代码拉取完成,页面将自动刷新
# !/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021.10.30
# @Author : TTY
# @Email : [email protected]
import os, sys
from pwn import *
import traceback
from commands import getoutput
from patch64 import patch64_handler
from patch32 import patch32_handler
def check():
# Check seccomp-tools
if not os.path.exists('/usr/local/bin/seccomp-tools') :
print 'You should intsall seccomp-tools first!'
print 'Github address : https://github.com/david942j/seccomp-tools'
exit(0)
# Check Parameters
filename = ''
sandboxFile = ''
try:
filename = sys.argv[1]
sandboxFile = sys.argv[2]
except:
print 'Parameter missing...'
print 'Usage: python evil_patcher.py elfFile sandboxFile'
print ' python evil_patcher.py elfFile sandboxFile 1 (more detailed process message)'
exit(0)
# Check filename and sandboxFile
if not os.path.exists(filename):
print 'ELF file not exists!'
exit(0)
if not os.path.exists(sandboxFile):
print 'Sandbox file not exists!'
exit(0)
def main():
check()
filename = sys.argv[1]
sandboxFile = sys.argv[2]
debugFlag = 0
try:
tmp = sys.argv[3]
debugFlag = 1
except:
pass
arch = ELF(filename).arch
if arch == 'i386':
patch32_handler(filename, sandboxFile, debugFlag).run()
elif arch == 'amd64':
patch64_handler(filename, sandboxFile, debugFlag).run()
else:
print arch + ' is not supported!!! Only i386 and amd64!!!'
if __name__ == '__main__':
try:
main()
except Exception:
traceback.print_exc()
print 'If you find any bugs, please contact me with e-mail : [email protected]'
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。