asset-group / 5ghoul-5g-nr-attacks

GNU General Public License v2.0
484 stars 82 forks source link

Compiling 5Ghoul PoC Binary for New 5G Exploits #26

Closed qiqingh closed 2 days ago

qiqingh commented 1 week ago

When creating new exploit scripts (test cases) and saving them in the modules/exploits/5gnr_gnb folder, how do we compile these 5Ghoul PoC binaries? Can we compile them within the provided Docker container? If so, could you give me detailed steps or any necessary commands?

Thank you for your assistance!

qiqingh commented 2 days ago

I using the "sudo bin/5g_fuzzer --list-exploits" to compile and load the new exploits. But get the error below:

"g++ -x c++ -std=c++17 -fPIC -w -O3 -c -o modules/exploits/5gnr_gnb/mac_sch_mac_rlc_crash.o -I src/ -I libs/ -I libs/wireshark -I libs/wireshark/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include - In file included from :1:0: src/ModulesInclude.hpp:108:5: error: ‘string’ does not name a type; did you mean ‘GString’? string *state; ^~ GString "

I using the same template from the example exploit. I think this causes the .o not to be successfully compiled and further causes the .so not to be successfully compiled. I removed the example exploit's .so file, and the same compile error happened.

qiqingh commented 2 days ago

Solved by appending "#include using std::string; "