msfadmin@metasploitable:~# vim /etc/default/snmpd
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
为:
SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid 0.0.0.0'
msfadmin@metasploitable:~$ sudo /etc/init.d/snmpd restart
msfadmin@metasploitable:~$ netstat -antup | grep 161
(No info could be read for "-p": geteuid()=1000 but you should be root.)
udp 0 0 0.0.0.0:161 0.0.0.0:*
Metasploit Documentation: https://docs.metasploit.com/
msf6 > use auxiliary/scanner/snmp/snmp_enum
msf6 auxiliary(scanner/snmp/snmp_enum) > show options
Module options (auxiliary/scanner/snmp/snmp_enum):
Name Current Setting Required Description
---- --------------- -------- -----------
COMMUNITY public yes SNMP Community String
RETRIES 1 yes SNMP Retries
RHOSTS yes The target host(s), see https://docs.metasploit.com/docs/using-metasploit/ba
sics/using-metasploit.html
RPORT 161 yes The target port (UDP)
THREADS 1 yes The number of concurrent threads (max one per host)
TIMEOUT 1 yes SNMP Timeout
VERSION 1 yes SNMP Version <1/2c>
View the full module info with the info, or info -d command.
msf6 auxiliary(scanner/snmp/snmp_enum) > set RHOSTS 192.168.1.180
RHOSTS => 192.168.1.180
msf6 auxiliary(scanner/snmp/snmp_enum) > run
msf6 > use auxiliary/scanner/smb/smb_version
msf6 auxiliary(scanner/smb/smb_version) > set RHOSTS 192.168.1.56, 192.168.1.180
注意:
msf6 auxiliary(scanner/snmp/snmp_enum) > back
msf6 > use auxiliary/scanner/smb/smb_version
msf6 auxiliary(scanner/smb/smb_version) > show options
Module options (auxiliary/scanner/smb/smb_version):
Name Current Setting Required Description
---- --------------- -------- -----------
RHOSTS yes The target host(s), see https://docs.metasploit.com/docs/using-metasploit/basi
cs/using-metasploit.html
THREADS 1 yes The number of concurrent threads (max one per host)
View the full module info with the info, or info -d command.
\msf6 auxiliary(scanner/smb/smb_version) > et RHOSTS 192.168.1.56, 192.168.1.180
[-] Unknown command: et
msf6 auxiliary(scanner/smb/smb_version) > set RHOSTS 192.168.1.56, 192.168.1.180
RHOSTS => 192.168.1.56, 192.168.1.180
msf6 auxiliary(scanner/smb/smb_version) > run
msf6 > use auxiliary/scanner/smb/smb_enumshares
msf6 auxiliary(scanner/smb/smb_enumshares) > show options
Module options (auxiliary/scanner/smb/smb_enumshares):
Name Current Setting Required Description
---- --------------- -------- -----------
HIGHLIGHT_NAME_PATTERN username|password|user|pass| yes PCRE regex of resource names to highlight
Groups.xml
LogSpider 3 no 0 = disabled, 1 = CSV, 2 = table (txt), 3 = one li
ner (txt) (Accepted: 0, 1, 2, 3)
MaxDepth 999 yes Max number of subdirectories to spider
RHOSTS yes The target host(s), see https://docs.metasploit.co
m/docs/using-metasploit/basics/using-metasploit.ht
ml
SMBDomain . no The Windows domain to use for authentication
SMBPass no The password for the specified username
SMBUser no The username to authenticate as
Share no Show only the specified share
ShowFiles false yes Show detailed information when spidering
SpiderProfiles true no Spider only user profiles when share is a disk sha
re
SpiderShares false no Spider shares recursively
THREADS 1 yes The number of concurrent threads (max one per host
)
View the full module info with the info, or info -d command.
msf6 auxiliary(scanner/smb/smb_enumshares) > set RHOSTS 192.168.1.56
RHOSTS => 192.168.1.56
msf6 auxiliary(scanner/smb/smb_enumshares) > set SMBUser administrator
SMBUser => administrator
msf6 auxiliary(scanner/smb/smb_enumshares) > et SMBPass 123456
[-] Unknown command: et
msf6 auxiliary(scanner/smb/smb_enumshares) > set SMBPass 123456
SMBPass => 123456
msf6 auxiliary(scanner/smb/smb_enumshares) > run
注意:
msf6 auxiliary(scanner/smb/smb_enumshares) > back
msf6 > use auxiliary/scanner/smb/smb_lookupsid
msf6 auxiliary(scanner/smb/smb_lookupsid) > show options
Module options (auxiliary/scanner/smb/smb_lookupsid):
Name Current Setting Required Description
---- --------------- -------- -----------
MaxRID 4000 no Maximum RID to check
MinRID 500 no Starting RID to check
RHOSTS yes The target host(s), see https://docs.metasploit.com/docs/using-metasploit/ba
sics/using-metasploit.html
SMBDomain . no The Windows domain to use for authentication
SMBPass no The password for the specified username
SMBUser no The username to authenticate as
THREADS 1 yes The number of concurrent threads (max one per host)
Auxiliary action:
Name Description
---- -----------
LOCAL Enumerate local accounts
View the full module info with the info, or info -d command.
msf6 auxiliary(scanner/smb/smb_lookupsid) > set RHOSTS 192.168.1.56
RHOSTS => 192.168.1.56
msf6 auxiliary(scanner/smb/smb_lookupsid) > set SMBUser administrator
SMBUser => administrator
msf6 auxiliary(scanner/smb/smb_lookupsid) > set SMBPass 123456
SMBPass => 123456
msf6 auxiliary(scanner/smb/smb_lookupsid) > run