<?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[Secvibe.com - Medium]]></title>
        <description><![CDATA[What’s happening and what’s not in the Infosecurity world! - Medium]]></description>
        <link>https://medium.com/security-vibes?source=rss----eef65edaf8da---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Secvibe.com - Medium</title>
            <link>https://medium.com/security-vibes?source=rss----eef65edaf8da---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 01:31:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/security-vibes" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How an India Govt. Ministry exposed half a million records with Personally Identifiable Information]]></title>
            <link>https://medium.com/security-vibes/how-an-india-govt-854083d8ff71?source=rss----eef65edaf8da---4</link>
            <guid isPermaLink="false">https://medium.com/p/854083d8ff71</guid>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[hacking]]></category>
            <dc:creator><![CDATA[Roshan Thomas]]></dc:creator>
            <pubDate>Thu, 29 Jun 2017 21:04:36 GMT</pubDate>
            <atom:updated>2017-07-05T20:32:48.969Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>MTFBWY</strong> if the weakest link of your network is your MongoDB instance.</p><p>We often talk profoundly about how we protect our internet facing assets. The false sense of security often comes from the lack of understanding of our own exposure. In the past couple of years, working with many customers I have realized that no one possess an absolutely current inventory of assets. You may attribute the conundrum of maintaining an asset inventory to the frequent acquisition and mergers, never ending plans to migrate to cloud and deliberate violation of policies by developers, but the reality is that all of us have enough ports open to the internet. The wall we envisioned is in fact a net with proliferating holes.</p><p>With all respect to those who said cloud will help organizations setup enterprise class service with a snap of a finger, it also helps them dig enterprise class holes on the network without another snap of a finger. Imagine what happens when you forget the basics on the placement of a database server in network? Imagine what might happen if you keep the DB in the DMZ?</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-jcv6mh0uok%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-jcv6mh0uok&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F-jcv6mh0uok%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/12b19903c47ffb9cd024577cf62e04f7/href">https://medium.com/media/12b19903c47ffb9cd024577cf62e04f7/href</a></iframe><p>And here is the story of what happened:</p><h4>The discovery…</h4><p>One fine Saturday morning (which people from the same time zone often categorize as ‘afternoon’), I decided to perform a recon on one domain [let’s say ( somedomain.tld ). I happened to stumble up on a MongoDB server which belongs to the same domain on shodan.io. Just out of curiosity I tried the following query on shodan.io.</p><blockquote><a href="https://www.shodan.io/search?query=product%3A%22MongoDB%22&amp;page=1">product:”MongoDB”</a></blockquote><p>The result was quite surprising. A handful of servers in the first results page itself seemed to have no authentication in place!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*LxGy6up-GSv5vREGS0QMgw.png" /><figcaption>A MongoDB server with anonymous authentication</figcaption></figure><p>The next logical step I had to take was to verify the access to one of these servers. So I <a href="https://www.mongodb.com/download-center?filter=enterprise#compass">downloaded the MongoDB Compass</a> client. and tried to access the same database as an anonymous user, supplying no credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dyRbJZW7npq7Q11ToAeNEg.png" /><figcaption>Mongo DB Connection settings</figcaption></figure><p>And there you go, full access to the server with all the option to create, delete, retrieve, modify anything on the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u4KD96wFgefg08rPHImiOg.png" /><figcaption>Unauthenticated access to a MongoDB server</figcaption></figure><h4>Exploration continues…</h4><p>Well and good. So what? There are a handful of MongoDB servers exposed to network, with no authentication in place. So what? The skeptic in me started questioning myself and I had to find other ways to convince myself that this is not an isolated incident.</p><p>So I started browsing through the result pages.</p><ol><li><a href="https://www.shodan.io/search?query=product%3A%22MongoDB%22&amp;page=1">Page 1</a>– 5/10</li><li><a href="https://www.shodan.io/search?query=product%3A%22MongoDB%22&amp;page=2">Page 2</a>– 4/10</li><li><a href="https://www.shodan.io/search?query=product%3A%22MongoDB%22&amp;page=3">Page 3</a>– 5/10</li><li><a href="https://www.shodan.io/search?query=product%3A%22MongoDB%22&amp;page=4">Page 4</a>– 4/10</li><li><a href="https://www.shodan.io/search?query=product%3A%22MongoDB%22&amp;page=5">Page 5</a>– 2/10</li></ol><p>20 out of 50 doesn’t look so bad. [I had to stop counting at the 5th page because I was using a free shodan account.] So the statistics which say 40% was kind of surprising. Does it actually imply that almost 40% of the MongoDB instances out there allow unauthenticated access? Not necessarily. Statistically speaking, the number 50 isn’t even sufficient to be called a ‘representative sample’ when you consider a tool with a significantly large user base.</p><p>So I decided to dig a little deeper. What if I try to dig into the result for each country?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*nFUVHe4yutJUh2aY_1Pp2w.png" /><figcaption>Shodan — Country-wise results for MongoDB servers</figcaption></figure><p>And these were the results.</p><ol><li><a href="https://www.shodan.io/search?query=product%3A&quot;MongoDB&quot;+country%3A&quot;US&quot;">United States</a> — 16/50</li><li><a href="https://www.shodan.io/search?query=product%3A&quot;MongoDB&quot;+country%3A&quot;CN&quot;">China</a> — 17/50</li><li><a href="https://www.shodan.io/search?query=product%3A&quot;MongoDB&quot;+country%3A&quot;DE&quot;">Germany</a> — 13/50</li><li><a href="https://www.shodan.io/search?query=product%3A%22MongoDB%22+country%3A%22FR%22">France</a> — 16/50</li><li><a href="https://www.shodan.io/search?query=product%3A&quot;MongoDB&quot;+country%3A&quot;NL&quot;">Netherlands</a> — 20/50</li><li>India — 24/50</li></ol><p>106/300 ! Approximately 35%. That’s a shocking figure I think.</p><h4>Collateral discoveries</h4><p>There were two collateral discoveries made while I explored these.</p><ul><li><strong>I wasn’t the only one</strong></li></ul><p>Quite a while after browsing through so many shodan result pages, I realized that I wasn’t the only one who figured this out. And guess what, they already started making money out of it too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*W9a4ZBh4DrOApRaAYvYefw.png" /><figcaption>A record left by the attacker in one of the compromised MongoDB instance.</figcaption></figure><p>More than half of the vulnerable instances discovered were already compromised by attackers.</p><ul><li><a href="https://uidai.gov.in/"><strong>AADHAAR [UIDAI]</strong></a><strong> was a bad idea when the govt. agencies themselves have no clue how to protect personal information</strong></li></ul><p>One of the servers apparently owned by a Central Government entity was identified to have the same vulnerability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*GFPe3hxcxpWjedthqk0T-g.png" /><figcaption>Compromised server most likely owned by a central ministry.</figcaption></figure><p>The ‘test’ database had close to 5 lakh records of personal information including, but not limited to;</p><ol><li>Aadhaar No:</li><li>PAN Card No:</li><li>Bank Account No:</li><li>Username/Password</li><li>Transaction Details/ Salary Details</li><li>Address</li><li>Date of Birth</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BlyPpzQlN8QqRtCdBgaC5Q.png" /><figcaption>Admin credentials- password hash</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/1*m4-XHRCkNPyAHcUlWYaVmQ.png" /><figcaption>Account number and bank details in one of the records.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Bd_0JY5WMD90fCl4U3i8uQ.png" /><figcaption>A record revealing multiple personal information.</figcaption></figure><p>In short, every single data needed by an identity thief to impersonate someone! To top it all, this server was already compromised by attackers too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0-75qiazVioyHCTIaF16Jw.png" /><figcaption>A record left by the hackers</figcaption></figure><p>I reported this to the ministry by mid April and didn’t receive any response. The issue seem to be fixed now as they enabled authentication for MongoDB and hence I am responsibly disclosing the issue even though there was no acknowledgement from their side ;)</p><h4>The Solution</h4><p>MongoDB users and admins can follow this guideline to secure their instances.</p><p><a href="https://docs.mongodb.com/manual/administration/security-checklist/">MongoDB Security Checklist</a></p><h4>Update</h4><p>The government entity mentioned in the article is Coal Ministry Provident Fund Organization. The server mentioned was found to host a test instance of CMPFO e Services on port 3000.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=854083d8ff71" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-vibes/how-an-india-govt-854083d8ff71">How an India Govt. Ministry exposed half a million records with Personally Identifiable Information</a> was originally published in <a href="https://medium.com/security-vibes">Secvibe.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Non-intrusive reconnaissance — A step-by-step guide]]></title>
            <link>https://medium.com/security-vibes/non-intrusive-reconnaissance-a-step-by-step-guide-e1cc3a88e679?source=rss----eef65edaf8da---4</link>
            <guid isPermaLink="false">https://medium.com/p/e1cc3a88e679</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[reconnaissance]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Roshan Thomas]]></dc:creator>
            <pubDate>Fri, 07 Apr 2017 19:27:48 GMT</pubDate>
            <atom:updated>2017-04-07T19:27:48.316Z</atom:updated>
            <content:encoded><![CDATA[<p>Reconnaissance is the first stage of a hacking process. During this stage, the attacker collects as much information as possible about the target from publicly available sources. Most common sources used are search engines, social networks &amp; technical forums. It’s during this stage the attacker identifies low hanging fruits and the weak spots of the target. The information collected in the reconnaissance stage is used in further stages to tailor attacks against a particular weak spot of the organization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*RXJNuOcYzFY7G4ZFR8s55Q.png" /><figcaption>Attack lifecycle; Source FireEye</figcaption></figure><p>The objective of reconnaissance is to have a fair idea of the architecture of the target organization and gather as much data as possible including employee contact details as these data can be further used in launching pivoted attacks such as spear phishing. Banners obtained from internet may sometimes expose the services and versions of software running on target systems which makes it very easy for an attacker to try out known exploits.</p><p>Initial recon itself is divided into two — passive and active reconnaissance. As the name suggests, in passive reconnaissance, the attacker tries to be as non-intrusive as possible to stay out of the target’s radar. Public domain data is the main source of information in this stage of an attack. The key motto of a passive reconnaissance is to identify the attack surface without triggering any alert. In this article I will be going through the approach methodology which I use while performing a passive recon exercise.</p><h4>Identifying the information of interest</h4><p>Though to exaggerate we can say that all the information we collect may be useful, identifying relevant information in the early stages itself is important. The relevance of information may vary with respect to target entity. However, the following can be considered as the best bet.</p><ol><li>Domain Names</li><li>IP Blocks</li><li>Subdomains</li><li>Open ports and services</li><li>OS and Server information</li><li>Non-HTML files and metadata</li><li>Employee information</li></ol><h4>Identifying domains</h4><p>After identifying the primary domain of a company, to know the actual internet footprint, we need list all the other domains owned by the same entity. First step in this is to identify company subsidiaries and their domains either from the primary website or google.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SXi7XWAHDOfZbsPQ0OQx5A.png" /><figcaption>Google Subsidiaries; Google Search Results</figcaption></figure><p>There may also be other domains owned by the company for various reasons including but not limited to — Phishing protection, Intellectual Property protection, Content Delivery Networks etc.</p><p>That takes us to the next step — leveraging whois information of known domains to perform a reverse whois lookup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*ElOcRxFapDiAhMyN7sUpvw.png" /><figcaption>Identifying more domains owned by the entity!</figcaption></figure><p>For example facebook.com is the known domain of our target entity. By querying the whois database, we can identify the registrant email address as domain@fb.com. The same can be used to performa reverse whoisquery to identify all the domains registered by the same registrant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*B31ox681RZXa1eYR4Kv8aQ.png" /><figcaption>Whois &amp; reverse whois to identify domains</figcaption></figure><h4>Identifying IP blocks owned by the target entity</h4><p>Second step is to identify the public IP blocks of the target entity. This can be obtained by performing the following cyclic process. To effectively identify all the net blocks owned by a company, the known domains must be resolved to IP addresses first. Once this information is obtained, whois records for those IPs can be checked to know the details including size of net block which includes the IP and registrant information. The registrant information thus obtained can be used to perform a reverse who is look up for identifying net blocks owned by the company. Parallely, reverse whois queries with known aliases of the target entity can also be performed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/565/1*Ty5qBkd1NrYxQsoCLg1Szw.png" /><figcaption>Obtaining IP block information</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/271/1*CrdaFVhM819Mbu8GgY2FWQ.png" /><figcaption>DNS query</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*jK-CtKUE5zyoYYk4uYG1kw.png" /><figcaption>Whois records for IP</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*zXxqODTPrv-a-N382nIvsQ.png" /><figcaption>IP blocks owned by Twitter</figcaption></figure><h4>Identifying subdomains</h4><p>Identifying the subdomains and other domains of the target organisation is the next logical step of reconnaissance as that would help in increasing the attack surface significantly. There are a couple of methods which can be used for the same including the ones listed below.</p><ol><li>Reverse DNS lookup on IP addresses identified</li><li>Search engines</li><li>DNS enumeration with a word dictionary of commonly used subdomain names.</li><li>DNS Zone transfer</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*Lt5H7j-VkdiWSopFmGgVBw.png" /><figcaption>Identifying subdomains: Different methods</figcaption></figure><p>There are multiple tools which can be used for the above purpose, each with a variety of options.</p><p>Attacker looks at an organisation from a different perspective. For him/her the maximum internet footprint means the maximum attack surface. This also imply that there would be a proportional amount of unpatched services facing the internet. So finding maximum subdomains will help the attacker in identifying maximum web applications. It is through web applications most of the successful data breaches happen as per 2014 XForce report.</p><h4>Identifying open ports &amp; services</h4><p>The next steps after identifying the internet footprint of the target organisation is to focus on technologies used by the target. In the reconnaissance stage we wouldn’t be actively probing the target for open ports or services and versions, rather rely on public sources for these details.</p><p>Gathering the system, software and version information would help the attacker to tailor exploits which uses vulnerabilities which are very specific to target systems.</p><p><a href="http://shodan.io/"><strong>Shodan.io</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*9m0PY9z9l2kEl2ND4z55fg.png" /></figure><p>Shodan is a popular search engine which crawls the internet for devices. It searches for banners and ports which hosts standard and non-standard services. Since the searches are not limited to http(s) a large amount of information regarding other services like ftp, ssh etc. can be obtained from the banners of these services crawled by shodan bots.</p><p><a href="https://www.netcraft.com/"><strong>Netcraft.com</strong></a></p><p>The netcraft is a goldmine of web/application server and hosting information. They also have historical data of what the servers used to run on in the past. The domains and URLs can be queried in netcraft to identify this information.</p><h4>Exploring the people factor</h4><p>Most sophisticated attacks employ social engineering as a part of the attack. To perform social engineering effectively contact information of privileged users is inevitable. It is during this stage; attackers search in all available public sources for information of target employees. Contact information including email addresses, phone numbers, social media accounts are all useful. The information obtained in this stage can be used for spear phishing attacks.</p><p>The following resources can be useful in getting user names, email addresses etc.</p><ol><li>LinkedIn</li><li>Search Engines</li><li>Social Media</li><li>Glass Door (To find job titles)</li><li>Job Portals</li><li>File Metadata</li><li>Whois records</li></ol><p>A large number of tools provide people search functionality. Maltego, FOCA, metagoofil, the Harvester etc. can be very useful in the same.</p><h4>Exploring Files of Interest</h4><p>Files &amp; sensitive data available on internet are of prime importance in reconnaissance of a target. There are a range of data which can be obtained from files. The data can be broadly categorized into two.</p><ol><li>Sensitive file content: Usernames, emails, passwords, account number, credit card details</li><li>File Metadata: User accounts, Computer name, Email, Internal IPs, Printers</li></ol><p><strong>FOCA</strong></p><p>FOCA (Fingerprinting Organizations with Collected Archives) is a reconnaissance tool which collects information about target organisations using different techniques including DNS queries, reverse DNS lookup and search engines. A particular feature of interest is the file search functionality which uses search engines like Google, Bing and Exalead to download documents which are on the target domain. This feature uses google dorks to identify the non HTML content hosted on the domains and then download the same and extract the metadata and then analyse the metadata for useful information.</p><p>The software &amp; Operating system details can help in crafting targeted exploits. For eg: if a user uses a vulnerable version of Adobe PDF reader or Microsoft Excel files with exploit macros can be sent to users to compromise the PC. Folder names can sometimes be useful to enumerate users and in understanding the directory structure. Details of printers are another set of useful information as printer networks are often ignored or access controls will not be properly enforced. Once in the internal network, access to printer network can help in escalating access to other parts of network or sensitive information being printed.</p><p>You may also read my earlier blogpost — <a href="https://secvibe.com/let-s-agree-that-everything-is-doomed-5d32f8b8c44e">Let’s agree that everything is doomed!</a> — about how I was able to get source code of applications from one of the servers belonging to a major private sector bank in India using google dorks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1cc3a88e679" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-vibes/non-intrusive-reconnaissance-a-step-by-step-guide-e1cc3a88e679">Non-intrusive reconnaissance — A step-by-step guide</a> was originally published in <a href="https://medium.com/security-vibes">Secvibe.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A little about Advanced Persistent Threats]]></title>
            <link>https://medium.com/security-vibes/a-little-about-advanced-persistent-threats-4b7d40cab49?source=rss----eef65edaf8da---4</link>
            <guid isPermaLink="false">https://medium.com/p/4b7d40cab49</guid>
            <category><![CDATA[apt]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[malware]]></category>
            <dc:creator><![CDATA[Roshan Thomas]]></dc:creator>
            <pubDate>Sat, 26 Nov 2016 03:01:03 GMT</pubDate>
            <atom:updated>2016-11-26T03:03:39.866Z</atom:updated>
            <content:encoded><![CDATA[<p>Much has been told about APTs and any detailing on APT might sound like a cliche scare tactic. However I would share a couple of details as I believe that it is important not to forget the same.</p><p>Advanced Persistent Threats are an advanced class of extremely stealthy malwares designed for the purpose of data exfiltration. Unlike conventional malwares, these malicious processes possessed the capability of evading any signature based detection systems such as Firewalls, IDS, IPS and typically remained dormant for a very long period of time. The term Advanced Persistent Threat is believed to have <a href="http://www.darkreading.com/partner-perspectives/bitdefender/the-anatomy-of-advanced-persistent-threats/a/d-id/1319525">coined by Colonel Greg Rattray of the US Air Force</a>. Stuxnet computer worm which affected the Iranian Nuclear Program is one of the earliest examples of an Advanced Persistent Threat.</p><p>Due to the complexity of the attack method and sophisticated nature, it is widely believed that APT groups are often powered by nation states to steal high value sensitive information. In the recent past, there have been instances where APT groups have targeted defense and aerospace organizations (FireEye, 2016). Though the APTs follow an attack life cycle similar to that of conventional breaches, the key difference is that they are stealthy. Quite often the malwares lay dormant for years so that even internal monitoring mechanisms would miss any suspicious activity.</p><p>APTs have been around for quite some time now. The first known targeted APT is Agent.btz which targeted military and diplomatic organizations between 2007 and 2009. Agent.btz primarily targeted Windows systems and were spread through social engineering and USB drives. The malware also was able to self-replicate and was used for cyber espionage and data theft. Though the malware is inactive now, improved variants including Turla and Epic Turla has marked their presence in 2015.</p><p>APT is an active area of research as more and more advanced variants are being detected every day and the attack methods are becoming more sophisticated and more persistent.</p><h3>The attack life cycle of APTs</h3><p>The attack lifecycle of APTs are somewhat similar to conventional attacks. It consists of all the stages including Initial Reconnaissance, Initial Compromise, Establish Foothold, Privilege Escalation, Lateral Expansion, Maintain Presence and Mission Completion (Radzikowski, 2016).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*BaiB7Du-qT8Kjyz-5KxYRQ.png" /><figcaption>The attack life cycle of APTs</figcaption></figure><p>While conventional malwares typically opt generic vulnerabilities to launch the payloads, APTs operate specific to the target. A great amount of research and reconnaissance is done in identifying potential weak targets. Attackers usually target people with significant access and privileges in the network or domain. Contrary to the common belief, soft targets including higher management are often ignored in these kind of attacks unless the attacker finds a notable escalation opportunity. Spear phishing is the most common launch method. The targeted nature of spear phishing makes it different from typical phishing scams which are targeted to millions of people. The target of spear phishing would be a single or very few number of employees. And the email would appear to have come from a trusted source of authority, for example, Manager, Payroll or HR. The payload would be a macro or an active content embedded on to PDF, Excel, Word document or any similar file which is not being monitored closely in the network.</p><p>Once the payload is deployed using spear phishing or other social engineering methods, the malware tries to attain foothold on the network. From this stage itself APTs utilize sophisticated methods including zero day vulnerabilities. After establishing foothold to maintain the controls, it will create one or more persistent backdoors. These backdoor channels typically run on a higher un monitored port. Quite often they also have been seen using trusted encrypted channels. Peculiarities like polymorphism helps them remain undetected in the network for a very long time. Also during this time, the malwares evolve periodically. Some APT’s will even have a dedicated person to control and update them.</p><p>After establishing foothold and maintaining persistence, the malware will try to escalate its access level by moving laterally and spreading to other systems in the network. Such an access escalation is often performed stealthily after monitoring the network pattern for over a long period of time. Spreading across the network helps the APTs in increasing the foothold. The lateral expansion is then followed by privilege escalation. Sniffed credentials or zero-day buffer overflow exploits on specific services in the network are utilized for this purpose.</p><p>The APT will then keep waiting for high value information and the specific information will then be encrypted and transmitted to the command and control systems. Unlike typical viruses or worms, APTs will never disrupt the daily operations as it would make their presence evident. To maintain presence, they routinely change their structure, code and method of execution as well as exfiltration.</p><p>The following peculiarities of the attack life cycle makes them a distinct class of attacks.</p><ol><li>Extensive research for initial reconnaissance.</li><li>Target specific infiltration using spear phishing.</li><li>Prolonged presence and persistence maintenance.</li><li>Use of advanced methods and zero-day vulnerabilities for access and escalation.</li><li>Sophisticated stealth methods including poly morphism and very long period of dormancy.</li><li>A well-defined high value target or data.</li><li>No disruption to normal services.</li><li>Use of secure channels for data exfiltration.</li><li>Very small data rates to avoid alerts.</li><li>Dedicated team or person form managing the CNC.</li></ol><h3>Infiltration Methods</h3><p>Multiple attack methods are used by APT for the initial exploit. Sometimes the attacks might also be chained in order to gain the initial access or deploy the attack payload (Symantec, 2011).</p><h4>Spear Phishing</h4><p>As discussed in the previous section spear phishing is a targeted phishing attack towards an entity or a specific individual. To be successful, the attackers might learn personal information about the target and craft very specific emails. Unlike the normal phishing campaigns which rely on ‘spray and hit’ by sending thousands of emails and hoping a percentage of the recipients would click on it, spear phishing targets individuals of high value and contributes around 91% successful attacks in today’s world. To make the email look realistic, the attackers would make use of insecurely configured mail servers, spoofing and a variety of techniques to evade spam filters.</p><h4>Social Engineering</h4><p>Though spear phishing is the most common and successful attack vector in deploying APTs, other social engineering methods are also used. In these methods it lures unsuspecting employees to click on malicious content hosted outside the company network. Active content embedded on to a PDF resume submitted via a job portal to HR department is an example of this sort of attack. The employee on opening the document will inadvertently run the active content. Active contents embedded to such files are commonly used in fetching malicious content.</p><h4>SQL Injection</h4><p>SQL injection is a web application vulnerability which lets an attacker inject arbitrary SQL queries to the backend database of an application. SQL injection can be used to obtain shell access on Database Servers. Since most of the attack process is happening via the web application, it would appear as genuine web traffic and won’t be visible to network layer controls deployed. Thus the attacker would get a secure passage to the trusted network through DMZ, bypassing the firewalls, IPS and other controls. If the APT is deployed via SQLi attack, it would also be able to quickly escalate the privileges compared to months taken by a spear phishing driven attack.</p><h4>Zero-day Vulnerabilities</h4><p>Zero-day vulnerabilities are undisclosed security issues pertaining to systems and services. In this case, victim will have no way of protecting against the attack as neither signatures to detect the attack, nor patches to protect from the vulnerability will be available. APTs often use Zero-days for initial compromise and switch to new zero-day vulnerabilities as the initial ones are fixed. Hydraq used this method for infiltration and propagation. Stuxnet on the other hand was exceptional as it used four separate zero-day vulnerabilities simultaneously to successfully infiltrate (Intelligence, Fireeye Isight, 2016). The more sophisticated APTs tend to use zero-days as it is the best way to cover the tracks and remain undetected.</p><h3>Examples — Stuxnet &amp; Flame</h3><h4>Stuxnet</h4><p>Of all the APTs identified so far, Stuxnet is the most popular. Stuxnet was the first cyber weapon created with the intention to cause actual physical damage. It was originally developed to sabotage Iran’s Uranium enrichment process. It infected and stayed undetected for about three years before being identified by Sergey Ulasen of VirusBlokAda.</p><p>The initial infection of the worm was through removable storage devices such as flash drives and it established foothold by infecting Windows machines in the network. It used four zero day vulnerabilities simultaneously for the purpose compromising windows machine and is the first APT to have used zero day vulnerabilities for propagation in an extensive manner. Stuxnet infected the Siemens 7 software for PLC SCADA systems used to control the centrifuges. It reportedly leaked sensitive data about the enrichment process and fed bogus data to the centrifuge and reportedly tore it apart sabotaging Iran’s years long attempt to enrich weapon grade Uranium. Stuxnet drivers used valid Realtek and JMicron signatures. This helped them in evading detection by anti-virus solutions and whitelisting HIPS.</p><p>Due to the nature of the target and the sophistication of attack methodologies, it is widely believed that Stuxnet was a nation-state funded campaign organised by the United States or Israel (Kaspersky Labs, 2016).</p><h4>Flame</h4><p>Flame is another cyber espionage malware which targeted middle eastern countries. The malware was targeted towards windows systems and spread through USB sticks and LAN. Flame included a rootkit, which could evade all signature based detection systems. It had the capabilities to record audio, screenshots, keyboard activity and network traffic. It could also record skype conversations and could attempt to download contact information from surrounding Bluetooth devices.</p><p>Flame was written purely for the purpose of espionage and the malware sent information back to command and Control systems across the world. With behavioural analysis, it was able to understand that the malware particularly was looking for AutoCAD drawings, PDF and text files.</p><h3>How to protect from APTs</h3><p>There is no single magic solution for APTs as the methods and techniques used by APTs are constantly evolving. Defence is depth is the key idea which is being suggested by experts. (Tankard, 2011)</p><h4>Multiple Layers of Protection</h4><p>APTs often use different methods for different stages of the attack life cycle. No single solution would be able to detect and alert about an APT. So the ideal approach for thwarting APT threats is to use multiple layers of protection (Mong, 2016). Rather than completely relying on a firewall of an IPS, implement additional layers of protection including anti viruses and host based firewalls.</p><h4>APT Solutions</h4><p>With the advent of APTs, numerous APT solutions have also been introduced to the market. The major players in the arena includes FireEye, Bluecoat, Fidelis, Symantec and Intel Security (The Radicati Group, 2016). Most of these solutions also claim to have a behavioural analysis module which tries to identify network traffic patterns for data exfiltration. They also have a conventional signature based algorithm which will double up as an anti-virus as well. Solutions including FireEye also provides the option of analysing the malware in a sandbox virtual environment.</p><h4>Security Information and Event Management Solutions</h4><p>As the APT attack life cycle is a co-ordinated long term process, prolonged log analysis becomes a necessity in target environments. Even though most APTs go undetected in the initial stages, SIEM solutions can be useful in identifying attacks for lateral expansion and privilege escalation by correlating it to other network events (Raywood, 2013). Correlation also would help in tracing back any unusual activity to the source of infection.</p><h4>Cybersecurity Awareness and Training</h4><p>As spear phishing is the most common initial attack vector, it is absolutely necessary that the potential target employees be made aware of the cyber-attacks like phishing. Computer based training modules and routine hands-on exercises and vulnerability assessments will help the employees in educating themselves about the potential threat (Benetis, Cano, Dimitriadis, &amp; Stewart-Rattray, 2013). The incident handling team also should be educated to correlate incidents even though they initially appear to be unrelated.</p><h3>Works Cited</h3><p>Arsene, L. (2015, March 18). <em>The Anatomy of Advanced Persistent Threats.</em> Retrieved from Dark Reading: <a href="http://www.darkreading.com/partner-perspectives/bitdefender/the-anatomy-of-advanced-persistent-threats/a/d-id/1319525">http://www.darkreading.com/partner-perspectives/bitdefender/the-anatomy-of-advanced-persistent-threats/a/d-id/1319525</a></p><p>Benetis, V., Cano, J. J., Dimitriadis, C. K., &amp; Stewart-Rattray, J. (2013). <em>Advanced Persistent Threat Awareness.</em> ISACA.</p><p>FireEye. (2016). <em>Cyber threats to aerospace and defence industries — Industry Intelligence Report.</em> FireEye.</p><p>Intelligence, Fireeye Isight. (2016). <em>Critical Lessons from 15 years of ICS vulnerabilities.</em> Industrial Control Systems (ICS) Vulnerability Trend Report.</p><p>Kaspersky Labs. (2016, October 29). <em>Targeted CyberAttacks Logbook</em>. Retrieved from Securelist: <a href="https://apt.securelist.com/">https://apt.securelist.com/</a></p><p>Mong, F. (2016, July 11). <em>Does Defense In Depth Still Work Against Today’s Cyber Threats?</em> Retrieved from Dark Reading: <a href="http://www.darkreading.com/threat-intelligence/does-defense-in-depth-still-work-against-todays-cyber-threats/a/d-id/1326146">http://www.darkreading.com/threat-intelligence/does-defense-in-depth-still-work-against-todays-cyber-threats/a/d-id/1326146</a></p><p>Radzikowski, P. S. (2016, February 11). <em>CyberSecurity: Expanded Look at the APT Life Cycle and Mitigation</em>. Retrieved from Dr. Shem: <a href="http://drshem.com/2016/02/11/cybersecurity-expanded-look-apt-life-cycle-mitigation/">http://drshem.com/2016/02/11/cybersecurity-expanded-look-apt-life-cycle-mitigation/</a></p><p>Raywood, D. (2013, March 12). <em>Gartner conference: Integrate IAM and SIEM to prevent APTs</em>. Retrieved from SC Magazine: <a href="http://www.scmagazineuk.com/gartner-conference-integrate-iam-and-siem-to-prevent-apts/article/283970/">http://www.scmagazineuk.com/gartner-conference-integrate-iam-and-siem-to-prevent-apts/article/283970/</a></p><p>Symantec. (2011). <em>Advanced Persistent Threats: A Symantec Perspective ; Preparing the Right Defense for the New Threat Landscape.</em> Symantec.</p><p>Tankard, C. (2011). Advanced Persistent threats and how to monitor and deter them. <em>Network Security</em>, 16–19.</p><p>The Radicati Group, I. (2016). <em>Advanced Persistent Threat (APT) Protection — Market Quadrant 2016.</em> Palo Alto, CA: The Radicati Group, Inc.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b7d40cab49" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-vibes/a-little-about-advanced-persistent-threats-4b7d40cab49">A little about Advanced Persistent Threats</a> was originally published in <a href="https://medium.com/security-vibes">Secvibe.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Penetrating Android Mobile Applications]]></title>
            <link>https://medium.com/security-vibes/android-appsec-27855dca8531?source=rss----eef65edaf8da---4</link>
            <guid isPermaLink="false">https://medium.com/p/27855dca8531</guid>
            <category><![CDATA[mobile-appsec]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[application-security]]></category>
            <dc:creator><![CDATA[Roshan Thomas]]></dc:creator>
            <pubDate>Sat, 01 Oct 2016 16:50:20 GMT</pubDate>
            <atom:updated>2016-10-08T07:25:51.623Z</atom:updated>
            <content:encoded><![CDATA[<p>The previous article <a href="https://secvibe.com/intercepting-android-traffic-for-mobile-appsec-2ba634995f6f#.26j7wbum9">Intercepting Android traffic for Mobile Appsec</a> discussed how Android Mobile Application traffic can be intercepted using Burpsuite to perform Mobile Appsec. However it didn’t cover the method which can be used for applications which rely on SSL pinning. The following tutorial and instructions were prepared for the presentation <a href="https://www.owasp.org/index.php/2016_BASC_Presentations">Penetrating Android Applications</a> delivered at OWASP BASC 2016 by <a href="https://www.linkedin.com/in/roshanpty">me</a> and <a href="https://www.linkedin.com/in/anurag-dwivedy">Anurag Dwivedy.</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.slideshare.net%2Fslideshow%2Fembed_code%2Fkey%2F3uEptpjjtsSh0L&amp;url=http%3A%2F%2Fwww.slideshare.net%2FRoshanThomas24%2Fpenetrating-android-aapplications&amp;image=http%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fpenetratingandroidapplications-161008072313-thumbnail-4.jpg%3Fcb%3D1475911475&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=slideshare" width="600" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/ea74a07eb471c7e789b9c825ae666a3f/href">https://medium.com/media/ea74a07eb471c7e789b9c825ae666a3f/href</a></iframe><p>Disclaimer: The application packages, zip archives, sample apks, tools etc are not developed by me. Install them on your device at your own risk. To avoid damaging your device, it is recommended to perform the same on a Virtual Device.</p><p>In the following section I would detail the steps. I have also embedded a video tutorial of the same for better understanding.</p><h3>Intercepting Android Mobile Traffic — A step-by-step guide</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fys9I-SDHlEI%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dys9I-SDHlEI&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fys9I-SDHlEI%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/01aab87dfb737fc590a32302c51e24a8/href">https://medium.com/media/01aab87dfb737fc590a32302c51e24a8/href</a></iframe><h4>1. PREREQUISITES</h4><p>a . Android SDK : <a href="https://developer.android.com/studio/index.html">https://developer.android.com/studio/index.html</a> <br>b . Genymotion : <a href="https://www.genymotion.com/">https://www.genymotion.com/</a> <br>c . Oracle VirtualBox</p><p>Details on how to install Genymotion is available in the <a href="https://secvibe.com/intercepting-android-traffic-for-mobile-appsec-2ba634995f6f#.26j7wbum9">previous article</a>.</p><h4>2. PREPARE THE DEVICE</h4><p><strong><em>a. Add and Start Genymotion AVD of choice. </em></strong>(Google Nexus 5X Android 6.0 in the video)</p><p><strong><em>b . Install Google Play Services</em></strong> : The following steps are applicable only for Android 6.0. For other Versions refer <a href="https://github.com/codepath/android_guides/wiki/Genymotion-2.0-Emulators-with-Google-Play-support">Genymotion 2.0 Emulators with Google Play support</a>.</p><ul><li>Flash the following three archives by dragging and dropping the same on the AVD. If you are using an actual device, you can boot in recovery mode and flash the files using TWRP/Cyanogenmod Recovery.</li><li>Flash the files in the order.</li><li>Restart the AVD after flashing each file.</li><li>Login to Google Play with your google account after installing the 2nd archive, before installing the 3rd one.</li></ul><ol><li><a href="http://www14.zippyshare.com/v/44278764/file.html">Genymotion-ARM-Translation_v1.1</a></li><li><a href="https://www.androidfilehost.com/?fid=96042739161891406">gapps-L-4–21–15</a></li><li><a href="https://www.androidfilehost.com/?fid=24052804347835438">benzo-gapps-M-20151011-signed-chroma-r3</a></li></ol><h4>3. INTERCEPTING NON-SSL TRAFFIC</h4><ol><li>Open <a href="https://portswigger.net/burp/">Burpsuite</a></li><li>Navigate to <strong>Proxy &gt; Options</strong></li><li>Add a proxy listener on your laptop/desktop’s IP address and any desired port. [ Use<strong> ipconfig/ifconfig</strong> to determine your local IP]</li><li>Open the Android Virtual Device.</li><li>Navigate to <strong>Settings &gt; WiFi</strong></li><li>Tap and hold the currently connected SSID and then tap ‘<strong>Modify Network</strong>’ in the context menu which pops up.</li><li>Check <strong>Advanced Options</strong>.</li><li><strong>Proxy &gt;Manual</strong></li><li>Set the IP and port of the burp proxy listener.</li><li>Access a non-https website in Android Browser</li><li>Capture the request and response in Burp</li></ol><h4><strong>4. INTERCEPTING SSL APPLICATIONS</strong></h4><p>a. Download and install Instagram from Play Store.<br>b. Try to intercept the traffic with the previous method. The application will alert Network Error.<br>c. This is because of the certificate error as Burp acts as a man in the middle and issues it’s own certificate. <br>d. To bypass the error the burp certificate has to be added to the trusted credentials of the device.</p><ol><li>Open Burp</li><li>Navigate to <strong>Proxy &gt;Options</strong></li><li><strong>Export CA Certificate</strong> in <strong>DER format </strong>(as burp.crt)</li><li>Open the AVD</li><li>Copy the <strong>burp.crt</strong> fie to the device. [You can use <strong>adb push</strong> command or simply drag and drop the file if you are using Genymotion AVDs.]</li><li>Navigate to<strong> Settings &gt;Security &gt;Install from SD Card</strong></li><li>Install the certificate</li><li>Add PIN/password authentication if prompted.</li><li>Open <strong>Instagram </strong>App</li><li>Enter a username and password and Click on <strong>Login</strong></li><li>Capture the request and response in Burp.</li></ol><h4>5. INTERCEPTING APPS WHICH USE SSL PINNING</h4><p>It can be observed that the same set up doesn’t work for the <a href="http://here (http://security-assessment.com/files/documents/whitepapers/SSLPinningExample.zip">sample app</a>. The application used here is a sample app developed by Denis Andzakovic of Security-Assessment.com.</p><p>To bypass the SSL pinning technique used in the application we have to use a trust killer. For older versions of Android, A <strong>Cydia Substrate</strong> module <strong>Android Trust Killer</strong> by <strong>ISEC partners</strong> can be used. Here for this AVD we are using an <strong>Xposed Framework</strong> module <strong>JustTrustMe</strong>.</p><p><strong><em>Install Xposed Framework</em></strong></p><ol><li>Run the ‘<a href="https://github.com/rovo89/GenyFlash">GenyFlash-master</a>’ tool in command prompt.</li><li>Flash the Xposed zip archive on the AVD. : For Nexus 5x Genymtion Android 6.0, select sdk23 * x86 from <a href="http://dl-xda.xposed.info/framework/">http://dl-xda.xposed.info/framework/</a></li><li>Install the <a href="http://dl-1.va.us.xda-developers.com/3/3/8/3/7/7/6/XposedInstaller_3.0_alpha4.apk?key=gBfviOaYbYqvVsDovbmp8w&amp;ts=1475031500">xposed installer apk</a></li><li>Install <strong>SuperSU</strong> binary</li><li>Install <strong>SuperSU</strong> apk</li><li>Install xposed module <a href="https://github.com/Fuzion24/JustTrustMe">JustTrustMe.apk</a></li></ol><p>Voila!, Now you would be able to intercept any traffic from an application which uses SSL pinning. However there are any applications which uses custom Certificate Verification logic. The above click and go procedures may not work for them. In that particular case you would have to decompile the application [using apktool] remove or manipulate the certificate verification logic, recompile the same and sign the apk.</p><h3>Decompiling &amp; Disassembling Android Native Applications</h3><h4>1. DECOMPILING THE APPLICATION FILE TO READ THE JAVA CLASS FILES</h4><p>Android application packages — APKs are an archive of Dalvik Executable or DEX code. DEX is the machine code specific for Dalvik Virtual Machine or Android Run Time on which the android applications run. While packaging an application the process is as follows.</p><p>Code in Java &gt; Compiled to dex &gt; Packaged into an APK archive</p><p>Reverse engineering essentially do the entire above process in the reverse order.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F6F3fA1kA5BY%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D6F3fA1kA5BY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F6F3fA1kA5BY%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/21bb1f2b05aa79294bfe16d00c815cfa/href">https://medium.com/media/21bb1f2b05aa79294bfe16d00c815cfa/href</a></iframe><p><strong>Tools Required:</strong></p><ol><li>dex2jar</li><li>JD-GUI</li></ol><p><strong>Steps:</strong></p><ol><li>Use dex2jar to unzip and unzip and translate the package to a JAR file.</li></ol><p>d2j-dex2jar &lt;apkfile&gt;</p><pre>D:\Mobile Appsec\Vulnerable App&gt;d2j-dex2jar diva-beta.apk<br>dex2jar diva-beta.apk -&gt; .\diva-beta-dex2jar.jar</pre><p>2. Open the JAR file to read the java class files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yZWLS1Y9jlCsP-T09t03mg.png" /><figcaption>JD-GUI</figcaption></figure><h4>2. UNZIPPING THE APPLICATION TO READ THE SMALI CODE AND ANDROID MANIFEST FILE</h4><ol><li>Decompile the application using apktool</li></ol><p>apktool d &lt;apkfile&gt;</p><pre>D:\Mobile Appsec\Vulnerable App&gt;apktool d diva-beta.apk<br>I: Using Apktool 2.2.0 on diva-beta.apk<br>I: Loading resource table…<br>I: Decoding AndroidManifest.xml with resources…<br>I: Loading resource table from file: C:\Users\roshan\AppData\Local\apktool\framework\1.apk<br>I: Regular manifest package…<br>I: Decoding file-resources…<br>I: Decoding values */* XMLs…<br>I: Baksmaling classes.dex…<br>I: Copying assets and libs…<br>I: Copying unknown files…<br>I: Copying original files…</pre><p>2. This will decompile the files to &lt;apkfile&gt; folder in the same folder. Open the AndroidManifest.xml file to see the permissions required by the app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*1tqWkgnEueZSoCxz7yhRWw.png" /><figcaption>AndroidManifest.xml</figcaption></figure><p>3. The smali code can also be accessed. It contains the assembly code for Dalvik Machine. This code can be manipulated and the application can be repackaged to bypass security controls like SSL pinning.</p><p>PS: Add the tool binary directories to an environment variable to run them from any path.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27855dca8531" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-vibes/android-appsec-27855dca8531">Penetrating Android Mobile Applications</a> was originally published in <a href="https://medium.com/security-vibes">Secvibe.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dissecting Whatsapp Encryption]]></title>
            <link>https://medium.com/security-vibes/dissecting-whatsapp-encryption-5cd6e9f8ec47?source=rss----eef65edaf8da---4</link>
            <guid isPermaLink="false">https://medium.com/p/5cd6e9f8ec47</guid>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[whatsapp]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[Roshan Thomas]]></dc:creator>
            <pubDate>Tue, 12 Jul 2016 03:29:14 GMT</pubDate>
            <atom:updated>2016-07-12T03:29:14.373Z</atom:updated>
            <content:encoded><![CDATA[<p>By now you all may have upgraded to the latest versions of Whatsapp which supports end-to-end encryption. End to end encryption, as the name suggests is a way of encrypting communication between two parties such that a third party, or even Whatsapp themselves cannot decrypt/read the communication. For quite a while I have been trying to understand the algorithm from the <a href="https://www.whatsapp.com/security/WhatsApp-Security-Whitepaper.pdf">white paper</a> which Whatsapp has published and I apparently realized that explaining the algorithm in layman’s language is quite impossible. So I decided to explain the same with the help of a flow chart.</p><p>The setup includes a handful of encryption keys. Like any other communication systems, the ‘signal’ protocol uses a combination of asymmetric and symmetric key cryptographic algorithms. The symmetric key algorithms ensure confidentiality and integrity whereas the asymmetric key cryptographic algorithms help in achieving the other security goals namely authentication and non-repudiation. In symmetric key cryptography a single key is used for encryption of the data as well as decryption. In asymmetric key cryptography there would be two separate keys. The data which is encrypted using the public key of a user can only be decrypted using the private key of that user and vice versa.</p><p>Whatsapp uses the Curve25519 based Elliptic Curve Diffie Hellman algorithm. The history of Curve25519 is worth noting as it was introduced after the concerns over allegations that certain parameters of the previously prevalent P-256 NIST standards have been manipulated by NSA for easier snooping. Elliptic Curve Diffie Hellman algorithm is a mathematical algorithm which helps two communicating entities to agree up on a shared secret without actually sending the actual keys to each other.</p><p>To understand the article and the method which they use, it is necessary to have a basic understanding of advanced cryptographic algorithms. So if you are not aware of ECDH, AES, SHA etc, this article may not entertain you. The following video by Robert Pierce beautifully explains the ECDH algorithm.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FF3zzNa42-tQ%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DF3zzNa42-tQ&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FF3zzNa42-tQ%2Fhqdefault.jpg&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5b6dcda602db2cab748fdbf99c603a30/href">https://medium.com/media/5b6dcda602db2cab748fdbf99c603a30/href</a></iframe><p>In the following flow chart, I have summarized all the key exchanges which occurs when a user installs whatsapp up until a message is sent to another user. Message key is a one time usable key and the process is repeated from the step where the new chain key is calculated.</p><p><strong>Communicating Entities</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*17oJ_-9s2xn-TPaUTmcpPg.png" /></figure><p><strong>Asymmetric Keys [ECDH]</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*y9tGLs8EBJrABDKAo2GLJQ.png" /></figure><p><strong>Symmetric Keys/ Pseudo Random Numbers</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*wjCKoPxxMCt9MRb7Jh5L6Q.png" /></figure><p><strong>Cryptographic Functions</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*XSQff7XTQ2RAtRxT3Z-aQA.png" /></figure><h4>Step By Step Process of Whatsapp End to End Encryption</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*eHlvTmlbrsFzwjSQnI2_7A.png" /></figure><p>Note: Please let me know if there is any error in any of the above listed steps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5cd6e9f8ec47" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-vibes/dissecting-whatsapp-encryption-5cd6e9f8ec47">Dissecting Whatsapp Encryption</a> was originally published in <a href="https://medium.com/security-vibes">Secvibe.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trudeau, Shor and a lot of qubits]]></title>
            <link>https://medium.com/security-vibes/trudeau-shor-and-lot-of-qubits-f5e5bd093942?source=rss----eef65edaf8da---4</link>
            <guid isPermaLink="false">https://medium.com/p/f5e5bd093942</guid>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Roshan Thomas]]></dc:creator>
            <pubDate>Thu, 26 May 2016 19:35:54 GMT</pubDate>
            <atom:updated>2016-05-29T05:48:53.995Z</atom:updated>
            <content:encoded><![CDATA[<p>When Justin Trudeu’s speech explaining Quantum Computing and qubits showed up on my news feed, I initially thought that it was because of my recent searches on web regarding the same. However when it went viral and more people started sharing the same, I realized that it is a global phenomenon. Even the very small advances in Quantum Computing have been heavily hitting news desks recently. The importance given to the same isn’t totally unreasonable even though the technology doesn’t look so feasible in the near future. It is believed that if we are able to make a stable Quantum Computing system which can hold sufficient number of qubits, it can not only make computing multifold faster but also could crash the most widely used security systems which rely on Public Key Cryptography. This article intend to detail the Shor’s algorithm — a Quantum Computing algorithm which can resolve one way mathematical functions such as Discrete Logarithm, Prime Factorization &amp; Elliptic Curve Discrete Logarithm calculations efficiently. Even though the intention of the article was to explain the concept with the least possible number of mathematical equations, I am unsure how far I have succeeded in it. However I believe that readers who are not familiar with the complex math behind the quantum computing will at least get a fair idea on the steps behind the same.</p><p>As it is not recommended to jump directly into a complex quantum algorithm, I would start with a primer on the need for Quantum Computing, Basics of Quantum Mechanics and a few words on math behind Public Key Cryptographic algorithms.</p><h4>Need for Quantum Computing</h4><p>Necessity is apparently the mother of all inventions. Inventions which aren’t necessary for the time wouldn’t survive. Discontinued Google glass can serve as a good example here. So what apparently is the need for quantum computing? To understand that we have to rewind a bit to the famous Moore’s law. Moore’s law predicted a proportional increase in number of transistors per chip with time. All of our gadgets run on processors which has integrated thousands of transistors to a small silicon chip. But recently the chip manufacturers have been facing a bottle neck in integrating more transistors per chip as the transistor size has already reached nano scale. The atomic radius of a Silicon atom is 117.6 pico meter or 0.1176 nm. Even though it is predicted that there would be technologies which would allow us to create 7 or even 5 nm transistors, at some point in time getting smaller is going to get affected by a quantum mechanical phenomenon known as Quantum Tunneling.</p><p>Since this physical limitation in getting smaller can stall the growth of computing, scientists had to think of an alternative. The idea started sprouting when Paul Benioff described quantum mechanical Hamiltonian models of computers in 70’s. In 1980, when Yuri Manin proposed an idea of quantum computing, the world started listening. The basic idea was to use qubits instead of conventional bits as qubits could carry more data due to the uncertainties associated with quantum states.</p><h4>Basics of Quantum Computing</h4><p>This will cover only the very basic quantum mechanical phenomena which are needed to explain Quantum computing or Shor’s algorithm in particular. Those who want to learn more about the same may explore many good YouTube Videos and research papers. I will list a few related literature at the end.</p><p>In conventional digital computing, calculations are done on bits. A bit can have either of the two values — 0 or 1 characterized by high or low voltages/current or whatever parameter the corresponding system measures. So the number of values x bits can possibly have is 2^x. That is, 2 bits can have 2^2 = 4 possible values as shown in the following figure. However at a time, they can store only one value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*MZTWdJkpoEmB26lecTgjwQ.png" /><figcaption>Figure 1: Bit representation of a classical computer</figcaption></figure><p>Quantum computing systems on the other hand utilizes the amazing quantum mechanical phenomena called ‘superposition’ of any two level quantum system. Electron spin system which has positive spin [+1/2] or a negative spin [-1/2] or a single photon whose polarization can either be vertical or horizontal are the common examples. Like the Schrodinger’s cat, which was dead and alive simultaneously while inside the box, quantum states are also uncertain before they are measured. The moment we measure the quantum state of a particle, the quantum state assumes one of the probable states. It is said that a qubit [which is apparently the quantum state of a photon/electron] can have both the possible values simultaneously until they are measured. From the macro world perspective, where the flip –flops can only store one of the two binary values at a time, this might seem a little difficult to comprehend. But at quantum level, classical physical laws are irrelevant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/1*w_RYTt2DfIDzXblb0AO-Ng.png" /></figure><p>As a result of the above while a conventional bit could have only one value of the possible two values at a time, a qubit can store 0 and 1 simultaneously. 2 qubits could store 4 values simultaneously, 3 could store 8 values simultaneously and so on. This would increase the computational capabilities multifold. While on a first look this might look complicated yet simple, performing calculations with a superposed quantum system is still tricky.</p><h4>Qubit Representation</h4><p>While conventional bits are represented by 0 or 1, qubit representation isn’t that flexible as we have to consider superposition of two distinct states. The best way to denote qubit is as a linear combination of two distinct state vectors |0&gt; &amp; |1&gt;. The vector representation of a qubit in superposition would be as follows.</p><p>|v&gt;= a.|0&gt; +b.|1&gt;</p><p>Where a and b are the quantum probabilities of system collapsing into |0&gt; or |1&gt; respectively if the qubits are measured. It is to be noted that a and b are complex numbers.</p><p>|v&gt; is also a unit vector. So the magnitude of superposed qubit vector ,</p><p>mag(|v&gt;)=√(a^2+b^2 )<br>= 1</p><p>Which implies the probability of the qubit being one of the definite states would be the magnitude of its complex co efficient.</p><p>ie; the real probability of qubit being |0&gt; would be the magnitude of complex coefficient a = a2</p><p>So the graphical representation on X-Y plane would be as follows. [This is just a representative diagram to make it simple. Qubits are usually not represented in x-y plain as they have complex co efficient. ]</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*tDCu857UIToD9Oq3Zu5_Hw.png" /><figcaption>Figure 3: Vector representation</figcaption></figure><p>Even though the representation consider a base with |0&gt; &amp; |1&gt;, due to vector properties it should also be noted that qubit vector |v&gt; can be represented by any orthonormal basis.</p><p>To get a holistic view of quantum computing, we need to understand how qubits are represented using Bloch spheres.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/794/1*hWkrkSR-1p3Gb5XLKrnPbw.png" /><figcaption>Figure 4: Bloch Sphere representation of superposed |Ψ&gt; vector</figcaption></figure><p>|Ψ&gt; is the qubit vector where |0&gt; and |1&gt; are the definite states |Ψ&gt; can collapse to when the same is measured.</p><h4>Qubit registers</h4><p>A lone qubit is as trivial as an empty wallet as we cannot perform any interesting calculations with the same. To perform calculations quantum bit registers which can hold multiple qubits are necessary. So far there exists qubit registers which can hold 5 bits and expanding the size beyond that is the major bottleneck practical quantum computing systems are facing.</p><p>Mathematical representation of qubit registers also are a bit different from conventional binary representation. Similar to vector qubit representation registers are also expressed as vector combination. An n qubit register is represented by a superposition of all 2n possibilities.</p><p>For example a 2 qubit register would be represented as follows</p><p>x⃗ = a. |00&gt; + b. |01&gt; + c. |10&gt; + d. |11&gt;</p><p>Where a, b, c and d are quantum probabilities of |00&gt;, |01&gt;, |10&gt; and |11&gt; respectively. And similar to qubits, the probability of each qubit in the register would be the square of coefficient.</p><h4>Quantum Logic Gates</h4><p>For many of the conventional logic gates, there exists no equivalent quantum gates. However there are a few gates which are only applicable to qubits.</p><p><strong>Measurement Gate:</strong> This gate collapses a superposed qubit into one of the finite states according to the probability co efficient.</p><p><strong>Swap Gate: </strong>It takes two qubits as inputs and swap between the qubits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*RIY62vAG2eKiTwsvVdR6bQ.png" /><figcaption>Figure 5: Swap gate</figcaption></figure><p><strong>Pauli X Gate:</strong> Flips the qubit in the opposite direction. |1&gt; to |0&gt; and vice versa and a superposed qubit to a superposition in the opposite direction.</p><p><strong>Hardmard Gate:</strong> Takes any qubit in a finite state and convert it to a right superposed qubit. [With equal probability to collapse to |1&gt; or |0&gt; when measured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*OVKkob-L5DdTfTmguOkVnQ.png" /><figcaption>Figure 6: Hardmard Gate</figcaption></figure><h4>Calculations on a conventional digital computer with logic gates</h4><p>To understand how mathematical operations can be faster in Quantum computing systems, we need to understand how a conventional computing system performs mathematical calculations. All the calculations are the result of basic arithmetic operations addition and subtraction. Repeated addition would result in multiplication, repeated multiplication in exponentiation and so on. A traditional system uses logic gates to perform these calculations. For example a classic bit to bit addition is performed with a half adder which uses a single XOR gate and an AND gate. XOR gate takes two inputs A &amp; B and gives the output S &amp; C as shown in the following logic tables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*aRY3SieQjHquIPzwe6J3CQ.png" /><figcaption>Figure 7: Truth Table for Half Adder</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*DHJ4cvHhi0ep9mP2C-IKTQ.png" /><figcaption>Figure 8: 2 bit half adder</figcaption></figure><h4>Calculation with Quantum Logic Gates</h4><p>It is clear that different values of inputs will give different results at the output. Interestingly in quantum computing systems all the inputs will superpose both 0 and 1 at the same time. The quantum gates will preserve the superposition and the results at S and C will also be superposed. Ultimately only one of those superposed values can be measured at the output. Since when we measure the superposed states will tend to assume one of the finite values 0 or 1, it is possible that we may not get the result we want. But, it is also observed that probabilities can be assigned to qubits [probability of being 1 or 0] and by efficiently manipulating the probabilities desired output can be obtained. By now you might have figured out why this wouldn’t particularly increase the speed of a simple arithmetic operation like addition. However this can be used to figure out the solutions of complex mathematical problems where we have to select only one correct value from enormous number of possibilities. Integer factorization &amp; Quantum database search are examples.</p><p>Another unintuitive quantum property which is made use of here in such computing systems is quantum entanglement. Quantum entanglement in simple words is the property of close association of two qubits. A state change in one of the pairs would affect the other one spontaneously no matter how distant they are physically. Scientists are still unsure about the reason for quantum entanglement, but that hasn’t stopped the world from researching ideas such as quantum teleportation. Any manipulation of the probability of a state of one qubit will also affect the other one in the pair due to quantum entanglement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*xdiX73MWgYl7DHpWZPMELg.png" /><figcaption>Figure 9: The differences</figcaption></figure><p>While it is pretty much obvious that Quantum Computing is not particularly useful in calculations which require corresponding outputs for given inputs where would they make sense? They would be an excellent choice where one valid selection has to be made from a number of possibilities. Consider a search operation. A program will have to iteratively look for the search value in an entire database to get the result in a classical computer. But guess what, the entire process can be superposed to a single step using a quantum computer and the value at the output can be measured.</p><h3>Shor’s Algorithm</h3><p>Shor’s algorithm is divided into two parts where there is a classical part and a quantum computing part. The calculation is done in 5 steps as follows. Out of the five steps, only in step 3 we make use of quantum computers.</p><p>Essentially what Shor’s algorithm does is splitting the factorization problem into two where one can be solved easily using a classical computer and the other can be a period finding problem which can be resolved using a Quantum Computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*iTgObpBiosT0CPmTL-MfyQ.png" /><figcaption>Figure 10: Steps of Shor’s algorithm</figcaption></figure><p>To understand the third step solved by a Quantum Computer, we need to know a bit about modular arithmetic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/279/1*XbMzEEnwwzpCCTPCR5T0Mg.gif" /><figcaption>Figure 11: Mod 13</figcaption></figure><p><em>a mod N</em> is defined as the remainder obtained while performing integer division of a with <em>N.</em></p><p>Modular arithmetic is also called clock arithmetic as the operation is analogous to wrapping around a thread of length a on a clock of circumference N. For example consider the following clock with circumference 13. To find 17 mod 13 we can take a thread of length 17 and wrap around the clock starting from 0. Where the thread ends would be the value of 17 mod 13 ie; 4.</p><h4>Example</h4><p><strong>Step 1: </strong>Choose a number N which is not prime.</p><p>Consider a small number which is a product of 2 prime numbers, say p = 11 and q = 7 <br>Thus, N = 77<br>We know that N is not a prime number.</p><p><strong>Step 2:</strong> Select ‘a’</p><p>Select a random integer a less than 77.<br>a = 4<br>GCD (a,N) = GCD (4,77) = 1<br>[If GCD of a and N is not equal to 1, then gcd(N,a) is a factor of N and the whole remaining process is not required]</p><p><strong>Step 3:</strong> Find r, the period of the function</p><p>Now we have to find the period of the function. In Shor’s algorithm this step is performed using a quantum computer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/204/1*95P1rvtfOLNYCDJ-9DIcuw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/1*11CGTZqtsCdABBX-vAVwEA.png" /><figcaption>Figure 12: 4^x mod 77</figcaption></figure><p>By plotting the values of f(x) we can see that it is a periodic function. f(1) =f(16) so the period of function is 15.</p><p>r = 15 since r is odd we have to repeat the steps with another value for r. Considering f(x) where a = 8</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*0iBuu-X-ss0gj6jLC1LEzw.png" /><figcaption>Figure 13: 8^x mod 77</figcaption></figure><p><strong>Step 4:</strong> Evaluate the range</p><p>The range was observed to be 10 which is an even value and we can proceed to the next step.</p><p>We need to verify if</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/307/1*b-daq1CO-4XLcGh2WzBu6A.png" /></figure><p><strong>Step 5:</strong> Finding the factors</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*sPNC2xje3hc0mE84sZUFQw.png" /></figure><h4>Quantum Computation for finding the range</h4><p>The first step here is to identify an integer Q which is a power of 2. Q should also comply with the following conditions.<br><em>N ≤ Q &lt; N^2 </em>and <br><em>Q/r &gt; N </em><br>Since Q= 2^q [Note that this q is different from the prime factor q which we are calculating. This q is effectively the size of bit reqister which can hold the value Q]<br>As we have mentioned earlier all the value up to integer Q can be represented by a superposition of q qubits. The superposition of Q values here will serve as x from 0 to Q-1.<br>Then f(x) is constructed as a quantum function which would also be in superposition of Q distinct states as x.</p><p><strong>The Quantum part</strong></p><p>As explained above, the Shor’s algorithm uses two q qubit registers — one with the superposed values for x and another for the superposed values of f(x)=a^x mod N. Let’s call the x- register, Register 1 and the f(x) register, Register 2. The circuit would be designed using quantum gates such that both x and f(x) registers are quantum entangled such that measuring the register with f(x) would result in the following.</p><ol><li>Register with f(x) will collapse to a finite value of〖 a〗^x mod N, say k</li><li>Register with x will go into a superposition of all the possible values of x which can result in f(x)=k</li></ol><p>So if we consider the example, f(x)=4^x mod 77 Register 1 &amp; Register 2 will have the following values superposed on q qubits. For ease of representation we have taken Q = 30, But in actual scenario N ≤Q&lt;N^2 is considered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*hdu9jRziP7GvTFwf2I2h0A.png" /><figcaption>Figure 14: Quantum Registers</figcaption></figure><p>We would then measure Register 2. On measuring, Register 2 would collapse into one of the finite values listed above. Suppose the Register 2 collapsed to 43. Since 43 is the value of f(x) when x=5,15 or 25, the quantum entangled Register 1 will then go to a superposition of 5, 15 and 25. In the next step we would measure Register 1 for the value of x corresponding to f(x). Due to the same quantum mechanical principles we described initially, we would get only one value of x as Register 1 collapses to one of the three finite states — 5, 15 or 25. With a few number of attempts, considerably less than what is required in a classical computer algorithm, we would be able to reproduce the same f(x)=43 and then measure Register 1 for a different value of x. If we get two consecutive values of x forf(x)=43, the period of the function can be found out, r=x_2 - x_1</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*jS7cO6AI3NpFDsPEhMiOFw.png" /><figcaption>Figure 15: : Circuit for Shor’s algorithm using 2n+3 qubits by Stephane Beauregard.</figcaption></figure><p>Above given is the state diagram of the Quantum Sub routine of Shor’s algorithm.</p><p>Register 1 carries the input values — x. To get right superposed values of |0&gt; and |1&gt;, q bit qubit register is subjected to a Hardmard gate.<br>Register 2 stores the output values — f(x).</p><p>The output register arrives into a different representation of f(x) using a unitary quantum Fourier transform. This discrete Fourier transform representation of f(x) is an easily measurable qubit representation and that makes the whole job a lot easier.</p><p>In the previous section we mentioned that the input and output register qubit values would be entangled. To understand how quantum entanglement is possible with operations using quantum gates, please watch the videos listed below.</p><h4>References</h4><ol><li><a href="http://arxiv.org/pdf/quant-ph/9508027v2.pdf">Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer</a> — Peter W. Shor</li><li><a href="http://www.csee.umbc.edu/~lomonaco/ams/lecturenotes/Shor.pdf">Introduction to Quantum Algorithms</a> — Peter W. Shor</li><li><a href="https://people.cs.umass.edu/~strubell/doc/quantum_tutorial.pdf">An Introduction to Quantum Algorithms</a> — Emma Strubell</li><li><a href="http://www.scottaaronson.com/blog/?p=208">Shor, I’ll do it</a> — Scott Aaronson</li><li>Video: <a href="https://youtu.be/F8U1d2Hqark">Building the Bits and Qubits</a> — Frame Of Essence — Philip O. Duncan</li><li>Video: <a href="https://youtu.be/ZoT82NDpcvQ">You don’t know how Quantum Computers work!</a> — Frame Of Essence — Philip O. Duncan</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5e5bd093942" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-vibes/trudeau-shor-and-lot-of-qubits-f5e5bd093942">Trudeau, Shor and a lot of qubits</a> was originally published in <a href="https://medium.com/security-vibes">Secvibe.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intercepting Android traffic for Mobile Appsec]]></title>
            <link>https://medium.com/security-vibes/intercepting-android-traffic-for-mobile-appsec-2ba634995f6f?source=rss----eef65edaf8da---4</link>
            <guid isPermaLink="false">https://medium.com/p/2ba634995f6f</guid>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[mobile-appsec]]></category>
            <dc:creator><![CDATA[Roshan Thomas]]></dc:creator>
            <pubDate>Sun, 01 May 2016 21:42:37 GMT</pubDate>
            <atom:updated>2016-05-02T05:46:36.095Z</atom:updated>
            <content:encoded><![CDATA[<p>Most of us may be familiar with how to use a proxy software to intercept traffic from a browser to a web application for application security testing. However, intercepting android traffic is somewhat different and it is common to run into problems while doing this same. In this article I am going to explain how android traffic can be intercepted for mobile appsec.</p><h4><strong>Tools required</strong></h4><ol><li><a href="https://www.genymotion.com/account/create/">Genymotion</a></li><li>Google Android SDK tools (Available with <a href="http://developer.android.com/sdk/installing/index.html">Android Studio</a>)</li><li>Dependencies for Android Studio (<a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html">Java Development Kit</a>)</li></ol><h3>Installing Android Studio</h3><p>You need to install JDK for android studio to work. JDK can be downloaded from the link given above and the installation process is click and go. Once JDK is installed, install Google Android Studio.<br>Note the location of SDK installation. In my case it was installed on <em>C:\Users\username\AppData\Local\Android\sdk</em> <br>Right click on ‘<em>This PC</em>’ or ‘<em>My Computer</em>’. Select ‘<em>properties</em>’ from the context menu. Select ‘<em>Advanced system settings</em>’ . In the ‘<em>Advanced</em>’ tab, select ‘<em>Environment Variables</em>’. Add a new path to the PATH variable by separating it with semi colon pointing to the location of ‘<em>Platform-tools</em>’ folder in Android SDK installation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/911/1*ONsyY2EYQYli-lK5sz1eeg.png" /><figcaption>Setting environment variable</figcaption></figure><p>Open command prompt and type the following command to see if the environment variable is set properly. The command should return all the switches for adb tool.<br><em>&gt; adb</em></p><h3>Intercepting Android Traffic</h3><p>Intercepting android traffic using a proxy can be done in two different ways.</p><ol><li>Intercept traffic from an android emulator.</li><li>Intercept traffic from a rooted android device.</li></ol><p>In this article, I will be following the first method as it is easier and it saves time avoiding the need for operating two different devices simultaneously. Any emulator or virtual device can be used to perform the same. Andoid Virtual Device (AVD) which is available with the <a href="http://developer.android.com/sdk/index.html">Android Studio</a> is preferred by a lot, but AVD is infamous for its slow response and tedious configuration options. My personal preference is Genymotion Android emulator as the same is fast and responsive on a windows based machine.</p><p>To download the Genymotion emulator, you need to <a href="https://www.genymotion.com/account/create/">create an account on Genymotion</a> and log in to the website. Once you login, in the download tab you can find the option to download Genymotion with VirtualBox and that’s what we want. If you have an existing installation of VirtualBox, you can download Genymotion without Virtual Box and install it to the location you prefer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HIiV85-291i0unAkXT9p8g.png" /><figcaption>Genymotion Download</figcaption></figure><h4>Creating Android Virtual Device on Genymotion</h4><p>1 . The first step is to create an android virtual device of your choice in Genymotion. Start Genymotion after installing the same and click on ‘Add’ button with a ‘+’ sign on it. Once you click on the same you will get a prompt to select the virtual device of your choice. Select an appropriate version which is compatible with the APK you want to test and click ‘Next’. Rename the virtual device and click next. You will be alerted when the files are downloaded and the AVD is ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eGY9Aihg0Hzvh19Oqhzzdw.png" /><figcaption>Setting up AVD on Genymotion</figcaption></figure><p>2 . Once the Virtual Device is created it will appear in the ‘Your virtual devices’ list. Click on the AVD you want to start and click ‘Start’ button with a ▶ sign next to it. In a few seconds the Android virtual device will be up and running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*cnt9zRNtCLxNeZrvSy0keg.png" /><figcaption>AVD</figcaption></figure><h4>Configuring the Proxy</h4><p>3 . Now you need to configure the proxy on your laptop to intercept the traffic. Any proxy tool of your choice can be used (Charles, Paros, BurpSuite…). I prefer BurpSuite. Start BurpSuite. The proxy need to be configured on the external interface of your machine as you need to intercept the traffic from a virtual device on the network, not your local host. In Burp, Go to ‘Proxy’ tab and then to ‘Options’ sub tab. Add a new proxy listener.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/790/1*akK_aywdH4wKgn8y4jXGNw.png" /><figcaption>Configuring proxy listener</figcaption></figure><p>4 . Set the port on which the proxy should listen to as 8888 (or any port of your choice which is not used by any other application) and the interface to the local IP of your laptop machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/703/1*XPnK6JG9aV6_q0ttg67Yww.png" /><figcaption>Configuring proxy listener</figcaption></figure><p>5 . Enable the proxy listener if the same is not enabled by default after creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*nH2TyVNf5yBFjjyqgMeMHA.png" /><figcaption>Configuring proxy listener</figcaption></figure><h4>Configuring AVD to route the HTTP traffic through Burp proxy</h4><p>6 . Go to Settings &gt; WiFi on the Genymotion AVD. There would be one active WiFi connection by the name ‘WiredSSID’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*JRDORUWAziTkk09OaWukZQ.png" /><figcaption>Wireless Proxy</figcaption></figure><p>7 . Tap and hold the SSID name and click on ‘Modify Network’ in the context menu which appears.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*cFPn278FrOOmJQFaw0zgeA.png" /><figcaption>Modifying network option</figcaption></figure><p>8 . Enable advanced options by clicking the tick box next to ‘Show advanced options’. Change proxy settings to ‘Manual’ from the drop down menu of ‘Proxy settings’ option. Give the proxy hostname and port as the IP address and port of the proxy listener (The same which was set on burp proxy). Click ‘Save’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*ygj5JfbWvkDYi6bWq2D2jQ.png" /><figcaption>Configuring proxy on AVD</figcaption></figure><p>9 . The current setting will work well for http traffic. However there is a problem when applications uses https. When there is a proxy-in-the-middle, unlike browsers, android apps would just tear down the connection instead of giving a prompt to accept the certificate mismatch. To avoid this problem, we might need to add the CA of burp proxy certificate to the trusted CA’s of the AVD. To do this browse the proxy listener on the web browser on your laptop machine. ie; in this case access <a href="http://10.0.0.49:8888/">http://10.0.0.49:8888</a> . Click and download the CA certificate. Rename and change the extension of the certificate file to .CRT from .DER</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LXK-RPvpf1ZQzOjHSopGvg.png" /><figcaption>Burp Certificate</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*rdWZq3ikTvbkGc1q713KoA.png" /><figcaption>Burp Certificate</figcaption></figure><p>10 . Now to install it to the AVD, we need to move the certificate to the AVD sdcard first. To do that we need to use the Android Debug Bridge aka adb. Android Debug Bridge is available in the Google Android SDK. Open command prompt and go to the location where cacert.crt is stored.</p><p>11 . Connect to the AVD using the following command. The IP of the AVD can be found on the title bar of Genymotion.</p><p><em>&gt; adb connect 192.168.56.101</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*KtbLeGIcaiealRgzDMwSMg.png" /><figcaption>IP of AVD</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/484/1*ET3n9enQ1TMPZ3_LGprx1g.png" /><figcaption>Connecting to AVD</figcaption></figure><p>12 . To copy the cacert.crt file to the AVD sdcard, adb push command can be used. [ adb &lt;sourcefile&gt; &lt;destinationfile&gt; is the syntax]</p><p><em>&gt; adb push cacert.crt /mnt/sdcard/cacert.crt</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*IKLsGosyjVfwiS2VsVaBxA.png" /><figcaption>ADB Push</figcaption></figure><p>13 . Open Genymotion AVD. Go to Settings &gt; Security. In the Credential Storage section, click on ‘Install from SD Card’. Give an appropriate name and click ‘OK’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*FgqtFRzzBv0XLdSxSeE4hw.png" /><figcaption>Installing Burp Certificate</figcaption></figure><p>[The AVD may prompt you to set a PIN to install certificate. Set a pin for the device and confirm the same.]</p><p>14 . Verify if the certificate was installed properly by checking the ‘Trusted Credentials’ Option. In the ‘User’ tab you can find the certificate from ‘PortSwigger’ which is the Burp Certificate we installed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*e-t7EY6UfyQEbJqbZ4pN3Q.png" /><figcaption>Installed Certificate</figcaption></figure><h4>Installing APKs to the AVD</h4><p>The AVD we set up was a minimal installation which has no google apps. So downloading the applications from play store inside the AVD is not possible unless we install Google Apps first. Alternatively adb can be used to install apks on the AVD.</p><p>15 . Download the APK file for the application you want to test. There are a few services which helps to download APKs of applications on playstore. <a href="http://www.apkpure.com/">APKPure</a> is one such website. Here I am demonstrating the interception with APK for Instagram application downloaded from APKPure. Make sure the apk you download is compatible with the version of Android in the AVD you are using.</p><p>16 . To install the APK the following command can be used. [ adb install &lt;apkname&gt; ]</p><p><em>&gt;adb install Instagram_v7.21.1_apkpure.com.apk</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*zAIkaAdDit03sTgIxN2LjA.png" /><figcaption>ADB install</figcaption></figure><p>17 . It can be observed that the Instagram App is successfully installed on the AVD.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*iTc5gNPFYgw4e-99jkRo9w.png" /><figcaption>Instagram installed</figcaption></figure><p>18 . Now that everything is configured, the set up should be good to intercept HTTPS traffic. Enforce the filters necessary to intercept client requests and responses in burp and turn the intercept on in the proxy tab.</p><p>19 . Open the Instagram app in the AVD and try to login.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/1*D2h5gKh6X2D3PQoIg5tegg.png" /><figcaption>Application on AVD</figcaption></figure><p>20 . The request can be intercepted in Burp Proxy as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*ZsgTase8nMWvUfZ1UZKqfg.png" /><figcaption>Intercepted traffic</figcaption></figure><p>Applications which uses SSL pinning need to be intercepted in a different way. We will discuss the methods in a future article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ba634995f6f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-vibes/intercepting-android-traffic-for-mobile-appsec-2ba634995f6f">Intercepting Android traffic for Mobile Appsec</a> was originally published in <a href="https://medium.com/security-vibes">Secvibe.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Let’s agree that everything is doomed!]]></title>
            <link>https://medium.com/security-vibes/let-s-agree-that-everything-is-doomed-5d32f8b8c44e?source=rss----eef65edaf8da---4</link>
            <guid isPermaLink="false">https://medium.com/p/5d32f8b8c44e</guid>
            <category><![CDATA[pentesting]]></category>
            <category><![CDATA[infosecurity]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Roshan Thomas]]></dc:creator>
            <pubDate>Fri, 08 Apr 2016 22:16:57 GMT</pubDate>
            <atom:updated>2016-04-09T13:37:56.342Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>The story of a critical information disclosure villain…</em></strong></p><p>Ok, Let’s agree that everything is doomed. There is proverb in my mother tongue — which can roughly be translated as follows.</p><blockquote>Even something as trivial as a grass can be a deadly weapon for an ace.</blockquote><p>Apart from the conventional commercial Indian movies where they apply this theory to make the hero stop villain’s bullet with a buffalo grass, or the probable parallel world Chuck Norris flicks, I recently realized, that this could actually have some relevance in the info-security industry as well.</p><p>We all may have heard of google dork queries which attackers use to perform passive reconnaissance on potential targets. (Those who haven’t heard of the same may refer <a href="http://null-byte.wonderhowto.com/how-to/use-google-hack-googledorks-0163566/">this</a>, <a href="https://www.exploit-db.com/google-hacking-database/">this</a> or <a href="http://whatis.techtarget.com/definition/Google-dork">that</a>.) It is also true that quite a few among us may also have trivialized the potential impact of such queries on a public domain. Yeah, Now is the time to confess if you have ever said — “Such a moron, he wants me to stop pasting code snippets while I clear doubt’s on ‘Stackoverflow’.”</p><p>Apparently the data available in public domain isn’t as trivial as we thought. Chuck Norris can in fact gather critical information including emails, passwords, usernames, credit card data and SSNs with a mere google search query. But the reason I am writing is something big I found on a Major bank’s domain.</p><p>In a class assignment to perform passive reconnaissance, I had to select a target. The target organization I chose for the exercise was a major, private sector bank in India. Defying the common notion that large organizations with sufficient security budgets do monitor data leakage, I was able to identify some shocking information without even actively probing the target domain.</p><p><strong><em>Note:</em></strong></p><p><em>When I performed this assignment, I ensured that no active reconnaissance was performed on the target systems. While there are a lot of unproductive discussions and controversies surrounding whether port-scan /service fingerprinting is </em><a href="https://nmap.org/book/legal-issues.html"><em>legal or not</em></a><em>, it is always safe to assume the worst. Certain ISP’s have even gone further to define </em><a href="http://www.xfinity.com/Corporate/Customers/Policies/HighSpeedInternetAUP.html"><em>policies </em></a><em>which explicitly forbids users from performing active probing.</em></p><p><em>I will not be revealing the actual bank name or any specific details which can compromise their security. From here onward the bank mentioned would be called “Mystery Bank” and the domain would be “mysterybankxyz.com”</em></p><p><strong><em>Steps:</em></strong></p><ol><li>Identify the target sub-domains. There are quite a few tools available online with which you can identify the subdomains of a particular domain. I used a handful of them to get the list of subdomains.</li><li>Gooogle it! I was primarily interested in the files on different sub-domains of mysterybankxyz.com.<em> </em>So I started off with the following search.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gnvztnTYmDDlIdCXWyFblw.png" /><figcaption>The query to get all files with the extension xls on mysterybankxyz.com</figcaption></figure><p>3. The search gave me a fair amount of results which I then went through one by one for passwords, emails and Credit Card Numbers. And yes, there were many! One such example is given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*kKt9HlAiF58paMPAR1AQhQ.png" /></figure><p>4. This increased my interest in the particular target sub-domain and I started browsing it folder by folder. Guess what, It was listing directories and the files in it. And quite surprisingly, it turned out to be a development server with hell lot of source code for the internally developed applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*IvuF5M0QtW2cDd2xP0c3JQ.png" /><figcaption>Directory listing on vulnerable.mysterybankxyz.com</figcaption></figure><p>5. Some of the directories were not accessible but that&#39;s when the mighty Google came for my help again. I used the Google cache to see the previous available version of the directories. eg: By googling cache:vulnerable.mysterybankxyz.com/test/test/xyz</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RqSuxTwwsPT2JxHSuQQo_Q.png" /></figure><p>6. And after a while I was able to access a directory which had the entire source code as a ZIP file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Fh_8maKPb2GPV3dK-8Qgg.png" /><figcaption>Source Code downloadable as zip</figcaption></figure><p>After some time I decided to responsibly disclose the vulnerability to the bank and sent the customer support team a mail asking for the contact details of security team. They promptly responded and the vulnerability was patched within a weak.</p><p><strong><em>Why do these vulnerabilities exist?</em></strong></p><p>There are a handful of reasons why such vulnerabilities go undetected.</p><ol><li>Low priority assigned for patching/hardening development systems.</li><li>Neither the scope, nor the time allocated isn’t enough to effectively perform passive reconnaissance on an entire organization.</li></ol><p>The big question here is whether I was the first and only one who found this. Mystery Bank being a large financial organization, must be a preferred target for many attackers. Couldn’t we all be doomed by the mighty Chuck if such weaknesses exist?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d32f8b8c44e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-vibes/let-s-agree-that-everything-is-doomed-5d32f8b8c44e">Let’s agree that everything is doomed!</a> was originally published in <a href="https://medium.com/security-vibes">Secvibe.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I could have spoofed you in Facebook!]]></title>
            <link>https://medium.com/security-vibes/how-i-could-have-spoofed-you-in-facebook-a9df6748795?source=rss----eef65edaf8da---4</link>
            <guid isPermaLink="false">https://medium.com/p/a9df6748795</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[infosecurity]]></category>
            <dc:creator><![CDATA[Roshan Thomas]]></dc:creator>
            <pubDate>Fri, 11 Mar 2016 22:04:40 GMT</pubDate>
            <atom:updated>2016-03-12T04:34:02.804Z</atom:updated>
            <content:encoded><![CDATA[<p>We rely extensively on various social media websites for personal as well as professional communication. Facebook even has gone beyond the conventional social media concept to offer features like ‘Facebook at Work’. While using these features we tend to believe that the service providers have made them secure or hack-proof. However in reality securing information systems doesn’t follow a “click’n’go” approach. It is quite possible to have significantly high impact vulnerabilities in these systems even after comprehensive vulnerability assessment stages which they are subjected to prior to moving them to a production environment. It is because of this possibility, a large number of companies offer bug bounty programs. Facebook is one such firm which offers bounties for the bugs users can identify on their platform. The story here is about one such vulnerability, but the sad part is that I couldn’t bag the bounty as another bounty hunter was ahead of me in reporting the same.</p><p>Explaining the vulnerability and the exploit would require a recap on SMTP &amp; email communication. SMTP or Simple Mail Transfer Protocol as the name suggests is the standard application layer protocol which defines email transmission. The history of SMTP dates back to 1970&#39;s where similar protocols where used in the predecessor of internet - ARPANET. Back in those good old days security wasn’t a concern at all and no security features were embedded in to the protocol. This resulted in SMTP being a protocol which cannot enforce most of the security considerations including Confidentiality, Integrity &amp; Non-repudiation. This inherent vulnerability of the protocol exists even in today’s email communication systems. And as a result, emails can easily be spoofed and sniffed on a network. Further down the line S/MIME was introduced to ensure integrity and confidentiality of emails, however these are not used widely unless in a high priority environment.</p><p>Facebook groups are one of the most popular features where people discuss anything under the sun. There have been instances where such discussions have landed people in jail. That being the case, what if I could post something on behalf of you in a Facebook group? Well, the after effect depends on what I post on your behalf, Doesn’t it? Apparently there existed a vulnerability which could let you spoof anyone and post anything to a Facebook group till 18th February, 2016!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*aNeoXUwBLR-9FgDcyjocrw.png" /></figure><h4>Vulnerability Details and Proof</h4><p>The vulnerability existed in the Facebook Groups’ feature which allowed users to post content to a group via email. For a group with group URL - www.facebook.com/groups/<strong><em>&lt;groupname&gt; </em></strong>, any member could post to the group by sending an email to <strong><em>&lt;groupname&gt;</em></strong>@groups.facebook.com from the email ID linked to their Facebook account. Without any other validation, facebook accepted the post if the email came from the email address associated with the user’s account.</p><p>You could have used any of the numerous fake emailers available in the web which can spoof email addresses to exploit this vulnerability and post to a group on behalf of other users. The Facebook application in this case trusted the input from an inherently vulnerable protocol - SMTP - to authenticate and authorize a user.</p><p>The only catch here was that you should be knowing the email address to spoof a user. But there was a way around for this as well. Facebook accepted emails from the facebook email address as well. The facebook email address of a user with profile URL www.facebook.com/<strong><em>&lt;useridentifier&gt;</em></strong> is <strong><em>&lt;useridentifier&gt;</em></strong>@facebook.com and because of this, the entire user base of facebook was vulnerable to the same attack.</p><p>Step 1: Login to Facebook and browse to a group which you want the post to appear. Note down the group identifier from the group URL.</p><p>Step 2: Select a member of the group whom you want to spoof. Note down the profile identifier from the profile URL.</p><p>Step 3: Open <a href="https://emkei.cz/">https://emkei.cz/</a> (or any fake emailer. This can also be done by manipulating the MAIL FROM header of a mail server which allows mail forwarding.)</p><p>Step 4: Give the following details and enter the content to be posted in the ‘Text’ field and click ‘Send’</p><blockquote>From E-mail: <strong><em>&lt;useridentifier&gt;</em></strong>@facebook.com</blockquote><blockquote>To: <strong><em>&lt;groupname&gt;</em></strong>@groups.facebook.com</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I9zhqMoo4wv425l8_yIYHg.png" /></figure><p>Step 5: It was observed that the text content was successfully posted in the target group by the target user profile!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*hQmtdQY0M25wPFxzgR7VCw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xsUwODLrBJ4nOWXXFnMEbg.png" /></figure><p>Tadaa, There you go!</p><h4>The Fix!</h4><p>After almost two weeks since I reported the vulnerability and they confirmed the same, Facebook mailed me that they have fixed the vulnerability. I initially thought that they would remove the feature altogether, however Facebook’s approach to this issue was different.</p><p>After playing around a little with the feature again, I realized that the issue was fixed by validating one of the other e-mail headers, probably the SPF header which gives an idea on whether the mail is being forwarded by a server which is authorized to send mail for the domain. Any spoofing attempt would result in an SPF fail at the spam filter and would be discarded. For Facebook, this is an effective fix as they allow only a handful of emails to be associated with an account based on the reputation and a bunch of other parameters. However this isn’t a fool proof method because an open mail forwarding support on any of the allowed email servers can also result in the same. Looks like at this point facebook considers it as an acceptable risk.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9df6748795" width="1" height="1" alt=""><hr><p><a href="https://medium.com/security-vibes/how-i-could-have-spoofed-you-in-facebook-a9df6748795">How I could have spoofed you in Facebook!</a> was originally published in <a href="https://medium.com/security-vibes">Secvibe.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>