Version 0.2.11
This commit is contained in:
parent
9d274de709
commit
992edab315
17 changed files with 551 additions and 84 deletions
|
@ -1,7 +1,4 @@
|
|||
from pappyproxy.http import Request, get_request, post_request, request_by_id
|
||||
from pappyproxy.plugin import main_context_ids
|
||||
from pappyproxy.context import set_tag
|
||||
from pappyproxy.iter import *
|
||||
{% include 'macroheader.py.template' %}
|
||||
|
||||
## Iterator cheat sheet:
|
||||
# fuzz_path_trav() - Values for fuzzing path traversal
|
||||
|
@ -11,8 +8,6 @@ from pappyproxy.iter import *
|
|||
# common_usernames() - Common usernames
|
||||
# fuzz_dirs() - Common web paths (ie /wp-admin)
|
||||
|
||||
MACRO_NAME = '{{macro_name}}'
|
||||
SHORT_NAME = '{{short_name}}'
|
||||
{% if req_lines %}
|
||||
###########
|
||||
## Requests
|
||||
|
|
27
pappyproxy/templates/macro_header.py.template
Normal file
27
pappyproxy/templates/macro_header.py.template
Normal file
|
@ -0,0 +1,27 @@
|
|||
from pappyproxy.session import Session
|
||||
|
||||
MACRO_NAME = '{{macro_name}}'
|
||||
SHORT_NAME = '{{short_name}}'
|
||||
runargs = []
|
||||
|
||||
def init(args):
|
||||
global runargs
|
||||
runargs = args
|
||||
|
||||
def modify_header(msg, key, val):
|
||||
"""
|
||||
Modifies the header in a request or a response if it already exists in
|
||||
the message
|
||||
"""
|
||||
if key in msg.headers:
|
||||
msg.headers[key] = val
|
||||
|
||||
def mangle_request(request):
|
||||
global runargs
|
||||
modify_header(request, 'headername', 'headerval')
|
||||
return request
|
||||
|
||||
def mangle_response(request):
|
||||
global runargs
|
||||
modify_header(request.response, 'headername', 'headerval')
|
||||
return request.response
|
34
pappyproxy/templates/macro_resubmit.py.template
Normal file
34
pappyproxy/templates/macro_resubmit.py.template
Normal file
|
@ -0,0 +1,34 @@
|
|||
import sys
|
||||
{% include 'macroheader.py.template' %}
|
||||
|
||||
def run_macro(args):
|
||||
# Get IDs of in-context requests
|
||||
reqids = main_context_ids()
|
||||
reqids.reverse() # Resubmit earliest first
|
||||
reqs = []
|
||||
|
||||
# Create session jar (uncomment jar functions to use)
|
||||
#jar = Session() # Create a cookie jar
|
||||
|
||||
# Iterate over each request and submit it
|
||||
for rid in reqids:
|
||||
print rid,
|
||||
sys.stdout.flush()
|
||||
r = request_by_id(rid)
|
||||
r = r.copy()
|
||||
|
||||
#jar.apply_req(r) # Apply headers/cookies from the cookie jar
|
||||
|
||||
#####################
|
||||
# Modify request here
|
||||
|
||||
r.submit()
|
||||
#jar.save_rsp(r.response, save_all=True) # Update the cookie jar from the response
|
||||
|
||||
#r.save() # Save the request to the data file
|
||||
reqs.append(r)
|
||||
|
||||
print ''
|
||||
|
||||
# Store the requests in memory
|
||||
set_tag('resubmit', reqs)
|
8
pappyproxy/templates/macroheader.py.template
Normal file
8
pappyproxy/templates/macroheader.py.template
Normal file
|
@ -0,0 +1,8 @@
|
|||
from pappyproxy.http import Request, get_request, post_request, request_by_id
|
||||
from pappyproxy.plugin import main_context_ids
|
||||
from pappyproxy.context import set_tag
|
||||
from pappyproxy.session import Session
|
||||
from pappyproxy.iter import *
|
||||
|
||||
MACRO_NAME = '{{macro_name}}'
|
||||
SHORT_NAME = '{{short_name}}'
|
Loading…
Add table
Add a link
Reference in a new issue