Windows命令行中的十六进制输入 [英] Hex input in Windows Command-line

查看:116
本文介绍了Windows命令行中的十六进制输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力解决这个编程难题,另一位我学校的学生提出了这个难题,我们给了.exe和相应的.c源代码.我试图解决该问题的方法是缓冲区溢出,并且我设法在Linux中使用perl脚本作为输入来做到这一点,以便我可以为返回地址输入十六进制值.

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 hex values for the return address.

问题是我们必须在Windows中使用.exe来执行此操作,并且我不知道如何在命令行中输入十六进制值.对于Linux版本,我使用了以下问题: gdb输入文件中的十六进制值而我的代码最终是这样的:

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";')

我将如何在Windows命令行上执行此操作?

How would I go about doing this on the Windows Command Line?

感谢您能提供的任何帮助,如果在某种程度上缺少我的问题,我向您致歉.我对这些东西很陌生.

Thanks for any help you can provide, and I apologize in advance if my question is lacking in some way; I'm very new at this stuff.

推荐答案

您有一些选择

  1. 为Windows安装PERL或PYTHON软件包.然后,您可以执行与在Linux中类似的方法.

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

如果您拥有Powershell,则可以执行以下链接中给出的一些脚本编制:

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/

请注意,当您为Windows编译源代码时,EIP的堆栈结构和位置将发生变化.因此,相同的有效负载可能无法在Linux上工作.

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.

这篇关于Windows命令行中的十六进制输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆