Skip to content

Commit

Permalink
Recursive pattern matching was broken, hopelfully fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnDEvans committed May 12, 2015
1 parent 8b61d8e commit 0a57fd9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions smbmap.py
Expand Up @@ -482,6 +482,7 @@ def output_shares(self, host, lsshare, lspath, verbose=True):
dirList = self.list_path(host, share, path, self.pattern, verbose)

if self.recursive:
print lsshare, lspath
if lsshare and lspath:
if self.pattern:
print '\t[+] Starting search for files matching \'%s\' on share %s.' % (self.pattern, lsshare)
Expand Down Expand Up @@ -753,7 +754,7 @@ def signal_handler(signal, frame):
sgroup.add_argument("-P", metavar="PORT", dest='port', type=int, default=445, help="SMB port (default 445)")

sgroup2 = parser.add_argument_group("Command Execution", "Options for executing commands on the specified host")
sgroup2.add_argument("-x", metavar="COMMAND", dest='command', help="Execute a command ex. 'ipconfig /r'")
sgroup2.add_argument("-x", metavar="COMMAND", dest='command', help="Execute a command ex. 'ipconfig /all'")

sgroup3 = parser.add_argument_group("Filesystem Search", "Options for searching/enumerating the filesystem of the specified host")
mex_group2 = sgroup3.add_mutually_exclusive_group()
Expand Down Expand Up @@ -787,8 +788,10 @@ def signal_handler(signal, frame):

lsshare = False
lspath = False

if args.recursive_dir_list:



if args.recursive_dir_list != None:
mysmb.recursive = True
mysmb.list_files = True
try:
Expand All @@ -806,7 +809,7 @@ def signal_handler(signal, frame):
lspath = '\\'.join(lspath[1:])
except:
pass

print '[+] Finding open SMB ports....'
socket.setdefaulttimeout(2)
if args.hostfile:
Expand Down

0 comments on commit 0a57fd9

Please sign in to comment.