sethsec / celerystalk

An asynchronous enumeration & vulnerability scanner. Run all the tools on all the hosts.
https://sethsec.github.io/celerystalk/
MIT License
397 stars 69 forks source link

Nmap scan results are not saved #132

Closed cwaazywabbit closed 4 years ago

cwaazywabbit commented 4 years ago

So I have the following in my config file

tcp_scan              : nmap [TARGET] -n -sV -Pn -p- -T5

but when you run ./celerystalk nmap then do ./celerystalk query brief, you would see this:

[+] Completed Tasks (8) (Only showing last 5 when in brief mode):

  [Duration][    IP     ] command...
  [00:03:48][  xyz1.de   ] nmap xyz1.de  -n -sV -Pn -p- -T5 -oA /root/xxx/xyz1.de/xyz1.de_nmap_tcp_scan.txt
  [00:04:32][     10.35.100.103      ] nmap 10.35.100.103  -n -sV -Pn -p- -T5 -oA /root/xxx/10.35.100.103/10.35.100.103_nmap_tcp_scan.txt
  [00:04:00][     10.35.100.202      ] nmap 10.35.100.202  -n -sV -Pn -p- -T5 -oA /root/xxx/10.35.100.202/10.35.100.202_nmap_tcp_scan.txt
  [00:03:58][     10.35.100.214      ] nmap 10.35.100.214  -n -sV -Pn -p- -T5 -oA /root/xxx/10.35.100.214/10.35.100.214_nmap_tcp_scan.txt
  [00:03:48][      10.35.100.94      ] nmap 10.35.100.94  -n -sV -Pn -p- -T5 -oA /root/xxx/10.35.100.94/10.35.100.94_nmap_tcp_scan.txt
[...]

however, no files are written :-/ Lo-and-behold what's really being executed

# ps aux | grep nmap
root       18169  3.8  0.4  60880 46396 pts/2    S    15:33   0:05 /usr/bin/nmap -oX - -vvv --stats-every 1s -n -sV -Pn -p- -T5 xyz1.de
root       18170  3.7  0.4  60868 46572 pts/2    S    15:33   0:04 /usr/bin/nmap -oX - -vvv --stats-every 1s -n -sV -Pn -p- -T5 xyz2.de
root       18171  3.7  0.4  58804 46116 pts/2    S    15:33   0:05 /usr/bin/nmap -oX - -vvv --stats-every 1s -n -sV -Pn -p- -T5 10.35.100.202
root       18172  5.7  0.4  58700 46300 pts/2    S    15:33   0:07 /usr/bin/nmap -oX - -vvv --stats-every 1s -n -sV -Pn -p- -T5 10.35.100.103
root       18173  3.7  0.4  60832 46424 pts/2    S    15:33   0:05 /usr/bin/nmap -oX - -vvv --stats-every 1s -n -sV -Pn -p- -T5 xyz3.de
root       18174  5.5  0.4  60992 46336 pts/2    S    15:33   0:07 /usr/bin/nmap -oX - -vvv --stats-every 1s -n -sV -Pn -p- -T5 xyz4.de
joeminicucci commented 4 years ago

Same problem here, thanks for your time @sethsec

sethsec commented 4 years ago

I'm going to look at this tonight. Just an FYI, the reason I have not gotten to this yet is because I almost always run nmap outside of celerystalk and just import the xml using the import command. That said, I'm hoping this is an easy fix.

cwaazywabbit commented 4 years ago

We're just lazy, Seth ;)

Thanks for looking into this.

sethsec commented 4 years ago

@cwaazywabbit or @joeminicucci - I think i fixed this. Either of your brave enough to checkout the dev branch and test it out? :)

cwaazywabbit commented 4 years ago

Yup, looks to be working 👍

# ps aux | grep nmap
root        5698  1.0  0.0   2392   704 pts/2    S    11:58   0:00 /bin/sh -c nmap 194.127.138.51  -n -sV -Pn -p- -T5 -oA /root/Desktop/results/194.127.138.51/194.127.138.51_nmap_tcp_scan
root        5699  0.6  0.0   2392   760 pts/2    S    11:58   0:00 /bin/sh -c nmap 194.127.138.48  -n -sV -Pn -p- -T5 -oA /root/Desktop/results/194.127.138.48/194.127.138.48_nmap_tcp_scan
root        5700  0.5  0.0   2392   760 pts/2    S    11:58   0:00 /bin/sh -c nmap 194.127.138.151  -n -sV -Pn -p- -T5 -oA /root/Desktop/results/194.127.138.151/194.127.138.151_nmap_tcp_scan
root        5701  0.5  0.0   2392   704 pts/2    S    11:58   0:00 /bin/sh -c nmap 194.127.138.152  -n -sV -Pn -p- -T5 -oA /root/Desktop/results/194.127.138.152/194.127.138.152_nmap_tcp_scan
root        5702  0.4  0.0   2392   764 pts/2    S    11:58   0:00 /bin/sh -c nmap 194.127.138.56  -n -sV -Pn -p- -T5 -oA /root/Desktop/results/194.127.138.56/194.127.138.56_nmap_tcp_scan
root        5703  0.5  0.0   2392   708 pts/2    S    11:58   0:00 /bin/sh -c nmap 194.127.138.50  -n -sV -Pn -p- -T5 -oA /root/Desktop/results/194.127.138.50/194.127.138.50_nmap_tcp_scan
root        5704  9.3  0.4  57612 42780 pts/2    S    11:58   0:01 nmap 194.127.138.48 -n -sV -Pn -p- -T5 -oA /root/Desktop/results/194.127.138.48/194.127.138.48_nmap_tcp_scan
root        5705 11.6  0.4  58808 43724 pts/2    S    11:58   0:01 nmap 194.127.138.51 -n -sV -Pn -p- -T5 -oA /root/Desktop/results/194.127.138.51/194.127.138.51_nmap_tcp_scan
root        5706  9.2  0.4  57632 42712 pts/2    S    11:58   0:01 nmap 194.127.138.50 -n -sV -Pn -p- -T5 -oA /root/Desktop/results/194.127.138.50/194.127.138.50_nmap_tcp_scan
root        5707 11.6  0.4  57596 42752 pts/2    S    11:58   0:01 nmap 194.127.138.151 -n -sV -Pn -p- -T5 -oA /root/Desktop/results/194.127.138.151/194.127.138.151_nmap_tcp_scan
root        5708  9.0  0.4  57620 42808 pts/2    S    11:58   0:01 nmap 194.127.138.56 -n -sV -Pn -p- -T5 -oA /root/Desktop/results/194.127.138.56/194.127.138.56_nmap_tcp_scan
root        5709  9.1  0.4  57476 42600 pts/2    S    11:58   0:01 nmap 194.127.138.152 -n -sV -Pn -p- -T5 -oA /root/Desktop/results/194.127.138.152/194.127.138.152_nmap_tcp_scan
root        5848  0.0  0.0   6156   840 pts/3    S+   11:59   0:00 grep --color=auto nmap
# ll /root/Desktop/results/194.127.138.51/194.127.138.51_nmap_tcp_scan*
-rw-r--r-- 1 root root  441 May  7 12:00 /root/Desktop/results/194.127.138.51/194.127.138.51_nmap_tcp_scan.gnmap
-rw-r--r-- 1 root root  563 May  7 12:00 /root/Desktop/results/194.127.138.51/194.127.138.51_nmap_tcp_scan.nmap
-rw-r--r-- 1 root root 1703 May  7 12:00 /root/Desktop/results/194.127.138.51/194.127.138.51_nmap_tcp_scan.xml