Security war stories
Vulnerabilities can be fun!
whoami?
Ron Bowes
SkullSpace you say!?
Hacker Jeopardy!!!
Okay, let's get started…
This talk?
Vulnerabilities I've…
NDA…
Vulnerability?
What is a vulnerability?
I'll also talk about best practices, but only in Comic Sans :)
Web
Permit web application
Terrible application, but the best parts:
Best practice: Remember, cookies can be read and written!
.git folders
Easy mistake to make
Best practice: Don't serve random files
Stealing voicemail
Shell injection in a password field?
Best practice: Be very, very careful if you're using system()
singles.org passwords stolen
… by 4chan, of all places. Oops?
Best practice: Don't store passwords in plaintext
Speaking of passwords…
bcrypt() is a very secure password scheme:
Speaking of passwords…
crypt() is NOT:
Best practice: Use bcrypt() or scrypt() or something strong
Red Hat Satellite XSS
Own a network with cross-site scripting?
Best practice: Don't make assumptions about vulnerabilities
Chrome extension XSS
Cross-site scripting in a privileged context!
Best practice: Be careful when coding in a privileged context
Rosetta Flash
Universal cross-site scripting with Flash!?
Best practice: NEVER let an untrusted user choose the first few bytes of a file
Also, parse files/network traffic as strictly as possible
Authentication
Bypass
Issues
Security camera ActiveX
This goes back a long, long time :)
Best practice: Don't use client-side authentication. Or ActiveX.
VNC security downgrade
VNC authentication could be chosen by the client
Best practice: Never trust a client to be sane
RocketSoftware auth bypass
I honestly forgot what the product was called…
But anyway, it used three packets to do stuff:
Best practice: Once again, never trust a client to be sane
Auth bypass in HP NNM
Let's talk about owning another network. :)
Other
vulnerabilities
Format string vulnerabilities
Not a specific issue for a change!
strings
$ strings ./strings-bfd-badptr.elf �Segmentation fault (core dumped)
Best practice: Don't have unexpected behaviour by default
"Shellshock"
On the topic of surprising behavior…
"Heartbleed"
On the topic of�vulnerabilities�with names,�logos, theme�songs, and�breakfast�cereals…
Best practice: Be very, very careful with length values
Speaking of trusting size…
When the WoW beta came out, they�didn't want pirate servers (eg, 'bnetd')
private boolean compareSignatureToIp(byte[] sig, byte[] ip) {
byte[] result = modPow(key, mod);
for(int i = 0; i < 4; i++)
if(result[i] != ip[i])
return false;
return true
}
WoW signatures
Here's what it should look like:
private boolean compareSignatureToIp(byte[] sig, byte[] ip) {
byte[] result = modPow(key, mod);
for(int i = 0; i < 4; i++)
if(result[i] != ip[i])
return false;
+ for(int i = 4; i < 256; i++)
+ if(result[i] != 0xBB)
+ return false;
+
return true
}
Best practice: Be careful with lengths
Speaking of padding…
MS10-070: Padding Oracle vulnerability in IIS
Best practices: a) Don't store sensitive data client-side .
b) When you require integrity, sign (+encrypt)
Speaking of Microsoft bulletins
ms08-068 - SMBRelay
Basically? We make the victim authenticate to itself
Victim
Attacker
Authenticate
Authenticate
(Replay)
Speaking of old stuff
Payphones used to use in-band signalling
Speaking of in-band signalling...
Chat messages in Starcraft (and Warcraft 2)
Novell path traversal
Novell had code that looked something vaguely like:
$file = $request['file'];
$file = "c:\\program files\\novell\\images\\" + $file;
send_to_user(read_file($file));
Novell path traversal
After patching, it looked like:
$file = $request['file'];
$file = "c:\\program files\\novell\\images\\" + $file;
+if($file.startsWith("c:\\program files\\novell\\images\\"))
send_to_user(read_file($file));
+else
+ throw(error)
Completely unreachable!
Best practice: Canonicalize paths and test patches!
And finally…
Best practice: Once again, sign your data!
That's it!
None of these vulnerabilities�could have been found with a�scanner (tools are nearly�useless!)
Many of these can lead to full�code execution
A little bit of foresight�could have saved them!
Learn about security!
Questions?
Mail: ron@skullsecurity.net
Twitter/Github: @iagox86
IRC: #skullspace on freenode
In person:
SkullSpace 9-5 all next� week! Drop by for a tour� and say hi :)
This talk: