Skip to content

Commit

Permalink
list files on shares for one system
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Apr 15, 2015
1 parent 4f50b02 commit c433f29
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions smb_enumerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,20 @@
is_direct_tcp=True)

connected = conn.connect(sys.argv[3],445)
Response = conn.listShares(timeout=30)

for i in range(len(Response)):
print("Share[",i,"] =", Response[i].name)
try:
Response = conn.listShares(timeout=30)
for i in range(len(Response)):
print("Share[",i,"] =", Response[i].name)

try:
Response2 = conn.listPath(Response[i].name,'/',timeout=30)
for i in range(len(Response2)):
print("File[",i,"] =", Response2[i].filename)
except:
print('### can not access the resource')

except:
print('### can not list shares')


0 comments on commit c433f29

Please sign in to comment.