Comments (8)
Hola mate!
Sorry for the delay response.. you rock!.. Let me dig your mail and I'll get
back to you...Big thanks for taking a look at it (SMBv1 code is ugly).. and
yes.. it does not support Unicode connections. Time to attack this issue :)
cheers!
beto
Original comment by [email protected]
on 8 Sep 2014 at 1:36
- Changed state: Accepted
- Added labels: ****
- Removed labels: ****
from impacket.
Hmm.. still trying to repro this issue based on your repro steps.
I've used a Windows 7 as the target.
1. chcp 866
2. mkdir b
then I forced smbclient.py to connect using smbv1 (change smbconnection.py and
force the SMBConnection.__init__() preferredDialect to SMB_DIALECT
I connected to the target system.. smbclient.py is telling me I'm with smbv1
and I see the directory as 'b'.
Mate.. did you take the same steps as myself?.. I might be missing something.
Original comment by [email protected]
on 16 Sep 2014 at 7:27
- Added labels: ****
- Removed labels: ****
from impacket.
Be careful, in the "mkdir" command, it's not a "b" but a "Ь" (the cyrillic
character). In your case, it still works because "b" is inherently and
correctly converted to the ascii char code \x62 (cp866 and ascii table are the
same for the ascii charset).
To reproduce the bug you have to create a directory or a file containing
non-ascii char. The simpliest way is to create the char with Python and copy /
paste the char in your Windows shell:
>>> print u"\u042c"
Ь
Tell me if it fixes your problem ;)
Original comment by [email protected]
on 17 Sep 2014 at 6:10
- Added labels: ****
- Removed labels: ****
from impacket.
dumb me..
thanks for the clarification.. just managed to create that directory..
First problem I found is smbclient.py dumps an exception, even when running SMB
v2.1 against the target.. And that has to do with the smbclient.py itself.
Doesn't that happen to you? .. I'm running smbclient.py from OSx
Original comment by [email protected]
on 17 Sep 2014 at 5:51
- Added labels: ****
- Removed labels: ****
from impacket.
Ok.. just saw your precmd addition into smbclient.py to prevent this problem
happening with SMB >= v2. I'm first committing that change.
For the rest, I want to carefully look at your changes since it might break
many things .. It's gonna take some time.
thanks again!
beto
Original comment by [email protected]
on 17 Sep 2014 at 6:28
- Added labels: ****
- Removed labels: ****
from impacket.
It's ok, I probably missed something during my patching madness :) so, I think
it's a good thing to carefully look at my changes. I don't have an overall view
of the project and, yeah, it probably breaks something somewhere...
Anyway, if you need some help or if you have any question about my patch,
please let me know ;)
Thanks to you for taking the time!
Renaud.
Original comment by [email protected]
on 18 Sep 2014 at 6:38
- Added labels: ****
- Removed labels: ****
from impacket.
Nooo.. thank you for taking the time to provide a patch (and specially mess
with smb.py..)
FYI, as far as I read, SMB_COM_TREE_CONNECT shouldn't encode unicode, from
[MS-CIFS], 2.2.4.50.1:
Flags2 (2 bytes): The SMB_FLAGS2_UNICODE flag bit SHOULD be zero. Servers MUST
ignore the SMB_FLAGS2_UNICODE flag and interpret strings in this request as
OEM_STRING strings.<74>
Path (variable): A null-terminated string that represents the server and share
name of the resource to which the client is attempting to connect. This field
MUST be encoded using Universal Naming Convention (UNC) syntax. The string MUST
be a null-terminated array of OEM characters, even if the client and server
have negotiated to use Unicode strings.
This doesn't apply to SMB_COM_TREE_CONNECT_ANDX.
Let me know if you read something different.
thanks again!
beto
Original comment by [email protected]
on 18 Sep 2014 at 12:21
- Added labels: ****
- Removed labels: ****
from impacket.
Oh yes you're right. All my fault :) when I patched smb.py, I read the
documentation about SMB_COM_TREE_CONNECT_ANDX only and not
SMB_COM_TREE_CONNECT... In my head, both could use Unicode... sorry about that
and thanks for the feedback.
Renaud.
Original comment by [email protected]
on 19 Sep 2014 at 9:10
- Added labels: ****
- Removed labels: ****
from impacket.
Related Issues (20)
- smbrelayx.py prob HOT 9
- smbserver.py does not work with signing HOT 1
- SMBTransport instance has no attribute 'get_dce_rpc' HOT 5
- secretsdump.py not working against winXP HOT 1
- secretsdump not working against a Windows 2000 Server HOT 1
- Error on function set_bytes_from_string in ImpactPacket.py HOT 2
- Services.py pass the hash causes an error HOT 3
- Python 2.6 support for OrderedDict HOT 2
- esentutl.py crashes while dumping table from ntds.dit HOT 6
- retr_file permissions issue in smb.py HOT 12
- smbserver not working with OSX Mavericks
- On Windows 2012R2 reports Broken Pipe HOT 7
- SMB_FIND_FILE_BOTH_DIRECTORY_INFO FileName non-NUL terminated HOT 8
- Bad record decoding in ese.py HOT 3
- error: can only concatenate tuple (not "unicode") to tuple HOT 6
- secretsdump.py utf16 codec errors HOT 13
- New KRB5 module/lib isn't installed HOT 2
- Patch for /trunk/impacket/examples/serviceinstall.py HOT 1
- psexec.py script throwing exceptions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from impacket.