<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: R̶E̶D̶A̶C̶T̶E̶D̶</title>
    <description>The latest articles on Forem by R̶E̶D̶A̶C̶T̶E̶D̶ (@didymus).</description>
    <link>https://forem.com/didymus</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F238982%2Fdb02a2eb-5868-4f40-bd3b-1546fb8eb7a6.png</url>
      <title>Forem: R̶E̶D̶A̶C̶T̶E̶D̶</title>
      <link>https://forem.com/didymus</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/didymus"/>
    <language>en</language>
    <item>
      <title>XSS and SQLi Polyglot Payloads</title>
      <dc:creator>R̶E̶D̶A̶C̶T̶E̶D̶</dc:creator>
      <pubDate>Mon, 21 Oct 2019 04:05:28 +0000</pubDate>
      <link>https://forem.com/didymus/xss-and-sqli-polyglot-payloads-4hb4</link>
      <guid>https://forem.com/didymus/xss-and-sqli-polyglot-payloads-4hb4</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fw77mrzh9ge8h5mp6lpp5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fw77mrzh9ge8h5mp6lpp5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;What is 'XSS'?&lt;/b&gt;&lt;br&gt;
Cross-site scripting (XSS) is a type of code-injection vulnerability found typically in web applications. XSS allows attackers to 'inject' client-side scripts into pages that will be processed and delivered to other users for viewing. XSS is often used to bypass access controls such as the same-origin policy. Attackers using XSS usually leverage known vulnerabilities in web applications, their servers, or the plug-in systems the web app needs for functionality. An attacker utilizing XSS will introduce malicious code into the content being delivered. When the combined content arrives to another user it is delivered from a trusted source. With XSS an attacker can gain elevated access-privileges to sensitive data, session cookies, and whatever other information that is maintained by the browser and will be delivered to the user.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;What is 'SQLi'?&lt;/b&gt;&lt;br&gt;
SQLi are SQL injections. They are code injection techniques like XSS, used to attack what are known to be or suspected to be data-driven applications. They are SQL statements formed with the intent of dumping database contents to the attacker. SQL injections can allow attackers to spoof identity, tamper with data, cause repudiation issues like voiding transactions or changing balances, disclose all of the system's data, destroy the data, or even become administrators of the database server. The first public discussions of SQL injection appeared around 1998 in Phrack Magazine.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;What are 'polyglot payloads'?&lt;/b&gt;&lt;br&gt;
Basically they are pieces of code that can be executed in multiple contexts in an application and still be treated as valid data. They are useful because with them you can test the application's input controls quicker and with less of a chance of being noticed. There are XSS, SQLi, and file (SWF, PDF, etc) polyglots. In complex applications the user input travels through many checkpoints. The route the input takes may be from the URL through a filter, into a database, and back out to a decoder before it is ever displayed for the user to see. The chart below illustrates what this input-route might look like.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fc48ntvjf0z4y52848cxl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fc48ntvjf0z4y52848cxl.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;XSS polyglot payload by Rsnake:&lt;/b&gt;&lt;br&gt;
&lt;code&gt;‘;alert(String.fromCharCode(88,83,83))//‘;alert(String.fromCharCode(88,83,83))//“;alert(String.fromCharCode(88,83,83))//“;alert(String.fromCharCode(88,83,83))//—&amp;gt;&amp;lt;/SCRIPT&amp;gt;”&amp;gt;’&amp;gt;&amp;lt;SCRIPT&amp;gt;alert(String.fromCharCode(88,83,83))&amp;lt;/SCRIPT&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;An XSS polyglot payload by Ashar Javed from his XSS PhD research:&lt;/b&gt;&lt;br&gt;
&lt;code&gt;‘“&amp;gt;&amp;gt;&amp;lt;marquee&amp;gt;&amp;lt;img src=x onerror=confirm(1)&amp;gt;&amp;lt;/marquee&amp;gt;”&amp;gt;&amp;lt;/plaintext\&amp;gt;&amp;lt;/|\&amp;gt;&amp;lt;plaintext/onmouseover=prompt(1)&amp;gt;&amp;lt;script&amp;gt;prompt(1)&amp;lt;/script&amp;gt;@gmail.com&amp;lt;isindex formaction=javascript:alert(/XSS/) type=submit&amp;gt;’—&amp;gt;”&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;script&amp;gt;alert(1)&amp;lt;/script&amp;gt;”&amp;gt;&amp;lt;img/id=“confirm&amp;amp;lpar;1)”/alt=“/“src=“/“onerror=eval(id&amp;amp;%23x29;&amp;gt;’”&amp;gt;&amp;lt;img src=“http://i.imgur.com/P8mL8.jpg”&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;XSS polyglot payload by Mathias Karlsson:&lt;/b&gt;&lt;br&gt;
&lt;code&gt;“onclick=alert(1)//&amp;lt;button‘onclick=alert(1)//&amp;gt;*/alert(1)//&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;An SQLi polyglot payload by Mathias Karlsson:&lt;/b&gt;&lt;br&gt;
&lt;code&gt;SLEEP(1) /*’ or SLEEP(1) or’” or SLEEP(1) or “*/&lt;/code&gt;&lt;br&gt;
The above polyglot payload works in single quote context, double quote context, as well as "straight into query" context. Please take the time to view Mathias Karlsson's slideshare below titled 'Polyglot Payloads in Practice'. There are some interesting attack patterns in it. It's also where the ASCII devil came from.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Mirror of RSnake's XSS Cheatsheet:&lt;/b&gt;&lt;br&gt;
&lt;a href="https://www.in-secure.org/misc/xss/xss.html" rel="noopener noreferrer"&gt;https://www.in-secure.org/misc/xss/xss.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;DEF CON 23 - Jason Haddix - How to Shot Web: Web and mobile hacking in 2015:&lt;/b&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=-FAjxUOKbdI" rel="noopener noreferrer"&gt;https://www.youtube.com/watch?v=-FAjxUOKbdI&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Polyglot Payloads in Practice by Mathias Karlsson:&lt;/b&gt;&lt;br&gt;
&lt;a href="https://www.slideshare.net/MathiasKarlsson2/polyglot-payloads-in-practice-by-avlidienbrunn-at-hackpra" rel="noopener noreferrer"&gt;https://www.slideshare.net/MathiasKarlsson2/polyglot-payloads-in-practice-by-avlidienbrunn-at-hackpra&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Phrack Magazine:&lt;/b&gt;&lt;br&gt;
&lt;a href="http://www.phrack.org" rel="noopener noreferrer"&gt;http://www.phrack.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If any of this is interesting to you please stay tuned. Next up is Cross-Site Request Forgery.&lt;/p&gt;

</description>
      <category>xss</category>
      <category>sqli</category>
      <category>pentesting</category>
      <category>infosec</category>
    </item>
    <item>
      <title>Engaging in OverTheWire's Wargames</title>
      <dc:creator>R̶E̶D̶A̶C̶T̶E̶D̶</dc:creator>
      <pubDate>Mon, 07 Oct 2019 03:10:18 +0000</pubDate>
      <link>https://forem.com/didymus/engaging-in-overthewire-s-wargames-1hgp</link>
      <guid>https://forem.com/didymus/engaging-in-overthewire-s-wargames-1hgp</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--o7oA_f4N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3nrzo2qytthev9f7bvgq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--o7oA_f4N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/3nrzo2qytthev9f7bvgq.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OverTheWire offer a collection of wargames that are designed to help you learn and practice security concepts in addition to fostering and exercising a particular way of thinking. Thinking outside of the box is, inarguably, a hacker or coders most powerful ability. There are a million-and-one scripts and other tools out there and all of them are extremely easy to use in comparison to developing this ability. Even if you have the knowledge to write them yourself you will still need the requisite street-smarts to achieve the desired outcome. Developing this mindset will aid you in problem-solving for the rest of your life. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XIesHO8L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9w04b57mlq6trkwsy748.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XIesHO8L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/9w04b57mlq6trkwsy748.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OverTheWire's first wargame titled 'Bandit' is aimed at absolute beginners. It will teach you the basics you will need to know in order to engage with their other wargames which increase in difficulty as you move up the levels. Bandit will teach you about using a Linux shell, remote connections, and SSH (secure shell). If you are unfamiliar with SSH I will provide a very brief explanation. The first iteration of SSH (SSH-1) was developed by Tatu Ylönen at Helsinki University of Technology. It's creation was prompted by a password-sniffing attack on the university network. SSH is a cryptographic network protocol for operating network services securely over an unsecured network. This is typically things like remote command-line, login, and remote command execution. Any network service can be secured with SSH. It was designed as a replacement for Telnet and other (insecure) remote shell protocols. Prior to SSH those protocols sent information (like passwords) in plain text which rendered them susceptible to interception through packet analysis. Will packet analysis be a future blog post? Who knows.&lt;/p&gt;

&lt;p&gt;The games at OverTheWire are organized into levels and it is intended for you to complete the previous level before advancing. Unlike 'red team vs blue team' hacking CTF (capture the flag) matches, the OverTheWire wargame suite is played solo so there is a lot less 'organizational overhead' needed to get things started. Real friends are overrated anyway. Everyone knows from Mr. Robot that the super-leet have imaginary ones. Spoiler alert.&lt;/p&gt;

&lt;p&gt;Bandit currently has 34 levels. The suggested order to play the games is to start there at level 0, then once you have worked through it move on to either Leviathan, Natas, or Krypton. After that they suggest Narnia, Behemoth, Utumno, and Maze in that order. There are also Vortex, Semtex, Manpage, and Drifter. Bandit is designed to familiarize the user with the command-line and SSH and set you up with some of the skills necessary for the later games. In Narnia the user is familiarized with basic exploitation. You are provided with the source code of each level in Narnia to make it easier to find the vulnerabilities. Behemoth deals with common coding mistakes such as buffer overflows, race conditions, and privilege escalation. Most of the beginner games do not require previous coding experience, but it will certainly become useful as you advance. Each shell game has its own SSH port and these wargames are a great way to familiarize oneself with the command-line and general concepts of network security.&lt;/p&gt;

&lt;p&gt;To get started with 'Bandit' you will need SSH. The host is &lt;code&gt;bandit.labs.overthewire.org&lt;/code&gt; on port &lt;code&gt;2220&lt;/code&gt; with a login and password of &lt;code&gt;bandit0&lt;/code&gt;. You can connect through the command-line with:&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;ssh -l bandit0 -p 2220 bandit.labs.overthewire.org&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;For Ubuntu users you can install the SSH server with:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt update&lt;br&gt;
sudo apt upgrade&lt;br&gt;
sudo apt install openssh-server&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;For Windows (non-WSL) users you will need to download PuTTY here:&lt;br&gt;
&lt;a href="https://www.putty.org"&gt;https://www.putty.org&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;OverTheWire also uses a scoreboard invoked by the &lt;code&gt;wechall&lt;/code&gt; command in the SSH shell. It is provided by WeChall at &lt;a href="https://www.wechall.net"&gt;https://www.wechall.net&lt;/a&gt;. To use the scoreboard go to the WeChall website and register for an account. Go to &lt;code&gt;Account&lt;/code&gt; then &lt;code&gt;WarBoxes&lt;/code&gt; to get your token. Edit your &lt;code&gt;~/.bashrc&lt;/code&gt; adding:&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;export WECHALLUSER="YourUserName"&lt;br&gt;
export WECHALLTOKEN="YOUR-WECHALL-TOKEN-HERE"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Next, edit your &lt;code&gt;~/.ssh/config&lt;/code&gt; and add:&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;Host *.labs.overthewire.org&lt;br&gt;
  SendEnv WECHALLTOKEN&lt;br&gt;
  SendEnv WECHALLUSER&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Additional information:&lt;br&gt;
&lt;a href="https://overthewire.org/wargames/"&gt;https://overthewire.org/wargames/&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Please do not hesitate to contact me if there is a particular subject you would like covered in a future blog post.&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

</description>
      <category>overthewire</category>
      <category>pentesting</category>
      <category>security</category>
      <category>infosec</category>
    </item>
    <item>
      <title>Creepin' with Maltego</title>
      <dc:creator>R̶E̶D̶A̶C̶T̶E̶D̶</dc:creator>
      <pubDate>Mon, 30 Sep 2019 04:25:38 +0000</pubDate>
      <link>https://forem.com/didymus/creepin-with-maltego-2h4o</link>
      <guid>https://forem.com/didymus/creepin-with-maltego-2h4o</guid>
      <description>&lt;p&gt;If you are not familiar with the acronym OSINT it stands for Open-Source INTelligence. This is data gathered from overt and publicly available sources. Do not make the mistake in thinking that just because the information is not obtained through covert, clandestine, or Secret Squirrel means that it is not valuable or actionable. It may have gone by different names but OSINT has been around for hundreds of years. These techniques have been the stock-in-trade of national security analysts, law enforcement agents, private investigators, business intelligence professionals, and even hackers.&lt;/p&gt;

&lt;p&gt;The information flow of OSINT sources can be broken down essentially to legacy media, internet, public government data, professional and academic publications, commercial data, and what is known as grey literature. Grey literature just refers to things like technical reports, preprints, patents, working papers, business documents, unpublished works, and newsletters.&lt;/p&gt;

&lt;p&gt;Maltego is an extremely powerful proprietary OSINT and forensic tool developed by Paterva. If you ever thought that Data Structures sprint at Operation Spark would not ever be useful, well, you would be wrong. Maltego presents the data visually in graph format, suitable for link analysis and data mining. However, the real power in Maltego is its library of customizable transforms. These transforms are like a combination between an API pull request and a sorting algorithm. They are small pieces of code that fetch related information for a given input. The output of these transforms is designed to be extensible so that other transforms can be run on it. They are also designed to return the smallest piece of information possible. You may be wondering why someone would want the smallest piece of information possible to be returned. The more the merrier right? Well, take the following example from the Maltego documentation:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WOX6_LUg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/qupn7k778g684fpudl3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WOX6_LUg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/qupn7k778g684fpudl3t.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aZPmvr7R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hlb6u0b7pfbw8bm8xitb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aZPmvr7R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/hlb6u0b7pfbw8bm8xitb.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
"The graph at the top has a whole layer less, whilst showing the same information. Using the second graph allows the analyst to quickly look at things like all the services running on port 80. Doing the same on the graph at the top would mean you would have to traverse up the tree to the IP addresses and then down again to the services giving you other services that are not running on port 80. Modelling your data correctly is a very important step in the process of building your own custom transforms. It is advised to give this step some thought before moving on with actually writing code for your transforms."&lt;/p&gt;

&lt;p&gt;In other words, it's like asking the super computer Deep Thought the answer to life, the Universe, and everything... and getting 42. You have to know the questions to ask in order to gain useful answers. Much of the skill in using Maltego is asking the right questions.&lt;/p&gt;

&lt;p&gt;Maltego can provide a core picture of an organizations network architecture. It arranges data from API pull requests into a visual format to illustrate useful relationships. This is an automated process that is far more efficient than any Google search. For instance, from a website you can identify tracking URLs. From this information you can identify other websites owned by the same organization and tracked with the same codes. Next, you can look up the DNS information. This would tell you which servers are pointing to the actual IP address that the website is hosted on. It will even tell you of other websites hosted with the same DNS server which may also belong to that organization. From the DNS server you can identify the MX server and the name server. You can explore the net block and find additional services or websites within the organization. Eventually, if you ask the right questions, you will discover the AAS number. All of this is automated and in an easy-to-read visual format. The format of the presented material is also important because it allows one to recognize useful relationships between nodes that may have otherwise been missed if only viewed through a terminal.&lt;/p&gt;

&lt;p&gt;So as we have learned Maltego can be an invaluable tool to digital forensic and penetration testing specialists. Maltego can do much more than network mapping. Perhaps in an upcoming post I will write on the topic again. In the meantime I hope you enjoyed this post and follow me if you wish to stay tuned.&lt;/p&gt;

&lt;p&gt;Maltego training video for absolute beginners:&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=sP-Pl_SRQVo"&gt;https://www.youtube.com/watch?v=sP-Pl_SRQVo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>maltego</category>
      <category>osint</category>
      <category>pentesting</category>
      <category>security</category>
    </item>
  </channel>
</rss>
