뭐 대충했어요

This commit is contained in:
imnyang 2025-06-07 15:12:15 +09:00
commit 5f84d24973
5 changed files with 138 additions and 29 deletions

22
main.py
View file

@ -1,9 +1,31 @@
import sys
from mitmproxy.tools.main import mitmdump
from flask import Flask, request
import threading
import lib.target as target
def main():
sys.argv = ["mitmdump", "-s", "./addon/init.py", "--listen-port", "11080"]
mitmdump()
# get target from browser use web api
app = Flask(__name__)
@app.route('/start', methods=['GET', 'POST'])
def start():
target_url = request.args.get('url')
if target_url:
target.save(target_url)
print(f"Target URL set to: {target_url}")
return f"Target URL set to: {target_url}"
return "No URL provided"
def run_web_server():
app.run(host='localhost', port=11081, debug=False)
# Start web server in a separate thread
web_thread = threading.Thread(target=run_web_server, daemon=True)
web_thread.start()
if __name__ == "__main__":
main()