<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Web Exploits on Garrettoh&#39;s Research / Blog</title>
    <link>https://garrettoh.dev/notes/500-hacking/02_initial_access/02_web/</link>
    <description>Recent content in Web Exploits on Garrettoh&#39;s Research / Blog</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <atom:link href="https://garrettoh.dev/notes/500-hacking/02_initial_access/02_web/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title></title>
      <link>https://garrettoh.dev/notes/500-hacking/02_initial_access/02_web/csrf/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://garrettoh.dev/notes/500-hacking/02_initial_access/02_web/csrf/</guid>
      <description>&lt;h1 id=&#34;csrf-cross-site-request-forgery&#34;&gt;CSRF (Cross-Site Request Forgery)&lt;/h1&gt;&#xA;&lt;h3 id=&#34;basics&#34;&gt;Basics&lt;/h3&gt;&#xA;&lt;p&gt;CSRF tricks a &lt;strong&gt;victim&amp;rsquo;s browser&lt;/strong&gt; into performing an unwanted action on a different website where they are currently authenticated. Unlike XSS (which steals data), CSRF &lt;strong&gt;executes actions&lt;/strong&gt; (e.g., changing a password, deleting an account).&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-to-look-for&#34;&gt;What to look for&lt;/h3&gt;&#xA;&lt;p&gt;A useful CSRF target is a &lt;strong&gt;sensitive action&lt;/strong&gt; (usually a POST request) that does not require a unique CSRF token.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The Test:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;The Observation:&lt;/strong&gt; Find a form (like &amp;ldquo;Change Email&amp;rdquo;) and look at the request in Burp.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The Check:&lt;/strong&gt; Is there a random string like &lt;code&gt;csrf_token=a83j...&lt;/code&gt;? If &lt;strong&gt;NO&lt;/strong&gt;, it is likely vulnerable.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The Proof:&lt;/strong&gt; If you can submit the form by only knowing the victim&amp;rsquo;s new email address, you can &amp;ldquo;force&amp;rdquo; them to submit it via a hidden form on your own site.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;hr&gt;&#xA;&lt;h3 id=&#34;how-it-differs-from-related-issues&#34;&gt;How it differs from related issues&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;XSS:&lt;/strong&gt; Steals the cookie.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;CSRF:&lt;/strong&gt; Uses the cookie (without seeing it) to perform an action.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;SSRF:&lt;/strong&gt; Makes the &lt;em&gt;Server&lt;/em&gt; do the work.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h3 id=&#34;references&#34;&gt;References&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;&lt;a href=&#34;https://portswigger.net/burp/documentation/desktop/tools/engagement-tools/generate-csrf-poc&#34;&gt;Burp Suite - CSRF PoC Generator&lt;/a&gt;:&lt;/strong&gt; (Pro feature, but can be done manually) Generates the HTML to trigger the attack.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h3 id=&#34;scope-note&#34;&gt;Scope note&lt;/h3&gt;&#xA;&lt;p&gt;In &lt;strong&gt;OSCP&lt;/strong&gt;, CSRF is usually part of a chain. It may enable an administrative change that exposes another weakness, such as a file upload. Validate the impact after the request succeeds.&lt;/p&gt;</description>
    </item>
    <item>
      <title></title>
      <link>https://garrettoh.dev/notes/500-hacking/02_initial_access/02_web/sqli/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://garrettoh.dev/notes/500-hacking/02_initial_access/02_web/sqli/</guid>
      <description>&lt;h1 id=&#34;sql-injection-sqli&#34;&gt;SQL Injection (SQLi)&lt;/h1&gt;&#xA;&lt;h3 id=&#34;basics&#34;&gt;Basics&lt;/h3&gt;&#xA;&lt;p&gt;SQL Injection is a vulnerability where an application improperly handles user input, allowing an attacker to &amp;ldquo;inject&amp;rdquo; their own SQL commands into a database query. This can lead to unauthorized data access, data modification, or even full system compromise (RCE).&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-to-look-for&#34;&gt;What to look for&lt;/h3&gt;&#xA;&lt;p&gt;The classic sign of SQLi is a &lt;strong&gt;Database Error&lt;/strong&gt; or a &lt;strong&gt;Change in Page Content&lt;/strong&gt; when you input a single quote (&lt;code&gt;&#39;&lt;/code&gt;).&lt;/p&gt;</description>
    </item>
    <item>
      <title></title>
      <link>https://garrettoh.dev/notes/500-hacking/02_initial_access/02_web/ssrf/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://garrettoh.dev/notes/500-hacking/02_initial_access/02_web/ssrf/</guid>
      <description>&lt;h1 id=&#34;ssrf-server-side-request-forgery&#34;&gt;SSRF (Server-Side Request Forgery)&lt;/h1&gt;&#xA;&lt;h3 id=&#34;basics&#34;&gt;Basics&lt;/h3&gt;&#xA;&lt;p&gt;SSRF allows an attacker to induce the &lt;strong&gt;server-side application&lt;/strong&gt; to make requests to an arbitrary domain. Essentially, you are using the vulnerable server as a &amp;ldquo;proxy&amp;rdquo; to attack internal systems that you cannot reach directly from the internet.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-to-look-for&#34;&gt;What to look for&lt;/h3&gt;&#xA;&lt;p&gt;A common SSRF entry point is a &lt;strong&gt;user-controlled URL parameter&lt;/strong&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;The Test:&lt;/strong&gt;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;The Observation:&lt;/strong&gt; A feature that &amp;ldquo;fetches&amp;rdquo; content, like &lt;code&gt;http://site.com/preview?url=http://google.com&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The Manipulation:&lt;/strong&gt; Change the URL to an internal address: &lt;code&gt;url=http://127.0.0.1:80&lt;/code&gt; or &lt;code&gt;url=http://169.254.169.254&lt;/code&gt; (Cloud Metadata).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;The Result:&lt;/strong&gt; If the server returns internal data (like a local &lt;code&gt;index.html&lt;/code&gt; or AWS keys), you have SSRF&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;hr&gt;&#xA;&lt;h3 id=&#34;testing-workflow&#34;&gt;Testing workflow&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; &lt;strong&gt;Step 1: Internal Port Scanning&lt;/strong&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Use the server to scan itself: &lt;code&gt;url=http://127.0.0.1:22&lt;/code&gt;, &lt;code&gt;url=http://127.0.0.1:3306&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; &lt;strong&gt;Step 2: Cloud Metadata Exfiltration&lt;/strong&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;AWS:&lt;/strong&gt; &lt;code&gt;http://169.254.169.254/latest/meta-data/iam/security-credentials/&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Azure:&lt;/strong&gt; &lt;code&gt;http://169.254.169.254/metadata/instance?api-version=2021-02-01&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&lt;input disabled=&#34;&#34; type=&#34;checkbox&#34;&gt; &lt;strong&gt;Step 3: Access Local Files&lt;/strong&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Try the &lt;code&gt;file://&lt;/code&gt; protocol: &lt;code&gt;url=file:///etc/passwd&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;further-reading&#34;&gt;Further reading&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;a href=&#34;https://book.hacktricks.wiki/en/pentesting-web/ssrf-server-side-request-forgery/index.html&#34;&gt;HackTricks: SSRF&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;</description>
    </item>
    <item>
      <title></title>
      <link>https://garrettoh.dev/notes/500-hacking/02_initial_access/02_web/stti/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://garrettoh.dev/notes/500-hacking/02_initial_access/02_web/stti/</guid>
      <description>&lt;h1 id=&#34;ssti-server-side-template-injection&#34;&gt;SSTI (Server-Side Template Injection)&lt;/h1&gt;&#xA;&lt;h3 id=&#34;basics&#34;&gt;Basics&lt;/h3&gt;&#xA;&lt;p&gt;SSTI occurs when an application embeds user input directly into a &lt;strong&gt;Template Engine&lt;/strong&gt; (like Jinja2, Twig, or Mako) instead of passing it as data. Template engines are designed to execute code to generate dynamic HTML; if you can inject into them, you aren&amp;rsquo;t just changing text—you are running code on the server.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-to-look-for&#34;&gt;What to look for&lt;/h3&gt;&#xA;&lt;p&gt;A simple SSTI test is &lt;strong&gt;mathematical evaluation&lt;/strong&gt;: send an expression in the template syntax and check whether the server renders its result.&lt;/p&gt;</description>
    </item>
    <item>
      <title></title>
      <link>https://garrettoh.dev/notes/500-hacking/02_initial_access/02_web/xss/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://garrettoh.dev/notes/500-hacking/02_initial_access/02_web/xss/</guid>
      <description>&lt;h1 id=&#34;xss-cross-site-scripting&#34;&gt;XSS (Cross-Site Scripting)&lt;/h1&gt;&#xA;&lt;h3 id=&#34;basics&#34;&gt;Basics&lt;/h3&gt;&#xA;&lt;p&gt;XSS is an injection vulnerability where an attacker &amp;ldquo;tricks&amp;rdquo; a website into executing malicious JavaScript in a victim&amp;rsquo;s browser. The browser thinks the script came from the trusted website, so it allows the script to access cookies, session tokens, or perform actions as that user.&lt;/p&gt;&#xA;&lt;h3 id=&#34;what-to-look-for&#34;&gt;What to look for&lt;/h3&gt;&#xA;&lt;p&gt;Start by checking for &lt;strong&gt;reflection&lt;/strong&gt;.&#xA;If you type a unique string (like &lt;code&gt;XSS_TEST_123&lt;/code&gt;) into a search bar, a URL parameter, or a profile field, and that &lt;strong&gt;exact string appears in the page&amp;rsquo;s HTML source&lt;/strong&gt;, the site is likely vulnerable.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
