Application of Snoopy

2010-04-28  来源:本站原创  分类:PHP  人气:322 

1 crawl content of the page fetch
2 pages of text crawl content (remove HTML tags) fetchtext
3 crawl pages link to form fetchlinks fetchform
4 support the proxy host
5 supports basic user name / password authentication
6 supports setting user_agent, referer (origin), cookies and header content (header file)
7 support for browser redirects, and can control the depth redirect
8 pages of links can expand into high-quality url (default)
9 to submit data and get the return value
HTML frame 10 to support tracking
11 when the transfer cookies to support redirection

1 to obtain the contents of the specified url
<? Php
$ Url = "http://www.youtube.com";
include ("snoopy.php");
$ Snoopy = new Snoopy;
$ Snoopy-> fetch ($ url); / / Get all elements
echo $ snoopy-> results; / / Display results
/ / Optional The following
$ Snoopy-> fetchtext / / Get the text content (remove the html code)
$ Snoopy-> fetchlinks / / Get the link
$ Snoopy-> fetchform / / Get the form
?>

2 form submission
<? Php
$ Formvars ["username"] = "admin";
$ Formvars ["pwd"] = "admin";

$ Action = "http://www.taoav.com"; / / form submission address
$ Snoopy-> submit ($ action, $ formvars );//$ formvars for the submission of an array
echo $ snoopy-> results; / / get the form to submit the results to return after
/ / Optional The following
$ Snoopy-> submittext; / / return removed only after the submission of the text html
$ Snoopy-> submitlinks; / / only return after the submission link
?>

3 camouflage
<? Php
$ Formvars ["username"] = "admin";
$ Formvars ["pwd"] = "admin";
$ Action = "http://www.taoav.com";
include "snoopy.php";
$ Snoopy = new Snoopy;
$ Snoopy-> cookies ["PHPSESSID"] = 'fc106b1918bd522cc863f36890e6fff7'; / / camouflage sessionid
$ Snoopy-> agent = "(compatible; MSIE 4.01; MSN 2.5; AOL 4.0; Windows 98)"; / / camouflage browser
$ Snoopy-> referer = "http://www.only4.cn"; / / disguise the source page address http_referer
$ Snoopy-> rawheaders ["Pragma"] = "no-cache"; / / cache of http header
$ Snoopy-> rawheaders ["X_FORWARDED_FOR"] = "127.0.0.101"; / / mask ip
$ Snoopy-> submit ($ action, $ formvars);
echo $ snoopy-> results;
?>

We can disguise the original browser session camouflage, camouflage ip, haha can do a lot of things.
For example, with a verification code to verify ip to vote, you can stop the vote.
ps: Here camouflage ip, http header is camouflage, so generally obtained through REMOTE_ADDR ip is not disguised,
It is those who get through the http header ip's (which can prevent the kind of agent) can themselves create ip.
On how to verify the code, it simply follows:
First using an ordinary browser, view the page, find the authentication code corresponding to the sessionid,
Also note the sessionid and authentication code value
Then on to forge with snoopy.
Principle: Because it is made with a sessionid verification code and the first input is the same.

4 Sometimes we may need to fake something more, snoopy completely reminds us of
<? Php
$ Snoopy-> proxy_host = "www.only4.cn";
$ Snoopy-> proxy_port = "8080"; / / Use a proxy

$ Snoopy-> maxredirs = 2; / / redirection number

$ Snoopy-> expandlinks = true; / / whether the completion time of the link often used in the acquisition of
/ / Example link for the / images / taoav.gif can be changed to link it all [img] http://www.taoav.com/images/taoav.gif [/ img]

$ Snoopy-> maxframes = 5 / / maximum allowed number of frame
/ / Note the time frame grab $ snoopy-> results returned is an array

$ Snoopy-> error / / return error message
?>

相关文章
  • Application of Snoopy 2010-04-28

    1 crawl content of the page fetch 2 pages of text crawl content (remove HTML tags) fetchtext 3 crawl pages link to form fetchlinks fetchform 4 support the proxy host 5 supports basic user name / password authentication 6 supports setting user_agent,

  • Build flex + spring + blazeds + hibernate application 2009-02-27

    Build flex + spring + blazeds + hibernate application First, set up the project blazeds 1, will blazeds.war extract to a directory, such as: myflex /; 2, set up java works were such as: MyFlex, in the orientation of selection create project from exis

  • log4j easy application in java 2009-02-27

    JAVA development, frequently used the log output, in a so-called most of the software company will have its own set of configuration style, re-read the configuration file to initialize property of the log, it will be good, but sometimes may not need

  • Building Scalable java EE application (2) 2009-02-28

    When the number of concurrent users marked the beginning of growth, you may be dissatisfied with a single machine can provide the performance, or because of a single JVM instance gc restrictions, you can not expand your java application, in such circ

  • Principle and Application of Ajax 2009-03-16

    In writing this article before, once wrote an essay about AJAX technologies, but involves a very narrow aspect of AJAX technology background, principles, advantages and disadvantages and other aspects is rarely associated with null. The background to

  • ror opensource project open source rails application 2009-03-17

    warehouse management http://www.warehouseapp.com/ version Boxroom sharing and managing files online online document management and sharing application http://boxroom.rubyforge.org/ Osirails. With a small-scale ERP systems including some ERP features

  • Dash: from FiveRuns a new application metrics Ruby Service 2009-03-22

    Dash , FiveRuns Provided a new measure of monitoring services, has been moved to individual beta version (you can apply), to allow interested developers to participate in assessment in a new way to monitor your application. This comes from the new se

  • A server simultaneously run multiple different versions of Rails application [to Taiwan thegiive article] 2009-03-24

    http://lightyror.thegiive.net/2007/04/rails-version.html, following its original content. Rails site now using, Version divided into several faction. 0.x 1.0 1.1 1.2 Rails 0.X is a few years ago began to use the Rails at the ancestor of the domestic

  • ExtJs easy application 2009-03-25

    Extjs application required the introduction of extjs in the page style and extjs library file, style file for the resources / css / ext-all.css, extjs the js library file consists of two major, adapter / ext / ext-base.js and ext - all.js, one of ext

  • JAVA foundation: In order to build Web Services Struts application 2009-04-01

    Here, I will briefly introduce the next Struts Architecture and Model - View - Controller (MVC). Struts encourages the Model - View - Controller design paradigm to build up basic applications. Struts view through the ActionForm with Struts controller

  • JavaScript is an object-oriented MVC-based framework for the implementation of non-absolute [original] [add precision application] 2009-04-04

    Author: Topcss QQ: 419074376 E-mail: andpai1.0 @ gmail.com Time :2009-03-08 Just look at JavaEye News Monthly - January 2009 - No. 11 overall, he saw a surprise, there is JS-based implementation of the MVC framework, because should not the Internet (

  • Through the secondary cache to speed up your hibernate application 2009-04-19

    Keywords: hibernate second cache Flanging edge because I also learn, there is nothing inevitable place undue Translations are welcome to U.S. criticism Original Title: Speed Up Your Hibernate Application with Second-Level Caching Original Source: htt

  • At ajax application data exchanged between 2009-04-20

    In this article, I will introduce one for the Ajax client and server to transfer data between the main method, and compare the traditional model of Web applications with the Ajax model differences. In addition, the text will also be explored at the s

  • XBRL application software classification 2009-04-22

    XBRL application software classification Http://xbrlchina.blog.sohu.com/38322354.html see at a blog, in turn: 1) Classification standard editing software (Taxonomy editor): Classification criteria are the basis of XBRL technology, each country adopti

  • Acegi at SSH (Struts + Spring + Hibernate) primary application of 2009-04-27

    Last week, about Acegi security framework of the SSH application in the beginning because Acegi configuration file loading mode confusion a few days, in the end is added to the form of plug-in configuration file struts struts -config.xml In statement

  • Custom-made for JSF Application Framework (1) 2009-05-09

    JavaServer Faces (JSF) are used for Java ™ Web application is the first standardized user interface framework. The Seam is a powerful extension of JSF Application Framework. In this consists of three parts of the new series of the first articles were

  • Struts, Spring, Hibernate Web application development 4 2009-05-11

    This article is taken from: http://www.blogjava.net/jacky9881/archive/2008/01/16/175701.html This section describes how to use SSH framework Validator framework, Validator framework based on the xml file to configure the validation rules, it relies m

  • Struts, Spring, Hibernate Web application development 3 2009-05-11

    This article is taken from: http://www.blogjava.net/jacky9881/archive/2008/01/02/172088.html At two, we give this simple web application to increase transaction statement, statement of the original transaction EJB are proud of the place, it is now Sp

  • Struts, Spring, Hibernate Web Application Development 2 2009-05-11

    This article is taken from: http://www.blogjava.net/jacky9881/archive/2008/01/02/172086.html 1. We have finished building the basic framework, then add the log function, simply amend the original web.xml, some additional configuration information: 1<

  • Struts, Spring, Hibernate Web application development 1 2009-05-11

    This article is taken from: http://www.blogjava.net/jacky9881/archive/2008/01/02/172076.html This Web application is very simple implementation of a user registration page, when users register at register.jsp enter information page, point to preserve