<?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>DEV Community: 64bitCoder</title>
    <description>The latest articles on DEV Community by 64bitCoder (@64bit_coder).</description>
    <link>https://dev.to/64bit_coder</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%2F685049%2F4615a130-3834-49d3-a9a5-c8186df1c89e.jpg</url>
      <title>DEV Community: 64bitCoder</title>
      <link>https://dev.to/64bit_coder</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/64bit_coder"/>
    <language>en</language>
    <item>
      <title>TryHackMe- Juicy Details Room</title>
      <dc:creator>64bitCoder</dc:creator>
      <pubDate>Sat, 14 Aug 2021 08:46:57 +0000</pubDate>
      <link>https://dev.to/64bit_coder/tryhackme-juicy-details-room-1jcd</link>
      <guid>https://dev.to/64bit_coder/tryhackme-juicy-details-room-1jcd</guid>
      <description>&lt;p&gt;Hi Everyone.This is my first post on dev.to . This post is dedicated to the attack enumeration and analysis of the Easy room "Juciy Details" on Tryhackme. You can solve this room for free @ &lt;a href="https://tryhackme.com/room/juicydetails"&gt;https://tryhackme.com/room/juicydetails&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Special Thanks to &lt;a class="mentioned-user" href="https://dev.to/kkaosninja"&gt;@kkaosninja&lt;/a&gt;
 for making me aware of this amazing platform.&lt;/p&gt;

&lt;p&gt;In this room we are provided with a .zip file which contains 3 .log files. We have to study and enumerate these in order to analyze the attack.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UCNsD-NF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0c2wczpkujfm7r7xjx4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UCNsD-NF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0c2wczpkujfm7r7xjx4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Coming to the Tasks which we are asked to solve.&lt;/p&gt;

&lt;p&gt;Task1: The solution for this task is already mentioned in the description of the task.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Task2:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q1) What tools did the attacker use? (Order by the occurrence in the log)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Solution: On studying the access.log file,we observe:&lt;/p&gt;

&lt;p&gt;Line2) &lt;code&gt;::ffff:192.168.10.5 - - [11/Apr/2021:09:08:34 +0000] "POST / HTTP/1.1" 200 1924 "-" "Mozilla/5.0 (compatible; Nmap Scripting Engine; https://nmap.org/book/nse.html)"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Tool 1: Nmap&lt;/p&gt;

&lt;p&gt;Line208) &lt;code&gt;::ffff:192.168.10.5 - - [11/Apr/2021:09:16:27 +0000] "GET /rest/user/login HTTP/1.0" 500 - "-" "Mozilla/5.0 (Hydra)"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Tool 2: Hydra&lt;/p&gt;

&lt;p&gt;Line550) &lt;code&gt;::ffff:192.168.10.5 - - [11/Apr/2021:09:29:14 +0000] "GET /rest/products/search?q=1 HTTP/1.1" 200 - "-" "sqlmap/1.5.2#stable (http://sqlmap.org)"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Tool 3: Sqlmap&lt;/p&gt;

&lt;p&gt;Line631) &lt;code&gt;::ffff:192.168.10.5 - - [11/Apr/2021:09:32:51 +0000] "GET /rest/products/search?q=qwert%27))%20UNION%20SELECT%20id,%20email,%20password,%20%274%27,%20%275%27,%20%276%27,%20%277%27,%20%278%27,%20%279%27%20FROM%20Users-- HTTP/1.1" 200 3742 "-" "curl/7.74.0"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Tool 4: curl&lt;/p&gt;

&lt;p&gt;Line632) &lt;code&gt;::ffff:192.168.10.5 - - [11/Apr/2021:09:34:33 +0000] "GET /a54372a1404141fe8842ae5c029a00e3 HTTP/1.1" 200 1924 "-" "feroxbuster/2.2.1"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Tool 5: Feroxbuster&lt;/p&gt;

&lt;p&gt;(Make sure you write the tools in the correct order and in the mentioned pattern in the answer box. )&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q2) What endpoint was vulnerable to a brute-force attack?&lt;br&gt;
Solution:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Line208) &lt;code&gt;::ffff:192.168.10.5 - - [11/Apr/2021:09:16:27 +0000] "GET /rest/user/login HTTP/1.0" 500 - "-" "Mozilla/5.0 (Hydra)"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In the above snippet we see that the attacker has discovered a login path where he starts a brute-force attack using Hydra.&lt;br&gt;
This &lt;strong&gt;path&lt;/strong&gt; is the vulnerable endpoint.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q3)What endpoint was vulnerable to SQL injection?&lt;/strong&gt;&lt;br&gt;
Solution: &lt;br&gt;
Line550) &lt;code&gt;::ffff:192.168.10.5 - - [11/Apr/2021:09:29:14 +0000] "GET /rest/products/search?q=1 HTTP/1.1" 200 - "-" "sqlmap/1.5.2#stable (http://sqlmap.org)"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The attacker used this vulnerable endpoint to perform a sql injection attack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q4) What parameter was used for the SQL injection?&lt;/strong&gt;&lt;br&gt;
Solution: &lt;code&gt;q&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q5)What endpoint did the attacker try to use to retrieve files? (Include the /)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Solution: &lt;br&gt;
Line640) &lt;code&gt;::ffff:192.168.10.5 - - [11/Apr/2021:09:34:33 +0000] "GET /ftp HTTP/1.1" 200 4852 "-" "feroxbuster/2.2.1"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After discovering the '/ftp' directory by feroxbuster,the attacker used this &lt;strong&gt;path&lt;/strong&gt; to retrieve files.&lt;/p&gt;

&lt;p&gt;This is it for Task 2. Lets move to Task 3.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Task 3&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Q1) What section of the website did the attacker use to scrape user email addresses?&lt;/strong&gt;&lt;br&gt;
Solution) &lt;code&gt;GET /rest/products/13/reviews HTTP/1.1&lt;/code&gt;&lt;br&gt;
This is the place where customers usually comment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q2) Was their brute-force attack successful? If so, what is the timestamp of the successful login? (Yay/Nay, 11/Apr/2021:09:xx:xx +0000)&lt;/strong&gt;&lt;br&gt;
Solution: &lt;br&gt;
Line495) &lt;code&gt;::ffff:192.168.10.5 - - [11/Apr/2021:09:16:32 +0000] "POST /rest/user/login HTTP/1.0" 401 26 "-" "Mozilla/5.0 (Hydra)"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This is the snippet which shows the successful login attempt by hydra.&lt;br&gt;
So, Yes this method was effective as the attacker was successful in logging.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q3) What user information was the attacker able to retrieve from the endpoint vulnerable to SQL injection?&lt;/strong&gt;&lt;br&gt;
Solution:&lt;br&gt;
Line631) ::ffff:192.168.10.5 - - [11/Apr/2021:09:32:51 +0000] "GET /rest/products/search?q=qwert%27))%20UNION%20SELECT%20id,%20&lt;code&gt;email&lt;/code&gt;,%20&lt;code&gt;password&lt;/code&gt;,%20%274%27,%20%275%27,%20%276%27,%20%277%27,%20%278%27,%20%279%27%20FROM%20Users-- HTTP/1.1" 200 3742 "-" "curl/7.74.0"&lt;/p&gt;

&lt;p&gt;Observing the above snippet of access.log file, we see that the attacker was able to successfully get the &lt;strong&gt;email&lt;/strong&gt; and &lt;strong&gt;password&lt;/strong&gt; .&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q4) What files did they try to download from the vulnerable endpoint? (endpoint from the previous task, question #5)&lt;/strong&gt;&lt;br&gt;
Solution: &lt;br&gt;
Line37) &lt;code&gt;Sun Apr 11 09:35:45 2021 [pid 8154] [ftp] OK DOWNLOAD: Client "::ffff:192.168.10.5", "/**www-data.bak**", 2602 bytes, 544.81Kbyte/sec&lt;/code&gt;&lt;br&gt;
Line38) &lt;code&gt;Sun Apr 11 09:36:08 2021 [pid 8154] [ftp] OK DOWNLOAD: Client "::ffff:192.168.10.5", "/**coupons_2013.md.bak**", 131 bytes, 3.01Kbyte/sec&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;These are the two files (in bold) which were retrieved by the attacker.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q5) What service and account name were used to retrieve files from the previous question? (service, username)&lt;/strong&gt;&lt;br&gt;
Solution: &lt;/p&gt;

&lt;p&gt;For this we have to look into the vsftpd.log file.&lt;br&gt;
Line8) &lt;code&gt;Sun Apr 11 08:15:58 2021 [pid 6526] [ftp] OK LOGIN: Client "::ffff:127.0.0.1", anon password "?"&lt;/code&gt;&lt;br&gt;
  The attacker used &lt;strong&gt;ftp&lt;/strong&gt; service with an &lt;strong&gt;anonymous&lt;/strong&gt; login.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Q6) What service and username were used to gain shell access to the server? (service, username)&lt;/strong&gt;&lt;br&gt;
Solution: &lt;/p&gt;

&lt;p&gt;Moving to auth.log,&lt;/p&gt;

&lt;p&gt;Line1) &lt;code&gt;Apr 11 09:38:29 thunt sshd[8162]: Failed password for www-data from 192.168.10.5 port 40066 ssh2&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This clearly shows that the attacker was trying to gain a shell by using &lt;strong&gt;ssh&lt;/strong&gt; with a username &lt;strong&gt;www-data&lt;/strong&gt; .&lt;/p&gt;

&lt;p&gt;Thats All for this room. Congratulations on completing the room. &lt;br&gt;
See you all in the next post.&lt;br&gt;
Join Me on TryHackMe: &lt;a href="https://tryhackme.com/p/64bitCoder"&gt;https://tryhackme.com/p/64bitCoder&lt;/a&gt;&lt;br&gt;
Love-Peace-Hack &amp;lt;3&lt;/p&gt;

</description>
      <category>tryhackme</category>
      <category>juicydetails</category>
      <category>thm</category>
      <category>blueteam</category>
    </item>
  </channel>
</rss>
