Tuesday, 22 September 2015

#MITM ATTACKS!!!!

What is a MITM Attack?

A Man in the Middle Attack (MITM) is a type of network attack in which an attacker assumes the role of the default gateway and captures all the traffic going to and fro. This is a very serious attack and also very easy to perform. MITM attack can be performed in a Local area network such as airport and  coffee shop wifi, college wifi, computer labs and other any kind of LAN. 


What the attack basically means is that a hacker (or anyone for that matter) with the right set of  tools, can intercept all your internet activities and see all your passwords and  all the websites you are browsing. 




How to perform a Man in the Middle attack?



There are many types of Man in the Middle attacks. There are also many ways to perform this attack. There are several tools such as Cain&Abel, Ettercap, Subterfuge, SSLStrip etc which can do a MITM attack.



In Windows, we use a technique called ARP spoofing to achieve MITM scenario. We use a free ready made tool called Cain&Abel for this. First, you need to be in the same network subnet as the victim (same campus, same room, or same wifi).



Download and Install Cain&Abel. Alsodownload and install Wireshark which is also free. We will be using wireshark to capture the packets and analyze them. 
After everything is installed, run Cain from the desktop or menu. 




  • 1. Start Sniffer by clicking button shown in red box. 2. Then go to Sniffer tab.

  • 3. Right click on screen and select “Scan Mac Addresses”. The screen will quickly  be populated with all users in your LAN.
  • 4. Select all the IP addresses and right click. and select "Resolve host name". Now, you can find the IP address of the person you want to attack by viewing the computer names.


  • Now, 
  •  4. click on “ARP” on bottom and then 
  •  5. click on “Plus” icon to add user in victim list. 



 A window called “New ARP Poison Routing ” will pop up.

  • You will see windows divided in two parts. Select the default gateway in left half and select the victim's IP in the right.  Here you see me selecting 10.97.26.1 as the default gateway for the network and the victim's IP address 10.97.26.156




  • Click on start ARP option shown in red box. You will see that CAIN starts poisoning the host. 




This completes our ARP poisoning  Now, all the traffic from the victim will pass through the attacker's PC. The victim may notice his internet speed slowing down. 



Now, we need to capture the traffic by using Wireshark. 



Fire up wireshark and
 1. Click on the adapter button shown below in red. 2. Click 'start' in the adapter where there are packets. 






If you let this run for a while, all the traffic going through the victim's PC will be captured by wireshark. You can then save the packet capture file and analyze it with appropriate filters. By analyzing the packets, you can find juicy information like username and passwords, web urls visited by the victim etc.
Please note that you have to be very careful while performing such an attack. If not done properly, it can even cause denial of service to the entire network. 

How to setup VPN in Windows 7


WHAT'S VPN?
Virtual Private Network or VPN is used mostly by corporate employees to connect to their office while travelling or  from their home or coffee shop. However, for students, there is an entirely different usage, and that is to bypass firewall restriction in schools and colleges. My friends keep on asking me how to bypass our college firewall as sites like youtube and facebook are blocked during working hours. There are many ways to bypass a firewall, depending on the blocking mechanisms used. VPNs are the best in my opinion.

So, how does VPN work?
Simply put, the wifi or internet you are currently using is not secure. Anyone can sniff data by aMITM attack. VPN creates an encrypted tunnel from your computer to a remote computer which will pass on your information the the websites you are viewing. Just remember that VPN ensures that your information is safe from prying eyes. Now, you might ask, what is that remote computer we are connecting to? It may be your office, or a free VPN server in this case.  The diagram shows VPN connection to a corporate server.

There are several kind of VPN protocols such as PPTP, L2TP, OpenVPN etc.  OpenVPN is the most secure and reliable type of VPN. However, we have to download the OpenVPN client, making it an extra step. In a corporate environment or in a situation where data confidentiality is of prime importance, you may use OpenVPN.  The most easy to setup is PPTP, which comes inbuilt in Microsoft Windows. That means no downloading is required. So, we will use this one. Please note that PPTP is not absolutely secure, but for normal browsing it should be fine.

1. Goto your free VPN providers website. My personal favourite is www.vpnbook.com
   Once there, scroll down, and you will see the IP address or domain or the VPN server, the username and password.

Since the VPN website itself may be blocked by the firewall, you may use GPRS or 3G on you mobile to first visit the site and obtain the VPN username and password. 
Note: These VPN providers periodically  change the passwords, so keep visiting the site to get updated passwords.

2. Goto Control Panel -> Internet Options -> Connections tab
  Click on Add VPN as shown.



A new window will pop up, asking for the Internet Address. This is the VPN site address which we saw earlier on vpnbook.com.  In this case, it is euro1.vpnbook.com. Leave the other fields as they are.


3. Click Next, and it will ask for username and password  Enter them as you saw on the website. Leave the domain blank.


Now, Click Connect and your VPN setup is done. Congratulations, you can now surf any website anonymously and without being logged or blocked.

This tutorial was for PPTP based VPN. PPTP can be blocked by your college or ISP, although it is unlikely. In that case, use OpenVPN. It is impossible to block OpenVPN as it can use any port.

Denial of Service (DOS) Attacks

What are Denial of Service (DOS) attacks?

Denial of Service attacks have become more widely known due to extensive media coverage. But what exactly is a denial of service attack? Simply put, a denial of service attack is a type of cyber attack wherein a website or service is brought down by a hacker or a group of hackers by flooding it with bogus traffic. The web server becomes overloaded with this bogus traffic and the service eventually crashes.

This means that if a hacker performs a denial of service attack against a website, say for example a bank website, then all the online transitions of that bank will be halted. Both companies and individuals are no long able to log into their netbanking accounts for the duration of the attack, leading to loss in revenue for the bank. The bank will also lose reputation and credibility for failing to protect their IT infrastructure.  Similarly, if Gmail was attacked, millions of users will not be able to access their email accounts. In a typical DoS attack, one hacker performs the attack using a DoS tool or script. This is easy to mitigate. The only thing one needs to do is block the IP address of the attacker. To overcome this, hackers use a technique called Distributed Denial of Service or DDoS.

What are Distributed Denial of Service(DDoS) Attacks?


DDoS attacks involve hundreds, if not thousands of "volunteers" who install the DoS tool in their systems and launch a coordinated attack on the target at a specified time. This was the case when Anonymous hacker group took down Paypal  and Mastercard websites some time back. In case there are no "volunteers" involved, hackers use a networks of zombies called botnets to perform the same attack. These zombies are basically normal home computers which have been hacked and infected with the DoS tool. The controller is able to issue remote commands to these "bots" so that they can start attacking a particular website without the owners even noticing. 
Hackers and hactivists perform denial of service attacks by using an array of readymade tools. one such tools is called the Low Orbit Ion Cannon(LOIC). It is a simple GUI tool and volunteers can use it to launch attacks once they receive the green light from the controllers, usually via IRC or social networks. There are many other DoS tools such as HOIC,Hulk Web server, RUDY (R-U-Dead-Yet), Silent  DDoSer etc.

This disruption in service is one of the biggest challenges for companies today. There is no fool proof method to protect against DDoS attacks.  There are many ongoing research on how to mitigate DDoS attacks. As of now, big companies rely on IDS and firewalls and the cooperation of the ISPs to mitigate such attacks.

Would you like to know how to perform a denial of service yourself? Read my other article on  #how to perform DoS attack here.

How to perform a Denial of Service attack to crash a website

Denial of service is a very aggressive attack usually launched against websites as a form of protest or activism. The ultimate aim is to bring down or crash the web server. There are many readymade tools for this. Here, I will give instructions on how to use a very simple DoS tool called Low Orbit Ion Cannon (LOIC). LOIC is a free and open source and can be found in Sourceforge.

Please note that the information provides here is only for educational purpose. 

First download LOIC from here. The original version requires Microsoft .net to run. If you are using a Linux system, then you can use the java version, Java LOIC.
Once downloaded, you can go ahead and run the tool. The directions are pretty straight forward.



1. Enter the URL of the website you are planning to attack. There is also an option to enter the IP address.
2. Once the URL is entered, click on "Lock On"
3. Select the protocol you want to use. TCP is fine.
4. Enter the no of simultaneous threads. (In other words, the severity of your attack) 500 to 1000 threads will do.
5.Finally, click on the large button labelled as "IMMA CHARGIN MAH LAZER"

That will start the attack.  In the bottom, you will see a substantial increase in the no. of requested connections. This means your attack is on. After some time, the website will slow down and eventually stop responding(crash). The best way to observe this is by creating a web server in a virtual lab and attacking it. You can then analyze the web server logs  for more information.

Note: Please don't use tool on any website other than your own. It is a very powerful tool and you could get in trouble with the law.¶lol 
#9jaCZ said it!!!