| はじめての自宅サーバ構築 - Fedora/CentOS - | Last Update | 2008/05/16 | |
| It opened to 2004/09/19. 当サイトはFedora9で運用しています |
Visitors Pageviews Today(IP/PV) |
3,251,070 12,000,159 1,539/8,816 |
|
デルではおとくなキャンペーン実施中! |
レノボ Web 広告限定ストア(キャンペーン&新着情報) |
設定ファイルの確認 # cat /proc/sys/kernel/exec-shield 1 設定ファイルの変更 # echo 2 > /proc/sys/kernel/exec-shield 設定ファイルの確認 # cat /proc/sys/kernel/exec-shield 2 上記数値の意味 0:常に無効 1:マークされたバイナリを有効にし、以外は無効 2:マークされたバイナリを無効にし、以外は有効 3:常に有効 |
libsafeのダウンロード
# wget http://pubs.research.avayalabs.com/src/libsafe-2.0-16.i386.rpm
--14:35:42-- http://pubs.research.avayalabs.com/src/libsafe-2.0-16.i386.rpm
=> `libsafe-2.0-16.i386.rpm'
pubs.research.avayalabs.com をDNSに問いあわせています... 198.152.240.29
pubs.research.avayalabs.com|198.152.240.29|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 374,371 (366K) [text/plain]
100%[===============================================>] 374,371 208.65K/s
14:35:44 (208.23 KB/s) - `libsafe-2.0-16.i386.rpm' を保存しました [374371/374371]
libsafeのインストール
# rpm -ivh libsafe-2.0-16.i386.rpm
Preparing... ########################################### [100%]
1:libsafe ########################################### [100%]
Adding libsafe to ld.so.preload for system wide protection
試験用のバッファオーバーフロー攻撃ツールをコピー
# cp /usr/doc/libsafe-2.0/exploits/t1 ./
libsafeのアンインストール
# rpm -e libsafe
Removing libsafe from /etc/ld.so.preload (if exists)
試験用のバッファオーバーフロー攻撃ツールを実行
# ./t1
This program tries to use strcpy() to overflow the buffer.
If you get a /bin/sh prompt, then the exploit has worked.
何かキーを押下する
Press any key to continue...
セグメンテーション違反です
セグメンテーション違反となり、バッファオーバーフローが抑止された
|
備考:バッファオーバーフローのサンプル
このままシステムを使用すると動作不安定の為、停止する可能性があります。
# ./t1
This program tries to use strcpy() to overflow the buffer.
If you get a /bin/sh prompt, then the exploit has worked.
Press any key to continue...
Libsafe version 2.0.16
Detected an attempt to write across stack boundary.
Terminating /root/t1.
uid=0 euid=0 pid=2590
Call stack:
0xbbb871 /lib/libsafe.so.2.0.16
0xbbb97a /lib/libsafe.so.2.0.16
0x80485bc /root/t1
0x80485d3 /root/t1
0x8abe1e /lib/tls/libc-2.3.4.so
Overflow caused by strcpy()
強制終了
|