PHP code
- <?
- $ Url = "http://www.taoav.com ";
- Include ("Snoopy. php ");
- $ Snoopy = new Snoopy;
- $ Snoopy-> fetch ($ URL); // get all content
- Echo $ Snoopy-> results; // display the result
- // Optional
- $ Snoopy-> fetchtext // get text content (remove HTML code)
- $ Snoopy-> fetchlinks // obtain the link
- $ Snoopy-> fetchform // obtain the form
- ?>
Form submission
PHP code
- <? PHP
- $ Formvars ["username"] = "admin ";
- $ Formvars ["PWD"] = "admin ";
- $ Action = "http://www.taoav.com"; // form submission address
- $ Snoopy-> submit ($ action, $ formvars); // $ formvars is the submitted Array
- Echo $ Snoopy-> results; // obtain the result returned after the form is submitted.
- // Optional
- $ Snoopy-> submittext; // after submission, only the HTML-removed text is returned.
- $ Snoopy-> submitlinks; // after submission, only the link is returned.
- ?>
Since the form has been submitted, we can do a lot of things. Next we will disguise the IP address and the browser.
Disguise
PHP code
- <? PHP
- $ Formvars ["username"] = "admin ";
- $ Formvars ["PWD"] = "admin ";
- $ Action = "http://www.taoav.com ";
- Include "Snoopy. php ";
- $ Snoopy = new Snoopy;
- $ Snoopy-> Cookies ["PHPSESSID"] = 'fc0000b1918bd522cc863f000090e6fff7 '; // disguise sessionid
- $ Snoopy-> agent = "(compatible; MSIE 4.01; MSN 2.5; AOL 4.0; Windows 98)"; // camouflage Browser
- $ Snoopy-> Referer = http://www.php100.com; // camouflage Source Page address http_referer
- $ Snoopy-> rawheaders ["Pragma"] = "no-Cache"; // The HTTP header information of the cache
- $ Snoopy-> rawheaders ["x_forwarded_for"] = "127.0.0.101"; // disguise IP Address
- $ Snoopy-> submit ($ action, $ formvars );
- Echo $ Snoopy-> results;
- ?>
In the past, we could disguise session as a Web browser and IP address, and Haha could do a lot of things.
For example, you can vote for an IP address with a verification code.
PS: here, the disguised IP address is actually an HTTP header, so the IP address obtained through remote_addr cannot be disguised,
Instead, IP addresses obtained through HTTP headers (which can prevent proxies) can be created by themselves.
Let's briefly describe how to use the Verification Code:
First, use a normal browser to view the page and find the sessionid corresponding to the Verification code,
Write down sessionid and verification code value at the same time,
Next, we will use Snoopy to forge.
Principle: because it is the same sessionid, the verification code obtained is the same as the one entered for the first time.
Sometimes we may need to forge more things, and Snoopy comes to mind completely for us.
PHP code
- <? PHP
- $ Snoopy-> proxy_host = "www.php100.com ";
- $ Snoopy-> proxy_port = "8080"; // use a proxy
- $ Snoopy-> maxredirs = 2; // redirect times
- $ Snoopy-> expandlinks = true; // whether to complete the link is often used during collection
- // For example, the link for/images/taoav.gif can be changed to its full link http://www.taoav.com/images/taoav.gif
- $ Snoopy-> maxframes = 5 // maximum number of frames allowed
- // When capturing the frame, $ Snoopy-> results returns an array.
- $ Snoopy-> error // error message returned
- ?>