<?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 Abdur Rehman Rehan on Medium]]></title>
        <description><![CDATA[Stories by Abdur Rehman Rehan on Medium]]></description>
        <link>https://medium.com/@abdurrehmanrehan?source=rss-fc0328a05673------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Abdur Rehman Rehan on Medium</title>
            <link>https://medium.com/@abdurrehmanrehan?source=rss-fc0328a05673------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 17:22:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abdurrehmanrehan/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[Immersive Labs | Cyber Million: Packet Analysis — Wireshark | Wireshark Display Filters: Filters…]]></title>
            <link>https://abdurrehmanrehan.medium.com/immersive-labs-cyber-million-packet-analysis-wireshark-wireshark-display-filters-filters-07dca4410603?source=rss-fc0328a05673------2</link>
            <guid isPermaLink="false">https://medium.com/p/07dca4410603</guid>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[immersive-labs]]></category>
            <category><![CDATA[wireshark]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[display-filter]]></category>
            <dc:creator><![CDATA[Abdur Rehman Rehan]]></dc:creator>
            <pubDate>Wed, 08 May 2024 18:58:31 GMT</pubDate>
            <atom:updated>2024-05-08T18:58:31.573Z</atom:updated>
            <content:encoded><![CDATA[<h3>Immersive Labs | Cyber Million: Packet Analysis — Wireshark | Wireshark Display Filters: Filters In Depth | Write-Up</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*IZqV3q6r8ZqN9lt1.png" /></figure><p><a href="https://immersivelabs.online/v2/labs/wireshark-filters-in-depth">Room Link.</a></p><p>For Any suggestions leave a comment.</p><h3>Briefing</h3><h3>Wireshark display filters</h3><p>Wireshark is often used by analysts who are reviewing captures of network traffic generated by malware samples. When reviewing this traffic it can be extremely difficult to find relevant information among all the noise within a network capture. Only a five-minute capture on Wireshark can show a high number of packets transferred between the host system and the servers it is connecting to around the world. Rather than having to continuously scroll through the PCAP, it can be advantageous to use Wireshark display filters, which can be applied post capture, to filter the important data needed for an investigation.</p><p>Using these filters will allow you to identify any necessary information about the packet transfer between two systems, including important IOCs (Indicators of Compromise) which can point towards an origin of a particular incident within a network.</p><h3>Usages and examples: In depth</h3><p>Within the first episode of this series we ran through some simple Wireshark display filters, which can be used to filter out specific packets from a packet capture file. For example filtering packets by a protocol, or filtering packets by source and destination IPs. If you have not already please complete the introductory episode, linked below:</p><p><strong>Prerequisite labs</strong></p><p><a href="https://immersivelabs.online/labs/wireshark-filters-intro">Wireshark Display Filters: An Introduction</a></p><p>You may have noticed while completing this lab that the color of the display filter bar changes when typing out display filters. While the bar remains red, the expression is not accepted. If the bar turns green, the expression has been accepted and will work as expected. And if the bar turns yellow, the expression has been accepted; however, it probably will not work as expected.</p><p>Now we know how to apply some basic filters, let’s take a look at some more complex examples and operators which can be used to create comprehensive display filters.</p><h4>Comparing values</h4><p>Some of the more crucial operators covered in this lab are the operators which are used to compare values within a packet capture. Comparison operators can be used to build filters which compare values in a number of different ways. Here is a complete table of the operators:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/0*mw01d87p4_mzzaTr.png" /></figure><p>There are additional operators that exist, which are expressed as English words. These two operators are contains and matches (which can also be used as ~).</p><p>The contains operator can be used to search/filter by a sequence of characters represented as a string, bytes, array of bytes, or a single character; i.e., does the protocol/field or slice contain a given value at any point in the search field. For example, to search for a given HTTP URL you would use the following:</p><pre>http contains “https://urltosearchfor.com”</pre><p>The <em>matches</em> (<em>~</em>) allows for more specific matching of strings via Perl-compatible regular expressions (PCRE), i.e., does protocol or text match the given regular expression. This allows analysts to filter while enforcing case sensitivity the regular expressions (?-i) option. For example:</p><pre>tcp.flags.str matches “(?-i)ACK”</pre><h4>The Slice operator</h4><p>The slice operator allows analysts to filter via a specific section of a field if the field is a test string or byte array. To do this you can place a pair of brackets [] containing a colon-separated range of values.</p><p>For example if you would like to filter via a specific section of an Ethernet address (the first three bytes), you could use the following filter:</p><pre>eth.src[0:3] == 32.65.76</pre><p>There are a few different ways in which slices can be formatted. For this example <em>‘0’</em> is the beginning of the offset, and <em>‘3’</em> signifies the length of the range.</p><p>Take a look at the following table which displays all the syntax which governs slices:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/405/0*uD3QeCGB7Pwi4-g1.png" /></figure><p>Offsets which begin with a negative value, indicate an offset which begins at the end of a search field. For example, eth.src[-3:3] == 32.65.76 would search for the last three bytes of ethernet source addresses.</p><p>Lastly, slices can be combined by using a concatenation operator between the multiple slices (,).</p><h4>The Membership operator</h4><p>The membership operator in Wireshark allows you to test a field for a set number of values. In order to do this, after a field value you must place the in operator followed by curly brackets with the values you wish to search for ({value1 value2 value3}). The following example will filter by tcp source port 80, 8080, and 808080:</p><pre>tcp.srcport in {80 8080 808080}</pre><p>Set values within a membership operator can also filter via a range of values by inserting a .. in between values. The following example will filter by tcp source ports 80, 8080, and every port between:</p><pre>tcp.srcport in {80 8080 80..8080}</pre><h3>In this lab</h3><p>In this lab, you have been exposed to some of the more complex operators used within Wireshark display filters for more comprehensive filters.</p><p>The practical element of this lab will involve the use of filters in order to sort through the PCAP provided on the Desktop. A full cheat sheet of important Wireshark display filters can be found <a href="https://www.wireshark.org/docs/dfref/">here</a>.</p><p>As has been mentioned in the introductory lab there is a great deal of fields which Wireshark can filter by, here is a link to the <a href="https://www.wireshark.org/docs/wsug_html_chunked/ChWorkBuildDisplayFilterSection.html">docs</a> for Wireshark, which provide a comprehensive display filter reference sheet.</p><h3>Lab Solution</h3><h4>Tasks:</h4><blockquote><strong><em>I. </em></strong>Read the <strong>Briefing </strong>panel to understand some more complex filters/operators.</blockquote><blockquote><strong><em>II.</em></strong><em> </em>Navigate to your <strong>Desktop </strong>and open <strong>file.pcap</strong> in Wireshark.</blockquote><blockquote><strong><em>III. </em></strong>Apply a filter that displays all SMTP traffic containing the text “Subject:”</blockquote><blockquote><strong><em>IV.</em></strong><em> </em>What is the first name of the recipient of that email?</blockquote><blockquote><strong>Answer: Sarah</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>First of all, we have to apply the filter to display only SMTP traffic that contains text “Subject:”.</blockquote><blockquote><em>2. </em>We can do it by using this filter.<br>(smtp contains &quot;Subject: &quot;)</blockquote><blockquote><em>3.</em> We will get the filtered packets and now will open the first packet for analysis.</blockquote><blockquote><em>4.</em> As we require the name of the recipient of email, we will find it under the “Simple Mail Transfer Protocol” field.</blockquote><blockquote><em>5. </em>There will “To” heading. There you will find the answer.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*os1-9KDzPzxf_pSykM0Vmg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/492/1*SCLnmsxzibbviQavfYQ1Lg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*sO-3W7xK9duhsraRIQOyyw.png" /></figure><blockquote><strong><em>V. </em></strong>Change the filter so it now displays all SMTP response traffic matching the text “.co.uk”.</blockquote><blockquote><strong><em>VI. </em></strong>What is the frame number of this packet?</blockquote><blockquote><strong>Answer: 9932</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Use the same contain filter with changed value.</blockquote><blockquote><em>2. </em>Add first packets frame number, it gives error and hint that required packet is response.</blockquote><blockquote><em>3. </em>There is total of three packets, we can easily add their numbers to determine but can also check STMP field as it will contain this info.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*ExyT2CpUfAA2aJZU_vkLAQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*GEV-armxgpIpkBbluTQNlQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*AzFYSj05qwUv9qYFF9KSUQ.png" /></figure><blockquote><strong><em>VII. </em></strong>Remove the existing filter. Now, apply a filter that displays all packets from UDP source ports 53, 59015, and 63518</blockquote><blockquote><strong><em>VIII. </em></strong>How many packets are then displayed?</blockquote><blockquote><strong>Answer: 60</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1</em>. We can use in operator and give the source ports for filtering.<br>udp.srcport in {53 59015 63518}</blockquote><blockquote><em>2. </em>Or other way is to use this filter.<br>udp.srcport == 53 || udp.srcport == 59015 || udp.srcport == 63518</blockquote><blockquote><em>3.</em> Both will give same results.</blockquote><blockquote><em>4</em>. You can check the number of packets in the bottom right corner.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VnIbCLP9SCd0OQG1wdrIow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*FZo_JIiU4i_x6iChKWJNFw.png" /></figure><blockquote><strong><em>IX. </em></strong>Take the following slice expression (frame[-4:4] == 0.1.2.3).</blockquote><blockquote><strong><em>X. </em></strong>At which offset does the slice begin?</blockquote><blockquote><strong>Answer: -4</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1.</em> Have to clearly read the brefing for this question.</blockquote><blockquote><em>2.</em> The number immediately after [ determine the beginning of the offset.</blockquote><blockquote><em>3. “-” </em>tells that start counting from the last.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*kPT5f_ak6kONCgqWhfGU8g.png" /></figure><blockquote><strong><em>XI. </em></strong>Take the following slice expression (frame[:4] == 0.1.2.3).</blockquote><blockquote><strong><em>XII. </em></strong>At which offset does the slice begin?</blockquote><blockquote><strong>Answer: 0</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1.</em> Mentioned in the brefing that if there is no beginning offset than by defualt it consider it 0.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*ZCVfdtYvgDTgYSpRvYwT4g.png" /></figure><h3>Connect with me on</h3><p><a href="https://www.linkedin.com/in/abdurrehmanrehan/">LinkedIn</a></p><p>Thank you for taking the time to read my walk through.<br>If you found it helpful, please hit the 👏 button and share it to help others with similar interests! + Feedback is always welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07dca4410603" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Try Hack Me | Introductory Networking | Write up]]></title>
            <link>https://abdurrehmanrehan.medium.com/try-hack-me-introductory-networking-write-up-d58426936711?source=rss-fc0328a05673------2</link>
            <guid isPermaLink="false">https://medium.com/p/d58426936711</guid>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[introductory-networking]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[tryhackme-writeup]]></category>
            <dc:creator><![CDATA[Abdur Rehman Rehan]]></dc:creator>
            <pubDate>Tue, 16 Apr 2024 20:30:25 GMT</pubDate>
            <atom:updated>2024-04-16T20:30:25.822Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*SK2XA3J8Zg8SMC3L8JIeGQ.png" /></figure><p>An introduction to networking theory and basic networking tools.</p><p><a href="https://tryhackme.com/room/introtonetworking">Room link.</a></p><p>For any suggestion leave a comment.</p><h3>Task 1: Introduction</h3><p>The aim of this room is to provide a beginner’s introduction to the basic principles of networking. Networking is a <em>massive</em> topic, so this really will just be a brief overview; however, it will hopefully give you some foundational knowledge of the topic, which you can build upon for yourself<em>.</em></p><p>The topics that we’re going to cover in this room are:</p><ul><li>The OSI Model</li><li>The TCP/IP Model</li><li>How these models look in practice</li><li>An introduction to basic networking tools</li></ul><h4>Questions</h4><blockquote><strong>I:</strong> Let’s get started!</blockquote><blockquote><strong>No Answer Needed.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DZG2UKn8kcTnCRmawFDsDQ.png" /></figure><h3>Task 2: The OSI Model: An Overview</h3><p>The OSI (<strong>O</strong>pen <strong>S</strong>ystems <strong>I</strong>nterconnection) Model is a standardised model which we use 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/134/0*XGXgjTaFSoL9iJsy.png" /></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><em>For the “Which Layer” Questions below, answer using the layer number (1–7)</em></strong></p><h4>Questions</h4><blockquote><strong>I: </strong>Which layer would choose to send data over TCP or UDP?</blockquote><blockquote><strong>Answer: 4</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ub8Ga4B3u3zQGlEHjQBKkQ.png" /></figure><blockquote><strong>II:</strong> Which layer checks received information to make sure that it hasn’t been corrupted?</blockquote><blockquote><strong>Answer: 2</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jmsJedjRAuv733193vHzOA.png" /></figure><blockquote><strong>III: </strong>In which layer would data be formatted in preparation for transmission?</blockquote><blockquote><strong>Answer: 2</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*55w4zroDFhYbwSyXjLqQYg.png" /></figure><blockquote><strong>IV: </strong>Which layer transmits and receives data?</blockquote><blockquote><strong>Answer: 1</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MON36AIlvwObzJ4jzYU58Q.png" /></figure><blockquote><strong>V:</strong> Which layer encrypts, compresses, or otherwise transforms the initial data to give it a standardised format?</blockquote><blockquote><strong>Answer: 6</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4tlnkd086wPZrKfcxn7VKA.png" /></figure><blockquote><strong>VI: </strong>Which layer tracks communications between the host and receiving computers?</blockquote><blockquote><strong>Answer: 5</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0OOPLZs_0tHd_3AnzIsHYQ.png" /></figure><blockquote><strong>VII: </strong>Which layer accepts communication requests from applications?</blockquote><blockquote><strong>Answer: 7</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*imomrUkEh0gwJ5y-Ys5LWQ.png" /></figure><blockquote><strong>VIII: </strong>Which layer handles logical addressing?</blockquote><blockquote><strong>Answer: 3</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*upv8cBK6jOI1sddMnWMDaw.png" /></figure><blockquote><strong>IX: </strong>When sending data over TCP, what would you call the “bite-sized” pieces of data?</blockquote><blockquote><strong>Answer: <em>segments</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w6LKXE9ghES-Xrb2QS_Mug.png" /></figure><blockquote><strong>X: [Research]</strong> Which layer would the FTP protocol communicate with?</blockquote><blockquote><strong>Hint:</strong> FTP is a protocol used to transfer data between computers. It’s often accessed with a special program called an FTP Client.</blockquote><blockquote><strong>Answer: 7</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*iWdz495IJ71uI8tuxrEPBA.png" /></figure><blockquote><strong>XI: </strong>Which transport layer protocol would be best suited to transmit a live video?</blockquote><blockquote><strong>Answer: UDP</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nkhMUljTL4Ed2l2YijUAvA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xmyMJYZstFDwrkcR1o0KVQ.png" /></figure><h3>Task 3: Encapsulation</h3><p>As the data is passed down each layer of the model, more information containing details specific to the layer in question is added on to the start of the transmission. As an example, the header added by the Network Layer would include things like the source and destination IP addresses, and the header added by the Transport Layer would include (amongst other things) information specific to the protocol being used. The data link layer also adds a piece on at the <em>end</em> of the transmission, which is used to verify that the data has not been corrupted on transmission; this also has the added bonus of increased security, as the data can’t be intercepted and tampered with without breaking the trailer. This whole process is referred to as <em>encapsulation; </em>the process by which data can be sent from one computer to another.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EP5Hpj7zN1T9j4Xu.jpeg" /></figure><p>Notice that the encapsulated data is given a different name at different steps of the process. In layers 7,6 and 5, the data is simply referred to as data. In the transport layer the encapsulated data is referred to as a segment or a datagram (depending on whether TCP or UDP has been selected as a transmission protocol). At the Network Layer, the data is referred to as a packet. When the packet gets passed down to the Data Link layer it becomes a frame, and by the time it’s transmitted across a network the frame has been broken down into bits.</p><p>When the message is received by the second computer, it reverses the process — starting at the physical layer and working up until it reaches the application layer, stripping off the added information as it goes. This is referred to as <em>de-encapsulation. </em>As such you can think of the layers of the OSI model as existing inside every computer with network capabilities. Whilst it’s not actually as clear cut in practice, computers all follow the same process of encapsulation to send data and de-encapsulation upon receiving it.</p><p>The processes of encapsulation and de-encapsulation are very important — not least because of their practical use, but also because they give us a standardised method for sending data. This means that all transmissions will consistently follow the same methodology, allowing any network enabled device to send a request to any other reachable device and be sure that it will be understood — regardless of whether they are from the same manufacturer; use the same operating system; or any other factors.</p><h4>Questions</h4><blockquote><strong>I: </strong>How would you refer to data at layer 2 of the encapsulation process (with the OSI model)?</blockquote><blockquote><strong>Answer: Frames</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/504/1*mhrmkKtraDnRO1Y4Ju7zbA.png" /></figure><blockquote><strong>II: </strong>How would you refer to data at layer 4 of the encapsulation process (with the OSI model), if the UDP protocol has been selected?</blockquote><blockquote><strong>Answer: Datagrams</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*xgyvU7eQd18Rx2Um7rORXw.png" /></figure><blockquote><strong>III: </strong>What process would a computer perform on a received message?</blockquote><blockquote><strong>Answer: de-encapsulation</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uvQxnkhKzmEfhlwHU2fP9Q.png" /></figure><blockquote><strong>IV: </strong>Which is the only layer of the OSI model to add a <em>trailer</em> during encapsulation?</blockquote><blockquote><strong>Answer: data link</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*sfzBHEqOoahWFvAJwgbAPg.png" /></figure><blockquote><strong>V: </strong>Does encapsulation provide an extra layer of security <strong>(Aye/Nay)</strong>?</blockquote><blockquote><strong>Answer: aye</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zij-x2Vje0dsC8N8Vf9TOw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GzkSmkOe7wOYl_a5RsmS5w.png" /></figure><h3>Task 4: The TCP/IP Model</h3><p>The TCP/IP model is, in many ways, very similar to the OSI model. It’s a few years older, and serves as the basis for real-world networking. The TCP/IP model consists of four layers: Application, Transport, Internet and Network Interface. Between them, these cover the same range of functions as the seven layers of the OSI Model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/153/0*38pT3ZlDNmb_TTcO.png" /></figure><p><strong><em>Note: </em></strong><em>Some recent sources split the TCP/IP model into five layers — breaking the Network Interface layer into Data Link and Physical layers (as with the OSI model). This is accepted and well-known; however, it is not officially defined (unlike the original four layers which are defined in RFC1122). It’s up to you which version you use — both are generally considered valid.</em></p><p>You would be justified in asking why we bother with the OSI model if it’s not actually used for anything in the real-world. The answer to that question is quite simply that the OSI model (due to being less condensed and more rigid than the TCP/IP model) tends to be easier for learning the initial theory of networking.</p><p>The two models match up something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/259/0*ruU4ShFY6ClUFudv.png" /></figure><p>The processes of encapsulation and de-encapsulation work in exactly the same way with the TCP/IP model as they do with the OSI model. At each layer of the TCP/IP model a header is added during encapsulation, and removed during de-encapsulation.</p><p>Now let’s get down to the practical side of things.</p><p>A layered model is great as a visual aid — it shows us the general process of how data can be encapsulated and sent across a network, but how does it actually happen?</p><p>When we talk about TCP/IP, it’s all well and good to think about a table with four layers in it, but we’re actually talking about a suite of protocols — sets of rules that define how an action is to be carried out. TCP/IP takes its name from the two most important of these: the <strong>T</strong>ransmission <strong>C</strong>ontrol <strong>P</strong>rotocol (which we touched upon earlier in the OSI model) that controls the flow of data between two endpoints, and the <strong>I</strong>nternet <strong>P</strong>rotocol, which controls how packets are addressed and sent. There are many more protocols that make up the TCP/IP suite; we will cover some of these in later tasks. For now though, let’s talk about TCP.</p><p>As mentioned earlier, TCP is a <em>connection-based</em> protocol. In other words, before you send any data via TCP, you must first form a stable connection between the two computers. The process of forming this connection is called the <em>three-way handshake</em>.</p><p>When you attempt to make a connection, your computer first sends a special request to the remote server indicating that it wants to initialise a connection. This request contains something called a <em>SYN</em> (short for <em>synchronise</em>) bit, which essentially makes first contact in starting the connection process. The server will then respond with a packet containing the SYN bit, as well as another “acknowledgement” bit, called <em>ACK</em>. Finally, your computer will send a packet that contains the ACK bit by itself, confirming that the connection has been setup successfully. With the three-way handshake successfully completed, data can be reliably transmitted between the two computers. Any data that is lost or corrupted on transmission is re-sent, thus leading to a connection which appears to be lossless.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/0*O8mAFk8VApvmlomC.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UBxoalNJx4mbfEtF.jpeg" /></figure><p><em>(Credit Kieran Smith, Abertay University)</em></p><p>We’re not going to go into exactly <em>how</em> this works on a step-to-step level — not in this room at any rate. It is sufficient to know that the three-way handshake must be carried out before a connection can be established using TCP.</p><p><strong>History:</strong></p><p>It’s important to understand exactly <em>why</em> the TCP/IP and OSI models were originally created. To begin with there was no standardisation — different manufacturers followed their own methodologies, and consequently systems made by different manufacturers were completely incompatible when it came to networking. The TCP/IP model was introduced by the American DoD in 1982 to provide a standard — something for all of the different manufacturers to follow. This sorted out the inconsistency problems. Later the OSI model was also introduced by the International Organisation for Standardisation (<a href="https://www.iso.org/home.html">ISO</a>); however, it’s mainly used as a more comprehensive guide for learning, as the TCP/IP model is still the standard upon which modern networking is based.</p><h4>Questions:</h4><blockquote><strong>I: </strong>Which model was introduced first, OSI or TCP/IP?</blockquote><blockquote><strong>Answer: TCP/IP</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*unZbcbppco9qGtzlSW874w.png" /></figure><blockquote><strong>II: </strong>Which layer of the TCP/IP model covers the functionality of the Transport layer of the OSI model <strong>(Full Name)</strong>?</blockquote><blockquote><strong>Answer: Transport</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*-7g2pFes1URe__2hsp812A.png" /></figure><blockquote><strong>III: </strong>Which layer of the TCP/IP model covers the functionality of the Session layer of the OSI model <strong>(Full Name)</strong>?</blockquote><blockquote><strong>Answer: Application</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/255/1*-7g2pFes1URe__2hsp812A.png" /></figure><blockquote><strong>IV: </strong>The Network Interface layer of the TCP/IP model covers the functionality of two layers in the OSI model. These layers are Data Link, and?.. <strong>(Full Name)</strong>?</blockquote><blockquote><strong>Answer: Physical</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*mVArTAb6sDRhwR2XNl5jNA.png" /></figure><blockquote><strong>V: </strong>Which layer of the TCP/IP model handles the functionality of the OSI network layer?</blockquote><blockquote><strong>Answer: Internet</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*mVArTAb6sDRhwR2XNl5jNA.png" /></figure><blockquote><strong>VI: </strong>What kind of protocol is TCP?</blockquote><blockquote><strong>Hint: </strong>In comparison, UDP would be connectionless</blockquote><blockquote><strong>Answer: <em>connection-based</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/494/1*x8t7Ba6qcpjVIFlC39ucuQ.png" /></figure><blockquote><strong>VII: </strong>What is SYN short for?</blockquote><blockquote><strong>Hint: </strong>British Spelling</blockquote><blockquote><strong>Answer: <em>synchronise</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*HVInxhiqK0U0wuWGi_WKWg.png" /></figure><blockquote><strong>VIII: </strong>What is the second step of the three way handshake?</blockquote><blockquote><strong>Answer: Syn/Ack</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-f3hekhT9Tc7B7DLSVu_sw.png" /></figure><blockquote><strong>IX: </strong>What is the short name for the “Acknowledgement” segment in the three-way handshake?</blockquote><blockquote><strong>Answer: ack</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*BGAaD0tAqUsvw29imNGRaw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vYlW5UAEb72H2XJV-41DWQ.png" /></figure><h3>Task 5: (Networking Tools) Ping</h3><p>At this stage, hopefully all of the theory has made sense and you now understand the basic models behind computer networking. For the rest of the room we’re going to be taking a look at some of the command line networking tools that we can use in practical applications. Many of these tools do work on other operating systems, but for the sake of simplicity, I’m going to assume that you’re running Linux for the rest of this room. The first tool that we’re going to look at will be the ping command.</p><p>The ping command is used when we want to test whether a connection to a remote resource is possible. Usually this will be a website on the internet, but it could also be for a computer on your home network if you want to check if it’s configured correctly. Ping works using the ICMP protocol, which is one of the slightly less well-known TCP/IP protocols that were mentioned earlier. The ICMP protocol works on the Network layer of the OSI Model, and thus the Internet layer of the TCP/IP model. The basic syntax for ping is ping &lt;target&gt;. In this example we are using ping to test whether a network connection to Google is possible:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/0*P600lRSSaExmVNYT.png" /></figure><p>Notice that the ping command actually returned the IP address for the Google server that it connected to, rather than the URL that was requested. This is a handy secondary application for ping, as it can be used to determine the IP address of the server hosting a website. One of the big advantages of ping is that it’s pretty much ubiquitous to any network enabled device. All operating systems support it out of the box, and even most embedded devices can use ping!</p><p>Have a go at the following questions. Any questions about syntax can be answered using the man page for ping (man ping on Linux).</p><h4>Questions</h4><blockquote><strong>I: </strong>What command would you use to ping the bbc.co.uk website?</blockquote><blockquote><strong>Answer: ping bbc.co.uk</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/1*ths5DQlyX_Rh3ju-3cRcgQ.png" /></figure><blockquote><strong>II: </strong>Ping <em>muirlandoracle.co.uk<br></em>What is the IPv4 address?</blockquote><blockquote><strong>Hint: </strong>You may need to answer question 4 first and use that switch to resolve the IPv4 address of the site, rather than the IPv6 address.</blockquote><blockquote><strong>Answer: 217.160.0.152</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*uc45EFrsEYCyJ5GJYCKMjg.png" /></figure><blockquote><strong>III: </strong>What switch lets you change the interval of sent ping requests?</blockquote><blockquote><strong>Hint: </strong>Look in the man page</blockquote><blockquote><strong>Answer: -i</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*iHXNZHxgiVikuIbZFOFZWw.png" /></figure><blockquote><strong>IV: </strong>What switch would allow you to restrict requests to IPv4?</blockquote><blockquote><strong>Answer: -4</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*0LaCapn_tuWKOAL84u8_PA.png" /></figure><blockquote><strong>V: </strong>What switch would give you a more verbose output?</blockquote><blockquote><strong>Answer: -v</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*MPUL920_gqT7UAqr5_Lyag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jiyPeXgWLVSE0BpTy2UnRA.png" /></figure><h3>Task 6: (Networking Tools) Traceroute</h3><p>The logical follow-up to the ping command is ‘traceroute’. Traceroute can be used to map the path your request takes as it heads to the target machine.</p><p>The internet is made up of many, many different servers and end-points, all networked up to each other. This means that, in order to get to the content you actually want, you first need to go through a bunch of other servers. Traceroute allows you to see each of these connections — it allows you to see every intermediate step between your computer and the resource that you requested. The basic syntax for traceroute on Linux is this: traceroute &lt;destination&gt;</p><p>By default, the Windows traceroute utility (tracert) operates using the same ICMP protocol that ping utilises, and the Unix equivalent operates over UDP. This can be altered with switches in both instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/0*U7OQrY8_2st2l8Wp.png" /></figure><p>You can see that it took 13 hops to get from my router (_gateway) to the Google server at 216.58.205.46</p><p>Now it’s your turn. As with before, all questions about switches can be answered with the man page for traceroute<br>(man traceroute).</p><h4>Questions</h4><blockquote><strong>I: </strong>Use traceroute on tryhackme.com<br>Can you see the path your request has taken?</blockquote><blockquote><strong>No Answer Needed.</strong></blockquote><blockquote><strong>II: </strong>What switch would you use to specify an interface when using Traceroute?</blockquote><blockquote><strong>Hint: </strong>An interface is provided by your NIC — common interfaces are things like tunnels for VPN connections, ethernet connections, and wireless connections</blockquote><blockquote><strong>Answer: -i</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/1*ji_h2uz_nJEP217Wtmm8hA.png" /></figure><blockquote><strong>III: </strong>What switch would you use if you wanted to use TCP SYN requests when tracing the route?</blockquote><blockquote><strong>Answer: -t</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*H4_CnFXwaIVJZZMudKd5wA.png" /></figure><blockquote><strong>IV: [Lateral Thinking] </strong>Which layer of the <strong><em>TCP/IP</em></strong> model will traceroute run on by default (Windows)?</blockquote><blockquote><strong>Answer: Internet</strong></blockquote><blockquote>It will be internet layer because it has to retrieve the host Ip address which are on the internet layers and also in above task it was mentioned ping works on the internet layer. and traceroute is something same but also finds the paths.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6QDIx7dkEtJTAznmxhRtiA.png" /></figure><h3>Task 7: (Networking Tools) WHOIS</h3><p>Domain Names — the unsung saviours of the internet.</p><p>Can you imagine how it would feel to remember the IP address of every website you want to visit? Horrible thought.</p><p>Fortunately, we’ve got domains.</p><p>We’ll talk a little bit more about how this works in the next task, but for now suffice to know that a domain translates into an IP address so that we don’t need to remember it (e.g. you can type tryhackme.com, rather than the TryHackMe IP address). Domains are leased out by companies called Domain Registrars. If you want a domain, you go and register with a registrar, then lease the domain for a certain length of time.</p><p>Enter Whois.</p><p>Whois essentially allows you to query who a domain name is registered to. In Europe personal details are redacted; however, elsewhere you can potentially get a great deal of information from a whois search.</p><p>There is a <a href="https://www.whois.com/whois/">web version</a> of the whois tool if you’re particularly averse to the command line. Either way, let’s get started!</p><p><em>(Note: You may need to install whois before using it. On Debian based systems this can be done with </em>sudo apt update &amp;&amp; sudo apt-get install whois<em>)</em></p><p>Whois lookups are very easy to perform. Just use whois &lt;domain&gt; to get a list of available information about the domain registration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FinXikfjUvWIYLVG.png" /></figure><p>This is comparatively a very small amount of information as can often be found. Notice that we’ve got the domain name, the company that registered the domain, the last renewal, and when it’s next due, and a bunch of information about nameservers (which we’ll look at in the next task).</p><p>Your Turn</p><h4>Questions</h4><blockquote><strong>I: </strong>Perform a whois search on facebook.com</blockquote><blockquote><strong>No Answer Needed.</strong></blockquote><blockquote><strong>II: </strong>What is the registrant postal code for facebook.com?</blockquote><blockquote><strong>Answer: 94025</strong></blockquote><blockquote>Used whois web</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*JsBUd4ofqxFTHNBl9qig9g.png" /></figure><blockquote><strong>III: </strong>When was the facebook.com domain first registered (Format: DD/MM/YYYY)?</blockquote><blockquote>Answer: 29/03/1997</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*XtOBIxxxsvbRJznFk1c57w.png" /></figure><blockquote><strong>IV: </strong>Perform a whois search on microsoft.com <br>(Note: If you fail to read the above instruction and consequently get the wrong answer for the next question, don’t expect a helpful response if you report it as a bug…)</blockquote><blockquote><strong>No Answer Needed.</strong></blockquote><blockquote><strong>V: </strong>Which city is the registrant based in?</blockquote><blockquote><strong>Answer: Redmond</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/457/1*Un9Rtrr3R_08ofrcxJRChQ.png" /></figure><p><strong>VI: [OSINT] </strong>What is the name of the golf course that is near the registrant address for microsoft.com?</p><p><strong>Answer: Bellevue Golf Course</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*Fskhs9JtfA1Hy-P6YFAaDw.png" /></figure><p><strong>VII: </strong>What is the registered Tech Email for microsoft.com?</p><p><strong>Answer: msnhst@microsoft.com</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*h2-FeEr9wqpjy54QKDQJlA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GkwHB-kO-Bd1vQCocJaxww.png" /></figure><h3>Task 8: (Networking Tools) Dig</h3><p>We talked about domains in the previous task — now lets talk about how they work.</p><p>Ever wondered how a URL gets converted into an IP address that your computer can understand? The answer is a TCP/IP protocol called DNS (<strong>D</strong>omain <strong>N</strong>ame <strong>S</strong>ystem).</p><p>At the most basic level, DNS allows us to ask a special server to give us the IP address of the website we’re trying to access. For example, if we made a request to <a href="http://www.google.com,/">www.google.com,</a> our computer would first send a request to a special DNS server (which your computer already knows how to find). The server would then go looking for the IP address for Google and send it back to us. Our computer could then send the request to the IP of the Google server.</p><p>Let’s break this down a bit.</p><p>You make a request to a website. The first thing that your computer does is check its local “<a href="https://www.ionos.co.uk/digitalguide/server/configuration/hosts-file/"><strong><em>Hosts</em></strong></a><strong><em> File</em></strong>” to see if an explicit IP-&gt;Domain mapping has been created. This is an older system than DNS and much less commonly used in modern environments; however, it still takes precedence in the search order of most operating systems. If no mapping has been manually created, the computer then checks its local DNS cache to see if it already has an IP address stored for the website; if it does, great. If not, it goes to the next stage of the process.</p><p>Assuming the address hasn’t already been found, your computer will then send a request to what is known as a <em>recursive</em> DNS server. These will automatically be known to the router on your network. Many Internet Service Providers (ISPs) maintain their own recursive servers, but companies such as Google and OpenDNS also control recursive servers. This is how your computer automatically knows where to send the request for information: details for a recursive DNS server are stored in your router or computer. This server will also maintain a cache of results for popular domains; however, if the website you’ve requested isn’t stored in the cache, the recursive server will pass the request on to a <em>root name</em> server.</p><p>Before 2004 there were precisely 13 root name DNS servers in the world. These days there are many more; however, they are still accessible using the same 13 IP addresses assigned to the original servers (balanced so that you get the closest server when you make a request). The root name servers essentially keep track of the DNS servers in the next level down, choosing an appropriate one to redirect your request to. These lower level servers are called <em>Top-Level</em> <em>Domain</em> servers.</p><p>Top-Level Domain (TLD) servers are split up into extensions. So, for example, if you were searching for tryhackme<strong>.com</strong> your request would be redirected to a TLD server that handled .com domains. If you were searching for bbc<strong>.co.uk</strong> your request would be redirected to a TLD server that handles .co.uk domains. As with root name servers, TLD servers keep track of the next level down: <em>Authoritative name servers</em>. When a TLD server receives your request for information, the server passes it down to an appropriate Authoritative name server.</p><p>Authoritative name servers are used to store DNS records for domains directly. In other words, every domain in the world will have its DNS records stored on an Authoritative name server somewhere or another; they are the source of the information. When your request reaches the authoritative name server for the domain you’re querying, it will send the relevant information back to you, allowing your computer to connect to the IP address behind the domain you requested.</p><p>When you visit a website in your web browser this all happens automatically, but we can also do it manually with a tool called dig . Like ping and traceroute, dig should be installed automatically on Linux systems.</p><p>Dig allows us to manually query recursive DNS servers of our choice for information about domains:<br>dig &lt;domain&gt; @&lt;dns-server-ip&gt;</p><p>It is a very useful tool for network troubleshooting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/0*uJQd9mLTuNCIfeRi.png" /></figure><p>This is a <em>lot</em> of information. We’re currently most interested in the ANSWER section for this room; however, taking the time to learn what the rest of this means is a very good idea. In summary, that information is telling us that we sent it one query and successfully (i.e. No Errors) received one full answer -- which, as expected, contains the IP address for the domain name that we queried.</p><p>Another interesting piece of information that dig gives us is the TTL (<strong>T</strong>ime <strong>T</strong>o <strong>L</strong>ive) of the queried DNS record. As mentioned previously, when your computer queries a domain name, it stores the results in its local cache. The TTL of the record tells your computer when to stop considering the record as being valid — i.e. when it should request the data again, rather than relying on the cached copy.</p><p>The TTL can be found in the second column of the answer section:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/450/0*TVCekMO6dBZ_4Eca.png" /></figure><p>It’s important to remember that TTL (in the context of DNS caching) is measured in <em>seconds,</em> so the record in the example will expire in two minutes and thirty-seven seconds.</p><p>Have a go at some questions about DNS and dig.</p><h4>Questions</h4><blockquote><strong>I: </strong>What is DNS short for?</blockquote><blockquote><strong>Answer: Domain Name System</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*JRN6gITqwcsmMaQbiHj29w.png" /></figure><blockquote><strong>II: </strong>What is the first type of DNS server your computer would query when you search for a domain?</blockquote><blockquote><strong>Answer: <em>recursive</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*-nl5S9MW1kNje_gtIH3LBA.png" /></figure><blockquote><strong>III: </strong>What type of DNS server contains records specific to domain extensions (i.e. <em>.com,</em> .co.uk*, etc)*? Use the long version of the name.</blockquote><blockquote><strong>Answer: Top-Level Domain</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*swsLs6PBpTxZuA3JswmQHQ.png" /></figure><blockquote><strong>IV: </strong>Where is the very first place your computer would look to find the IP address of a domain?</blockquote><blockquote><strong>Hint: </strong>Read the provided information carefully. This question refers to a system which is older than (and completely separate from) DNS.</blockquote><blockquote><strong>Answer: hosts files</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*QdtCJCxGuHNUre5mK0z8fQ.png" /></figure><blockquote><strong>V: [Research]</strong> Google runs two public DNS servers. One of them can be queried with the IP 8.8.8.8, what is the IP address of the other one?</blockquote><blockquote><strong>Answer: 8.8.4.4</strong></blockquote><blockquote>Search on the internet.</blockquote><blockquote><strong>VI: </strong>If a DNS query has a TTL of 24 hours, what number would the dig query show?</blockquote><blockquote><strong>Answer: 86400</strong></blockquote><blockquote>As it is displayed in seconds so will do simple calculation 24*60*60 secs.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LOaNJRsXFwo8vPRcKhyWRg.png" /></figure><h3>Task 9: Further Reading</h3><p>That’s us completed our whirlwind tour of networking basics. Hopefully you’ve found it informative!</p><p>Networking is one of those things that you just need to learn. We’ve covered the very basics, but it would be a very good idea to continue to learn by yourself.</p><p>In terms of further information, feel free to reach out in the TryHackMe Discord if you want any help with the contents of this room. Additionally, if you want to expand your knowledge of networking theory, the <a href="https://www.amazon.co.uk/Interconnecting-Cisco-Network-Devices-ICND1/dp/1587054620/ref=sr_1_1?keywords=Interconnecting+Cisco+Network+Devices%2C+Part+1&amp;qid=1583683766&amp;sr=8-1">CISCO Self Study Guide by Steve McQuerry</a> is a great resource to work from. There may be a more up to date version available; however, this edition is cheap, readily available, and most importantly, still very relevant. Whilst it is designed to as a study guide for the CCNA exam, that book serves equally well as a very rounded introduction to networking principles.</p><h4>Questions</h4><blockquote><strong>I:</strong> Read the final thoughts</blockquote><blockquote><strong>No Answer Needed.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7_h7WhDcy6UsWbYxnYyomA.png" /></figure><h3>Connect with me on</h3><p><a href="https://www.linkedin.com/in/abdurrehmanrehan/">LinkedIn</a></p><p>Thank you for taking the time to read my walk through.<br>If you found it helpful, please hit the 👏 button (40x) and share it to help others with similar interests! + Feedback is always welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d58426936711" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Immersive Labs | Cyber Million: Incident Response | Browser Bookmark Discovery | Write-Up]]></title>
            <link>https://abdurrehmanrehan.medium.com/immersive-labs-cyber-million-incident-response-browser-bookmark-discovery-write-up-cc03e73a72ee?source=rss-fc0328a05673------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc03e73a72ee</guid>
            <category><![CDATA[browsers]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[immersive-labs]]></category>
            <dc:creator><![CDATA[Abdur Rehman Rehan]]></dc:creator>
            <pubDate>Sat, 24 Feb 2024 11:02:15 GMT</pubDate>
            <atom:updated>2024-02-24T11:02:15.266Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9c05qQPVDuWfBAkR.jpg" /><figcaption><a href="https://anekawarnacatrumahminimalistik.blogspot.com/2020/10/konsep-33-browser-backgrounds.html">Image link</a></figcaption></figure><p><a href="https://immersivelabs.online/v2/labs/browser-bookmark-discovery">Room Link.</a></p><p>For Any suggestions leave a comment.</p><h3>Briefing</h3><h4>Bookmarks</h4><p>Stealing browser information isn’t just a manual task for an attacker to execute. In the past, malware families have capitalized on information leaks as part of a wider attack. Calisto is a piece of backdoor MacOS malware discovered by the researchers at <a href="https://securelist.com/calisto-trojan-for-macos/86543/">SecureList</a>. One part of Calisto’s attack scope is to steal information from Google Chrome, including history, bookmarks and cookies.</p><p>Browser data location varies, as it is based on the platform, browser and operating system. In this lab, Chromium bookmark data can be found in the <strong>/home/iml-user/.config/chromium/Default</strong> directory.</p><h4>Mitigation and detection</h4><p>Finding a way to mitigate this technique is unlikely, as this sort of file system behavior is common and unsuspicious. Preventing access to the bookmark files will not solve anything because it will prevent legitimate software from running properly. It is therefore worth preventing adversary tools from being able to run in the first place. You can do this by white-listing, which allows you to identify and block unnecessary executables or malicious utilities.</p><h4>In this lab</h4><p>You have access to a compromised box, and your task is to find as much information as possible about the user.</p><p>What can you learn?</p><h3>Lab Solution</h3><h4>Tasks:</h4><blockquote><strong>I.</strong> Locate the bookmark file found in the <br>/home/iml-user/.config/chromium/Default directory.</blockquote><blockquote><strong>II</strong>. Answer questions based on the target’s bookmarks.</blockquote><blockquote><strong>III. </strong>Under which attack phase is this technique likely to occur?</blockquote><blockquote><strong>Answer: Enumeration</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em><a href="https://www.privacysense.net/terms/enumeration/">Enumeration </a>is a process to extract usernames,<strong> </strong>machine names, network resources, shares and services from a system or network.</blockquote><blockquote><em>2. </em>As we are trying to get/steal the bookmarks data, so it is also enumeration attack phase.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*jmNeM2rzZrZ7sUVeoqf3YA.png" /></figure><blockquote><strong>IV. </strong>True or False: The user has Pinterest bookmarked.</blockquote><blockquote><strong>Answer: True</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>In the given directory there is bookmarks file open it.</blockquote><blockquote><em>2. </em>After opening use find command to find the Pinterest bookmark in the file.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*VL0_FnqpfaDSlwgzsXo-tw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*wAooxiClG-l8dxG4pBMk_g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*lnW3-FOOkVGeNwAlR8McUg.png" /></figure><blockquote><strong>V. </strong>What is the most likely email service used by the user?</blockquote><blockquote><strong>Answer: yahoo</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Use find command to find the keyword mail in the file.</blockquote><blockquote><em>2. </em>You will find only one result that is the Yahoo mail.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*ZoWcKY80KFPxuvdhS4v-Iw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*67IUSW_AYwJoxa2TZFUAWQ.png" /></figure><blockquote><strong>VI. </strong>To what banking company is the user registered?</blockquote><blockquote><strong>Answer: imlbank</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Same steps as previous two</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*oZzdneABjnVbqQgytb5zHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*0ftliU2YV9V_9oOpARKkbA.png" /></figure><blockquote><strong>VII</strong>. What is the link to the adware hiding itself as the user’s bank?</blockquote><blockquote><strong>Answer: http://adware.win32.agent.ahgx/</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>As the question says adware is hiding itself as bank so we will find it in the search for bank.</blockquote><blockquote><em>2. </em>As previously seen that bank has 3 results we will go down and will find the advert trying to hide as bank.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*6fPhnoardqsrWJh5pOewow.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*n00oYNrboyhI_mPNLdYz5g.png" /></figure><blockquote><strong>VIII.</strong> What is the name of the PHP file disguised as a clickbait title?</blockquote><blockquote><strong>Answer: stealer.php</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Follow the same steps as above questions search for php.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/821/1*DX7BTayv718HCAg2rCfXrA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*cgL-2MguUWOvrp99GS5W0g.png" /></figure><h3>Connect with me on</h3><p><a href="https://www.linkedin.com/in/abdurrehmanrehan/">LinkedIn</a></p><p>Thank you for taking the time to read my walk through.<br>If you found it helpful, please hit the 👏 button (up to 40x) and share it to help others with similar interests! + Feedback is always welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cc03e73a72ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Immersive Labs | Cyber Million: Incident Response | ZWASP Phishing Vulnerability in Office 365 |…]]></title>
            <link>https://abdurrehmanrehan.medium.com/immersive-labs-cyber-million-incident-response-zwasp-phishing-vulnerability-in-office-365-eea176efa677?source=rss-fc0328a05673------2</link>
            <guid isPermaLink="false">https://medium.com/p/eea176efa677</guid>
            <category><![CDATA[immersive-labs]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[phishing]]></category>
            <category><![CDATA[walkthrough]]></category>
            <dc:creator><![CDATA[Abdur Rehman Rehan]]></dc:creator>
            <pubDate>Fri, 23 Feb 2024 08:10:21 GMT</pubDate>
            <atom:updated>2024-02-23T08:11:00.235Z</atom:updated>
            <content:encoded><![CDATA[<h3>Immersive Labs | Cyber Million: Incident Response | ZWASP Phishing Vulnerability in Office 365 | Write-Up</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EOQL_L-EUYCqm0cE.jpg" /></figure><p><a href="https://immersivelabs.online/v2/labs/zwasp-phishing-vulnerability-in-office-365">Room Link.</a></p><p>For Any suggestions leave a comment.</p><h3>Briefing</h3><h4>ZWSP Phishing Attack</h4><p>In November 2018, Avanan researchers discovered a new type of phishing attack using ZWSPs to obfuscate malicious links to phishing sites, which bypasses both Office 365’s URL reputation check and its ATP Safe Links’ URL protection.</p><p>Even though this is a relatively simple attack, the impact of a successful execution could be highly destructive.</p><p>As of 9th January, 2019 Microsoft have released a patch which remediated the issue.</p><h4>What are Zero-Width Spaces (ZWSPs)?</h4><p>Zero-width spaces are empty space characters. Unrendered, they appear as a combination of numbers and special characters planted between other letters, words or URLs. However, when rendered in a browser they are invisible, creating the illusion of it being a normal URL.</p><ul><li>zero-width space: &amp;#8203;</li><li>zero-width non-joiner: &amp;#8204;</li><li>zero-width joiner: &amp;#8205;</li><li>zero-width no-break space: &amp;#65279;</li><li>full-width digit zero: &amp;#65296;</li></ul><h4>Phishing method</h4><p>When used for a phishing attack, a zero-width non-joiner (&amp;#8204) is embedded in the middle of a malicious URL. Microsoft did not recognize this as a legitimate URL so security checks and ATP Safe Links were not applied. However, when a user views this link within their inbox, they will not see the ZWSPs, mistaking it for a regular URL.</p><p>Below is an example of this technique using <a href="http://www.google.com./">www.google.com.</a> When hovered over, the link will appear exactly as intended ‘www.google.com’. However, below is how it would appear to Microsoft Security.</p><pre>http&amp;#8204;s://go&amp;#8204;ogle.co&amp;#8204;m/</pre><p>In this lab we will be using Thunderbird Mail, an email application installed on Ubuntu systems to examine how this technique appears when pointed towards a fake phishing site intended to steal IML banking customer details. Read the full article from Avanan <a href="https://www.avanan.com/resources/zwasp-microsoft-office-365-phishing-vulnerability">here</a>.</p><h3>Lab Solution</h3><h4>Tasks:</h4><blockquote><strong>I</strong>. Open up the Thunderbird application from the <strong>Desktop</strong>.</blockquote><blockquote><strong>II</strong>. Read the emails contained within the inbox.</blockquote><blockquote><strong>III</strong>. Analyze URLs and answer the questions.</blockquote><blockquote><strong>IV</strong>. What ZWSP was proven to work in phishing attacks?</blockquote><blockquote><strong>Answer: &amp;#8204; (Zero-Width Non-Joiner)</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Read the briefing.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*PtRcpUZU9kurA9ffXF2Lbw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*AcA0vJtTKVuv7GYgOGAVXw.png" /></figure><blockquote><strong>V. </strong>How does the link in the first email appear when viewed via the browser?</blockquote><blockquote><strong>Answer: http://www.xn--imlb-076a/#8204;an%E2%80%8Ck/log%E2%80%8Cin.c%E2%80%8Com</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Open the first mail.</blockquote><blockquote><em>2. </em>Click on the link it will open in browser.</blockquote><blockquote><em>3. </em>Copy the link from search bar.</blockquote><blockquote><em>4. </em>It will also show special characters when paste in the answer box. Do not manually write the answer as it is not being properly displayed in the browser.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/1*o94pWSM9m75taqZBd7FrDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*oxgZL0BdS9wCndfxYyS9Zg.png" /></figure><blockquote><strong>VI. </strong>What is the actual web address it links you to? See the second email.</blockquote><blockquote><strong>Answer: http://www.imlbank/login.com</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Open the second mail.</blockquote><blockquote><em>2. </em>Click on the link.</blockquote><blockquote><em>3. </em>Copy the link displayed in search box.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*nkqTaZiGtoPs5XcIEMM9hw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*h0WvGInSOV0AQaRO08ZTgg.png" /></figure><h3>Connect with me on</h3><p><a href="https://www.linkedin.com/in/abdurrehmanrehan/">LinkedIn</a></p><p>Thank you for taking the time to read my walk through.<br>If you found it helpful, please hit the 👏 button (up to 40x) and share it to help others with similar interests! + Feedback is always welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eea176efa677" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Immersive Labs | Cyber Million: Incident Response | Parsing PST | Write-Up]]></title>
            <link>https://abdurrehmanrehan.medium.com/immersive-labs-cyber-million-incident-response-parsing-pst-write-up-108978b93675?source=rss-fc0328a05673------2</link>
            <guid isPermaLink="false">https://medium.com/p/108978b93675</guid>
            <category><![CDATA[immersive-labs]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[incident-response]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[parsing]]></category>
            <dc:creator><![CDATA[Abdur Rehman Rehan]]></dc:creator>
            <pubDate>Fri, 23 Feb 2024 07:43:48 GMT</pubDate>
            <atom:updated>2024-02-23T07:53:44.162Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*inf1jcphrDhKKiZR" /></figure><p><a href="https://immersivelabs.online/v2/labs/parsing-pst/">Room Link.</a></p><p>For Any suggestions leave a comment.</p><h3>Briefing</h3><p>Outlook uses file-based storage to save local versions of your emails in the form of OST files (.ost). Outlook can also export emails in a similar file format called PST (.pst).</p><p><strong>File paths</strong><br>On a standard configuration, OST files are located in one of two directories, depending on the version of Office you have installed.</p><p>Office pre-2007 uses ‘C:\Users\user\AppData\Local\Microsoft\Outlook’.</p><p>Outlook 2013 onwards uses ‘C:\Users\user\Documents\Outlook Files’.</p><p>On domains with roaming user profiles or Folder Redirections enabled, these files could also exist on network shares.</p><p><strong>Parse PST</strong><br>There are several open source and freeware tools that can be used to read OST files. They can also be imported into a ‘clean’ Outlook, such as one inside a virtual machine.</p><p>There are several libraries that can be used to parse PST/OST files and access their contents, too; this is achieved programmatically using scripting languages such as Python.</p><p><strong>LIBPFF</strong><br>libpff is a library used to access the Personal Folder File (PFF) and the Offline Folder File (OFF) format. It contains a series of command line tools and also exposes an API that can be used to interact with scripting languages such as Python.</p><p><strong>Pffexport</strong><br>Pffexport is a command line tool that is part of the libpff installation. It can be used to extract all the information from a PST/OST file.</p><p>Emails are extracted in a hierarchical folder structure that matches the Outlook inbox layout. This includes deleted items and calendar entries or notes if they are also synced to Outlook.</p><p>A typical message extracted contains the following files:</p><ul><li>ConversationIndex.txt</li><li>InternetHeaders.txt</li><li>Message.txt</li><li>OutlookHeaders.txt</li><li>Recipients.txt</li><li>Attachments</li></ul><h3>Lab Solution</h3><h4>Tasks:</h4><blockquote><strong>I. </strong>Parse the PST file using pffexport.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/585/1*UhDD7nG9AwNCYB56N18O4g.png" /></figure><blockquote><strong>II</strong>. Identify the inbox for SHARRIS1 (non-privileged).</blockquote><blockquote><strong>III.</strong> Answer the questions.</blockquote><blockquote><strong>IV. </strong>Using the inbox from the task list, what is the md5sum of the attachment in Message00004?</blockquote><blockquote><strong>Answer: a586daafce5c9816c2372dd2fecb12cd</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>As mentioned, we have to check message in the inbox.</blockquote><blockquote><em>2. </em>Open folder Message00004&gt;&gt;Attachment.</blockquote><blockquote><em>3. </em>Open terminal here and run md5sum command on the file to get md5 hash.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*G-9Rfd0GuVQaTIZxeG6ygw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*xg59FSqTRgI3yvsxRe6RMA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*4x_L6h5U0tyn-_gTZKrgag.png" /></figure><blockquote><strong>V.</strong> Using the inbox from question one, what is the email address for the recipient in Message00014?</blockquote><blockquote><strong>Answer: DL-GA-all_enron_worldwide2@ENRON.com</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Open the folder of Message00014 you will find recipients.txt.</blockquote><blockquote><em>2. </em>In this txt file you will find the recipients mail address.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*dCWYxRSa9eCRIxxNtyj6sg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/569/1*WR8wuWAhJJCxeyGUt00pLQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*ZNoARdSErjj_FUu0o24YOA.png" /></figure><blockquote><strong>VI</strong>. Using the inbox from the task list, what is the subject line for Message00005?</blockquote><blockquote><strong>Answer: Sun Devil Mtg. — Cost allocation and Rate design</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Open the folder of Message00005.</blockquote><blockquote><em>2. </em>There you will find message.txt</blockquote><blockquote><em>3. </em>In this text file you will find the subject line.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*tBQMkx2Xo9d5j7WwH4h3uA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*nzi80qCoz2bqHbNIUv5QsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*2ioBTMWsL2cOmuECkDNM2g.png" /></figure><h3>Connect with me on</h3><p><a href="https://www.linkedin.com/in/abdurrehmanrehan/">LinkedIn</a></p><p>Thank you for taking the time to read my walk through.<br>If you found it helpful, please hit the 👏 button (up to 40x) and share it to help others with similar interests! + Feedback is always welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=108978b93675" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Immersive Labs | Cyber Million: Incident Response | Exfiltration Over Alternative Protocol |…]]></title>
            <link>https://abdurrehmanrehan.medium.com/immersive-labs-cyber-million-incident-response-exfiltration-over-alternative-protocol-30142ab125e4?source=rss-fc0328a05673------2</link>
            <guid isPermaLink="false">https://medium.com/p/30142ab125e4</guid>
            <category><![CDATA[immersive-labs]]></category>
            <category><![CDATA[exfiltration]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[incident-response]]></category>
            <dc:creator><![CDATA[Abdur Rehman Rehan]]></dc:creator>
            <pubDate>Fri, 23 Feb 2024 06:27:18 GMT</pubDate>
            <atom:updated>2024-02-23T06:27:18.225Z</atom:updated>
            <content:encoded><![CDATA[<h3>Immersive Labs | Cyber Million: Incident Response | Exfiltration Over Alternative Protocol | Write-Up</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X3ln5eJrA1ao0n10" /></figure><p><a href="https://immersivelabs.online/v2/labs/exfiltration-over-alternative-protocol">Room Link.</a></p><p>For Any suggestions leave a comment.</p><h3>Briefing</h3><h4>Overview</h4><p>Data exfiltration is the process of transferring information from a target network to an external location under control of the attacker. While some adversaries will export data using the same protocol utilized during the command and control phase, others will take a different approach, such as using FTP, HTTP or SMTP. Alternative protocols are often used to send data to a different location to that of the control server.</p><h4>Examples</h4><p>As many organizations monitor both incoming and outgoing connections, attackers will use a range of techniques in an attempt to avoid detection. For example, attackers have been known to utilize the Windows Background Intelligent Transfer Service (BITS) using the BITSAdmin command line tool. As this service is primarily used for downloading Windows updates, it is able to bypass many system and firewall restrictions, allowing a user to transfer files to and from a compromised host.</p><p>Other examples of exfiltration using alternative protocols include the CosmicDuke and Hydraq malware. Both samples have been observed exporting data to locations which differ to the command and control channel.</p><h4>Detection</h4><p>Attempts to transfer data outside of a network can be identified by monitoring network traffic for abnormal behavior. For example, connections where the client has sent significantly more data than it has received could be considered suspicious and warrant further investigation.</p><p>System administrators may also wish to investigate processes which do not normally utilize network resources or are using significantly more bandwidth that what is otherwise considered normal. Furthermore, analyzing network packets could also highlight instances where the protocol behavior does not match what is expected for a given port.</p><h4>Mitigation</h4><p>Data exfiltration can be mitigated by configuring network firewalls so they only allow necessary traffic to enter and exit the network on specified ports. For example, if FTP is not a business requirement, blocking all ports associated with this service will reduce the number of ways sensitive data can potentially leave the network.</p><p>The use of network intrusion detection and prevention systems can help reduce the risk of exfiltration by using network signatures to identify malicious activity. Furthermore, the use of proxies and dedicated servers providing services on specific ports will reduce the number of avenues an adversary can take to export data.</p><h4>Scenario</h4><p>In this lab, you have been alerted to suspicious network activity and have been given a PCAP containing network traffic. On closer inspection, it appears that a compromised host has connected to a Samba server which is used to store backup data. The files downloaded by the host have then been transferred to an external location. This is shown in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/0*cQNeGMGt9HwAtQDk.png" /></figure><p>To complete this lab, you will need to analyze the PCAP to understand what happened before answering the questions.</p><h3>Lab Solution</h3><h4>Tasks:</h4><blockquote><strong>I</strong>. Analyze the <strong>network_activity.pcap</strong> file located on the <strong>Desktop.</strong></blockquote><blockquote><strong>II.</strong> Answer the questions.</blockquote><blockquote><strong>III</strong>. What is the IP address of the Samba server used to back up files?</blockquote><blockquote><strong>Answer: 172.17.0.2</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>First, we will check the endpoints to determine which IP addresses have most traffic as the could be the ones we required.</blockquote><blockquote><em>2. </em>We will see the TCP tab as samba server communicate over the TCP.</blockquote><blockquote><em>3. </em>We can see the top two Ip having more than 700 packets transferred, and this is the highest no.</blockquote><blockquote><em>4. </em>We can guess that our required IP will be from them.</blockquote><blockquote><em>5. </em>Now we will apply this filter. <br>tcp.port == 445</blockquote><blockquote><em>6. </em>As we 445 is default port for communicating in samba server.</blockquote><blockquote><em>7. </em>We get the filtered result.</blockquote><blockquote><em>8. </em>We will scroll to check the communication.</blockquote><blockquote><em>9. </em>We can see that IP 172.16.120.128 is requesting IP 172.17.0.2 for employees2017.csv (in the below picture) so later IP would be our backup server.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/1*OKcD5T7oYxDIj4iuUqWwkg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EgHcZG29U1WkbxVhjZL0Ag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*_9zkYHo8p6IZrY_5LW4rBg.png" /></figure><blockquote><strong>IV.</strong> How many CSV files were downloaded from the Samba server?</blockquote><blockquote><strong>Answer: 9</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>For finding the csv files we will use the find function of wireshark.</blockquote><blockquote><em>2. </em>To use find press crtl+f.</blockquote><blockquote><em>3. </em>In find select string and value to .csv and click find.</blockquote><blockquote><em>4. </em>Note the names of the files appearing.</blockquote><blockquote><em>5. </em>We will find:<br>employees2016.csv<br>employees2017.csv<br>employees2018.csv<br>corporate_cards2016.csv<br>corporate_cards2017.csv<br>corporate_cards2018.csv<br>customers2016.csv<br>customers2017.csv<br>customers2018.csv</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZkZHq1B1HA0EWReGqI20hQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*Q97SoR9z-GI_-T3ePuVVtw.png" /></figure><blockquote><strong>V. </strong>What is the IP address of the host machine used to download the backup files?</blockquote><blockquote><strong>Answer: 172.16.120.128</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>We noted in task no IV that one IP is requesting files from other.</blockquote><blockquote><em>2. </em>That is the IP of host machine used to download backup files.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zEZMwzm5BpJ8l3KtIwkbVQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/394/1*w3vo-_i8jxjcmQsBL-JQ4w.png" /></figure><blockquote><strong>VI. </strong>What protocol was used to exfiltrate data to the external server?</blockquote><blockquote><strong>Answer: ftp</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>As mentioned in scenario that ftp server was in use we will filter FTP.</blockquote><blockquote><em>2. </em>We will filter common protocols to find which is being used if FTP is not used.</blockquote><blockquote><em>3. </em>We filtered and looked through the packets there has been login try.</blockquote><blockquote><em>4. </em>Further looking down we found that login was successful, and file was also requested so this is our protocol.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*9815uqqTqEK8XK8q5_ZlPg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*1Y0oNHBtBHR2lTvOn9kSFw.png" /></figure><blockquote><strong>VII. </strong>What is the IP address of the external server?</blockquote><blockquote><strong>Answer: 34.241.109.23</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>We can see that communication is between two IPs.</blockquote><blockquote><em>2</em>. We know that 172.16.120.128 is our host server so the other one will be external server.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*9815uqqTqEK8XK8q5_ZlPg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*QNR4le9jIv8Hfx5yFWAISw.png" /></figure><blockquote><strong>VIII. </strong>What username was used to authenticate to the external server?</blockquote><blockquote><strong>Answer: bob</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Without modifying the filter look for the username used.</blockquote><blockquote><em>2. </em>We will find it in the upper packets.</blockquote><blockquote><em>3. </em>As we will have to authenticate first.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*uO-Cpxz_bdXvOSjk6STu4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*PNEvM0Y84O-Hs4-TnMirjw.png" /></figure><blockquote><strong>IX. </strong>What password was used to authenticate to the external server?</blockquote><blockquote><strong>Answer: MyExfilDataServer</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>We can also find the password in the packets easily.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/842/1*uC67itrdfKs8xMjmO9SvBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*wMPPp-UJz9g96vq9_NF7JQ.png" /></figure><blockquote><strong>X. </strong>What file name was used to transfer the compressed CSV files to the external server?</blockquote><blockquote><strong>Answer: background_images.zip</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Further explore the packets you will find the compressed file.</blockquote><blockquote><em>2. </em>Also, we can use find command to find compressed file.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*K-yEt73EAOWYnx8A-tMGBQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*oIneorxb0nLl_JKrAfGCpQ.png" /></figure><h3>Connect with me on</h3><p><a href="https://www.linkedin.com/in/abdurrehmanrehan/">LinkedIn</a></p><p>Thank you for taking the time to read my walk through.<br>If you found it helpful, please hit the 👏 button (up to 40x) and share it to help others with similar interests! + Feedback is always welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30142ab125e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Immersive Labs | Cyber Million : Introducing the Cyber Kill Chain | Cyber Kill Chain: Actions on…]]></title>
            <link>https://abdurrehmanrehan.medium.com/immersive-labs-cyber-million-introducing-the-cyber-kill-chain-cyber-kill-chain-actions-on-ff5e1fdea30b?source=rss-fc0328a05673------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff5e1fdea30b</guid>
            <category><![CDATA[immersive-labs]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[actions-on-objective]]></category>
            <category><![CDATA[cyber-kill-chain]]></category>
            <category><![CDATA[walkthrough]]></category>
            <dc:creator><![CDATA[Abdur Rehman Rehan]]></dc:creator>
            <pubDate>Wed, 21 Feb 2024 07:30:26 GMT</pubDate>
            <atom:updated>2024-02-21T07:30:26.042Z</atom:updated>
            <content:encoded><![CDATA[<h3>Immersive Labs | Cyber Million : Introducing the Cyber Kill Chain | Cyber Kill Chain: Actions on Objectives | Write-Up</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c6E9eUCnmt3UKXUm.png" /></figure><p><a href="https://immersivelabs.online/v2/labs/cyber-kill-chain-actions-objectives">Room Link.</a></p><p>For Any suggestions leave a comment.</p><h3>Briefing</h3><h4>Scenario</h4><p><strong>Actions on Objectives</strong> is a phase in the Cyber Kill Chain framework that refers to the final stage of a cyberattack, where the attacker achieves their intended goal or objective, such as data exfiltration, system compromise, or disruption of services. It involves the attacker taking actions to exploit the compromised environment and accomplish their mission, which may include stealing sensitive information, causing damage, or establishing persistent access for future attacks.</p><p>All attacks happen for a reason. Sometimes for theft of property, sometimes for planting evidence, and sometimes even for fun. However, there’s always an objective, which makes every attack slightly different.</p><p>As defenders, you’ll only know what the attackers are after if they achieve their objectives. If you stop them earlier, the objectives may never be known.</p><h4>In this lab</h4><p>In this lab, you’ll investigate a cybersecurity incident against your organization. You have several logs recorded in a central <strong>Splunk </strong>instance and must use these to identify malicious activity from each stage of the Cyber Kill Chain.</p><p>Having identified which ransomware was in operation based on the C2 investigation, you can now investigate the specific actions that were taken.</p><p>There are a few inbuilt Windows tools that attackers (and, in turn, their malware) will use. Using <strong>Splunk</strong>, search for cases where these Windows tools have been leveraged to perform malicious actions.</p><p>However, it’s worth remembering that not all command-line actions will be malicious. Normal processes and administrator scripts can also generate these same log entries as they use the same tools. Understanding the time and correlating this against other logs is an important part of the threat-hunting process.</p><h3>Lab Solution</h3><h4>Tasks:</h4><blockquote><strong>I.</strong> To open Splunk, double-click the icon located on the Desktop.</blockquote><blockquote><strong>II.</strong> Adjust the time range from “24 hours” to “All time”.</blockquote><blockquote><strong>III.</strong> To filter for the relevant logs, use this Splunk search query:<br>index=botsv1 earliest=0 Process_Command_Line=&quot;*&quot; (vssadmin OR cmd.exe)</blockquote><blockquote><strong>IV.</strong> Create additional queries to answer the questions.</blockquote><blockquote><strong>V.</strong> What command line tool was used to delete Volume Shadow Copies?</blockquote><blockquote><strong>Answer: vssadmin.exe</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>We will modify the query to include word delete. Query:<br>index=botsv1 earliest=0 Process_Command_Line=&quot;*&quot; (vssadmin OR cmd.exe) delete</blockquote><blockquote><em>2. </em>This will filter out the events that have delete keyword used. If not found, we could use shadow as a keyword or had to manually search form the events.</blockquote><blockquote><em>3. </em>Only one event is filtered out.</blockquote><blockquote><em>4. </em>We will inspect to find the name of the tool.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mL7fs5v92WYxXCK00P_tnQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*zDQ_DhayTMePnb4vphXuFw.png" /></figure><blockquote><strong>VI.</strong> What temporary file is executed by the command prompt using the “/C” option?</blockquote><blockquote><strong>Answer: 121214.tmp</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>We will modify the query so it will filter out the events that contains the /C and .tmp in the events so that we will have less events to look through. Query:<br><em>index=botsv1 earliest=0 Process_Command_Line=&quot;*&quot; (vssadmin OR cmd.exe) /C .tmp</em></blockquote><blockquote><em>2. </em>We have filtered out the events.</blockquote><blockquote><em>3. </em>The first event has 121214.tmp run with /C option that is our answer.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*WWZPc1n6P2tp6pYDnD1I2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*CbZHlVzRtH5smUJ3nRUE3g.png" /></figure><blockquote><strong>VII. </strong>Which host in the network was this temporary file executed on?</blockquote><blockquote><strong>Answer: we8105desk.waynecorpinc.local</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>In the same event of the above answer, we will find the host name.</blockquote><blockquote><em>2. </em>Expand the event by clicking show all lines.</blockquote><blockquote><em>3. </em>It will expand the event details.</blockquote><blockquote><em>4. </em>Search for Computer Name/host name to get the answer.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FP1fufBQprMTEfbTmE3Ayg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*UWmVeSnZxP_XSRRx1wG9rw.png" /></figure><blockquote><strong>VIII</strong>. At what time was the “whoami” command executed? (Provide your answer in the format HH:MM:SS)</blockquote><blockquote><strong>Answer: 9:58:30</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Edit the query to search for command whoami, this can be done with the following query: <em>index=botsv1 earliest=0 Process_Command_Line=&quot;whoami&quot;</em></blockquote><blockquote><em>2. </em>We will get only one event note the time and answer the question.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/995/1*3o1Tmd0cyQODnvSR90HYFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*pua5yf2qfL0iWeyG0okPxg.png" /></figure><h3>Connect with me on</h3><p><a href="https://www.linkedin.com/in/abdurrehmanrehan/">LinkedIn</a></p><p>Thank you for taking the time to read my walk through.<br>If you found it helpful, please hit the 👏 button (up to 40x) and share it to help others with similar interests! + Feedback is always welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff5e1fdea30b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Immersive Labs | Cyber Million : Introducing the Cyber Kill Chain | Cyber Kill Chain: Command and…]]></title>
            <link>https://abdurrehmanrehan.medium.com/immersive-labs-cyber-million-introducing-the-cyber-kill-chain-cyber-kill-chain-command-and-dc041f1e975e?source=rss-fc0328a05673------2</link>
            <guid isPermaLink="false">https://medium.com/p/dc041f1e975e</guid>
            <category><![CDATA[command-and-control]]></category>
            <category><![CDATA[immersive-labs]]></category>
            <category><![CDATA[cyber-kill-chain]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[Abdur Rehman Rehan]]></dc:creator>
            <pubDate>Wed, 21 Feb 2024 06:54:29 GMT</pubDate>
            <atom:updated>2024-10-31T21:56:01.252Z</atom:updated>
            <content:encoded><![CDATA[<h3>Immersive Labs | Cyber Million : Introducing the Cyber Kill Chain | Cyber Kill Chain: Command and Control | Write-Up</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0yJBYiGBdvlb_eOB.png" /></figure><p><a href="https://immersivelabs.online/v2/labs/cyber-kill-chain-command-control">Room Link.</a></p><p>For Any suggestions leave a comment.</p><h3>Briefing</h3><h4>Scenario</h4><p>The <strong>Command and Control</strong> phase of the Cyber Kill Chain is when the attacker looks to establish a connection with the victim machine to facilitate remote command execution and continuous monitoring.</p><p>A command-and-control (C2) server is a centralized server or infrastructure that cybercriminals or attackers use to control and communicate with compromised computers or devices, often referred to as “bots” or “zombies.” These compromised devices are typically infected with malware, such as a botnet, which allows the attacker to control and coordinate their malicious activities remotely.</p><p>The C2 server acts as the command center, providing instructions to the compromised devices and receiving data or information from them. It enables the attacker to remotely manage and control the botnet, including launching attacks, distributing malware, stealing data, or performing other malicious activities. For this to be successful, however, the attacker must have executed something on the victim’s computer to establish a network connection between the attacker and the victim’s computer.</p><p>The communication between the C2 server and the compromised devices can occur through various channels, such as internet protocols, messaging protocols, or even covert channels within legitimate network traffic. Attackers often employ techniques to obfuscate or hide the C2 server’s location, making it difficult for security professionals to detect and disrupt their operations.</p><p>Detecting and blocking C2 servers is an essential part of cybersecurity defense, as it helps to disrupt the attacker’s control over compromised devices and prevent further malicious activities.</p><p>A useful tool for detecting C2 network activity is a network Intrusion Detection System (IDS). The most actively maintained with a large set of community rules are <a href="https://www.snort.org/">Snort</a> and <a href="https://suricata.io/">Surciata</a>.</p><p><strong>Cerber</strong></p><p><strong>Cerber ransomware</strong> is a type of malicious software (malware) that belongs</p><p>to the ransomware family. It was first discovered in early 2016 and quickly gained notoriety due to its widespread distribution and sophisticated features.</p><p>Cerber ransomware is designed to encrypt files on a victim’s computer or network, rendering them inaccessible. Once the files are encrypted, the attackers demand a ransom payment in exchange for the decryption key needed to unlock the files. The ransom note typically provides instructions on how to make the payment, often in the form of cryptocurrency like Bitcoin.</p><p>Cerber ransomware spreads through various methods, including malicious email attachments, exploit kits, compromised websites, and infected software downloads. It primarily targets Windows operating systems.</p><h4>In this lab</h4><p>In this lab, you’ll investigate a cybersecurity incident against your organization. You have several logs recorded in a central <strong>Splunk </strong>instance and must use these to identify malicious activity from each stage of the Cyber Kill Chain.</p><p><strong>Splunk </strong>can filter data and create tables showing a breakdown of the top or rare values. These types of filters are beneficial when looking for specific information. To get a quick view, click the field’s name from the left-hand menu, and a pop-out window will show you a table view. This view also includes links to more specific queries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/0*BgBxn6LaNH4HPiGH.png" /></figure><p>Explore a set of <strong>Suricata </strong>events that have been logged to <strong>Splunk</strong>. You’ll need to apply various <strong>Splunk </strong>fields to answer the questions.</p><h3>Lab Solution</h3><h4>Tasks:</h4><blockquote><strong>I.</strong> To open Splunk, double-click the icon located on the Desktop.</blockquote><blockquote><strong>II.</strong> Adjust the time range from “24 hours” to “All time”.</blockquote><blockquote><strong>III.</strong> To filter for the relevant logs, use this Splunk search query:<br>index=botsv1 earliest=0 source=&quot;/var/log/suricata/eve.json&quot;</blockquote><blockquote><strong>IV.</strong> Analyze the appropriate Splunk fields to answer the questions.</blockquote><blockquote><strong>V. </strong>While filtering for Suricata event logs, how many unique alert signatures have been detected?</blockquote><blockquote><strong>Answer: 62</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>After applying the filter search for alert signature field in the left column.</blockquote><blockquote><em>2</em>. If not found, click on the more fields button and search for alert signature.</blockquote><blockquote><em>3</em>. We can find the desired field and its value that is the answer.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/187/1*lk9bg3y2QmpAabx0qD4Q0g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*sbEEH7yEG9_56fLlQxb-Dw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*7jstMdEhNcwrQOLbrqe7Ng.png" /></figure><blockquote><strong>VI. </strong>How many events were detected that match the one of the Cerber alert signature?</blockquote><blockquote><strong>Answer: 5</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>We will modify the query so that we can find the events that ahve CERBER alert signature the modified query will look like.<br><em>index=botsv1 earliest=0 source=&quot;/var/log/suricata/eve.json&quot; alert.signature=&quot;*CERBER*&quot;</em></blockquote><blockquote><em>2. </em>This will filter out event that have word cerber in the alert signature.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*FxE6QIGzXyiBrj_rT2BYJA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*f-p3wxD5jGOzzy-AcAqoqA.png" /></figure><blockquote><strong>VII. </strong>What is the &quot;dest_ip&quot; for the &quot;ETPRO TROJAN Ransomware/Cerber Checkin 2&quot; alert?</blockquote><blockquote><strong>Answer: 85.93.0.0</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1</em>. We will edit the query to filter out events having the alert signature mentioned in the question. Using query:<br><em>index=botsv1 earliest=0 source=&quot;/var/log/suricata/eve.json&quot; &quot;alert.signature&quot;=&quot;ETPRO TROJAN Ranssomware/Cerber Checkin 2&quot; | table dest_ip</em></blockquote><blockquote><em>2. </em>We will only get one event.</blockquote><blockquote><em>3</em>. We will inspect the event to find out the dest_ip.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*57iINEVl5jRYJ6B3P82QWA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/398/1*LPL8wtoZYhfG68-b9VV2Fw.png" /></figure><blockquote><strong>VIII. </strong>What is the signature ID for the “Cerber Onion Domain Lookup” signature?</blockquote><blockquote><strong>Answer: 2820156</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>We will edit the query to filter out events having the alert signature mentioned in the question. Using query:<br><em>index=botsv1 earliest=0 source=&quot;/var/log/suricata/eve.json&quot; &quot;alert.signature&quot;=&quot;ETPRO TROJAN Ranssomware/Cerber Onion Domain Lookup&quot;</em></blockquote><blockquote><em>2. </em>We will get the events.</blockquote><blockquote><em>3</em>. For the alert signature id look in the fields and we will find the ID for alert.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*l_zvQ7E58PPDgsYBwqHYRQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*TjyEuj-zUUrngdTmPGOSAw.png" /></figure><h3>Connect with me on</h3><p><a href="https://www.linkedin.com/in/abdurrehmanrehan/">LinkedIn</a></p><p>Thank you for taking the time to read my walk through.<br>If you found it helpful, please hit the 👏 button (up to 40x) and share it to help others with similar interests! + Feedback is always welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dc041f1e975e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Immersive Labs | Cyber Million : Introducing the Cyber Kill Chain | Cyber Kill Chain: Installation…]]></title>
            <link>https://abdurrehmanrehan.medium.com/immersive-labs-cyber-million-introducing-the-cyber-kill-chain-cyber-kill-chain-installation-06fd4e78a19b?source=rss-fc0328a05673------2</link>
            <guid isPermaLink="false">https://medium.com/p/06fd4e78a19b</guid>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[immersive-labs]]></category>
            <category><![CDATA[writeup]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[cyber-kill-chain]]></category>
            <dc:creator><![CDATA[Abdur Rehman Rehan]]></dc:creator>
            <pubDate>Wed, 21 Feb 2024 05:28:53 GMT</pubDate>
            <atom:updated>2024-02-21T05:28:53.401Z</atom:updated>
            <content:encoded><![CDATA[<h3>Immersive Labs | Cyber Million : Introducing the Cyber Kill Chain | Cyber Kill Chain: Installation | Write-Up</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cJEDI296KC2drBjq.png" /></figure><p><a href="https://immersivelabs.online/v2/labs/cyber-kill-chain-installation">Room Link.</a></p><p>For Any suggestions leave a comment.</p><h3>Briefing</h3><h4>Scenario</h4><p>The <strong>Installation</strong> phase of the Cyber Kill Chain refers to when an attacker installs a backdoor into a system. It’s a method of gaining persistence on the system they’re attacking, achievable using malware. An attacker can also do this manually to attain greater access remotely.</p><p>This process normally involves installing software that allows connections from the victim computer to an attacker-controlled computer, such as a remote access trojan (RAT).</p><p><strong>Methods of installation</strong></p><p>When a computer is shut off, the information residing in RAM is lost. The attacker requires a way to keep a connection alive even after a machine has been switched off and turned back on later. This is typically done through installing software. Two common methods for installing malicious software are to utilize the <strong>Windows Registry</strong> and the <strong>startup folder</strong>.</p><p><strong>Windows Registry</strong></p><p>Several registry keys can be set to autorun a command on the computer’s startup. Malware authors often favor these methods when installing their software on a machine. The registry keys to look out for include:</p><ul><li><strong>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run</strong></li><li><strong>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run</strong></li><li><strong>HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce</strong></li><li><strong>HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce</strong></li><li><strong>HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun</strong></li></ul><p>However, an attacker can hide their software in the registry key of another legitimate program to reduce visibility.</p><p>If an attacker decides not to host any malware files on disk, the registry key can run a command to re-download the malware from a command and control center whenever the system booms up.</p><p><strong>Startup folder</strong></p><p>An attacker can also use the startup folder to run their backdoor as soon as someone boots up the computer. This is a slightly riskier installation method — the malicious software must be stored on disk, as the startup folder will have to hold a relevant file to run it.</p><p>The startup folder is located here:</p><p><strong>C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp</strong></p><h4>In this lab</h4><p>In this lab, you’ll investigate a cybersecurity incident against your organization. You have several logs recorded in a central <strong>Splunk </strong>instance and must use these to identify malicious activity from each stage of the Cyber Kill Chain.</p><p>When crafting your Splunk query, we recommend using keywords such as registry and run to help narrow down your search. To match search queries for RunOnce and AutoRun, use the regex symbol (*) on either side of run in <strong>Splunk</strong>.</p><h3>Lab Solution</h3><h4>Tasks:</h4><blockquote><strong>I.</strong> To open Splunk, double-click the icon located on the Desktop.</blockquote><blockquote><strong>II.</strong> Adjust the time range from “24 hours” to “All time”.</blockquote><blockquote><strong>III.</strong> To filter for the relevant logs, use this Splunk search query:<br>index=&quot;botsv1&quot; earliest=&quot;0&quot; registry run</blockquote><blockquote><strong>IV.</strong> What is the name of the binary used to achieve persistence?</blockquote><blockquote><strong>Answer: osk.exe</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>As mentioned, file is binary, and binary is often used interchangeably with exe files so we can edit the query to:<br>index=&quot;botsv1&quot; earliest=&quot;0&quot; registry autorun exe</blockquote><blockquote><em>2</em>. We will get only two events and the exe file is the same in both, so it is our answer.</blockquote><blockquote><em>3</em>. We can also use run keyword instead of autorun, but the events count will be more, and we have to search for the desired exe.</blockquote><blockquote><em>4</em>. We can see that there will be all the system exe but osk.exe is not the system exe file so that will be the answer.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hfz8Z5Vm0KH7t20XqNVf7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*13JuDQeYQSg2Dz5u_u4lEA.png" /></figure><blockquote><strong>V. </strong>What is the process ID of this binary?</blockquote><blockquote><strong>Answer: 3588</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>See the PID of the event and that is the process ID.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*tet38Zysd0jeEFHmUBkGRw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/399/1*Wsb3E3sghx9aEsvFbU60bA.png" /></figure><blockquote><strong>VI. </strong>What file path is contained within the “data” field for this log entry?</blockquote><blockquote><strong>Answer: “C:\Users\bob.smith.WAYNECORPINC\AppData\Roaming\{35ACA89F-933F-6A5D-2776-A3589FB99832}\osk.exe”</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>Copy the path including the “”.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*tet38Zysd0jeEFHmUBkGRw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*_vPvLZ6KQvcrEkDH6w7NFA.png" /></figure><blockquote><strong>VII.</strong> At what time in logs does this log entry appear? (Provide your answer in the format HH:MM:SS)</blockquote><blockquote><strong>Answer: 10:49:24</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>In the left column and top of the event details we can find the date and time of the event.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*tet38Zysd0jeEFHmUBkGRw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*nHxDeC1dtT-CytuAUnOCDQ.png" /></figure><h3>Connect with me on</h3><p><a href="https://www.linkedin.com/in/abdurrehmanrehan/">LinkedIn</a></p><p>Thank you for taking the time to read my walk through.<br>If you found it helpful, please hit the 👏 button (up to 40x) and share it to help others with similar interests! + Feedback is always welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06fd4e78a19b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Immersive Labs | Cyber Million : Introducing the Cyber Kill Chain | Cyber Kill Chain: Exploitation…]]></title>
            <link>https://abdurrehmanrehan.medium.com/immersive-labs-cyber-million-introducing-the-cyber-kill-chain-cyber-kill-chain-exploitation-decac24a1272?source=rss-fc0328a05673------2</link>
            <guid isPermaLink="false">https://medium.com/p/decac24a1272</guid>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[immersive-labs]]></category>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[cyber-kill-chain]]></category>
            <category><![CDATA[writeup]]></category>
            <dc:creator><![CDATA[Abdur Rehman Rehan]]></dc:creator>
            <pubDate>Wed, 07 Feb 2024 04:52:19 GMT</pubDate>
            <atom:updated>2024-02-07T04:52:19.931Z</atom:updated>
            <content:encoded><![CDATA[<h3>Immersive Labs | Cyber Million : Introducing the Cyber Kill Chain | Cyber Kill Chain: Exploitation | Write-Up</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7sI1bU8EqgMAMry7.png" /></figure><p><a href="https://immersivelabs.online/labs/cyber-kill-chain-exploitation">Room Link.</a></p><p>For Any suggestions leave a comment.</p><h3>Briefing</h3><h4>Scenario</h4><p>The <strong>exploitation</strong> phase is the first time an attempt is made to execute code or trigger a series of events on the target system.</p><p>There are two primary methods when considering exploitation:</p><p><strong>User interaction:</strong> This requires a user to trigger the start of the exploitation. This typically occurs when a user interacts with a file or URL the attacker delivers through a specific method, such as an email.</p><p><strong>Service exploitation: </strong>Many other exploitation attempts do not require user interaction. Vulnerabilities in network devices are one, while another is software with vulnerabilities that can be exploited by delivering specially crafted payloads to these services.</p><h4><strong>Post exploitation</strong></h4><p>Once the exploit has been triggered, the attacker can carry out various activities. Some of these actions are covered in the later stages of the Cyber Kill Chain. However, the attacker may also neglect other elements of the Cyber Kill Chain from this point onward. It is commonplace in ransomware attacks, for example, for the malware not to install a persistence mechanism or send any data to a command-and-control (C2) server, instead relying on the organization to contact the attackers directly.</p><p>Attacks that leak credentials during the exploitation phase may be used in later attacks or vectors to form a separate, although related, incident with its own independent kill chain.</p><h4>In this lab</h4><p>In this lab, you’ll investigate a cybersecurity incident against your organization. You have several logs recorded in a central <strong>Splunk </strong>instance and must use these to identify malicious activity from each stage of the Cyber Kill Chain.</p><p>The exploitation attempt is a brute force attack against a <a href="https://www.joomla.org/">Joomla</a> web application. Start by filtering the logs to look for HTTP POST requests that contain the strings username and passwd. You can then further filter this down by searching for specific usernames, such as imthebatman.</p><h3>Lab Solution</h3><h4>Tasks:</h4><blockquote><strong>I. </strong>To open Splunk, double-click the icon located on the Desktop.</blockquote><blockquote><strong>II.</strong> Adjust the time range from “24 hours” to “All time”.</blockquote><blockquote><strong>III. </strong>To filter for the relevant logs, use this Splunk search query:<br>index=&quot;botsv1&quot; earliest=&quot;0&quot; source=&quot;stream:HTTP&quot;</blockquote><blockquote><strong>IV. </strong>Create additional queries to answer the questions.</blockquote><blockquote><strong>V. </strong>How many login attempts can be seen in the logs for `username=admin`?</blockquote><blockquote><strong>Answer: 413</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>As the question suggest that username admin is target.</blockquote><blockquote><em>2. </em>We will apply filters for username and admin separately and combined to get the answer we can also apply the POST request filter if above not work.</blockquote><blockquote><em>3. </em>The query that will work is<br>index=”botsv1&quot; earliest=”0&quot; source=”stream:HTTP” username admin</blockquote><blockquote><em>4. </em>As it tells it about the events in which keyword username and admin in used only filter that.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*Xk0JUeHT4z3fvGfl09ba8w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*SNDSQ_hmSDwxaXgbFOso8w.png" /></figure><blockquote><strong>VI. </strong>What scripting language was used to send the brute force attempts?</blockquote><blockquote><strong>Answer: Python</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>As attacker was using brute force to access admin account and made 413 attempts.</blockquote><blockquote>2. We can check user agents for the answer.</blockquote><blockquote><em>3. </em>Maybe the name of language appears.</blockquote><blockquote><em>4. </em>We got two user agents, and one has language name in it.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*2k_mzwRX4RHMYV16TqH1YQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*V-tJ63YB8EfAE-eQ97kQFA.png" /></figure><blockquote><strong>VII.</strong> What is the value of the password during the brute force attempt at ‘8/10/16 9:46:45.502 PM’?</blockquote><blockquote><strong>Answer: animal</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>To narrow down the result we can apply a query<br>index=”botsv1&quot; earliest=”0&quot; source=”stream:HTTP” username admin date_minute=46 date_second=45</blockquote><blockquote><em>2. </em>Or another way if you do not know exact keywords is to look in the left panel and find minute and second field and apply them.</blockquote><blockquote><em>3. </em>Even if the desired minute or seconds are not shown you can edit the new query from the query editor.</blockquote><blockquote><em>4. </em>We will get the narrow down results find the event that has exact value of microseconds and go through it to find the password in<strong> form data.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*eg7LUW8_nJinPJUjpZHvLw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*-TWeeBMs8xP-0dyknI9QnQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*oNmdcmlSQ-_9H_DjJz-0Ng.png" /></figure><blockquote><strong>VIII. </strong>What is the source IP of the brute force attacks?</blockquote><blockquote><strong>Answer: 23.22.63.114</strong></blockquote><blockquote><strong>Solution:</strong></blockquote><blockquote><em>1. </em>We can use the above event to get the source IP address if we scroll further down, we can see the src_ip heading containing the answer.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*8iOzIZM2Ytxp_kY6Lhv2Ig.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*V9mwixXoJ9pMXLg4zRhPkQ.png" /></figure><h3>Connect with me on</h3><p><a href="https://www.linkedin.com/in/abdurrehmanrehan/">LinkedIn</a></p><p>Thank you for taking the time to read my walk through.<br>If you found it helpful, please hit the 👏 button (up to 40x) and share it to help others with similar interests! + Feedback is always welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=decac24a1272" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>