Sunday, 14 October 2012

Added 215 Tango Library Icons to FluentsSharp.BCL and 'PoC - View FluentSharp_BCL Embeded Icons.h2'

I just added to FluentSharp.BCL 229 icons from http://tango.freedesktop.org/Tango_Icon_Library which should help the O2 Scripts/Tools to look more professional and slick.

The icons where added to the resources (*.rex) file FormImages and can be consumed easily via FluentSharp.BCL's extensions methods (see script below for an example of using it on a ToolStrip control)

To  help to find an icon to use, I wrote a quick icon viewer which looks like this:


And here is the source code as a Gist:

Friday, 12 October 2012

First video of Eclipse's real-time static analysis plugin for Java security

Diarmaid McManus has recently published a video of his Eclipse's real-time static analysis plugin for Java security

Here is the video of it in action (showing an error on a StackTrace information disclosure issue)

'Using the HTML5 Fullscreen API for Phishing Attacks', OWASP MIA and 'We need SAST technology for browsing the web safely'

Really nice article from Feross Aboukhadijeh on the Phishing potential of HTML5 FullScreen features:

You can read it at Using the HTML5 Fullscreen API for Phishing Attacks

Note that on Chrome in OSx it will show this alert


... if you're not in Full Screen already. But in a lot of cases that will be easy to dismiss (specially with users used to click that 'Allow' button). See note below on using SAST technology to deal with this.

What is interesting about this story is that is also shows how developers DO care about security. There is a thread about it on Hackers News and on Reddit and I found this article via the CodeProject's Daily New email:



OWASP MIA

But where's OWASP on this thread?

  • both Hackers News and on Reddit have no mention for OWASP (just search the page)
  • Feross article also has no mention of OWASP
  • A quick search for Feross' name and OWASP didn't show anything 
  • Nothing on OWASP's website (which means that he has not presented at an OWASP conference or chapter)

So is Feross involved at all with OWASP? I can't find it.

As one of the guys who created one of the best ClickJacking examples HOW TO: Spy on the Webcams of Your Website Visitors (and only 22 years old), he is clearly part of the new generation of AppSec Security experts.

But if OWASP is not able to attract him and create environments / ecosystems for Feross (and other new stars), that means that we (OWASP) are starting to be irrelevant for the new Generation :(

And that is a fundamental problem with OWASP. We should be measuring OWASP's success by its community and relevance. But it is much harder  to measure 'What could had happened' than 'what is happening'. This (amongst others) is why I proposed a new model for OWASP so that OWASP can reinvent itself and find ways to add value to Feross (and its community).


We need SAST technology for browsing the web safely

So how to do solve this? Unless we start to have SAST-like Technology on browsers (which allow us to write context-sensitive rules that know the difference between YouTube and Feross' website) I don't think we will find a good solution (it's just patches and hacks)

BrowServer - node.js HTTP server, in your browser (NextGen XSS PoCs and Exploits?)

http://browserver.org/ is a pretty simple but spectacular tool. It makes your browser a webserver by reverse proxy(ing) web requests to your (private) IP/DNS location via their server.

The Node.js code is at GitHub jed/browserver-client and jed/browserver-node and this could really make some powerful XSS PoCs (checkout their Location detection).

It also could help with remote support and O2 Script debugging :)


Small example of O2 adding value to my life (adding numbers)

For me, one the best parts of O2 is that it does actually help me on the day to day 'stuff' that happens everyday.

And this is even when I don't make a conscious effort to use O2. For example, just now I need to sum 15 numbers and before I reached to a calculator (or spreadsheet), I just went to the Online C# REPL and wrote a script :)

Thursday, 11 October 2012

Should I start an O2 based 'A-Tool-a-Day' blog?


As I was posting the Util - View CheatSheets at devcheatsheet.com v1.0.exe entry I was wondering if I shouldn't start an A-Tool-a-Day release cycle (just like http://www.jonathanmann.net/ or  http://a-song-a-day.com/ did for music). 

There are plenty of really powerful Scripts/Tools in the O2 Platform that could do with more exposure, and maybe releasing them one a day would help.

Also, with the latest version of O2, it takes seconds to create a new stand-alone exe, so it shouldn't take long to create the entries :)

I also have tons of really powerful PoCs and PowerTools created for previous version of O2 that I really don't want to lose (publishing them this way would force me to package them)

What do you think?

Util - View CheatSheets at devcheatsheet.com v1.0.exe

Here is a little mini-tool (that I used today) which provides a nice GUI for viewing the CheatSheets at devcheatsheet.com.

The stand-alone exe is only 1Mb and you can download it from: Util - View CheatSheets at devcheatsheet.com v1.0.exe

O2 Script - Create TM Library from CheckMarx CWE data

Bellow is a pretty cool O2 script that created an TeamMentor Library from the raw Xml files I extracted from the CheckMarx database:

This is what the created Library looks like:



TeamMentor Vulnerability Disclosures: CSRF , ClickJacking and Get Password Hash from Browser Memory

Following the Test and Hack TeamMentor server with 3.2 RC5 code and SI library post, Dinesh Shetty took the challenge and sent me 3 nice documents with a number of security issues on the 3.2 version of TeamMentor (note that we are also Creating an TeamMentor Security Bounty Program)

Here are some comments on the 3 issues, and below you can see the PDFs he submitted:

Wednesday, 10 October 2012

Util - Try BootStrap CSS v1.0.exe

Here is a nice O2 Script that allows the easy testing of BooStrap CSS (or any other HTML transformation)

The O2 Scripts and supporting files are here and you can download the stand-alone exe from: Util - Try BootStrap CSS v1.0.exe

This what the GUI looks like when rendering some of the provided Code Snippets:





Next features to add to C# Web REPL, can you help?

If you are looking for coding ideas around the O2 Platform, the recently released C# Web REPL is a great place to start (see post Web-based C# REPL (key milestone in O2's development )

The code is at GitHub (https://github.com/o2platform/Web_CSharp_REPL) and it can be opened in VisualStudio (or pushed to AppHarbor or Azure)

Here are some ideas for the the next batch of features that we should add to this web tool:

  • Add a 'Save and share' like the https://compilify.net and http://jsfiddle.net do 
    • maybe with the option to email the user
    • maybe implemented as GISTs (small git repositories with only a couple scripts)
  • Add a 'Clear Script' button
  • Create a view for the execution logs (currently shown as a XML dump: http://csharp-repl.apphb.com/CSharp_REPL.asmx/CurrentLogFile_Contents )
    • maybe with a real-time view of scripts executed (using AJAX to refresh)
  • Add Code Samples that can be directly invoked (maybe from a treeview or dropdown box)
    • This is probably the single most important feature to add since it would really allow for the easy consumption and use of this GUI
  • Auto compile checks, where (similar to what happens with the Windows or VisualStudio version of this REPL environment) the user gets 'semi-real-time' feedback on any errors
  • Show compilation errors in a separate window
  • Security: (since the code is running with Full Trust and has access to O2's APIs this web interface could be abused quite easily)
    • Add OAuth (maybe to tie a user execution to a Google account?)
    • Scan Scripts with Cat.NET before executing (and maybe require special privs to execute them)
      • actually, if we can detect the 'vuln/exploit code' before its execution, we could even change the GUI to go red  (like we here) 
      • we could also show security guidance to the user (from OWASP.org or TeamMentor.net)
    • Add AppSensor like capabilities (to detect abuse and change the app behaviour accordingly)
    • Option to run scripts in Partial Trust

  • Add CodeComplete (which will make a massive difference when using the O2's FluentSharp APIs)
  • Consume it from an windows-based O2 C# REPL environment (this would allow for example for the short-term use of Auto-Complete and better AST error reporting provided by Roslyn)
  • ...something you you really want and it is not on this list... (i.e. you have an itch to scratch)

So get a GitHub account, fork the https://github.com/o2platform/Web_CSharp_REPL repository, add some features and send me a Pull Request

A must watch TED talk about GIT and democracy

Nudged by Dennis Groves, here is a really good presentation on the power of GIT outside programming:


Couple interesting notes:


Note to vendors, engage AppSec community (and if you write your app in .NET there is nowhere to hide)

It always amazes me how much 'precious' vendors are of their 'amazing technologic' advances.

They are always so afraid of us 'the security researchers' that we will just 'use their product', and reverse engineer it, and make a lot of money with it, and blah, blah, blah (see post Providing licenses to security consultants )

If you are a vendor and don't share or push-as-mad your tool/service/technology with Application Security professionals (like me), here are a couple comments for you:

  • you are stupid - sorry I could probably say this in a more politically correct way, but its early and I'm on the first coffee
  • you are missing out your most important community - yes we
    • are hard to deal with, 
    • have strong opinions, 
    • already have a strong tool set, 
    • think that you don't have a clue (not all of you :)  ),
    • are hard convince
    • usually know more about what you are trying to do than you
    • are a factor factor of the success of your product 
  • I'm the stupid one, if I use your evaluation version in a commercial (paid) engagement - that would be breaking the license/law, it would be morally wrong, and (when found out) would put me (the professional) in a very bad light
  • if your product does work 'the way you think it does', don't worry, companies will pay it - since the ROI is obvious 
  • and if your product does work well (see above), don't you think that I would be the first one to push it - after all my skills are still needed to make sense of it all and to put it into context for the client (see next point)
  • if you see us (AppSec professionals) as competitors, you are also stupid - since the whole "hey don't buy/hire their services, just buy our tool/service and you will fine" logic is so broken that only short-term strategists can make sense of it. See this post Security Tool's vendor "No need for Doctors" for a analogy of this topic
  • on the topic of reverse engineering your tool:  
    • its not because we can that we will
    • yes most of your DRM and License protections suck, but breaking them would actually be a complement to you (see piracy links below), since it would mean that we would care enough to break it
    • technically breaking your DRM and License is illegal and we would be stupid to do it
    • and btw, if you write apps in .NET, there is nowhere to hide
      • if go down the obfuscation route, you will create more problems for you (and QA team) and will also send a clear sign that you "dont want to dance"
  • on the topic of adding / fixing features to Windows .NET apps
    • In case you haven't noticed but due to .NET reflection there is nothing that can't be invoked (i.e. no such thing as private methods)
    • Add to that the really good support for Windows Gui automation and there nothing that can't really be scripted and automated
    • Now, in the O2 Platform, I happen to make this process really, really easy (for one of the ways look at this Video: Injecting C# DLLs into Managed (C#) and Unmanaged (C++) processes) and am now for example able to improve and add features to existing 'closed products' (look for example what I'm doing with Cat.NET: Reaching out to Microsoft regarding CAT.NET )
    • This means that I can now add new features to your product, I can fix things, I can make it do what I (and your customer) really wants it to do.
    • And is that a BAD thing?
      • You don't want me to help you understand how to best use your product?
      • You don't want me to fix your product?
      • You don't want me to give you more reasons for  your customers to buy your product?
      • You don't want me to give my customers security automations that uses your product? (where they need to buy a license/service to use it in the future)
  • on the topic of asking Application Security professionals to sign NDAs before using/trying your tools/services
    • I have strong two words to say to that (FY), but I had had my coffee by now, so I will be more gentle:
      • No and No :)
    • This is a topic long enough for another post, but this is another idea that is so wrong from a 'Business point of view' that I don't get it. Also from a technical point of view, it is very hard to copy and steal other ideas. We are all standing in the shoulders of giants, and all our work is inspired by others.
      • (memory lane: on the Ounce days I wrote a really nice/long internal email on the topic of 'Why NDAs are stupid', but since I wasn't blogging like this back then, I've lost it!!. I hate 'locked up and non-hyperlinked data', it's so inefficient to have to write/thing about the same thing over and over)
  • And if you make it this far (and spent some TIME reading this), always remember that the most important asset that the AppSec professionals have (that you want to grab) is TIME
    • You should measure your outreach effectiveness and success by how much TIME is spent on your product/service (and how many public posts are made about it)
    • Anything that you can do to make it easier and faster to use your product/service will make a massive difference
    • Since TIME is very limited and so is attention span, don't be afraid to go back and ask 'Hey can I do anything to help? Have you tried it? What do you think of it?'
    • And since TIME is a finite amount, remember that any TIME not spent on your product/service is probably TIME spent on your competitors :)
Finally, since most vendors when they hear these arguments only have a word in their head: 'Piracy!!!!' 

I leave you with a thought from Tim O'Reilly in 2002 "Obscurity is a far greater threat to authors and creative artists than piracy." ,  and these guys agree with Tim:
Sorry about this rant, I just have had this conversation far too many times :)


Tuesday, 9 October 2012

Web-based C# REPL (key milestone in O2's development)

Here is a pretty cool development for O2 Platform and FluentSharp. You can now run the O2's C# REPL environment directly from a browser!

Just go to http://csharp-repl.apphb.com/ and try it :)

This is what it looks like:


This is pure C# so anything that is valid in C# (variables, for-each-loops, if-else, lambdas,etc...)  will work.

Note that when coding the REPL script you are supposed to return a value, and if your code doesn't compile you will get an error like this:


What is really powerful is that you can download external dependencies and consume them directly.

In the code sample below we are fetching the MarkdownSharp.dll assembly, setting a MarkdownSharp namespace and creating an instance of the Markdown class:


IMPORTANT: all scripts are logged and publicly available here: http://csharp-repl.apphb.com/CSharp_REPL.asmx/CurrentLogFile_Contents  (please try not to abuse AppHarbor hosting services)

The source code of this is at GitHub (https://github.com/o2platform/Web_CSharp_REPL) with automatic deployment to AppHarbour on Git Push.  I tried to keep it as simple as possible and (as I mention on the README) I would like to credit the http://www.jshint.com guys who's website I based the theme on.

What do you think? What should be the next steps?

Trying UserEcho on O2 Platform

Just found UserEcho.com and I really liked their interface to ask questions (driven by a search first).

So to see how it works in action, I just created an Free account for the O2 Platform: http://o2plaform.userecho.com/

Here is what it looks like:



It looks like you can add ideas, questions, bugs and praises.

So if you have one of these related to the O2 Platform, please post them at http://o2plaform.userecho.com/

Great animation that shows how BootStrapToday works

Checkout this video that I found on the the http://bootstraptoday.com/ homepage:

Using 99Designs for Design services

Just saw http://99designs.co.uk/ in action on the logo commissioned by Mark for the Seconauts community : http://99designs.co.uk/logo-design/contests/create-next-logo-seconauts-152818

Look like a pretty sweet and slick service. We should use it more at OWASP

I have been using elance.com for a while which is also pretty powerful

Monday, 8 October 2012

Creating an TeamMentor Security Bounty Program

Following the unofficial success of the Test and Hack TeamMentor server with 3.2 RC5 code and SI library request (with already a couple vulnerabilities disclosed), I'm very happy to say that SI is going to make it official.

We will be creating an TeamMentor Security Bounty Program for this week, which is when we are doing a Security Push for TeamMentor (before it is released officially next week).

There still needs to be a bit of thinking on this, with the rules-of-engagement defined, but here is the thinking so far:

The Seeker product sounds good, how can I get my hands on it?

Here is very positive review from SC Magazine on Seeker : First Look: Seeking application security

Seeker is an interesting WebAppSec product since it mixes SAST and DAST and RunTime analysis.  It is also lead by Ofer Maor which is OWASP Leader and really smart guy.

I really would like to take it for a test drive, but am still waiting for Ofer to send me an evaluation version :)

And if it works, it would be something that I wouldn't mind running regularly on TeamMentor, but at 30k for a license, I don't think that that will happen (they need a better price for SMEs)

My other interrest in Seeker is to add an O2 Platform API for it and to integrate it with TeamMentor's Security Knowledge-Base, just like we are doing for CheckMarx (see videos at PoC of integrating TeamMentor with Checkmarx )

Idea: Sync Blogger Posts with a GitHub repository

From the end of the So if my blog account is compromised can I sue Google? post comes an interesting WebService idea:

Sync Blogger posts with a GitHub repository 

So if my blog account is compromised can I sue Google?

After another occasion where I connect to this blog via HTTP (in a Starbucks) I'm left wondering how long will it be until my account is compromised? And what could I do when that happens?

As you can see in Blogger in HTTP only? What happened to HTTPS? this is not news for me.

Although there seems to be an recent improvement (i.e. HTTPS actually works if directly used), the question is why doesn't Google do it?

Why doesn't Google provides an 100% SSL experience?

I'm speculating, but it has to be a mix of:

  • Not enough compromises/attacks (if an attack happened but there is no public record of it, did it really happened?)
  • Not enough public and high-profile compromises/attacks (more realistic)
  • The Hardware costs of making that change (which is weird, since I would assume that Google is able to provide iSSL in at a cost-effective way)
  • The Software/Application costs of making that change (this sounds more realistic since some apps are hard to move to SSL due to its dependencies and side effects)
  • Not being sued on this topic (because if they were, the maths/business-case/ROI would be simple)  
The last point is an interesting one, since:
  • There is clearly a case that Google is not taking due care with their customer's data 
  • Google has publicly stated the importance of HTTPs (see HTTPS security for web applications )
  • In 2012 there is no 'real' or 'defensible' technical excuse for not using SSL all the time
I guess with the teams of clever lawyers and developers at Google, their conclusion was that (as Oct 2012) there is a 'real' or 'defensible' business excuse for them to act this way.

Another fine example of why Security is so hard to do from a business point of view. 

Here it is a nice service, used by millions of customers with no (reported/public) problems, and then, here come the Security TAX forcing code and infrastructure changes!!! (with no visible customer benefit)

Tip: Just in case, I just used a great little feature from the Blogger admin panel which is the 'Export Blog' (this gives you an xml file with your entire blog contents. Now if only I could get Blogger to sync it with a GitHub repository

Idea: dynamically fetching content from GitHub to show as website

I was thinking of a way to create a very simple way to package and consume an TeamMentor website, and NuGet come to mind (note that you can already consume TM's engine from NuGet via the TeamMentor.CoreLib package, which is the compilation of this VS project)

The problem is that on the WebSite layer (see code here) there are lots of files in there (namely the Html, Image, CSS and JS files) which we need to use.

Now we could create a NuGet package with these files, but that would still mean that the VS project would still have ALL of those files in there.

What I really want is to have access to all those files without actually seeing them (i.e only the custom changes should exist in the VS project file).

At the moment I can see two (kinda crazy ways) to do this:

  1. Package all files into a dll's resources section (like I did with O2's dll dependencies) - using an extra HttpHandler that  would try to match an HttpRequest to an file available (and serve it)
  2. Use the HttpHandler described above to get the files directly from GitHub  (i.e. http request to GitGub to the the files)
The 2nd option would be really cool, but quite a crazy one :)

You basically would have an AppHarbor hosted website whose content where being dynamically fetched (server-side) from GitHub :)

Now if only Asp.NET supported the packing of websites as a one file package

Exploiting Microsoft MVC vulnerabilities using OWASP O2 Platform

Michael Hidalgo wrote this great article on using O2 to exploit an overposting (i.e. auto-binding) vuln in an ASP.NET MVC demo app: Exploiting Microsoft MVC vulnerabilities using OWASP O2 Platform

As you can notice that was posted on CodeProject.com which has always been a good source of technical content for me (although not a site I would use everyday). That said, I'm starting to like the new version of http://codeproject.com and this could be a great place to post O2-related technical articles.

On the Asp.NET MVC topic, if you are interested, here are a couple related posts:

The next step is to see how we can write SAST rules (maybe executed by Cat.NET) to find these issues on the source code.

I really don't have hard numbers, but I will bet that the number of Asp.NET apps vulnerable is really high (just like what happens with the Spring Framework MVC)



Still at the being ignored stage

A good friend included on a recent email, this comment:


"...I thought you might like this top quote. Reminds me of you !

http://thinkexist.com/quotation/here-s-to-the-crazy-ones-the-misfits-the-rebels/761372.html .."

That link is for one of the best Steve Jobs (or Apple) quotes, which is of course a great source of inpiration for me:


“Here's to the crazy ones, the misfits, the rebels, the troublemakers, the round pegs in the square holes... the ones who see things differently -- they're not fond of rules... You can quote them, disagree with them, glorify or vilify them, but the only thing you can't do is ignore them because they change things... they push the human race forward, and while some may see them as the crazy ones, we see genius, because the ones who are crazy enough to think that they can change the world, are the ones who do.”

You can see that text on its original form in the 1997 Apple Add (btw, this is the version with Steve Jobs doing the voiceover, which is much better than the original)

Now, having just had two StackExchange questions removed by its moderators (see here and here) and based on the still limited reaction that currently exists to the O2 Platform, I can say (from experience) that what actually happens for a while is that you are indeed IGNORED :)

I think reality is more like:  "...First they ignore you, then they laugh at you, then they fight you, then you win ...".(Wikipedia is not sure if that is Mahatma Gandhi quote)

To be honest, I don't really care about the win bit, I want to change the way software is developed and make it more secure, so there is not really a winner or looser.

Also, (so far) I have not been of receiving end of laughs. What I get a log is: '... that looks cool/powerful, but I have no idea how to use or apply it to my problelm...' :)

So maybe a better sequence of events is:

"...First they ignore you, 
        ... then they are puzzled at you, 
            .... then they resist change, 
                   ....then then change  "

:)

Sunday, 7 October 2012

Another cool learn to code site (with REPL)

Here is another cool REPL Javascript Learn-to-Code site http://www.crunchzilla.com/code-monster

It's targeted for Kids, but I would say it's for all ages groups that want to learn (or improve) coding.

My view is that 'Coding is the new Maths' and is an key still to have.

I really like Code Academy and I can't recommend it high enough!

(btw, the reason why this post doesn't have screenshots is explained here: Idea for improving blog creation productivity (post by screenshot) )