You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+20-11
Original file line number
Diff line number
Diff line change
@@ -3,16 +3,16 @@
3
3
log4j2-scan is a single binary command-line tool for CVE-2021-44228 vulnerability scanning and mitigation patch. It also supports nested JAR file scanning and patch. It also detects CVE-2021-45046 (log4j 2.15.0), CVE-2021-45105 (log4j 2.16.0), CVE-2021-4104 (log4j 1.x), and CVE-2021-42550 (logback 0.9-1.2.7) vulnerabilities.
* If you get `VCRUNTIME140.dll not found` error, install [Visual C++ Redistributable](https://docs.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170).
9
9
* If native executable doesn't work, use the JAR instead. 32bit is not supported.
10
10
* 7zip is available from www.7zip.org, and is open source and free.
With --scan-log4j1 option, it also removes JMSAppender.class, SocketServer.class, SMTPAppender.class, SMTPAppender$1.class
42
42
--force-fix
43
43
Do not prompt confirmation. Don't use this option unless you know what you are doing.
44
+
--restore [backup_file_path]
45
+
Unfix JAR files using zip archived file.
44
46
--all-drives
45
47
Scan all drives on Windows
46
48
--drives c,d
47
49
Scan specified drives on Windows. Spaces are not allowed here.
48
50
--no-symlink
49
51
Do not detect symlink as vulnerable file.
50
52
--exclude [path_prefix]
51
-
Full paths of directories whose absolute path starts with the specified value will be excluded. Does not support relative paths. You can specify multiple --exclude [path_prefix] pairs
53
+
Full paths of directories whose absolute path starts with the specified value will be excluded.
54
+
Does not support relative paths. You can specify multiple --exclude [path_prefix] pairs
52
55
--exclude-config [config_file_path]
53
56
Specify exclude path list in text file. Paths should be separated by new line. Prepend # for comment.
54
57
--exclude-pattern [pattern]
55
-
Exclude specified paths of directories by pattern. Supports fragments. You can specify multiple --exclude-pattern [pattern] pairs (non regex)
58
+
Exclude specified paths of directories by pattern. Supports fragments.
59
+
You can specify multiple --exclude-pattern [pattern] pairs (non regex)
56
60
--exclude-fs nfs,tmpfs
57
61
Exclude paths by file system type. nfs, nfs3, nfs4, cifs, tmpfs, devtmpfs, fuse.sshfs and iso9660 is ignored by default.
62
+
--syslog-udp [host:port]
63
+
Send alert to remote syslog host for vulnerable or potentially vulnerable binaries
58
64
--report-csv
59
65
Generate log4j2_scan_report_yyyyMMdd_HHmmss.csv in working directory if not specified otherwise via --report-path [path]
If you add `--fix` option, this program will copy vulnerable original JAR file to .bak file, and create new JAR file without `org/apache/logging/log4j/core/lookup/JndiLookup.class` entry. In most environments, JNDI lookup feature will not be used. However, you must use this option at your own risk. Depending the Operating System:
99
+
If you add `--fix` option, this program will copy vulnerable original JAR file to .bak file, and create new JAR file without `org/apache/logging/log4j/core/lookup/JndiLookup.class` entry. All .bak files are archived into the single zip file which is named by `log4j2_scan_backup_yyyyMMdd_HHmmss.zip`, then deleted safely. In most environments, JNDI lookup feature will not be used. However, you must use this option at your own risk. You can easily restore original vulnerable JAR files using `--restore` option.
100
+
101
+
Depending the Operating System:
94
102
95
103
- Windows: It is necessary to shutdown any running JVM process before applying patch due to lock files. Start affected JVM process after fix.
96
104
- Linux/macOS: Apply patch, restart the JVM after
@@ -127,6 +135,7 @@ Run in 5 steps:
127
135
4. Compare log4j2 version and print vulnerable version.
128
136
5. If --fix option is used, backup vulnerable file and patch it.
129
137
* For example, original vulnerable.jar is copied to vulnerable.jar.bak
138
+
6. Archive all backup files into the zip file `log4j2_scan_backup_yyyyMMdd_HHmmss.zip`, then delete .bak files.
System.out.println("\tUnfix JAR files using zip archived file.");
70
73
System.out.println("--all-drives");
71
74
System.out.println("\tScan all drives on Windows");
72
75
System.out.println("--drives c,d");
73
76
System.out.println("\tScan specified drives on Windows. Spaces are not allowed here.");
74
77
System.out.println("--no-symlink");
75
78
System.out.println("\tDo not detect symlink as vulnerable file.");
76
79
System.out.println("--exclude [path_prefix]");
77
-
System.out.println("\tFull paths of directories whose absolute path starts with the specified value will be excluded. Does not support relative paths. You can specify multiple --exclude [path_prefix] pairs");
80
+
System.out.println("\tFull paths of directories whose absolute path starts with the specified value will be excluded.\n"
81
+
+ "\tDoes not support relative paths. You can specify multiple --exclude [path_prefix] pairs");
0 commit comments