|
|
@ -5,29 +5,16 @@ from mitmproxy import ctx, http |
|
|
|
import argparse |
|
|
|
|
|
|
|
class Injector: |
|
|
|
''' |
|
|
|
def load(self, loader): |
|
|
|
loader.add_option( |
|
|
|
"scr_url", str, "", "script_url to inject" |
|
|
|
) |
|
|
|
''' |
|
|
|
def __init__(self, path): |
|
|
|
self.path = path |
|
|
|
|
|
|
|
def response(self, flow: http.HTTPFlow) -> None: |
|
|
|
#print("hola hola hola") |
|
|
|
#print(self.path) |
|
|
|
|
|
|
|
if self.path: |
|
|
|
html = BeautifulSoup(flow.response.content, "html.parser") |
|
|
|
print(self.path) |
|
|
|
print(flow.response.headers["content-type"]) |
|
|
|
if flow.response.headers["content-type"] == 'text/html': |
|
|
|
print("uuuuuu") |
|
|
|
print(flow.response.headers["content-type"]) |
|
|
|
print("asdf asdf asdf asdf asdf") |
|
|
|
print("-----") |
|
|
|
print("mmmmm") |
|
|
|
script = html.new_tag( |
|
|
|
"script", |
|
|
|
src=self.path, |
|
|
@ -41,5 +28,3 @@ def start(): |
|
|
|
parser.add_argument("path", type=str) |
|
|
|
args = parser.parse_args() |
|
|
|
return Injector(args.path) |
|
|
|
|
|
|
|
#addons = [Injector()] |