KeenSecurityLab / BinAbsInspector

BinAbsInspector: Vulnerability Scanner for Binaries
GNU General Public License v3.0
1.58k stars 231 forks source link

headless mode #57

Closed now4yreal closed 2 years ago

now4yreal commented 2 years ago

My command is : analyzeHeadless ./bai bai_2022_09_09 -import ./test2 -postScript BinAbsInspector "@@ -all" And i get the error followed: root@3893d60a101e:/bai# analyzeHeadless ./bai bai_2022_09_09 -import ./test2 -postScript BinAbsInspector "@@ -all" openjdk version "17.0.4.1" 2022-08-12 OpenJDK Runtime Environment Temurin-17.0.4.1+1 (build 17.0.4.1+1) OpenJDK 64-Bit Server VM Temurin-17.0.4.1+1 (build 17.0.4.1+1, mixed mode) INFO Using log config file: jar:file:/bai/ghidra_10.1.2_PUBLIC/Ghidra/Framework/Generic/lib/Generic.jar!/generic.log4j.xml (LoggingInitialization) INFO Using log file: /root/.ghidra/.ghidra_10.1.2_PUBLIC/application.log (LoggingInitialization) INFO Loading user preferences: /root/.ghidra/.ghidra_10.1.2_PUBLIC/preferences (Preferences) INFO Loading previous preferences: /root/.ghidra/.ghidra_10.1.5_PUBLIC/preferences (Preferences) INFO Class search complete (1497 ms) (ClassSearcher) INFO Initializing SSL Context (SSLContextInitializer) INFO Initializing Random Number Generator... (SecureRandomFactory) INFO Random Number Generator initialization complete: NativePRNGNonBlocking (SecureRandomFactory) INFO Trust manager disabled, cacerts have not been set (ApplicationTrustManagerFactory) INFO HEADLESS Script Paths: /bai/ghidra_10.1.2_PUBLIC/Ghidra/Features/MicrosoftCodeAnalyzer/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Features/Base/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Processors/DATA/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Features/FileFormats/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Debug/Debugger/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Processors/PIC/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Debug/Debugger-agent-dbgmodel-traceloader/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Features/Python/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Features/BytePatterns/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Extensions/BinAbsInspector/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Features/Decompiler/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Processors/8051/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Features/FunctionID/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Features/VersionTracking/ghidra_scripts /bai/ghidra_10.1.2_PUBLIC/Ghidra/Features/GnuDemangler/ghidra_scripts (HeadlessAnalyzer) ERROR REPORT SCRIPT ERROR: BinAbsInspector : Missing plugin needed to run scripts of this type. Please ensure you have installed the necessary plugin. (HeadlessAnalyzer) ERROR Abort due to Headless analyzer error: Invalid script: BinAbsInspector (HeadlessAnalyzer) java.lang.IllegalArgumentException: Invalid script: BinAbsInspector at ghidra.app.util.headless.HeadlessAnalyzer.checkScript(HeadlessAnalyzer.java:788) at ghidra.app.util.headless.HeadlessAnalyzer.checkScriptsList(HeadlessAnalyzer.java:801) at ghidra.app.util.headless.HeadlessAnalyzer.compileScripts(HeadlessAnalyzer.java:835) at ghidra.app.util.headless.HeadlessAnalyzer.processLocal(HeadlessAnalyzer.java:408) at ghidra.app.util.headless.AnalyzeHeadless.launch(AnalyzeHeadless.java:121) at ghidra.GhidraLauncher.launch(GhidraLauncher.java:59) at ghidra.Ghidra.main(Ghidra.java:47)

I have tried many methods but failed in the end, could you please help me? thanks a lot

torabi12 commented 2 years ago

I think your Java version is not OK for ghidra 10.1.2. Check the ghidra's requirements for this old version.

It is just an idea.

MatthewShao commented 2 years ago

The message shows that you did not install the extension correctly, please see: https://github.com/googleinterns/ghidra-nsis-extension#installing-the-extension

now4yreal commented 2 years ago

I don't konw why but finally I solved this by running analyzeheadless in the folder of ghidra :(

Anyway thank you all for helping me!