AFL 實戰(二) 測試python

2021-10-07 14:43:44 字數 1115 閱讀 2578

cpython是用c語言實現的python直譯器。作為官方實現,它是最廣泛使用的python直譯器。專案原始碼

apt-get update

sudo

apt-get

install -y build-essential libncursesw5-dev libreadline-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev libbz2-dev zlib1g-dev libffi-dev

git clone

cd cpython

配置

對於完整的專案,需要將編譯器指定為 afl-gcc,然後再進行編譯。

./configure cc=

"afl-gcc" cxx=

"afl-g++"

make

fuzz

正式執行 fuzz 測試的命令如下:

mkdir

in# 在in檔案下下建立python的語料庫

afl-fuzz -m none -i in -o out ./python @@

測試結果

配置

./configure

make

make

test

sudo

make

install

啟用qemu模式,要先編譯。

# 進入到aflplusplus所在位置

cd qemu_mode

./build_qemu_support.sh

fuzz
afl-fuzz -q -m none -i in -o out ./python @@
測試結果

《pytest測試實戰》筆記 二

pytest與unittest對比 pytest unittest assert something asserttrue something assert a b assertequal a,b assert a b assertlessequal a,b pytest有乙個重要的功能,它可以重寫...

Python爬蟲實戰(二)

實驗介紹 本實驗通過使用beautifulsoup方法對網頁進行簡單的爬取工作,並對beatifulsoup方法進行簡單的介紹。beautifulsoup開發手冊 示例網頁如下 實驗內容 從本地網頁爬取商品資訊,商品名,評分等級等相關資訊 實驗 from bs4 import beautifulso...

Python 入門實戰(二)

牛優果暑期python入門實戰第二彈 實戰時遇到的任何問題都可以在上課的時候向老師提出詢問!入門實戰第一彈問題回顧 計算1,3,5 97,99所有數字的總和 解法1 while 迴圈語句 sum 0 i 1 while i 100 sum sum i i i 2 print sum 詳解 首先初始化...