HNHacker News
TopNewBestAskShowJobs

nbpoole

2,035 karma · joined November 2, 2010

Web application security enthusiast. Currently a Security Engineer at Facebook. Formerly a security consultant for Matasano Security. My posts and comments do not reflect the opinions or views of my employer.

Blog: https://nealpoole.com/blog/

Twitter: https://twitter.com/NealPoole

Contact me: https://nealpoole.com/blog/contact/

submissionscomments
nbpoole··on Cookiejacking: 0-day exploit of all Internet Explorer versions
Actually, djbdns does not have a perfect record: http://article.gmane.org/gmane.network.djbdns/13864
nbpoole··on Cookiejacking: 0-day exploit of all Internet Explorer versions
"If this attack involves "simply sniffing TCP 445" why not just MITM the whole session?"

Because it doesn't. The attack involves using a bug in IE (an iframe will render cookie data from the local computer) with clickjacking to steal cookie information. Sniffing on port 445 is only mentioned in the context of figuring out the username of your target (by causing the target to connect to your SMB server, running on port 445).

I'd suggest you go back and re-read the whole page before making sweeping generalizations.

nbpoole··on So how does hacking work anyway?
PHP was my very first language, which in hindsight was probably a good choice for a couple reasons:

1. It's used in a ton of web applications. It's slightly less popular than in the past due to the influx of frameworks like Rails and Django, but a lot of major web software (Wordpress, Drupal, Joomla, MediaWiki, phpBB) still uses it.

2. People tend to write very insecure PHP code, especially when they fail to use a framework. Again, this is slightly less true now than it was in the past. However, it's very common to see bad practices like:

- SQL queries generated via string concatenation

- Output escaping done manually, on a per-element basis, rather than in an automatic, context-sensitive manner.

- File upload scripts that let you upload PHP files, or file download scripts that accept a filename but don't sanitize against directory traversal attacks.

nbpoole··on So how does hacking work anyway?
It's not a big secret at all ;)

tptacek has a list of books on Amazon, linked to from his news.yc profile, which cover a wide range of application security topics (http://amzn.to/cthr46). I own The Art of Software Security Assessment and The Web Application Hacker's Handbook and I can vouch for them as quality resources, although I'm not sure how accessible they would be for a beginner.

In terms of a more practical introduction, Google Gruyere is an application deliberately built with security vulnerabilities for the purposes of learning (http://google-gruyere.appspot.com/). There are plenty of other projects along those lines: WebGoat is another good example.

nbpoole··on Cookiejacking: 0-day exploit of all Internet Explorer versions
Agreed. This IE bug does seem to have some interesting behavior though:

https://twitter.com/#!/superevr/status/73920079921815552

nbpoole··on Simple query parameter to blank pages with Facebook comments
http://forum.developers.facebook.net/viewtopic.php?id=60571

http://bugs.developers.facebook.net/show_bug.cgi?id=9777#c66

So, the problem is framebusting code not playing well with iframes. ;-)

nbpoole··on Chrome has transcended version numbers
"If you've disabled FTP for security reason updating becomes a manual process."

The automatic update process will also work if the webserver has write permissions on the files (which is a bad idea in the first place). But if it doesn't and you can't/won't give it FTP credentials for a user that does, you do need to go through a somewhat manual process.

Personally, I use vendor branching (http://svnbook.red-bean.com/en/1.1/ch07s05.html) in both SVN and Git in cases like this. I don't have to rely on the developers to generate a patch: I get all of the changes pulled directly from my local repository.

nbpoole··on Chrome has transcended version numbers
That hasn't been my experience. I run Chrome on 10.6 and when a new version comes out, I have to manually close/reopen Chrome to install it (usually by clicking the "Update and Restart" button shown in that screenshot).
nbpoole··on Journalist questioned by police after reporting Facebook security flaw
Why do people assume that this is some kind of giant Facebook conspiracy? From the article:

"According to Grubb, security expert Christian Heinrich demonstrated in front of the delegates how he had managed to acquire privacy-protected photos of the wife of fellow conference speaker Chris Gatford, who is Director at HackLabs."

Isn't it more likely that the police are investigating charges against Heinrich in relation to the presentation?

nbpoole··on PHP "require" Performance
Out of curiosity, what does your include_path look like? Is ./ the first element, the last, or somewhere in the middle?
nbpoole··on Show HN: This weird bug is probably present in your Nginx configuration.
Yes, you're right. I actually did move the line in my testing, but for it to work properly, you would want to duplicate it. I'll update my comment. :)

I should also mention that merely allowing uploads via php.ini is not an issue: you need to be storing them somewhere web accessible. A good rule of thumb for this: if you could put a PHP script in the uploads directory and have it execute, you have a potential problem.

nbpoole··on Show HN: This weird bug is probably present in your Nginx configuration.
That configuration contains a major security vulnerability, at least if your site allows file uploads (I tested it on my server to be sure). I've written about this issue before: https://nealpoole.com/blog/2011/04/setting-up-php-fastcgi-an...

Edit: You need to copy the try_files line into the PHP location block. I'd recommend using the following line (I just added =403 to the end of yours, so you return a 403 error rather than a 500 error when try_files fails):

   try_files $uri $uri/ /index.php?$query_string =403;
nbpoole··on Show HN: This weird bug is probably present in your Nginx configuration.
As the blog post points out, this does look to be a consequence of "IfIsEvil" (http://wiki.nginx.org/IfIsEvil). The behavior of calling the script, not rendering it, and displaying the actual file is very strange though, especially since the if statements appear mutually exclusive. Maybe someone with nginx experience can explain why that would happen.
nbpoole··on JSON: The JavaScript subset that isn't
Indeed. You get the same error in Chrome and a slightly different one in Firefox. That isn't valid JavaScript on its own.
nbpoole··on X Factor & fox.com hacked, contestants database leaked
I assume it means that's where temptemptemp13 found the link.
nbpoole··on There's more to HTML escaping than &, <, >, and "
I just tried the following HTML:

    <input type="text" value=`asdf` />
In IE, the input box contained the string asdf. In other browsers, it contained the string `asdf`
nbpoole··on There's more to HTML escaping than &amp;, &lt;, &gt;, and "
` can be used in place of single or double quotes around attribute values in IE.
nbpoole··on There's more to HTML escaping than &amp;, &lt;, &gt;, and "
...except when there isn't. ;-)

PHP's htmlspecialchars function, which is called out specifically in this post, is actually fine for most use-cases. If you write code like this:

    <input type="text" name="foo" value="<?php echo htmlspecialchars($_GET['bar']) ?>" />
Then an attacker can't break out of the attribute (and consequently can't do anything bad). htmlspecialchars also accepts a flag, ENT_QUOTES, which allows it to sanitize values for single-quoted attributes properly. If you don't surround an attribute's value at all, then you're still vulnerable: you also have invalid HTML.

The real takeaway here can be found in the middle of the post: "you must be aware of the context in which you’re working with user input."

nbpoole··on Ask HN: It's 2011. Why is web encryption still coupled with verification?
I'd argue that in order to trust what's in your address bar, you have to have "verification": if you're not sure who's on the other end, you can't trust the address bar. Whether that knowledge comes from a PKI system like browsers use now or an SSH-style system is a separate issue.
nbpoole··on Ask HN: It's 2011. Why is web encryption still coupled with verification?
There was a great discussion about this a month or so ago (http://news.ycombinator.com/item?id=2376431). I'd highly encourage you to read the comments that were made.

As Lanzaa pointed out here, encryption without identity validation is worthless. If anyone can MITM your connection without you knowing about it, your encryption isn't doing you any good. That being said, there is certainly value to the "SSH model", where you verify the destination's fingerprint the first time you connect and any time it changes. That at least gives you the opportunity to know if someone is attacking you.

nbpoole··on Skype bug gives attackers root access to Mac OS X
You don't need a username and password for shell access if the application has a vulnerability that allows for arbitrary code execution. Your code just executes as the same user as the application. To elevate your privileges, you would need to use a separate vulnerability once you have shell access.
nbpoole··on Skype bug gives attackers root access to Mac OS X
Fair enough. The article does link to the actual blog post though (http://www.purehacking.com/blogs/gordon-maddern/skype-0day-v...).
nbpoole··on Skype bug gives attackers root access to Mac OS X
Unfortunately, it's not so simple. Alerting the public before a fix is out is a double-edged sword: it also means malicious attackers have a chance to replicate the finding and abuse it.
nbpoole··on Skype bug gives attackers root access to Mac OS X
It doesn't happen by chance (usually), but it's not an infrequent occurrence either.

Take an example from earlier today: there's a vulnerability in Exim that can allow arbitrary remote code execution (http://www.vupen.com/english/advisories/2011/1185). For anyone who doesn't know what Exim is, I refer you to Wikipedia (http://en.wikipedia.org/w/index.php?title=Exim&oldid=421...):

"Exim is a mail transfer agent (MTA) used on Unix-like operating systems. Exim is free software distributed under the terms of the GNU General Public License, and it aims to be a general and flexible mailer with extensive facilities for checking incoming e-mail.

...

A large number of Exim installations exist, especially within Internet service providers[1] and universities in the UK. Exim is also widely used with the GNU Mailman mailing list manager, and cPanel."

nbpoole··on Skype bug gives attackers root access to Mac OS X
What does XSS have to do with remote code execution? I mean, it's possible for a Javascript parser to have vulnerabilities that can lead to arbitrary code execution, but the Amazon example seems in no way relevant here.
nbpoole··on Quick and simple PHP Twitter login for your site, ideal for your weekend project
Fair enough: you'll have a pull request shortly. ;-)

Edit: Pull request created. https://github.com/jmathai/twitter-async/pull/108

nbpoole··on Gmail Contacts size increased to 25000
There was a previous HN discussion about this limit at http://news.ycombinator.com/item?id=2263093. It included some speculation about why Google would limit the number of contacts.
nbpoole··on JS Source of "Osama Execution" Facebook Worm
- It's not an issue in IE9: "The prefix JavaScript: is stripped from any text pasted into the IE9 address bar. This mitigates a socially-engineered XSS attack common on social networks wherein users were tricked into performing self-inflicted XSS injections upon themselves. No, CTRL+C,ALT+D,CTRL+V, ENTER will not give you magical powers" (http://blogs.msdn.com/b/ieinternals/archive/2011/02/11/ie9-r...)

- Found the following issue for Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=305692

- Found the following issue for Chrome: http://code.google.com/p/chromium/issues/detail?id=6888

nbpoole··on JS Source of "Osama Execution" Facebook Worm
Did you type it in or copy/paste? Only copy/paste is blocked. Also, keep in mind this is a new feature in IE9.

Edit: Just tested again on Windows 7. Pasting javascript:alert(1) caused the javascript: part of the URI to be stripped.

nbpoole··on JS Source of "Osama Execution" Facebook Worm
IE9 actually takes care of this to some degree. For example, try pasting javascript:alert(1) into your address bar and hitting enter: the Javascript is blocked. To bypass it, you need to paste part of the URL into the address bar and manually fill in the rest (specifically, you can't paste a URL starting with javascript: or vbscript:). To the best of my knowledge, IE9 is the only browser that implements this kind of protection.

Two thoughts:

1. Disabling Javascript execution via the address bar is not something Facebook is capable of doing, any more than a random web developer can disable your ability to view the HTML of a page. Protection at this level is up to the browser developers.

2. That being said, I believe these kinds of phishing attacks demonstrate a lack of understanding on the part of end-users regarding what javascript: URIs can do. It's hard to protect users from themselves. ;-)

← PreviousPage 7 of 15Next →