-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
smbserver: Connection reset by peer && command not implemented #105
Comments
hey mate..
A pcap capture of the SMB Session would be awesome. Does it fail with SMBv2 / v1 or both? thanks |
with SMBv1:
With SMBv2 it seems to work:
But it fails:
PCAP of SMBv1: PCAP of SMBv2: |
Didn't mean to close :/ |
Hmm.. I still can't reproduce. The PCAP for SMBv1 only shows the target system trying to connect to your smbserver using SMBv2. That's because you might have connected using SMBv2 before, and the target knows and cached you talk SMBv2 (and not SMBv1) hence it doesn't negotiate the protocol version again. In order to fix that you will need to boot the target in between tests (or revert snapshot) The PCAP for SMBv2 shows the file was opened but then when asking for file information, the object cannot be found. That is strange, and I couldn't reproduce in here. What I did was: The target is a Windows 10.
For SMBv2
The result is I get the Do you get the same errors following these steps? If so (and that's the intention), we will need to dig deeper on the OS config side. Anything in particular set up on that Win 10? thanks dude. |
I rebooted the VM and the original error didn't happen anymore so that was a problem with the SMBv1/v2 caching.
and the PS script is never downloaded If you want to take a look at the smbserver class its here: Also you could just test it yourself by running:
|
First try using SMBv1. I think you forgot to tell the DCERPC SRVSVC the list of shares you have. Here's the diff:
Check if with these changes everything works fine. If you enable SMB2, there will be an error due to this line
Looks like SMBv2 does not support specifying a share as a relative path. That's a bug that should be fixed in the SMBv2 code. |
Applied the diff and still the same, took a look at the traffic and it seems like the server is having a hard time reading the requested file (don't quote me on that). Here is the pcap: https://mega.nz/#!mFQlgTLD!wkrxX-6YPGTuHQEKJNPFJ_nELto1Hp_fv73AxvTzLGM |
Anything written out at the console? Any error? What are you doing at the target's? what about, from
|
Just in case also, git pull impacket to the latest version. |
On the latest commit:
And when using an IEX cradle keep getting this:
|
@asolino |
it's really weird cause everything works as expected when using smbserver.py |
Well it's really weird because it's working on my side even using crackmapexec running it this way (different IPs/pwds):
I can browse the Is it working on other OSes? |
wut? ahah what OSes are you using? Atm I'm running Debian and I'm currently using Windows 7 as the target. |
You mentioned Windows 10 at the beginning of this issue. That's what I'm using. crackmapexec.py is running on OSx. Looks like it's not related to Windows 10 then. Why don't you use the SimpleSMBServer class?. Look at https://github.com/CoreSecurity/impacket/blob/master/examples/smbserver.py#L55 |
@asolino Already tried SimpleSMBServer, same result. Will try again with the latest commit just to make sure |
Just tried using SimpleSMBServer and nothing changes. At this point I'm thinking it might be a Linux issue (??) since it works for you on OSX |
Just ran crackmapexec from a Kali box and it worked, again! |
@asolino ok, its gotta be my system then. closing. Sorry for the trouble mate |
Hey man!
I'm currently trying to download powershell scripts over smb on Windows 10 using the following command:
smbserver.py and my custom smb server class give me the following output:
Let me know if you need some additional information.
Cheers
The text was updated successfully, but these errors were encountered: