-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenum-scheduler
62 lines (51 loc) · 1.42 KB
/
enum-scheduler
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import sys
cyan = '\033[1;32m'
red = '\033[1;31m'
yellow = '\033[0;33m'
none = '\033[0m'
# SERVICE = [PORTS]
ftp = ["21"]
http = ["80", "8000", "8080", "3000", "5080"] # 5985 == inutile
https = ["443", "8443", "8081"] # , "5986"]
rpc = ["111"]
msrpc = ["135", "593"]
smb = ["445"]
snmp = ["161", "162"]
dns = ["53", "5353"]
def check_args (ac, av):
if ac != 3:
print(red + "Usage: enum-scheduler <IP> \"port1,port2,port3,...,portN\"")
sys.exit(2)
def schedule (ip, port):
if port in ftp:
os.system("enum-ftp {}".format(ip))
elif port in http:
os.system("enum-http {} {}".format(ip, port))
elif port in https:
os.system("enum-https {} {}".format(ip, port))
elif port in smb:
os.system("enum-smb {}".format(ip))
elif port in snmp:
os.system("enum-snmp {}".format(ip))
elif port in dns:
os.system("enum-dns {} {}".format(ip, port))
elif port in rpc:
print("https://book.hacktricks.xyz/pentesting/pentesting-rpcbind")
os.system("enum-rpc {}".format(ip))
elif port in msrpc:
print("https://book.hacktricks.xyz/pentesting/135-pentesting-msrpc")
os.system("enum-msrpc {} {}".format(ip, port))
def main (argc, argv):
check_args(argc, argv)
os.setuid(0)
os.setgid(0)
ip = argv[1]
ports = argv[2].split(',')
print(red + "ports: {}".format(ports))
for port in ports:
schedule(ip, port)
if __name__ == '__main__':
main(len(sys.argv), sys.argv)