开发者

Hex input in Windows Command-line

I am trying to solve this programming puzzle another student at my school put out, and we were given an .exe and the corresponding .c source code. The way I am trying to attack the problem is with a buffer overflow, and I managed to do it in Linux using a perl script as the input so that I could input the h开发者_JAVA技巧ex values for the return address.

The problem is we have to do it using the .exe in Windows, and I do not know how to enter hex values in the command line. For the Linux version, I used this question: Hex values in gdb input files and my code ending up being this:

./a.out $(perl -e 'print "A"x34 . "\x7d\x86\x04\x08";')

How can I do this on the Windows Command Line?


You have some options

  1. Install PERL or PYTHON package for Windows. Then you can do the similar way as you do in Linux.

  2. If you have powershell, you can do some scripting as given in link below:

http://www.sans.org/windows-security/2010/02/11/powershell-byte-array-hex-convert/

Note that when you compile the source code for Windows, there will be change in structure of stack and position of EIP. And hence the same payload might not work which worked on Linux.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜