Version 0.2.12
This commit is contained in:
parent
992edab315
commit
f28ab4fe96
32 changed files with 2324 additions and 754 deletions
649
docs/build/html/overview.html
vendored
649
docs/build/html/overview.html
vendored
|
@ -6,7 +6,7 @@
|
|||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
|
||||
<title>The Pappy Proxy — Pappy Proxy 0.2.0 documentation</title>
|
||||
<title>The Pappy Proxy — Pappy Proxy 0.2.11 documentation</title>
|
||||
|
||||
<link rel="stylesheet" href="_static/classic.css" type="text/css" />
|
||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||
|
@ -14,7 +14,7 @@
|
|||
<script type="text/javascript">
|
||||
var DOCUMENTATION_OPTIONS = {
|
||||
URL_ROOT: './',
|
||||
VERSION: '0.2.0',
|
||||
VERSION: '0.2.11',
|
||||
COLLAPSE_INDEX: false,
|
||||
FILE_SUFFIX: '.html',
|
||||
HAS_SOURCE: true
|
||||
|
@ -23,7 +23,7 @@
|
|||
<script type="text/javascript" src="_static/jquery.js"></script>
|
||||
<script type="text/javascript" src="_static/underscore.js"></script>
|
||||
<script type="text/javascript" src="_static/doctools.js"></script>
|
||||
<link rel="top" title="Pappy Proxy 0.2.0 documentation" href="index.html" />
|
||||
<link rel="top" title="Pappy Proxy 0.2.11 documentation" href="index.html" />
|
||||
<link rel="next" title="The Pappy Proxy Tutorial" href="tutorial.html" />
|
||||
<link rel="prev" title="Welcome to Pappy Proxy’s documentation!" href="index.html" />
|
||||
</head>
|
||||
|
@ -43,7 +43,7 @@
|
|||
<li class="right" >
|
||||
<a href="index.html" title="Welcome to Pappy Proxy’s documentation!"
|
||||
accesskey="P">previous</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="index.html">Pappy Proxy 0.2.0 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-0"><a href="index.html">Pappy Proxy 0.2.11 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
@ -84,6 +84,8 @@ contributing code and plugins are extremely easy to integrate as a core
|
|||
feature. So you can also contribute by writing a plugin and letting me
|
||||
know about it. You can find out more by looking at <a class="reference external" href="https://roglew.github.io/pappy-proxy/pappyplugins.html">the official plugin
|
||||
docs</a>.</p>
|
||||
<p>You can find ideas for features to add on <a class="reference external" href="https://roglew.github.io/pappy-proxy/contributing.html">the contributing page in the
|
||||
docs</a>.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="how-to-use-it">
|
||||
|
@ -94,7 +96,7 @@ docs</a>.</p>
|
|||
<code class="docutils literal"><span class="pre">pip</span></code> or some other command that can handle a <code class="docutils literal"><span class="pre">setup.py</span></code> with
|
||||
requirements. Once the requirements are installed, you can check that it
|
||||
installed correctly by running <code class="docutils literal"><span class="pre">pappy</span> <span class="pre">-l</span></code> to start the proxy.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>$ git clone --recursive https://github.com/roglew/pappy-proxy.git
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>$ git clone --recursive https://github.com/roglew/pappy-proxy.git
|
||||
$ cd pappy-proxy
|
||||
$ pip install .
|
||||
</pre></div>
|
||||
|
@ -106,7 +108,7 @@ $ pip install .
|
|||
exported responses, plugin data, etc. will be placed in the current
|
||||
directory so it’s good to give your project a directory of its own. To
|
||||
start a project, do something like:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>$ mkdir test_project
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>$ mkdir test_project
|
||||
$ cd test_project
|
||||
$ pappy
|
||||
Copying default config to directory
|
||||
|
@ -134,7 +136,7 @@ a temporary data file in <code class="docutils literal"><span class="pre">/tmp</
|
|||
be deleted. If you want to run Pappy in lite mode, run Pappy with either
|
||||
<code class="docutils literal"><span class="pre">-l</span></code> or <code class="docutils literal"><span class="pre">--lite</span></code>.</p>
|
||||
<p>Example:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>$ pappy -l
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>$ pappy -l
|
||||
Temporary datafile is /tmp/tmpw4mGv2
|
||||
Proxy is listening on port 8000
|
||||
pappy> quit
|
||||
|
@ -228,6 +230,132 @@ proxy. The following fields can be used to configure the proxy:</p>
|
|||
</table>
|
||||
<p>See the default <code class="docutils literal"><span class="pre">config.json</span></code> for examples.</p>
|
||||
</div>
|
||||
<div class="section" id="general-console-techniques">
|
||||
<h2>General Console Techniques<a class="headerlink" href="#general-console-techniques" title="Permalink to this headline">¶</a></h2>
|
||||
<p>There are a few tricks you can use in general when using Pappy’s
|
||||
console. Most of these are provided by the
|
||||
<a class="reference external" href="https://docs.python.org/2/library/cmd.html">cmd</a> and
|
||||
<a class="reference external" href="https://pythonhosted.org/cmd2/index.html">cmd2</a>.</p>
|
||||
<div class="section" id="run-a-shell-command">
|
||||
<h3>Run a shell command<a class="headerlink" href="#run-a-shell-command" title="Permalink to this headline">¶</a></h3>
|
||||
<p>You can run a shell command with <code class="docutils literal"><span class="pre">!</span></code>:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>pappy> ls
|
||||
ID Verb Host Path S-Code Req Len Rsp Len Time Mngl
|
||||
5 GET vitaly.sexy /netscape.gif 304 Not Modified 0 0 0.08 --
|
||||
4 GET vitaly.sexy /esr1.jpg 304 Not Modified 0 0 0.07 --
|
||||
3 GET vitaly.sexy /construction.gif 304 Not Modified 0 0 0.07 --
|
||||
2 GET vitaly.sexy /vitaly2.jpg 0 N/A -- --
|
||||
1 GET vitaly.sexy / 304 Not Modified 0 0 0.07 --
|
||||
pappy> !ls
|
||||
cmdhistory config.json data.db
|
||||
pappy>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="running-python-code">
|
||||
<h3>Running Python Code<a class="headerlink" href="#running-python-code" title="Permalink to this headline">¶</a></h3>
|
||||
<p>You can use the <code class="docutils literal"><span class="pre">py</span></code> command to either run python code or to drop down
|
||||
to a Python shell.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>pappy> py print ':D '*10
|
||||
:D :D :D :D :D :D :D :D :D :D
|
||||
pappy> py
|
||||
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
|
||||
[GCC 4.8.2] on linux2
|
||||
Type "help", "copyright", "credits" or "license" for more information.
|
||||
(ProxyCmd)
|
||||
|
||||
py <command>: Executes a Python command.
|
||||
py: Enters interactive Python mode.
|
||||
End with ``Ctrl-D`` (Unix) / ``Ctrl-Z`` (Windows), ``quit()``, '`exit()``.
|
||||
Non-python commands can be issued with ``cmd("your command")``.
|
||||
Run python code from external files with ``run("filename.py")``
|
||||
|
||||
>>> from pappyproxy import config
|
||||
>>> config.CONFIG_DICT
|
||||
{u'data_file': u'./data.db', u'history_size': 1000, u'cert_dir': u'{DATADIR}/certs', u'proxy_listeners': [{u'interface': u'127.0.0.1', u'port': 8000}]}
|
||||
>>> exit()
|
||||
pappy>
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="redirect-output-to-file">
|
||||
<h3>Redirect Output To File<a class="headerlink" href="#redirect-output-to-file" title="Permalink to this headline">¶</a></h3>
|
||||
<p>You can use <code class="docutils literal"><span class="pre">></span></code> to direct output to a file. However, a number of
|
||||
commands use colored output. If you just redirect these to a file, there
|
||||
will be additional bytes which represent the ANSI color codes. To get
|
||||
around this, use the <code class="docutils literal"><span class="pre">nocolor</span></code> command to remove the color from the
|
||||
command output.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>pappy> ls > ls.txt
|
||||
pappy> !xxd -c 32 -g 4 ls.txt
|
||||
0000000: 1b5b316d 1b5b346d 49442020 56657262 2020486f 73742020 20202020 20202050 .[1m.[4mID Verb Host P
|
||||
0000020: 61746820 20202020 20202020 20202020 2020532d 436f6465 20202020 20202020 ath S-Code
|
||||
0000040: 20202020 52657120 4c656e20 20527370 204c656e 20205469 6d652020 20204d6e Req Len Rsp Len Time Mn
|
||||
0000060: 676c2020 1b5b306d 0a352020 201b5b33 366d4745 541b5b30 6d202020 1b5b3931 gl .[0m.5 .[36mGET.[0m .[91
|
||||
0000080: 6d766974 616c792e 73657879 1b5b306d 20201b5b 33366d1b 5b306d2f 1b5b3334 mvitaly.sexy.[0m .[36m.[0m/.[34
|
||||
00000a0: 6d6e6574 73636170 652e6769 661b5b30 6d202020 2020201b 5b33356d 33303420 mnetscape.gif.[0m .[35m304
|
||||
00000c0: 4e6f7420 4d6f6469 66696564 1b5b306d 20203020 20202020 20202030 20202020 Not Modified.[0m 0 0
|
||||
00000e0: 20202020 302e3038 20202020 2d2d2020 20200a34 2020201b 5b33366d 4745541b 0.08 -- .4 .[36mGET.
|
||||
0000100: 5b306d20 20201b5b 39316d76 6974616c 792e7365 78791b5b 306d2020 1b5b3336 [0m .[91mvitaly.sexy.[0m .[36
|
||||
0000120: 6d1b5b30 6d2f1b5b 33346d65 7372312e 6a70671b 5b306d20 20202020 20202020 m.[0m/.[34mesr1.jpg.[0m
|
||||
0000140: 201b5b33 356d3330 34204e6f 74204d6f 64696669 65641b5b 306d2020 30202020 .[35m304 Not Modified.[0m 0
|
||||
0000160: 20202020 20302020 20202020 2020302e 30372020 20202d2d 20202020 0a332020 0 0.07 -- .3
|
||||
0000180: 201b5b33 366d4745 541b5b30 6d202020 1b5b3931 6d766974 616c792e 73657879 .[36mGET.[0m .[91mvitaly.sexy
|
||||
00001a0: 1b5b306d 20201b5b 33366d1b 5b306d2f 1b5b3334 6d636f6e 73747275 6374696f .[0m .[36m.[0m/.[34mconstructio
|
||||
00001c0: 6e2e6769 661b5b30 6d20201b 5b33356d 33303420 4e6f7420 4d6f6469 66696564 n.gif.[0m .[35m304 Not Modified
|
||||
00001e0: 1b5b306d 20203020 20202020 20202030 20202020 20202020 302e3037 20202020 .[0m 0 0 0.07
|
||||
0000200: 2d2d2020 20200a32 2020201b 5b33366d 4745541b 5b306d20 20201b5b 39316d76 -- .2 .[36mGET.[0m .[91mv
|
||||
0000220: 6974616c 792e7365 78791b5b 306d2020 1b5b3336 6d1b5b30 6d2f1b5b 33346d76 italy.sexy.[0m .[36m.[0m/.[34mv
|
||||
0000240: 6974616c 79322e6a 70671b5b 306d2020 20202020 201b5b33 366d3230 30204f4b italy2.jpg.[0m .[36m200 OK
|
||||
0000260: 1b5b306d 20202020 20202020 20202020 30202020 20202020 20323033 34303033 .[0m 0 2034003
|
||||
0000280: 20203135 352e3131 20202d2d 20202020 0a312020 201b5b33 366d4745 541b5b30 155.11 -- .1 .[36mGET.[0
|
||||
00002a0: 6d202020 1b5b3931 6d766974 616c792e 73657879 1b5b306d 20201b5b 33366d1b m .[91mvitaly.sexy.[0m .[36m.
|
||||
00002c0: 5b306d2f 1b5b3334 6d1b5b30 6d202020 20202020 20202020 20202020 2020201b [0m/.[34m.[0m .
|
||||
00002e0: 5b33356d 33303420 4e6f7420 4d6f6469 66696564 1b5b306d 20203020 20202020 [35m304 Not Modified.[0m 0
|
||||
0000300: 20202030 20202020 20202020 302e3037 20202020 2d2d2020 20200a 0 0.07 -- .
|
||||
pappy> nocolor ls > ls2.txt
|
||||
pappy> !xxd -c 32 -g 4 ls2.txt
|
||||
0000000: 49442020 56657262 2020486f 73742020 20202020 20202050 61746820 20202020 ID Verb Host Path
|
||||
0000020: 20202020 20202020 2020532d 436f6465 20202020 20202020 20202020 52657120 S-Code Req
|
||||
0000040: 4c656e20 20527370 204c656e 20205469 6d652020 20204d6e 676c2020 0a352020 Len Rsp Len Time Mngl .5
|
||||
0000060: 20474554 20202076 6974616c 792e7365 78792020 2f6e6574 73636170 652e6769 GET vitaly.sexy /netscape.gi
|
||||
0000080: 66202020 20202033 3034204e 6f74204d 6f646966 69656420 20302020 20202020 f 304 Not Modified 0
|
||||
00000a0: 20203020 20202020 20202030 2e303820 2020202d 2d202020 200a3420 20204745 0 0.08 -- .4 GE
|
||||
00000c0: 54202020 76697461 6c792e73 65787920 202f6573 72312e6a 70672020 20202020 T vitaly.sexy /esr1.jpg
|
||||
00000e0: 20202020 33303420 4e6f7420 4d6f6469 66696564 20203020 20202020 20202030 304 Not Modified 0 0
|
||||
0000100: 20202020 20202020 302e3037 20202020 2d2d2020 20200a33 20202047 45542020 0.07 -- .3 GET
|
||||
0000120: 20766974 616c792e 73657879 20202f63 6f6e7374 72756374 696f6e2e 67696620 vitaly.sexy /construction.gif
|
||||
0000140: 20333034 204e6f74 204d6f64 69666965 64202030 20202020 20202020 30202020 304 Not Modified 0 0
|
||||
0000160: 20202020 20302e30 37202020 202d2d20 2020200a 32202020 47455420 20207669 0.07 -- .2 GET vi
|
||||
0000180: 74616c79 2e736578 7920202f 76697461 6c79322e 6a706720 20202020 20203230 taly.sexy /vitaly2.jpg 20
|
||||
00001a0: 30204f4b 20202020 20202020 20202020 30202020 20202020 20323033 34303033 0 OK 0 2034003
|
||||
00001c0: 20203135 352e3131 20202d2d 20202020 0a312020 20474554 20202076 6974616c 155.11 -- .1 GET vital
|
||||
00001e0: 792e7365 78792020 2f202020 20202020 20202020 20202020 20202033 3034204e y.sexy / 304 N
|
||||
0000200: 6f74204d 6f646966 69656420 20302020 20202020 20203020 20202020 20202030 ot Modified 0 0 0
|
||||
0000220: 2e303720 2020202d 2d202020 200a0a .07 -- ..
|
||||
pappy>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>If you want to write the contents of a request or response to a file,
|
||||
don’t use <code class="docutils literal"><span class="pre">nocolor</span></code> with <code class="docutils literal"><span class="pre">vfq</span></code> or <code class="docutils literal"><span class="pre">vfs</span></code>. Use just the <code class="docutils literal"><span class="pre">vbq</span></code> or
|
||||
<code class="docutils literal"><span class="pre">vbs</span></code> commands.</p>
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="8%" />
|
||||
<col width="92%" />
|
||||
</colgroup>
|
||||
<thead valign="bottom">
|
||||
<tr class="row-odd"><th class="head">Command</th>
|
||||
<th class="head">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody valign="top">
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">nocolor</span></code></td>
|
||||
<td>Run a command and print its output without ASCII escape codes. Intended for use when redirecting output to a file. Should only be used with text and not with binary data.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="generating-pappy-s-ca-cert">
|
||||
<h2>Generating Pappy’s CA Cert<a class="headerlink" href="#generating-pappy-s-ca-cert" title="Permalink to this headline">¶</a></h2>
|
||||
<p>In order to intercept and modify requests to sites that use HTTPS, you
|
||||
|
@ -259,9 +387,9 @@ argument to have it put the generated certs in a different directory.</p>
|
|||
<p>The following commands can be used to view requests and responses</p>
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="40%" />
|
||||
<col width="4%" />
|
||||
<col width="7%" />
|
||||
<col width="89%" />
|
||||
<col width="56%" />
|
||||
</colgroup>
|
||||
<thead valign="bottom">
|
||||
<tr class="row-odd"><th class="head">Command</th>
|
||||
|
@ -274,30 +402,74 @@ argument to have it put the generated certs in a different directory.</p>
|
|||
<td>list, ls</td>
|
||||
<td>List requests that are in the current context (see Context section). Has information like the host, target path, and status code. With no arguments, it will print the 25 most recent requests in the current context. If you pass ‘a’ or ‘all’ as an argument, it will print all the requests in the current context. If you pass a number “n” as an argument, it will print the n most recent requests in the current context.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">sm</span></code></td>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">sm</span></code> [p]</td>
|
||||
<td>sm, site_map</td>
|
||||
<td>Print a tree showing the site map. It will display all requests in the current context that did not have a 404 response.</td>
|
||||
<td>Print a tree showing the site map. It will display all requests in the current context that did not have a 404 response. This has to go through all of the requests in the current context so it may be slow. If the <code class="docutils literal"><span class="pre">p</span></code> option is given, it will print the paths as paths rather than as a tree.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">viq</span> <span class="pre"><id(s)></span></code></td>
|
||||
<td>view_request_info, viq</td>
|
||||
<td>View additional information about requests. Includes the target port, if SSL was used, applied tags, and other information.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">vfq</span> <span class="pre"><id(s)></span></code></td>
|
||||
<td>view_full_request, vfq</td>
|
||||
<td>view_full_request, vfq, kjq</td>
|
||||
<td>[V]iew [F]ull Re[Q]uest, prints the full request including headers and data.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">vbq</span> <span class="pre"><id(s)></span></code></td>
|
||||
<td>view_request_bytes, vbq</td>
|
||||
<td>[V]iew [B]ytes of Re[Q]uest, prints the full request including headers and data without coloring or additional newlines. Use this if you want to write a request to a file.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">ppq</span> <span class="pre"><format></span> <span class="pre"><id(s)></span></code></td>
|
||||
<td>pretty_print_request, ppq</td>
|
||||
<td>Pretty print a request with a specific format. See the table below for a list of formats.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">vhq</span> <span class="pre"><id(s)></span></code></td>
|
||||
<td>view_request_headers, vhq</td>
|
||||
<td>[V]iew [H]eaders of a Re[Q]uest. Prints just the headers of a request.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">vfs</span> <span class="pre"><id(s)></span></code></td>
|
||||
<td>view_full_response, vfs</td>
|
||||
<td>view_full_response, vfs, kjs</td>
|
||||
<td>[V]iew [F]ull Re[S]ponse, prints the full response associated with a request including headers and data.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">vhs</span> <span class="pre"><id(s)></span></code></td>
|
||||
<td>view_response_headers, vhs</td>
|
||||
<td>[V]iew [H]eaders of a Re[S]ponse. Prints just the headers of a response associated with a request.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">vbs</span> <span class="pre"><id(s)></span></code></td>
|
||||
<td>view_response_bytes, vbs</td>
|
||||
<td>[V]iew [B]ytes of Re[S]ponse, prints the full response including headers and data without coloring or additional newlines. Use this if you want to write a response to a file.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">pps</span> <span class="pre"><format></span> <span class="pre"><id(s)></span></code></td>
|
||||
<td>pretty_print_response, pps</td>
|
||||
<td>Pretty print a response with a specific format. See the table below for a list of formats.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">pprm</span> <span class="pre"><id(s)></span></code></td>
|
||||
<td>print_params, pprm</td>
|
||||
<td>Print a summary of the parameters submitted with the request. It will include URL params, POST params, and/or cookies</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">pri</span> <span class="pre">[ct]</span> <span class="pre">[key(s)]</span> <span class="pre">|</span> <span class="pre">param_info,</span> <span class="pre">pri</span> <span class="pre">|</span> <span class="pre">Print</span> <span class="pre">a</span> <span class="pre">summary</span> <span class="pre">of</span> <span class="pre">the</span> <span class="pre">parameters</span> <span class="pre">and</span> <span class="pre">values</span> <span class="pre">submitted</span> <span class="pre">by</span> <span class="pre">in-context</span> <span class="pre">requests.</span> <span class="pre">You</span> <span class="pre">can</span> <span class="pre">pass</span> <span class="pre">in</span> <span class="pre">keys</span> <span class="pre">to</span> <span class="pre">limit</span> <span class="pre">which</span> <span class="pre">values</span> <span class="pre">will</span> <span class="pre">be</span> <span class="pre">shown.</span> <span class="pre">If</span> <span class="pre">you</span> <span class="pre">also</span> <span class="pre">provide</span></code>ct<code class="docutils literal"><span class="pre">as</span> <span class="pre">the</span> <span class="pre">first</span> <span class="pre">argument,</span> <span class="pre">it</span> <span class="pre">will</span> <span class="pre">include</span> <span class="pre">any</span> <span class="pre">keys</span> <span class="pre">that</span> <span class="pre">are</span> <span class="pre">passed</span> <span class="pre">as</span> <span class="pre">arguments.</span> <span class="pre">|</span> <span class="pre">|</span></code>watch`</td>
|
||||
<td>watch</td>
|
||||
<td>Print requests and responses in real time as they pass through the proxy.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Available formats for <code class="docutils literal"><span class="pre">ppq</span></code> and <code class="docutils literal"><span class="pre">pps</span></code> commands:</p>
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="17%" />
|
||||
<col width="83%" />
|
||||
</colgroup>
|
||||
<thead valign="bottom">
|
||||
<tr class="row-odd"><th class="head">Format</th>
|
||||
<th class="head">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody valign="top">
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">form</span></code></td>
|
||||
<td>Print POST data submitted from a form (normal post data)</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">json</span></code></td>
|
||||
<td>Print as JSON</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>The table shown by <code class="docutils literal"><span class="pre">ls</span></code> will have the following columns:</p>
|
||||
|
@ -484,24 +656,24 @@ will be a part of the current context.</p>
|
|||
<p>Filter strings define a condition that a request/response pair must pass
|
||||
to be part of the context. Most filter strings have the following
|
||||
format:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><field> <comparer> <value>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><field> <comparer> <value>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Where <code class="docutils literal"><span class="pre"><field></span></code> is some part of the request/response, <code class="docutils literal"><span class="pre"><comparer></span></code>
|
||||
is some comparison to <code class="docutils literal"><span class="pre"><value></span></code>. For example, if you wanted a filter
|
||||
that only matches requests to <code class="docutils literal"><span class="pre">target.org</span></code>, you could use the
|
||||
following filter string:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="n">host</span> <span class="ow">is</span> <span class="n">target</span><span class="o">.</span><span class="n">org</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">host</span> <span class="ow">is</span> <span class="n">target</span><span class="o">.</span><span class="n">org</span>
|
||||
|
||||
<span class="n">field</span> <span class="o">=</span> <span class="s">"host"</span>
|
||||
<span class="n">comparer</span> <span class="o">=</span> <span class="s">"is"</span>
|
||||
<span class="n">value</span> <span class="o">=</span> <span class="s">"target.org"</span>
|
||||
<span class="n">field</span> <span class="o">=</span> <span class="s2">"host"</span>
|
||||
<span class="n">comparer</span> <span class="o">=</span> <span class="s2">"is"</span>
|
||||
<span class="n">value</span> <span class="o">=</span> <span class="s2">"target.org"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Also <strong>if you prefix a comparer with ‘n’ it turns it into a negation.</strong>
|
||||
Using the previous example, the following will match any request except
|
||||
for ones where the host contains <code class="docutils literal"><span class="pre">target.org</span></code>:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>host nis target.org
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>host nis target.org
|
||||
|
||||
field = "host"
|
||||
comparer = "nis"
|
||||
|
@ -510,7 +682,7 @@ value = "target.org"
|
|||
</div>
|
||||
<p>For fields that are a list of key/value pairs (headers, get params, post
|
||||
params, and cookies) you can use the following format:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><field> <comparer1> <value1>[ <comparer2> <value2>]
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><field> <comparer1> <value1>[ <comparer2> <value2>]
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>This is a little more complicated. If you don’t give comparer2/value2,
|
||||
|
@ -518,7 +690,7 @@ the filter will pass any pair where the key or the value matches
|
|||
comparer1 and value1. If you do give comparer2/value2, the key must
|
||||
match comparer1/value1 and the value must match comparer2/value2 For
|
||||
example:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>Filter A:
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>Filter A:
|
||||
cookie contains Session
|
||||
|
||||
Filter B:
|
||||
|
@ -571,6 +743,16 @@ Matches both A and B but not C
|
|||
<td>The body (data section) of either the request or the response</td>
|
||||
<td>String</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td>reqbody</td>
|
||||
<td>qbody, qdata, qbd, qdt</td>
|
||||
<td>The body (data section) of th request</td>
|
||||
<td>String</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td>rspbody</td>
|
||||
<td>sbody, sdata, sbd, sdt</td>
|
||||
<td>The body (data section) of th response</td>
|
||||
<td>String</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td>verb</td>
|
||||
<td>verb, vb</td>
|
||||
<td>The HTTP verb of the request (ie GET, POST)</td>
|
||||
|
@ -586,6 +768,16 @@ Matches both A and B but not C
|
|||
<td>An HTTP header (ie User-Agent, Basic-Authorization) in the request or response</td>
|
||||
<td>Key/Value</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td>reqheader</td>
|
||||
<td>reqheader, qhd</td>
|
||||
<td>An HTTP header in the request</td>
|
||||
<td>Key/Value</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td>rspheader</td>
|
||||
<td>rspheader, shd</td>
|
||||
<td>An HTTP header in the response</td>
|
||||
<td>Key/Value</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td>rawheaders</td>
|
||||
<td>rawheaders, rh</td>
|
||||
<td>The entire header section (as one string) of either the head or the response</td>
|
||||
|
@ -697,8 +889,23 @@ can still negate these.</p>
|
|||
<td>after, af</td>
|
||||
<td>Filters out any request that is not before the given request. Filters out any request without a time.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td>inv</td>
|
||||
<td>inf</td>
|
||||
<td>Inverts a filter string. Anything that matches the filter string will not pass the filter.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>Examples:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>Only show requests before request 1234
|
||||
f b4 1234
|
||||
|
||||
Only show requests after request 1234
|
||||
f af 1234
|
||||
|
||||
Show requests without a csrf parameter
|
||||
f inv param ct csrf
|
||||
</pre></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="scope">
|
||||
|
@ -789,6 +996,129 @@ The <code class="docutils literal"><span class="pre">fbi</span></code> command a
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="decoding-strings">
|
||||
<h2>Decoding Strings<a class="headerlink" href="#decoding-strings" title="Permalink to this headline">¶</a></h2>
|
||||
<p>These features try to fill a similar role to Burp’s decoder. Each
|
||||
command will automatically copy the results to the clipboard. In
|
||||
addition, if no string is given, the commands will encode/decode
|
||||
whatever is already in the clipboard. Here is an example of how to
|
||||
base64 encode/decode a string.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>pappy> b64e "Hello World!"
|
||||
SGVsbG8gV29ybGQh
|
||||
pappy> b64d
|
||||
Hello World!
|
||||
pappy>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>And if the result contains non-printable characters, a hexdump will be
|
||||
produced instead</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>pappy> b64d ImALittleTeapot=
|
||||
0000 22 60 0b 8a db 65 79 37 9a a6 8b "`...ey7...
|
||||
|
||||
pappy>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The following commands can be used to encode/decode strings:</p>
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="12%" />
|
||||
<col width="16%" />
|
||||
<col width="72%" />
|
||||
</colgroup>
|
||||
<thead valign="bottom">
|
||||
<tr class="row-odd"><th class="head">Command</th>
|
||||
<th class="head">Aliases</th>
|
||||
<th class="head">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody valign="top">
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">base64_decode</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">base64_decode</span></code>, <code class="docutils literal"><span class="pre">b64d</span></code></td>
|
||||
<td>Base64 decode a string</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">base64_encode</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">base64_encode</span></code>, <code class="docutils literal"><span class="pre">b64e</span></code></td>
|
||||
<td>Base64 encode a string</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">asciihex_decode</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">asciihex_decode</span></code>, <code class="docutils literal"><span class="pre">ahd</span></code></td>
|
||||
<td>Decode an ASCII hex string</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">asciihex_encode</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">asciihex_encode</span></code>, <code class="docutils literal"><span class="pre">ahe</span></code></td>
|
||||
<td>Encode an ASCII hex string</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">html_decode</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">html_decode</span></code>, <code class="docutils literal"><span class="pre">htmld</span></code></td>
|
||||
<td>Decode an html encoded string</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">html_encode</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">html_encode</span></code>, <code class="docutils literal"><span class="pre">htmle</span></code></td>
|
||||
<td>Encode a string to html encode all of the characters</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">url_decode</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">url_decode</span></code>, <code class="docutils literal"><span class="pre">urld</span></code></td>
|
||||
<td>Url decode a string</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">url_encode</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">url_encode</span></code>, <code class="docutils literal"><span class="pre">urle</span></code></td>
|
||||
<td>Url encode a string</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">gzip_decode</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">gzip_decode</span></code>, <code class="docutils literal"><span class="pre">gzd</span></code></td>
|
||||
<td>Gzip decompress a string. Probably won’t work too well since there’s not a great way to get binary data passed in as an argument. I’m working on this.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">gzip_encode</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">gzip_encode</span></code>, <code class="docutils literal"><span class="pre">gze</span></code></td>
|
||||
<td>Gzip compress a string. Result doesn’t get copied to the clipboard.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">base64_decode_raw</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">base64_decode_raw</span></code>, <code class="docutils literal"><span class="pre">b64dr</span></code></td>
|
||||
<td>Same as <code class="docutils literal"><span class="pre">base64_decode</span></code> but will not print a hexdump if it contains non-printable characters. It is suggested you use <code class="docutils literal"><span class="pre">></span></code> to redirect the output to a file.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">base64_encode_raw</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">base64_encode_raw</span></code>, <code class="docutils literal"><span class="pre">b64er</span></code></td>
|
||||
<td>Same as <code class="docutils literal"><span class="pre">base64_encode</span></code> but will not print a hexdump if it contains non-printable characters. It is suggested you use <code class="docutils literal"><span class="pre">></span></code> to redirect the output to a file.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">asciihex_decode_raw</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">asciihex_decode_raw</span></code>, <code class="docutils literal"><span class="pre">ahdr</span></code></td>
|
||||
<td>Same as <code class="docutils literal"><span class="pre">asciihex_decode</span></code> but will not print a hexdump if it contains non-printable characters. It is suggested you use <code class="docutils literal"><span class="pre">></span></code> to redirect the output to a file.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">asciihex_encode_raw</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">asciihex_encode_raw</span></code>, <code class="docutils literal"><span class="pre">aher</span></code></td>
|
||||
<td>Same as <code class="docutils literal"><span class="pre">asciihex_encode</span></code> but will not print a hexdump if it contains non-printable characters. It is suggested you use <code class="docutils literal"><span class="pre">></span></code> to redirect the output to a file.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">html_decode_raw</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">html_decode_raw</span></code>, <code class="docutils literal"><span class="pre">htmldr</span></code></td>
|
||||
<td>Same as <code class="docutils literal"><span class="pre">html_decode</span></code> but will not print a hexdump if it contains non-printable characters. It is suggested you use <code class="docutils literal"><span class="pre">></span></code> to redirect the output to a file.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">html_encode_raw</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">html_encode_raw</span></code>, <code class="docutils literal"><span class="pre">htmler</span></code></td>
|
||||
<td>Same as <code class="docutils literal"><span class="pre">html_encode</span></code> but will not print a hexdump if it contains non-printable characters. It is suggested you use <code class="docutils literal"><span class="pre">></span></code> to redirect the output to a file.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">url_decode_raw</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">url_decode_raw</span></code>, <code class="docutils literal"><span class="pre">urldr</span></code></td>
|
||||
<td>Same as <code class="docutils literal"><span class="pre">url_decode</span></code> but will not print a hexdump if it contains non-printable characters. It is suggested you use <code class="docutils literal"><span class="pre">></span></code> to redirect the output to a file.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">url_encode_raw</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">url_encode_raw</span></code>, <code class="docutils literal"><span class="pre">urler</span></code></td>
|
||||
<td>Same as <code class="docutils literal"><span class="pre">url_encode</span></code> but will not print a hexdump if it contains non-printable characters. It is suggested you use <code class="docutils literal"><span class="pre">></span></code> to redirect the output to a file.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">gzip_decode_raw</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">gzip_decode_raw</span></code>, <code class="docutils literal"><span class="pre">gzdr</span></code></td>
|
||||
<td>Same as <code class="docutils literal"><span class="pre">gzip_decode</span></code> but will not print a hexdump if it contains non-printable characters. It is suggested you use <code class="docutils literal"><span class="pre">></span></code> to redirect the output to a file.</td>
|
||||
</tr>
|
||||
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">gzip_encode_raw</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">gzip_encode_raw</span></code>, <code class="docutils literal"><span class="pre">gzer</span></code></td>
|
||||
<td>Same as <code class="docutils literal"><span class="pre">gzip_encode</span></code> but will not print a hexdump if it contains non-printable characters. It is suggested you use <code class="docutils literal"><span class="pre">></span></code> to redirect the output to a file.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">unixtime_decode</span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">unixtime_decode</span></code>, <code class="docutils literal"><span class="pre">uxtd</span></code></td>
|
||||
<td>Take in a unix timestamp and print a human readable timestamp</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="interceptor">
|
||||
<h2>Interceptor<a class="headerlink" href="#interceptor" title="Permalink to this headline">¶</a></h2>
|
||||
<p>This feature is like Burp’s proxy with “Intercept Mode” turned on,
|
||||
|
@ -823,7 +1153,7 @@ default to <code class="docutils literal"><span class="pre">vi</span></code>.</p
|
|||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="highlight-python"><div class="highlight"><pre>Intercept both requests and responses:
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>Intercept both requests and responses:
|
||||
> ic requests responses
|
||||
> ic req rsp
|
||||
|
||||
|
@ -901,7 +1231,7 @@ make automated requests through the proxy and save them to the data
|
|||
file. A macro file is any python script file in the current directory
|
||||
that is in the form <code class="docutils literal"><span class="pre">macro_<name>.py</span></code>. An example project directory
|
||||
with macros would be:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>$ ls -l
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>$ ls -l
|
||||
-rw-r--r-- 1 scaryhacker wheel 150 Nov 26 11:17 config.json
|
||||
-rw------- 1 scaryhacker wheel 2639872 Nov 26 17:18 data.db
|
||||
-rw-r--r-- 1 scaryhacker wheel 471 Nov 26 18:42 macro_blank.py
|
||||
|
@ -914,15 +1244,15 @@ with macros would be:</p>
|
|||
<code class="docutils literal"><span class="pre">test</span></code> macro. A macro script is any python script that defines a
|
||||
<code class="docutils literal"><span class="pre">run_macro(args)</span></code> function and a <code class="docutils literal"><span class="pre">MACRO_NAME</span></code> variable. For example,
|
||||
a simple macro would be:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="c">### macro_print.py</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1">### macro_print.py</span>
|
||||
|
||||
<span class="n">MACRO_NAME</span> <span class="o">=</span> <span class="s">'Print Macro'</span>
|
||||
<span class="n">MACRO_NAME</span> <span class="o">=</span> <span class="s1">'Print Macro'</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">run_macro</span><span class="p">(</span><span class="n">args</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="n">args</span><span class="p">:</span>
|
||||
<span class="k">print</span> <span class="s">"Hello, </span><span class="si">%s</span><span class="s">!"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
||||
<span class="k">print</span> <span class="s2">"Hello, </span><span class="si">%s</span><span class="s2">!"</span> <span class="o">%</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">print</span> <span class="s">"Hello, Pappy!"</span>
|
||||
<span class="k">print</span> <span class="s2">"Hello, Pappy!"</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>You can place this macro in your project directory then load and run it
|
||||
|
@ -930,7 +1260,7 @@ from Pappy. When a macro is run, arguments are passed from the command
|
|||
line. Arguments are separated the same way as they are on the command
|
||||
line, so if you want to use spaces in your argument, you have to put
|
||||
quotes around it.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>$ pappy
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>$ pappy
|
||||
Proxy is listening on port 8000
|
||||
pappy> lma
|
||||
Loaded "<Macro Test Macro (tm/test)>"
|
||||
|
@ -955,7 +1285,7 @@ function will be run when it the macro gets loaded.</p>
|
|||
<h3>Generating Macros From Requests<a class="headerlink" href="#generating-macros-from-requests" title="Permalink to this headline">¶</a></h3>
|
||||
<p>You can also generate macros that have Pappy <code class="docutils literal"><span class="pre">Request</span></code> objects created
|
||||
with the same information as requests you’ve already made. For example:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>$ pappy
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>$ pappy
|
||||
Proxy is listening on port 8000
|
||||
pappy> ls
|
||||
ID Verb Host Path S-Code Req Len Rsp Len Time Mngl
|
||||
|
@ -1286,18 +1616,18 @@ can fix it.</p>
|
|||
requests in macros. It’s worth pointing out that <code class="docutils literal"><span class="pre">request_by_id</span></code> is
|
||||
useful for passing request objects as arguments. For example, here is a
|
||||
macro that lets you resubmit a request with the Google Bot user agent:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="c">## macro_googlebot.py</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1">## macro_googlebot.py</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">pappyproxy.http</span> <span class="kn">import</span> <span class="n">Request</span><span class="p">,</span> <span class="n">get_request</span><span class="p">,</span> <span class="n">post_request</span><span class="p">,</span> <span class="n">request_by_id</span>
|
||||
<span class="kn">from</span> <span class="nn">pappyproxy.context</span> <span class="kn">import</span> <span class="n">set_tag</span>
|
||||
<span class="kn">from</span> <span class="nn">pappyproxy.iter</span> <span class="kn">import</span> <span class="o">*</span>
|
||||
|
||||
<span class="n">MACRO_NAME</span> <span class="o">=</span> <span class="s">'Submit as Google'</span>
|
||||
<span class="n">SHORT_NAME</span> <span class="o">=</span> <span class="s">''</span>
|
||||
<span class="n">MACRO_NAME</span> <span class="o">=</span> <span class="s1">'Submit as Google'</span>
|
||||
<span class="n">SHORT_NAME</span> <span class="o">=</span> <span class="s1">''</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">run_macro</span><span class="p">(</span><span class="n">args</span><span class="p">):</span>
|
||||
<span class="n">req</span> <span class="o">=</span> <span class="n">request_by_id</span><span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
|
||||
<span class="n">req</span><span class="o">.</span><span class="n">headers</span><span class="p">[</span><span class="s">'User-Agent'</span><span class="p">]</span> <span class="o">=</span> <span class="s">"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"</span>
|
||||
<span class="n">req</span><span class="o">.</span><span class="n">headers</span><span class="p">[</span><span class="s1">'User-Agent'</span><span class="p">]</span> <span class="o">=</span> <span class="s2">"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"</span>
|
||||
<span class="n">req</span><span class="o">.</span><span class="n">submit</span><span class="p">()</span>
|
||||
<span class="n">req</span><span class="o">.</span><span class="n">save</span><span class="p">()</span>
|
||||
</pre></div>
|
||||
|
@ -1351,24 +1681,24 @@ which generates a deferred, then generate a deferred from
|
|||
used twisted before, please don’t try. Twisted is hard. Plus the mangled
|
||||
request will be saved before it is submitted anyways.</p>
|
||||
<p>Confusing? Here are some example intercepting macros:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="c">## int_cloud2butt.py</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1">## int_cloud2butt.py</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">string</span>
|
||||
|
||||
<span class="n">MACRO_NAME</span> <span class="o">=</span> <span class="s">'Cloud to Butt'</span>
|
||||
<span class="n">MACRO_NAME</span> <span class="o">=</span> <span class="s1">'Cloud to Butt'</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">mangle_response</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
|
||||
<span class="n">r</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">response</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
|
||||
<span class="n">r</span><span class="o">.</span><span class="n">raw_data</span> <span class="o">=</span> <span class="n">string</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">raw_data</span><span class="p">,</span> <span class="s">'cloud'</span><span class="p">,</span> <span class="s">'butt'</span><span class="p">)</span>
|
||||
<span class="n">r</span><span class="o">.</span><span class="n">raw_data</span> <span class="o">=</span> <span class="n">string</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">raw_data</span><span class="p">,</span> <span class="s">'Cloud'</span><span class="p">,</span> <span class="s">'Butt'</span><span class="p">)</span>
|
||||
<span class="n">r</span><span class="o">.</span><span class="n">raw_data</span> <span class="o">=</span> <span class="n">string</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">raw_data</span><span class="p">,</span> <span class="s1">'cloud'</span><span class="p">,</span> <span class="s1">'butt'</span><span class="p">)</span>
|
||||
<span class="n">r</span><span class="o">.</span><span class="n">raw_data</span> <span class="o">=</span> <span class="n">string</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">r</span><span class="o">.</span><span class="n">raw_data</span><span class="p">,</span> <span class="s1">'Cloud'</span><span class="p">,</span> <span class="s1">'Butt'</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">r</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="c">## int_donothing.py</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1">## int_donothing.py</span>
|
||||
|
||||
<span class="kn">import</span> <span class="nn">string</span>
|
||||
|
||||
<span class="n">MACRO_NAME</span> <span class="o">=</span> <span class="s">'Do Nothing'</span>
|
||||
<span class="n">MACRO_NAME</span> <span class="o">=</span> <span class="s1">'Do Nothing'</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">mangle_request</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="n">request</span>
|
||||
|
@ -1377,25 +1707,25 @@ request will be saved before it is submitted anyways.</p>
|
|||
<span class="k">return</span> <span class="n">request</span><span class="o">.</span><span class="n">response</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="c">## int_adminplz.py</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1">## int_adminplz.py</span>
|
||||
|
||||
<span class="kn">from</span> <span class="nn">base64</span> <span class="kn">import</span> <span class="n">base64encode</span> <span class="k">as</span> <span class="n">b64e</span>
|
||||
|
||||
<span class="n">MACRO_NAME</span> <span class="o">=</span> <span class="s">'Admin Session'</span>
|
||||
<span class="n">MACRO_NAME</span> <span class="o">=</span> <span class="s1">'Admin Session'</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">mangle_request</span><span class="p">(</span><span class="n">request</span><span class="p">):</span>
|
||||
<span class="n">r</span> <span class="o">=</span> <span class="n">request</span><span class="o">.</span><span class="n">copy</span><span class="p">()</span>
|
||||
<span class="n">r</span><span class="o">.</span><span class="n">headers</span><span class="p">[</span><span class="s">'Authorization'</span><span class="p">]</span> <span class="o">=</span> <span class="s">'Basic </span><span class="si">%s</span><span class="s">'</span> <span class="o">%</span> <span class="n">b64e</span><span class="p">(</span><span class="s">'Admin:Password123'</span><span class="p">)</span>
|
||||
<span class="n">r</span><span class="o">.</span><span class="n">headers</span><span class="p">[</span><span class="s1">'Authorization'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'Basic </span><span class="si">%s</span><span class="s1">'</span> <span class="o">%</span> <span class="n">b64e</span><span class="p">(</span><span class="s1">'Admin:Password123'</span><span class="p">)</span>
|
||||
<span class="k">return</span> <span class="n">r</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>In addition, you can use an <code class="docutils literal"><span class="pre">init(args)</span></code> function to get arguments
|
||||
from the command line. If no arguments are passed, args will be an empty
|
||||
list. Here is an example macro that does a search and replace:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="c">## int_replace.py</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1">## int_replace.py</span>
|
||||
|
||||
<span class="n">MACRO_NAME</span> <span class="o">=</span> <span class="s">'Find and Replace'</span>
|
||||
<span class="n">SHORT_NAME</span> <span class="o">=</span> <span class="s">''</span>
|
||||
<span class="n">MACRO_NAME</span> <span class="o">=</span> <span class="s1">'Find and Replace'</span>
|
||||
<span class="n">SHORT_NAME</span> <span class="o">=</span> <span class="s1">''</span>
|
||||
<span class="n">runargs</span> <span class="o">=</span> <span class="p">[]</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">init</span><span class="p">(</span><span class="n">args</span><span class="p">):</span>
|
||||
|
@ -1420,7 +1750,7 @@ list. Here is an example macro that does a search and replace:</p>
|
|||
<p>You can use this macro to do any search and replace that you want. For
|
||||
example, if you wanted to replace “Google” with “Skynet”, you can run
|
||||
the macro like this:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>pappy> lma
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>pappy> lma
|
||||
Loaded "<InterceptingMacro Find and Replace (replace)>"
|
||||
pappy> rim replace Google Skynet
|
||||
"Find and Replace" started
|
||||
|
@ -1522,6 +1852,10 @@ error checking.</p>
|
|||
<td><code class="docutils literal"><span class="pre">export</span></code></td>
|
||||
<td>Writes either the full request or response to a file in the current directory.</td>
|
||||
</tr>
|
||||
<tr class="row-even"><td><code class="docutils literal"><span class="pre">merge</span> <span class="pre"><dbfile></span></code></td>
|
||||
<td><code class="docutils literal"><span class="pre">merge</span></code></td>
|
||||
<td>Add all the requests from another datafile to the current datafile</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="section" id="response-streaming">
|
||||
|
@ -1547,58 +1881,58 @@ scripts. Still, it may not be a bad idea to try building a macro to do
|
|||
something in a quick and dirty way before writing a plugin since plugins
|
||||
are more complicated to write.</p>
|
||||
<p>A simple hello world plugin could be something like:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="c">## hello.py</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1">## hello.py</span>
|
||||
<span class="kn">import</span> <span class="nn">shlex</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">hello_world</span><span class="p">(</span><span class="n">line</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="n">line</span><span class="p">:</span>
|
||||
<span class="n">args</span> <span class="o">=</span> <span class="n">shlex</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
|
||||
<span class="k">print</span> <span class="s">'Hello, </span><span class="si">%s</span><span class="s">!'</span> <span class="o">%</span> <span class="p">(</span><span class="s">', '</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">args</span><span class="p">))</span>
|
||||
<span class="k">print</span> <span class="s1">'Hello, </span><span class="si">%s</span><span class="s1">!'</span> <span class="o">%</span> <span class="p">(</span><span class="s1">', '</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">args</span><span class="p">))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">print</span> <span class="s">"Hello, world!"</span>
|
||||
<span class="k">print</span> <span class="s2">"Hello, world!"</span>
|
||||
|
||||
<span class="c">###############</span>
|
||||
<span class="c">## Plugin hooks</span>
|
||||
<span class="c1">###############</span>
|
||||
<span class="c1">## Plugin hooks</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">load_cmds</span><span class="p">(</span><span class="n">cmd</span><span class="p">):</span>
|
||||
<span class="n">cmd</span><span class="o">.</span><span class="n">set_cmds</span><span class="p">({</span>
|
||||
<span class="s">'hello'</span><span class="p">:</span> <span class="p">(</span><span class="n">hello_world</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
|
||||
<span class="s1">'hello'</span><span class="p">:</span> <span class="p">(</span><span class="n">hello_world</span><span class="p">,</span> <span class="bp">None</span><span class="p">),</span>
|
||||
<span class="p">})</span>
|
||||
<span class="n">cmd</span><span class="o">.</span><span class="n">add_aliases</span><span class="p">([</span>
|
||||
<span class="p">(</span><span class="s">'hello'</span><span class="p">,</span> <span class="s">'hlo'</span><span class="p">),</span>
|
||||
<span class="p">(</span><span class="s">'hello'</span><span class="p">,</span> <span class="s">'ho'</span><span class="p">),</span>
|
||||
<span class="p">(</span><span class="s1">'hello'</span><span class="p">,</span> <span class="s1">'hlo'</span><span class="p">),</span>
|
||||
<span class="p">(</span><span class="s1">'hello'</span><span class="p">,</span> <span class="s1">'ho'</span><span class="p">),</span>
|
||||
<span class="p">])</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>You can also create commands which support autocomplete:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">shlex</span>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">shlex</span>
|
||||
|
||||
<span class="n">_AUTOCOMPLETE_NAMES</span> <span class="o">=</span> <span class="p">[</span><span class="s">'alice'</span><span class="p">,</span> <span class="s">'allie'</span><span class="p">,</span> <span class="s">'sarah'</span><span class="p">,</span> <span class="s">'mallory'</span><span class="p">,</span> <span class="s">'slagathor'</span><span class="p">]</span>
|
||||
<span class="n">_AUTOCOMPLETE_NAMES</span> <span class="o">=</span> <span class="p">[</span><span class="s1">'alice'</span><span class="p">,</span> <span class="s1">'allie'</span><span class="p">,</span> <span class="s1">'sarah'</span><span class="p">,</span> <span class="s1">'mallory'</span><span class="p">,</span> <span class="s1">'slagathor'</span><span class="p">]</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">hello_world</span><span class="p">(</span><span class="n">line</span><span class="p">):</span>
|
||||
<span class="k">if</span> <span class="n">line</span><span class="p">:</span>
|
||||
<span class="n">args</span> <span class="o">=</span> <span class="n">shlex</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="n">line</span><span class="p">)</span>
|
||||
<span class="k">print</span> <span class="s">'Hello, </span><span class="si">%s</span><span class="s">!'</span> <span class="o">%</span> <span class="p">(</span><span class="s">', '</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">args</span><span class="p">))</span>
|
||||
<span class="k">print</span> <span class="s1">'Hello, </span><span class="si">%s</span><span class="s1">!'</span> <span class="o">%</span> <span class="p">(</span><span class="s1">', '</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">args</span><span class="p">))</span>
|
||||
<span class="k">else</span><span class="p">:</span>
|
||||
<span class="k">print</span> <span class="s">"Hello, world!"</span>
|
||||
<span class="k">print</span> <span class="s2">"Hello, world!"</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">complete_hello_world</span><span class="p">(</span><span class="n">text</span><span class="p">,</span> <span class="n">line</span><span class="p">,</span> <span class="n">begidx</span><span class="p">,</span> <span class="n">endidx</span><span class="p">):</span>
|
||||
<span class="k">return</span> <span class="p">[</span><span class="n">n</span> <span class="k">for</span> <span class="n">n</span> <span class="ow">in</span> <span class="n">_AUTOCOMPLETE_NAMES</span> <span class="k">if</span> <span class="n">n</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="n">text</span><span class="p">)]</span>
|
||||
|
||||
<span class="c">###############</span>
|
||||
<span class="c">## Plugin hooks</span>
|
||||
<span class="c1">###############</span>
|
||||
<span class="c1">## Plugin hooks</span>
|
||||
|
||||
<span class="k">def</span> <span class="nf">load_cmds</span><span class="p">(</span><span class="n">cmd</span><span class="p">):</span>
|
||||
<span class="n">cmd</span><span class="o">.</span><span class="n">set_cmds</span><span class="p">({</span>
|
||||
<span class="s">'hello'</span><span class="p">:</span> <span class="p">(</span><span class="n">hello_world</span><span class="p">,</span> <span class="n">complete_hello_world</span><span class="p">),</span>
|
||||
<span class="s1">'hello'</span><span class="p">:</span> <span class="p">(</span><span class="n">hello_world</span><span class="p">,</span> <span class="n">complete_hello_world</span><span class="p">),</span>
|
||||
<span class="p">})</span>
|
||||
<span class="n">cmd</span><span class="o">.</span><span class="n">add_aliases</span><span class="p">([</span>
|
||||
<span class="p">(</span><span class="s">'hello'</span><span class="p">,</span> <span class="s">'hlo'</span><span class="p">),</span>
|
||||
<span class="p">(</span><span class="s1">'hello'</span><span class="p">,</span> <span class="s1">'hlo'</span><span class="p">),</span>
|
||||
<span class="p">])</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Then when you run Pappy you can use the <code class="docutils literal"><span class="pre">hello</span></code> command:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre>$ pappy -l
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>$ pappy -l
|
||||
Temporary datafile is /tmp/tmpBOXyJ3
|
||||
Proxy is listening on port 8000
|
||||
pappy> ho
|
||||
|
@ -1627,6 +1961,104 @@ you can write out commands that you use regularly but may not be worth
|
|||
creating a dedicated plugin for.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="global-settings">
|
||||
<h2>Global Settings<a class="headerlink" href="#global-settings" title="Permalink to this headline">¶</a></h2>
|
||||
<p>There are some settings that apply to Pappy as a whole and are stored in
|
||||
<code class="docutils literal"><span class="pre">~/.pappy/global_config.json</span></code>. These settings are generally for tuning
|
||||
performance or modifying behavior on a system-wide level. No information
|
||||
about projects is put in here since it is world readable. You can
|
||||
technically add settings in here for plugins that you write, but if it’s
|
||||
at all possible, please keep settings in the normal project config.</p>
|
||||
<p>Settings included in <code class="docutils literal"><span class="pre">~/.pappy/global_config.json</span></code>:</p>
|
||||
<table border="1" class="docutils">
|
||||
<colgroup>
|
||||
<col width="8%" />
|
||||
<col width="92%" />
|
||||
</colgroup>
|
||||
<thead valign="bottom">
|
||||
<tr class="row-odd"><th class="head">Setting</th>
|
||||
<th class="head">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody valign="top">
|
||||
<tr class="row-even"><td>cache_size</td>
|
||||
<td>The number of requests from history that will be included in memory at any given time. Set to -1 to keep everything in memory. See the request cache section for more info.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="section" id="using-a-socks-server">
|
||||
<h2>Using a SOCKS Server<a class="headerlink" href="#using-a-socks-server" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Pappy allows you to use an upstream SOCKS server. You can do this by
|
||||
adding a <code class="docutils literal"><span class="pre">socks_proxy</span></code> value to config.json. You can use the following
|
||||
for anonymous access to the proxy:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>"socks_proxy": {"host":"socks.proxy.host", "port":5555}
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>To use credentials you add a <code class="docutils literal"><span class="pre">username</span></code> and <code class="docutils literal"><span class="pre">password</span></code> value to the
|
||||
dictionary:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>"socks_proxy": {"host":"socks.proxy.host", "port":5555, "username": "mario", "password":"ilovemushrooms"}
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Anything that passes through any of the active listeners will use the
|
||||
proxy.</p>
|
||||
</div>
|
||||
<div class="section" id="transparent-host-redirection">
|
||||
<h2>Transparent Host Redirection<a class="headerlink" href="#transparent-host-redirection" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Sometimes you get a frustrating thick client that doesn’t let you mess
|
||||
with proxy settings to get it to go through a proxy. However, if you can
|
||||
redirect where it sends its traffic to localhost, you can get Pappy to
|
||||
take that traffic and redirect it to go where it should.</p>
|
||||
<p>It takes root permissions to listen on low numbered ports. As a result,
|
||||
we’ll need to do some root stuff to listen on ports 80 and 443 and get
|
||||
the data to Pappy. There are two ways to get the traffic to Pappy. The
|
||||
first is to set up port forwarding as root to send traffic from
|
||||
localhost:80 to localhost:8080 and localhost:443 to localhost:8443
|
||||
(since we can listen on 8080 and 8443 without root). Or you can YOLO,
|
||||
run Pappy as root and just have it listen on 80 and 443.</p>
|
||||
<p>According to Google you can use the following command to forward port 80
|
||||
on localhost to 8080 on Linux:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 80 -j REDIRECT --to-ports 8080
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Then to route 443 to 8443:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 443 -j REDIRECT --to-ports 8443
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Of course, both of these need to be run as root.</p>
|
||||
<p>Then on mac it’s</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>echo "
|
||||
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
|
||||
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443
|
||||
" | sudo pfctl -ef -
|
||||
Then to turn it off on mac it’s
|
||||
sudo pfctl -F all -f /etc/pf.conf
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Then modify the listener settings in the project’s config.json to be:</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>"proxy_listeners": [
|
||||
{"port": 8080, "interface": "127.0.0.1", "forward_host": "www.example.faketld"},
|
||||
{"port": 8443, "interface": "127.0.0.1", "forward_host_ssl": "www.example.faketld"},
|
||||
]
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>This configuration will cause Pappy to open a port on 8080 that will
|
||||
accept connections normally and a port on 8443 which will accept SSL
|
||||
connections. The forward_host setting tells Pappy to redirect any
|
||||
requests sent to the port to the given host. It will also update the
|
||||
request’s host header. forward_host_ssl does the same thing, but it
|
||||
listens for SSL connections and forces the connection to use SSL.</p>
|
||||
<p>Or if you’re going to YOLO it do the same thing then listen on port
|
||||
80/443 directly. I do not suggest you do this.</p>
|
||||
<div class="highlight-python"><div class="highlight"><pre><span></span>"proxy_listeners": [
|
||||
{"port": 80, "interface": "127.0.0.1", "forward_host": "www.example.faketld"},
|
||||
{"port": 443, "interface": "127.0.0.1", "forward_host_ssl": "www.example.faketld"},
|
||||
]
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Pappy will automatically use this host to make the connection and
|
||||
forward the request to the new server.</p>
|
||||
</div>
|
||||
<div class="section" id="faq">
|
||||
<h2>FAQ<a class="headerlink" href="#faq" title="Permalink to this headline">¶</a></h2>
|
||||
<div class="section" id="i-still-like-burp-but-pappy-looks-interesting-can-i-use-both">
|
||||
|
@ -1654,10 +2086,83 @@ it’s saved to disk, it will have an ID of <code class="docutils literal"><
|
|||
bit and it will get an ID you can use.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="boring-technical-stuff">
|
||||
<h2>Boring, Technical Stuff<a class="headerlink" href="#boring-technical-stuff" title="Permalink to this headline">¶</a></h2>
|
||||
<p>I do some stuff to try and keep speed and memory usage to reasonable
|
||||
levels. Unfortunately, things might seem slow in some areas. This is
|
||||
where I try and explain why those exist. Honestly, you probably don’t
|
||||
care about this, but I’d rather have it written down and have nobody
|
||||
read it than just leave people in the dark.</p>
|
||||
<div class="section" id="request-cache-memory-usage">
|
||||
<h3>Request Cache / Memory usage<a class="headerlink" href="#request-cache-memory-usage" title="Permalink to this headline">¶</a></h3>
|
||||
<p>For performance reasons, Pappy by default will not store every request
|
||||
in memory. The cache will store a certain number of the most recently
|
||||
accessed requests in memory. This means that if you go through all of
|
||||
history, it could be slow (for example running <code class="docutils literal"><span class="pre">ls</span> <span class="pre">a</span></code> or <code class="docutils literal"><span class="pre">sm</span></code>). If
|
||||
you have enough RAM to keep everything in memory, you can set the
|
||||
request cache size to -1 to just keep everything in memory. However,
|
||||
even if the cache size is unlimited, it still won’t load a request into
|
||||
memory untill you access it. So if you want to load everything in
|
||||
memory, run <code class="docutils literal"><span class="pre">ls</span> <span class="pre">a</span></code>.</p>
|
||||
<p>By default, Pappy will cache 2000 requests. This is kind of heavy, but
|
||||
it’s assumed you’re doing testing on a reasonably specced laptop.
|
||||
Personally, I live on the edge and use -1 until I run into memory
|
||||
issues.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="section" id="changelog">
|
||||
<h2>Changelog<a class="headerlink" href="#changelog" title="Permalink to this headline">¶</a></h2>
|
||||
<p>The boring part of the readme</p>
|
||||
<ul class="simple">
|
||||
<li>0.2.7<ul>
|
||||
<li>boring unit tests</li>
|
||||
<li>should make future releases more stable I guess</li>
|
||||
<li>Support for upstream SOCKS servers</li>
|
||||
<li><code class="docutils literal"><span class="pre">print_params</span></code> command</li>
|
||||
<li><code class="docutils literal"><span class="pre">inv</span></code> filter</li>
|
||||
<li><code class="docutils literal"><span class="pre">param_info</span></code> command</li>
|
||||
<li>Filters by request/response only headers/body</li>
|
||||
<li>Transparent host redirection</li>
|
||||
<li>Some easier to type aliases for common commands</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>0.2.6<ul>
|
||||
<li>Fix pip being dumb</li>
|
||||
<li><code class="docutils literal"><span class="pre">watch</span></code> command to watch requests/responses in real time</li>
|
||||
<li>Added <code class="docutils literal"><span class="pre">pp[qs]</span> <span class="pre">form</span> <span class="pre"><id></span></code> to print POST data</li>
|
||||
<li>Bugfixes</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>0.2.5<ul>
|
||||
<li>Requests sent with repeater now are given <code class="docutils literal"><span class="pre">repeater</span></code> tag</li>
|
||||
<li>Add ppq and pps commands</li>
|
||||
<li>Look at the pretty prompt</li>
|
||||
<li>Bugfixes</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>0.2.4<ul>
|
||||
<li>Add command history saving between sessions</li>
|
||||
<li>Add html encoder/decoder</li>
|
||||
<li>All the bugs were fixed so I added some more for 0.2.5</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>0.2.3<ul>
|
||||
<li>Decoder functions</li>
|
||||
<li>Add <code class="docutils literal"><span class="pre">merge</span></code> command</li>
|
||||
<li>Bugfixes</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>0.2.2<ul>
|
||||
<li>COLORS</li>
|
||||
<li>Performance improvements</li>
|
||||
<li>Bugfixes (duh)</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>0.2.1<ul>
|
||||
<li>Improve memory usage</li>
|
||||
<li>Tweaked plugin API</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>0.2.0<ul>
|
||||
<li>Lots of refactoring</li>
|
||||
<li>Plugins</li>
|
||||
|
@ -1702,6 +2207,12 @@ always be pappy time in your heart, I promise)</li>
|
|||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#configuration">Configuration</a></li>
|
||||
<li><a class="reference internal" href="#general-console-techniques">General Console Techniques</a><ul>
|
||||
<li><a class="reference internal" href="#run-a-shell-command">Run a shell command</a></li>
|
||||
<li><a class="reference internal" href="#running-python-code">Running Python Code</a></li>
|
||||
<li><a class="reference internal" href="#redirect-output-to-file">Redirect Output To File</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#generating-pappy-s-ca-cert">Generating Pappy’s CA Cert</a></li>
|
||||
<li><a class="reference internal" href="#browsing-recorded-requests-responses">Browsing Recorded Requests/Responses</a></li>
|
||||
<li><a class="reference internal" href="#tags">Tags</a></li>
|
||||
|
@ -1720,6 +2231,7 @@ always be pappy time in your heart, I promise)</li>
|
|||
<li><a class="reference internal" href="#built-in-filters">Built-In Filters</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#decoding-strings">Decoding Strings</a></li>
|
||||
<li><a class="reference internal" href="#interceptor">Interceptor</a></li>
|
||||
<li><a class="reference internal" href="#repeater">Repeater</a></li>
|
||||
<li><a class="reference internal" href="#macros">Macros</a><ul>
|
||||
|
@ -1741,11 +2253,18 @@ always be pappy time in your heart, I promise)</li>
|
|||
<li><a class="reference internal" href="#should-i-write-a-plugin-or-a-macro">Should I Write a Plugin or a Macro?</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#global-settings">Global Settings</a></li>
|
||||
<li><a class="reference internal" href="#using-a-socks-server">Using a SOCKS Server</a></li>
|
||||
<li><a class="reference internal" href="#transparent-host-redirection">Transparent Host Redirection</a></li>
|
||||
<li><a class="reference internal" href="#faq">FAQ</a><ul>
|
||||
<li><a class="reference internal" href="#i-still-like-burp-but-pappy-looks-interesting-can-i-use-both">I still like Burp, but Pappy looks interesting, can I use both?</a></li>
|
||||
<li><a class="reference internal" href="#why-does-my-request-have-an-id-of">Why does my request have an id of <code class="docutils literal"><span class="pre">--</span></code>?!?!</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#boring-technical-stuff">Boring, Technical Stuff</a><ul>
|
||||
<li><a class="reference internal" href="#request-cache-memory-usage">Request Cache / Memory usage</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference internal" href="#changelog">Changelog</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
@ -1796,12 +2315,12 @@ always be pappy time in your heart, I promise)</li>
|
|||
<li class="right" >
|
||||
<a href="index.html" title="Welcome to Pappy Proxy’s documentation!"
|
||||
>previous</a> |</li>
|
||||
<li class="nav-item nav-item-0"><a href="index.html">Pappy Proxy 0.2.0 documentation</a> »</li>
|
||||
<li class="nav-item nav-item-0"><a href="index.html">Pappy Proxy 0.2.11 documentation</a> »</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="footer" role="contentinfo">
|
||||
© Copyright 2015, Rob Glew.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.3.
|
||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.6.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue