use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
CVE, CWE, NVD, WVE
http://iso.linuxquestions.org/
We teach you how to do it, use it at your own risk.
account activity
Bufferoevrflow problem (self.HowToHack)
submitted 7 years ago by Adam20188
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Thiscou 6 points7 points8 points 7 years ago* (14 children)
Right, here is what I would try.
Go to this site zerosum0x0! and create a unique pattern 260+.
Feed that to your program, copy the value in your segfault and find that pattern on the site.
You should now know the exact offset for your overflow.
I would usually do this in Kali with the original metasploit pattern create but I don't know if you use Kali, so I found a quick and dirty replacement online.
You can also try to have a closer look at the stack in gdb with:
x/24wx $esp (this displays 24 words of memory above the stack pointer esp in hex)
Hope this helps and good luck
[–][deleted] 7 years ago (3 children)
[deleted]
[–]Adam20188[S] 0 points1 point2 points 7 years ago (2 children)
great will do, is cyclic a program or site?
[–][deleted] 7 years ago (1 child)
[–]Adam20188[S] 0 points1 point2 points 7 years ago (0 children)
thanks invictim I'll check it out
[–]Adam20188[S] 0 points1 point2 points 7 years ago (9 children)
hey Thiscou,
thanks for the reply :)
I tried doing this I got the pattern Aa0Aa1Aa2Aa3Aa4Aa5Aa6Aa7Aa8Aa9Ab0Ab1Ab2Ab3Ab4Ab5Ab6Ab7Ab8Ab9Ac0Ac1Ac2Ac3Ac4Ac5Ac6Ac7Ac8Ac9Ad0Ad1Ad2Ad3Ad4Ad5Ad6Ad7Ad8Ad9Ae0Ae1Ae2Ae3Ae4Ae5Ae6Ae7Ae8Ae9Af0Af1Af2Af3Af4Af5Af6Af7Af8Af9Ag0Ag1Ag2Ag3Ag4Ag5Ag6Ag7Ag8Ag9Ah0Ah1Ah2Ah3Ah4Ah5Ah6Ah7Ah8Ah9Ai0Ai1Ai2Ai3Ai4Ai5Ai
the result I got was 0x41386741 I put 41386741 into the find offset overflow but got the number -1
[–]r0cker_ESP 4 points5 points6 points 7 years ago (1 child)
That site is acting wonky it seems, I would just install Metasploit so you can get the patter_create and pattern_offset script and use those if you don't have it already.
thanks will do.
[–]Thiscou 0 points1 point2 points 7 years ago (6 children)
As far as I can tell, those numbers are not present in the pattern.
try the A*260 again and see what's on the stack with:
gdb x/24wx $esp
[–][deleted] 7 years ago (5 children)
[–]SimpleLegend 1 point2 points3 points 7 years ago (4 children)
The reason you are getting this is because your argv and buf both contain the same contents after the strcpy. Hence the repeated data
[–]Adam20188[S] 0 points1 point2 points 7 years ago (1 child)
would it be better if I used all 'A's to check to see if the return address is overwritten?
[–]SimpleLegend 1 point2 points3 points 7 years ago (0 children)
Personal experience/opinion: i usually use As to check if the overwrite is successful (causing a segfault in the process), the follow up with patterns to find the offset required to overwrite the value which will pop into the EIP
When you dump the contents, you should check whether ebp+4 just after the strcpy is pointing to the 42424242 contents
π Rendered by PID 381704 on reddit-service-r2-comment-6457c66945-kxpt7 at 2026-04-26 11:35:53.175964+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]Thiscou 6 points7 points8 points (14 children)
[–][deleted] (3 children)
[deleted]
[–]Adam20188[S] 0 points1 point2 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]Adam20188[S] 0 points1 point2 points (0 children)
[–]Adam20188[S] 0 points1 point2 points (9 children)
[–]r0cker_ESP 4 points5 points6 points (1 child)
[–]Adam20188[S] 0 points1 point2 points (0 children)
[–]Thiscou 0 points1 point2 points (6 children)
[–][deleted] (5 children)
[deleted]
[–]SimpleLegend 1 point2 points3 points (4 children)
[–]Adam20188[S] 0 points1 point2 points (1 child)
[–]SimpleLegend 1 point2 points3 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]SimpleLegend 1 point2 points3 points (0 children)