From ed7ee40944326d1cddfe17bc5cd555a4fa9629c7 Mon Sep 17 00:00:00 2001 From: Rob Glew Date: Tue, 29 Dec 2015 00:38:51 -0600 Subject: [PATCH] Release 0.1.1 Bugfixes, new versioning system, fix up for pypi --- .gitignore | 2 +- MANIFEST.in | 6 +++++- README.md | 6 +++--- pappyproxy/config.py | 7 +++++-- pappyproxy/console.py | 3 +-- pappyproxy/default_user_config.json | 2 +- pappyproxy/macros.py | 1 - setup.py | 10 ++++++---- 8 files changed, 22 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 4168236..d1d307d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,4 @@ TAGS config.json build/* *.egg-info/* -.#* +.#* \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index f8f3b96..acf60c6 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,7 @@ include README.md include LICENSE.txt -recursive-include pappyproxy *.py *.vim \ No newline at end of file +include pappyproxy default_user_config.json +recursive-include pappyproxy *.py +recursive-include pappyproxy *.vim +recursive-include pappyproxy *.txt +include docs/source/overview.rst \ No newline at end of file diff --git a/README.md b/README.md index af4049b..ffb9454 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ $ Adding The CA Cert to Your Browser ---------------------------------- -In order for Pappy to view data sent using HTTPS, you need to add a generated CA cert (`certificate.crt`) to your browser. Certificates are generated using the `gencerts` command and are by default stored in the same directory as the main `pappy.py` script. This allows Pappy to act as a CA and sign any HTTPS certificate it wants without the browser complaining. This allows Pappy to decrypt and modify HTTPS requests. The certificate installation instructions are different for each browser. +In order for Pappy to view data sent using HTTPS, you need to add a generated CA cert (`certificate.crt`) to your browser. Certificates are generated using the `gencerts` command and are by default stored in `~/.pappy/certs`. This allows Pappy to act as a CA and sign any HTTPS certificate it wants without the browser complaining. This allows Pappy to decrypt and modify HTTPS requests. The certificate installation instructions are different for each browser. ### Firefox You can add the CA cert to Firefox by going to `Preferences -> Advanced -> View Certificates -> Authorities -> Import` and selecting the `certificate.crt` file in the `certs` directory. @@ -86,13 +86,13 @@ The following tokens will also be replaced with values: | Token | Replaced with | |:--|:--| -| `{PAPPYDIR}` | The directory where Pappy's files are stored | +| `{DATADIR}` | The directory where Pappy's data files are stored | See the default `config.json` for examples. Generating Pappy's CA Cert -------------------------- -In order to intercept and modify requests to sites that use HTTPS, you have to generate and install CA certs to your browser. You can do this by running the `gencerts` command in Pappy. By default, certs are stored in the same directory as Pappy's script files. This is also the default location that Pappy will look for certificates (unless you specify otherwise in `config.json`.) In addition, you can give the `gencerts` command an argument to have it put the generated certs in a different directory. +In order to intercept and modify requests to sites that use HTTPS, you have to generate and install CA certs to your browser. You can do this by running the `gencerts` command in Pappy. By default, certs are stored `~/.pappy/certs`. This is also the default location that Pappy will look for certificates (unless you specify otherwise in `config.json`.) In addition, you can give the `gencerts` command an argument to have it put the generated certs in a different directory. | Command | Description | |:--------|:------------| diff --git a/pappyproxy/config.py b/pappyproxy/config.py index ee0fd0b..14af0de 100644 --- a/pappyproxy/config.py +++ b/pappyproxy/config.py @@ -4,8 +4,9 @@ import os import shutil PAPPY_DIR = os.path.dirname(os.path.realpath(__file__)) +DATA_DIR = os.path.join(os.path.expanduser('~'), '.pappy') -CERT_DIR = PAPPY_DIR +CERT_DIR = os.path.join(DATA_DIR, 'certs') DATAFILE = 'data.db' DEBUG_DIR = None DEBUG_TO_FILE = False @@ -29,12 +30,14 @@ def load_settings(proj_config): global DEBUG_VERBOSITY global LISTENERS global PAPPY_DIR + global DATA_DIR global SSL_CA_FILE global SSL_PKEY_FILE # Substitution dictionary subs = {} - subs['PAPPYDIR'] = PAPPY_DIR + #subs['PAPPYDIR'] = PAPPY_DIR + subs['DATADIR'] = DATA_DIR # Data file settings if 'data_file' in proj_config: diff --git a/pappyproxy/console.py b/pappyproxy/console.py index cf04bc5..4f238a6 100644 --- a/pappyproxy/console.py +++ b/pappyproxy/console.py @@ -807,8 +807,7 @@ class ProxyCmd(cmd2.Cmd): def do_gencerts(self, line): dest_dir = line or pappyproxy.config.CERT_DIR message = "This will overwrite any existing certs in %s. Are you sure?" % dest_dir - answer = confirm(message, 'n') - if not answer or answer[0].lower() != 'y': + if not confirm(message, 'n'): return False print "Generating certs to %s" % dest_dir pappyproxy.proxy.generate_ca_certs(dest_dir) diff --git a/pappyproxy/default_user_config.json b/pappyproxy/default_user_config.json index 6bc85dd..8993bb8 100644 --- a/pappyproxy/default_user_config.json +++ b/pappyproxy/default_user_config.json @@ -1,6 +1,6 @@ { "data_file": "./data.db", - "cert_dir": "{PAPPYDIR}/certs", + "cert_dir": "{DATADIR}/certs", "proxy_listeners": [ {"port": 8000, "interface": "127.0.0.1"} ] diff --git a/pappyproxy/macros.py b/pappyproxy/macros.py index 21ad4f0..98b5be3 100644 --- a/pappyproxy/macros.py +++ b/pappyproxy/macros.py @@ -5,7 +5,6 @@ import random import re from pappyproxy import http -from pappyproxy import templates from pappyproxy import config from twisted.internet import defer from jinja2 import Environment, FileSystemLoader diff --git a/setup.py b/setup.py index a9a9bb5..2f453ea 100755 --- a/setup.py +++ b/setup.py @@ -1,21 +1,23 @@ #!/usr/bin/env python -from distutils.core import setup +import pkgutil +from setuptools import setup, find_packages setup(name='pappyproxy', - version='0.0.2', + version='0.1.1', description='The Pappy Intercepting Proxy', author='Rob Glew', author_email='rglew56@gmail.com', url='https://www.github.com/roglew/pappy-proxy', - packages=['pappyproxy'], + packages=['pappyproxy', 'pappyproxy.schema'], + include_package_data = True, license='MIT', entry_points = { 'console_scripts':['pappy = pappyproxy.pappy:start'], }, long_description=open('docs/source/overview.rst').read(), keywords='http proxy hacking 1337hax pwnurmum', - download_url='https://github.com/roglew/pappy-proxy/archive/0.0.2.tar.gz', + download_url='https://github.com/roglew/pappy-proxy/archive/0.1.1.tar.gz', install_requires=[ 'beautifulsoup4>=4.4.1', 'cmd2>=0.6.8',