ShawnDEvans / smbmap

SMBMap is a handy SMB enumeration tool
GNU General Public License v3.0
1.76k stars 343 forks source link

File content searching hidden shares #8

Closed jbarcia closed 9 years ago

jbarcia commented 9 years ago

when performing a search against a hidden share (ex. c$) an error of no such file or folder is given [errno2].

root@ws246:~/smbmap-master# python smbmap.py -u 'USER' -p 'PASS' -d DOMAIN -H 10.1.111.158 -F password --search-path 'c:\Users\User\AppData\Roaming' [+] Finding open SMB ports.... [+] User SMB session establishd... [+] IP: 10.1.111.158:445 Name: [+] File search started on 1 hosts...this could take a while [+] Job be7f55a5587c400a9389b33e started on 10.1.111.158, result will be stored at C:\Windows\TEMP\be7f55a5587c400a9389b33e.txt [+] Grabbing search results, be patient, share drives tend to be big... [Errno 2] No such file or directory: '/root/smbmap-master/10.1.111.158-C$_Windows_TEMP_be7f55a5587c400a9389b33e.txt' [Errno 2] No such file or directory: '/root/smbmap-master/10.1.111.158-C$_Windows_TEMP_be7f55a5587c400a9389b33e.txt' [Errno 2] No such file or directory: '/root/smbmap-master/10.1.111.158-C$_Windows_TEMP_be7f55a5587c400a9389b33e.txt' [Errno 2] No such file or directory: '/root/smbmap-master/10.1.111.158-C$_Windows_TEMP_be7f55a5587c400a9389b33e.txt' [Errno 2] No such file or directory: '/root/smbmap-master/10.1.111.158-C$_Windows_TEMP_be7f55a5587c400a9389b33e.txt' [Errno 2] No such file or directory: '/root/smbmap-master/10.1.111.158-C$_Windows_TEMP_be7f55a5587c400a9389b33e.txt'

ShawnDEvans commented 9 years ago

Thanks! I'll look into reproducing this issue and work on a fix. On May 7, 2015 11:49 PM, "jbarcia" notifications@github.com wrote:

when performing a search against a hidden share (ex. c$) an error of no such file or folder is given [errno2].

— Reply to this email directly or view it on GitHub https://github.com/ShawnDEvans/smbmap/issues/8.

ShawnDEvans commented 9 years ago

Ok, was easy to reproduce, all I had to do was use that feature. The issues were numerous, but all simple enough to fix. I had an incorrect variable reference in one of the loops which resulted in the the host IP not iterating with a loop. I also had a miss match between the return value of "download_file" and the actual name of the file output to the local disk, which is why the "[Errno 2] No such file or directory" kept popping up. Finally the job termination tracking and logic was flawed. I also tweaked the output a bit. Hopefully that's it, but somehow I feel like I need to test a bit more. In any case, thanks for reporting this. I'm going to close it until it rears it's head again.