Skip to content

Commit

Permalink
building version 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
maldevel committed Jul 26, 2020
1 parent f34c1c8 commit 08e3eec
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 58 deletions.
16 changes: 9 additions & 7 deletions intelspy.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ def _quit():
CommandsFile = ''
ManualCommandsFile = ''

username_wordlist = '/usr/share/seclists/Usernames/top-usernames-shortlist.txt'
password_wordlist = '/usr/share/seclists/Passwords/darkweb2017-top100.txt'

CurrentDateTime = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
DbConnection = None

Expand Down Expand Up @@ -249,8 +252,6 @@ def calculate_elapsed_time(start_time):
#####################################################################################################################

def loadprofiles(live_host_scan_profiles_file, port_scan_profiles_file):
username_wordlist = '/usr/share/seclists/Usernames/top-usernames-shortlist.txt'
password_wordlist = '/usr/share/seclists/Passwords/darkweb2017-top100.txt'

with open(os.path.join(RootDir, 'profiles', live_host_scan_profiles_file), 'r') as p:
try:
Expand Down Expand Up @@ -295,14 +296,13 @@ def loadprofiles(live_host_scan_profiles_file, port_scan_profiles_file):

if 'username_wordlist' in service_scans_profiles:
if isinstance(service_scans_profiles['username_wordlist'], str):
username_wordlist = service_scans_profiles['username_wordlist']
uw = service_scans_profiles['username_wordlist']

if 'password_wordlist' in service_scans_profiles:
if isinstance(service_scans_profiles['password_wordlist'], str):
password_wordlist = service_scans_profiles['password_wordlist']
pw = service_scans_profiles['password_wordlist']

return live_host_scan_profiles, port_scan_profiles, service_scans_profiles, global_patterns, username_wordlist, \
password_wordlist
return live_host_scan_profiles, port_scan_profiles, service_scans_profiles, global_patterns, uw, pw


#####################################################################################################################
Expand Down Expand Up @@ -1937,8 +1937,10 @@ def parseargs(psps: [], psp_config_file: string, lhsps: [], lhsp_config_file: st
port_scan_profiles_file = 'port-scan-profiles.toml'
live_host_scan_profiles_file = 'live-host-scan-profiles.toml'

lhsps, psps, ssps, gp, uw, pw = loadprofiles(live_host_scan_profiles_file, port_scan_profiles_file)
lhsps, psps, ssps, gp, username_wordlist, password_wordlist = loadprofiles(live_host_scan_profiles_file,
port_scan_profiles_file)

print(username_wordlist)
intelArgs = parseargs(psps, port_scan_profiles_file, lhsps, live_host_scan_profiles_file)

if intelArgs.errors:
Expand Down
68 changes: 17 additions & 51 deletions profiles/port-scan-profiles.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[default.nmap-top-1000-udp]

[default.nmap-top-1000-udp.service-detection]
command = 'nmap {nmap_extra} -sU -sV -n -Pn -vv --top-ports 1000 --open -T{nmap_speed} -oA "{topudpportsdir}/{address}_nmap_top_1000_udp" {address}'
command = 'nmap {nmap_extra} -sU -sV -n -Pn --defeat-icmp-ratelimit -vv --top-ports 1000 --open -T{nmap_speed} -oA "{topudpportsdir}/{address}_nmap_top_1000_udp" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[default.nmap-full-tcp]
Expand All @@ -22,14 +22,14 @@
command = 'nmap {nmap_extra} -sS -vv -A -Pn --osscan-guess --version-all -p{ports} -T{nmap_speed} -oA "{tcpservicesdir}/{address}_nmap_full_tcp_services" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[default.nmap-3000-udp]
[default.nmap-full-udp]

[default.nmap-3000-udp.port-scan]
command = 'nmap {nmap_extra} -sU -vv -n -Pn --top-ports 3000 --open -T{nmap_speed} -oA "{topudpportsdir}/{address}_nmap_top_3000_udp" {address}'
[default.nmap-full-udp.port-scan]
command = 'nmap {nmap_extra} -sU -vv -n -Pn --defeat-icmp-ratelimit -p- --open -T{nmap_speed} -oA "{fulludpportsdir}/{address}_nmap_full_udp" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[default.nmap-3000-udp.service-detection]
command = 'nmap {nmap_extra} -sU -vv -A -Pn --osscan-guess --version-all -p{ports} -T{nmap_speed} -oA "{udpservicesdir}/{address}_nmap_top_3000_udp_services" {address}'
[default.nmap-full-udp.service-detection]
command = 'nmap {nmap_extra} -sU -vv -A -Pn --defeat-icmp-ratelimit --osscan-guess --version-all -p{ports} -T{nmap_speed} -oA "{udpservicesdir}/{address}_nmap_full_udp_services" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[quick]
Expand All @@ -40,62 +40,28 @@
command = 'nmap {nmap_extra} -sS -sV --version-all -n -Pn -vv --top-ports 100 --open -T{nmap_speed} -oA "{toptcpportsdir}/{address}_nmap_top_100_tcp" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[quick.nmap-top-20-udp]

[quick.nmap-top-20-udp.service-detection]
command = 'nmap {nmap_extra} -sU -A --version-all -n -Pn -vv --top-ports 20 --open -T{nmap_speed} -oA "{topudpportsdir}/{address}_nmap_top_20_udp" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[quick.nmap-top-1000-tcp]

[quick.nmap-top-1000-tcp.port-scan]
command = 'nmap {nmap_extra} -sS -vv -n -Pn --top-ports 1000 --open -T{nmap_speed} -oA "{toptcpportsdir}/{address}_nmap_top_1000_tcp" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[quick.nmap-top-1000-tcp.service-detection]
command = 'nmap {nmap_extra} -sS -vv -A -Pn --osscan-guess --version-all -p{ports} -T{nmap_speed} -oA "{tcpservicesdir}/{address}_nmap_top_1000_tcp_services" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[quick.nmap-top-100-udp]

[quick.nmap-top-100-udp.port-scan]
command = 'nmap {nmap_extra} -sU -vv -n -Pn --top-ports 100 --open -T{nmap_speed} -oA "{topudpportsdir}/{address}_nmap_top_100_udp" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[quick.nmap-top-100-udp.service-detection]
command = 'nmap {nmap_extra} -sS -vv -A -Pn --osscan-guess --version-all -p{ports} -T{nmap_speed} -oA "{udpservicesdir}/{address}_nmap_top_100_udp_services" {address}'
command = 'nmap {nmap_extra} -sU -A --version-all --defeat-icmp-ratelimit --defeat-icmp-ratelimit -n -Pn -vv --top-ports 100 --open -T{nmap_speed} -oA "{topudpportsdir}/{address}_nmap_top_100_udp" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[extreme]
[quick.nmap-top-3000-tcp]

[extreme.nmap-top-1000-tcp]

[extreme.nmap-top-1000-tcp.service-detection]
command = 'nmap {nmap_extra} -sS -sV -n -Pn -vv --top-ports 1000 --open -T{nmap_speed} -oA "{toptcpportsdir}/{address}_nmap_top_1000_tcp" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[extreme.nmap-top-1000-udp]

[extreme.nmap-top-1000-udp.service-detection]
command = 'nmap {nmap_extra} -sU -sV -n -Pn -vv --top-ports 1000 --open -T{nmap_speed} -oA "{topudpportsdir}/{address}_nmap_top_1000_udp" {address}'
[quick.nmap-top-3000-tcp.port-scan]
command = 'nmap {nmap_extra} -sS -vv -n -Pn --top-ports 3000 --open -T{nmap_speed} -oA "{toptcpportsdir}/{address}_nmap_top_3000_tcp" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[extreme.nmap-full-tcp]

[extreme.nmap-full-tcp.port-scan]
command = 'nmap {nmap_extra} -sS -vv -n -Pn -p- --open -T{nmap_speed} -oA "{fulltcpportsdir}/{address}_nmap_full_tcp" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[extreme.nmap-full-tcp.service-detection]
command = 'nmap {nmap_extra} -sS -vv -A -Pn --osscan-guess --version-all -p{ports} -T{nmap_speed} -oA "{tcpservicesdir}/{address}_nmap_full_tcp_services" {address}'
[quick.nmap-top-3000-tcp.service-detection]
command = 'nmap {nmap_extra} -sS -vv -A -Pn --osscan-guess --version-all -p{ports} -T{nmap_speed} -oA "{tcpservicesdir}/{address}_nmap_top_3000_tcp_services" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[extreme.nmap-full-udp]
[quick.nmap-top-3000-udp]

[extreme.nmap-full-udp.port-scan]
command = 'nmap {nmap_extra} -sU -vv -n -Pn -p- --open -T{nmap_speed} -oA "{fulludpportsdir}/{address}_nmap_full_udp" {address}'
[quick.nmap-top-3000-udp.port-scan]
command = 'nmap {nmap_extra} -sU -vv -n -Pn --defeat-icmp-ratelimit --top-ports 3000 --open -T{nmap_speed} -oA "{topudpportsdir}/{address}_nmap_top_3000_udp" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

[extreme.nmap-full-udp.service-detection]
command = 'nmap {nmap_extra} -sS -vv -A -Pn --osscan-guess --version-all -p{ports} -T{nmap_speed} -oA "{udpservicesdir}/{address}_nmap_full_udp_services" {address}'
[quick.nmap-top-3000-udp.service-detection]
command = 'nmap {nmap_extra} -sU -vv -A -Pn --defeat-icmp-ratelimit --osscan-guess --version-all -p{ports} -T{nmap_speed} -oA "{udpservicesdir}/{address}_nmap_top_3000_udp_services" {address}'
pattern = '^(?P<port>\d+)\/(?P<protocol>(tcp|udp))(.*)open(\s*)(?P<service>[\w\-\/\?]+)(\s*)(?P<reason>[\w\-]+)(\s*)ttl(\s*)\d+(\s*)(?P<version>.*)$'

0 comments on commit 08e3eec

Please sign in to comment.