network scanners and flash

So, obviously, network and application scanners are targeting flash ‘.swf’ (swiff) files.  These scanners decompile and then do static analysis on the code.  Very cool stuff.  There are several that I know of that are handling swiff code in this manner.

1) SWFScan  (sorry for linking to a forum search, but there is no nice clean URI for this product)

2) Ratproxy which uses  Flare

If I had the time, I’d like to see how these automated scanners handle malformed swiff files (hack-a-hack attacks).

A quick question for those more familiar with flash security tools: is there an open source lib for decompiling flash swiff files?  Comment here or shoot me an email at dmitry.chan@gmail.com

Peace,

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

Kiosk security

Regarding http://blogs.securiteam.com/index.php/archives/1165 , I won’t be able to do daily posts…I’m just way too busy for that…

A few months back, I was sent a 4-foot tall, 80 pound kiosk in the mail.  I had 32 hours (one weekend) to figure out how to break the software.  It only took a few hours, so I thought I’d put together a list of Kiosk 101 security bullets.

1) Encrypt *all* of the traffic.  If you’re not using certificates, it is downright trivial to modify a DNS server (or write a quick MITM proxy) to point your web/xml client to some other web site.  Plus, do you really want your clients order, warranty information, address, phone number, best time to contact, etc passed in plain text over the web?

2)  Do not trust the store network.  Assume that someone malicious can both read AND write data on the store network.

3) Port scan or do a netstat on the kiosk OS to ensure that your kiosk isn’t set up with a service that binds a socket that you haven’t thought to ACL.  I thought it unusual to find 6 open TCP ports on a secured kiosk device.  For that matter, how about just blocking everything except the ports that you need?

4) disable broadcast services, especially ones that tell the passive listener the OS, system name, etc.

5) there is more at risk than just the kiosk.  Consider the attacker who figures out how the client protocol works and then uses this information to spoof a malicious client and attack the server.

6) disabling the cache on the local system isn’t the same as always storing confidential data securely (in transit and at rest).  Assume that the attacker can figure out your “magic key strokes” (maybe by recording a technician servicing the machine??????) and get local access.

7) This will be a service nightmare, but the devices shouldn’t be configured with the same accounts and passwords.  If you break one kiosk, you shouldn’t be given the keys to all of the same kiosks.

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

Boxers and pen-testers

If you play any sort of sport, you’ll be familiar with the means by which an athlete develops their skill.  I like to box, so I’ll use that as an analogy.  Before you ever get in the ring, you have to know how to balance your body, hold your hands, throw a punch, move your feet and head, etc.  Once you master the FORM, you can then move to SPEED and STRENGTH training.  You don’t start on the heavy bag.  Kids who start on the heavy bag learn how to push a heavy bag…not how to fight.  Kids who start with shadow-boxing, footwork, then move to double-end or speed work, and finally end up on the heavy bag, have the correct form to punch through an object and not push an object.  I digress…

There is a discussion on the dailydave mailing list regarding the benefits of being able to reliably write exploit code in order to do pen-testing.  Writing exploit code, reversing binary apps, and fuzzing are great skills.  I liken them to a knockout punch.  Not many people have these skills (relative to the total number of pen-testers).  The problem is that you don’t want to start learning how to knock people out until you have figured out how to get close enough to throw the punch.  How many times have you seen a pen-tester show up on site with his/her interpreter?  I don’t mean a literal interpreter, I mean the person tasked with harnessing the creative maelstrom that is the pen-tester.  These two (or more) often have their shtick all worked out and the Corporate folks grin along with the show.

Corporate folks: whatcha got on that leash there?

Interpreter: the whooly behemoth, recently returned from a heap-overflow bloodbath at Antigua

Corporate folks: AH!  EEH!  is it…is it like the others?

Interpreter: Unlike any other that has been seen in this part of the corporate world.  Terribly destructive.

Corporate folks: Do we treat it like the others and put it in a cube near the bathroom, feed it pizza and caffeine and never, ever look it in the eyes?

Interpreter: Yes.  Further, you have been blessed with the fact that I have been blessed with the ability of communicating with Bob…errr…the Behemoth.  [turns to behemoth] ukkle snarp miselthrape dominos pizza muhgarkle

Behemoth: muhgarkle?  jasi blem blam Papa Johns [and shuffles off to cube]

Interpreter: He’s on it now.  [winks at crowd]  I don’t know howwwwwww he does it [glances over shoulder at shuffling behemoth]…different breed, that’s for sure.

Corporate folks: [laughing].  Well, we sure are glad they sent You.  Some companies [wink wink] just leave their behemoths on site with no supervision.

Interpreter: Oh, no.  Yeah, we could never do that with this one…I could tell you some stories…oh my…leave him alone on site…horrible…hey, it’s almost 11:00.  Who’s up for lunch?

This is roughly akin to a boxer entering the ring on the shoulders of another guy.  The other guy lugs him around the ring, trying to position him to throw haymakers at the opponent.  How much better if the guy throwing the haymakers had mastered the form necessary to get close enough to land a punch.  With respect to corporate consultants, the form isn’t really that hard to come by.  A few things:

1) You should be and smell clean.  Often overlooked, a consultant should be well dressed, groomed, and not reek of the margarita shots that he/she was taking at the strip club 3 hours before the work day began.

2) You should be able to communicate with the business professionals that are paying for your consulting.  This includes both speaking AND writing in a clear and intelligible fashion.

3) You should be able to understand business drivers and how they might *possibly* apply to your consulting engagement. This is an important point - The company will tell you what needs to be accomplished.  Not the other way around.

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

Another hack-a-hack attack

So, I blogged about it here, initially. This week I’ve been playing with keyloggers. I had my keyloggers setup on win2k3 and winxp machines and I was accessing them via RDP. I made the mistake of keeping my RDP session nailed up. A few days later, I note tons of entries being displayed within the keylogger GUI. Of course, since the clipboard auto-synchs between the client machine and the RDP server, the keylogger on the virtual machine had been logging the clipboard contents from my home machine. I had been doing tons of code edits, so every cut-and-paste was captured and displayed by the keylogger software. Pretty embarrassing!

Now, what would I find if I setup a machine on a stub network, installed a keyboard logger, and let the hackers come on in? For everyone attaching to my machine, I would be snagging their clipboard. That might be interesting data.

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

Wikiscanner

OK, I’m sure that, as usual, I’m a day late to this party…but, I’m having lots of fun with Wikiscanner . It’s pretty fun to browse around companies that you’ve worked for and seeing what edits they have been doing on Wiki. One of the cool things is to look at a company and see when and where they have been editing their Companies wiki (it’s also funny to see when and where they have been editing their competitions wiki). Companies want to ensure that the Wiki article reflects well on their company. After all, a google query for company X will almost always have the Wiki article as one of the top hits. I’m pretty sure that this can be used to an attacker’s favour. For instance, if you know that the PR folks are monitoring and editing a certain page on the Internet at regular intervals, then you can inject malicious links, code (?), etc. and use it to target the internal user. What if the wiki page for a large software vendor contained a link to where they could download a demo of the software for free? Would the PR person know better than to download the software and see what it was?
!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

Random stuff

I’m hyped! The much-anticipated Maltego version 2.0 is out. I had previously alluded to maltego here. To the 1% of you who haven’t heard of Maltego, it’s a tool for determining relationships between domains, users, email addresses, etc. I can’t think of an Infosec or traditional corporate security group which wouldn’t benefit from this tool. Check out new features here and here.

OK, everyone is probably familiar with the riddle put forth by Samson. e.g. “From the eater came forth food; and from the strong came forth sweet.”. The answer to that riddle was hidden. Who could have guessed the meaning? The strength of the riddle was in the fact that it was based on subjective knowledge that only Samson possessed. Of course, the story ends badly due to philistine subterfuge…but, I digress. I know that the security industry puts forth much effort in solving the riddle of “spam”. Question one, would a person, solving the spam riddle, be best served in keeping the answer to himself? It would seem that any sort of public solution would give the spammer equal opportunity to adjust their attack vector.

I don’t know much about spam. Google (and their gmail app) seem to know a lot about spam :-) . Joe Stewart over at Secureworks knows a lot about spam. He claims that the top botnets can send over 100 billion spams per day. I have a few more ignorant questions:

2) Spam is a nuisance. Can the power of spam be harnessed and used against ones enemies? If spam is the “eater”, how can it be used to ones advantage?

3) The sending of spam seems highly automated. Can the power of spam be turned inward? Like a child scooping cuploads of black ants on a red ant mount, is there a way of causing a “war” between spambots? Would such a war benefit anyone?

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

Marketer on Marketer crime

I have a strong distrust of most marketing and sales individuals. I hate evaluating software and getting a dozen calls or emails from some overzealous, inside-sales weenie. For this reason, I usually use bogus information when I fill out the obligatory form requesting the software that I want to play with. Lately, a lot more companies have been ignoring my queries for eval software. While I’m pleased to not be receiving calls or emails, I would appreciate the actual software. Today, while waiting (not too patiently) for my link to come through, I went through the email looking for some clue as to why I wasn’t selected to play with their software. In the HTML, I note a line like this (obfuscated somewhat and using ‘(’ and ‘)’ instead of angle brackets).

(IMG xsrc=”http://somelargesoftwarecompany.com/mk/auth?_ED=abcdefghijklmnopqrstuv

&_esniff=true” HEIGHT=”1″ WIDTH=”1″)

What’s that? Why is HEIGHT and WIDTH equal to 1? How will I ever see that?

So, the natural next question is: What happens when the web browser (or email client) requests that image. Well, it turns out it’s not a real image. It’s size is 0 bytes and the error code is “204 NoContent”.

I add a single quote to the abcdefghijklmnopqrstuv string. Now, I’m getting an error message like:

“MarketFirst encountered an error while processing your request.”

So, what’s the deal with that little, bitty image? Well, it turns out that I’m not supposed to see that little, bitty image. That little snippet is part of a marketing software (MarketFirst) which tracks when and where the email is opened (ooooh, I am *so* hating marketing guys right now).

To see other companies using the marketfirst software, google:
MarketFirst error inurl:”/mk/”

Even more fun, google:
MarketFirst inurl:”/mk/” ODBC error

Wanna try it yourself. Check out:
http://cdcsoftware-marketing.com/mk/get/ca_m1_online_demo_registration?MP=M1COM_HOMEPAGE

You’ll even get your own email which tracks back to their database…call it marketer on marketer crime.

Now, if I could just get a MarketFirst demo evaluation ;)

!Dmitry

P.S. and here’s how to bypass marketer profiling and get your software downloads. Open the email in plain text (it’s MIME encoded). Convert it to HTML text. Post the HTML on some web site. Now, call your buddy at a Fortune50 company and have him/her click the link. I bet you get the download now.

P.S.S Even more fun….embed the HTML in an email to some user at the same company where you are requesting the download :)

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

Open source pollenation

I’m rushing this post out so that this post can be the 1,000th post :)

I’ve got a project that I’d love to run, but I just don’t have the time. Here’s what I’m thinking of. I want to crawl Fortune 1000 sites and generate fingerprints on their code (ASP, JavaScript, whatever I can read in plain text). I then want to pull out variable names and other unique identifiers from the culled code. With this, I can:

1) see if there has been any cross-pollenation across the sites

2) See if any of these Fortune 1000 web developers have embedded open source code within their app.

3) If (2), I’d like to run the open source code through a static source code analyzer and see if there are any ‘gotchas’.

A few months ago, I did this exercise for a single Fortune 1000 company. I wasn’t really surprised to find a bunch of open source libs in use. In this particular case, I didn’t even need to use google codesearch to find the package that they were using. The company had left all te GNU comment info within the source. It also wasn’t surprising to find that the developers had installed the entire open source project under an ‘include’ directory, even though my spider only found a link to several of the ‘.js’ files. And, lastly, searching bugtraq for this particular product revealed that they were running an older, vulnerable version of their open source software. Mildly interesting. I’d love to automate this. A cool product would:

1) spider a site and download all their code (even HTML can have comment fields or variable names which can be used to track the HTML back to an open source app)

2) Use some algorithm to find uniq identifiers within the code. Store these identifiers.

3) Use some algorithm to compare these identifiers to other sites which have already been spidered and stored.

4) Feed these identifiers to ‘google codesearch’ to see if the code is part of a larger, open source project.

5) If (4) use some algorithm to determine the version level. Query bugtraq for flaws within the observed version.

6) Run the code through some static analyzers looking for coding flaws.

That’s it. Happy 1,000-post birthday Securiteam blogs!

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

Tools, tools, tools.

Maltego GUI is off-the-freaking-chain. Check it out at http://www.paterva.com/web2/maltego/maltego-gui-1.0-download.html

Also, the folks at Security Compass have released some new firefox plugins which should aid in detecting SQL injection and XSS. I’m between gigs, but will give these a good test drive the next time I’m tasked with a web application.

If one doesn’t already exist, I’d like an open source “Reporting Framework”. A metasploit for power reporters. I spend at least 10% of my consulting hours on reporting. I hate reporting. Feed this tool your reports and get back a standard report in the template of your choosing. All cross-referencing with CVE, CVSS, BID, NIST, etc. should be automagic. Relevant references should be automatically inserted (links to patches, standards, etc.). There should even be an option for uploading screen shots which are tagged to an IP/FQDN and service…

Enjoy the Holiday of your choosing,

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

HirBirrySec in the A-T-L

HillBillySec is set for July 25. I won’t be there (or will I?), but I will plan on attending the August meetup. The meetings will be held at this pub. I hope to meet some of you at these meetings.
Peace,

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

The Ballad of the Anonymous Explorer

Long, long ago on a planet, far, far away, a rag-tag group of explorers discovered valuable gems beneath the surface of the planet. The explorers could barely walk without stumbling over a protruding gem. “Stub a toe and find a gem”, they gleefully cried. The explorers were happy and spent much of their free time exploring the planet and enjoying the company of their fellow explorers. This was a time of love and general ‘hippiness’.

As time went on, the gems closer to the surface were exhausted and the explorers had to use their hands to scrabble into the hard soil in search of the gems. Those who had accumulated many gems retired to Alpha-9 (also known as the ‘playboy’ planet as 99.9% of the inhabitants of this planet were beautiful, 19-year-old virgins). Those who were frivolous with their gems (or greedy, some were just plain greedy) had to develop tools to help them get even deeper into the surface. These tools were, of course, of great value and the researchers separated into cabals which shared the same tools. The cabals hated each other but they at least understood that which drove them. This was the time of greed and vendettas.

As time went even further on, the tools which extracted the gems became free to all and many, many more explorers were seen taking the shuttle to this now-desolate planet. These new explorers were without cabal affiliation and were seen as immoral renegades. Some explorers paid a ransom and were taken under the wing of a particular cabal - Most perished. This time was dubbed ‘the great explorer genocide’ or ‘The Civil war of our discontent’ (by the more romantic explorer-historians).

In the end times, a few new cabals decided to pay each explorer for the gems that they discovered. In this way, explorers did not have to any longer associate with a particular cabal. Gems were harvested at an incredible rate and the newer (smarter) cabals grew in power and influence. One of the older cabals, understandably perturbed, created a blog and whine about it daily.

This is the part of the story where a hero steps in, or Peace descends on the valley…or, some crap like that. Not in this story. This story ends with the explorers tearing each other to shreds, killing each other in droves, until a large governing body of Explorers steps in and banishes all the greedy explorers to Alpha-2 (also known as the ‘buggery’ planet…for all the obvious reasons).

The end.

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

Dmitry’s Summer of Code (SoC)

So, the kids are out of school and it’s time to start putting together the list of companies that I’ll be consulting for this summer. With a full time job, I have to be careful to only choose companies that allow testing after business hours, remote work, etc. If the trend continues (from last summer), network pen-tests and straight application pen-tests (blackbox) will be eclipsed by a more ‘hybrid’ approach (application pen-testing with access to the source). Of course, the big ‘hitter’ will be .NET applications. Java will be a remote (remote, remote) second. If there is a 3rd place finisher, I’ve yet to see them (PHP, RoR?). As usual, I’m most interested in finding (or creating) automation that does 80% of the work for me. As I mentioned in a previous post, the tools which do this sort of auditing seem to be catching up with the demand.

Speaking of tools … Ounce Labs is holding a two-day training course for source code auditors. The second day of training includes auditing open source projects and finding 0-dayz. How cool is that?!? OWASP is also investing time (and money) on source code auditing. It was also very nice to see SWAAT (*WITH* source code!!!!!) donated to the OWASP project. The next year will, imo, be critical for source code auditing companies.

Peace,

!Dmitry

dmitry.chan@gmail.com

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

Errata

Just a few quick snippets.

First, as mentioned on vulnerableminds.com, Google has some kick-ass training videos available. I recommend the following search: http://video.google.com/videosearch?q=type%3Agoogle+engEDU+security

Second, I’m still trying to break my Motorola Q. However, the fuzzing is going slow due to a stupid little thing called DHCP! I have to literally watch the fuzzing as my IP changes so often. Add to this the fact that I’m naturally lazy and prone to distraction and you have a recipe for disaster (read: lawsuit). An interesting post on cell phone (in)security can be found here.

Third, I’m into source code scanning (well, actually, I’m into the automation of source code scanning). I’ve mentioned Ounce labs in the past…Well, Dinis Cruz was just cajoled into doing some work for them. I’ve had the pleasure of working with Dinis in the past. This freaking guy is a .NET ninja! I expect Ounce will be kicking butt in this arena very soon.

Last, but certainly not least, if you’re a GPF fan there is a very cool movie that Jared Demott put together. Go see it here

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

I love my Motorola, but I think she’s cheating on me

So, I got a new Motorola Q Smartphone. And, of course, the first thing anyone does when they get a new networked device is scan the sucker. I don’t expect any ports to be open (besides the synching ports), so I go for the UDP ports first. The stack on the Motorola is UDP-scanning friendly and I get:

42/udp open|filtered nameserver
67/udp open|filtered dhcps
68/udp open|filtered dhcpc
135/udp open|filtered msrpc
136/udp open|filtered profile
137/udp open|filtered netbios-ns
138/udp open|filtered netbios-dgm
139/udp open|filtered netbios-ssn
445/udp open|filtered microsoft-ds
520/udp open|filtered route
1034/udp open|filtered activesync-notify
1434/udp open|filtered ms-sql-m
2948/udp open|filtered wap-push

Interesting. Now, I just need to generate some test cases and I can start fuzzing those services. I now scan to see what’s open on the TCP side. I honestly don’t expect anything. I start with ports 1-10000. And….port 8000 is open????? That’s a wierd port to be open, so I telnet in to the port, and I get a 4-byte packet of \x00\x00\x00\x69 followed by a packet with the following strings:

“”"
Motorola Test Command#11000
Motorola MCU Data Logger#11006
Motorola DSP Logger#11007
QC Interface#11008
“”"

Hmmmm, another bit of interesting news. And those strings (minus the pound digits) return no info via Google. Further, what are those #[DIGIT] things. And, what sort of logging is being done? For kicks, I tell nmap to scan ports 11,000-11008 on both TCP and UDP. All the UDP ports are dead…but, port 11008/TCP is open. Nice. I now scan all ports through 65535 and I note that port 13000 is also open. So, to recap. I have 13 UDP ports to fuzz and 3 TCP ports to fuzz. I don’t hold much hope for port 8000. It appears to be a poor man’s rpc or something…telling me where other services might be living. Connect to port 8000 and it just dumps it’s data and immediately FINs. 11008 and 13000 don’t respond to the nudging that I’ve been sending down the pipe thus far. I’ve got a little homemade program that I’m running (a stupid little program) which just generates rand() bytes of rand() composition and sends it down the line and waits 6 seconds for a response. Once I can get a single response, I can just run permutations of the successful-response packet in hopes of a second response, ad infinitum….blackbox testing at it’s worst. So, now I’m out of the loop and just waiting for my program to find something and send me an email. I think I’ve hit refresh on my email client 75 times this morning. I’m too impatient to be a decent fuzzer guy. It’s been running for 11 hours! I should have some data by now! … Somewhere in cyberspace, Johnny Disco is laughing at me.

What would be nice (hint hint) would be a pointer to some protocol specs ;) In case anyone has forgotten, my email address is dmitry.chan@gmail.com

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

Procrastinate another 2 minutes

I read security blogs to stay current. That’s a lie. I read security blogs for the same reason I watch Jerry Springer. I want to see sociopaths and rednecks nutting up over their 20-minutes of fame. So-and-so is leaving this-or-that blog/company/affiliation/whatever and such-and-such is screwing this guy over with rambo litigation….etc. etc. It’s all meaningless, but it’s entertaining and a great way to kill time if you’re all out of good drugs. I think I might be getting jaded, apathetic, or burned out…hmmm, oh well, it doesn’t matter. Here’s some stuff that’ll help you get through another 2 or 3 minutes of your day.

Perhaps the funniest blog entry that I’ve ever read.

In other news…It’s official - Web application scanners are now so bad that I won’t even use them if they’re free. At this point, I am officially divorced from automated application scanners. What I’ve been using, primarily, is Proxies and Firefox browser plugins. Some folks were nice enough to put together a very nice list of Firefox plugins which make the app pen-testers life much easier. Snag it here

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

OWASP Spring of Code

Over the past few years, I haven’t had the time to attend many security conferences. I happened to be in Seattle for the tail end of the OWASP autumn of code (October of 2006). I had the chance to go out to dinner and chat with many of the leaders in web application security. These are some of the sharpest guys in the industry and OWASP is on the cusp of really taking off. Some of their proposed projects for the Spring of Code will greatly aid the security industry. I already use many of their tools and the financing of innovative, open source security tools is *always* a good thing.

I’m very excited to see that a ’source code scanner’ may be one of the funded tools. As I’ve blogged in the past, there are great ‘frameworks’ (CodeScout and SWAAT to name two), but the meat of the work is always the individual checks. I hope to see a great open source .NET source code scanner in the near future.
If you’re young (of heart or otherwise), full of vim and vigour, and can afford the time, check out their Spring of Code initiative at http://www.owasp.org/index.php/OWASP_Spring_Of_Code_2007

!Dmitry

DiggRedditSlashdotTwitThisSphinnStumbleUpondel.icio.usFacebookGoogleTechnoratiE-mail this story to a friend!

Vulnerability Scanner