pry0cc / axiom

The dynamic infrastructure framework for everybody! Distribute the workload of many different scanning tools with ease, including nmap, ffuf, masscan, nuclei, meg and many more!
MIT License
4.06k stars 645 forks source link

naabu_nmap module merge results is error #695

Closed ghost closed 1 year ago

ghost commented 1 year ago

i use command axiom-scan tmp -m naabu-nmap -p - -rate 10000 -c 50 -nmap-cli 'nmap -Pn -sV -oX output/nmap.xml' -o out/

The scanning process of nmap is normal, but the merged results are not as expected. final_naabu contains other unexpected content.

The contents of the final output directory are as follows.

10192594 out/final_naabu.txt
       50 out/final_nmap.xml
      389 out/final_nmap.xml.html
        5 out/naabu.txt
        2 out/naabu.txt.~1~
        1 out/naabu.txt.~2~
       62 out/nmap.xml
       32 out/nmap.xml.~1~
       21 out/nmap.xml.~2~

can you help me?

This is the program's return message.

Mode set to directory... Merging directories...
Merging naabu and nmap output
cat: ./Tools/testssl/etc/DST: No such file or directory
cat: Root: No such file or directory
cat: CA: No such file or directory
cat: X3.txt: No such file or directory
cat: ./Tools/testssl.sh/etc/DST: No such file or directory
cat: Root: No such file or directory
cat: CA: No such file or directory
cat: X3.txt: No such file or directory
cat: ./go/pkg/mod/github.com/lor00x/goldap@v0.0.0-20180618054307-a546dffdd1a3/doc/RFC: No such file or directory
cat: 4514: No such file or directory
cat: LDAP: No such file or directory
cat: String: No such file or directory
cat: Representation: No such file or directory
cat: of: No such file or directory
cat: Distinguished: No such file or directory
cat: Names.txt: No such file or directory
cat: ./go/pkg/mod/github.com/lor00x/goldap@v0.0.0-20180618054307-a546dffdd1a3/doc/RFC: No such file or directory
cat: 4512: No such file or directory
cat: LDAP: No such file or directory
cat: Directory: No such file or directory
cat: Information: No such file or directory
cat: Models.txt: No such file or directory
cat: ./go/pkg/mod/github.com/lor00x/goldap@v0.0.0-20180618054307-a546dffdd1a3/doc/RFC: No such file or directory
cat: 4511: No such file or directory
cat: LDAP: No such file or directory
cat: The: No such file or directory
cat: Protocol.txt: No such file or directory
Merging Nmap XML output...
2023-03-14 15:27:10,465 - DEBUG - Adding: 'out/nmap.xml'
2023-03-14 15:27:10,468 - DEBUG - Parsing: 'out/nmap.xml'
Done: 'Merging both naabu ouput and nmap'

and --debug model return this

###########################################################################################################
#  After downloading all the results merge the output
#
merge_output
+ merge_output
+ [[ '' != \t\r\u\e ]]
+ '[' -f out/ ']'
+ [[ '' == \t\x\t ]]
+ [[ '' == \x\m\l ]]
+ [[ '' == \c\s\v ]]
+ [[ '' == '' ]]
+ echo 'Mode set to directory... Merging directories...'
Mode set to directory... Merging directories...
+ mkdir /root/.axiom/tmp/naabu-nmap+167880819627457/merge
+ xargs -0 '-I{}' cp --backup=t '{}' /root/.axiom/tmp/naabu-nmap+167880819627457/merge
+ find /root/.axiom/tmp/naabu-nmap+167880819627457/output -type f -print0
++ wc -l
++ ls /root/.axiom/tmp/naabu-nmap+167880819627457/merge
+ output_lines=5
+ '[' -f out/ ']'
+ mv /root/.axiom/tmp/naabu-nmap+167880819627457/merge out/
+ [[ naabu-nmap == \g\o\w\i\t\n\e\s\s ]]
+ [[ naabu-nmap == \n\a\a\b\u\-\n\m\a\p ]]
+ echo 'Merging naabu and nmap output'
Merging naabu and nmap output
+ xargs cat
+ sort -u
+ find . -name '*.txt'
cat: ./Tools/testssl/etc/DST: No such file or directory
cat: Root: No such file or directory
cat: CA: No such file or directory
cat: X3.txt: No such file or directory
cat: ./Tools/testssl.sh/etc/DST: No such file or directory
cat: Root: No such file or directory
cat: CA: No such file or directory
cat: X3.txt: No such file or directory
cat: ./go/pkg/mod/github.com/lor00x/goldap@v0.0.0-20180618054307-a546dffdd1a3/doc/RFC: No such file or directory
cat: 4514: No such file or directory
cat: LDAP: No such file or directory
cat: String: No such file or directory
cat: Representation: No such file or directory
cat: of: No such file or directory
cat: Distinguished: No such file or directory
cat: Names.txt: No such file or directory
cat: ./go/pkg/mod/github.com/lor00x/goldap@v0.0.0-20180618054307-a546dffdd1a3/doc/RFC: No such file or directory
cat: 4512: No such file or directory
cat: LDAP: No such file or directory
cat: Directory: No such file or directory
cat: Information: No such file or directory
cat: Models.txt: No such file or directory
cat: ./go/pkg/mod/github.com/lor00x/goldap@v0.0.0-20180618054307-a546dffdd1a3/doc/RFC: No such file or directory
cat: 4511: No such file or directory
cat: LDAP: No such file or directory
cat: The: No such file or directory
cat: Protocol.txt: No such file or directory
+ echo 'Merging Nmap XML output...'
Merging Nmap XML output...
+ /root/.axiom/interact/merge-xml.py -d out/ -o out//final_nmap.xml
2023-03-14 15:42:25,017 - DEBUG - Adding: 'out/final_nmap.xml'
2023-03-14 15:42:25,018 - DEBUG - Adding: 'out/nmap.xml'
2023-03-14 15:42:25,023 - DEBUG - Parsing: 'out/final_nmap.xml'
2023-03-14 15:42:25,028 - DEBUG - Parsing: 'out/nmap.xml'
+ '[' -f out/ ']'
+ echo -e '\033[0;32mDone: '\''\033[0;34mMerging both naabu ouput and nmap\033[0m'\'''
Done: 'Merging both naabu ouput and nmap'
0xtavian commented 1 year ago

Yea the merging code for that module doesn’t work unfortunately @Curta7n
https://github.com/pry0cc/axiom/blob/master/interact/axiom-scan#L342

ghost commented 1 year ago

okay。so sad。 I used another method to complete the merging work.

find $LOGPATH -name "*.txt" | xargs cat | sort -u > ~/out/final_naabu.txt
find $LOGPATH -name nmap.xml | awk '{printf "cp %s ~/out/%d.xml\n", $1, NR}' | sh
python3 $AXIOM_PATH/interact/merge-xml.py -d ~/out -o ~/out/final_nmap.xml`
0xtavian commented 1 year ago

Feel free to submit a PR :)