forked from stick-fish/nosey_neighbour
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsmb.py
38 lines (33 loc) · 1.44 KB
/
smb.py
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
#!/usr/bin/python
import sys, os, time
target = str(sys.argv[1])
def smb_windows_share(smb1_port):
cmd600 = 'enum4linux -a -M -l ' + target + ' |tee enum4linux.txt'
cmd601 = 'smbmap -H ' + target + ' -P 139 | tee -a smbmap.txt'
cmd602 = 'smbmap -H ' + target + ' -P 139 -R | tee -a smbmap.txt'
cmd603 = 'smbclient -L\\ -N -I ' + target + '| tee -a smbclient.txt'
print('[+] Running Windows Share Enumeration... ')
os.system(cmd600)
os.system(cmd601)
os.system(cmd602)
os.system(cmd603)
def smb_windows_domain(smb2_port):
cmd610 = 'enum4linux -a -M -l ' + target + ' |tee enum4linux.txt'
cmd611 = 'smbmap -H ' + target + ' -P 445 | tee -a smbmap.txt'
cmd612 = 'smbmap -H ' + target + ' -P 445 -R | tee -a smbmap.txt'
cmd613 = 'smbmap -H ' + target + ' -P 445 -x "ipconfig /all" | tee -a smbmap.txt'
cmd614 = 'smbclient -L\\ -N -I ' + target + ' | tee -a smbclient.txt'
print('[+] Running Windows Domain Enumeration... ')
os.system(cmd610)
os.system(cmd611)
os.system(cmd612)
os.system(cmd613)
os.system(cmd614)
def smb_windows_rpc(smb0_port):
cmd620 = 'sslscan --show-certificate --no-colour ' + target
cmd621 = 'rcpclient -U "" ' + target + ' -c "srvinfo;enumdomusers;getdompwinfo;querydominfo;netshareenum;netshareenumall"'
cmd622 = 'nmap -vv --reason -Pn -sV -p 135 --script="banner,msrpc-enum,rpc-grind,rpcinfo" -oA "rpc_nmap" ' + target
print('[+] Running Windows RPC Enumeration... ')
os.system(cmd620)
os.system(cmd621)
os.system(cmd622)