Version 0.2.8
This commit is contained in:
parent
f4274e1e82
commit
9a58a915c2
36 changed files with 1885 additions and 819 deletions
|
@ -9,8 +9,8 @@ import datetime
|
|||
from pappyproxy.http import Request, post_request
|
||||
from pappyproxy.util import PappyException
|
||||
from pappyproxy.requestcache import RequestCache
|
||||
from pappyproxy.console import print_requests
|
||||
from pappyproxy.pappy import heapstats, cons
|
||||
from pappyproxy.util import print_requests
|
||||
from pappyproxy.pappy import heapstats, session
|
||||
from pappyproxy.plugin import require_modules
|
||||
from twisted.internet import defer
|
||||
|
||||
|
@ -97,7 +97,7 @@ def big_fucking_data_file(line):
|
|||
def time_cmd(line):
|
||||
print 'Timing `%s`...' % line
|
||||
start = datetime.datetime.now()
|
||||
cons.onecmd(line.strip())
|
||||
session.cons.onecmd(line.strip())
|
||||
end = datetime.datetime.now()
|
||||
total_time = (end-start).total_seconds()
|
||||
print '`{0}` took {1:.3f} seconds'.format(line, total_time)
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
import crochet
|
||||
import pappyproxy
|
||||
|
||||
from pappyproxy.console import confirm
|
||||
from pappyproxy.util import PappyException
|
||||
from pappyproxy.util import PappyException, confirm
|
||||
from pappyproxy.http import Request
|
||||
from twisted.internet import defer
|
||||
|
||||
|
|
|
@ -3,9 +3,8 @@ import pappyproxy
|
|||
import shlex
|
||||
|
||||
from pappyproxy.plugin import active_intercepting_macros, add_intercepting_macro, remove_intercepting_macro
|
||||
from pappyproxy.console import load_reqlist
|
||||
from pappyproxy.macros import load_macros, macro_from_requests, gen_imacro
|
||||
from pappyproxy.util import PappyException
|
||||
from pappyproxy.util import PappyException, load_reqlist
|
||||
from twisted.internet import defer
|
||||
|
||||
loaded_macros = []
|
||||
|
|
|
@ -10,7 +10,7 @@ from pappyproxy.util import PappyException
|
|||
from pappyproxy.macros import InterceptMacro
|
||||
from pappyproxy.http import Request, Response
|
||||
from pappyproxy.plugin import add_intercepting_macro, remove_intercepting_macro
|
||||
from pappyproxy import comm, config
|
||||
from pappyproxy import pappy
|
||||
from twisted.internet import defer
|
||||
|
||||
PLUGIN_ID="manglecmds"
|
||||
|
@ -126,8 +126,8 @@ def check_reqid(reqid):
|
|||
defer.returnValue(None)
|
||||
|
||||
def start_editor(reqid):
|
||||
script_loc = os.path.join(config.PAPPY_DIR, "plugins", "vim_repeater", "repeater.vim")
|
||||
subprocess.call(["vim", "-S", script_loc, "-c", "RepeaterSetup %s %d"%(reqid, comm.comm_port)])
|
||||
script_loc = os.path.join(pappy.session.config.pappy_dir, "plugins", "vim_repeater", "repeater.vim")
|
||||
subprocess.call(["vim", "-S", script_loc, "-c", "RepeaterSetup %s %d"%(reqid, pappy.session.comm_port)])
|
||||
|
||||
####################
|
||||
## Command functions
|
||||
|
@ -163,6 +163,8 @@ def intercept(line):
|
|||
intercept_requests = True
|
||||
if any(a in rsp_names for a in args):
|
||||
intercept_responses = True
|
||||
if not args:
|
||||
intercept_requests = True
|
||||
|
||||
if intercept_requests and intercept_responses:
|
||||
intercept_str = 'Requests and responses'
|
||||
|
|
|
@ -3,11 +3,10 @@ import pappyproxy
|
|||
import shlex
|
||||
|
||||
from pappyproxy.colors import Colors, Styles, path_formatter, host_color, scode_color, verb_color
|
||||
from pappyproxy.console import confirm, load_reqlist, Capturing
|
||||
from pappyproxy.util import PappyException, remove_color
|
||||
from pappyproxy.util import PappyException, remove_color, confirm, load_reqlist, Capturing
|
||||
from pappyproxy.macros import InterceptMacro
|
||||
from pappyproxy.requestcache import RequestCache
|
||||
from pappyproxy.pappy import cons
|
||||
from pappyproxy.pappy import session
|
||||
from pappyproxy.plugin import add_intercepting_macro, remove_intercepting_macro
|
||||
from twisted.internet import defer
|
||||
from twisted.enterprise import adbapi
|
||||
|
@ -76,7 +75,7 @@ def gencerts(line):
|
|||
Generate CA cert and private CA file
|
||||
Usage: gencerts [/path/to/put/certs/in]
|
||||
"""
|
||||
dest_dir = line or pappyproxy.config.CERT_DIR
|
||||
dest_dir = line or pappyproxy.pappy.session.config.cert_dir
|
||||
message = "This will overwrite any existing certs in %s. Are you sure?" % dest_dir
|
||||
if not confirm(message, 'n'):
|
||||
return False
|
||||
|
@ -94,9 +93,9 @@ def log(line):
|
|||
verbosity = int(line.strip())
|
||||
except:
|
||||
verbosity = 1
|
||||
pappyproxy.config.DEBUG_VERBOSITY = verbosity
|
||||
pappyproxy.pappy.session.config.debug_verbosity = verbosity
|
||||
raw_input()
|
||||
pappyproxy.config.DEBUG_VERBOSITY = 0
|
||||
pappyproxy.pappy.session.config.debug_verbosity = 0
|
||||
|
||||
@crochet.wait_for(timeout=None)
|
||||
@defer.inlineCallbacks
|
||||
|
@ -182,7 +181,7 @@ def watch_proxy(line):
|
|||
|
||||
def run_without_color(line):
|
||||
with Capturing() as output:
|
||||
cons.onecmd(line.strip())
|
||||
session.cons.onecmd(line.strip())
|
||||
print remove_color(output.val)
|
||||
|
||||
def load_cmds(cmd):
|
||||
|
|
|
@ -3,8 +3,7 @@ import pappyproxy
|
|||
import shlex
|
||||
|
||||
from pappyproxy.plugin import main_context_ids
|
||||
from pappyproxy.console import load_reqlist
|
||||
from pappyproxy.util import PappyException
|
||||
from pappyproxy.util import PappyException, load_reqlist
|
||||
from twisted.internet import defer
|
||||
from pappyproxy.http import Request
|
||||
|
||||
|
|
|
@ -7,8 +7,7 @@ import pprint
|
|||
import shlex
|
||||
import urllib
|
||||
|
||||
from pappyproxy.console import load_reqlist, print_table, print_request_rows, get_req_data_row
|
||||
from pappyproxy.util import PappyException, utc2local
|
||||
from pappyproxy.util import PappyException, utc2local, load_reqlist, print_table, print_request_rows, get_req_data_row
|
||||
from pappyproxy.http import Request, repeatable_parse_qs
|
||||
from twisted.internet import defer
|
||||
from pappyproxy.plugin import main_context_ids
|
||||
|
@ -270,6 +269,8 @@ def view_request_info(line):
|
|||
Usage: view_request_info <reqid(s)>
|
||||
"""
|
||||
args = shlex.split(line)
|
||||
if not args:
|
||||
raise PappyException("Request id is required")
|
||||
reqids = args[0]
|
||||
|
||||
reqs = yield load_reqlist(reqids)
|
||||
|
@ -287,6 +288,8 @@ def view_request_headers(line):
|
|||
Usage: view_request_headers <reqid(s)>
|
||||
"""
|
||||
args = shlex.split(line)
|
||||
if not args:
|
||||
raise PappyException("Request id is required")
|
||||
reqid = args[0]
|
||||
|
||||
reqs = yield load_reqlist(reqid)
|
||||
|
@ -307,6 +310,8 @@ def view_full_request(line):
|
|||
Usage: view_full_request <reqid(s)>
|
||||
"""
|
||||
args = shlex.split(line)
|
||||
if not args:
|
||||
raise PappyException("Request id is required")
|
||||
reqid = args[0]
|
||||
|
||||
reqs = yield load_reqlist(reqid)
|
||||
|
@ -326,6 +331,8 @@ def view_request_bytes(line):
|
|||
Usage: view_request_bytes <reqid(s)>
|
||||
"""
|
||||
args = shlex.split(line)
|
||||
if not args:
|
||||
raise PappyException("Request id is required")
|
||||
reqid = args[0]
|
||||
|
||||
reqs = yield load_reqlist(reqid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue