MCPcopy Create free account
hub / github.com/AutoRecon/AutoRecon / SMBMap

Class SMBMap

autorecon/default-plugins/smbmap.py:3–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1from autorecon.plugins import ServiceScan
2
3class SMBMap(ServiceScan):
4
5 def __init__(self):
6 super().__init__()
7 self.name = "SMBMap"
8 self.tags = ['default', 'safe', 'smb', 'active-directory']
9
10 def configure(self):
11 self.match_service_name(['^smb', '^microsoft\-ds', '^netbios'])
12
13 async def run(self, service):
14 if service.target.ipversion == 'IPv4':
15 await service.execute('smbmap -H {address} -P {port} 2>&1', outfile='smbmap-share-permissions.txt')
16 await service.execute('smbmap -u null -p "" -H {address} -P {port} 2>&1', outfile='smbmap-share-permissions.txt')
17 await service.execute('smbmap -H {address} -P {port} -r 2>&1', outfile='smbmap-list-contents.txt')
18 await service.execute('smbmap -u null -p "" -H {address} -P {port} -r 2>&1', outfile='smbmap-list-contents.txt')
19 await service.execute('smbmap -H {address} -P {port} -x "ipconfig /all" 2>&1', outfile='smbmap-execute-command.txt')
20 await service.execute('smbmap -u null -p "" -H {address} -P {port} -x "ipconfig /all" 2>&1', outfile='smbmap-execute-command.txt')

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected