Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #83 from sethsec/issue-82-nmap-output-not-saved
Browse files Browse the repository at this point in the history
Issue 82 nmap output not saved
  • Loading branch information
sethsec authored May 2, 2019
2 parents 6ed3ef6 + 813e50c commit 6448a8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion celerystalk
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ import csv

from lib.nmap import nmapcommand

build=str(164)
build=str(166)

def print_banner():

Expand Down
12 changes: 9 additions & 3 deletions lib/nmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,21 @@ def nmap_scan_subdomain_host(vhost,workspace,simulation,output_base_dir,config_f
config.read(['config.ini'])

vhost_explicitly_out_of_scope = lib.db.is_vhost_explicitly_out_of_scope(vhost, workspace)
output_file = os.path.normpath(os.path.join(output_base_dir, vhost,vhost + "_nmap_tcp_scan.txt"))
output_host_dir = os.path.normpath(os.path.join(output_base_dir, vhost))
try:
os.stat(output_host_dir)
except:
os.makedirs(output_host_dir)

output_file = os.path.normpath(os.path.join(output_host_dir, vhost + "_nmap_tcp_scan.txt"))
if not vhost_explicitly_out_of_scope:
#print(config_nmap_options)
cmd_name = "nmap_tcp_scan"
try:
if not simulation:
populated_command = "nmap " + vhost + config_nmap_options + " -oN " + output_file
populated_command = "nmap " + vhost + config_nmap_options + " -oA " + output_file
else:
populated_command = "#nmap " + vhost + config_nmap_options + " -oN " + output_file
populated_command = "#nmap " + vhost + config_nmap_options + " -oA " + output_file
except TypeError:
print("[!] Error: In the config file, there needs to be one, and only one, enabled tcp_scan command in the nmap_commands section.")
print("[!] This determines what ports to scan.")
Expand Down

0 comments on commit 6448a8e

Please sign in to comment.