Version 0.3.0, move large amount of code to Puppy
This commit is contained in:
parent
76d20774a5
commit
f9737dbdd8
169 changed files with 6463 additions and 43862 deletions
|
@ -1,17 +0,0 @@
|
|||
from pappyproxy.session import Session
|
||||
|
||||
MACRO_NAME = '{{macro_name}}'
|
||||
SHORT_NAME = '{{short_name}}'
|
||||
runargs = []
|
||||
|
||||
def init(args):
|
||||
global runargs
|
||||
runargs = args
|
||||
|
||||
def mangle_request(request):
|
||||
global runargs
|
||||
return request
|
||||
|
||||
def mangle_response(request):
|
||||
global runargs
|
||||
return request.response
|
30
pappyproxy/templates/intmacro.py.tmpl
Normal file
30
pappyproxy/templates/intmacro.py.tmpl
Normal file
|
@ -0,0 +1,30 @@
|
|||
{% include 'macroheader.py.tmpl' %}
|
||||
{% if req_lines %}
|
||||
###########
|
||||
## Requests
|
||||
# It's suggested that you call .copy() on these and then edit attributes
|
||||
# as needed to create modified requests
|
||||
##
|
||||
{% for lines, params in zip(req_lines, req_params) %}
|
||||
req{{ loop.index }} = parse_request(({% for line in lines %}
|
||||
{{ line }}{% endfor %}
|
||||
), {{ params }})
|
||||
{% endfor %}{% endif %}
|
||||
|
||||
runargs = []
|
||||
|
||||
def init(client, args):
|
||||
global runargs
|
||||
runargs = args
|
||||
|
||||
def mangle_request(client, request):
|
||||
global runargs
|
||||
return request
|
||||
|
||||
def mangle_response(client, request, response):
|
||||
global runargs
|
||||
return response
|
||||
|
||||
def mangle_websocket(client, request, response, wsmessage):
|
||||
global runargs
|
||||
return wsmessage
|
|
@ -1,31 +0,0 @@
|
|||
{% include 'macroheader.py.template' %}
|
||||
|
||||
## Iterator cheat sheet:
|
||||
# fuzz_path_trav() - Values for fuzzing path traversal
|
||||
# fuzz_sqli() - Values for fuzzing SQLi
|
||||
# fuzz_xss() - Values for fuzzing XSS
|
||||
# common_passwords() - Common passwords
|
||||
# common_usernames() - Common usernames
|
||||
# fuzz_dirs() - Common web paths (ie /wp-admin)
|
||||
|
||||
{% if req_lines %}
|
||||
###########
|
||||
## Requests
|
||||
# It's suggested that you call .copy() on these and then edit attributes
|
||||
# as needed to create modified requests
|
||||
##
|
||||
|
||||
{% set count = 1 %}{% for params, lines in zip(req_params, req_lines) %}
|
||||
req{{ count }} = Request(({% for line in lines %}
|
||||
'{{ line }}'{% endfor %}{% set count = count+1 %}
|
||||
){{ params }})
|
||||
{% endfor %}{% endif %}
|
||||
|
||||
def run_macro(args):
|
||||
# Example:
|
||||
# req = req1.copy() # Copy req1
|
||||
# req.submit() # Submit the request to get a response
|
||||
# print req.response.raw_headers # print the response headers
|
||||
# req.save() # save the request to the data file
|
||||
# or copy req1 into a loop and use string substitution to automate requests
|
||||
pass
|
22
pappyproxy/templates/macro.py.tmpl
Normal file
22
pappyproxy/templates/macro.py.tmpl
Normal file
|
@ -0,0 +1,22 @@
|
|||
{% include 'macroheader.py.tmpl' %}
|
||||
{% if req_lines %}
|
||||
###########
|
||||
## Requests
|
||||
# It's suggested that you call .copy() on these and then edit attributes
|
||||
# as needed to create modified requests
|
||||
##
|
||||
{% for lines, params in zip(req_lines, req_params) %}
|
||||
req{{ loop.index }} = parse_request(({% for line in lines %}
|
||||
{{ line }}{% endfor %}
|
||||
), {{ params }})
|
||||
{% endfor %}{% endif %}
|
||||
|
||||
def run_macro(client, args):
|
||||
# Example:
|
||||
"""
|
||||
req = req1.copy() # Copy req1
|
||||
client.submit(req) # Submit the request to get a response
|
||||
print(req.response.full_message()) # print the response
|
||||
client.save_new(req) # save the request to the data file
|
||||
"""
|
||||
pass
|
|
@ -1,27 +0,0 @@
|
|||
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
|
|
@ -1,29 +0,0 @@
|
|||
import sys
|
||||
{% include 'macroheader.py.template' %}
|
||||
from pappyproxy.http import submit_requests
|
||||
|
||||
def run_macro(args):
|
||||
# Get IDs of in-context requests
|
||||
reqids = main_context_ids()
|
||||
reqids.reverse() # Resubmit earliest first
|
||||
|
||||
# Iterate over each request and submit it
|
||||
to_submit = []
|
||||
for rid in reqids:
|
||||
req = request_by_id(rid).copy()
|
||||
|
||||
###################
|
||||
# Modify `req` here
|
||||
|
||||
req.tags.add('resubmit')
|
||||
to_submit.append(req)
|
||||
|
||||
#############################
|
||||
# Modify resubmit params here
|
||||
submit_requests(to_submit,
|
||||
mangle=False,
|
||||
save=False,
|
||||
save_in_mem=False,
|
||||
unique_paths=False,
|
||||
unique_paths_and_args=False,
|
||||
)
|
|
@ -1,8 +0,0 @@
|
|||
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}}'
|
1
pappyproxy/templates/macroheader.py.tmpl
Normal file
1
pappyproxy/templates/macroheader.py.tmpl
Normal file
|
@ -0,0 +1 @@
|
|||
from pappyproxy.proxy import parse_request, parse_response
|
Loading…
Add table
Add a link
Reference in a new issue