Repository navigation
Replies: 1 comment 1 reply
|
Also see Pennyw0rth/NetExec#1253 especially Pennyw0rth/NetExec#1253 (comment) for the explanation/analysis. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
So, uhm, i am very new to this so i apologise if i am doing things wrong. so i was solving a HTB lab that included downloading system hive from the SYSVOL share in the backup operator module in nxc using a cifs cross domain tgs, the connection was like this: from my attack machine to a chisel proxy estblished from an ssh session to dc02 and finally to dc01. this long chain i assume was the reason for an error that looked like this:
Error writing file "SYSTEM" ... ("Unpacked data doesn't match constant value 'b'...'' should be ''þSMB''", ...)
with a big blob of bytes appearing on the screen. At first glance you would say that could be some bad byte calculation, but based on my analysis it is more related to the latency of this connection, let me explain. In the retrievFile function when an exception is raised the code proceeds to call recv.close() in smb3.py which then calls non_polling_raed from nmb.py, i tried analyzing the connection socket to see if the error is happeingn due to left over bytes in the socket or smth from a previous connection but the answer was no. so after understadning how recv.close works and how it sends a RST packet to the server and then waits for a response, i tried to terminate the tcp socket after a byte transfer fail in recvFile function, and it the error stopped showing this blob of bytes. In addition, a straight forward solution to this is increasing the timeout of the smb connection, but the ungraceful handling of that byte blob will still be there. So i was working on fixing how to handle this occasion gracefully despite the smb timeout being low. What i am asking here now is whether that would considered an acceptable contribution by the maintainers if i provided more details ofc to my analysis, and if anyone wants to maybe give an advice on how to approach it and how to make a good PR.
All reactions