<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sumit Chaudhary on Medium]]></title>
        <description><![CDATA[Stories by Sumit Chaudhary on Medium]]></description>
        <link>https://medium.com/@sumit79c2003?source=rss-5affbe35d9c9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Sumit Chaudhary on Medium</title>
            <link>https://medium.com/@sumit79c2003?source=rss-5affbe35d9c9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 21:13:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sumit79c2003/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Capturing Traffic with tcpdump (Linux)]]></title>
            <link>https://medium.com/@sumit79c2003/capturing-traffic-with-tcpdump-linux-5ca89f69b99e?source=rss-5affbe35d9c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ca89f69b99e</guid>
            <category><![CDATA[tcpdump]]></category>
            <dc:creator><![CDATA[Sumit Chaudhary]]></dc:creator>
            <pubDate>Mon, 14 Oct 2024 00:32:24 GMT</pubDate>
            <atom:updated>2024-10-14T00:32:24.606Z</atom:updated>
            <content:encoded><![CDATA[<p>Tcpdump is a Linux command line utility that enables the capture and analysis of network traffic travelling through the system. It is often used for network troubleshooting and analysis.</p><p><strong>Before installing</strong> the tcpdump service, you will <strong>need to update</strong> the repository/package list <strong>and upgrade</strong> to the latest package versions for your Linux machine.</p><blockquote>In Linux Terminal</blockquote><blockquote><strong>Type</strong> the command <strong><em>sudo apt-get update</em></strong> and hit <strong><em>Enter</em></strong>.</blockquote><blockquote><em>This command requests an update of all repositories, dependencies and packages installed in Linux.</em></blockquote><blockquote><strong>Type</strong> the command <strong><em>sudo apt-get upgrade</em></strong> and hit <strong><em>Enter</em></strong>.</blockquote><blockquote><em>This command begins the upgrade process of all repositories, dependencies and packages installed in Linux.</em></blockquote><blockquote><strong><em>Remember that sudo at the beginning of the command is necessary if you are not running the command as the root user.</em></strong></blockquote><p>Once the upgrade process is done”</p><blockquote>Type the command <strong><em>which tcpdump</em></strong> and hit <strong>Enter</strong>. The <strong>which</strong> command is used to locate an executable file. In this instance, we are checking to see if <strong>tcpdump</strong> is installed.</blockquote><blockquote>If installed, you will see output such as <strong><em>/usr/sbin/tpdump</em></strong>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*hhQbeRSCSt-fhOBUHdpFxQ.png" /></figure><blockquote>Type the command <strong><em>sudo apt-get install tcpdump</em></strong> and hit <strong><em>Enter</em> </strong>to install. You will see an output like this:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/1*AxU1ALO8UH1CAIABEX6CHQ.png" /></figure><blockquote>Type the command <strong><em>tcpdump -D</em></strong> and hit <strong>Enter</strong>. This command runs <strong>tcpdump </strong>and the <strong>-D</strong> switch applies the option to list all available network interfaces<em>.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*1O1T3oOVwI7Wkq8Y58yMqg.png" /></figure><blockquote>Type the command <strong><em>tcpdump -i &lt;Adapter_Name&gt;</em></strong><em> </em>and hit <strong><em>Enter (Adapter_Name = eth0). </em></strong><em>The </em><strong><em>-i</em></strong><em> switch applies the condition to capture traffic only on one specific network interface.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*vHJ0NLRs7jc7qjyoRXnbAA.png" /></figure><blockquote>Type the command <strong><em>tcpdump -i any </em></strong>and hit <strong><em>Enter</em></strong>.<br><em>This command will capture packets from all available interfaces simultaneously.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*p9z-y87R3BTl1_Q47NdeLA.png" /></figure><blockquote>Type the command <strong><em>tcpdump -i any -c 5 </em></strong>and hit<strong><em> Enter</em></strong>.</blockquote><blockquote><em>The addition of the switch -c followed by the desired number of packets, in this case, 5, tells tcpdump to limit the capture to 5 packets.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*rH1-h-ZVie-0UYyyJ3-U-w.png" /></figure><blockquote><strong><em>Different options can be applied to specify capture such as below:</em></strong></blockquote><blockquote>○ <strong><em>Host </em></strong>— <em>Specify a host machine IP address to capture data from</em></blockquote><blockquote>○ <strong><em>Port </em></strong>— <em>Specify the port to capture data on. E.g. Port 80 for HTTP</em></blockquote><blockquote>○ <strong><em>Src</em></strong> — <em>Specify a source IP address to capture data from</em></blockquote><blockquote>○ <strong><em>Dst</em></strong> — <em>Specify a destination IP address to capture data from</em></blockquote><blockquote><strong><em>For example: tcpdump -i any -c5 host &lt;IP_Address&gt;. </em></strong><em>Where &lt;IP_Address&gt; can be replaced by the host address of a virtual machine. Example: </em><strong><em>tcpdump -i any -c5 host 54.204.39.132</em></strong><em>). This command will capture packets from a specific host.</em></blockquote><blockquote><strong><em>Additional filtering can be accomplished with the use of logical operators such as:</em></strong></blockquote><blockquote>○ <strong><em>and</em></strong> — <em>Allows a combination of filtering options. E.g. source and destination</em></blockquote><blockquote>○ <strong><em>or </em></strong>— <em>Either of the conditions specified in the command can be applied to filter capture data</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*1dt0axsrqqyX1TgrWM_FsA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ca89f69b99e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Network Configuration in Linux]]></title>
            <link>https://medium.com/@sumit79c2003/network-configuration-in-linux-8f7b7bf30a8e?source=rss-5affbe35d9c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f7b7bf30a8e</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[network-configuration]]></category>
            <dc:creator><![CDATA[Sumit Chaudhary]]></dc:creator>
            <pubDate>Sun, 13 Oct 2024 23:43:20 GMT</pubDate>
            <atom:updated>2024-10-13T23:59:34.598Z</atom:updated>
            <content:encoded><![CDATA[<p>This exercise aims to showcase the Linux command line terminal’s practical application and associated tools, including text editors like Nano or Vim. Through this exercise, I gained hands-on experience in exploring my machine’s network configuration, efficiently viewing and editing configuration files, and mastering the technique of mapping an IP address in the /etc/hosts file.</p><p>For this exercise I used a Windows and Kali virtual machine. Just some basics to obtain the IP address of my Kali: In terminal type command <strong><em>ip a </em></strong>to list all network interfaces and their associated IP addresses:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*i-Of-k_ejNB4WQjvR2uYPA.png" /><figcaption>etho0 will show the IP address of Kali VM</figcaption></figure><p>Once we have the IP address, we can use any text editor like nano or vim to open the file <em>/etc/hosts (e.g: nano /etc/hosts)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/1*mIoHW2HynB3_hL2c2OLt-w.png" /></figure><p>This file works as the local Domain Name System (DNS) by mapping IP addresses to names.</p><blockquote>Edit the file <em>/etc/hosts </em>(Remember that editing a system file requires root/admin privileges. Preface your command with <strong>sudo</strong> to run as root/admin: sudo nano /path/to/directory)<em> </em>and enter the following line:</blockquote><blockquote>&lt;IP_Address&gt; winmachine, where &lt;IP_Address&gt; will be your windows virtual machone’s IP address</blockquote><blockquote>Exit the text file. To exit out of nano: Ctrl +X, then Y for yes, to save changes and hit Enter to quit.</blockquote><p>This configuration will allow you to use the name winmachine instead of the IP address to access your Windows virtual machine.</p><p><strong>Lets check if this configuration works!</strong></p><p>Launch your Windows virtual machine to test your configuration.</p><blockquote>Test the configuration by typing “<em>ping winmachine”</em> in the Kali Linux terminal. Hit <em>Enter</em>.</blockquote><blockquote>You should see a response from the Windows virtual machine in the same way you would if you had pinged the full IP address. This verifies that the configuration you put in place is successful.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*pED_k2mkhnN1kLtkMcntyQ.png" /></figure><p><strong>Lets disable this configuration now</strong></p><p>To disable any configuration or a line a script we simply need to place a “#” at the beginning of the respective line. This disables the command and convert it to a comment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*Rlylr52rUK17-NuWXdi2SA.png" /></figure><p>To test this change ping the win machine again by name as we created earlier. This time we will not be able to ping the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*gYRfKccdNw60ikMr16IrFQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f7b7bf30a8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OSI Model]]></title>
            <link>https://medium.com/@sumit79c2003/osi-model-befb1d22d302?source=rss-5affbe35d9c9------2</link>
            <guid isPermaLink="false">https://medium.com/p/befb1d22d302</guid>
            <dc:creator><![CDATA[Sumit Chaudhary]]></dc:creator>
            <pubDate>Mon, 12 Aug 2024 10:04:02 GMT</pubDate>
            <atom:updated>2024-09-05T07:41:22.358Z</atom:updated>
            <content:encoded><![CDATA[<p>Whilst OSI is the foundation model and is used more in theory, TCP/IP model is preferred and practically used by in IT.</p><p>The OSI (<strong>O</strong>pen <strong>S</strong>ystems <strong>I</strong>nterconnection) Model is a standardised model which is used to demonstrate the theory behind computer networking. In practice, it’s actually the more compact TCP/IP model that real-world networking is based off; however the OSI model, in many ways, is easier to get an initial understanding from.</p><p>The OSI model consists of seven layers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AU2g3cz4wg1FjkZmjtCaMg.png" /><figcaption>OSI vs TCP/IP Model</figcaption></figure><p>There are many mnemonics floating around to help you learn the layers of the OSI model — search around until you find one that you like.</p><p>I personally favour: <strong>A</strong>nxious <strong>P</strong>ale <strong>S</strong>hakespeare <strong>T</strong>reated <strong>N</strong>ervous <strong>D</strong>runks <strong>P</strong>atiently</p><p>Let’s briefly take a look at each of these in turn:</p><p><strong>Layer 7 — Application</strong>:</p><p>The application layer of the OSI model essentially provides networking options to programs running on a computer. It works almost exclusively with applications, providing an interface for them to use in order to transmit data. When data is given to the application layer, it is passed down into the presentation layer.</p><p><strong>Layer 6 — Presentation:</strong></p><p>The presentation layer receives data from the application layer. This data tends to be in a format that the application understands, but it’s not necessarily in a standardised format that could be understood by the application layer in the <em>receiving</em> computer. The presentation layer translates the data into a standardised format, as well as handling any encryption, compression or other transformations to the data. With this complete, the data is passed down to the session layer.</p><p><strong>Layer 5 — Session:</strong></p><p>When the session layer receives the correctly formatted data from the presentation layer, it looks to see if it can set up a connection with the other computer across the network. If it can’t then it sends back an error and the process goes no further. If a session <em>can</em> be established then it’s the job of the session layer to maintain it, as well as co-operate with the session layer of the remote computer in order to synchronise communications. The session layer is particularly important as the session that it creates is unique to the communication in question. This is what allows you to make multiple requests to different endpoints simultaneously without all the data getting mixed up (think about opening two tabs in a web browser at the same time)! When the session layer has successfully logged a connection between the host and remote computer the data is passed down to Layer 4: the transport Layer.</p><p><strong>Layer 4 — Transport:</strong></p><p>The transport layer is a very interesting layer that serves numerous important functions. Its first purpose is to choose the protocol over which the data is to be transmitted. The two most common protocols in the transport layer are TCP (<strong>T</strong>ransmission <strong>C</strong>ontrol <strong>P</strong>rotocol) and UDP (<strong>U</strong>ser <strong>D</strong>atagram<strong> P</strong>rotocol); with TCP the transmission is <em>connection-based</em> which means that a connection between the computers is established and maintained for the duration of the request. This allows for a reliable transmission, as the connection can be used to ensure that the packets <em>all</em> get to the right place. A TCP connection allows the two computers to remain in constant communication to ensure that the data is sent at an acceptable speed, and that any lost data is re-sent. With UDP, the opposite is true; packets of data are essentially thrown at the receiving computer — if it can’t keep up then that’s <em>its </em>problem (this is why a video transmission over something like Skype can be pixelated if the connection is bad). What this means is that TCP would usually be chosen for situations where accuracy is favoured over speed (e.g. file transfer, or loading a webpage), and UDP would be used in situations where speed is more important (e.g. video streaming).</p><p>With a protocol selected, the transport layer then divides the transmission up into bite-sized pieces (over TCP these are called <em>segments</em>, over UDP they’re called <em>datagrams</em>), which makes it easier to transmit the message successfully.</p><p><strong>Layer 3 — Network:</strong></p><p>The network layer is responsible for locating the destination of your request. For example, the Internet is a huge network; when you want to request information from a webpage, it’s the network layer that takes the IP address for the page and figures out the best route to take. At this stage we’re working with what is referred to as <em>Logical </em>addressing (i.e. IP addresses) which are still software controlled. Logical addresses are used to provide order to networks, categorising them and allowing us to properly sort them. Currently the most common form of logical addressing is the IPV4 format, which you’ll likely already be familiar with (i.e 192.168.1.1 is a common address for a home router).</p><p><strong>Layer 2 — Data Link:</strong></p><p>The data link layer focuses on the <em>physical </em>addressing of the transmission. It receives a packet from the network layer (that includes the IP address for the remote computer) and adds in the physical (MAC) address of the receiving endpoint. Inside every network enabled computer is a <strong>N</strong>etwork <strong>I</strong>nterface <strong>C</strong>ard (NIC) which comes with a unique MAC (<strong>M</strong>edia <strong>A</strong>ccess <strong>C</strong>ontrol) address to identify it.</p><p>MAC addresses are set by the manufacturer and literally burnt into the card; they can’t be changed — although they <em>can</em> be spoofed. When information is sent across a network, it’s actually the physical address that is used to identify where exactly to send the information.</p><p>Additionally, it’s also the job of the data link layer to present the data in a format suitable for transmission.</p><p>The data link layer also serves an important function when it receives data, as it checks the received information to make sure that it hasn’t been corrupted during transmission, which could well happen when the data is transmitted by layer 1: the physical layer.</p><p><strong>Layer 1 — Physical:</strong></p><p>The physical layer is right down to the hardware of the computer. This is where the electrical pulses that make up data transfer over a network are sent and received. It’s the job of the physical layer to convert the binary data of the transmission into signals and transmit them across the network, as well as receiving incoming signals and converting them back into binary data.</p><p><strong>Courtsey: TryHackMe</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=befb1d22d302" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>