From e3c5605fce0bebcddd2ef6cf29b29ad8399135a5 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Thu, 4 Jul 2024 23:42:06 +0400 Subject: [PATCH] finish "user guide: addon" section --- README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d59169d..986a855 100644 --- a/README.md +++ b/README.md @@ -43,4 +43,25 @@ click "Get mitmproxy-ca-cert.pem" below "Firefox". Import it: Settings > Privacy & Security > Certificates > View Certificates... > "Authorities" tab > Import... > Choose the downloaded cert > Checkbox "Trust this CA to identify web sites" > OK. -## TODO +## Archiving web sites +To get the addon, either clone the git repo: +```bash +$ git clone https://git.dc09.ru/mitm-archive/addon +$ cd addon +``` +… or just download the script: +```bash +$ mkdir addon && cd addon +$ curl https://git.dc09.ru/mitm-archive/addon/raw/branch/main/addon.py >addon.py +``` + +Stop mitmproxy if it's still running (q and then y for mitmproxy; Ctrl+C for mitmweb), then re-launch it with the mitm-archive addon: `mitmproxy -s addon.py` (or mitmweb). + +**Each HTTP response** that comes to mitmproxy is archived: metadata is in `./archive.db` SQLite database, headers and body are in `./storage/{id}/headers` and `./storage/{id}/body` respectively. + +To adjust these paths, set the environment variables: +```bash +$ export SQLITE_DB_PATH=archive.db +$ export STORAGE=storage +$ mitmproxy -s addon.py +``` \ No newline at end of file