Giter VIP home page Giter VIP logo

smbmap's People

Contributors

3lpsy avatar alichtman avatar bbriggs avatar g0tmi1k avatar gitmopp avatar hackndo avatar inosec2 avatar mirchr avatar nopsec-sevans avatar noraj avatar samueloph avatar shawndevans avatar spurin avatar zamanry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smbmap's Issues

Authentication error

I got this error on arch derivative distro, but when I'm using it on Kali/Parrot OS there's no error comes up.

2020-02-03-043725_1366x768_scrot

SMB Permission Clarification

Hi, This is more clarification than an bug or issue. I want to use SMBmap to enumerate all the shares that are set to "everyone" access write permission. However, if I use a basic domain user then we have to guess the share names. If I use a admin user the shares will can be enumerated but the permissions are reflecting that of the admin user not an everyone account. Is this correct?

Authentication error (yes, me too...)

Hi!

Got some of the authentication errors that it seems like other people have had too and I can not fix it.

smbmap

kali@kali:~/smbmap$ python3 smbmap.py -H 10.10.10.178
[!] Authentication error on 10.10.10.178
kali@kali:~/smbmap$ python3 smbmap.py -H 10.10.10.178 -u '' -p ''
[!] Authentication error on 10.10.10.178
kali@kali:~$ smbmap -H 10.10.10.178
[!] Authentication error on 10.10.10.178
kali@kali:~$ smbmap -H 10.10.10.178 -u '' -p ''
[!] Authentication error on 10.10.10.178

smbclient

kali@kali:~$ smbclient -N -L 10.10.10.178

        Sharename       Type      Comment
        ---------       ----      -------
        ADMIN$          Disk      Remote Admin
        C$              Disk      Default share
        Data            Disk      
        IPC$            IPC       Remote IPC
        Secure$         Disk      
        Users           Disk      
SMB1 disabled -- no workgroup available

Any tips?

[!] Authentication error on x.x.x.x

the target server
139/tcp open netbios-ssn Samba smbd 3.X - 4.X (workgroup: WORKGROUP)
445/tcp open netbios-ssn Samba smbd 3.0.20-Debian (workgroup: WORKGROUP)
my version of smbclient
smbclient --version
Version 4.11.5-Debian
I solved problem smbclient with --option='client min protocol=NT1'

smbmap -H 10.10.10.3
[!] Authentication error on 10.10.10.3

there is a way to assign the option to smbmap

Distributed Search is Still Broken

Search results do not have a 1 to 1 relationship to their parent job. This is a result of a nested loop, and an invalid lock check on "findstr" output files. Working on this now.

package inclusion into distro

Like the new tool! Would like to include it into ArchAssault as an official package for our users.

1.) could you include whatever license you are releasing the code under?

2.) could you offer up a tagged release?
#1 being the most important of these 2 things.

Thanks in advance!

  • Chad

Smbmap fail to enumerate shares and permissions with anonymous login

Hello,

I have noticed that smbmap fail to enumerate shares with anonymous login recently. I am using the Active machine from hackthebox in this example with the latest version of smbmap.

Smbclient.py from impacket and smbclient can successfully show the shares.

root@kali:/opt/tools/smbmap# git log
commit b36dc82796e89b0c52ee819fbf4467987c6fdb6d (grafted, HEAD -> master, origin/master, origin/HEAD)
Author: Shawn Evans <[email protected]>
Date:   Mon May 4 13:27:51 2020 -0400

    Improved NULL sesssion negotiation...I think

```bash
root@kali:/opt/tools/smbmap# python3 ./smbmap.py -H 10.10.10.100
[!] Authentication error on 10.10.10.100

root@kali:/opt/tools/smbmap# /usr/share/doc/python3-impacket/examples/smbclient.py 10.10.10.100
Impacket v0.9.20 - Copyright 2019 SecureAuth Corporation

Type help for list of commands
# shares
ADMIN$
C$
IPC$
NETLOGON
Replication
SYSVOL
Users
# 

Best regards and thanks a lot for this very useful tool.

Unable to execute command

Hi @ShawnDEvans ,

Command execute not work in windows 10, i get error :

C:\smbmap-1.0.1>python smbmap.py -u Administrator -p 123456 -H 192.168.176.139 -x whoami
[+] Finding open SMB ports....
[+] User SMB session establishd...
[+] IP: 192.168.176.139:445     Name: DESKTOP-JG4CPKM
[!] [Errno 10054] An existing connection was forcibly closed by the remote host
(<class 'socket.error'>, 'smbmap.py', 107)

I don't understand this error message how to resolve it?

Thanks,

Missing required parameter 'digestmod'.

Hello! On BlackArch smbmap always fails and throws the error:

[!] Authentication error on ….

I tried to debug and discovered that login function fails with exception:

Missing required parameter 'digestmod'.

I think the reason is incompatibility with newer version of some dependencies. Please, can you check it and fix?

File content searching hidden shares

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'

Doesn't do null sessions

Smbmap can't login with null sessions, i've tried smbmap -u '' -p '' -H 192.168.6.10, and without user and password (smbmap -H 192.168.6.10), since the docs say it should use null when username is not provided.
On the same host and share using smbclient -L //192.168.6.10 -U '' -N i'm able to see the share and login with null sessions.
Please check the attached image:
Capture

thanks for this great tool :)

SMB SessionError

Hello! I have installed new Kali on VMBox. Did sudo apt update && sudo apt upgade
Downloaded https://github.com/ShawnDEvans/smbmap.git
When I made recommendations
pip install -r requirements.txt
Got errors:

Installing collected packages: pycrypto, impacket, configparser
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behavior is the source of the following dependency conflicts.
crackmapexec 5.2.2 requires bs4<0.0.2,>=0.0.1, which is not installed.
crackmapexec 5.2.2 requires impacket<0.10.0,>=0.9.23, but you have impacket 0.9.21 which is incompatible.
crackmapexec 5.2.2 requires neo4j<5.0.0,>=4.1.1, but you have neo4j 1.7.0.dev0 which is incompatible.
crackmapexec 5.2.2 requires pylnk3<0.4.0,>=0.3.0, but you have pylnk3 0.4.2 which is incompatible.
Successfully installed configparser-5.2.0 impacket-0.9.21 pycrypto-2.6.1

After running the script
./smbmap.py -H 10.10.10.178

I am getting an error:

[+] IP: 10.10.10.178:445 Name: 10.10.10.178 Status: Authenticated
[!] Something weird happened: SMB SessionError: STATUS_ACCESS_DENIED({Access Denied} A process has requested access to an object but has not been granted those access rights.) on line 967

I don't understand what it is connected with, the basic smbmap installed in Kali does not give any results at all.
Please help me understand how to fix this error.

Option to disable termcolor in output

If i run smbmap from a python3 script by calling subprocess.Popen i get terminal colors in the output.

Eg, \033[1;37m

Is it possible to have add a flag to disable termcolor so output does not have to be cleaned.

libgcc_s.so.1 must be installed for pthread_cancel to work

Hi,

when running smbmap with the following options, it´ll stop during work with the following error code:
"libgcc_s.so.1 must be installed for pthread_cancel to work"
I figured out that his behaviour only appears when you select a very large input file. (~1.200 IPs)

smbmap -u 'user' -p 'pass' -d DOM --host-file [FILE.txt] --dir-only.

When splitting the large host-file into two party (2x600IPs) it works at the beginning. After a while
Unforrunately at some point the script throws the error "[!] Error: (<class 'BrokenPipeError'>, 'smbmap', 1337)" for further hosts.

With smaller host-files i never got this errors. Therefore i would assume it might correlate with large host-files.

I tried this on two different kali linux clients with the same result.

Thanks a lot!

Support for multiple creds?

Would it be possible for to extend the code to support a list of credentials rather than a single set? I can generate a code push if that would assist.

ImportError: cannot import name transport

I've installed impacket and tried to run smbmap.

root@kali:~/smbmap-master# python smbmap.py
Traceback (most recent call last):
  File "smbmap.py", line 17, in <module>
    from impacket.dcerpc import transport, svcctl, srvsvc
ImportError: cannot import name transport

As it seems this project is dead - but you never know.

Password is visible

We are facing issue while reveling the password because it gets save in our history where multiple users has access to the same terminal, Can it be password protected

-r/-R options are no required with --csv usage

I just realized I never created a linked issue for my pull request #69. I am not sure if that is preferred so I am creating one just in case.

The --csv option no longer requires the -r/-R options. This behavior was changed in 9a83288 (Enhanced CSV Export and Fixed Color Output to File, 2020-09-08). The linked pull request updates the usage statement and readme to reflect that.

CSV output

Hello Shawn,

As you are working on the future multi-threaded release of the tool, could you also add an option to produce a CSV output for the the dir/file listings ?

Cheers.

Non-descriptive errors

I'm running the latest version from the git repo on Red Hat, it's very useful but I'm getting tons of these messages:

image

I don't know what the underlying errors are, so I can't solve them. Can the errors be more descriptive?

'NoneType' object has not attribute 'strip'

When executing smbmap's File Content Search with the -F command. I am getting returned a 'NoneType' object has no attribute 'strip'

Command to reproduce:
python smbmap.py -d DOMAIN -u USER -p PASS --host-file ~/Desktop/smb.txt -F '[1-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]'

Output produced:
'NoneType' object has no attribute 'strip' \ [!] Job creation failed on host: x.x.x.x \ [+] Grabbing search results, be patient, share drives tend to be big ... \ [+] All jobs complete

Command execution broken with python 3

self.__outputBuffer += data

data is a bytes type and can't be appended to a str type

$ python smbmap.py ... -x "whoami"
[+] Finding open SMB ports....
[+] User SMB session established on redacted...
[!] Something went wrong: can only concatenate str (not "bytes") to str

Authentication error

OS: Kali
Python: python 3.8.2

Hi there, while I'm using smbmap, something errored here and I can't figure out why. Would you help me to solve the problem?

smbmap -H 10.10.10.100
[!] Authentication error on 10.10.10.100

I can use smbclient and enum4linux without anyerrors, however, there is an error for smbmap.
This is the first time I've doing an issue, if there is any mistake, please point out.
Thanks!
截屏2020-04-26 下午12 59 54

Incorrect spelling

smbmap.py: print '[+] User SMB session establishd on %s...' % (host)

establishd => established

download_file is inconsistent

I've encountered instances where a file will not download using SMBMap. If I attempt to map/mount the same remote SMB share drive using the same credentials, I can navigate to the problematic file and download it without issue. This hasn't been something I've been able to reproduce in my lab. If anyone else runs into this issue, please let me know. Thanks!

install issues with pycrypto

As stated in the README.md file, you need to run following command to install smbmap:
sudo pip3 install smbmap
However i've been getting following error:

Building wheels for collected packages: pycrypto
Building wheel for pycrypto (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [71 lines of output]
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for __gmpz_init in -lgmp... yes
checking for __gmpz_init in -lmpir... no
checking whether mpz_powm is declared... yes
checking whether mpz_powm_sec is declared... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for inttypes.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking wchar.h usability... yes
checking wchar.h presence... yes
checking for wchar.h... yes
checking for inline... inline
checking for int16_t... yes
checking for int32_t... yes
checking for int64_t... yes
checking for int8_t... yes
checking for size_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for uint8_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for memmove... yes
checking for memset... yes
configure: creating ./config.status
config.status: creating src/config.h
In file included from /usr/include/python3.11/Python.h:86,
from src/_fastmath.c:31:
/usr/include/python3.11/cpython/pytime.h:208:60: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
208 | PyAPI_FUNC(int) _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts);
| ^~~~~~~~
/usr/include/python3.11/cpython/pytime.h:213:56: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
213 | PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts);
| ^~~~~~~~
/usr/include/python3.11/cpython/pytime.h:217:63: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
217 | PyAPI_FUNC(void) _PyTime_AsTimespec_clamp(_PyTime_t t, struct timespec ts);
| ^~~~~~~~
src/_fastmath.c:33:10: fatal error: longintrepr.h: No such file or directory
33 | #include <longintrepr.h> /
for conversions */
| ^~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycrypto
Running setup.py clean for pycrypto
Failed to build pycrypto
Installing collected packages: pycrypto, configparser, smbmap
Running setup.py install for pycrypto ... error
error: subprocess-exited-with-error

× Running setup.py install for pycrypto did not run successfully.
│ exit code: 1
╰─> [18 lines of output]
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
In file included from /usr/include/python3.11/Python.h:86,
from src/_fastmath.c:31:
/usr/include/python3.11/cpython/pytime.h:208:60: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
208 | PyAPI_FUNC(int) _PyTime_FromTimespec(_PyTime_t *tp, struct timespec *ts);
| ^~~~~~~~
/usr/include/python3.11/cpython/pytime.h:213:56: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
213 | PyAPI_FUNC(int) _PyTime_AsTimespec(_PyTime_t t, struct timespec *ts);
| ^~~~~~~~
/usr/include/python3.11/cpython/pytime.h:217:63: warning: ‘struct timespec’ declared inside parameter list will not be visible outside of this definition or declaration
217 | PyAPI_FUNC(void) _PyTime_AsTimespec_clamp(_PyTime_t t, struct timespec ts);
| ^~~~~~~~
src/_fastmath.c:33:10: fatal error: longintrepr.h: No such file or directory
33 | #include <longintrepr.h> /
for conversions */
| ^~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pycrypto

This issue likely presents itself because pycrypto is no longer maintained.
Is there a solution for this issue? Or is it possible to migrate smbmap to pycryptodome?

445 not open

Hi, I am experimenting the next issue when I use smbmap. If I try twice o three times it works.

python3 smbmap.py -H x.x.x.x -u 'myuser' -p 'mypass'
[!] 445 not open on x.x.x.x....

I don't know if the issue is expected or I need to check any thing.

Regards,
Arsenio

Use SMBMAP to create folder

Hi, I tried to use the utility to create a folder on Samba but wasn't able to make it work.
Does somebody have an example for that usecase. Thanks

Tried the following but didn't get it to work
python3 smbmap.py -H ipaddrss -d xxx -u xxx -p xxx -x 'mkdir "newfolder"'

Releasing a Windows executable ?

Hello Shawn,

Well first let me thank you for developing this cool script. I wished to have the very same features directly from metasploit modules (hello issue 3994) but it seems that the implementation is not yet available :(

Anyway, I wanted to ask you whether you plan to release "one-file" windows executable for your script, as you can do with py2exe (take a look at that link and that one).
The idea is to be able to easily deploy it on pwned Windows boxes during internal engagements for pivoting purposes...without going through the tedious phase of installing Python binaries + dependencies.

Error - Raspberry Pi 3b

I get the following error when I try to run smbmap:

Traceback (most recent call last):
File "./smbmap.py", line 19, in
from impacket import version, smbserver
File "/usr/local/lib/python3.5/dist-packages/impacket/smbserver.py", line 48, in
from impacket import smb, nmb, ntlm, uuid
File "/usr/local/lib/python3.5/dist-packages/impacket/smb.py", line 49, in
from pyasn1.type.univ import noValue
ImportError: cannot import name 'noValue'

I have tried removing/reinstalling impacket and pyasn1 but to no avail.

Any help would be greatly appreciated.

Thanks.

smbmap gitclone not working

I have cloned the smabmap from https://github.com/ShawnDEvans/smbmap.git after cloning the same run the following command
python3 -m pip install -r requirements.txt
and successfully installed the requirement.

further when i am running the smbmap observed the following error in kali linux
smbmap
Traceback (most recent call last):
File "/usr/bin/smbmap", line 19, in
from impacket import version, smbserver
File "/usr/local/lib/python3.10/dist-packages/impacket/smbserver.py", line 172
except Exception, e:
^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized

please help me to resolve the issue

Logout Issue when using a host file

I was using SMBMap on a recent engagement, and at one point hit an error when attempting to log off of a system. I'm not 100% sure what it was related to, but it's on my radar. I'll likely add some graceful error handling to the logout function as a band aid until I have a better grasp on what is causing the error.

Problem with shebang

Hello,
In the file the shebang is now #pwi! /usr/bin/env python2
When using a helper-script in kali to start the smbmap, this line is considered as a comment and the program doesn't start.
Please replace it with #! /usr/bin/env python2
Thanks

from impacket import version, smbserver

On line 172 and others, there are errors that make the program useless.

File "/home/user/.local/lib/python3.9/site-packages/impacket/smbserver.py", line 172

Command execution error

Hi, I hope you could help me on the issue I am encountering.

I'm trying to do a command execution but I encountered an issue:
[!] Error: (<class 'impacket.dcerpc.v5.rpcrt.DCERPCException'>, 'smbmap.py', 1314)

When I do these two commands below, no issues we encountered.
./smbmap.py -H 127.0.0.1 -u 'Administrator' -p 'P@ssw0rd08'
./smbmap.py -H 127.0.0.1 -u 'Administrator' -p 'P@ssw0rd08' -r 'C$\Users'

the command I'm trying was just simple first as I'm trying to troubleshoot the issue.
Just a simple adding of user.
./smbmap.py -H 127.0.0.1 -u 'Administrator' -p 'P@ssw0rd08' -x 'net user tryer test123 /add'

Can't read data include utf-8 character

Hi
Smbmap raise utf-8 decode error, it can't read Chinese.

When running smbmap to exec cmd like ipconfig or read file content if the data include UTF-8 character it raise decode error.

Error MSG: [!] Something went wrong: 'utf-8' codec can't decode byte 0xc5 in position 13: invalid continuation byte

smbmap should show comments

If a share contains some comments, they are currently not shown in smbmap. smbclient -L shows them correctly. I think it would be nice to show comments if there are some as they can contain valuable information.

Example config:

[share]
    comment = "Example Samba Server"
    path = /home/test/
    read only = yes
    browsable = yes
    public = yes
    force user = nobody
    force group = nogroup

Typo in help output

Small typo in -h output.

The last example uses -h instead of-H.

$ smbmap -u 'apadmin' -p 'asdf1234!' -d ACME -h 10.1.3.30 -x 'net group "Domain Admins" /domain'

should probably be

$ smbmap -u 'apadmin' -p 'asdf1234!' -d ACME -H 10.1.3.30 -x 'net group "Domain Admins" /domain'

Incorrect spelling

Line 454. Miss spelling of "please"

print '\t[!] Unable to remove test directory at \%s%s%s, plreae remove manually' % (host, share, root)

SyntaxWarning: "is not" with a literal. Did you mean "!=?"

Ran into this issue on Kali Linux, running Python 3.8.2. I'm not able to replicate it outside of my Kali Linux VM however.

kali@kali:~$ smbmap -H 10.10.10.3
/usr/lib/python3/dist-packages/impacket/smbserver.py:2465: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if jtr_dump_path is not '':
/usr/lib/python3/dist-packages/impacket/smbserver.py:2501: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if jtr_dump_path is not '':
/usr/lib/python3/dist-packages/impacket/smbserver.py:2843: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if jtr_dump_path is not '':
/usr/lib/python3/dist-packages/impacket/smbserver.py:4417: SyntaxWarning: "is not" with a literal. Did you mean "!="?
  if credentials_fname is not "":
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:169: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if supportedCiphers[0] in (constants.EncryptionTypes.aes128_cts_hmac_sha1_96.value, constants.EncryptionTypes.aes256_cts_hmac_sha1_96.value) and aesKey is '':
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:302: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None):
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:302: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None):
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:302: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None):
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:579: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:579: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:579: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:607: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:607: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/krb5/kerberosv5.py:607: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is b'' and nthash is b'' and (aesKey is b'' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/smbconnection.py:351: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is '' and nthash is '' and (aesKey is '' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/smbconnection.py:351: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is '' and nthash is '' and (aesKey is '' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/smbconnection.py:351: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if lmhash is '' and nthash is '' and (aesKey is '' or aesKey is None) and TGT is None and TGS is None:
/usr/lib/python3/dist-packages/impacket/dcerpc/v5/ndr.py:1336: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.structure is ():
/usr/lib/python3/dist-packages/impacket/dcerpc/v5/ndr.py:1423: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if self.structure is ():
/usr/lib/python3/dist-packages/impacket/dcerpc/v5/dcom/wmi.py:2412: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if itemValue is '':
[!] Authentication error on 10.10.10.3

Any ideas what may be causing this?

UnicodeEncodeError

Hello Shawn.

I'm using smbmap.py on MacOS, it works. But I discovered the problem.
smbmap.py --host-file ./HOSTS.txt -u 'user' -p 'password' -d 'domain'

[+] IP: 10.10.10.1:445 Name: host1.domain.com
Disk Permissions
---- -----------
ADMIN$ NO ACCESS
C$ NO ACCESS
IPC$ READ ONLY
Пример шары READ ONLY
[+] IP: 10.10.10.2:445 Name: host2.domain.com
Disk Permissions
---- -----------
ADMIN$ NO ACCESS
C$ NO ACCESS
IPC$ READ ONLY
print$ READ ONLY
Test READ ONLY
т ест_ READ ONLY
Тест READ ONLY

I get the normal output.

smbmap.py --host-file ./HOSTS.txt -u 'user' -p 'password' -d 'domain' > ./list.txt

cat list.txt
[+] IP: 10.10.10.1:445 Name: host1.domain.com
Disk Permissions
---- -----------
ADMIN$ NO ACCESS
C$ NO ACCESS
IPC$ READ ONLY
[!] 'ascii' codec can't encode characters in position 1-6: ordinal not in range(128)
(<type 'exceptions.UnicodeEncodeError'>, 'smbmap.py', 906)

[+] IP: 10.10.10.2:445 Name: host2.domain.com
Disk Permissions
---- -----------
ADMIN$ NO ACCESS
C$ NO ACCESS
IPC$ READ ONLY
print$ READ ONLY
Test READ ONLY
[!] 'ascii' codec can't encode character u'\u0442' in position 1: ordinal not in range(128)
(<type 'exceptions.UnicodeEncodeError'>, 'smbmap.py', 906)

In that case, I already get the problem.

Plans on creating a new release?

Hi there,

Thanks for your tremendous work providing the infosec community with smbmap.

I have noticed that throughout the past two years lots of good features, such as the ability to get prompted for the password, had been added to the code base. However, for users depending on the packaged version these remain largely inaccessible, as the released versions lacks behind the actual code base. Are you planning on releasing a new version any time soon?

Make a pypi package

@ShawnDEvans, it would help people and maintainers if you could package smbmap in a standard Python package that could be available on pypi.org.

Take a look at my simple packages, like nmaptocsv, it's quite easy :)

-A pattern not working or ?

trying to download a samba share with all files.

command:

smbmap -u test -p test -H 192.168.1.100 -s C$ -R
i get all the shares, and files listed.

if i add a -A to the end
smbmap -u test -p test -H 192.168.1.100 -s C$ -R -A '.*'

then nothing. no files are found, it lists the directorys though, but no downloads.

eighter i do not understand the command, or it is not working.

version: 1.1.0+git20191013-1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.