在線查詢libc版本的網站:
https://libc.blukat.me/
一個python項目LibcSearcher
項目地址:https://github.com/lieanu/LibcSearcher
安裝
(下載比較慢,該項目依賴另外一個項目https://github.com/lieanu/libc-database)
git clone https://github.com/lieanu/LibcSearcher.git
cd LibcSearcher
python setup.py develop
這個項目我已經打包在下面地址了https://download.csdn.net/download/weixin_43833642/12507253(大概有500MB左右,從github上下要下到猴年馬月…)
from LibcSearcher import *
#第二個參數,爲已泄露的實際地址,或最後12位(比如:d90),int類型
obj = LibcSearcher("fgets", 0X7ff39014bd90)
obj.dump("system") #system 偏移
obj.dump("str_bin_sh") #/bin/sh 偏移
obj.dump("__libc_start_main_ret")
另一個用ruby開發的項目one_gadget
項目地址:https://github.com/david942j/one_gadget
安裝
需要ruby環境
sudo apt install ruby
gem install one_gadget
python中調用
import subprocess
def one_gadget(filename):
return map(int, subprocess.check_output(['one_gadget', '--raw', filename]).split(' '))
one_gadget('/lib/x86_64-linux-gnu/libc.so.6')