Title: smbrecon.py- recon_scan tool used and required in Penetration TestingAuthor: ajayverma
import sys
import subprocess

if len(sys.argv) != 2:
print "Usage: smbrecon.py <ip address>"

ip = sys.argv[1]
NBTSCAN = "python samrdump.py %s" % (ip)
nbtresults = subprocess.check_output(NBTSCAN, shell=True)
if ("Connection refused" not in nbtresults) and ("Connect error" not in nbtresults) and ("Connection reset" not in nbtresults):
print "[*] SAMRDUMP User accounts/domains found on " + ip
lines = nbtresults.split("\n")
for line in lines:
if ("Found" in line) or (" . " in line):
print " [+] " + line

Submitted On: 2019-06-26 09:24:54