本文整理汇总了Python中builder.Builder.payload方法的典型用法代码示例。如果您正苦于以下问题:Python Builder.payload方法的具体用法?Python Builder.payload怎么用?Python Builder.payload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类builder.Builder
的用法示例。
在下文中一共展示了Builder.payload方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Builder
# 需要导入模块: from builder import Builder [as 别名]
# 或者: from builder.Builder import payload [as 别名]
MYSELF = os.path.abspath(os.path.expanduser(__file__))
if os.path.islink(MYSELF):
HEAPFILE = os.readlink(MYSELF)
sys.path.append(os.path.dirname(MYSELF))
from builder import Builder
b = Builder('./foo'+sys.argv[1] \
,['a','b','c'] \
,["PATH=/tmp/",'EVIL=dupa'] \
)
payload = b.payload()
lpayload = (len(payload) + 0x1000) & ~(0x1000-1)
#exit()
x = libc.fork()
if x == 0:
libc.sleep(15)
addr = c_void_p(base_adddr)
libc.mmap(addr,lpayload,7,0x32,0,0)
libc.memcpy(addr,payload,len(payload))
cfun = cast(addr,CFUNC)
cfun(addr)
exit()
else:
print "[Parent] Child pid: %d" % x