Courses:

Offensive Countermeasures: The Art Of Active Defense: SANSFIRE June 15-16, Blackhat USA July 27-28 & 29-30


Defensive Countermeasures: Foundations for Becoming A Devious Defender: Blackhat USA July 27-28 & 29-30


Conferences:

Check out the entire PaulDotCom crew at BsidesRI June 14-15th!



Subscribe:

Blog:
Videos:
Podcast:


PaulDotCom Español


Hack Naked TV


Hack Naked At Night


Stogie Geeks


Sponsored By:


www.coresecurity.com


www.tenablesecurity.com


www.sans.org



Follow Us On:


twitter.com/pauldotcom

PaulDotCom YouTube Channel


December 2012 Archives

Episode 313 - Drunken Security News

|

The Holiday Edition! Paul's talking about a naked Scarlett Johannson and getting Grandma using HTTPS Everywhere. The guys take Adobe to task for still not fixing a two year old vulnerability, they look at the top gadgets of 2012, as well as the top stories of the year. Paul wants you to support your DBAs and encourage database security, and he asks "Should we exploit every vulnerability to prove it exists?" Larry has updates on the Onity hotel lock situation and the going rate for hacked credit card terminals. Finally, Santa Jack talks about fixing a potential vulnerability by uploading a vulnerability. Oh, and don't forget about Security BSides Rhode Island on June 15.

Episode 313 Show Notes

Episode 313 (mp3)

Tune in to PaulDotCom Security Weekly TV, Hack Naked TV, and Hack Naked At Night episodes on our YouTube Channel or our Bliptv channel.

Episode 313 - Tim Medin, SANS Holiday Hacking Challenge

|

Tim Medin from Counter Hack Challenges joins the show to tell about the Miser brothers and the Year Without a Santa Claus and explain the SANS Holiday Challenge 2012. Hack your way through five levels to warm up Snow Miser and cool down Heat Miser and get Santa back to work. Plus, Paul gets a pretty creepy phone call from someone special.

Episode 313 Show Notes

Episode 313 (mp3)

Tune in to PaulDotCom Security Weekly TV, Hack Naked TV, and Hack Naked At Night episodes on our YouTube Channel or our Bliptv channel.

Episode 312 - Drunken Security News

|

Bug bounties on PayPal, offensive security tips and reminders, Onity lock fixes, hiding botnets, escalating admin privileges, hacking Samsung TVs, and Paul's "Big Announcement"!

Episode 312 Show Notes

Episode 312 (mp3)

Tune in to PaulDotCom Security Weekly TV, Hack Naked TV, and Hack Naked At Night episodes on our YouTube Channel or our Bliptv channel.

Episode 311 - Drunken Security News

|

Paul talks about email that hacks routers, dumb criminals, should you disclose security holes, worms in Tumblr, cPanel flaws. Jack is here to tell us about unrealistic expectations, breach reports, logging and small medical offices getting hacked.

Episode 311 Show Notes

Episode 311 (mp3)

Tune in to PaulDotCom Security Weekly TV, Hack Naked TV, and Hack Naked At Night episodes on our YouTube Channel or our Bliptv channel.

Episode 310 - Drunken Security News

|

XSSing Yahoo for only $700, hacking back debates and royal passwords. Paul also talks about Belkin, honeypots and Gabriella Coleman while Larry tells us about RFID chips on children and hotel lock fails. Lastly, Allison found a talk on OPSEC by The Grugq and "Fort Knox level security" with "RANDOM_STRING". Plus so much more!

Episode 310 Show Notes

Episode 310 Part 1 (mp3)

Tune in to PaulDotCom Security Weekly TV, Hack Naked TV, and Hack Naked At Night episodes on our YouTube Channel or our Bliptv channel.

Tech Segment: MiniPwner (TP-Link TL-WR703n Pen Testing Drop Box)

|

The MiniPwner is a pen-testing drop box. Prior to the MiniPwner we were using a Pwnie Express or an Apple travel router as drop boxes during physical penetration tests. But these solutions depended on a known IP addressing scheme or DHCP, a power outlet near an open network port, and unfiltered Internet access. My wish list for a home-built drop box was a router that was small, inexpensive, OpenWRT supported, had wired and wireless interfaces, had space for a USB drive, and could be battery powered, all without soldering or custom firmware. The WR703N router had recently become available and OpenWRT supported and seemed to be a perfect fit.

Episode 310 Show Notes

Episode 310 Part 1 (mp3)

Tune in to PaulDotCom Security Weekly TV, Hack Naked TV, and Hack Naked At Night episodes on our YouTube Channel or our Bliptv channel.

Mobile Device Hacking Using Proxies - Episode 307

|

Special Guest: Charlie Eriksen

In recent episodes, the subject of mobile security has come up. Mobile security is something that's fairly new, and is ripe with security and privacy concerns if you go looking for them, as a result of how new the platform is, and how much of a gold rush it has been to develop this sort of software. This provides you with a platform which is easily snooped and attack on. As it happens, most mobile traffic is plain HTTP(S), which makes the barrier to entry very low for doing sniffing of traffic and such. One tool for doing so, which provides a lot of great features, is Burp Suite. We'll take a look at how you can set up your iOS devices to work with Burp and have a bit of fun.

Episode 307 Show Notes

Episode 307 Part 1 (mp3)

Tune in to PaulDotCom Security Weekly TV, Hack Naked TV, and Hack Naked At Night episodes on our YouTube Channel or our Bliptv channel.

SSL Stripping is an attack originally discovered by Moxie Marlinspike (@moxie) and released at BlackHat DC 2009 along with a tool called SSLStrip. SSL Stripping is an attack that takes advantage of the fact that server-side redirects are used to pass clients from HTTP versions of a page to the HTTPS, SSL encrypted, version. SSL Stripping tools, such as SSLStrip, listen for requests from clients which receive a response intending to forward the client to the HTTPS version of the page. SSL Stripping tools hijack this response, make the SSL encrypted HTTPS connection to the server, convert all instances of "https" to "http" within the legitimate content, and pass the modified content to the unsuspecting client over unencrypted HTTP. The attacker can then view all of the traffic between the client and the server in cleartext. I know what you're thinking, "Why not just conduct an HTTPS man-in-the-middle?" The benefit of SSL Stripping over HTTPS mitm is that HTTPS mitm requires that the target client accept an invalid or untrusted SSL certificate in order to complete the attack, an obvious clue to the target that something is amiss. SSL Stripping provides very few visual clues that the target is being compromised.

Now, on to the reason for this article.

I was recently confronted with a challenge find a way to defend against an SSL Stripping attack. Initially, I gave the easy answer, "Train your users to always manually type in "https" before every site they visit which uses SSL encryption." How realistic is that? Not very. So the solution had to be automated in such a way that it was seamless to the user and controlled by the administrator or application developer. As we said above, SSL Stripping attacks target the client's trust of the response from the server. So in order to prevent SSL Stripping, the client must be responsible for ensuring that SSL is used where needed. Sounds dangerous right? Putting any level of control in the hands of the client. Well, in this case, we have no choice. The client HAS to be the decision maker here, as SSL Stripping tools specifically take advantage of this deficiency in the client.

The solution I came up with ended up being rather simple. Developers can add several lines of JavaScript code to the client-side portion of their application which forces the client to enforce SSL encrypted HTTP (HTTPS) without the direction of the server. Now before you start flaming this article, let me finish. It must be understood that while this will work, a mitm still has control over all cleartext responses from the server to the client. Therefore, if the mitm is aware of the anti-SSL Stripping mechanism, they can customize their SSL Stripping tool to also strip the anti-SSL Stripping code out of the response, rendering the client defenseless.

Moving forward, the following JavaScript code will force the client-side of an application to connect to the HTTPS version of each page on which the code is executed. Placing this code on the top of a page will defend against SSL Stripping attacks on that page.
var proto = String.fromCharCode(104,116,116,112,115,58); if (window.location.protocol != proto) { window.location.href = proto + window.location.href.substring(window.location.protocol.length); }
Let's walk through the code.

Line 1 creates a variable called "proto" which has a string value of "https". The reason we create the string this way is to avoid where SSL Stripping tools search and replace all instances of "https" with "http". SSL Stripping tools could add this to the search and replace, but think of how many different ways we can create and obfuscate JavaScript code to create a string equal to "https". Actually, it's limitless. Consider the following JavaScript:
var proto = String.fromCharCode(105-1,114+2,118-2,110+2,118-3,55+3)
This creates the string "https". As long as we're dealing with math, we have unlimited possibilities. Line 2 checks to see whether the protocol of the current location of the DOM is "https". If it is not, then line 3 redirects the client to the "https" version of the page. Since the decision is being made on the client side, SSL Stripping tools do not have the opportunity to hijack the redirect from the server, and SSL Stripping is averted.

UPDATE:
I quickly received a lot of responses to this article concerning HSTS (HTTP Strict Transport Security). HSTS does something very similar to what I do in this article, but it standardizes it so that browser developers will have the security measure built in. HSTS is OPT-IN and is activated by the use of a "Strict-Transport-Security" (STS) header from the server. The STS header must be transmitted from the server to the client via HTTPS, so the issue still remains that the connection, if initially made over HTTP, can be hijacked and "SSL stripped". Using JS to enforce HTTPS for that initial requests adds an extra layer of security to ensure that the client is able to make that initial request for the server over HTTPS and receive the STS header to protect future connections.

UPDATE:
For a spirited debate on the validity of this technique, see http://www.reddit.com/r/netsec/comments/149y3s/defending_against_ssl_stripping_attacks/

Join me for SEC542: Web App Penetration Testing and Ethical Hacking at SANS Monterey 2013!
Monterey, CA | Fri Mar 22 - Wed Mar 27, 2013