+ Reply to Thread
Results 1 to 1 of 1

Thread: "How To" capture announces with MITMProxy. [HTTP & HTTPS Trackers]

  1. #1
    Member cloud99's Avatar
    Join Date
    06.04.17
    Location
    Earth
    P2P Client
    qBittorrent, BiglyBT Mod, mRatio and RatioMaster +
    Posts
    350
    Activity Longevity
    1/20 9/20
    Today Posts
    0/5 ssssss350

    "How To" capture announces with MITMProxy. [HTTP & HTTPS Trackers]

    Hello SBI Community,

    I will show you how to use MITM Proxy to capture HTTP & HTTPS traffic (HTTPS private tracker announces) on a Windows 10 O.S. by performing a “Man-In-The-Middle Attack” on your own system.

    You must set up a proxy server and configure your device to route traffic. Here’s a step-by-step tutorial on capturing Private Tracker announces for debugging/mod client file making/etc.

    Let’s get started. But before that, you’re going to need a couple of things. They are: -

    1. Copy of MITM Proxy (I’m using version Windows v10.3.0 64bit version).
    2. Torrent Client (I’m using qBittorrent v4.6.4).
    3. Private Tracker (I’m using BootyTape.com).
    4. Notepad (I'm using Windows Notepad).


    Now comes the part of installing MITMProxy and setting it up on your system.

    1) Installing MITMProxy: Head to the website (https://mitmproxy.org/) and download the Windows Installer.

    Image: - Click image for larger version. 

Name:	Screenshot_1.png 
Views:	35 
Size:	177.7 KB 
ID:	21765

    2) A) Install MITMProxy on your device: - Install the software by double-clicking on the installer or right-clicking and choosing “Install.”

    Image: - Click image for larger version. 

Name:	Screenshot_2.png 
Views:	37 
Size:	28.0 KB 
ID:	21766

    2) B) Choose the Installation directory: -You must choose where to install MITMProxy. By default, the “C:\Program File\mitmproxy” location is set by default. It is best if you leave it at that.

    Image: - Click image for larger version. 

Name:	Screenshot_3.png 
Views:	28 
Size:	14.5 KB 
ID:	21767

    2) C) Uncheck the "Launch MITMProxy now" box and click on "Finish".

    Image: - Click image for larger version. 

Name:	Screenshot_22.png 
Views:	29 
Size:	23.2 KB 
ID:	21768

    Now that we've installed MITMProxy on our system we need to set up the proxy server in order route traffic through it.

    3) A) On Windows 10, search for “Proxy Settings” on your system.

    Image: - Click image for larger version. 

Name:	Screenshot_4.png 
Views:	31 
Size:	310.5 KB 
ID:	21769

    3) B) Type “http://localhost” in the address. Type “8080” in the port. Make sure to click save in the proxy settings.

    Image: - Click image for larger version. 

Name:	Screenshot_5.png 
Views:	29 
Size:	232.1 KB 
ID:	21770

    Now we've set up the proxy. The next step is installing the MITMProxy root certificate so that it is trusted by the system and you won't need to click through a TLS certificate warning on every domain.

    4) A) Visit (https://mitm.it/) on your browser, and you should see the MITMProxy root certificate installation option. Download it for windows.

    Image: - Click image for larger version. 

Name:	Screenshot_6.png 
Views:	25 
Size:	48.8 KB 
ID:	21771

    4) B) Choose “Current User” for the storage location of the certificate.

    Image: - Click image for larger version. 

Name:	Screenshot_7.png 
Views:	26 
Size:	56.1 KB 
ID:	21772

    4) C) Choose the certificate by finding it on your download location and click on “Next.”

    Image: - Click image for larger version. 

Name:	Screenshot_8.png 
Views:	26 
Size:	55.0 KB 
ID:	21773

    4) D) Don’t type any passwords. Choose “Next.”

    Image: - Click image for larger version. 

Name:	Screenshot_9.png 
Views:	28 
Size:	57.7 KB 
ID:	21774

    4) E) Choose “Automatically select the certificate store based on the type of Certificate.”

    Image: - Click image for larger version. 

Name:	Screenshot_10.png 
Views:	23 
Size:	54.0 KB 
ID:	21775

    4) F) Choose “Finish” to install the certificate.

    Image: - Click image for larger version. 

Name:	Screenshot_11.png 
Views:	27 
Size:	51.7 KB 
ID:	21776

    4) G) Choose "Yes" to the security warning.

    Image: - Click image for larger version. 

Name:	Screenshot_12.png 
Views:	31 
Size:	64.2 KB 
ID:	21777

    4) H) Choose "Ok."

    Image: - Click image for larger version. 

Name:	Screenshot_23.png 
Views:	30 
Size:	3.7 KB 
ID:	21778

    Now that we've installed the certificate. It is time to check whether the certificate was installed correctly. This step is completely optional.

    5) A) Search for “Manage User Certificates” on your system.

    Image: - Click image for larger version. 

Name:	Screenshot_13.jpg 
Views:	26 
Size:	52.7 KB 
ID:	21779

    5) B) Search for “Trusted Root Certifications Authorities -> Certificates.” Scroll down to find the one used by MITMProxy.

    Image: - Click image for larger version. 

Name:	Screenshot_14.png 
Views:	31 
Size:	74.9 KB 
ID:	21780

    Now that we're done with installing MITMProxy, its certiifcate and setting up the proxy server. It is time to fire up your torrent client. I’m using qBittorrent, which has its own networking library. Therefore, it will ignore the system proxy setting, so you must use the same I.P. and Port you set up on your system level in qBittorrent.

    6) Open qBittorrent->Tools->Option->Connection and choose the proxy type=HTTP, IP= 127.0.0.1, Port= 8080. Apply and then save.

    Image: - Click image for larger version. 

Name:	Screenshot_24.png 
Views:	32 
Size:	80.0 KB 
ID:	21781

    7) Head over to your MITMProxy install directory, i.e., “C:\Program Files\mitmproxy\bin\” and run the “mitmweb.exe” program. You don’t need to run it with your Command Prompt/Terminal.

    Image: - Click image for larger version. 

Name:	Screenshot_25.png 
Views:	29 
Size:	83.4 KB 
ID:	21782

    8) A browser instance will open with the address “http://127.0.0.1:8081/#/flows.” This is where you will see all traffic (tracker announces requests and responses).

    Image: - Click image for larger version. 

Name:	Screenshot_26.png 
Views:	28 
Size:	65.2 KB 
ID:	21783

    9) Start 1 or more torrents in qBittorrent; you should see the HTTPS announces in the MITM web browser.

    Image: - Click image for larger version. 

Name:	Screenshot_19.png 
Views:	25 
Size:	89.0 KB 
ID:	21784

    10). You can copy the data, i.e., the Tracker announces requests and responses from the server, and save it on your notepad. You can then share it with a member of this forum for debugging/mod client-making purposes.

    Image: - Click image for larger version. 

Name:	Screenshot_27.png 
Views:	33 
Size:	62.8 KB 
ID:	21785

    11) Make sure to turn off the proxy that you've set up in Step 3.

    Image: - Click image for larger version. 

Name:	Screenshot_29.png 
Views:	25 
Size:	228.3 KB 
ID:	21786

    Otherwise, you going to face problems with connecting to the internet as seen in the below image.

    Image: - Click image for larger version. 

Name:	Screenshot_28.png 
Views:	24 
Size:	120.2 KB 
ID:	21787

    Important Notes: -

    1. MITM attacks are illegal without permission. Ensure you have the legal right to capture traffic on the network you’re monitoring.
    2. Always use this tool responsibly and ethically, and respect user privacy and confidentiality.
    3. The captured traffic may contain sensitive information, so handle it with care. You must censor your private passkey, info hash, peer I.D., port, key, and I.P./I.P.v6 address if you plan to share the data on the forum, as other members can access them and use your sensitive information for nefarious purposes unless asked otherwise.
    4. MITM Proxy can run on Windows, Linux, and macOS. Please read the installation guide to learn how to install it on your system.


    Installing MITM Proxy on different OSes? Follow the instruction in the below link.
    Code:
    https://docs.mitmproxy.org/stable/overview-installation/
    Credits: -
    @anon - Thanks for all the help with this tutorial. I couldn’t have done it without you.

    So that about sums it up. If you have questions or think something must be added here, let me know.

    ~cloud99
    Last edited by cloud99; 24.05.24 at 12:54. Reason: Added Step 11 which is important.
    Reply With QuoteReply With Quote
    Thanks

  2. Who Said Thanks:

    alpacino (28.05.24) , joe1982 (27.05.24) , illusive (24.05.24) , Mag1sk (24.05.24) , anon (24.05.24)

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •