Python中的可利用缓冲区溢出strcpy()

时间:2016-01-24 08:16:02

标签: python buffer-overflow python-internals

如何在Python中利用缓冲区溢出。

我有以下代码:

from ctypes import *
libc = cdll.msvcrt
a = c_char_p("Here's a string that has 60 characters, 61 if you count null")
b = c_char_p("What do I put here to inject code?")
a = libc.strcpy(a, b)
print "Well, that didn't do anything"

我在b中放入什么来将代码注入程序?我以前在C中利用了溢出,但是我甚至无法使它崩溃(C中的相同程序会因相同的输入而崩溃)。

出了什么问题?如何在Python使用C函数时利用不安全的代码?

0 个答案:

没有答案
相关问题