NavigationSyndicateUser login |
EAR SearchThe "EAR Search" tool searches for text and regular expressions within a given JAVA archive file (EAR, WAR, JAR and ZIP). The tool does recursively search within included archive files. Command syntax is very simple, similar to grep: Syntax: java -jar EARScanner.jar [-c] [-E] [-k] [-n] fileToAnalyze searchPattern -c: search within comments (following java.util.Properties definition) -E: treat searchPattern as a regular expression -k: keep exploded files and directories -n: show line number This small utility is written in JAVA and runs on JAVA 1.4 and upper versions. Download EAR Search
Details on the Search Algorithm
Sample OutputThis tool can be used for example to search IP addresses inside an EAR file, using the classic regular expression "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}". Update: for IPv4 address in decimal format, use this regular expression "((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]? \d)". D:\>java -jar EARSearch.jar -n -E testcase3.ear "\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" EAR File: testcase3.ear (2122 bytes). Search for (in '): '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}' EAR explosion process starts at Fri Apr 11 22:56:07 GMT 2014. Options: -E -n Exploding directory: D:\testcase3.ear_ testcase3.ear_\FileUNIXDir\FileUNIX.txt:16:1.23.4.5 is an IP testcase3.ear_\FileUNIXDir\FileUNIX.txt:17:1.23.4.5 and 2.33.44.5 are IPs testcase3.ear_\FileUNIXDir\FileUNIX.txt:18:1.23.4.5 end testcase3.ear_\FileUNIXDir\FileUNIX.txt:19:2.23.4.5 testcase3.ear_\FileUNIXDir\FileUNIX.txt:21:start 3.23.4.5 testcase3.ear_\FileWindows.war_\FileWindows.txt:16:1.23.4.5 is an IP testcase3.ear_\FileWindows.war_\FileWindows.txt:17:1.23.4.5 and 2.33.44.5 are IPs testcase3.ear_\FileWindows.war_\FileWindows.txt:18:1.23.4.5 end testcase3.ear_\FileWindows.war_\FileWindows.txt:19:2.23.4.5 testcase3.ear_\FileWindows.war_\FileWindows.txt:21:start 3.23.4.5 testcase3.ear_\TestIPs.txt:2:IP1: 1.2.3.4 testcase3.ear_\TestIPs.txt:4:IP3: 123.234.345.456 for example Search completed. Files searched: 5 (2343 bytes). Files matching: 3. Lines matching: 12 D:\> Version History
|