一壶冒、論述題(3 ? 10分)
寫一段含有XSS漏洞的代碼,并寫出如何利用XSS漏洞來實行攻擊
寫出5種以上常見的安全配置錯誤的漏洞
- 不安全的默認配置
- 不完整的臨時配置
- 開源云存儲
- 錯誤的HTTP報頭配置
- 包含敏感信息的詳細錯誤信息
- 無線局域網(wǎng)的有哪幾種安全機制莉给?詳細說一下最安全的那種機制的加解密
二、代碼分析題(2 ? 10分)
- 代碼1:
<? php
include($_GET['test']);
?>
- 代碼2:
<?php
$target = $_GET['ip'];
$cmd = "ping -c 3 $target";
echo $cmd;
system($cmd);
?>
- 這兩段代碼存在什么漏洞祝辣?
- 這兩段代碼中的漏洞如何修復尿这?寫出修復代碼。
三允瞧、代碼分析題(2 ? 10分)
$is_upload = false;
$msg = null;
if (isset($_POST[ ' submit ' ])) {
if (file_exists(UPLOAD_PATH)) {
$deny_ext = array( ' .asp ' , ' .aspx' , ' .php ' , ' .jsp ' );
$file_name = trim($_FILES[ ' upload_file ' ][ ' name ' ]);
$file_name = deldot($file_name);//刪除文件名末尾的點
$file_ext = strrchr($file_name, ' . ');
$file_ext = strtolower($file_ext);//轉(zhuǎn)換為小寫
$file_ext = str_ireplace(' ::$DATA ', ' ', $file_ext);//去除字符串::$DATA
$file_ext = trim($file_ext);//收尾去空
if (!in_array($file_ext简软,$deny_ext)) {
$temp_file = $ FILES[ 'upload_file'][ 'tmp_name'];
$img_path = UPLOAD_PATH.' / '.date("YmdHis").rand(1000,9999).$file_ext;
if (move_uploaded_file($temp_file,$img_path)) {
$is_upload = true;
} else {
$msg = '上傳出錯! ';
}
} else {
$msg = ‘不允許上傳.asp,.aspx,.php,-jsp后綴文件! ';
}
- 文件上傳漏洞的原理和后果?
- 圖中代碼對上傳的文件做了哪些操作述暂?如何上傳文件才能使webshell成功上傳痹升?
四、代碼分析題(3 ? 10分)
HLOCAL h1,h2,h3,h4,h5,h6;
HANDLE hp;
hp = HeapCreate(0,0x1000,0x10000);
h1 = HeapAlloc(hp,HEAP_ZERO_MEMORY,8);
h2 = HeapAlloc(hp,HEAP_ZERO_MEMORY,8);
h3 = HeapAlloc(hp,HEAP_ZERO_MEMORY,8);
h4 = HeapAlloc(hp,HEAP_ZERO_MEMORY,8);
h5 = HeapAlloc(hp,HEAP_ZERO_MEMORY,8);
h6 = HeapAlloc(hp,HEAP_ZERO_MEMORY,8);
HeapFree(hp,0,h1);
HeapFree(hp,0,h3);
HeapFree(hp,0,h5);//此時freelist[2]包含三個空閑堆塊
h1 = HeapAlloc(hp,HEAP_ZERO_MEMORY,8);//考試題里好像沒有這句代碼畦韭,忘了忘了
- 詳細說明空表和快表
- 盡可能詳細地畫出圖中代碼的堆結(jié)構空間圖
- 說明DWORD SHOOT攻擊的方法视卢,可以畫圖輔助說明