<?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 Christof on Medium]]></title>
        <description><![CDATA[Stories by Christof on Medium]]></description>
        <link>https://medium.com/@chryb3r?source=rss-93493c82db29------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aYS7bJ8ZBpRh1NTjqXMA7Q@2x.jpeg</url>
            <title>Stories by Christof on Medium</title>
            <link>https://medium.com/@chryb3r?source=rss-93493c82db29------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 08:30:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chryb3r/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[Instant — HackTheBox Writeup]]></title>
            <link>https://medium.com/@chryb3r/instant-hackthebox-writeup-2af0a9fa13a9?source=rss-93493c82db29------2</link>
            <guid isPermaLink="false">https://medium.com/p/2af0a9fa13a9</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[red-team]]></category>
            <category><![CDATA[reverse-engineering]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <dc:creator><![CDATA[Christof]]></dc:creator>
            <pubDate>Sat, 01 Mar 2025 20:15:39 GMT</pubDate>
            <atom:updated>2025-03-01T20:15:39.352Z</atom:updated>
            <content:encoded><![CDATA[<h3>Instant — HackTheBox Writeup</h3><p>The steps that I took to complete this box. Follow along!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*k5cG3meDuk-yuYYpeiLABQ.png" /><figcaption>Instant</figcaption></figure><h4>Information</h4><ul><li>Difficulty: Medium</li><li>Machine: Linux</li><li>Techniques: Enumeration, Reverse Engineering, API Testing &amp; File Decryption</li><li>Tools: Nmap, MobSF, APKtool, BurpSuite &amp; SolarPuttyCracker.py</li></ul><h4>Setup</h4><ul><li>Spawn the machine and connect to it using the attack machine. Kali in my case.</li><li>I always begin a box by running Nmap to scan for open ports and potential vulnerabilities with sudo nmap -sC -sV 10.10.11.37 -oA Instant</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*Bsn9CKjXU5nVYYoIj8KmtQ.png" /><figcaption>Nmap scan results</figcaption></figure><ul><li>The output shows that SSH (port 22) and port 80 (HTTP) is open. Port 80 has a site being hosted at <a href="http://instant.htb/">http://instant.ht</a>b/. I added this domain to the /etc/hosts/ file.</li><li>Next, I opened my Firefox browser in Kali and went to the site to check it out. On the webpage, there wasn’t much functionality outside of the Download Now option. I performed some directory brute forcing with Gobuster just to ensure I wasn’t missing anything. Since nothing of interest was found, I hit the Download Now button.</li><li>An instant.apk file was downloaded to my machine. Since I had no prior knowledge of this type of file, I turned to Google. In summary, I learned that a .apk (Android Package Kit) file is used to install apps on Android devices containing all of the files needed to run the app.</li><li>To see the contents of this file, I had to turn to Google again which revealed that this type of file can be reverse engineered using tools such as MobSF and the APKTool. I love checking out new tools so I installed both.</li><li>I moved the .apk file from the Downloads folder to my working directory for ease of use and run MobSF (docker version). Command: sudo docker run -it — rm -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest</li><li>The output should provide the URL to access the tool as well as the username and password</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6fxwDeIP_kST3ikVdTGYBA.png" /><figcaption>MobSF up and running</figcaption></figure><ul><li>Once logged in, select Upload &amp; Analyze and select the instant.apk file for analysis. The process will take a few mins.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*s74meuvXA5-ZKD1ygY8pig.png" /><figcaption>Analysis underway</figcaption></figure><ul><li>While that’s running, I used APKtool’s decompile module to extract the data from the file and output to a folder I can navigate and grep (important later). Command: apktool d instant.apk -o instant</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*dtpxDWs4TneiRHxK7KBjtA.png" /><figcaption>APKtool running</figcaption></figure><ul><li>Back to MobSF (i’ll call MSF for short), the file is fully analyzed and the page is a beautiful UI with loads of data to parse through. Scrolling through MSF “Possible Hardcoded Secrets” piqued my interest immediately.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TOhkOGvcMtMNalgT1ZyDPQ.png" /><figcaption>Oooh what’s this?? A JWT token?</figcaption></figure><ul><li>I was familiar with JWT tokens so I immediately understood what it was. JSON Web Tokens, or JWT(s), are strings used to communicate the identity and authorization data of a user between applications. JWTs can sometimes be decoded to reveal credentials and user roles.</li><li>This JWT token was incomplete though as it’s usually broken up into 3 parts. The portion revealed under Possible HardCoded Secrets is only the payload with auth information. The other 2 parts include a header and signature with all 3 being separated by a . The full token is found within the AdminActivities.java file under Code Analysis. Copy the whole thing.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A4LchF5n60gKuRkTUaZYpQ.png" /><figcaption>An API &amp; full admin JWT token</figcaption></figure><ul><li>All files under Code Analysis also includes APIs that perform a variety of functions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*HPHNXUYEOxkypJGkTSR2gA.png" /><figcaption>Files with APIs</figcaption></figure><ul><li>Each one found:</li><li><a href="http://mywalletv1.instant.htb/api/v1/view/profile">http://mywalletv1.instant.htb/api/v1/view/profile</a><br><a href="http://mywalletv1.instant.htb/api/v1/login">http://mywalletv1.instant.htb/api/v1/login</a><br><a href="http://mywalletv1.instant.htb/api/v1/register">http://mywalletv1.instant.htb/api/v1/register</a><br><a href="http://mywalletv1.instant.htb/api/v1/initiate/transaction">http://mywalletv1.instant.htb/api/v1/initiate/transaction</a><br><a href="http://mywalletv1.instant.htb/api/v1/confirm/pin">http://mywalletv1.instant.htb/api/v1/confirm/pin</a></li><li>Next, I proceeded to decode the token to reveal it’s contents. A number of tools and Burp extensions can do this but I chose <a href="https://jwt.io/">jwt.io</a>.</li><li>Decoding the JWT reveals algorithm, the payload and signature. The juicy details here is obviously the fact that this is an admin token verified by the role. Jwt this token down (get it? 😁)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hQm4aIFYnsJ8I6Se59Szcw.png" /></figure><ul><li>These APIs are not accessible by just going to them in the browser. One more piece of information was missing that I could not find so I turned the file output by APKTool.</li><li>I ran grep to search through the files looking for the Swagger UI that is usually used to interact with APIs. Command: grep -r “swagger” instant</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*RWzQZCN15Tbmfmqhe0SyeQ.png" /><figcaption>Swagger found</figcaption></figure><ul><li>Next, I added this subdomain to /etc/hosts/ right next to the instant.htb domain so I can access it in the browser. The entry should look like this: 10.10.11.37 instant.htb swagger-ui.instant.htb</li><li>On the webpage, there are 3 categories: Users, Logs and Transactions. I took a quick look at the type of request, the path and the description. The lock indicated that those APIs required authentication first before use.</li><li>I first hit Authorize which needed the JWT token I found using MSF. Now I am authorized as “Admin”. All APIs changes from grey open locks to black closed locks.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-pykWoEFEYyzqjTWpLR5Yg.png" /><figcaption>Click Authorize</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*Bbe3xm-T5ryTwJJZjB5pNA.png" /><figcaption>Paste the token &amp; Authorize</figcaption></figure><ul><li>After Authorizing, the first API that I tried out (click Try it out and Execute) first was /api/v1/admin/list/users to enumerate who are the users on the machine. Results revealed two users: instantAdmin and shirohige.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7uPea4FKzKAfGer0ouJ48A.png" /><figcaption>Users</figcaption></figure><ul><li>After, I tested each API but noticed something interesting about the /api/v1/admin/view/logs API. The output is a log file from a log folder in shirohige’s home directory. This indicates there is a possible path traversal vulnerability here.</li></ul><h4>Exploiting the vulnerability</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lwn-M3Nnzkm4DNRi27kdCg.png" /><figcaption>Shirohige’s log</figcaption></figure><ul><li>The /api/v1/admin/view/logs only allows viewing what’s in the log folder but I found quickly that the actually vulnerable API was /api/v1/admin/read/logs which allows reading any file (not just logs) within shirohige’s home directory.</li><li>Entering the 1.log file display it’s contents.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yvEHTnnGnD7yMC26Cn3xdQ.png" /><figcaption>1.log file contents</figcaption></figure><ul><li>Typical testing of a path traversal vulnerability involves checking to see if the sensitive /etc/passwd file is readable. I received a 500 internal server error response so I decided to do some troubleshooting with Burp (you can skip this part, just showing how I troubleshooted this issue).</li></ul><h4>Troubleshooting using Burpsuite (skippable)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dsx3krlHKD5jiopCzLIS8Q.png" /></figure><ul><li>I opened Burp and copied the curl command above Request URL. I added the --proxy to run the request through Burp so I could send it to Intruder for automation purposes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pKyX3-CxP6dVNrVl2JVJ-w.png" /><figcaption>Running request through Burp</figcaption></figure><ul><li>Next, I sent the request to Burp Intruder setting the path as the payload position and using the LFI-JHaddix.txt wordlist from SecLists.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7cyjkoH8chBFl-h4BYYlAg.png" /><figcaption>Payload position</figcaption></figure><ul><li>Using Intruder to automate the process was successful in reading the file. I noticed that my problem was not backing up one more directory 🤦‍♂️ but troubleshooting and knowing where I went wrong is apart of the learning experience.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Byn5ozlvpttK6ONhApe1Q.png" /><figcaption>/etc/passwd file contents in response</figcaption></figure><h4>User Flag</h4><ul><li>Back to Swagger, entering ../../../etc/passwd in the /api/v1/admin/read/log API responds with the file contents.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10Uy-vRfUZztHpkjWogI-w.png" /><figcaption>Response via Swagger API</figcaption></figure><ul><li>(As a fan of the anime, this was a nice One Piece reference by the box creator 🔥)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yqg3MdVxrrDFe-N7KgK-uA.png" /><figcaption>One Piece reference</figcaption></figure><ul><li>Since shirohige is the only confirmed user on this machine and it’s possible to read any file they own, getting the user flag is simple using ../../../home/shirohige/user.txt</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*suMsqWyw0J37HxB4AVlo7Q.png" /><figcaption>User flag captured</figcaption></figure><h4>Privilege Escalation</h4><ul><li>The Nmap scan earlier on revealed that only ports 22 and 80 were open. Using the LFI vulnerability, I was able to read the SSH key files for shirohige.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5bXAy9i7y7eBQXqE4Jb5ow.png" /><figcaption>Private Key</figcaption></figure><ul><li>I proceed to copy the private key and removed the unnecessary formatting like /n.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E_OotV8haWB_qtxe94Y8Ew.png" /><figcaption>Saving private key, no formatting</figcaption></figure><ul><li>I pasted the key into a file I created on my machine called “id_rsa”.</li><li>Next, I ran the command chmod 600 id_rsa which is typical file permissions for sensitive files.</li><li>Time to SSH into the Instant machine as shirohige using ssh -i id_rsa shirohige@10.10.11.37</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*DgGwEZFo3kvg3-rGBId2Ag.png" /><figcaption>SSH</figcaption></figure><ul><li>I proceeded to look around using ls . Apart from the user.txt file, there is a project directory and the logs directory that holds the 1.log file. There was nothing interesting in the project directory so I decided to poke around outside of shirohige’s home folder.</li><li>I stumbled onto the /opt directory that held a backups folder. In the backups folder was a Solar-PuTTY folder with a sessions.-backup.dat file.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*TloQnsqLRNfDn_6s45GgAA.png" /><figcaption>backup file</figcaption></figure><ul><li>I am familiar with the Windows tool PuTTY but was unfamiliar with PuTTY so I did some GooglFu and found out it’s basically an enhanced version of PuTTY created by SolarWinds.</li><li>Backup files can contain credentials so I set up a python (confirmed the box has python3 installed using python3command) server from the Solar-PuTTY folder so I can download the file to my working directory in Kali.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k8OX909f9mB5jv2HurkfAw.png" /><figcaption>Downloading file</figcaption></figure><ul><li>Running nano the file was not in a human readable format due to encryption. I turned to Google again where I found the <a href="https://github.com/ItsWatchMakerr/SolarPuttyCracker">Solar-PuTTYCracker.py</a> tool which is used to decrypt SolarPuTTY file. I downloaded the script and moved it to my working directory. After, I ran the command python3 SolarPuttyCracker.py -w /usr/share/wordlists/john.lst sessions-backup.dat -o /home/chryber/HTB/Instant/cracked.txt -v using the wordlist from the JohntheRipper tool and outputting the data to the cracked.txt file.</li><li>The backup file was successfully decrypted using the password estrella</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ocdQFJWLRXWf68Nt7nipEA.png" /><figcaption>Running SolarPuTTYCracker</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*mzrZo8DfY-ViCD8mPoazcg.png" /><figcaption>Decryption completed!</figcaption></figure><ul><li>Sidenote: Ran into a python error when first running the SolarPuTTY script where the python module “Crypto” could not be found. Reading the script and researching Google, it seems it has been updated to Cryptodome so I modified the script which fixed the issue.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*y4h6a8gfiokKLbFqyKlrFQ.png" /><figcaption>Lines 25–27 from original script</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*zwkANklCBtSLSGMGPw9g4Q.png" /><figcaption>Fixed lines 25–27 after download</figcaption></figure><ul><li>Usingless cracked.txtreveals the the root credentials.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*Yh8DUCexhqoHeT_HfPOkmA.png" /><figcaption>Root creds!</figcaption></figure><ul><li>Back to shirohige’s SSH session, I ran su root and entered the password from the decrypted file which was a success. Time to get the trophy: root.txt.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*F7vs9yWwumodMe1lhaQDVw.png" /><figcaption>Rooted!</figcaption></figure><h4>End Notes</h4><p>Instant is one of my favorite machines, as it allowed me to learn about useful tools such as MobSF and AKTool while deepening my understanding of the reverse engineering process. The vulnerabilities exploited on this box highlight the importance of developers refraining from hardcoding sensitive data within files and packages that can be easily decrypted or reverse-engineered. Additionally, APIs need to be properly secured to ensure they do not explicitly trust user input.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2af0a9fa13a9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cicada — HackTheBox Writeup]]></title>
            <link>https://medium.com/@chryb3r/cicada-hackthebox-writeup-44ce0910410b?source=rss-93493c82db29------2</link>
            <guid isPermaLink="false">https://medium.com/p/44ce0910410b</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[active-directory]]></category>
            <category><![CDATA[hackthebox-writeup]]></category>
            <category><![CDATA[network-security]]></category>
            <dc:creator><![CDATA[Christof]]></dc:creator>
            <pubDate>Fri, 28 Feb 2025 00:46:10 GMT</pubDate>
            <atom:updated>2025-02-28T04:49:16.714Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cicada — HackTheBox Writeup</h3><p>The steps that I took to complete this box. Follow along!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*WnkLyK7Da5AVgp8JYV6vIQ.png" /></figure><h4>Information:</h4><ul><li>Difficulty: Easy</li><li>Machine: Windows (Active Directory)</li><li>Techniques: Enumeration, Brute Forcing, Privilege Escalation</li><li>Tools: Nmap, SMBClient, SMBMap, NetExec, Evil-WINRM, &amp; Impacket</li></ul><h4>Setup:</h4><ul><li>Spawn the machine and connect the attack machine, Kali in my case, via OpenVPN.</li><li>Once the machine is up and running, I started with an Nmap scan with the -sV and -sC flags to scan for vulnerabilities as well as open ports. The -oA flag will output to the 3 different file types (.gnmap, .nmap and .xml) for further review if needed later on. Tip: gnmap stands for greppable nmap with allows for easy search using the CLI tool grep.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*ewJ154Jd1Q94TirVj5RFgA.png" /><figcaption>Nmap scan results</figcaption></figure><ul><li>The output show a number of ports open, most notably Kerberos on port 80, LDAP on port 389 and SMB on port 445. All signs point to this machine being an Active Directory environment which also confirms it is running Windows (Service Info reveals this as well). LDAP enumeration reveals the domain is cicada.htb with DNS CICADA-DC.cicada.htb.</li><li>Next, I added the domain to my /etc/hosts file with sudo nano /etc/hosts</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*0WNTXyQTt7a96wr4xrATlg.png" /><figcaption>Adding domain to /etc/hosts so IP can be resolved</figcaption></figure><h4>Enumeration</h4><ul><li>SMB is open so it’s a great place to start looking for information such as credentials. SMBClient is a nice tool for the job when it comes to enumerating. No workgroup password needed, hit Enter.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*xDh6Ze115Az_jHFqA-MhnQ.png" /><figcaption>Enumerating SMB Shares</figcaption></figure><ul><li>Results show the various SMB Shares on the machine. Typically, ADMIN$, C$, IPC$, NETLOGON and SYSVOL shares can be found when enumerating SMB but DEV and HR seems particular to this machine. Next is to try and connect to each share using smbclient \\\\10.10.11.35\\DEV and smbclient \\\\10.10.11.35\\HR</li><li>Using the dir command in the DEV share resulted in the NT_STATUS_ACCESS_DENIED error indicating that I do not have authorization to see what’s in the share currently. Moving onto the HR share, running dir list the contents of the present working directory and reveals and interesting file <em>Notice from HR.txt</em>.</li><li>I downloaded the file to my Kali using the get &quot;Notice from HR.txt&quot; command. Putting this is quotes is key as the spaces will infer that these are separate command (or files) when they are not. More on this <a href="https://learn.microsoft.com/en-us/troubleshoot/windows-server/setup-upgrade-and-drivers/filenames-with-spaces-require-quotation-mark">here</a>.</li><li>Reading the file using cat reveals a default password but no username. I jot down the password <strong>Cicada$M6Corpb*@Lp#nZp!8 </strong>and proceeded to finding the user.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DImUPNHeSY_3UPXwSKOaSQ.png" /><figcaption>Welcome file with default password</figcaption></figure><ul><li>Now that a password has been found, it’s time for some password spraying to try and match it with a user within the domain. The very handy Netexec tool is used with anonymous login and the — rid-bruteflag to brute force the RID revealing the users. Command: nxc smb 10.10.11.35 -u ‘anonymous’ -p ‘’ — rid-brute</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*inUcfmyc5LxVfJgToAbKyQ.png" /><figcaption>List of users</figcaption></figure><ul><li>Next, the spray. I created a file with the found usernames. Administrator can be added but highly doubt this box will be that easy. I named the file usernames.txt. Running Netexec, I enumerated the user with this password usingt the command nxc smb 10.10.11.35 -u usernames.txt -p ‘Cicada$M6Corpb*@Lp#nZp!8’</li><li>The output shows a green + icon for user michael.wrightson indicating successful login via SMB.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4IzPrGXzRa8Tlj80G981HA.png" /><figcaption>Successful login</figcaption></figure><ul><li>So far, this AD environment has not followed secure password protection policies with a default password being found in a file share. Sometimes users, will leave reminders on the password for an account. This is seen after running command nxc smb 10.10.11.35 -u ‘michael.wrightson’ -p ‘Cicada$M6Corpb*@Lp#nZp!8’ --users</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ipdXryBZ77p_653A6pw1w.png" /><figcaption>User password left in password description</figcaption></figure><ul><li>So far, two sets of credentials have been collected <strong>michael.wrightson:Cicada$M6Corpb*@Lp#nZp!8 and david.orelious:aRt$Lp#7t*VQ!3</strong></li><li>Back to SMB, I decided to check what privileges that these users may have on the shares that I was unable to enumerate previously. Once I have credentials, I like to use SMBMap for better visuals. I started with the last set of credentials obtained and checked the Dev share. Command:smbmap -H 10.10.11.35 -r DEV -u ‘david.orelious’ -p ‘aRt$Lp#7t*VQ!3’ — depth 4</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*PvZLyfkaQyouw4GPD-RCgA.png" /><figcaption>SMBMap output</figcaption></figure><ul><li>Looking at the output, david.orlious has READ ONLY access to all shares except ADMIN$ and C$. The good news is that there is a share available that I didn’t have access to before but the bad news is that the user David does not have the most elevated privileges. In the DEV share, there is a script Backup_script.ps1 which I proceeded to check.</li><li>I ran SMBMap again with the --download flag and file name which allowed me to download to my present working directory, HTB/Cicada. Command: smbmap -H 10.10.11.35 -r DEV -u ‘david.orelious’ -p ‘aRt$Lp#7t*VQ!3’ --download ‘DEV/Backup_script.ps1’</li><li>Reading the file reveals SMB backup information with another username <strong>emily.oscars </strong>and password <strong>Q!3@Lp#M6b*7t*Vt</strong></li><li>Again, I ran the same SMBMap command but replacing the credentials to see what user emily has access to. Woow! She has READ ONLY access to the admin and c share. From the comments on the admin share, emily is able to remote in.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/855/1*zdiJkLldvH3__Mm6jShX8g.png" /><figcaption>SMBMap output using Emily’s credenitals</figcaption></figure><h4>User Flag</h4><ul><li>Since emily’s credentials are obtained, the next step is to try and use a tool to remote into the machine. I used Evil-WINRM for this purpose.</li><li>Next, navigation to the Desktop of the user where I used the type user.txt command to get the flag.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rf7stVrPjaRvcpveO_cl8Q.png" /><figcaption>user flag</figcaption></figure><h4>Privilege Escalation</h4><ul><li>When pentesting windows machines, it is good practice to check a user’s privielges when a foothold is achieved. I ran whoami /priv to see what privileges emily has.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*dPXzzPDBvF49ghLyGrAh9A.png" /><figcaption>Emily privileges</figcaption></figure><ul><li>Doing some Googles on each privilege revealed that the SeBackupPrivilege allows a user or service to read files and directories regardless of the security features on those objects. These objects can even be backed up or copied under certain circumstances.</li><li>Using the steps found <a href="https://github.com/nickvourd/Windows-Local-Privilege-Escalation-Cookbook/blob/master/Notes/SeBackupPrivilege.md">here</a> I created a Temp directory, copied the SAM and SYSTEM files which contains the credentials of all users on the machine and download these files to my Kali working directory.</li></ul><pre>cd c:\<br><br>mkdir Temp<br><br>reg save hklm\sam c:\Temp\sam<br><br>reg save hklm\system c:\Temp\system<br><br>cd Temp<br><br>download sam<br><br>download system</pre><ul><li>Delete the Temp file after (cleanup is important). Files should be in the working directory.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/692/1*ypvnlRVDvkuEMWN--UgPIg.png" /><figcaption>SAM and System</figcaption></figure><ul><li>Next, I used Impacket’s secretsdump tool to dump these user creds. Command: impacket-secretsdump -sam sam -system system LOCAL</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/833/1*dMRTJ7SZdRYw4NufT9najA.png" /><figcaption>Dump</figcaption></figure><ul><li>Now that I have the admin’s NTLM hash, I can use this to remote in using Evil-WINRM. For this command though, instead of using the -p flag for password, I replaced it using the -H flag for hash. The NT hash is all that’s needed. Command: evil-winrm -i 10.10.11.35 -u ‘Administrator’ -H 2b87e7c93a3e8a0ea4a581937016f341</li><li>After a few moments, the connection is made and I am in as Administrator. Time to navigate to the root.txt flag.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FDz4_ioC6tLYOtsyGr_FgQ.png" /><figcaption>Machine rooted!!</figcaption></figure><p><strong>End Notes</strong></p><p>Cicada is an easy box demonstrating the risks of storing plaintext credentials in locations that attackers can enumerate. Proper password security means avoiding password storage in files and ensuring users understand not to write down their passwords — or, in this case, include them in the password description when creating one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=44ce0910410b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pickle Rick — TryHackMe’s Rick & Morty Room]]></title>
            <link>https://medium.com/@chryb3r/pickle-rick-tryhackmes-rick-morty-room-0083c5ad6f9f?source=rss-93493c82db29------2</link>
            <guid isPermaLink="false">https://medium.com/p/0083c5ad6f9f</guid>
            <category><![CDATA[web-app-pentesting]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[ctf-walkthrough]]></category>
            <category><![CDATA[rick-and-morty]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[Christof]]></dc:creator>
            <pubDate>Wed, 17 Apr 2024 02:35:28 GMT</pubDate>
            <atom:updated>2024-04-17T02:35:28.433Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pickle Rick — TryHackMe’s Rick &amp; Morty Room</h3><p>I was never a fan of the show, Rick and Morty, but thought this CTF was interesting enough to try out. Web app hacking! Lets get to it.</p><h3><strong>Intro:</strong></h3><p>I launched the machine and started Kali Linux. I then connected to THM using OpenVPN.</p><h3><strong>Recon:</strong></h3><ul><li>When testing a web app, the best thing to do first is to… go to the site!</li><li>On the homepage, there is a message from Rick to Morty. Short story even shorter, Rick has turned himself into a pickle and needs help getting the recipe for his reverse pickle potion. The issue is that the recipe is on his computer which he has forgotten the password for. He now needs Morty’s help (us) to get the password and obtain the 3 secret ingredients.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-c8w7HyBNbXeslTylzX1TA.png" /><figcaption>Rick in trouble!</figcaption></figure><ul><li>The homepage is very simple with an image of Rick but my first thought was to check the page source to see if there is anything there. Bam! There is a self note from Rick with the username for the computer. Jot that down.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1D7-fXlMTlKbRshc9CrSaw.png" /><figcaption>HTML page</figcaption></figure><ul><li>Rick’s message included BURP twice, especially in the 2nd sentence. This sounds like a hint to use the popular web app testing framework Burpsuite.</li><li>I opened Burp and set the ip for the machine as the target while filtering out all other traffic. Burp did not show an additional endpoints, only js files which I viewed briefly.</li><li>Next, I added /admin to the URL which resulted in an error. Errors aren’t always a bad thing in this case. I was able to determine that the web server running is Apache 2.4.18.</li><li>While analyzing the html, I noticed that the image on the page is housed within a /assets directory. That’s interesting. I decided to check it out. The web directory revealed a a few files, including gifs and jpegs which did not exactly stand out but were entertaining.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LQ7YDHqNHYQpqbhKLH3TLQ.png" /><figcaption>Assets page</figcaption></figure><ul><li>This got my wheels spinning. Are there other directories? Burp’s site map didn’t reveal additional ones so I decided to use one of my favorite tools, dirb.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*D7CGQqbStFTn6vKAoQrBzA.png" /><figcaption>Dirb results</figcaption></figure><ul><li>While dirb ran, I also did a pretty aggressive nmap scan (not to be used on actual systems) using nmap -T5 -sC — F 10.10.167.67 . -sC is to check open ports for vulnerabilities using default scripts. Results did not show much. SSH did not look like the way in after confirming it required authentication via public key.</li><li>Back to dirb, a few additional directories were found so I decided to check them out. Robots.txt revealed a string. Password maybe? The /server-status directory is results in a 403 forbidden error.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*Ya2iMIWLnCWANtQ5038WJQ.png" /><figcaption>Robots.txt</figcaption></figure><ul><li>So what’s next? I did get a bit stuck and decided to run a tool that I have not used in awhile, Nikto! Nikto is a web app vulnerability scanner that is built into Kali by default. A few mins of scanning and the results were juicy. Don’t we just love a php login page?</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FwidZWbOWyqT8aoIlUuQbw.png" /><figcaption>Nikto scan results</figcaption></figure><h3>Exploitation</h3><ul><li>Cool, so have a username ‘<em>R1ckRul3s</em>’ and a login page. I decided to try the text ‘<em>Wubbalubbadubdub</em>’ from the robots.txt page first because hey, who knows.</li><li>WOOOOOOOOOOW, it actually worked! Recon people; it’s so important. I could’ve POSSIBLY ran tools like Hydra, FFuF, JTR or Burp Intruder to try and brute force the password but that would’ve been more time wasted.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DwKqVgVwnAG1nKJiP0p8cQ.png" /><figcaption>Admin panel</figcaption></figure><ul><li>The first thing I decided to do before using the command execution panel is to check the tabs at the top. All had the same “Only the <strong>REAL</strong> rick can view this page..” with a gif. Ok cool, nothing to see there.. yet.</li><li>Back at command panel, I decided to try some commands. I already enumerated this was a Linux machine (Ubuntu). I tried ls which revealed the files in the current directory.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V3gczbwbT4wCuRukIdeE-A.png" /></figure><ul><li>The file named ‘Sup3rS3cretPickl3Ingred.txt’ seemed like it had the first ingredient needed to I tried to output the contents using cat . I received a command denied screen with a gif and some text. Of course they wouldn’t make it easy.</li><li>After some research (not checking write ups 😁), I found that the less command can be used to view the contents of a file one screen at a time. I use cat 99% of the time to output file content so this is one command that I have not used. I decided to try it. less Sup3rS3cretPickl3Ingred.txt Success!</li><li><strong>Q1: What is the first ingredient that Rick needs?</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TgOWqmPeZYkgY6a8O8z3kQ.png" /></figure><h3>Finding the next ingredient</h3><ul><li>I decided to run the less command again but this time along with the clue.txt file which provided a clue that mentions to look around the file system for the other ingredient.</li><li>Running the whoami command, I see that the user is www-data. I tried some other commands to start digging. I noticed Assets was a directory since I had already been there (it also did not have a file extension) so I decided to poke around there again. I did not find anything different from accessing the web page itself.</li><li>Next, I decided to try moving up some levels in the hierarchy which allowed me to see the folders outside of the current directory with ls ../../</li><li>Although you can run commands to see other directories running change directory cd will not actually allow you navigate to the panel since this is not actually a command line on the system.</li><li>Since ls ../../ did not reveal anything out of the ordinary, I began to suspect that this ingredient would be in a hidden directory.</li><li>Running ls -al revealed all hidden directories. 2 interesting ones being home and root.</li><li>I checked home first by using ls /home . This revealed two directories, rick and ubuntu</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ug1nHbziz2B5gfd-FkGEWA.png" /><figcaption>ls /home</figcaption></figure><ul><li>Next, I used ls /home/rick lo and behold, the 2nd ingredient file was there!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eblkFMgs4QXOEIxzPtwEUw.png" /><figcaption>second ingredient found</figcaption></figure><ul><li>Viewing these ingredients had a bit of trickiness to it. The command panel is still blocking cat so less will be the one to use again but because there is a space in the name. Viewing was not as simple as typing less /home/rick/second ingredients</li><li>I had to utilize the technique of escaping the space (did some googling since it’s been awhile since I had to deal with a directory with a space). To view the contents, the command I used was less /home/rick/second\ ingredients with the backslash escaping the space in this case.</li><li>Success! 2nd ingredients found!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hXvnZaJENUUWVGhoHbtgYA.png" /><figcaption>2nd ingredient</figcaption></figure><h3>Finding the last ingredient</h3><ul><li>No more clues on getting to the last ingredient but the fact that the root directory is not showing anything is suspicious. It’s a CTF, the chances that the final ingredient are in root are very likely, right?</li><li>I tried a bunch of commands to show the root directory but none worked. It occurred to me that I should be using sudo while attempting to list the root directory using sudo ls /root -al</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yp8TjmTHAEXSFLyBH8zxCw.png" /><figcaption>root directory</figcaption></figure><ul><li>Here is a 3rd.txt file. Interesting! I erased the ls /root -al and replaced with less /root/3rd.txt (keeping sudo for elevated privileges). Try on your end!</li><li>CTF Complete!</li></ul><p>Thanks for reading. Stay curious my friends!</p><p>~ <em>Chryber</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0083c5ad6f9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Windows Event Logs Room — TryHackMe]]></title>
            <link>https://medium.com/@chryb3r/windows-event-logs-room-tryhackme-c043aa59b68?source=rss-93493c82db29------2</link>
            <guid isPermaLink="false">https://medium.com/p/c043aa59b68</guid>
            <category><![CDATA[computer-security]]></category>
            <category><![CDATA[tryhackme]]></category>
            <category><![CDATA[walkthrough]]></category>
            <dc:creator><![CDATA[Christof]]></dc:creator>
            <pubDate>Mon, 02 Oct 2023 02:58:39 GMT</pubDate>
            <atom:updated>2023-10-02T02:58:39.916Z</atom:updated>
            <content:encoded><![CDATA[<h3>Windows Event Logs Room — TryHackMe</h3><p><em>Follow along and let’s clear this room together.</em></p><h4>Task 1: What are Event Logs?</h4><p>A: Read intro, start machine and Click Completed to proceed to the next task.</p><h4><strong>Task 2: Event Viewer</strong></h4><p>Q: For the questions below, use Event Viewer to analyze <strong>Microsoft-Windows-PowerShell/Operational</strong> log.</p><p>A: Click Completed.</p><p>Q: What is the Event ID for the earliest recorded event?</p><p>Open Event Viewer either by searching for the program or using eventvwr.msc command within the Windows terminal. Using the left panel, Expand Applications and Service logs &gt; Microsoft &gt; Windows &gt; Powershell. Double click Operational within the middle window. All events will be listed at the top of the middle window, scroll down to the last event to see its EventID.</p><p>A: 40961</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QMOt5pso80AWcseP0f6SQw.png" /><figcaption>Task 2, Question 2</figcaption></figure><p>Q: Filter on Event ID 4104. What was the 2nd command executed in the PowerShell session?</p><p>Use the Filter Current Log option under the Actions pane on the right. Enter EventID in the field then click Ok.</p><p>Scroll down the list of events and click on the 2nd event (from the bottom). The command used will be shown in the General pane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*00hwx2Wxeaqg3JpviqUMMg.png" /><figcaption>Task 2, Question 3</figcaption></figure><p>A: whoami</p><p>Q: What is the Task Category for Event ID 4104?</p><p>Look at the Task Category column within the listed events tab for EventID 4104.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pWpDPZ6CMHYquv5KXETGCQ.png" /><figcaption>Task 2, Question 4</figcaption></figure><p>A: Execute a Remote Command</p><p>Q: Analyze the Windows PowerShell log. What is the <strong>Task Category</strong> for Event ID 800?</p><p>This is one of the questions where reading the information before answering is important. Searching EventID ‘800’ will not yield any results. To find the answer, right click on the Operational log item on the life side pane &gt; Create Custom View &gt; Select By Source &gt; Event Sources drop down &gt; Select both Powershell options &gt; Filter on EventID ‘800&#39; &gt; Ok. Dont forget to name the New View. Like the questions before, check the Task Category for the answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*M-1xlF0rGwDGeq6_mI_wKw.png" /><figcaption>Task 2, Question 5</figcaption></figure><p>A: Pipeline Execution Details</p><h4>Task 3: wevtutil.exe</h4><p>Q: How many log names are in the machine?</p><p>To solve, open Poweshell. Type wevtutil.exe and run. This will display command information. To determine the number of logs, run the e1 or enum-logs command but also pipe the measure-bojects cmdlet like so wevtutil.exe e1 | measure-objects</p><p>A: 1071</p><p>Q: What event files would be read when using the <strong>query-events</strong> command?</p><p>Run wevtutil qe /? command for an explanation and the answer.</p><p>A: event log, log file or structured query</p><p>Q: What option would you use to provide a path to a log file?</p><p>This is referring to the options for the wevtutil qe /? command. Run it again and look for the option that will show the path file of the log if the value is true.</p><p>A: /lf:true</p><p>Q: What is the VALUE for /q?</p><p>Read the description of the option.</p><p>A: Xpath query</p><p>Q: The questions below are based on this command: <strong>wevtutil qe Application /c:3 /rd:true /f:text</strong></p><p>A: None. Click Complete.</p><p>Q: What is the log name?</p><p>A: Application</p><p>Q: What is the /rd option for?</p><p>Read the description for the /rd option of the wevtutil qe /? command</p><p>A: Event read direction</p><p>Q: What is the /c option for?</p><p>Read the description for the /c option of the wevtutil qe /? command</p><p>A: maximum number of events to read</p><h4>Task 4: Get-WinEvent</h4><p>Q: Answer the following questions using the <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.diagnostics/Get-WinEvent?view=powershell-7.1"><strong>online</strong></a> help documentation for <strong>Get-WinEvent</strong></p><p>A: Click Completed</p><p>Q: Execute the command from <strong>Example 1</strong> (as is). What are the names of the logs related to <strong>OpenSSH</strong>?</p><p>In PowerShell, run the command Get-WinEvent -LogList * from Example 1 in the task description. The two names of the logs associated with OpenSSH will be at the bottom of the list.</p><p>A: OpenSSH/Admin, OpenSSH/Operational</p><p>Q: Execute the command from <strong>Example 8</strong>. Instead of the string <strong>*Policy*</strong> search for <strong>*PowerShell*</strong>. What is the name of the 3rd log provider?</p><p>Open the mentioned link from the first question that did not require an answer. Run the command from Example 8 on the web pageGet-WinEvent -ListProvider *PowerShell* . The question asked to replace *Policy* in the command with *PowerShell* so that is what is needed to get the answer. Check the 3rd listed Name field.</p><p>A: Microsoft-Windows-Powershell- DesiredStateConfiguration-FileDownloadManager</p><p>Q: Execute the command from <strong>Example 9</strong>. Use <strong>Microsoft-Windows-PowerShell</strong> as the log provider. How many event ids are displayed for this event provider?</p><p>Run the command (Get-WinEvent -ListProvider Microsoft=Windows-GroupPolicy).Events | Format-Table Id, Description | Measure-Object</p><p>A: 192</p><p>Q: How do you specify the number of events to display?</p><p>I used the Find option (CTRL + F key) to search for portion on the web page that talks about the number of events. Example 13 talks about this in detail and the command used to specify the number of events.</p><p>A: MaxEvents</p><p>Q: When using the <strong>FilterHashtable</strong> parameter and filtering by level, what is the value for <strong>Informational</strong>?</p><p>No command execution needed. To find the answer, dig into the online document or go to <a href="https://learn.microsoft.com/en-us/powershell/scripting/samples/creating-get-winevent-queries-with-filterhashtable?view=powershell-7.3">https://learn.microsoft.com/en-us/powershell/scripting/samples/creating-get-winevent-queries-with-filterhashtable?view=powershell-7.3</a> and the level key names and their values are listed at the bottom of the page.</p><p>A: 4</p><h4>Task 5: XPath Queries</h4><p>Q: Using the knowledge gained on <strong>Get-WinEvent</strong> and <strong>XPath</strong>, what is the query to find <strong>WLMS</strong> events with a System Time of <strong>2020–12–15T01:09:08.940277500Z</strong>?</p><p>Use the task description, online document and hint if needed to develop the command.</p><p>A: Get-WinEvent -LogName Security -FilterXPath ‘*/System/Provider[<a href="http://twitter.com/Name">@Name</a>=”WLMS”] and */System/TimeCreated[<a href="http://twitter.com/SystemTime">@SystemTime</a>=”2020–12–15T01:09:08.940277500Z”]</p><p>Q: Using <strong>Get-WinEvent</strong> and <strong>XPath</strong>, what is the query to find a user named Sam with an Logon Event ID of 4720?</p><p>To answer this one, I had to really study the structure of writing the query based on the XML structure and the examples provided in the description. To query a user named Sam, the command would be */EventData/Data Name=[@TargetUserName=&quot;Sam&quot; . The question also calls for the command to query the specific event ID so the command would be */System/EventID=4720&#39; . Now put them together with the Get-WinEvent -LogName Security -FilterXPath command.</p><p>A: Get-WinEvent -LogName Security -FilterXPath ‘*/EventData/Data Name=[<a href="http://twitter.com/TargetUserName">@TargetUserName</a>=”Sam”]’ and ‘*/System/EventID=4720’</p><p>Q: Based on the previous query, how many results are returned?</p><p>A: 2</p><p>Q: Based on the output from the question #2, what is Message?</p><p>A: Answer: A user account was created</p><p>Q: Still working with Sam as the user, what time was Event ID 4724 recorded? (<strong>MM/DD/YYYY H:MM:SS [AM/PM]</strong>)</p><p>A: 12/17/2020 1:57:14 PM</p><p>Q: What is the Provider Name?</p><p>A: Microsoft-Windows-Security-Auditing</p><h4>Task 6: EventIDs</h4><p>Q: I’m ready to look at some event logs…</p><p>A: Click Completed</p><h4>Task 7: Putting Theory Into Practice</h4><p>This tasks has scenarios that match each set(s) of questions. Read the scenarios carefully and answer the questions it is associated with.</p><p>Q: What event ID is to detect a PowerShell downgrade attack?</p><p>A quick Google search will provide this answer.</p><p>A: 400</p><p>Q: What is the <strong>Date and Time</strong> this attack took place? (<strong>MM/DD/YYYY H:MM:SS [AM/PM]</strong>)</p><p>Double click the file to open the Event Viewer GUI. Use the Filter option on the right and filter EventID ‘400’. The date of the first event is the answer.</p><p>A: 12/18/2020 7:50:33 AM</p><p>Q: A <strong>Log clear</strong> event was recorded. What is the ‘Event Record ID’?</p><p>Double click the file to open the Event Viewer GUI. Scroll down the list of the events and check the Task Category for “Log Cleared”. Click on this event. Click on the Details tab &gt; XML View and check EventRecordID field.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oWw4qoU_okoI5MG7K99iwA.png" /><figcaption>Task 7, Question 3</figcaption></figure><p>A: 27736</p><p>Q: What is the name of the computer?</p><p>Go back to the Details and check the Computer field.</p><p>A: PC01.example.corp</p><p>Q: What is the name of the first variable within the PowerShell command?</p><p>This scenario mentions searching for EventID 4104. Using the filter option again, we can filter for logs with this EventID. Click on the oldest log at the bottom (filter by date puts it at the top of the list). The variable is the first couple characters in the Details starting with $.</p><p>A: $Va5w3n8=</p><p>Q: What is the <strong>Date and Time</strong> this attack took place? (<strong>MM/DD/YYYY H:MM:SS [AM/PM]</strong>)</p><p>Using the Date and Time column, filter from oldest to latest logs on this event. The oldest log time is the date the attack was first executed.</p><p>A: 8/25/2020 10:09:28 PM</p><p>Q: What is the <strong>Execution Process ID</strong>?</p><p>Picking up where the last question left off, click on the Details of the oldest log then the XML tab. Look for the Eexution Process ID field.</p><p>A: 6620</p><p>Q: What is the <strong>Group Security ID</strong> of the group she enumerated?</p><p>Some GoogleFu will help you find the answer.</p><p>A: S-1–5–32–544</p><p>Q: What is the event ID?</p><p>Some GoogleFu will help you find the answer.</p><p>A: 4799</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c043aa59b68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hash cracking with a cat! on Windows]]></title>
            <link>https://medium.com/@chryb3r/hash-cracking-with-a-cat-on-windows-b2260e7a71e5?source=rss-93493c82db29------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2260e7a71e5</guid>
            <category><![CDATA[hashcat]]></category>
            <category><![CDATA[password-security]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Christof]]></dc:creator>
            <pubDate>Wed, 23 Aug 2023 23:59:16 GMT</pubDate>
            <atom:updated>2023-08-23T23:59:16.822Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/440/0*bwcoFXyZrRGtMwAF.png" /></figure><p><em>NOTE: This is not an in-depth tutorial on how to use this tool. I completed this “mini lab” as a part of TCM’s Ethical Hacking course to practice cracking a hash with Hashcat. In this part of the course, the focus is on attacking Active Directory and utilizing the Responder tool to capture hashes from a domain joined machine. The machine is called “The Punisher” from the Marvel anti-hero with the local admin being “Frank Castle” which is the anti-hero’s real name (but if you are Marvel fan you knew that right?).</em></p><p>What is a hash? A hash is a fixed length string that is generated when a key or alphanumeric string is run through a hashing algorithm. The length of the hash never changes no matter the change in length of the password. There are many types of hashing algorithms out there. Some popular includes MD5 and SHA-256. It is important to use an one-way hashing algorithm to prevent someone from converting the hash back to it’s original plaintext form.</p><p>Here we have the MD5 hash of ‘Mypassword1’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*d40rCJw_77qoCZ8fjEr6ZQ.png" /><figcaption>MD5 Hash and SHA1 Hash for Mypassword1</figcaption></figure><p>Notice below that the length of the hashes did not change despite the change in length of the password to ‘Mypassword1453556789876’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*DjtiC6p9r8dlFiiD8uA9rA.png" /><figcaption>No change in length</figcaption></figure><p>You can mess around with hashes <a href="https://www.md5hashgenerator.com/">here</a>.</p><p>What is Hashcat? In short, it is advertised as a password recovery tool rich with features to break down hashes and derives the password from it. I decided to test out the tool’s effectiveness for myself by installing on my personal computer. I have heard numerous times that password cracking tools works much better when utilizing the Graphics Processing Unit (GPU) of your personal computer instead of running the tools in virtualized environments. The more robust the GPU, the faster the process will be.</p><p>I began by downloading the Hashcat tool via <a href="https://hashcat.net/hashcat/">https://hashcat.net/hashcat/</a>. I downloaded both the sources and binaries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*_tcBoxspxPoLXhR5JBf8HQ.png" /><figcaption>File download</figcaption></figure><p>On my device, I created a folder called “hacking” (Original right?).In this folder, I extracted the hashcat-6.2.6.7z file to my hacking folder. Next, I copied the entire hash from within my Azure deployed Kali Linux machine to a newly created hashes.txt file. The hashes.txt file is then moved to the hashcat-6.2.6 subfolder within the hacking folder.</p><p>In order to start cracking the hash, I needed a wordlist so I downloaded the rockyou.txt wordlist from Github. A wordlist is usually a text file with commonly used and/or previously compromised passwords. TCM’s practical ethical hacking course used Kali Linux for the Hashcat segment but I am on Windows so I needed to know the syntax to run from the Windows terminal. Youtuber Saleh provided a fantastic <a href="https://www.youtube.com/watch?v=KLry7bf51QQ">Youtube video</a> on breaking hashes with Hashcat which included the syntax to begin cracking.</p><p>In the video, Saleh broke a MD5 hash. The hash that I acquired through the Active Directory lab is an NTLM2 hash so I had to modify the command he used below:</p><pre>hashcat -m0 -a3 -o cracked.txt hash.txt</pre><p>To run Hashcat, I right-clicked on command prompt and ran as administrator. Next, I navigated to the hacking folder which is on my Desktop then into the hashcat-6.2.6 subfolder.</p><p>I modified the command above as follows to match my files:</p><pre>hashcat -m 5600 - a3 hashes.txt rockyou.txt -O</pre><p>Explanation of the syntax as I understand it is as follows:</p><ul><li>Hashcat executes the application</li><li>The -m5600 flag 5600 is the NTLMv2 hashing mode. Each hashing algorithm has a different mode referenced by a number. A comprehensive list can be found <a href="https://hashcat.net/wiki/doku.php?id=example_hashes">here</a>.</li><li>-The -a3 flag defines the speed used to break the hash.</li><li>Hashes.txt has the hash being broken and it is matched against the wordlist rockyou.txt</li><li>An error occurred when I ran the command without the -O command and I was prompted to add it which allowed the command to execute.</li></ul><p>Time to run!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*07QDhwb4aYBqkWVv4iCsqQ.png" /><figcaption>In progress</figcaption></figure><p>The process took anywhere from 15–20 minutes (I stepped away). During, my laptop ran real warm as well</p><p>Success! Here we have an easily cracked hash since the password used to secure the account was weak.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YhfBKMoKKOGDWAbAssrwSA.png" /></figure><p>One of the most interesting features in the tool is if I run the same command again and include --show , the hash along with the password is displayed.</p><p>As I continue to learn and grow more in the field, I will expand on this knowledge and post more write ups on tools and my experience with them.</p><p>Hope you enjoyed reading!</p><p>Related interesting links:</p><h3>Hashcat cheat sheet 📃</h3><ul><li><a href="https://www.youtube.com/watch?v=cczlpiiu42M">Hashes More In depth</a> 🏫</li><li><a href="https://www.kali.org/tools/hashid/">Hash-ID</a> 🪪</li><li><a href="https://academy.tcm-sec.com/p/practical-ethical-hacking-the-complete-course">TCM’s PEH course</a> 🧑‍💻</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2260e7a71e5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Microsoft Azure Detection Lab]]></title>
            <link>https://medium.com/@chryb3r/microsoft-azure-detection-lab-831fb7dd1941?source=rss-93493c82db29------2</link>
            <guid isPermaLink="false">https://medium.com/p/831fb7dd1941</guid>
            <category><![CDATA[microsoft-azure]]></category>
            <category><![CDATA[microsoft-sentinel]]></category>
            <category><![CDATA[kql]]></category>
            <category><![CDATA[mitre-attack]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Christof]]></dc:creator>
            <pubDate>Fri, 04 Aug 2023 23:21:42 GMT</pubDate>
            <atom:updated>2023-08-04T23:28:04.665Z</atom:updated>
            <content:encoded><![CDATA[<p><em>My personal experience in spinning up a Virtual Machine in Azure, configuring resources such as Microsoft Sentinel, ingesting logs into Sentinel using data connectors, Azure security practices and creating custom logs using Kusto Query Language (KQL). Credit for this lab goes to </em><a href="https://cyberwoxacademy.com/azure-cloud-detection-lab-project/"><em>CyberWox</em></a><em>.</em></p><p><strong>Azure Resources Used:</strong></p><ul><li>Windows 10 Virtual Machine</li><li>Microsoft Sentinel</li><li>Log Analytics Workspace</li></ul><h4>Setup</h4><p>I began this lab by creating an Azure account via <a href="https://azure.microsoft.com/en-us/free/">https://azure.microsoft.com/en-us/free/</a> Microsoft provides $200 worth of free credits to practice which is awesome. It’s important to delete these resources though to ensure all of the credits aren’t used up.</p><p>Next, I created a Resource Group (which I will be calling RG for ease of use). Resource Groups are containers for an Azure solution or just resources you want to manage together. This was easy enough to create by hovering over ‘Resource Group’ below Navigate &lt; + Create. I created a basic resource group called ‘Lab_1’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mjwp_z2kDEKNu5_FMMI63g.png" /></figure><p>The next step was to deploy a Virtual Machine from which data will be collected later. Steps I performed : Click the Virtual Machine tab &lt; + Create. I selected the RG I created &lt; created my VM name &lt; Windows 10 Pro image &lt; created a username and password (important for later) &lt; Review + Create while keeping all other defaults.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zRlOFe7EtlCL6Sch98bwng.png" /></figure><p>After deploying the VM, Network Security Group (NSG)was also created in the process. An NSG operates like a firewall for Azure resources by allowing or disallowing traffic to and from the virtual network. When a VM is deployed, it joins the virtual network (vnet) and is assigned an ip address and network interface. The NSG includes security rules in which the destination and source, port, and protocol can be specified.</p><p>By default, Remote Desktop Protocol (RDP) is selected as the protocol for access to the VM. NSG shows that any RDP traffic is being allowed which is highly risky from a security standpoint. Attackers typically scan for open management ports such as RDP and SSH to gain access to machines as an entry point and exploit other resources. Another security feature is needed to ensure that only I can RDP from my personal device to the VM. For this, I enabled a security feature called JIT or Just-In-Time access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SnfanTVA1uadutKKekszNA.jpeg" /><figcaption>RDP Allowed</figcaption></figure><p>JIT is a cloud solution meant to reduce the attack surface by limiting who has access to the VM based on role-based access (RBAC) and certain IP addresses. Defender for Cloud identifies which VM should have JIT enabled based on a few factors:</p><ul><li>VM has a firewall enabled</li><li>Firewall is allowing inbound traffic on ports 22, 3389, 5985, &amp; 5986</li></ul><p>If these settings apply, JIT is recommended. First, I search and selected Microsoft Defender for Cloud in the Azure Portal &lt; Environmental Setting in left panel &lt; click Azure Subscription &lt; Enable All Plans.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k5b477peE5En1SBNwFtR0w.png" /><figcaption>Microsoft Defender for Cloud enabled</figcaption></figure><p>Steps I performed to enable JIT: I went back to the Defender homepage &lt; clicked Workload Protections in the left panel &lt; Just-in-time VM access under Advanced Protections &lt; select chryberVM &lt; Enable JIT on VM. I kept the default configurations for all management port access which is a 3 hour time limit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Khe-ne95tMpqIPMEHTjQcQ.png" /><figcaption>Enabling JIT</figcaption></figure><p>The ‘Add’ option can be used to add additional ports, the type of protocol, singular or ip ranges and adjusting the time frame.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5FH7Vvo1B8UZRI0BimwCVw.png" /><figcaption>Default time constraints</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C-qEU1ESe6UhqlUXJQ37Ew.png" /><figcaption>JIT configured. Button now says Request Access</figcaption></figure><p>I went to the Network tab of the VM and saw that RDP was only allowing my ip address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jjVyoUTMIx6O8jMecR50oQ.png" /></figure><p>To collect log data, first I had to configure Log Analytics Workspace within Microsoft Sentinel. Steps I performed: Type Microsoft Sentinel in the search bar &lt; clicked Create &lt; Create a New Workspace &lt; select RG &lt; named the workspace ‘mydemospace’ &lt; Review + Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I8iHE4E5MqpcUzVZ_5RqLA.png" /><figcaption>After workspace creation</figcaption></figure><h4>Sending data to Sentinel</h4><p>Sentinel did not have any information because there is no data being fed into the logs. The next part requires using data connectors to have security events that will later be generated from the VM. Steps I took: click Data Connectors &lt; More content &lt; search security events &lt; Windows Security Events &lt; Install. The installation process installs Microsoft Events via AMA which is the connector that allows one to “view dashboard, create custom queries and improve investigation” per description.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0UZcbMHhugtUY8OABNrTog.png" /><figcaption>Select Windows Security Events</figcaption></figure><p>After installing the connector, I configured a data collection rule to select the type of data I want sent to Sentinel. Steps I performed: Click Open Connect page &lt; Create data collection rule &lt; Write rule name &lt; select RG &lt; click Next:Resource &lt; Add Resource &lt; select chryberVM &lt; Next: Collect &lt; All Security Events &lt; Review + Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5lKxkyC_q6tjZcFIDfCTTw.png" /><figcaption>Rule creation complete</figcaption></figure><h4>Generating Security Events in Virtual Machine</h4><p>The next process in the lab was to generate some activity within the VM. Windows keeps a security of of events such as login attempts, process and more via the Security Logs in Event Viewer. First, I had to connect to the VM over RDP. Steps I performed: Go to Virtual Machine homepage &lt; Click Connect &lt; My IP under Source IP &lt; Request Access. Since JIT is enabled, I must request the 3 hour time frame for my ip address access to access it.</p><p>Additional steps I took: Open Remote Desktop Connection program on my computer &lt; entered VM public ip address &lt; entered username created during VM deployment &lt; Connect &lt; enter password &lt; Ok.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VAglRVnpN8NuWtAhyNcn9w.png" /><figcaption>RDP connect</figcaption></figure><p>By logging in successfully, I created a security event which generates an event id needed for creating querying the logs. To get the event id, I searched Event Viewer in the desktop search bar &lt; Windows Logs &lt; Security. I combed through events and found the successful logon is designated the id ‘4624’.</p><h4>Writing KQL scripts</h4><p>I went from generating a security event to getting the event ID to utilizing KQL to generate logs associated with the event. Steps I performed: From Sentinel homepage, click Logs in left side panel &lt; Click in “Type your query here” field and typed the KQL shown logic below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IHn9Q1OU6uKCl_4x7gEMRw.png" /><figcaption>Successful login query</figcaption></figure><p>My familiarity with SQL helped in analyzing the log. The query looked for security events that matched the event id ‘4624’. The project syntax created the columns where we can see the time I logged in and the machine I logged in on. In an enterprise environment with many endpoints, the AccountName field would different the users and their logins but for this lab it was not needed. I decided to reopen Event Viewer on the VM and grabbed the failed logon attempt event id to practice creating another query with a different ID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gL3JOA-YJJaUJbisvCAd-w.png" /><figcaption>Creating failed login query</figcaption></figure><h4>Generating security alerts and creating analytics rules</h4><p>In this task, I learned about the process of creating an alert to be notified of security events based on rules created for VMs in Azure. If there is an event such as failed logon and unfamiliar scheduled task then Sentinel can send an alert about this. First, I set up enable logging for scheduled tasks and create a scheduled task in the VM. Steps I performed: Access the VM via RDP Request Access &lt; Sign in &lt; search Local Security Policy &lt; clicked Advanced Audit Policy Configuration &lt; System Audit Policies — Local Groups &lt; Object Access &lt; Audit Other Object Access Events &lt; Check off Success and Failure &lt; Ok.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7LahFmny9-7fLjyOlK7ufw.gif" /><figcaption>Allowing logging of scheduled tasks</figcaption></figure><p>Next, I created a scheduled task that will be detected by Sentinel. Steps I performed: Search Task Scheduler on Windows VM &lt; Create Task &lt; name the task “fakemaliciousactivity” &lt; wrote a description &lt; Triggers &lt; I entered a time a few mins from my current time for the task to run &lt; Actions &lt; Start a Program &lt; Browse &lt; selected cmd.exe path &lt; Ok &lt; Ok. I decided to select the command prompt to open as this program is executed by some malware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*kXoDFb0TexdyXyJ3_l9QOQ.png" /><figcaption>Name creation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*tAS-uLCko_yeBrr6KRRFiA.png" /><figcaption>Scheduling the time</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rG7XfZseD_UlcAd95KYVng.png" /><figcaption>Selecting the program for execution</figcaption></figure><p>Next I used KQL to create the analytics rule needed to generate alerts for the scheduled task. Steps I performed: On the Sentinel homepage &lt; Analytics in left panel &lt; Create &lt; Scheduled Query rule &lt; named the rule “Task scheduled on Windows VM” &lt; wrote a description &lt; selected a severity for Medium &lt; mapped the TTP &lt; Next:Set rule logic &lt; wrote the query &lt; Skipped through Incident Settings and Automation response &lt; Review + Create &lt; Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w8WcnmKQgWlLYpLRaB8i7Q.png" /><figcaption>Selecting TTPs based on MITRE ATT&amp;CK</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lThWGOo_3HuU109VecH7fA.png" /><figcaption>Writing KQL logic to detect the task</figcaption></figure><p>The schedule task executed at the appropriate time. In Sentinel, I received an alert for the task as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v7nCQHClBp1tc1tSAkr_HA.png" /><figcaption>Program executed as scheduled</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o7GhX0Ebt4lAlbfljK71Yw.png" /><figcaption>Scheduled task alert</figcaption></figure><h4>Wrap up</h4><p>I thoroughly enjoyed spinning up this lab and working with the various Azure resources. I was familiar with Azure from previous experience in college projects but now I have acquired a better understanding of how tools such as Sentinel and Defender are implemented to monitor and protect cloud resources. Azure has an immense but insightful number of articles that I used to read up on such as Just-in time access, Network Security Groups and data connectors.</p><p>Mapping the TTPs associated with the scheduled task event was also another enjoyable part of this lab for me. Utilizing my knowledge of the MITRE ATT&amp;CK framework, I selected Persistence as the tactic since adversaries can run malicious executables as scheduled tasks to gain initial or continued access to a system and deliver more malicious payloads. The techniques are <a href="https://attack.mitre.org/techniques/T1546/">Event Triggered Execution</a> and <a href="https://attack.mitre.org/techniques/T1053/">Scheduled Task/Job</a>.</p><p>I returned to the Analytics wizard to create a new rule for excessive logons and mapped the TTPs associated with this new alert. The technique being Initial Access and the technique being <a href="https://attack.mitre.org/techniques/T1133/">External Remote Services</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w4UdK1vseALE4wA6a2rjDw.png" /><figcaption>Creating another analytics rule</figcaption></figure><p>Now time to delete and turn off these resources to save my remaining credits. More cloud stuff to come.. 👌</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=831fb7dd1941" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TryHackME: ItsyBitsy (ELK Challenge Room)]]></title>
            <link>https://medium.com/@chryb3r/tryhackme-itsybitsy-elk-challenge-room-b98f6c9589be?source=rss-93493c82db29------2</link>
            <guid isPermaLink="false">https://medium.com/p/b98f6c9589be</guid>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[tryhackme-walkthrough]]></category>
            <category><![CDATA[elasticsearch]]></category>
            <category><![CDATA[elk-stack]]></category>
            <dc:creator><![CDATA[Christof]]></dc:creator>
            <pubDate>Wed, 02 Aug 2023 00:39:17 GMT</pubDate>
            <atom:updated>2023-08-02T00:39:17.276Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Medium level room on TryHackMe to test knowledge in log analysis using Elastic (ELK)</blockquote><p>Task 1: Read the introduction, start the machine, start Attackbox (and confirm completion of both to move on.</p><p>Task 2: Read the scenario (it’s interesting 😎). Also navigate to the IP address in the AttackBox’s Firefox browser to load ELK.</p><p>Q: How many events were returned for the month of March 2022?</p><p><em>A: Navigate to Discover tab &lt; Time &lt; Absolute &lt; Set start time to ‘March 1, 2022 at 00:00:00.00’ and end time to ‘Mar 31, 2022 @ 23:59:59.999’. The number of events is the number of hits returned.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nZ4dinaADhcVzaTw72t9Zw.png" /></figure><p>Q: What is the IP associated with the suspected user in the logs?</p><p><em>A: Using the filters on the left hand side, select the the source_ip filter. The suspicious ip is the one with the least amount of events.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3d6XEX-2sxhoZX2qs50KZQ.png" /></figure><p>Q: The user’s machine used a legit windows binary to download a file from a C2 server. What is the name of the binary?</p><p><em>A: Click the ‘+’ icon next to the suspicious ip to filter it out. Now we are left with 2 events. Read through the fields in each event, only one value is associated with Windows (hint: user-agent field).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LRe2lwm1a81oMHC4aMGYQg.png" /></figure><p>Q: The infected machine connected with a famous filesharing site in this period, which also acts as a C2 server used by the malware authors to communicate. What is the name of the filesharing site?</p><p><em>A: The answer calls for a website. Read through the fields again. Only one field has a ‘.com’ in it.</em></p><p>Q: What is the full URL of the C2 to which the infected host is connected?</p><p><em>A: A little trickier than the last question but it’s calling for the same type of answer. The answer calls for a website but instead of ending in ‘.com’ it requires the rest of the URL pointing to the C2. Answer requires combining values from 2 fields in the log (hint: host + uri).</em></p><p>Q: A file was accessed on the filesharing site. What is the name of the file accessed?</p><p><em>A: Open a new tab in the Attackbox browser. Go copy/type the URL found in the last question. File name is shown on the webpage</em></p><p>Q: The file contains a secret code with the format THM{_____}.</p><p><em>A: Secret code is just below the file name.</em></p><p>Remember to terminate the machine.</p><p>Completion:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h_FyzSx3dEJxEOp_9U45wQ.png" /><figcaption>Challenge complete!</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b98f6c9589be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Vulnerability Management Explained]]></title>
            <link>https://medium.com/@chryb3r/vulnerability-management-explained-bdaf88c57bbd?source=rss-93493c82db29------2</link>
            <guid isPermaLink="false">https://medium.com/p/bdaf88c57bbd</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[vulnerability-management]]></category>
            <dc:creator><![CDATA[Christof]]></dc:creator>
            <pubDate>Tue, 01 Aug 2023 04:22:45 GMT</pubDate>
            <atom:updated>2023-08-01T04:22:45.970Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is a vulnerability?</h3><p>Before explaining vulnerability management, it is important to first define a vulnerability. A vulnerability is an exploitable fault within a device, network, or application. There are 5 types of vulnerabilities.</p><p>1. Operating System</p><p>2. Misconfigurations</p><p>3. Weak or default credentials</p><p>4. Poor application design</p><p>5. Human error</p><h3>Vulnerability Scoring</h3><p>Vulnerability scoring was designed to determine the risk and impact that a vulnerability may pose to a system or network. The two vulnerability scoring systems currently are Common Vulnerability Scoring System (CVSS) and Vulnerability Priority Rating (VPR). CVSS is more geared toward how a certain vulnerability would affect the CIA Triad (Confidentiality, Integrity, and Availability) as opposed to VPR which is dynamic due to changing rating based on the risk a vulnerability poses to an organization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/183/1*0azHk63sNceWbWi2HiOpuQ.png" /></figure><h3>Databases</h3><p>National Vulnerability Database is one of the most popular databases. Created and maintained by NIST, National Institute of Standards and Technology, this database list vulnerabilities under Common Vulnerabilities and Exposures where each is given a designation of CVE-Date-ID#. For example, CVE-2023–29345 is the designation for a Microsoft Edge security feature bypass vulnerability. Other databases include exploit-db where the method of exploit is provided as well, GitHub, Rapid7 and Searchsploit. It is interesting to note that Searchsploit is an offline version of Exploit-db which is available in popular pentesting distros such as Kali Linux.</p><h3>Vulnerability Scanning</h3><p>The process of using automated tools to search for vulnerabilities within devices, applications, and networks. Some popular vulnerability scanners include NESSUS and Qualys. Another type of scanner generally used by pentesters is nmap which scans the network for open ports. Unused open ports are a significant vulnerability.</p><p>Scanners like NESSUS categorize the weaknesses in the system based on the scan configuration and provide feedback on how they can be remedied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*V72MRT-yf2cwca-OtbDvQQ.png" /><figcaption>Nessus</figcaption></figure><h3>So, what is Vulnerability Management?</h3><p>Vulnerability Management is the continuous process of identifying, assessing, remediating, or mitigating risk to an organization’s IT infrastructure. This concept envelopes everything covered above and stakeholders working with security professions to develop quantified risk-based assessments. An associated framework has been developed and has been implemented by many organizations for their vulnerability management program.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*Kfop0askBbjx8hn_Wgobdg.png" /><figcaption>Lifecycle</figcaption></figure><h3>Discover</h3><p>In this initial phase, all assets, configurations, and networks are scanned. Organizations will need to understand the attack surface of their infrastructure by performing an organization wide scan which should be planned.</p><h3>Prioritize</h3><p>Categorization based on risk to the infrastructure happens in this page. Integral systems with critical vulnerabilities are placed as priority for patching/remediation. For example, vulnerabilities with databases would be the highest priority since loss of data can lead to loss of reputation and legal ramifications for the company.</p><h3>Assess</h3><p>Once prioritized, scan findings are assessed to understand the severity of the vulnerability to the IT infrastructure. This is where a quantified risk-based assessment and risk baseline can be developed.</p><h3>Reporting</h3><p>Vulnerabilities are documented and reported. Analyzing the reports helps security professionals in understanding the severity of the vulnerability and can correlate to the security posture of the organization.</p><h3>Remediation</h3><p>The phase in which the security professionals at the company report the findings to the stakeholders who will determine if they want to remediate, mitigate, or accept the risk the vulnerability poses. Remediation involves eradicating the vulnerability by performing actions such as patching a new version of software or upgrading a piece of software to the latest version. Mitigation involves implementing controls which would lessen the risk. If the risk is low enough, the stakeholders can choose to accept (ignore) it.</p><h3>Verify</h3><p>In this final phase, another vulnerability scan is done to ensure that all vulnerabilities that pose the greatest risk to the organization’s infrastructure have been remedied. Frequent audits and other configurations to scanning such as implementing a time-based scan are done in this phase.</p><h3>So, what does this all mean?</h3><p>Vulnerability Management encompasses searching for weakness in the infrastructure, analyzing and fixing it. It’s impossible to fix all vulnerabilities, especially at the rate that technology is expanding, but just because lessening the blow if one is exploited is much better for the organization than the alternatives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bdaf88c57bbd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Brute Forcing WINRM using Metasploit for Active Directory Access]]></title>
            <link>https://medium.com/@chryb3r/brute-forcing-winrm-using-metasploit-for-active-directory-access-2ccc72dc30a5?source=rss-93493c82db29------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ccc72dc30a5</guid>
            <category><![CDATA[bruteforce-attack]]></category>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[kali-linux]]></category>
            <category><![CDATA[metasploit]]></category>
            <category><![CDATA[ethical-hacking]]></category>
            <dc:creator><![CDATA[Christof]]></dc:creator>
            <pubDate>Thu, 27 Jul 2023 00:49:17 GMT</pubDate>
            <atom:updated>2023-07-27T00:52:14.676Z</atom:updated>
            <content:encoded><![CDATA[<p>Funny story how this lab began. I was actually attempting to set up another lab with Active Directory but could not login to Windows Server 2019 due to forgetting my admin password. I kept trying generic passwords that I figured that I would have used but none could log me in. Frustrated, I tried recovery mode to see if I can get to the command prompt but that required my admin login as well 🤦‍♂️. This situation got my wheels spinning. Can I crack my password? I began to look into this and finally got it with a little help which will be discussed later on. Follow along after setting up Windows Server 2019 and Kali or just read through my process on how dangerous it is to use weak passwords. I detailed the process and tools that I used below. Check out my first Medium blog post or Jason Makador’s YouTube tutorial on how to set up the homelab.</p><ul><li>Windows Server 2019 💻 (target)</li><li>Virtual Box 🧰</li><li>Kali Purple 🐉 (attacker)</li></ul><p>1. Deep thought: How can I crack my password? In Windows, the password hashes are stored in HKEY_LOCAL_MACHINE\SAM. SAM is the Windows Security Accounts Manager. For obvious security purposes, this database cannot be accessed unless you have system priveleges and HLK/SAM access. Without getting to deep into Windows internals, I am on the outside so I can’t even get to this file to extract the hashes to run through tools like Hashcat. My next thought: why not try brute forcing it?</p><p>2. Planning: I am familiar with tools like John the Ripper and Hydra for password cracking. I also recalled Burpsuite can be used to brute force logins from my ethical hacking course. I kept those tools in mind but first I needed to put Kali and the Server 2019 machine on the same network.</p><p>3. Network: VirtualBox has a variety of options under the Network setting for each machine. Most if not all of my machines are set to NatNetwork which I created as a default. I also created a ChryberHomeLab Natnetwork recently as well. A NatNetwork is an internal network that accepts outbound connections. In VirtualBox, Click Tools &lt; Network &lt; NAT Networks &lt; Create &lt; Enter network name &lt; Enter IPv4 address (mine is a /24 network to allow for 254 hosts) &lt; Enable DHCP (unless you want to assign IP addresses to each machine yourself) &lt; Apply. Note: This should not be the same IP address as your host machine. I recommend using ‘ipconfig’ on your host machine command line and confirm your ip address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*h3hTCKQ5MxYYLl9k.gif" /><figcaption>Network set up</figcaption></figure><p>4. Set up: Moving Server 2019 and Kali into the same subnet. Click machine &lt; Settings &lt; Network &lt; Attached to: NAT Network &lt; Name: ChryberHomeLab (in my case).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*c5GAc82vliMIRem2.gif" /></figure><p>5. IP address locator: Now that the attack machine (Kali) and the target (Server 2019) are on on the same network, my next thought was how I can locate the IP address assigned to the server machine by DHCP. The first thing I did was confirm Kali’s ip using ifconfig which was 192.168.3.5 I decided to use Nmap. In short, Nmap scans a specific ip or subnet for open ports, services and hosts. I used the help page to use the best flags for this. I chose nmap -v -sn 192.168.3.0/24. Why? -v for verbosity so I can see the addresses being scanned and -sn so ports are not scanned for each, all I need to know is what hosts are active on the network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q4Mg7FtOkjg9PuJd.png" /></figure><p>6. After narrowing the active hosts to 2 (which is correct since I have a Win 10 machine also on the network), I switched up the scan to all port scan using nmap -T4 -p- -A 192.168.3.1 and nmap -T4 -p- -A 192.168.3.4. Once I saw Kerberos, I knew I had the right ip. I briefly looked over the open ports and services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Jp7BgVsTU7E_e5iM.png" /><figcaption>nmap scan for hosts on network</figcaption></figure><p>7. Research: Next, I focused on which tools/methods I could use to brute force. First, I thought about John the Ripper but I remembered that I would need a password file to run it against which I did not have. Next, I checked out Burp. I have used some of it’s features such as intercepter but this time would require intruder as well. After digging into it for a bit I quickly realized this would not be the best method since it requires the capturing of login traffic which isn’t possible because I am not logging in over the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*F4VDzZ2iLPMF-pWP.png" /><figcaption>Burpsuite</figcaption></figure><p>8. Revelation: During this process, I came to the realization that the account I was attempting to login to was a standard non admin user. I only needed to select “Other User” and then enter Administrator and default weak password of ‘Password1’ 🤦‍♂️. I felt stupid but I did not want to cheat myself out of the opportunity to learn more so I continued as if I never logged at all. I continued researching ways to break in until I found the WINRM exploit via <a href="https://www.youtube.com/watch?v=cF02JaXTCwc">https://www.youtube.com/watch?v=cF02JaXTCwc</a>. Shout out to Pwn and Defend.</p><p>9. Enumerating: Simple enough the exploit can be found in Metasploit so I launched msfconsole from the Kali command line. I also read up on WIN RM. In summary, Windos Remote Manager is a built-in remote management protocol that enables admins to communicate with hosts and manage servers that are not in their immedicate vicinity but are on the same network. First step was to use the auxiliary module auxiliary/scanner/winrm/winrm_auth_methods or use 1 to find out if a WINRM service is listening on http(s) and enumerate the supported authentication methods.<br>Using this module required a few settings first (TCM&#39;s Ethical Hacking course knowledge kicking in). By using options I saw that I needed to set the domain name and rhosts. The rport and URI are to be kept default. Here I saw Kerberos and Negotiate (NTLM) protocol are supported.<br>set DOMAIN MYFIRSTDOMAIN<br>set rhost &lt;target ip&gt;<br>run</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*htiFg_5AicPWahV7.png" /><figcaption>Searching for WINRM exploits in Metasploit</figcaption></figure><p>10. Exploit: Next, it was time to find this password. I loaded up the the brute force scanner auxiliary/scanner/winrm/winrm_login via use 3. Again, I used options to see what was required and set already. For this step, I needed the domain, rhosts, password, pass_file and username (even though password, pass_file and username says &#39;no&#39;). The exploit wouldn&#39;t run without all 5 because of the authentication. For password, I put a random password value in but input the actual username. As for pass_file, this requires a file with passwords on one line so I thought the john.lst wordlist I had in Kali would be just fine.<br>set DOMAIN MYFIRSTDOMAIN<br>set rhosts &lt;target ip&gt;<br>set PASSWORD pass (not the correct password btw)<br>set PASS_FILE usr/share/wordlists/john.lst<br>set USERNAME Administrator</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f-YtmgjggTjP8nC4.png" /><figcaption>Running the exploit</figcaption></figure><p>11. Try Again: So brute forcing failed the first time after running through each password in the file. The password I set was in the file but unfortunately, one capital letter made all the difference (I checked). Maybe I need more wordlists or maybe it was something else. I will figure that out later.</p><p>12. A little cheat: I decided to create my own wordlist with the password I set to test the module regardless. I opened a new terminal window and navigates to the wordlists directory. Writing to file in this directory is not possible unless you have root permissions so I sudo’d into root and created the file mousepad brutefile.txt. I loaded up some generic passwords including the correct one and reset the pass_file option to set PASS_FILE usr/share/wordlists/brutefile.txt. SUCCESS!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XXUB9glC9Z4dJJ9F.png" /><figcaption>Password found</figcaption></figure><h3>💭What did I learn?</h3><p>The lab revealed how using easily guessed login credentials is a major security flaw. If I had the right wordlist and time, the password can easily be found by brute force tools. Implementing password policies such as password complexity and lockouts can prevent these attacks. In production environments, more stress is placed on good password hygene to prevent undesirables from gaining access to critical systems. I now remember my password to work on my other lab so that’s a plus as well 😅.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ccc72dc30a5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[File Encryption with GPG using Linux Mint]]></title>
            <link>https://medium.com/@chryb3r/file-encryption-with-gpg-using-linux-mint-8813496b7be4?source=rss-93493c82db29------2</link>
            <guid isPermaLink="false">https://medium.com/p/8813496b7be4</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[linux-mint]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[gpg]]></category>
            <dc:creator><![CDATA[Christof]]></dc:creator>
            <pubDate>Thu, 27 Jul 2023 00:20:07 GMT</pubDate>
            <atom:updated>2023-07-27T00:20:07.348Z</atom:updated>
            <content:encoded><![CDATA[<p>After learning about this tool, I decided to get hands on with GPG and file encryption. Here I will be going through the simple steps to use this powerful tool in my Linux Mint VM. This can be done with any Linux distro. Mint is just mine of choice.</p><ul><li>VMWare WorkStation Player 17</li><li>Linux Mint 21.1 “Vera”</li></ul><ol><li>Boot up VMWare and starting the VM.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/0*k3D5nVI3wnf0Vsa3.png" /></figure><p>2. Open the terminal and create a file with sensitive data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/0*t7bhn0-x5I5PTUiU.png" /></figure><p>3. GPG comes installed on Linux so no installation of a package is needed. Proceed in using the command to encrypt the file. Notice that the data shows when the plaintext file is concatenated as opposed to concatenating the encrypted file. Note: I entered my user login password to encrypt.</p><pre>gpg -c filename.txt</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/0*YQVsO8iecpGpBhxl.png" /></figure><p>4. Using the same command but replacing -c with -d reveals the encryption algorithm (AES256.CFB) as well as the original contents of the file.</p><pre>gpg -d filename.txt.gpg</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/0*ePeu-X3gcaFDc-qW.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8813496b7be4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>