Yah, late commentary. Sorry, been a little busy. Brian Chess kicked the hornet’s nest beautifully by declaring:
Penetration Testing: Dead in 2009with:
“Death doesn’t mean it goes away, it means it transforms. Pen testing will be reborn in the area of production monitoring and measurement,” Chess said. “The goal won’t be that failure is found and must be fixed. The goal is that failures will become a much rarer event.”That is a great goal. However, the goal of penetration testing (which in my world is synonymous with security assessments, so if you are going to get all semantic on me, go nuts, most of my customers use these words interchangably, and they are some of the most sophisticated puchasers of security), is not to prove you have a problem, it is a last minute check to find what you missed elsewhere during the construction of a given application or environment. In the future, where security in the SDLC is considered mature, penetration testing will still be there for assurance purposes, but also perform continuous improvement, where the findings get looped back into the process so that developers learn about the latest security flaws that they aren’t defending their applications against.
Spending more in other parts of the lifecycle is essential to effectively manage security. But, no matter how much you spend this year in other parts of your development lifecycle, you will have NO idea what still lurks inside of your application until a qualified party investigates it. The success rate of any top rate security consultancy in finding critical vulnerabilities that customers think were worth the cost of the engagement in 2008 is going to be over 90%.
What should really die in 2009 is the low hanging fruit findings that still plague applications going into production today. SQL injection and Cross Site Scripting were all to prevalent in 2008.
What I actually think is going to happen is that SDLC efforts are going to have an incredibly hard time in 2009. Strategic security initiatives are expensive and time consuming, especially to developers. If you are going to be effective at security in 2009, you are going to have to be low-drag. Dev teams are not going to have the time to delay product releases, by increasing the overhead involved in cumbersome security at each phase.
The status quo is likely to remain just that over the next 12 months. On our list of blog posts coming up will be one on lightweight SDLC. I promise.
ps: if it isn’t at all obvious, it is in Brian Chess’ best interest to say that penetration testing is dead, and it is in mine to say that it is alive and well.
pps: I just read this and I am apparently really rusty at writing blog posts. Please be patient as I evolve from 16 year old emo livejournal quality to the slightly higher Matasano quality.
ppps: Read Ivan’s excellent response and Brian’s response to Ivan’s response.
Just wanted to wish our customers, our readers, the blogosphere, the internet, the world, and the universe a happy holiday season. With an economic decline and mass layoffs, IT security budgets are going to get smaller. Security teams will have to do more with less.
Meanwhile, an economic downturn will increase motivations to commit crime (including computer based). And motivations aren’t the only thing increasing. Attacker sophistication always goes up. Every year, attackers get more and more sophisticated, and no matter how much improvement we make in application security, there still seems to be enough critical security vulnerabilities out there to keep everyone frantically patching.
I promised that I wasn’t going to do a predictions blog post, because next year predictions are like new years resolutions. They seem important on January 1st, and by February 1st you can’t even remember what they were. But, I do have one prediction:
We are going to see an increase in stupid, stupid insider attacks. People who just get mad at their employers and try to inflict damage.
No matter what happens, 2009 is going to be an interesting year for the information security space.
Happy Holidays!
We’ve just released a new version of our first product: Playbook v1.2.
Textual and structured searchPlaybook v1.2 now includes full textual search to complement the previously available rule search. We’ve always known search would be important for Playbook: once you manage a certain amount of firewalls being able to quickly find policies referencing an IP address or service can be a huge time-saver.
Before v1.2 search was limited to what we now call rule format aware search, where only specific elements (e.g., addresses, port numbers, host names) within rules could be used as search terms. This form of structured search works great when you are looking for things that fall within the supported structure: it is often more accurate than its unstructured counterpart, and can provide additional benefits when the search terms are more complex than simple text or numbers. For example, using rule format aware search you can identify all rulesets that reference a given IP address, including those that do so by using a netblock that includes it (e.g., searching for “192.168.2.1” will return firewalls with rules for “192.168.2.0/24”).
But sometimes what you are looking for may not be structured information. You may be interested in all uses of an interface name, specific text within macros or all mentions of “FIXME!” in comments. That’s where textual search comes in. With Playbook v1.2 you can now search all your rulesets using both mechanisms, with the added benefit that textual search can also be used to search the wiki and all firewall doc you’ve written, to, for example, find all mentions of a customer name in your rules and doc at the same time.
Search is also aware of versioning, letting you search any arbitrary version of the content. For example, Playbook can search for all references of a name on last month’s version of the rules, or identify all recent changes affecting firewalls with rules that reference port 8080 (including those edits where the reference was removed).
New rule and wiki editorPlaybook v1.2 includes a new AJAX editor optimized for editing firewall rules right from your browser, with no additional plugins required. This new editor supports Playbook’s edit/preview/publish workflow for editing rules and other content such as firewall doc and wiki pages. A preview button lets you see what your content would look like before submitting your edit. In the few cases where a web-based editor may not be the best tool to edit rules, upload and download buttons let you work on your rules outside the browser.
Where do I sign up?Check out the product’s website for more information on these and other features and to sign up to see the product in action. We’ve added new information on all major features as well as a few additional product screenshots (click on any screenshot to see a larger version).
We are happy to announce a new release of our firewall management product Playbook, available today.
Playbook v1.1 introduces Rule Macros and support for managing rules for Cisco PIX firewalls among many smaller enhancements and bug fixes.Most firewall deployments not only involve multiple devices from diverse vendors but a complex set of rules that need to be maintained over time. Rules may refer to elements specific to each firewall as well as to elements shared across organizational units. More often than not, shared policy elements — common rules for all firewalls in a certain geography, or a common way of dealing with a specific protocol— are a substantial part of these rules. Operations teams resort to all kinds of kludges to deal with shared elements: from massive copy-paste crusades to building tall include-file houses of cards. Playbook offers a better way.
Using Playbook’s new Rule Macros feature you can now create and manage these shared elements individually as an integral part of the firewall hierarchy. Think of Rule Macros as macro language meets tree-like firewall hierarchy. Firewalls that belong to the same area inherit shared elements from the hierarchy automatically. Playbook will track and index all changes to these macros over time and tell you when a change requires you to update your firewalls.
We will be posting more about Playbook and Rule Macros shortly. Sign up to learn more about Playbook!
Anonymizing proxies are often used by people who wish privacy, or to circumvent access controls. High profile political cases such as circumventing the Great Firewall of China and the protection of pro-democracy movements are held up as a model of the positive contributions of anonymizing proxies.
But there are also dark sides to anonymizing proxies, such as using them to harass or stalk other people. Many services such as MUDs or web boards want to be semi-anonymous, and have no interest in the user’s actual identity. In this day and age of free throwaway email accounts, establishing a new identity is easy. Banning an account can be rather futile if all what the offender has to do is establish a new email account. So, access control is often done via IP blocking. If the banned offender continues to persist, often the IP blocks are expanded to include the entire range of dynamic addresses allocated for the offender’s ISP.
However, anonymizing proxies are used to circumvent these IP blocks, and raise the bar for those people trying to control access to their services. While there are many valid uses for anonymizing proxies, a few abusers cause there to be a keen desire on the part of administrators to ban them from connecting or utilizing their services outright.
Many of these anonymizing proxies are not helpful enough to identify themselves as such, making banning them tricky. The question then becomes, how can the use of anonymizing proxies be detected? This in part depends on what sort of proxy is used.
There are:
Analysis of the HTTP headers can reveal anonymous proxies, as these headers are often rewritten in a very characteristic way. User-Agent, From, and Referer headers are usually modified or removed to protect the user’s privacy. By outright rejecting unusual variations on these, it is possible to detect and stop anonymous proxies. There are Snort signatures for detecting this as well.
Along the vein of detecting proxy usage, one approach that works against TOR as well is to exploit the fact that the web browser client is executing client-side code such as Javascript, Java, or Flash. TOR uses Privoxy, and Privoxy often rewrites the content that is sent to the client. By detecting altered content using Javascript, it is possible to determine the use of specific anonymizing proxies and reacting differently. This code can be used as a gatekeeper, that checks before loading extra content. Sending this information back to the server might be viewed as a privacy violation. But this is not perfect, as it could be circumvented by a savvy user using force browsing.
A lower level mechanism is to open a Java socket connection back to the server. Jeremiah Grossman and RSnake at ha.ckers.org presented on this technique at Blackhat 2007. When the connection is successful, the server has the IP address of the origin, circumventing the proxy. By comparing the IP address provided by the connection with the one obtained via the original connection, a decision can be made as to if it is a proxy. There are also various other techniques that rely on client-side exploitation.
For each connection via Tor, the exit node changes. HTTP uses multiple sequential connections. This can be exploited readily by embedding a signature that contains the remote address that previously connected, the user agent, and other headers. This is then MD5’ed into a session hash. If the exit node changes, the remote address will change, consequentially, changing the session hash. When the session hash changes, the application or site can kick the user out to a login page.
Another way to detect anonymizing proxies is to download proxy listings on a daily basis and add them to a list. By comparing the connecting IP address to the list, it can be determined if it was via a proxy. This is imperfect and does not cover all the possible proxies. This also includes downloading a list of Tor exit nodes.
One of the more intriguing papers encountered during the research for this post was Identifying Proxy Nodes in a Tor Anonymization Circuit by Chakravarty, Stavrou, and Keromytis. By measuring the network characteristics of a connection via Tor, it may be possible to determine that the communications came via the anonymous proxy. This is speculation, however, and further research may be coming to investigate this. There may be a technical and detailed blog post on this in the future!
As stated earlier, it is not the most trivial of tasks, but by using a combination of techniques, a website operator should be able to block anonymous proxies. If it is a lower level application such as a MUD that one connects to via telnet, then simpler techniques such as proxy list blocking are necessary. Packet inspection or characteristic measurements may allow such applications to block proxy nodes.
I just finished an interesting pen test: an infrastructure who’s entire attack surface consisted of custom embedded hardware devices. They communicated via proprietary wireless data connections.
It was a short project. A few weeks, tops. Getting in bed with their comms wasn’t really feasible: high barrier to entry, requiring hardware I didn’t have. All the traditional back-end systems (PC, servers, etc.) were also out of scope, because they were housed in a secure data center away from the internets, accessible only via the private connections with the devices.
It was looking bleak.
Physical access to the devices was ‘in scope’, so I reluctantly popped one open. As I expected, it was full of entirely proprietary hardware: the mainboard and the peripherals, all communicating across several proprietary buses… and… serial.
So I decided (again reluctantly) to look at the serial stuff. I found a few admin ports, but that was underwhelming. But things got interesting when I noticed that, in one special mode, all the communication peripherals spoke to the mainboard over serial and not the bus they were seated in.
I am not really a hardware guy. I reverse and source audit. So, in my view, it still looked bleak.
Nonetheless, I decided to try my hand at spying on the serial traffic. The first technique I tried was suggested by Eric Monti (who I discovered had done something similar with great success in the past). His suggestion: use two serial ports on my laptop, making it “inline” between peripherals intercepting and rewriting the data with a vanilla “select() loop” style mux. Eric provided some code that I hacked up a bit. This worked, but only partially, because some of the devices failed to initialize during hardware handshake when my laptop was inline (I still don’t know why. I suspect some of the pins I couldn’t control went from low to high… again… I’m not one of the Matasano hardware guys).
The only thing left to do really was passively spy on the traffic between the peripherals. This would require a hardware serial tap. I thought about it, and it seemed reasonable. So I googled around and found this.
I took some (reluctant) trips to Radio Shack and Fry’s and tried my hand at building his tap, not really expecting to get anywhere. After three failed attempts, I realized that this guy’s wiring diagrams were subtly incorrect. The pinouts were wrong. I tried my new design which looks more like the diagram above. The device came out looking something like the photograph below.
I fired up minicom/zterm, and began seeing all the traffic on the bus! (Really only half because each side of the tap is only half duplex.) So now I was starting to feel a little more confident. This was familiar territory, I could now try my hand at reversing the protocol spoken across the peripherals to see what was being sent to the back-end servers. Before I could do that however, I needed to write custom tools —- minicom wouldn’t cut it.
So I wrote an internal serial terminal and injection tool called serial_snoop to be used with this serial tap. It has two modes: The first is passive, and it just displays data on one or two buses. The second drops you into a interactive python shell, and acts like minicom, only instead of reading from STDIN (as minicom does) serial_snoop sends data out onto the serial device via object method calls (which I provide in a big class). Because it’s interactive python you can also import “helper objects” to perform tasks… this allowed me to play interactively with the devices, and name helper functions specifically to their purpose (“initialize_wireless_iface()”, “send_packet()”, and potentially “crash_server()” :-).
And this is where our story ends. I spent about a week reversing the protocols spoken by the device to the back-end systems. It was a surprisingly simple protocol. By the middle of the last week, I had replicated most of the functional parts of the protocol and I had successful data injection into the back-end systems via the wireless interfaces in the device.
The moral of the story, I guess, is that if I can do simple hardware stuff like this, anyone can. Hardware never gets solid testing because of obstacles that may actually be easy to overcome. If you can successfully hop the hardware hurdle, you can find all that never-before-seen attack surface.
I didn’t mean to! … Ok yes I did.
http://www.opera.com/support/search/view/901/
I like Opera but it has not received as much ‘security attention’ as Firefox or Internet Explorer. Opera is pretty big in the mobile browser market, so this will probably be changing real soon. Web application flaws and attack techniques are growing everyday but the browser itself is still an excellent and reliable attack vector. In this case the vulnerability is based on a ‘specially crafted URI’ which of course can be triggered by any attacker controlled content. It is reproducible on both x86 Linux and Win XP SP2 and Vista.
This flaw was found using some rudimentary fuzzing, simple stuff really. I basically whipped up a few lines of Javascript to create different URI’s with incrementing string lengths (yes I’m serious). And thanks to Immunity Debugger I was able to boil it down to a heap overflow in no time.
The offending URI was ‘http://BBB*BBB:password@example.com’. This took minimal effort to find and underscores the importance of simple fuzzing test cases being built into your SDLC.
Here is a screenshot of Immunity Debugger when Opera crashed.
Don’t forget to patch: Opera
Been a long time since I’ve posted. I am hereby posting to say that I will be posting again. Specifically about testing Web Services. Which often turns out to be a pain in the arse.
In the interim, I wanted to say that I was going to be in Chicago next week. From Tuesday to Thursday. If anyone wants to meetup, just send me an email or leave a comment. That also means, I will be there for Chisec 21, 7PM-9PM Hop Haus.
I now return you to our irregularly scheduled programming.
This is the first in a series of posts covering VoIP.
There are two separate components to most VoIP implementations:
There are also master/slave protocols that incorporate signalling, but directly control the client hardware or software. With this, the handset or softphone is a dumb terminal where keypresses are sent directly to the host which controls the display and indicator lights. Examples include Nortel’s UNISTIM, and Cisco’s Skinny Client Control Protocol (SCCP).
With this in mind, we can classify VoIP endpoint philisophies as follows:
In this post, I am going to be focusing on and attempting to distill the essentials of SIP, demystifying it for the security audience who wishes to work with it.
One day, Mario was on his way to visit Princess Peach at her invitation. He saw her standing outside of the Warp Pipe that lead to her Castle. He waved at her. She waved back.
And then, oh no! Bowser’s minions snatched her away!
But fortunately, the Mushroom Kingdom was recently wired for WiFi. So Mario whips out his wireless SIP phone. He calls Toadstool, Peach’s loyal servant. Toadstool is on the local wireless network. Mario pushes the speed dial button for Toadstool, which has Toadstool’s domain name.
Once this has been resolved to an IP address, SIP handshaking happens. SIP is transport independent but is usually carried over UDP. SIP messages are text based in the theory that they are easier to monitor and diagnose, with messaging that is stateless and very alike HTTP.
First, Mario’s phone sends a SIP INVITE packet to Toadstool’s phone. It includes all the details on who is calling, including how to contact the caller. This includes origin and ports. Toadstool’s phone responds with a ‘100 Trying’ and then a ‘180 Ringing’ message. When Toadstool answers the phone, it sends a ‘200 OK’ message. When Mario’s phone receives the OK message, it sends an ACK back. Once this happens, voice on each end is sent to the other via RTP over UDP using the IP and ports set up in advance during the SIP transactions.
“Oh, no!” cried Mario to Toadstool, “Bowser’s minions kidnapped Princess Peach!”
“Again?! We have to teach her how to defend herself. She just hasn’t been herself since Super Mario Brothers 2,” replied Toadstool, “I’ll round everyone up. Luigi is away at the Mario Kart Racing Track though.”
“All right! I’ll call him,” replied Mario to Toadstool and then hung up.
Now, for those of you readers who are rooting for Bowser, was he smart enough to realize that you can spoof UDP packets and CANCEL a call before Toadstool could answer? Or did he understand that SIP packets can be intercepted on a local network, and he could set himself up as the man in the middle? Unfortunately for those of you inclined to cheer for the villain, he is a giant turtle of habit. Body snatching and sending minions out is the extent of his technique.
A pity, for that if he had sent out countless INVITE packets on the Mushroom Kingdom network, he could have shut down the entire phone system and gotten away clean with Princess Peach.
Since Luigi was outside the Cloud Kingdom, when Mario dialed for Luigi, his phone talked to the Mushroom Kingdom SIP Proxy.
The SIP Proxy does resolution for the address provided, which was luigi@mushroom. When Luigi went to the Mario Kart Racetrack, his phone registered itself with the Mushroom Kingdom SIP Proxy. When it registered, it let the proxy know what its IP address is and how to contact it.
So when Mario called Luigi, the SIP proxy resolved according to Luigi’s REGISTER information. The standard SIP handshake is passed back and forth. When it gets to RTP streams is where it gets complicated. The Mushroom Kingdom could be using a STUN server as well. Or their infrastructure could be SIP aware, and open ports accordingly on the Mushroom Kingdom firewall.
“Luigi!” Mario exclaimed and could hear his brother’s kart roaring, “Princess Peach has been kidnapped by Bowser!” And with that, Luigi veered off the race track in pursuit of Bowser’s minions.
Those that are more fond of turtles than plumbers would be saddened to note that Bowser could have impersonated as Luigi on the SIP proxy if he had stolen his credentials. Or Bowser could have spoofed Luigi’s IP address, and Mario’s brother would have kept racing on.
Using the superior communications network, they were able to catch up with Bowser’s koopas and jump on their heads. Mario was rewarded by a kiss from Princess Peach!
I hope you enjoyed reading the story as much as I enjoyed writing it. I hope that this will clarify SIP for some of my readers, and open your eyes as to some of the attack vectors inherent in SIP.
All characters and places used are copyrighted by Nintendo.
The background sprites are credited to GordonBlazin@aol.com
The character sprites are credited to davidjclarke@gmail.com
Hi!
I am Stephen A. Ridley. I recently started here at Matasano as a Senior Researcher (working out of the Manhattan office). I studied Physics, but for work I do software reversing, protocol replication, and exploit development. Before Matasano, I was at McAfee as a Senior Security Architect, in a small (5 person) R&D group learning from all-stars like Mark Dowd, John Viega, and David Coffey. Prior to McAfee I was at Aegis Research (which became ManTech Security and Mission Assurance) supporting the U.S. Defense and Intelligence communities doing reversing and vuln research. I got the opportunity to do all kinds of other neat stuff there, but mostly I got to be batboy for all the grand slammers on that team.
Here at Matasano, I again find myself fortunate enough to be on another phat team. I (probably like most of you) came up following groups like Teso, #ADM, and antisec.is while getting amused by groups like b4b0, ~el8, and gob bles. Also, like many folks in this industry, my motivation tends to wax and wane, limboing between states of limerence and ‘jaded disillusionment’. (If you remember, for a while folks thought it was all over after ~2001…but here we are.)
While the game is definitely different now, there is still some inspiring stuff being done. Most recently some of the public discoveries and techniques I found to be pretty re-inspiring in different ways were:
Work like this serves as reminders that there is still a lot of unexplored landscape out there with plenty of good work waiting to be done regardless of how bleak the future might sometimes look for cool bugs. I look forward to “settling in” to work on some of the neat projects we have lined up here at Matasano and hopefully posting a bit here on the blog.