{"id":19442977,"url":"https://github.com/syncom/wp5-rpi3-mitmproxy-setup","last_synced_at":"2025-04-25T00:32:09.970Z","repository":{"id":145815063,"uuid":"97213656","full_name":"syncom/wp5-rpi3-mitmproxy-setup","owner":"syncom","description":"How to set up WiFi Pineapple Mark V to work with Raspberry Pi3, and run mitmproxy","archived":false,"fork":false,"pushed_at":"2024-03-25T22:38:06.000Z","size":106,"stargazers_count":16,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-03T13:39:32.705Z","etag":null,"topics":["mitmproxy","raspberry-pi","rpi3","wifi-pineapple"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/syncom.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-14T08:51:11.000Z","updated_at":"2025-01-19T17:12:14.000Z","dependencies_parsed_at":"2024-03-25T23:33:46.878Z","dependency_job_id":"b0b8063e-ae70-4b8d-8443-b186d524c568","html_url":"https://github.com/syncom/wp5-rpi3-mitmproxy-setup","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syncom%2Fwp5-rpi3-mitmproxy-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syncom%2Fwp5-rpi3-mitmproxy-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syncom%2Fwp5-rpi3-mitmproxy-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syncom%2Fwp5-rpi3-mitmproxy-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syncom","download_url":"https://codeload.github.com/syncom/wp5-rpi3-mitmproxy-setup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250733350,"owners_count":21478345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mitmproxy","raspberry-pi","rpi3","wifi-pineapple"],"created_at":"2024-11-10T15:41:36.952Z","updated_at":"2025-04-25T00:32:09.721Z","avatar_url":"https://github.com/syncom.png","language":"Shell","readme":"# How to set up WiFi Pineapple on Raspberry Pi to MITM HTTP connections\n\n## References\n\nThe setup procedures described in this document are based on the following\nreferences:\n\n* [WiFi Pineapple Mark V with Burp\n  Proxy](http://hackedexistence.com/project/wifi-pineapple/wifi-pineapple-mk5-with-burp-proxy.html)\n* [Run mitmproxy on Raspberry\n  Pi](https://hackaday.io/project/10338/instructions)\n* [Blog post: Raspberry\n  Pineapple](http://snthenote.blogspot.com/2017/06/blog-post_19.html)\n\n## Tools and Equipment\n\n* Wi-Fi Pineapple Mark V (WP-5)\n* Raspberry Pi 3 (RPI-3) running Raspbian Linux distro\n* [mitmproxy](https://mitmproxy.org/), version 0.18.2, with python 2.7 on\n  Raspbian.\n\n## Connect WP-5 with RPI-3\n\nGenerally speaking, follow the instructions in this video: [Linux Internet\nConnection Sharing - WiFi Pineapple Mark V - Pineapple\nUniversity](https://www.youtube.com/watch?v=f94FZSJs4ms).  On the RPI-3, `wlan0`\nis the interface to the Internet, `eth0` is the interface (wired) to the WP-5;\nthe internet connection will be shared by the RPI-3 from `wlan0` to `eth0` to\nserve the WP-5.\n\n![wp5 on rpi3](img/raspberry-pineapple.jpg \"Raspberry Pineapple\")\n\nDownload the script that configures iptables rules and executes it (no MITM\nproxy yet).\n\n```bash\nwget https://www.wifipineapple.com/wp5.sh\nchmod u+x wp5.sh\nsudo ./wp5.sh\n```\n\nIt is usually safe to keep all default settings, except for the \"Internet\nGateway\" IP address, which shall be set as `wlan0`'s corresponding gateway\naddress (e.g., 192.168.0.1. Run `ifconfig` beforehand to find out the info). Now\nvisit \u003chttp://172.16.42.1:1471\u003e to configure the WP-5. Once the WP-5 is\nconfigured, for example, turn on \"PineAP\" for some fun.\n\n### How to play\n\nFor example, to intercept all HTTP traffic through the WP-5, do\n\n```bash\nsudo tcpdump -A -s 0 -i eth0 -w http_dump.pcap tcp port http\n```\n\nHere,\n\n* `-A` means ouput in ASCII\n* `-s 0` means output all payload content\n* `-i eth0` means capture packets on eth0 interface\n* `-w http_dump.pcap` sets the output dump file\n* `tcp port http` means capture only HTTP packets\n\nOnce enough data has been collected, use Wireshark or\n[foremost](https://linux.die.net/man/1/foremost) to analyze the pcap dump:\n`http_dump.pcap`.\n\n## Man-in-the-middle HTTP/HTTPS traffic\n\n1. Install `mitmproxy` on RPI-3 (use python 2 for example)\n\n   ```bash\n   sudo aptitude install python-setuptools python-dev build-essential\n   sudo easy_install pip\n   sudo pip install mitmproxy==0.18.2\n   ```\n\n2. Run the modified WP-5 configuration script\n   [wp5_mitmproxy.sh](src/wp5_mitmproxy.sh) to add port forwarding rules (from\n   80 and 443 to 8080, the port `mitmproxy` listens on by default).\n\n   ```bash\n   cd src/\n   sudo ./wp5_mitmproxy.sh\n   ```\n\n   Do a `diff wp5.sh wp5_mitmproxy.sh` to see the added rules for NAT port\n   forwarding.\n\n3. Run `mitmproxy` and `mitmdump`.\n\n   ```bash\n   mitmproxy -T --host\n   ```\n\n   You can watch the HTTP traffic from the console.\n\n   ```bash\n   mitmdump -T -s hacked.py\n   ```\n\n   This will intercept the HTTP response, and add \"HACKED!!!\" text at the bottom\n   of the page.\n\n## Related tutorial\n\n* [How to set up mitmproxy for pentest in\n  Docker](https://github.com/syncom/mitmproxy-hermit): An example of setting up\n  `mitmproxy` for testing an application from inside a Docker image\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncom%2Fwp5-rpi3-mitmproxy-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyncom%2Fwp5-rpi3-mitmproxy-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncom%2Fwp5-rpi3-mitmproxy-setup/lists"}