June 2011 Archives

I am getting a bit sick of sites either storing passwords in the clear or as simple MD5 hashes (which is different than the crypt3 function using MD5 BTW).

There are a series of stories about how Groupon India was storing Passwords in the clear, but also accessible via Google Searches. Apparently, the magic query was “filetype:sql” “password” and “gmail".

What the hell? Honestly, though I am not that surprised. Simply go to a site or two that have a link for lost or forgotten passwords and have them send you a reminder. And by reminder I mean, a number of them will send you your actual password.

Either way you should be checking https://shouldichangemypassword.com/ on almost a daily basis.

-strandjs

PaulDotCom will be teaching Offensive Countermeasures at Black Hat July 30-31

Chris "carnal0wnage" Gates joins the crew and explains what a Army Signal officer is, what can be done to help companies scope properly to get the most out of a pentest. Also discussion around wXf. Enjoy.
Episode 249 Show Notes Episode 249 part 1 Direct Audio Download All the Pauldotcom Security Weekly episodes on our Bliptv archives. Hosts: Paul "PaulDotCom" Asadoorian,Carlos Perez,Larry Pesce Audio Feeds:

Penetration Testing The Insane

|

Wow, just when I thought we had beat this topic to death, out comes Pete Herzog with a refreshing look at security and testing. The first thing you have to realize is that vulnerability and patch management only take you so far. This is sort of like the new firewall, while it provides some protection, it still leaves you feeling vulnerable and awake at night at 3am asking yourself if you're going to be the next RSA or Sony. Pete calls for a return of real penetration testing. The type of testing that is going to look deep into your environment, tie systems together, string up multiple small vulnerabilities, and tell you where your real problems are. The problem is that no one wants this type of testing. I think it’s this way for two reasons, they know you will find holes, and its cheaper to just run a vulnerability scan and limit scope to finding stuff that, in the end, doesn't really matter.

We would like to encourage all companies to do a couple of things. First, at a bare minimum run a vulnerability scan against your environment before a test. A growing number of our friends that do penetration testing are getting tired of finding ms08_067 vulnerabilities. Basically, you should do an in depth scan and a basic penetration test before you have a test that is at the level Pete is talking about.

Tonight at 7:30 PM EDT, we'll have Chris Gates of the infamous Carnal0wnage/Attack Research blog and contributor to the Metasploit and wXf Projects on to discuss his work with his latest venture, Lares Consulting.

Episode 249 will also feature a special guest technical segment with Kevin Fiscus who will go over ways to use snort (and a variety of regular expressions) to catch base64 on the network.

This Thursday night, don't miss out on some great discussions on Metasploit, web application frameworks, snort and other pure geek heaven topics, all live on Episode 249 of PaulDotCom Security Weekly, via the link below:

NOTE: The video will play the most recent show up until we are live!

For interactive live video, audio, and chat during each episode you can visit PaulDotCom Live!, just hang out in our IRC channel, tune into PaulDotCom Radio for an audio only version of the show, or if you prefer, visit the Episode 249 show notes page.

- Paul Asadoorian, Larry Pesce, Carlos Perez, Darren Wigley, John Strand and Mike Perez.

Eric Fiterman discuses his black hat training that will help you 'OWN' the data center. Virtualization Forensics is included at no charge to you... download the podcast today.


Of course we have security news the only way PDC knows how to do it.

Episode 248 Show Notes

Episode 248 part 2 Direct Audio Download

All the Pauldotcom Security Weekly episodes on our Bliptv archives.

Hosts: Paul "PaulDotCom" Asadoorian,Carlos Perez,Larry Pesce

Audio Feeds:

As I stated yesterday I wanted to spend a bit of time talking about how you can detect an insider. This seems like the only reasonable course of action based on attacks recently where a treasure trove of UserIDs and passwords have been dumped. We need to stop thinking that attackers are always going to use malware and start thinking that maybe, just maybe, the attackers are in our network using existing user credentials.

Fortunately, there are some things we can do that are cheap and do not require an expensive Data Loss Prevention (DLP) solution. The first one I want to talk about is auditing file, folder and printer access by users. This is a functionality that is built into every Windows system and can be restricted to sensitive files and directories that you wish to have audited.

For more information please check here.

You can configure it to log every time a user accesses a file or just when someone tries to access a file they do not have permission to access.

Screen shot 2011-06-22 at 10.08.57 AM.png
Alice is up to no good


Screen shot 2011-06-22 at 10.10.41 AM.png

Event details

So with this turned on, what would we look for? Ideally, you would be looking for a pattern of access violations from the existing user accounts in your environment. For example, let’s say that Alice generally accesses shares relating to her job in finance. Monday morning she is trying to access files in the development, HR, and research departments of your organization. Oh! And she is trying to access hundreds of files per minute. This might be an indication that she has taken up a new hobby, or it could be that her account is compromised.

Once again, I would like to stress that we need to start looking for additional creative ways to start detecting attacks outside of our traditional IDS/IPS/AV trifecta of fail.

Tomorrow we will be looking at some ways to analyze network traffic for evil.

PaulDotCom will be teaching Offensive Countermeasures at Black Hat July 30-31

Here it is episode 248. Part one leads us off with Joshua "jduck1337" Drake and his contributions to the metasploit project.

Then we have a bearded Unix guy who hates firewalls to talk about his project, Shibboleth.

Episode 248 Show Notes

Episode 248 Direct Audio Download

All the Pauldotcom Security Weekly episodes on our Bliptv archives.

Hosts: Paul "PaulDotCom" Asadoorian,Carlos Perez,Larry Pesce

Audio Feeds:

Just a quick post today.

There is a thought that keeps eating at the back of my head after looking at password disclosure breaches of the past few weeks.

No matter how good your security is, it is only as good as the worst public site your users access outside of work. This means you may have a great password policy, great AV, outstanding monitoring, hired the #1 hacker in the world for testing and you can still be compromised because a user had an account at Sega.

HackerPose.jpeg
"With Spyware there is no hacking anymore." - G. Evans
"Wow. That was dumb." - J. Strand

Why? Because they used the same password at Sega that they use on your site. This is important because I think there are very few (if any) products out there that can adequately address this issue.

How do you detect an attack that is effectively the same difficulty to identify as an insider?

We will address this throughout the rest of this week’s posts.

PaulDotCom will be teaching Offensive Countermeasures at Black Hat July 30-31

Tonight catch Joshua "jduck1337" Drake, Steve Carmody and Eric Fiterman on a jam packed episode starting at 7:30 PM tonight.

Joshua will be on to discuss his prolific contributions at Metasploit, his experience as the CVE 2010-3971 IE exploit module caretaker, and his current gig at Accuvant. Steve will go over the standards based, open source software package for web single sign-on (SSO) known as Shibboleth. To top off the night, Eric Fiterman of the cybersecurity incubator program Rogue Networks and forensics firm Methodvue will give us a sneak peak at his upcoming Black Hat training which promises to help you 'own' the data center.

Don't miss out on some great discussions on Metasploit, SSO, and Virtualization Forensics all done in the signature PaulDotCom style- watch Episode 248 of PaulDotCom Security Weekly as it was intended - live, via the link below:

NOTE: The video will play the most recent show up until we are live!

For interactive live video, audio, and chat during each episode you can visit PaulDotCom Live!, just hang out in our IRC channel, tune into PaulDotCom Radio for an audio only version of the show, or if you prefer, visit the Episode 248 show notes page.

- Paul Asadoorian, Larry Pesce, Carlos Perez, Darren Wigley, John Strand and Mike Perez.

Why we secretly love Lulzsec

|

Patrick, I personally think that you hit the nail on the head on this one. "LulzSec is running around pummeling some of the world's most powerful organizations into the ground... for laughs! For lulz! For shits and giggles!

Surely that tells you what you need to know about computer security: there isn't any." While I may not agree with Lulzsec's actions or ethics, they are certainly raising awareness, and hopefully cutting through the FUD.

It is odd, we have had a number of the CEOs and CTOs become directly interested in the testing we are currently involved in. Why? Because every week there is a new story about a large company being attacked.

Yesterday, on the Core webcast, we were taking about the bear analogy. Many managers say they don't have to be the fastest, we just need to be faster than the other guy when being chased by a bear.

But what if there are a lot of bears?

And the majority of them are smarter than you?

HackerBer.jpeg
Bears use Unix.. Because Unix is cool, and they can afford it.

Now, management is starting to get it. Now they are seeing very large organizations fall. Now, they are learning their organization is tasty and goes good with berries.

From Larry and John

PaulDotCom will be teaching Offensive Countermeasures at Black Hat July 30-31

This has all but one of the hallmarks of a great PaulDotCom story. We have nudity? Check. We have malware? Check. We have privacy issues? Check. We have beer? Dang!

homer-crazy.jpg

All work and no beer make Homer something something

Apparently, this PC repair person would install malware on people’s computers and send them periodic messages that a sensor was dirty and one way to clean it was to get it near steam - Because electronics love water.

I really have a feeling that the industry has abandoned home users. Many of the home anti-malware programs are sub-par at best. Why would they be anything more than that? Look, home users run all kinds of vile programs. Those games where you have to whack Justin Bieber to win a prize? Yeah, they actually play that. A nice program where they change their desktop background to a new picture of a cat every 15 minutes? They think it is the greatest thing next to Farmville. So why should you care? You can just buy a shirt that says, "No, I will not fix your computer" and be done with it. Right?

fixcomputer.jpg

It is witty, geeky and makes you look like a jackass at family functions


Well, no. See, we are in the middle of a pen test where the company has given their customers an allowance to buy a computer that they are responsible to maintain. Then, the company moved all of their data and email to the cloud. I am sure you see where this is going.

tornado.jpg

Is that the "Cloud"?

How do you test this? There is no way we will get authorization to exploit home users’ systems... And therein lies the problem. Un-ethical hackers (or Black Hats) will attack home users. We need to find a way to model this risk. One thought is to track the attacks against home users to see if there is a risk for the company environment. The problem I have is that if your organization asks about home PC security are you somehow responsible?

Just a thought.

Brought to you by Larry, Paul, John and Duff Beer.

PaulDotCom will be teaching Offensive Countermeasures at Black Hat July 30-31

IMF Hacked

|

It seems that every week we are seeing a whole new slew of major security attacks. We could go through the list but at PDC we have a game where every time a new one is mentioned we have to drink. It is early in the morning and I don’t think that would be a wise decision.

DrinkBaby.jpeg
... and because of PaulDotCom.

The most recent one is the attack on the International Monetary Fund (IMF). Once again, details are very sketchy as of right now, but it is clear they were attack and it is clear that they had to cut their connection to the World Bank because of the attack.

Right now the rumors are stating that the attack was not related to the RSA debacle. Which is good, I think… However, it does appear that the attack was a spear-phishing attack. Once again, we have to ask if it is really necessary for all of our users to access the Internet as part of their jobs? Paul and I are working on a test this month where we had the customer check out a site with some information on a vulnerability we had found. It took him a while to get to the site because he had to switch to a different computer that was connected to the Internet via a cable modem that was completely segmented from the rest of their environment. He stated that they are moving to a posture of Internet white listing rather than a black list approach. Why? Because they were tired of dealing with the spear-phishing attack of the month.

There are also two other bits of information that I find terribly interesting. One, they noticed the attack because of a file transfer. This rocks. If it is in fact the case that they discovered the breach because of a change in network flow (and the bad guys did not have access for weeks, or months) we at PDC would like to commend the IDS/Network/Admin team.

KickAss.jpg


Well done guys.

The other bit of interesting information is that they severed their connections with the World Bank. There are some other things we can read between the lines on this one as well. One, they had someone on staff who was willing to make a hard call. Also, they had the technical capability to cut the connection. I know this seems like a petty, small thing, however, we have worked on a number of incidents where the customer had no idea how to sever a connection.


news_cable_mess_03_full.png

Who can blame them... really?

So, two things you need to do this week:

1. Sniff your traffic at the edge of the network. If HR gets all nuts about privacy just collect the TCP/IP header data. Then look at the HTTP statistics and see how much traffic is business related.

2. Ask management if you have the procedures in place to cut your connection to a major business partner or the Internet - In the right circumstances of course.

For more on the IMF attack please see below:

http://www.theregister.co.uk/2011/06/13/imf_hack_attack/

http://www.nytimes.com/2011/06/12/world/12imf.html?_r=4

http://www.bbc.co.uk/news/world-us-canada-13740591

http://www.bloomberg.com/news/2011-06-11/imf-computer-system-infiltrated-by-hackers-said-to-work-for-foreign-state.html


PaulDotCom will be teaching Offensive Countermeasures at Black Hat July 30-31


Peter Zerechak the creator of the upcoming doucmentary CODE: 2600 a look at the hacker community, joins us for a discussion on his work filming and what kind of a film he wanted to make.

Watch the blip.tv video for a special 10 min trailer that was made for the PaulDotCom Security Weekly episode.

We do have a fine tech segment from Tim Tomes (LaNMaSteR53) and using Google to brute force subdomains. Of course we also have security news and review of this week in the blog..

Episode 247 Show Notes

Episode 247 Direct Audio Download

All the Pauldotcom Security Weekly episodes on our Bliptv archives.

Hosts: Paul "PaulDotCom" Asadoorian,Carlos Perez,Larry Pesce

Audio Feeds:

Visit Tim "LaNMaSteR53" Tomes' tools page for the latest version of the script and catch him on Episode 247 of PaulDotCom!


Recently, I (Tim Tomes) have been listening to Kevin Johnson's (SecureIdeas) SANS SEC542 mp3s on my trips back and forth from the office just to refresh some of the basics of web app pentesting. Day 2 includes a block of instruction where Kevin talks about using advanced search engine queries to discover subdomains, replicating a dns zone transfer when zone transfers are disabled on the dns server. Basically, the technique involves making search engine requests which restrict the url and site to the target domain. Then, based on the results of the search, excluding the subdomains that are returned. Repeat until the search engine returns 0 results. The final search query excludes all of the public facing subdomains that the search engine is aware of. Conduct a dns look-up of each of the identified subdomains, and you've got yourself a dns zone transfer of all the subdomains with public facing web servers.


Kevin discusses a couple of tools that automate this process. Some of the tools he discusses use paid-for API keys (therefore, not openly available) while others do a lot of different things, but are not designed for this specifically. Bottom line, he doesn't provide a tool which does this. Thus, the idea for GXFR was born.


image here


GXFR shows its strength in requiring only a few requests and having the ability to be tuned to avoid shunning. I was able to resolve 33 subdomains for SANS.org (at the time) with only 8 requests and avoid shunning by employing a 5 second delay (default) between requests. GXFR also has the ability to issue requests via http or https based upon whether the '--no-encrypt' option is used. If all you want to do is discover subdomains, but aren't necessarily interested in the ip information, then exclude the '--dns-lookup' option. If you want to be extra careful, or you are already shunned, you can use the '--proxy' option and feed the script a list of open http/socks proxies or an ip and port of a single proxy. When using the list, the script will "proxy spray" all of your search engine queries by sending each request through a proxy randomly selected from the list. The script does some proxy validation at run-time, letting you know if the proxy is valid, and exempting it from further use if it is not. This feature provides the user will all kinds of flexibility. i.e. send requests through netcat/ssh pivots or tor, monitor requests via interception proxy, use script from behind transparent proxy, etc. The latest version of the script comes with the ability to set a custom user agent string. You're welcome bitform! :D


There are a couple of issues. The "search engine of choice" enforces a maximum words per search limit of 32 words and a maximum search string length of 2074 characters, so GXFR is limited to identifying ~32 sub domains or less depending in which threshold you hit first. It sucks, I know. I'm currently looking for a way around these limitations without using the API. However, in the mean time, the tool still does the job of automating the task for you, as the word and character limits would still apply if the technique was done manually.


I have shared GXFR with Kevin and you can expect to see it in the SEC542 curriculum in the near future and upcoming releases of SamuraiWTF. It may also pop up in the web sections of Ed Skoudis' SEC504 and SEC560. As always, if we don't share, we all fail, so please let me know if you identify any bugs while using the tool. Thanks, and enjoy!


Sample output in verbose mode: (3 proxies listed in the file 'proxies', 2 of which were invalid)



root@bt:~# ./gxfr.py *domain-omit* --proxy proxies --dns-lookup -v
[-] domain: *domain-omit*
[-] querying search engine, please wait...
[+] sending query to 123.201.211.145:80
[!] subdomain found: www.
[!] subdomain found: educations.
[!] subdomain found: promotions.
[!] subdomain found: wanfest.
[+] sleeping to avoid lock-out...
[+] sending query to 222.215.230.56:80
[!] 222.215.230.56:80 failed: <urlopen error Tunnel connection failed: 403 Forbidden>
[+] sending query to 1237.0.0.1:8080
[!] subdomain found: secure.
[!] subdomain found: images10.
[!] subdomain found: espanol.
[+] sleeping to avoid lock-out...
[+] sending query to 1233.171.253.70:80
[!] 123.171.253.70:80 failed: <urlopen error Tunnel connection failed: 404 Not Found>
[+] sending query to 196.201.211.145:80
[!] subdomain found: twmts.
[!] subdomain found: e.
[!] subdomain found: e3wwwtest.
[!] subdomain found: m.
[!] subdomain found: biz.
[!] subdomain found: mts.
[!] subdomain found: blog.
[!] subdomain found: partner.
[!] subdomain found: www.biz.
[+] sleeping to avoid lock-out...
[+] sending query to 123.0.0.1:8080
[!] subdomain found: e4wwwtest.
[!] subdomain found: e4ssltest.
[!] subdomain found: e3ssltest.
[!] subdomain found: images17.
[+] sleeping to avoid lock-out...
[+] sending query to 123.201.211.145:80
[-] all available subdomains found...
[-] successful queries made: 5
[+] final query string: https://encrypted.google.com/search?num=100&q=inurl%3A*domain-omit*+site%3A*domain-
omit*+-site:www.*domain-omit*+-site:educations.*domain-omit*+-site:promotions.*domain-
omit*+-site:wanfest.*domain-omit*+-site:secure.*domain-omit*+-site:images10.*domain-omit*+-site:espanol.*domain-
omit*+-site:twmts.*domain-omit*+-site:e.*domain-omit*+-site:e3wwwtest.*domain-omit*+-site:m.*domain-
omit*+-site:biz.*domain-omit*+-site:mts.*domain-omit*+-site:blog.*domain-omit*+-site:partner.*domain-
omit*+-site:www.biz.*domain-omit*+-site:e4wwwtest.*domain-omit*+-site:e4ssltest.*domain-
omit*+-site:e3ssltest.*domain-omit*+-site:images17.*domain-omit*

[subdomains] - 20
www.*domain-omit*
educations.*domain-omit*
promotions.*domain-omit*
wanfest.*domain-omit*
secure.*domain-omit*
images10.*domain-omit*
espanol.*domain-omit*
twmts.*domain-omit*
e.*domain-omit*
e3wwwtest.*domain-omit*
m.*domain-omit*
biz.*domain-omit*
mts.*domain-omit*
blog.*domain-omit*
partner.*domain-omit*
www.biz.*domain-omit*
e4wwwtest.*domain-omit*
e4ssltest.*domain-omit*
e3ssltest.*domain-omit*
images17.*domain-omit*

[-] querying dns, please wait...
[+] querying dns for www.*domain-omit*...
[+] querying dns for educations.*domain-omit*...
[+] querying dns for promotions.*domain-omit*...
[+] querying dns for wanfest.*domain-omit*...
[+] querying dns for secure.*domain-omit*...
[+] querying dns for images10.*domain-omit*...
[+] querying dns for espanol.*domain-omit*...
[+] querying dns for twmts.*domain-omit*...
[+] querying dns for e.*domain-omit*...
[+] querying dns for e3wwwtest.*domain-omit*...
[+] querying dns for m.*domain-omit*...
[+] querying dns for biz.*domain-omit*...
[+] querying dns for mts.*domain-omit*...
[+] querying dns for blog.*domain-omit*...
[+] querying dns for partner.*domain-omit*...
[+] querying dns for www.biz.*domain-omit*...
[+] querying dns for e4wwwtest.*domain-omit*...
[+] querying dns for e4ssltest.*domain-omit*...
[+] querying dns for e3ssltest.*domain-omit*...
[+] querying dns for images17.*domain-omit*...

[ip] [subdomain]
1233.52.123.185 espanol.*domain-omit*
1233.52.123.188 secure.*domain-omit*
1233.52.123.185 www.*domain-omit*
123.130.131.1234 e.*domain-omit*
123.14.67.182 mts.*domain-omit*
123.186.163.206 blog.*domain-omit*
123.52.123.162 e3ssltest.*domain-omit*
123.14.213.161 e4wwwtest.*domain-omit*
123.44.23.113 images10.*domain-omit*
123.44.23.106 images10.*domain-omit*
123.14.213.162 e4ssltest.*domain-omit*
123.93.50.155 wanfest.*domain-omit*
123.52.123.154 biz.*domain-omit*
123.14.213.154 biz.*domain-omit*
123.167.248.98 twmts.*domain-omit*
123.44.23.130 promotions.*domain-omit*
123.44.23.104 promotions.*domain-omit*
123.44.23.1233 images17.*domain-omit*
123.44.23.104 images17.*domain-omit*
123.52.123.154 www.biz.*domain-omit*
123.52.123.161 e3wwwtest.*domain-omit*
123.84.247.59 educations.*domain-omit*
123.84.247.26 educations.*domain-omit*
123.14.213.151 m.*domain-omit*
123.140.1238.155 partner.*domain-omit*

- Tim Tomes

UPDATE 6-8-2011:
Tim Tomes, Captain and former Red Team leader for the Army, will be on the show to give us an overview of his Search Engine Based Domain Transfer Tool, GXFR.
----
Jeremy Zerechak will be on PaulDotCom Security Weekly at 7:30 PM ET to give us a special preview of his upcoming documentary film "Code 2600"! The film "is an exploration of the struggle to adapt to the often dangerous and delicate vast cyber networks that have defined our identities and way of life".

Therefore, we encourage you to make Thursday night your movie night, grab some popcorn and enjoy Episode 247 of PaulDotCom Security Weekly as it was intended - live, via the link below:

NOTE: The video will play the most recent show up until we are live!

code2600.jpg

For interactive live video, audio, and chat during each episode you can visit PaulDotCom Live!, just hang out in our IRC channel, tune into PaulDotCom Radio for an audio only version of the show, or if you prefer, visit the Episode 247 show notes page.

- Paul Asadoorian, Larry Pesce, Carlos Perez, Darren Wigley, John Strand and Mike Perez.

Friday Night episode from Casa Assadoorian. Wee bit of a tech segment on some PenTesting basics... like screen, ls, grep, tail, also some NMAP basics.


Of course we have Security news and review of this week in the blog..

Episode 246 Show Notes

Episode 246 Direct Audio Download

All the Pauldotcom Security Weekly episodes on our Bliptv archives.

Hosts: Paul "PaulDotCom" Asadoorian,Carlos Perez,Larry Pesce

Audio Feeds:

And now for your downloading enjoyment we have Moxie Marlinspike as he shares with us the going ons at Whipser Systems and attempts to make Android do the right thing. Don't miss a discussion on finding Mary Jane on a beach and in the middle of the ocean.
Of course we have Security news and review of this week in the blog..
Episode 245 Show Notes Episode 245 part 2 Direct Audio Download All the Pauldotcom Security Weekly episodes on our Bliptv archives. Hosts: Paul "PaulDotCom" Asadoorian,Carlos Perez,Larry Pesce Audio Feeds:

Good people of Boston: hide your women and laptops! OK, at least just consider shielding your laptops from having beer poured inside... But bring your leftover ShmooBalls to tonight's Boston OWASP meeting going on at Microsoft NERD in Cambridge, MA to catch PaulDotCom speaking live.

Catch the PaulDotCom crew live Friday night at 8PM for a round up of news, stories and end of the week shenanigans with Episode 246 of PaulDotCom Security Weekly live, via the link below:

NOTE: The video will play the most recent show up until we are live!

For interactive live video, audio, and chat during each episode you can visit PaulDotCom Live!, just hang out in our IRC channel, tune into PaulDotCom Radio for an audio only version of the show, or if you prefer, visit the Episode 246 show notes page.

- Paul Asadoorian, Larry Pesce, Carlos Perez, Darren Wigley, John Strand and Mike Perez.

Below is a post that was sent in from Josh More.

I am involved in a great many groups that are (ostensibly) focused on technology or security to some extent. One somewhat disturbing trend that I've noticed in recent months is people complaining about their significant others and how they constantly put their shared system at risk through Facebook. Now, I could make this post about how being with someone means accepting their flaws along with their virtues or even go so far down the path of "all you ever do is complain, why on Earth did you marry them in the first place?", but this isn't that sort of blog. Instead of doing that, I'll point out that we have all the tools we need to secure someone else's connection and you're having issues isn't not because your spouse is stupid, it's because you're lazy.

Here's how to be less lazy... involving Firefox profiles and Facebook.

This is not another "how to secure Facebook" post. To do that, please see this post from Sophos. This is also not about basic Internet security. No, this is about how to use some built-in functionality in Firefox to create walls between dangerous sites. By itself, it will help a lot against account takeovers and complex leveraged attacks... but if you don't follow basic security practices like using complex passwords and not sharing them between systems, the benefit will be limited. Keep this in mind as we go through this process.

Profiles

Firefox uses profiles to separate different settings. They are amazingly powerful, and yet, shockingly, people hardly use them at all. What we're going to do here is create a specific profile for Facebook use and then adjust the default profile to block Facebook. The important thing to remember here is that this technique can be used to protect ANY website, not just Facebook.

Let's start by installing Firefox if it is not already installed. To do that, just go over to Mozilla.com and download and install Firefox. Once it's installed, we have to launch the profile manager. The way you do this is going to vary based on operating system. Under Windows 7 and Vista, go to the search box at the bottom left of the start menu and type firefox.exe -ProfileManager -no-remote. If you are running Windows XP, go to the start menu, click Run... and in the dialog, type firefox.exe -ProfileManager -no-remote. If you are running an older version of Windows, just give up now. Those operating systems are dead and cannot be secured. Either upgrade to Windows 7 or look at running an alternate operating system like Ubuntu Linux.

If you are running Linux, you can just open a shell and run firefox -ProfileManager -no-remote

01-FirefoxProfileManager.png


Now we need to create a new profile for Facebook use. To do this, go to Create Profile -> Next -> Enter Facebook for the profile name and click on Finish.


02-FirefoxProfileManager.png

Now you can just select the Facebook profile and click on Start Firefox. This will launch a basic web browser for you. Now we need to configure the appropriate add-ons.

Add-ons

Firefox supports "add-ons" (also called "extensions") which supply additional functionality to the browser. Each profile maintains it's own set of add-ons, so if you like any of the one's we're adding here and want to use them in your regular browsing, you'll have to add them into the default profile as well.

To select your add-ons, you should open the Firefox menu and select the Add-ons link over to the right. For the rest of this section, we will be adding each add-on by searching for the name in the search box at the top right and then clicking the Install button by the Add-on name. The links provided are so you can read about the add-on before adding it if desired. However, please add them through the Firefox interface so that they will be automatically updated for you.


03-FirefoxAddons.png


  • RequestPolicy - This prevents the so-called "like-jacking" attack by explicitly allowing the browser to connect to specific sites.

  • Web of Trust - This connects your browser to a free service that compares sites you try to visit to known list of bad sites.

  • NoScript - This prevents your browser from running scripts except for the ones that you explicitly allow.

  • AdBlock Plus - Prevents ads from displaying, however, this may break some games. If you play games, please see note 1 at the bottom of this post.

  • Certificate Patrol - Improves the HTTPS security within Firefox.

  • Force-TLS - Allows Firefox to refuse to connect to a site if it is not secure.


Once these are installed, you will have to restart Firefox to activate them. Either click on of the Restart Firefox links or close the browser and re-launch it using the -ProfileManager -no-remote trick above.

Automatic Tuning

Once you've restarted Firefox, it will launch into the automated tuning process and you'll have to specify some configuration options.

The first thing that will come up is the RequestPolicy configuration window. By default, it allows for some automated tuning... but this makes it less secure than we really want here. Uncheck the "International" checkbox and click on "OK". We'll tune the rest of this add-on shortly.


04-RequestPolicy1.png

The next dialog is Web of Trust (WOT). The WOT add-on just needs you to accept the EULA before you proceed. Read the EULA and then click on "Accept" if you accept the terms of the EULA.

Now you should have four to five tabs open. The order will likely depend on the order in which you added the add-ons. We will be tuning the NoScript and ForceTLS later in this process, so just close those tabs.

Web of Trust
This is where things start to get complicated. The RequestPolicy addon, by default, will conflict with WOT. You can tell because there is a red flag icon in the bottom right corner. You need to click on the flag and go up to the "Temporarily allow all requests" option.

NOTE: This is something you should do only during the tuning process. Allowing all requests basically turns off the protection that Request Policy allows, and since this is the key protection for Facebook, it should usually be on.

Once this is selected, the page should reload and give you a configuration page for Web of trust. Basic is good enough for us, so just click on Next.

The next option is to register. You do now have to do this, but if you wish to do so, fill out the form and click Finish. Otherwise click on the little red X at the top of the "window" in the browser. Then close the tab.

06-WOT.png

Adblock Plus

If you chose to install Adblock Plus, this tab will appear. If you chose not to do this, just skip to the next sub-section. On this pane, you select the subscriptions you want. Most users will be fine with just EasyList which should be selected by default, so click on Add subscription and that tab will close.

Options

Now we need to tell Firefox that this profile is to launch Facebook. To do this, click on the Firefox menu and then go to Options and select the top Options option. (And please accept my apologies for that sentence.) You should be in the General tab (far left) of the options dialog. In the area where it says Home Page, please enter in https://www.facebook.com.


07-Options-General.png

Now click on the Content tab. Where it says Enable JavaScript look over at the right and click on the Advanced button. In the tiny little window that comes up, uncheck each checkbox and click on OK. This will help prevent Javascript-based attacks, which are very common on Facebook. We will protect against the rest of them shortly when we configure NoScript.

08-Options-Content-AdvancedJavascript.png

Now click on the Privacy tab and select Never remember history in the drop down. The less data you store, the less there is for an attacker to steal.


09-Options-Privacy.png

Now click on the Security tab. For the most part, the defaults are good, except that it defaults to storing passwords. Remember that every password you store is a password that could be stolen by an attacker. Uncheck the Remember passwords for sites checkbox. If you have used this profile in the past, you may also wish to click on Saved Passwords and select Remove All.

Now for the complicated step. By default, most browsers choose user convenience over security. We discovered this problem back when Comodo was hacked a few months ago, and this is what you need to do to fix it. Select the Advanced tab. Then select the Encryption sub-tab at the far right of the list of tabs below the primary tabs across the top. Click on Validation and click the bottom-most checkbox. Then click OK to close the sub-dialog and then OK to close the options dialog. The drawback to this is that if Facebook's OCSP server goes down, you will not be able to connect. The upside is that if Facebook is attacked, you won't be able to connect to a compromised site.

Now it's time to restart Firefox again. This will clear the temporary setting change we made and get us to where we can start tuning the system. Run Firefox with the -ProfileManager -no-remote trick again and select the Facebook profile. You should automatically-connect to Facebook and be prompted to log in. Just log in as usual and we can start the manual tuning process.

Manual Tuning

Request Policy

This is going to be the most annoying aspect of accessing Facebook this way, but it is very much worth the extra time it takes. When you start Facebook, you will see a bunch of missing images and some grey flags in their place. This is because RequestPolicy doesn't yet know which sites are safe, so it blocks everything.

10-Facebook-Blocked.png

To fix this, click on the little red flag icon in the bottom right of your browser (this is in the status bar of the browser window, not in the Facebook section). This will allow you to let RequestPolicy know which sites can talk to other sites. First we need to go to the Preferences option at the top of the RequestPolicy menu. Click on the Advanced tab over at the right and then select Allow permanent whitelisting when using Private Browsing. Now click on the red flag again and allow the two sites akamaihd.net and fbcdn.net to be accessed by Facebook by selecting the option in bold at the top of each sub-menu.


11-RequestPolicy.png

12-RequestPolicyPrefs.png
13-RequestPolicy-Whitelisting.png

NoScript

Now we need to allow Javascript to more of Facebook will work. To do this, click on the Options button on the yellow bar along the bottom of the screen.
This works much like RequestPolicy. Just click on the Allow Facebook.com option in bold and the page should refresh.

At this point, Facebooks should be looking pretty normal.

ForceTLS

Now to force secure connections in the event that Facebook changes that option (again). To do this, right-click on the Facebook page and select View Page Info, click on the Permissi tab, scroll down to where it says Secure Connection and click on both checkboxes.

Games

At this point, things should be more or less working securely for basic Facebook services (reading and posting to walls, getting messages, etc). If you play games, you may have to go through the RequestPolicy and NoScript steps above to allow different sites, but be aware that for every site you add, you increase your risk significantly.

Default Profile

Now we have to tweak the default profile. Restart Firefox again (sorry), and run Firefox with the -ProfileManager -no-remote trick again. This time, select the default profile and go into the Add-ons section as before. This time, we will be adding only one add-on.

LeechBlock


After it's installed and you've restarted Firefox, it should come back to the Add-ons Manager. If it does not, you can get there by going to the Firefox menu, then to Add-ons then the Extensions. Now click on Options next to LeechBlock. The Block Set 1 tab should be selected. Under What to Block enter *.facebook.com. Then click on Next to go to the When to Block tab. Just click on the All Day and Every Day buttons as you never want to access Facebook from the default profile. Now, click on OK to activate this change.

Note, if you are doing this to protect someone other than yourself, you may wish to turn on some other options in this add-on to prevent them from unblocking Facebook. You may also wish to replace the standard page with one that says that Facebook is only available via the dedicated Facebook profile. These steps are out of scope for this little How To guide.

Optional Others

If you plan to do anything risky in the default profile, consider using the other add-ons that we used on the Facebook profile. After you've used them a bit for Facebook, it should be pretty easy to adapt them to other uses. You may also wish to load LeechBlock into the Facebook profile to prevent people from using that profile to go to other common sites (online banking, webmail, etc) from that profile.

You can also create a dedicated Firefox profile for each of these common uses, if you wish.

Desktop Configuration

Now for the final step. You don't want people to have to manually type in -ProfileManager -no-remote every time they need to access this profile. Instead, we'll modify the Firefox icon on the desktop to do this automatically. To do this, right click on the Firefox icon on your desktop and add -ProfileManager -no-remote to the end of the Target section (outside the quotes). Then click OK to save your change. Now when you double-click on the icon, you will be prompted for which profile you wish to run.

If you wish, you can read a bit more about Firefox profiles and make an icon that launches the Facebook profile, but this How To is long enough already, so I won't be getting into it.

There you go, that's it! While there's no "Safe" on the Internet, if you take these steps, you'll be a whole lot safer than the vast majority of Facebook users.


Notes:


  1. It would be best if you don't play games at all on Facebook. There have been numerous problems with game developers being less than trustworthy... and you probably have better things to do with your time anyway. ;) If you must play games, consider using two Facebook accounts and creating a second "Facebook Games" profile to access them in. This way, if you have your friends in one account and your games in another, a bad game won't put all of your friends at risk.

  2. You should still use a strong password on your account and not share it anywhere else. If you have a weak password, an attacker can figure it out without your involvement at all, and none of these protections will help. If you share passwords, an attacker can use your password to steal a lot more from you. You can generate strong passwords over at Strong Password Generator.

  3. You may wish to add different Firefox themes to each profile so there is a visual reminder where you are and what you can do. You can find lots of Firefox themes at the Firefox Themes Site.

  4. If you are technically-skilled, both RequestPolicy and NoScript allow you to export your configuration so you can import it elsewhere. If you have to set up multiple computers, this can be a time saver (or you can just copy the profile directories). In case it's useful, here are my exported policy files:


PaulDotCom will be teaching Offensive Countermeasures at Black Hat July 30-31