<?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 Chandrika Shrestha on Medium]]></title>
        <description><![CDATA[Stories by Chandrika Shrestha on Medium]]></description>
        <link>https://medium.com/@shtachandrika269?source=rss-bff3450cacdf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*j7Ln0H0pjMIQpfYEjbMZDg.jpeg</url>
            <title>Stories by Chandrika Shrestha on Medium</title>
            <link>https://medium.com/@shtachandrika269?source=rss-bff3450cacdf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 19:05:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shtachandrika269/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[OSI Model with real life analogy]]></title>
            <link>https://medium.com/@shtachandrika269/osi-model-with-real-life-analogy-1d553e62a87d?source=rss-bff3450cacdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d553e62a87d</guid>
            <category><![CDATA[osi-model]]></category>
            <category><![CDATA[osi-model-explained]]></category>
            <category><![CDATA[osi-model-in-networking]]></category>
            <dc:creator><![CDATA[Chandrika Shrestha]]></dc:creator>
            <pubDate>Fri, 27 Jun 2025 09:48:25 GMT</pubDate>
            <atom:updated>2025-06-28T10:51:37.175Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/425/0*q-Ez0b3X_t9N6C10.jpg" /></figure><p>Have you ever wondered how internet works and how message travel across the internet? Well, that’s because of networking. To understand the network better and to standardize the communication between different systems, International Organization for Standardization (ISO) developed a conceptual framework Open Systems Interconnection (OSI) Model.</p><p>OSI Model is a set of protocols that explains how data moves from one device to another over a network. It was created to give everyone a common language for communication. So, the OSI model is like a universal language for devices to talk to each other.</p><p>Sending data over the internet is just like sending a mail through postal system. It has 7 layers and each layer has their own job. 7 layers of OSI model are: Please Do Not Throw Sausage Pizza Away. JK.🤣 These are just mnemonics to remember different layers of OSI model. Actual layers are:</p><ol><li>Physical Layer</li><li>Data-Link Layer</li><li>Network Layer</li><li>Transport Layer</li><li>Session Layer</li><li>Presentation Layer</li><li>Application Layer</li></ol><p>Well, which layer comes first is to decided by which side you are at, i.e. sender or receiver. If you are sender, it starts from application layer, or else it starts from physical layer.</p><p>So, as I mentioned earlier that sending data over the internet is like sending a mail. So, let’s see what I meant. Let’s imagine a scenario where you have a Spanish friend who only knows Spanish and you only know Nepali and all you can reply them is ‘si’. But that’s not how communication works right?</p><p>So,</p><p>In Application Layer, you write a letter in Nepali, which is similar to writing a mail using Browser or Email app.</p><p>Then it goes to Presentation Layer, your Nepali letter is translated to let’s say universal language (English), which is similar to formatting the message so the receiver understands it which is binary or machine format, no matter which system they are on. Encoding, Encryption, Decryption takes place in this layer of networking.</p><p>Then it goes to Session Layer, where you establish a connection with post office to send letters, which is similar to establishing active connection sessions between two devices.</p><p>After that, it is sent to Transport Layer, where you break the letter into multiple envelopes if it’s too big and number them , so the receiver knows the order. Just imagine that postal service implemented new rule that you cannot send more than 100 words in one envelope. 😂 This is similar to where data is split into packets, with protocols like TCP or UDP, number them, and send them.</p><p>Then, the postal service decides which route to take to reach the destination which is similar to Network layer, where IP addresses come into the scene and routing decisions are made. Routers are used to communicate between different networks.</p><p>Once the route is decided. Then comes Data-Link Layer, where a local postman walks to your house and picks up the envelope who is responsible for delivery within your local area which is similar to transferring frames between nodes in same network.</p><p>Then comes the Physical Layer, where actual transmission occurs in the form of electric signals, light pulses, or radio waves over cables or wireless. Like if the postman is taking the letter from your place to your friends place through bike.</p><p>Now, at the receiving end:</p><p>Physical Layer: The postman physically delivers the letter to your friend’s house using a bike. Just like the electric signals, light pulses, or radio waves arrive via cables or wireless media.</p><p>Data-Link Layer: Then, the postman walks to your friend’s exact door and checks the address on the envelope and your friends house address. Here, the system checks if the data is meant for your device using MAC address.</p><p>Network Layer: The envelope has a source and destination address. Your friend picks up the envelope and checks the name on it to see if the letter is for them. Just like it checks the IP packet inside to see if it’s really meant for your system.</p><p>Transport Layer: Remember that you had sent a lot of envelopes? So, your friend collects multiple envelopes, checks the numbers and arranges them in order. Just like the protocol in Transport layer on the receiver’s system reassembles the data , checks for errors and makes sure nothing is missing.</p><p>Session Layer: Your friend knows that the letter is the part of the conversation, so the session is continued. Just like this layer makes sure the communication session is still active and properly closed after receiving.</p><p>Presentation Layer: Your friend sees that the letter is in English and then translates it into Spanish. Maybe using google translate. 😂. Just like the receiver’s system formats the data so that the receiver’s application can understand it.</p><p>Application Layer: Finally your friend reads the letter and understand the message. And this is where apps like browser, email, WhatsApp, etc. presents the data to the receiver.</p><p>That’s it for now. If I have written anything incorrect or have any suggestions. Do comment or contact me. Thank you!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d553e62a87d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PicoCTF — SOAP
Hello everyone!]]></title>
            <link>https://medium.com/@shtachandrika269/picoctf-soap-hello-everyone-49ecb0d02b1d?source=rss-bff3450cacdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/49ecb0d02b1d</guid>
            <dc:creator><![CDATA[Chandrika Shrestha]]></dc:creator>
            <pubDate>Thu, 27 Jun 2024 04:46:53 GMT</pubDate>
            <atom:updated>2024-06-27T04:51:19.446Z</atom:updated>
            <content:encoded><![CDATA[<h3>PicoCTF — SOAP</h3><p>Hello everyone!<br>I am trying to describe the SOAP CTF of PicoCTF under Web Exploitation Category.</p><p><strong>Description:</strong><br>The web project was rushed and no security assessment was done. Can you read the /etc/passwd file?<br>Additional details will be available after launching your challenge instance.</p><p><strong>Hint:</strong><br>XML external entity Injection</p><p>I didn’t know what XML external entity Injection is and what it looks like. So I had to google it. Upon searching it on google. I found out that “XML external entity injection (also known as XXE) is a web security vulnerability that allows an attacker to interfere with an application’s processing of XML data.”<br>Now I had to know what it looks like so I found out the payload on github.</p><p><a href="https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/XXE%20Injection#exploiting-xxe-to-perform-SSRF-attacks">https://github.com/swisskyrepo/PayloadsAllTheThings/tree/master/XXE%20Injection#exploiting-xxe-to-perform-SSRF-attacks</a><br><br>So I used Burpsuite to intercept the request after clicking on “Details”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZmKqE9u7V6ah_vp6ImtuLg.jpeg" /></figure><p>and I got this on Burpsuite and send it to the repeater.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B3MVRPkMqsKQKkAqESN4aA.jpeg" /></figure><p>As I knew that I had to read the /etc/passwd file I searched for the payload to read the file, which was:<br>&lt;!DOCTYPE root [&lt;!ENTITY test SYSTEM &#39;file:///etc/passwd&#39;&gt;]&gt;</p><p>I was running the payload as it is so it did not work. So, I had to watch a video LOL. So, after watching a video I got to know that I had to change the value inside the &lt;ID&gt; tag to &amp;test; so that it could pass the value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0EPKmvHbOnBzpMeRfVRTig.jpeg" /></figure><p>Upon running this, the etc/passwd/ file got dumped and I got the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MPE6ciHShDdcyXXG-OPTLQ.jpeg" /></figure><p>Flag: picoCTF{XML_3xtern@l_3nt1t1ty_e79a75d4}<br>Thank You!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49ecb0d02b1d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iptables]]></title>
            <link>https://medium.com/@shtachandrika269/iptables-4af9430ab63d?source=rss-bff3450cacdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/4af9430ab63d</guid>
            <category><![CDATA[iptables]]></category>
            <category><![CDATA[linux-firewall]]></category>
            <dc:creator><![CDATA[Chandrika Shrestha]]></dc:creator>
            <pubDate>Mon, 13 May 2024 15:34:18 GMT</pubDate>
            <atom:updated>2024-05-19T14:44:12.371Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4eyx1_mJeV-uBzLMr29iEg.jpeg" /><figcaption>iptables Firewall</figcaption></figure><p><strong>iptables</strong> is a firewall program for linux. It will monitor traffic from and to your server using tables. These tables contain sets of rules, called chains, that will filter incoming and outgoing data packets. With ‘iptables’, you can set up rules for packet filtering, Network Address Translation (NAT), and packet mangling.</p><p><strong>Uses of ‘iptables’:</strong></p><ol><li><strong>Packet Filtering: </strong>‘iptables’ can be used to allow, deny, or forward packets based on various criteria such as source IP address, destination IP address, port numbers, and packet state.</li><li><strong>NAT (Network Address Translation):</strong> ‘iptables’ can be used to configure NAT, which allows you to modify the source or destination IP address and port number of packets as they pass through a router or firewall.</li><li><strong>Packet Mangling :</strong> ‘iptables’ can modify certain fields in the packet header, such as TTL (Time To Live), TOS (Type Of Service), or the TCP options.</li><li><strong>Firewall Rules:</strong> ‘iptables’ can be used to create and manage firewall rules to secure your system by allowing or denying specific types of traffic.</li></ol><h4><strong>Install the iptables firewall in Linux</strong></h4><ul><li>sudo apt-get install iptables -y</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*O0H1bTBLrbcYW2n5xoMX6A.png" /></figure><h4>Structure of iptables command</h4><ul><li>sudo iptables [options] CHAIN_rule [-j target]</li></ul><p><strong>sudo :</strong> This is used to execute the command with superuser or root privileges.</p><p><strong>iptables: </strong>Command used for configuring the firewall.</p><p><strong>[option]: </strong>This is an optional part. Some common options are:</p><ol><li>-A (append) : Adds a rule to a string (at the end)</li></ol><p>Eg: sudo iptables -A INPUT -p tcp — dport 80 -j ACCEPT</p><p>2. -C (check): Finds a rule that matched the requirements of the string</p><p>Eg: sudo iptables -C INPUT -s 192.168.1.100 -j DROP</p><p>3. -D (delete): Removes the specified rules from a string</p><p>Eg: sudo iptables -D INPUT -p tcp — dport 22 -j ACCEPT</p><p>4. -F (flush): Deletes all rules from a chain</p><p>Eg: sudo iptables -F INPUT</p><p>5. -I (insert): Adds a rule to a string at a given position</p><p>Eg: sudo iptables -I INPUT 2 -p tcp — dport 443 -j ACCEPT</p><p>6. -L (list): Displays all rules in a string</p><p>Eg: sudo iptables -L INPUT</p><p>7. -N (new chain): Creates a new string</p><p>Eg: sudo iptables -N CUSTOM_CHAIN</p><p>8. -V (verbose): Displays more information when using a list option</p><p>Eg: sudo iptables -v -L INPUT</p><p>9. -X (delete-chain): Deletes the supplied string</p><p>Eg: sudo iptables -X CUSTOM_CHAIN</p><p><strong>CHAIN: </strong>A chain refers to a predefined sequence of rules that packets traverse within the firewall. Each chain is associated with a specific point in the packet’s journey through the networking stack of the Linux Kernel. When a packet enters a system, it is processed against the rules defined in the appropriate chain(s) based on its characteristics and the configures firewall.</p><p>Some predefined chains are as follows:</p><ol><li>INPUT: This chain handles incoming packets destined for the local system.</li><li>OUTPUT: This chain deals with outgoing packets originating from the local system.</li><li>FORWARD: This chain manages packets that are being forwarded through the system to another destination.</li><li>PREROUTING: This chain is part of the NAT (Network Address Translation) table and is used to modify packets as they come into the system, before any routing decisions are made.</li><li>POSTROUTING: This is also related to NAT, this one is used to modify packets as they leave the system, after routing decisions have been made.</li><li>DOCKER-USER: This chain is used by Docket to implement user-defined rules before Docker’s built-in rules are applied.</li></ol><p><strong>j target:</strong> The -j flag is used to specify the target action that should be taken if a packet matches the criteria defined in a rule. It stands for “jump”, indicating that the packet should jump to a specific target or action. The target action determines how the packet should be handled after matching the rule.</p><p>Some common target actions include:</p><ol><li>ACCEPT: This target allows the packet to proceed through the firewall without any further processing. The packet is accepted and allowed to reach its destination.</li><li>DROP: This target silently discards the packet without sending any notification to the sender. The packet is essentially “dropped” and does not continue through the firewall.</li><li>REJECT: Similar to DROP, this target discards the packet, but it also sends a notification (ICMP) back to the sender indicating that the packet was rejected. This can be useful for informing the sender that their packet was not allowed through.</li><li>LOG: This target logs information about the packet, such as its source and destination IP addresses, port numbers, and other relevant details. The packet continues through the firewall after being logged.</li><li>DNAT: This target is used for Destination Network Address Translation, which allows you to rewrite the destination IP address of the packet. It is often used for implementing port forwarding or redirecting incoming traffic to a different destination.</li><li>SNAT: This target is used for Source Network Address Translation, which allows you to rewrite the source IP address of the packet. It is commonly used for outbound NAT configurations.</li></ol><h4>Check the current status of iptables</h4><ul><li>sudo iptables -L</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*9uWBYVyyd1gGON4sdjNRJw.png" /></figure><h4>Allow traffic on localhost (own system)</h4><ul><li>sudo iptables -A INPUT -i lo -j ACCEPT</li><li>-i lo : loopback interface</li></ul><h4>Allow traffic on specific ports</h4><ul><li><strong>To allow HTTP Web traffic:</strong> sudo iptables -A INPUT -p tcp — dport 80 -j ACCEPT</li><li><strong>To allow HTTPS Web traffic:</strong> sudo iptables -A INPUT -p tcp — dport 443 -j ACCEPT</li><li><strong>To allow FTP Web traffic: </strong>sudo iptables -A INPUT -p tcp — dport 21 -j ACCEPT</li><li>-p : Check the specified protocol (tcp)</li><li>— dport: Specifies the destination port</li></ul><h4>Control traffic by IP address</h4><ul><li><strong>To accept traffic from a specific address:</strong></li></ul><p>sudo iptables -A INPUT -s &lt;IP_to_accept_from&gt; -j ACCEPT</p><ul><li><strong>To block traffic from an IP address:</strong></li></ul><p>sudo iptables -A INPUT -s &lt;IP_to_block&gt; -j DROP</p><ul><li><strong>To reject traffic from an IP address range:</strong></li></ul><p>sudo iptables -A INPUT -m iprange — src-range &lt;start_IP-end_IP&gt; -j REJECT</p><p>-m: Matches the specified option</p><p>iprange: Instructs the system to wait for a range of IP addresses instead of one</p><p>-src-range: Identifies the IP address range</p><h4>Delete unwanted traffic</h4><ul><li><strong>To prevent unauthorized access by removing all traffic from other ports:</strong></li></ul><p>sudo iptables -A INPUT -j DROP</p><h4>Delete a rule</h4><p>sudo iptables -P INPUT DROP</p><ul><li>P : sets the default policy</li></ul><p>This command sets the default policy (-P) for the INPUT chain to DROP.</p><p>First, list all rules by entering the following:</p><ul><li>sudo iptables -L — line-numbers</li></ul><p>Locate the line for the firewall rule you want to remove and run this command:</p><ul><li>sudo iptables -D INPUT &lt;Number&gt;</li></ul><h4>Save your changes</h4><ul><li>sudo -s iptables-save -c</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4af9430ab63d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>