<?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 Mattia Zignale on Medium]]></title>
        <description><![CDATA[Stories by Mattia Zignale on Medium]]></description>
        <link>https://medium.com/@mattiazignale?source=rss-442f25896e9b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-METnzxrQQ57EOpuSGfzQQ.png</url>
            <title>Stories by Mattia Zignale on Medium</title>
            <link>https://medium.com/@mattiazignale?source=rss-442f25896e9b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 22:28:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mattiazignale/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[What is Threat Intelligence and why your company should work on it]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://mattiazignale.medium.com/what-is-threat-intelligence-and-why-your-company-should-work-on-it-a5132ac6fd91?source=rss-442f25896e9b------2"><img src="https://cdn-images-1.medium.com/max/1280/1*3QkKBMi3A4vTE1uh0L8DmA.jpeg" width="1280"></a></p><p class="medium-feed-snippet">Threat intelligence is the process of collecting and analyzing information related to security threats</p><p class="medium-feed-link"><a href="https://mattiazignale.medium.com/what-is-threat-intelligence-and-why-your-company-should-work-on-it-a5132ac6fd91?source=rss-442f25896e9b------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://mattiazignale.medium.com/what-is-threat-intelligence-and-why-your-company-should-work-on-it-a5132ac6fd91?source=rss-442f25896e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5132ac6fd91</guid>
            <category><![CDATA[threat-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[business-risk]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mattia Zignale]]></dc:creator>
            <pubDate>Thu, 13 Jul 2023 01:01:01 GMT</pubDate>
            <atom:updated>2023-07-13T01:01:01.740Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to hide messages with Steganography]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://infosecwriteups.com/how-to-hide-messages-with-steganography-8b91c74b3594?source=rss-442f25896e9b------2"><img src="https://cdn-images-1.medium.com/max/873/0*Fqqa5rZW5MxeKNgA.jpg" width="873"></a></p><p class="medium-feed-snippet">Quick study of this wonderful technique</p><p class="medium-feed-link"><a href="https://infosecwriteups.com/how-to-hide-messages-with-steganography-8b91c74b3594?source=rss-442f25896e9b------2">Continue reading on InfoSec Write-ups »</a></p></div>]]></description>
            <link>https://infosecwriteups.com/how-to-hide-messages-with-steganography-8b91c74b3594?source=rss-442f25896e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b91c74b3594</guid>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[forensics]]></category>
            <category><![CDATA[steganography]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mattia Zignale]]></dc:creator>
            <pubDate>Mon, 03 Apr 2023 12:21:44 GMT</pubDate>
            <atom:updated>2023-04-03T12:22:43.092Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Attacking and  securing Docker containers]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://infosecwriteups.com/attacking-and-securing-docker-containers-cc8c80f05b5b?source=rss-442f25896e9b------2"><img src="https://cdn-images-1.medium.com/max/2024/1*P862was_vY_Kkls38pWdyA.png" width="2024"></a></p><p class="medium-feed-snippet">How to set secure Docker enviroment and reduce risk for Docker attacks</p><p class="medium-feed-link"><a href="https://infosecwriteups.com/attacking-and-securing-docker-containers-cc8c80f05b5b?source=rss-442f25896e9b------2">Continue reading on InfoSec Write-ups »</a></p></div>]]></description>
            <link>https://infosecwriteups.com/attacking-and-securing-docker-containers-cc8c80f05b5b?source=rss-442f25896e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/cc8c80f05b5b</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mattia Zignale]]></dc:creator>
            <pubDate>Tue, 07 Feb 2023 03:18:05 GMT</pubDate>
            <atom:updated>2023-02-07T03:18:05.651Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Introduction to Digital Forensics]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://infosecwriteups.com/introduction-to-digital-forensics-12449aa7e399?source=rss-442f25896e9b------2"><img src="https://cdn-images-1.medium.com/max/680/1*euJq18qCtlwOKa5-zjvNfg.jpeg" width="680"></a></p><p class="medium-feed-snippet">Digital forensics is the process of uncovering and interpreting electronic evidence.</p><p class="medium-feed-link"><a href="https://infosecwriteups.com/introduction-to-digital-forensics-12449aa7e399?source=rss-442f25896e9b------2">Continue reading on InfoSec Write-ups »</a></p></div>]]></description>
            <link>https://infosecwriteups.com/introduction-to-digital-forensics-12449aa7e399?source=rss-442f25896e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/12449aa7e399</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[digital-forensics]]></category>
            <dc:creator><![CDATA[Mattia Zignale]]></dc:creator>
            <pubDate>Thu, 12 Jan 2023 17:40:42 GMT</pubDate>
            <atom:updated>2023-01-12T17:40:42.884Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Vulnhub Doubletrouble: Walkthrough]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://infosecwriteups.com/vulnhub-doubletrouble-walkthrough-b8958f894ca?source=rss-442f25896e9b------2"><img src="https://cdn-images-1.medium.com/max/1200/0*JAXWwG-jMPJU5RW8.png" width="1200"></a></p><p class="medium-feed-snippet">Do not under evaluate this easy machine, it will bring you through&#x2026;trouble!</p><p class="medium-feed-link"><a href="https://infosecwriteups.com/vulnhub-doubletrouble-walkthrough-b8958f894ca?source=rss-442f25896e9b------2">Continue reading on InfoSec Write-ups »</a></p></div>]]></description>
            <link>https://infosecwriteups.com/vulnhub-doubletrouble-walkthrough-b8958f894ca?source=rss-442f25896e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8958f894ca</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Mattia Zignale]]></dc:creator>
            <pubDate>Sat, 16 Oct 2021 23:08:09 GMT</pubDate>
            <atom:updated>2021-10-16T23:08:09.127Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Light Roast 106: Anonymize With Tor]]></title>
            <link>https://medium.com/dark-roast-security/light-roast-106-anonymize-with-tor-4243dd0fc0a7?source=rss-442f25896e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4243dd0fc0a7</guid>
            <category><![CDATA[light-roast]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[blue-team]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Mattia Zignale]]></dc:creator>
            <pubDate>Thu, 30 Sep 2021 12:17:35 GMT</pubDate>
            <atom:updated>2021-09-30T12:17:35.201Z</atom:updated>
            <content:encoded><![CDATA[<h4>An overview of using Tor for online anonymity.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*262YNaJ_s47g2ZD_1kMiqQ.png" /><figcaption>image provided by author</figcaption></figure><h3>What is Tor?</h3><p><strong>Tor</strong> (acronym for <em>The Onion Router</em>) is a free software, released under BSD license, which allows for <strong>anonymous communication</strong> on the Internet based on the second generation of the network protocol <strong>onion routing</strong>: its use makes it much more difficult to trace the Internet activity of the user. It’s aimed at protecting the privacy of users, their freedom, and the ability to conduct confidential communications without being monitored or intercepted.</p><p>The <strong>Tor Project</strong> is a great organization that has been working to improve online anonymity for years. It allows its users to surf the web anonymously when they’re online, and it protects their identity in case they need to access their email or other accounts.</p><p>Tor was invented by the United States Naval Research Laboratory in the early 2000s, and it was first released to the public in 2004. The Tor Project has been working to improve the software and the user experience since then. In 2012, they released a new version of Tor that’s free and open source.</p><h3>How does it work?</h3><p>Generally speaking, the working principle behind the Tor network is simple: a user who wants to connect to Google using Tor establishes an encrypted connection with an input node of the network (called <em>Guard</em>). This node transmits the content to a series of internal nodes (called <em>relays</em>) chosen at random, and finally, the last node (called <em>Exit node</em>) establishes the connection with Google. This process is completely transparent to the user who, beyond the potential latency due to using the circuit with multiple relays, will not notice any difference.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*l2f6R9azYddT0C2uoQh3hQ.png" /><figcaption>image provided by author</figcaption></figure><p>In a normal scenario, in fact, the user would connect directly to the server of the requested service: Google, Facebook, etc. who then knows the exact identity (i.e. IP address) of the user browsing. When the connection crosses the TOR network the data is passed through various relay nodes, which we have just seen, with the intent not only to protect the identity of the user, but also to ensure that no other external observer can deduce the ultimate destination of the user.</p><h3>Installing Tor on your system</h3><p>In this article, we will install Tor (CLI) on an Ubuntu system. <strong>Tor Browser </strong>(you can find more information about it on <a href="https://www.torproject.org/">torproject.org</a>) is a modified Firefox installation with an internal implementation of Tor, not covered in this article.</p><pre>sudo apt install tor</pre><p>This command will install Tor into your system with a couple of dependencies. Once installed Tor will start as a daemon on port 9050, you can check the status of Tor service with:</p><pre>sudo systemctl status tor</pre><p>Now we have Tor installed and ready to work in our system.</p><h3>Use Tor as a proxy</h3><p>Now we will set Tor as a proxy, first in our browser and then in our system. These two settings differ a bit: the first one will set Tor only for our browser, which means other connections outside the browser will go directly without Tor, and the second one works at the system level, so programs like our terminal will go through Tor as well.</p><h4>Configure Tor in Firefox</h4><p>To configure Tor in Firefox, we need to install Foxyproxy as this will aid in easily modifying the proxy settings. Open Foxyproxy and start adding parameters as the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ukLXbEkMKAMVpYAdttsLQg.png" /><figcaption>image by author</figcaption></figure><p>Once the profile is saved you’ll find it in Foxyproxy’s menu. Just click on it and your browser will work through the Tor network!</p><h4>Configure Tor as system proxy</h4><p>Keeping in mind, this is on Ubuntul, go to Settings &gt; Networks and find “Proxy”. Click on the gear and set to “Manual”, then insert your Tor port on “Host SOCKS”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*sYmgJnsKM4NUbhb94Bl2Ew.png" /><figcaption>My system is in Italian, sorry about that. But if you’re reading this I hope you can use your system anyway.</figcaption></figure><p>To test it out, open terminal and try to do some curl or wget commands to get your IP address. You can also try wget to “check.torproject.org” and you’ll see your real IP.</p><blockquote>As described above, this will not cover you as well as you may think! Be careful.</blockquote><p>You can run Tor at any level of your system, this is only the fastest method (and not the most secure). If you’re looking for a better solution, try editing your connections with the terminal.</p><h4>Check your Tor connectivity</h4><p>To make sure you’re working through Tor network check your IP Address using any service, like <a href="https://www.whatismyip.com/">whatismyipaddress.com</a>. As mentioned, Tor Project offers a service to check Tor connectivity on their website: <a href="https://check.torproject.org/">https://check.torproject.org/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bWT0NuZ2IhDZrw6i3RcIww.png" /><figcaption>image by author</figcaption></figure><h3>Conclusions</h3><p>In this article, we covered a bit of Tor’s history and it&#39;s usage, how it works with guard, relays, and exit nodes, and how to install and use it on a Linux system, either as a browser or system proxy.</p><blockquote><strong>N.B. </strong>Your connection is anonymized, not encrypted as end-to-end! Be aware of this. Tor does wrap your traffic in encrypted layers as it transports it through the Tor network. Use a VPN and Tor network to increase your online anonymity.</blockquote><p>Stay safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4243dd0fc0a7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dark-roast-security/light-roast-106-anonymize-with-tor-4243dd0fc0a7">Light Roast 106: Anonymize With Tor</a> was originally published in <a href="https://medium.com/dark-roast-security">Dark Roast Security</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How LUKS works with Full Disk Encryption in Linux]]></title>
            <link>https://infosecwriteups.com/how-luks-works-with-full-disk-encryption-in-linux-6452ad1a42e8?source=rss-442f25896e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6452ad1a42e8</guid>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[computer-security]]></category>
            <dc:creator><![CDATA[Mattia Zignale]]></dc:creator>
            <pubDate>Thu, 16 Sep 2021 13:23:29 GMT</pubDate>
            <atom:updated>2021-09-25T21:43:42.562Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*ighFjLp4k6pi56XEqhA9CA.png" /></figure><h3>Full Disk Encryption</h3><p><strong>Full disk encryption</strong> is encryption at disk level (as suggested by the name) and it is transparent to the user as it operates below the filesystem layer. Basically it is a <strong>block device encryption</strong>, which means that when a block from disk is read (or written) the encryption module at kernel level works for us, like a translator.</p><blockquote>This kind of encryption does not differentiate between sensitive and not sensitive information, it just crypts all.</blockquote><p>While the <strong>file-based encryption</strong> has to been implemented from developers (using libraries) for each contest and could not work in other computers if not correctly implemented, full disk encryption crypts all and it is file-system agnostic (because you’re crypting blocks on device), this helps if you want to have an <strong>encrypted LVM setup</strong> or a partition table.</p><p>One of the disadvantages of the full disk encryption is that when the system is on the disk is unlocked, while the file-based encryption must be decrypted every time you need to use it.<br>Essentially the full disk encryption protects you only when the system is off, so in case someone steals your laptop or pc your files are safe (well, it depends on some other factors).</p><h4>Overview of dm-crypt</h4><p>The default standard device-mapper encryption in Linux is provided by <strong>dm-crypt</strong> in the Linux kernel, so if you are looking to have full control over partition and key management this is what you should use.<br>The management of <em>dm-crypt</em> is done through <em>cryptsetup</em>: <strong>LUKS</strong> is an additional frontend for <em>dm-crypt</em> with the aim to semplify all the cryptographic procedures.<br>The following image describes where are the layers mentioned above (filesystems, directories, block device, etc.):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*dF1UojoSEku9HLZo.png" /><figcaption>How are organized the encryption layers</figcaption></figure><h3>How LUKS works</h3><p><strong>LUKS</strong> (<em>Linux Unified Key Setup</em>), in particular LUKS2, provides a generic key store on the dedicated area on a disk, with the ability to use multiple passphrases to unlock a stored key. LUKS2 has a more flexible way of storing metadata (redundant information to provide recovery in the case of corruption in metadata area).</p><p>LUKS header provides metadata for encryption setup. The followings are some of the features:</p><ul><li>Checksum mechanism to detect corruption and manipulation in header</li><li>Metadata area is stored in two copies for a possible recovery</li><li>Metadata are stored in JSON format. It allows future extensions without modifying binary structures</li><li>Header contains objects called <em>token</em>, which contains information to where to get the unlocking passphrase</li></ul><h3>Header</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*84JXyKYNBwdh2k6Q3CYn-w.png" /><figcaption>LUKS Header explaination</figcaption></figure><p>LUKS header are basically divided into three parts:</p><ul><li>Binary header (4096 byte, only 512 bytes are used)</li><li>Metadata in JSON</li><li>Keyslot area</li></ul><p>As you can see in the image above, the binary and JSON areas are stored twice and in normal condition they contain the same values.</p><p>The size of the binary header ensures that it is always written in only one sector (<em>atomic write</em>) to prevent errors and/or corruptions.</p><h4><strong>Binary Header</strong></h4><p>The binary header contains all the information needed to inform the system that is going to approach a LUKS device. The information saved here are basic information such as labels, a signature that indicates this is a LUKS device, header size and the metadata checksum (<em>very important!</em>).</p><p>The primary header must be stored in sector 0 of the device, the second one starts after the first JSON area at fixed offset position as indicated below:</p><pre>Offset  | JSON<br>[bytes] | [kB]<br>---------------<br>16384   |   12<br>32768   |   28<br>65536   |   60<br>131072  |  124<br>262144  |  252<br>524288  |  508<br>1048576 | 1020<br>2097152 | 2044<br>4194304 | 4092</pre><h4><strong>JSON Area</strong></h4><p>The JSON Area starts after the binary header and the end must be aligned to 4096-byte sector offset, so JSON area size is</p><pre>JSON_Area_size = header_size - 4096</pre><p>So the offset where the second binary header starts (reported in the table above) now makes sense: JSON size + bin_header_size (4096 byte) must match with the Offset. The unused space is filled with zeros.</p><h4>Keyslot Area</h4><p>Keyslot area is space on disk that can be allocated for binary data from keyslots, in fact there are stored encrypted keys referenced from keyslot metadata.</p><p>The allocated area is defined in a keyslot by an area object that contains offset (from the device beginning) and size fields, both fields must be validated otherwise will be rejected.</p><h4>Alignment padding</h4><p>The <strong>alignment padding</strong> has the purpose to align the encrypted data at the beginning of a block (block are encrypted one by one, typically a block is 512 byte) with the right offset to make LUKS properly work with the encrypted sectors.</p><h3>Metadata</h3><p><strong>LUKS metadata</strong> allows defining object with a specific functionality. Objects not recognized are ignored, but still maintained into JSON metadata.</p><p>The implementation must validate the JSON structure before updating the on-disk header.</p><p>LUKS has some mandatory objects as follow:</p><ul><li><strong><em>config </em></strong>— which contains persistent header configuration attributes</li><li><strong><em>keyslots </em></strong>— that are objects that describe encrypted keys storage areas</li><li><strong><em>digests </em></strong>— used to verify that decrypted keys are correct</li><li><strong><em>segments </em></strong>— describe areas on disk that contain user encrypted data</li><li><strong><em>tokens </em></strong>— can optionally include additional metadata, bindings to other systems</li></ul><p>Binary data inside JSON are stored in Base64 encoding and 64-bit integers are stored as string in decimal notation.</p><p>The following is a drill-down of the mandatory objects in LUKS metadata:</p><h4>Config object</h4><p>The config object contains these fields, that are global for the LUKS device:</p><ul><li><strong><em>json_size </em></strong>— JSON area size (in bytes), this fields must be equal to the binary header</li><li><strong><em>keyslots_size </em></strong>— binary keyslot area size (in bytes), this must be aligned to 4096 bytes</li><li><strong><em>flags </em></strong>— array of string objects with persistent flags for the device</li><li><strong><em>requirements </em></strong>— array of string objects with additional required features for the LUKS device</li></ul><h4>Keyslot object</h4><p>Keyslot objects contain information about stored keys, areas, where binary keyslot are stored, encryption type, anti-forensic function used, password-based key derivation function and related parameters.</p><p>Each keyslot object contains:</p><ul><li><strong><em>type </em></strong>— keyslot type</li><li><strong><em>key_size </em></strong>— key size (in bytes) stored in keyslot</li><li><strong><em>area </em></strong>— allocated area in binary keyslot area</li><li><strong><em>kdf </em></strong>— PBKDF</li><li><strong><em>af </em></strong>— anti-forensic. Not in use in modern systems (LUKS2)</li><li><strong><em>priority </em></strong>— is the keyslot priority: 0 = ignore, 1 = normal, 2 = high.</li></ul><h4>Digest object</h4><p>To verify that a decrypted key (from a keyslot) is correct, LUKS uses digests object. These objects are assigned to keyslots and segments, if not assigned to a segment the digest is used for a unbound key.</p><p>Digest object contains these fields:</p><ul><li><strong><em>type </em></strong>— digest type</li><li><strong><em>keyslots </em></strong>— array of keyslot objects names assigned to the digest</li><li><strong><em>segments </em></strong>— array of segment objects names assigned to the digest</li><li><strong><em>salt </em></strong>— binary salt for the digest</li><li><strong><em>digest </em></strong>— binary digest data</li></ul><h4>Segment object</h4><p>Segment object contains the definition for encrypted areas on the disk. For a normal LUKS device there is only one data segment present.</p><p>These are the fields:</p><ul><li><strong><em>type</em></strong> — segment type (only <em>crypt</em> is currently used)</li><li><strong><em>offset </em></strong>— offset from the device start to the beginning of the segment</li><li><strong><em>size </em></strong>— segment size (in bytes) or <em>dynamic</em> (for the dynamic resize of the device)</li><li><strong><em>iv_tweak </em></strong>— starting offset for the Initializaion Vector</li><li><strong><em>encryption </em></strong>— segment encryption algorithm in <em>dm-crypt</em> notation</li><li><strong><em>sector_size </em></strong>— sector size for the segment (512, 1024, 2048 or 4096 bytes)</li><li><strong><em>integrity </em></strong>— LUKS2 user data integrity protection</li><li><strong><em>flags </em></strong>— array of string objects with additional information for the segment</li></ul><h4>Token object</h4><p>Token object is an object that describe how to get a passphrase to unlock a particular keyslot, and can contain additional JSON metadata.<br>These are the mandatory fields:</p><ul><li><strong><em>type </em></strong>— defines the token type</li><li><strong><em>keyslots </em></strong>— array of keyslot objects names assigned to the token</li></ul><h3>LUKS Backup and Restore</h3><h4>LUKS Header Backup</h4><p>LUKS header backup is useful in case you corrupt or delete your header. If you work directly on the disk (and not on the device mapper) for any reason, this could save you in case something bad happens.</p><p>This will create a file with your LUKS header:</p><pre>sudo cryptsetup luksHeaderBackup /dev/MY_DRIVE --header-backup-file /path/to/backup-file</pre><p>You can backup your LUKS header with <em>dd</em> command too:</p><pre>sudo dd if=/dev/MY_DRIVE of=/path/to/backup-file bs=X count=Y</pre><p>With <em>dd</em> you should know the size of your header in order to make sure you copy all the data in it. Use <em>luksDump</em> to get size and offset information.</p><h4>LUKS Header Restore</h4><p>This is one of the worst scenario you may face: you have lost/corrupted your LUKS header. If you have a backup copy, you can restore them booting from a Live OS, this procedure will restore your headers back.</p><pre>sudo cryptsetup luksHeaderRestore /dev/MY_DRIVE --header-backup-file /path/to/backup-file</pre><p>LUKS will ask for confirm the command:</p><pre>WARNING!<br>========<br>Device /dev/MY_DRIVE already contains LUKS2 header. Replacing header will destroy existing keyslots.<br><br>Are you sure? (Type uppercase yes): </pre><h3>How to wipe a LUKS encrypted drive</h3><p>If you have a <strong>LUKS encrypted drive</strong>, you have two ways to wipe it: delete the LUKS header located at the beginning of the encrypted disk, or you can wipe the entire disk as a standard disk.</p><h4>Deleting LUKS Header</h4><p>The header, as we stated above, contains all the information to unlock the disk, without these information (keys in particular) is practically impossible to recover the data.<br>So may be sufficient to erase the header:</p><pre>sudo shred --size=LUKS_HEADER_SIZE /dev/MY_DRIVE</pre><blockquote>If you have multiple partition make sure you shred only the LUKS partition and not the whole disk or the partition table!</blockquote><p>You can also wipe your keys with <em>cryptsetup</em> as follow:</p><pre>sudo cryptsetup erase <em>/dev/MY_DRIVE</em></pre><p>Additionally you can remove all the LUKS header with <em>wipefs</em>:</p><pre>sudo wipefs -a <em>/dev/MY_DRIVE</em></pre><h4>Wipe the disk</h4><p>Wiping the disk will be the simplest solution, but not the fastest. In order to proceed erasing your disk, you need to boot from a Live OS.</p><p>With <em>shred</em> we can erase our disk and prevent any forensic data recovery:</p><pre>sudo shred /dev/MY_DRIVE</pre><p>Also <em>dd</em> can be used for this purpose and the input source should be urandom/random or zero:</p><pre>sudo dd if=/dev/urandom of=/dev/MY_DRIVE</pre><pre>OR</pre><pre>sudo dd if=/dev/zero of=/dev/MY_DRIVE</pre><h3>Conclusion</h3><p>In this article we have explored LUKS, a valid frontend for full disk encryption. It is important to ensure that your LUKS configuration is secure (strong ciphers); if you do not need the explicit features of the first version of LUKS, use LUKS2.</p><p>We have also seen that erasing a LUKS partition could be easier and faster than a normal disk, this is an interesting point since at the moment (2021) there is no way to recover encrypted data.</p><p>If you want to understand how to secure your<strong> Linux system</strong>, not only enabling the <strong>Full Disk Encryption</strong>, see also this article:</p><p><a href="https://mattiazignale.medium.com/introduction-to-linux-security-hardening-635af8e6e885">Introduction to Linux Security &amp; Hardening</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6452ad1a42e8" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/how-luks-works-with-full-disk-encryption-in-linux-6452ad1a42e8">How LUKS works with Full Disk Encryption in Linux</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Notes on CEH — Part 4]]></title>
            <link>https://mattiazignale.medium.com/notes-on-ceh-part-4-3b01889ea9b0?source=rss-442f25896e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3b01889ea9b0</guid>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[ceh-certification]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Mattia Zignale]]></dc:creator>
            <pubDate>Wed, 01 Sep 2021 09:03:14 GMT</pubDate>
            <atom:updated>2021-09-01T09:03:14.633Z</atom:updated>
            <content:encoded><![CDATA[<h3>Notes on CEH — Part 4</h3><h3>10: IDS/Firewall Evasion and Honeypot</h3><p>An IDS (<strong>Intrusion Detection System</strong>) is security software (or hardware) that inspects all traffic entering and leaving the network, looking for suspicious patterns.</p><h4>Types of IDS</h4><ul><li><strong>NIDS</strong>: Network based IDS, consists of a machine placed in the network in promiscuous mode, listening to the traffic, able to generate alerts in case of malicious patterns.</li><li><strong>HIDS</strong>: Host based IDS, are generally applications (agents) installed on specific hosts, able to audit the events of the host under analysis.</li></ul><h4>Firewall</h4><p>They are hardware (or software) devices that prevent unauthorized access from and to private networks; they are usually placed between the public and private network. The firewall analyzes all packets that enter or leave the network and blocks those that do not respect the set security criteria.</p><h4>Firewall architecture</h4><p><em>BASTION HOST</em>: It is a system configured to protect resources from attacks, it has two interfaces, one for the private network and one for the Internet.</p><p><em>SCREENED SUBNET</em>: It is more common to call it <strong>DMZ</strong> (DeMilitarized Zone) and contains hosts that offer services that must be available to the outside world (e.g. webserver), the private zone cannot be reached by internet users.</p><p><em>MULTI-HOMED FIREWALL</em>: These are firewalls with two or more interfaces that allow further subdivision of the network according to security specifications dictated by the company.</p><h4>DMZ — DeMilitarized Zone</h4><p>The DMZ is a network that is used as a buffer between the internal network (secure) and the Internet (insecure). It is created using a firewall with three or more network interfaces.</p><h3>IDS evasion techniques</h3><p>The main goal is to make to see to the IDS packets that in reality they are other.</p><h4>Insertion Attack</h4><p>This is a type of attack that confuses the IDS into reading invalid packets, the IDS will accept packets that will be rejected by the end systems involved, this will result in data being inserted into the IDS.</p><h4>Obfuscation</h4><p>It’s an <strong>IDS evasion</strong> technique, it consists in encoding the packet (containing a payload) in such a way that it’s decipherable only by the target host and not by IDS, usually cryptography or Unicode encoding is used.</p><h3>Firewall evasion techniques</h3><p>The identification of firewalls can be done through port scanning and discovery of running services, <strong>firewalking</strong> that consists in using TTL to determine ACLs and map the network, and banner grabbing for footprinting.</p><h4>IP Address Spoofing</h4><p>The attacker masks his IP address as if it were a trusted host, this is done by modifying the header of IP packets in order to bypass the firewall.</p><h4>Bypassing blocked websites</h4><p>Some websites allow you to browse other websites through them, thus bypassing the IP-based rules of the firewall.</p><h4>Firewall bypass using ICMP Tunneling</h4><p>This technique allows, for example, to encapsulate a backdoor in the data portion of <strong>ICMP packets</strong>, the payload portion is arbitrary and is not examined by many firewalls so it is possible to encapsulate any kind of data.</p><h3>11: Hacking Web Application</h3><p>Web applications provide an interface between the end user and the web server, through a series of dynamically generated (or static) web pages that are served by the web server.</p><h3>Threats to Web Applications</h3><h4>OWASP Top 10 Application Security Risks (2017)</h4><ol><li>Injection</li><li>Broken Authentication</li><li>Sensitive Data Exposure</li><li>XML External Entity</li><li>Broken Access Control</li><li>Security Misconfiguration</li><li>Cross-Site Scripting (XSS)</li><li>Insecure Deserialization</li><li>Components with known vulnerabilities</li><li>Insufficient Logging and Monitoring</li></ol><h4>Injection</h4><p>It is a vulnerability that allows unvalidated data to be interpreted and executed by the server, and can be divided into: SQL Injection, Command Injection, LDAP Injection.</p><h4>Broken Authentication</h4><p>An attacker can exploit vulnerabilities in the authentication mechanism or in session management functions such as: exposed accounts, session ID, logout, password management, timeouts, security questions, and more to impersonate an user.</p><h4>Sensitive Data Exposure</h4><p>Many web applications do not protect sensitive information from unauthorized access, this can occur if there are flaws such as improper encryption management or information leaks (e.g. access).</p><h4>XXE — XML External Entity</h4><p>It is a server-side attack, specifically a <strong>SSRF</strong> (<em>Server-Side Request Forgery</em>), where the application parses an XML file from an unrecognized source. It takes advantage of errors in the XML parser.</p><h4>Broken Access Control</h4><p>Access Control refers to how a web application allows access to its content and functions, this method bypasses authentication.</p><h4>Security Misconfiguration</h4><p>An attacker using a vulnerability due to misconfiguration (such as using default accounts or managing unprotected files) will gain unauthorized access to the system. It is typically exploited by using invalidated input, form tampering, improper error and exception handling, or insufficient transport security measures.</p><h4>XSS — Cross-Site Scripting</h4><p>The <strong>XSS attack</strong> exploits vulnerabilities in dynamic pages, it allows the attacker to inject code into web pages and have other users execute/display it.</p><h4>Insecure Deserialization</h4><p>Data Serialization/Deserialization is a process that allows linearization of data objects so that they can be transported to other systems or networks, the attacker injects malicious code and forwards it to the victim.</p><h4>Use of components with known vulnerabilities</h4><p>External components, such as libraries and frameworks, which are often used in webapps that run with certain privileges, a flaw in any external component can compromise the entire application and have a very serious impact. An attacker is able to identify weak components and dependencies through scanning or manual analysis.</p><h4>Insufficient logging and monitoring</h4><p>This scenario occurs when the application does not perform complete and exhaustive logging or detection systems do not detect any malicious activity (or ignore it completely).</p><h4>CSRF — Cross-Site Request Forgery</h4><p>A <strong>CSRF attack</strong> exploits vulnerabilities in a web page and allows the attacker to force a user’s browser to send malicious requests. The victim has an active session with a trusted website and simultaneously visits a fraudulent website that injects an HTTP request to the trusted site, compromising its integrity.</p><h3>Web Application Hacking Methodology</h3><h4>Web Infrastructure Footprinting</h4><p>Footprinting is the first step in <strong>webapp hacking</strong> and consists of identifying vulnerable applications and selecting victims.</p><p><strong>SERVER DISCOVERY</strong>: Cataloguing information about the location of servers and their status. Information on IP addresses, DNS names and port scanning allows the service discovery phase to be carried out in a more agile manner.</p><p><strong>SERVICE DISCOVERY</strong>: Analyze the target to identify the ports in use. Some tools to make this kind of analysis: <em>nmap</em>, <em>netscan tools pro</em>, <em>sandcat</em>.</p><p><strong>SERVER IDENTIFICATION</strong>: Analyze the header of the server responses to identify the model and version of the web server software, in essence this is banner grabbing.</p><p><strong>HIDDEN CONTENT DISCOVERY</strong>: Discover hidden content and functionality that is not directly reachable, so that it can be exploited. (Web dir brute forcing, web spidering).</p><h4>WAF and Proxy Detection</h4><p>PROXY: It allows you to find out if the target is redirecting requests through a proxy server, usually these servers add some fields in the response header. You can use the TRACE method (HTTP 1.1) to identify changes.</p><p>WAF: Check if the web application under analysis is protected by a WAF (<strong>Web Application Firewall</strong>) via cookies in replies (often WAFs add their own cookies to the response request). Use <em>wafw00f</em> to find out what kind of WAF is present.</p><h3>12: SQL Injection</h3><p>SQL Injection is a technique used to take advantage of un-sanitiezed input vulnerabilities to pass SQL commands through a web application for execution by a backend database. An attacker can gain unauthorized access or retrieve information.</p><h3>SQL Injection Methodology</h3><h4>Extracting Information through Error Messages</h4><p>Error messages are essential for extracting information from the database: operating system, database type.<br>Depending on the type of errors found you can vary attack techniques.<br>Attacker manipulates parameters of GET and POST requests to generate errors.</p><h4>SQL Injection Black Box PenTesting</h4><ul><li>Send single/double quotes as the input data to catch not sanitized input</li><li>Use right square bracket as the input data to catch if is used as part of a SQL identifier without sanitization</li><li>Send long strings of junk data to detect buffer overruns</li></ul><h4>Perform Error Based SQL Injection</h4><ul><li>Syntax error converting the <em>nVARCHAR</em> value <em>db_name</em> to a column of data type int</li><li>When using dynamic SQL within a stored procedure, the app must properly sanitize the user input to eliminate risk of code injection, otherwise there is a chance of executing malicious SQL within the stored procedure</li></ul><h4>Bypass Website Logins using SQL Injection</h4><p>You can union results with a known password and MD5 hash of supplied password, the webapp will compare your password and the supplied MD5 hash instead of MD5 from the database.</p><p>Some SQL Injection examples:</p><pre>admin&#39; --<br>admin&#39; #<br>admin&#39;/*<br>&#39; OR 1=1--</pre><h4>Interacting with the Operating System</h4><p>There are two ways to interact with the OS: reading and writing system files from disk, direct command execution via remote shell.</p><pre>NULL UNION ALL SELECT LOAD_FILE(‘/etc/passwd’)/*</pre><p>If successful, the injection will display contents of the passwd file.</p><h4>Network Reconnaissance using SQL Injection</h4><ul><li>You can execute the following using the <em>XP_CMDSHELL</em> command:</li></ul><pre>ipconfig /all, tracert MYIP, arp -a, netstat -ano</pre><ul><li>Gathering IP information through reverse lookups.</li></ul><h4>Finding and Bypassing Admin Panel of a Website</h4><p>Attackers try to find the admin panel of a website using simple Google Dorks and bypass the admin authentication using SQL Injection attack.</p><p>Will follow other articles about CEH</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3b01889ea9b0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How was my first Web Application Penetration Test]]></title>
            <link>https://infosecwriteups.com/how-was-my-first-web-application-penetration-test-d18fdd78d2d5?source=rss-442f25896e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d18fdd78d2d5</guid>
            <category><![CDATA[web-hacking]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[web-app-security]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[Mattia Zignale]]></dc:creator>
            <pubDate>Sun, 29 Aug 2021 16:28:24 GMT</pubDate>
            <atom:updated>2021-08-29T16:28:24.668Z</atom:updated>
            <content:encoded><![CDATA[<p>A while ago a client of mine asked for a <strong>WAPT</strong> (<em>Web Application Penetration Test</em>) for his company; the web application was built in Microsoft environment, so with all the <em>ASP.NET</em> and <em>.NET framework</em> stuffs that Linux boys always pass: this was the first real WAPT I have ever done.</p><p>Why I say that this was the first real WAPT in my life? Well, I had no information about the web application or the systems behind. This made it a bit challenging and more exciting than ever. The only information I had was the version of the web server, the language of the source code and an admin account to test internal part of the web application.<br>The web app I had to break was on a pre-production environment but I noticed that also the production environment was on the same IP address, this made me desist from doing a DoS network attack because it could impact also production (what a pity!).</p><h3>First move: Recon</h3><p>Since I had no idea of what kind of application I was analyzing I had to start from the basics: <strong>reconnaissance</strong> and <strong>information gathering</strong>.</p><h4>DNS Lookup</h4><p>This is quite often my first recon move when I have a web application to analyze. DNS lookup could give you a lot of information regarding the target infrastructure, but this time I was not so lucky: the nameserver was managed by GoDaddy (which was surely out of scope) and I can not retrieve any other information.</p><h4>NMAP Scan</h4><p>Perform a NMAP scan is always a good point to start, even if it is a Web Application Penetration Test, it could give you information about services running on the target, ports open (or not) and firewall/ids in front of the server.</p><pre># Nmap 7.80 scan initiated Tue Aug  3 15:11:12 2021 as: nmap -sC -sV -p- -v -oN nmap-1-65535-sV-sC.txt ---OMISSIS---.com<br>Nmap scan report for ---OMISSIS---.com (xxx.xxx.xxx.xxx)<br>Host is up (0.042s latency).<br>Not shown: 65533 filtered ports<br>PORT    STATE SERVICE  VERSION<br>80/tcp  open  http     Microsoft IIS httpd 10.0<br>|_http-favicon: Unknown favicon MD5: 0F7EXXXXXXXXXXXXXXXXXXXXXXXX2C16<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST OPTIONS<br>|_http-server-header: Microsoft-IIS/10.0<br>| http-title:         ---OMISSIS---<br>|_Requested resource was http://---OMISSIS---.com/<br>443/tcp open  ssl/http Microsoft IIS httpd 10.0<br>| http-methods: <br>|_  Supported Methods: GET HEAD POST OPTIONS<br>|_http-server-header: Microsoft-IIS/10.0<br>|_http-title: Did not follow redirect to http://---OMISSIS---.com/<br>| ssl-cert: Subject: commonName=---OMISSIS---.com/organizationName=---OMISSIS---./countryName=IE<br>| Subject Alternative Name: DNS:---OMISSIS---.com<br>| Issuer: commonName=GeoTrust EV RSA CA 2018/organizationName=DigiCert Inc/countryName=US<br>| Public Key type: rsa<br>| Public Key bits: 4096<br>| Signature Algorithm: sha256WithRSAEncryption<br>| Not valid before: 2021-05-26T00:00:00<br>| Not valid after:  2022-06-14T23:59:59<br>| MD5:   7bf5 XXXX XXXX XXXX XXXX XXXX XXXX 1149<br>|_SHA-1: bb2c XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX ce6c<br>|_ssl-date: 2021-08-03T13:13:37+00:00; 0s from scanner time.<br>| tls-alpn: <br>|   h2<br>|_  http/1.1<br>Service Info: OS: Windows; CPE: cpe:/o:microsoft:windows</pre><pre>Read data files from: /usr/bin/../share/nmap<br>Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .<br># Nmap done at Tue Aug  3 15:13:38 2021 -- 1 IP address (1 host up) scanned in 145.48 seconds</pre><p>As you can see in the code above, once again we didn’t get any relevant information, so go ahead with recon!</p><h4>SSL Scan</h4><p>After the NMAP scan I performed a scan with sslscan to see which cipher suites were in use:</p><pre>sslscan ---OMISSIS---.com                                                                                                                                    1 ⨯<br>Version: 2.0.7-static<br>OpenSSL 1.1.1j-dev  xx XXX xxxx</pre><pre>Connected to xxx.xxx.xxx.xxx</pre><pre>Testing SSL server ---OMISSIS---.com on port 443 using SNI name ---OMISSIS---.com</pre><pre>SSL/TLS Protocols:<br>SSLv2     disabled<br>SSLv3     enabled<br>TLSv1.0   enabled<br>TLSv1.1   enabled<br>TLSv1.2   enabled<br>TLSv1.3   disabled</pre><pre>TLS Fallback SCSV:<br>Server does not support TLS Fallback SCSV</pre><pre>TLS renegotiation:<br>Secure session renegotiation supported</pre><pre>TLS Compression:<br>Compression disabled</pre><pre>Heartbleed:<br>TLSv1.2 not vulnerable to heartbleed<br>TLSv1.1 not vulnerable to heartbleed<br>TLSv1.0 not vulnerable to heartbleed</pre><pre>Supported Server Cipher(s):<br>Preferred TLSv1.2  256 bits  ECDHE-RSA-AES256-GCM-SHA384   Curve 25519 DHE 253<br>Accepted  TLSv1.2  128 bits  ECDHE-RSA-AES128-GCM-SHA256   Curve 25519 DHE 253<br>Accepted  TLSv1.2  256 bits  DHE-RSA-AES256-GCM-SHA384     DHE 2048 bits<br>Accepted  TLSv1.2  128 bits  DHE-RSA-AES128-GCM-SHA256     DHE 2048 bits<br>Accepted  TLSv1.2  128 bits  RC4-SHA                      <br>Accepted  TLSv1.2  128 bits  RC4-MD5                      <br>Preferred TLSv1.1  128 bits  RC4-SHA                      <br>Accepted  TLSv1.1  128 bits  RC4-MD5                      <br>Preferred TLSv1.0  128 bits  RC4-SHA                      <br>Accepted  TLSv1.0  128 bits  RC4-MD5</pre><pre>SSL Certificate:<br>Signature Algorithm: sha256WithRSAEncryption<br>RSA Key Strength:    4096</pre><pre>Subject:  ---OMISSIS---.com<br>Altnames: DNS:---OMISSIS---.com<br>Issuer:   GeoTrust EV RSA CA 2018</pre><pre>Not valid before: May 26 00:00:00 2021 GMT<br>Not valid after:  Jun 14 23:59:59 2022 GMT</pre><p>This was the first relevant result I had: SSLv3 and TLSv1.0 enabled (which are not secure anymore!). Moreover the cipher suites for TLSv1.2 were using RC4 and MD5 that are not recommended because they are considered weak.</p><h3>Attack phase</h3><p>Once the reconnaissance was over I moved to do some magics on that web application!</p><h4>Static Code Analysis</h4><p>Obviously I didn’t have the source code of the application, but I had the HTML generated: this means a lot of Javascript scripts, libraries, external resource and (if you’re lucky) some useful comment in the code.</p><p>I started looking at the HTML and noticed a lot of libraries were used, and some of them were vulnerable or no longer maintained.<br>This analysis helped me in the next steps.</p><h4>Login form and Session Management</h4><p>The first analysis on the login page was on the cookies. The web application I tested does not refresh Session ID after login and neither if the page is refreshed (when the user is not authenticated), moreover there were some cookies that were still valid after logout.</p><p>Secondly the password input was not managed correctly, the type of this input was “<em>text</em>” and not “<em>password</em>”: the obfuscation was made by special font applied to this input.<br>Furthermore this input can’t handle correctly the single quote ( ‘ ) character, in fact if inserted it caused the crash of the system of login that remained in wait, beyond to the fact to make to disappear the obfuscation of the field. The cause was that the password was sent back to the client (from the server) into a Javascript function that was using single quote to pass the argument (the password).</p><h4>XSS</h4><p>After a little bit of work I discovered some fields which can be filled with free text. I tried with a simple XSS:</p><pre>&lt;script&gt;alert(1)&lt;/script&gt;</pre><p>Unexpectedly, the application crashed. Even if the framework became aware of the potential attack, our XSS generated an unhandled exception revealing the framework version and the stack trace.<br>Once I got the version used to build the web application I googled a bit an found a way to bypass this crash: using Unicode encoding.</p><p>I built the new XSS with Unicode angle brackets and finally I got a <strong>stored XSS</strong>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*-kiF1Umx1fG_W_E-5_faRw.png" /></figure><h3>Reporting phase</h3><p>This phase is the most important and you should start it when you start the Penetration Test. In Kali you’ll find some specific tools for pt reporting, but you can use even VI if you want.</p><p>The report I wrote was divided into 5 sections and 2 appendix:</p><ol><li><em>Activity Overview </em>— This paragraph describes the activity, the rules of engagement, the methodology, the team, and the tools used.</li><li><em>Findings</em> —Usually contains only evidence of the vulnerabilities found by the scanner or vulnerable software.</li><li><em>Attack Narrative</em> — This section describes the attack phase: how the attack was made, how specific vulnerability was exploited and how to remediate.</li><li><em>Remediation Plan </em>— Remediation section contains all the remediations suggested (vulnerabilities and PT remediation).</li><li><em>Conclusions </em>— This is the final section which contains a sum up of the report.</li></ol><p>Remember to describe all the steps very clearly for your client, write your contacts if they have any doubts.</p><h3>Useful resources</h3><h4>International Security Guidelines</h4><ul><li><strong>NIST 800–100</strong> “Information Security Handbook” -<br><a href="https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-100.pdf">https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-100.pdf</a></li><li><strong>NIST 800–95</strong> “Guide to Secure Web Services” -<br><a href="https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-95.pdf">https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-95.pdf</a></li><li><strong>NIST 800–53</strong> “Security and Privacy Controls for<br>Information Systems and Organizations” -<br><a href="https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r5.pdf">https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-53r5.pdf</a></li><li><strong>OWASP Web Security Testing Guide</strong> -<br><a href="https://owasp.org/www-project-web-security-testing-guide/stable/">https://owasp.org/www-project-web-security-testing-guide/stable/</a></li><li><strong>OSSTMM </strong>— <a href="https://www.isecom.org/OSSTMM.3.pdf">https://www.isecom.org/OSSTMM.3.pdf</a></li></ul><h4>Secure Cipher Suites</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*4-7bjnaACI_GA2FalvajVw.png" /><figcaption>OpenSSL Cipher Suite syntax</figcaption></figure><p><strong>Supplementary links:</strong></p><ul><li><a href="https://owasp.deteact.com/cheat/cheatsheets/TLS_Cipher_String_Cheat_Sheet.html">https://owasp.deteact.com/cheat/cheatsheets/TLS_Cipher_String_Cheat_Sheet.html</a></li><li><a href="https://cheatsheetseries.owasp.org/cheatsheets/TLS_Cipher_String_Cheat_Sheet.html">https://cheatsheetseries.owasp.org/cheatsheets/TLS_Cipher_String_Cheat_Sheet.html</a></li></ul><h3>Conclusions</h3><p>The web application I analyzed was quite secure, but there were still some technical measures to implement to improve the overall security. Disabling SSL v3 and TLS 1.0/1.1 and using <strong>secure cipher suites</strong> increases the security of HTTPS connections by preventing certain types of <strong>man-in-the-middle</strong> attacks. Separating development and production environments (and using different IP addresses) is necessary to avoid DoS network attacks.<br>Proper Session Management dramatically decreases the risk of <strong>Session Hijacking</strong> attacks and <strong>CSRF</strong> (Cross-Site Request Forgery) attacks. The password input in the login form must be managed correctly and it needs some additional server-side checks. XSS can be avoided by doing deeper checks by using the development framework properly, implementing proper encoding, and exception handling.<br>Limiting information disclosed (web server version, framework version and stack trace) could put the attacker in difficulty.<br>Make sure to handle correctly all the exceptions that could be thrown to avoid unforeseen situations.</p><p>Always follow the best practices: NIST, OWASP, ISECOM and the whole Security community will be your best friends.</p><p>The only advice I can give you is try, try and try again, because every application or system is different: no application is 100% secure, even if you’re a n00b.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d18fdd78d2d5" width="1" height="1" alt=""><hr><p><a href="https://infosecwriteups.com/how-was-my-first-web-application-penetration-test-d18fdd78d2d5">How was my first Web Application Penetration Test</a> was originally published in <a href="https://infosecwriteups.com/">InfoSec Write-ups</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Notes on CEH — Part 3]]></title>
            <link>https://mattiazignale.medium.com/notes-on-ceh-part-3-3101d83f955a?source=rss-442f25896e9b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3101d83f955a</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ceh-certification]]></category>
            <dc:creator><![CDATA[Mattia Zignale]]></dc:creator>
            <pubDate>Mon, 26 Jul 2021 13:03:27 GMT</pubDate>
            <atom:updated>2021-08-30T10:11:17.101Z</atom:updated>
            <content:encoded><![CDATA[<h3>Notes on CEH — Part 3</h3><h3>07: Sniffing</h3><h3>Sniffing concepts</h3><h4>Network Sniffing</h4><p>Packet sniffing is a process of monitoring and capturing all packets passing through a network through the use of dedicated software or hardware.</p><h4>Types of Sniffing</h4><p><strong>PASSIVE SNIFFING</strong>: refers to a technique of sniffing through hubs (which are no longer in use today) and can only be done in a network where packets are sent to all devices.</p><p><strong>ACTIVE SNIFFING</strong>: is a technique that is used in a network where there are switches, it consists of injecting ARP packets into the network to fill the CAM (content addressable memory) of the switch. Techniques used include: MAC flooding, DHCP attacks, DNS Poisoning, Switch Port Stealing, ARP Poisoning, and spoofing attacks. <strong>The NIC must be in promiscuous mode</strong>.</p><h3>MAC Attacks</h3><p>When the CAM on a switch is full, packets are sent to all ports on the switch, effectively turning it into a hub, the switch is then reset and reenters in “learning mode”. The CAM is typically filled with dummy IP/MACs.</p><h4>Switch Port Stealing</h4><p>This technique uses MAC Flooding to sniff packets. The attacker floods the switch with specially modified ARP packets: the packet has the MAC of the target as the source and the MAC of the attacker as the recipient; if the attacker is fast enough compared to the switch then the packets will be redirected to him and not to the legitimate target.</p><h3>DHCP Attacks</h3><p>DHCP servers maintain TCP/IP configurations in a database, they are classified as valid parameters.</p><h4>DHCP Starvation Attack</h4><p>This type is a DoS attack on the DHCP server. The attacker broadcasts DHCP requests and gets IP addresses “released”, which inhibits the user from obtaining or renewing their IP address.</p><h4>Rouge DHCP Server</h4><p>The attacker enables a dummy DHCP server in the network to respond to DHCP requests, this attack is used with the help of DHCP Starvation: the attacker sends TCP/IP configurations to users who request them after delegitimizing the genuine DHCP server.</p><h3>ARP Poisoning</h3><p>The ARP protocol is <strong>stateless</strong> and is used to map the IPs and MACs of devices. All devices make ARP requests in broadcast to find the MAC of a device. With ARP it is possible to send responses even if a specific request has not been made, so in a network it is possible, before any device asks for it, to make a request such as “Hello I am A and I have the MAC XX:XX:XX”, the target will still record the information.</p><h4>Threats</h4><p>Using fictitious ARP requests an attacker can break into the communication between two hosts resulting in a de facto man-in-the-middle.</p><p>Other threats:</p><ul><li>Packet sniffing</li><li>Session Hijacking</li><li>VOIP Call Tapping</li><li>Data Manipulation</li><li>MITM Attacks</li><li>Data interception</li><li>Connection Hijacking</li><li>Connection reset</li><li>Credentials theft</li><li>DoS Attacks</li></ul><h3>DNS Poisoning</h3><p>DNS Poisoning is a technique that tricks a DNS server into believing it has received authentic information, in fact, wrong/false IP addresses are inserted into the DNS configuration that is responsible for translating web addresses into IPs.</p><h4>Intranet DNS Spoofing</h4><p>The attacker’s system must be connected to the LAN and enabled for packet sniffing, it works very well against switches with ARP Poisoning routing.</p><h4>Host File</h4><p>Modifying the hosts file of the system allows the attacker to be very successful: in fact, if the system finds the searched query in its hosts file, it will not make any query to the DNS server.</p><h4>Proxy Server DNS Poisoning</h4><p>An attacker can change the settings of the victim’s proxy server and all requests will go through not the original proxy but the one set by the attacker.</p><h4>DNS Cache Poisoning</h4><p>This type of attack consists of altering the DNS cache (or adding DNS records) in the DNS resolver cache in order to redirect traffic to malicious sites.</p><h3>08: Denial of Service</h3><h3>Introduction to DoS and DDoS</h3><p>Denial of Service (DoS) attack is a type of attack that targets computers or networks and reduces, restricts, or prevents access to resources by legitimate users. The attacker floods the victim with non-legitimate requests or simple traffic to overload the victim’s resources.</p><p>DDoS (Distributed Denial of Service) is a coordinated DoS attack that involves a large number of zombie computers (previously compromised systems, botnets) to attack a single target.</p><h3>DoS/DDoS Attack techniques</h3><p><strong>VOLUMETRIC ATTACK</strong>: Consume the bandwidth of the target (network or service).</p><p><strong>PROTOCOL ATTACK</strong>: It uses resources such as connection state tables present in network equipment.</p><p><strong>APPLICATION LAYER ATTACK</strong>: Consume application (or service) resources in a way that renders it non-functional to legitimate users.</p><h4>UDP Flood</h4><p>The attacker sends spoofed UDP packets at a high frequency, on random ports. This will result in the server being forced to “check” if there are any applications that can respond on the selected ports.</p><h4>SYN Flood</h4><p>The attacker sends a massive amount of SYN requests to the target with fictitious source IP address, the target will reply with SYN+ACK waiting for the final ACK. The target will not receive a response because the source IP is fake; an incomplete three-way handshake can be waiting up to 75 seconds.</p><h4>Fragmentation Attack</h4><p>This type of attack drastically reduces the target’s ability to reassemble packets. The target, inundated with fragmented TCP or UDP packets, will attempt to reassemble them and this will lead to a reduction in performance. Fragmented packets usually pass through network defense systems unnoticed, as reassembling and inspecting large fragmented packets would consume an excessive amount of system resources.</p><h4>Multi-Vector Attack</h4><p>The attacker in this case uses a combination of volumetric, protocol and application layer attacks. They can be launched one vector at a time or in parallel to confuse analysts.</p><h3>Detection e mitigation techniques</h3><p>Detection techniques are based on the identification and discrimination of malicious traffic (constant traffic increases or spikes) and circumstantial events of unanticipated increase of legitimate packets. All detection techniques define an attack as an <strong>abnormal and noticeable deviation from predetermined thresholds</strong> during normal network traffic.</p><ul><li><strong>ACTIVITY PROFILING</strong>: This type of analysis studies the average packet rate in the network, and in individual segments, to verify the presence of malicious traffic.</li><li><strong>SEQUENTIAL CHANGE-POINT DETECTION</strong>: These are algorithms that filter traffic by address, port or protocol and index the results on a time scale.</li><li><strong>WAVELET-BASED SIGNAL ANALYSIS</strong>: The wavelet analysis describes an incoming signal in spectral terms, this analysis allows to filter out anomalous traffic from normal traffic.</li></ul><h4>Countermeasures</h4><p><strong>Absorb the attack</strong>: Use additional resources (bandwidth, system resources)</p><p><strong>Degrading services</strong>: Turn off non-critical and unnecessary services</p><p><strong>Turn off services</strong>: Turn off all services until the attack is over</p><h4>Prevention</h4><ul><li>EGRESS FILTERING: Scan the headers of IP packets leaving the network, make sure that unauthorized or malicious traffic leaves the internal network.</li><li>INGRESS FILTERING: Prevent source address spoofing, protects against flooding attacks.</li><li>TCP INTERCEPT: The TCP Intercept feature in routers protects TCP servers from SYN flooding attacks. It prevents DoS attacks by validating TCP connections.</li><li>RATE LIMITING: Controls the rate of inbound and outbound traffic, reduces high inbound traffic.</li></ul><h4>Reflection</h4><p>There are systems that are set up with a low level of security (honeypot) and act as bait for attackers. A honeypot is used to gather information about the attacker and attack techniques. Use a <strong>defense-in-depth</strong> approach at different points in the network to divert suspicious DoS traffic to honeypots.</p><h4>Mitigation</h4><ul><li>LOAD BALANCING: Balancing the load in a multi-server architecture allows you to mitigate DDoS attacks.</li><li>THROTTLING: This method helps routers take on too much incoming traffic so that servers can handle it properly.</li><li>DROP REQUESTS: Servers and routers begin dropping packets when the load increases excessively.</li></ul><h3>09: Session Hijacking</h3><h3>Session Hijacking concepts</h3><p>Session Hijacking is an attack methodology in which the attacker attempts to insert himself into a TCP communication between two computers. By sniffing the traffic, the attacker can compromise the victim with fraud, identity and/or credential theft.</p><h4>Types of Session Hijacking</h4><p><strong>ACTIVE ATTACK</strong>: In such an attack, the attacker finds an active session and takes it over.</p><p><strong>PASSIVE ATTACK</strong>: In a passive attack, on the other hand, traffic is sniffed and recorded.</p><h4>Session Hijacking in OSI model</h4><p>NETWORK LEVEL HIJACKING: Interception (sniff) of packets during a TCP/UDP transmission between client and server.</p><p>APPLICATION LEVEL HIJACKING: Obtaining the application user session (e.g. HTTP) via session ID.</p><h3>Session Hijacking at applicative level</h3><p>In a session hijacking attack, a session token must be stolen or predicted in order to allow unauthorized access to the web server (HTTP).</p><h4>Compromise of session IDs with client-side attacks</h4><ul><li>XSS allows attackers to inject malicious scripts and have them executed by other users visiting the page</li><li>Malicious code written in JS can be included in a web page and capture user sessions</li><li>A Trojan could change the proxy settings in the browser and send sessions through a machine operated by the attacker</li></ul><h4>Session Hijacking with CRIME attack</h4><p>CRIME (Compression Ratio Info-leak Made Easy) is a client-side attack that exploits vulnerabilities present in compression protocols such as SSL/TLS, SPDY and HTTPS.</p><h3>Session Hijacking at network level</h3><p>This type of session hijacking is based on the protocols used by web applications at the application layer, the attacker obtains critical information which is then used to attack the application layer.</p><h4>TCP/IP Hijacking</h4><p>It uses spoofed packets to take over the connection between the victim and the target, but the attacker must reside in the same network.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3101d83f955a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>