Skip to content

Commit

Permalink
Patched a NULL session bug
Browse files Browse the repository at this point in the history
  • Loading branch information
NopSec-Sevans committed Jan 3, 2025
1 parent 2169cc6 commit 3808808
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ usage: smbmap.py [-h] (-H HOST | --host-file FILE) [-u USERNAME] [-p PASSWORD |
/" \ :) |. \ /: ||: |_) :)|. \ /: | / / \ \ /|__/ \
(_______/ |___|\__/|___|(_______/ |___|\__/|___|(___/ \___)(_______)
-----------------------------------------------------------------------------
SMBMap - Samba Share Enumerator v1.10.4 | Shawn Evans - ShawnDEvans@gmail.com<mailto:ShawnDEvans@gmail.com>
SMBMap - Samba Share Enumerator v1.10.7 | Shawn Evans - ShawnDEvans@gmail.com
https://github.com/ShawnDEvans/smbmap

options:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

setuptools.setup(
name = "smbmap",
version = "1.10.5",
version = "1.10.7",
author = "ShawnDEvans",
author_email = "Shawn.Evans@knowledgeCG.com",
author_email = "ShawnDEvans@gmail.com",
description = " SMBMap is a handy SMB enumeration tool ",
long_description = long_description,
long_description_content_type = "text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion smbmap.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH SMBMAP "1" "August 2018" "smbmap 1.0.5" "User Commands"
.TH SMBMAP "1" "January 2025" "smbmap 1.10.7" "User Commands"
.SH NAME
smbmap \- SMB enumeration tool
.SH SYNOPSIS
Expand Down
9 changes: 4 additions & 5 deletions smbmap/smbmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import inspect
import csv
import getpass
import resource

from threading import Thread, Event
from multiprocessing.pool import Pool
Expand All @@ -40,7 +41,6 @@
# Seriously, the most amazing Python library ever!!
# Many thanks to that dev team

import resource
rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
resource.setrlimit(resource.RLIMIT_NOFILE, (4096, rlimit[1]))

Expand All @@ -66,7 +66,7 @@
/" \ :) |. \ /: ||: |_) :)|. \ /: | / / \ \ /|__/ \
(_______/ |___|\__/|___|(_______/ |___|\__/|___|(___/ \___)(_______)
-----------------------------------------------------------------------------
SMBMap - Samba Share Enumerator v1.10.6 | Shawn Evans - ShawnDEvans@gmail.com
SMBMap - Samba Share Enumerator v1.10.7 | Shawn Evans - ShawnDEvans@gmail.com
https://github.com/ShawnDEvans/smbmap
"""

Expand Down Expand Up @@ -913,7 +913,7 @@ def to_string(smb_tree, mysmb):
else:
priv_status = 'Status: ' + colored ('Authenticated', 'green')
except:
priv_status = 'Status: ' + colored ('Authenticated', 'green')
priv_status = 'Status: ' + colored ('NULL Session', 'green')

for share in smb_tree[host].keys():
if smb_tree[host][share]['privs'] == 'READ, WRITE':
Expand Down Expand Up @@ -1010,7 +1010,7 @@ def get_shares( share_args ):
# } ]

share_tree = {}
if share_args['smbconn'].getSessionKey():
if share_args['smbconn'].getDialect():
try:
shareList = share_args['smbconn'].listShares()
shares = []
Expand Down Expand Up @@ -1526,7 +1526,6 @@ def main():

share_pool = Pool()
share_args = [ { 'smbconn' : mysmb.hosts[host]['smbconn'][0] , 'host' : host, 'write_check' : args.write_check, 'exclude' : mysmb.exclude } for host in mysmb.hosts.keys() if len(mysmb.hosts[host]['smbconn']) > 0 ]

mysmb.loader.update('Enumerating shares...')

# this call returns an array of dict objects
Expand Down

0 comments on commit 3808808

Please sign in to comment.