Saturday, 7 April 2012

Traits of a great developers (by Justin Searls)

Justin Searls The Mythical Team-Month presentation is really spectacular, and inside it there a section on Observable traits of great developers.

Since I'm a developer (currently on the O2 Platform and TeamMentor), I wonder if I have these traits? and since I'm hiring, the question is how to identify them?

  • Empathetic: vigorously defends the interests of users by adopting their perspective
  • Analytical: breaks down large objectives, ideas, and problems into small manageable ones
  • Visionary: identifies a singular idea & fights for its simplicity, yet plans for growth
  • Scientific: methodically attacks problems, reducing paths of inquiry efficiently
  • Creative: dreams up new ideas & approaches, continuously and asynchronously
  • Professional: invests time in long-term effectiveness, maintainablility of their work
  • Entrepreneurial: willfully kills projects that don't success before over-investing on them
  • Hungry: relentlessly improves, thorough learning, practising and sharing 
Well I'm not the one that should be evaluating my our performance (I think I do most of those :)  ) , but if you're a developer, this is really want adds value when creating applications.

Giving TeamMentor 3.1 a test-drive

After many months of hard-core development, here are the first beta release of  TeamMentor 3.1 , which I invite you all you give a test-drive.

You can get the latest version from  https://github.com/TeamMentor/TeamMentor-Documentation  (which is a clone of my main dev repository with a couple extra libraries). These libraries are the ones we use at http://docs.teammentor.net so you have with you the latest version of our documentation (which is not a  lot I know)

You should be able to run it locally using the 'Start teamMentor.bat' file, which will open up the default documentation site at http://127.0.0.1:12115/_Customizations/TM_Documentation/index.htm and you will have the normal TeamMentor GUI at http://127.0.0.1:12115/html_pages/Gui/TeamMentor.html (which what you usually see when you go https://teammentor.net or https://owasp.teammentor.net )

Here is a marketing page that we created (using TeamMentor) that aims to explain the first steps in a simple way: http://docs.teammentor.net/xml/Customer_Landing_Page (checkout the xml to xsl transformation :) ). Here are a couple more variations of that page http://docs.teammentor.net/xml/Customer_Landing_Page_v2 and http://docs.teammentor.net/xml/Test_Landing_Page )


Update [16/Apr/2012]: the links above are not working any more, the latest versions of those are: http://docs.teammentor.net/xml/Eval and http://docs.teammentor.net/xml/Customer 

I'm also working on documenting the more advanced features of TeamMentor here  http://docs.teammentor.net/xsl/Table_of_Contents  (which you will also be able to access this locally here:  http://127.0.0.1:12115/xsl/Table_of_Contents  (btw, in the links above you can replace docs.teammentor.net with 127.0.0.1:12115)

There are two users set-up:
  • admin : !!tmbeta
  • editor  : 123qwe
Let me know if you have any questions or issues.

Btw, I'm really proud of what TeamMentor as become, and there are some pretty powerful features in there (for example checkout the wikitext content creation workflow).

And GIT + GitHub absolutely ROCKS!!!! It is not easy to get your head around it, BUT it is a massive game changer, and I have development workflows today that I never thought possible (check out this really cool graph of the commits and branches of my main dev clone: https://github.com/DinisCruz/TeamMentor-3.0-Release/network).

Great description of why OWASP Summits are special

Abe (on the owasp-leaders list) just posted the text below in response to my Summits must be part of OWASP's DNA reply and it provides one of the best descriptions of what makes Owasp Summit's special and worthwhile doing (please read it).

If you've never been to one of our Summits, this is why they are so important and necessary (Imagine what we could achieve with regular Summits)


Friday, 6 April 2012

Some proposed Visions for next OWASP Summit

Since Summits must be part of OWASP's DNA , and in case some of you are thinking of putting energy in creating the next OWASP Summit, I really think that the 'Summit Proposal' concept I detailed here is a good model.

Summits must be part of OWASP's DNA

The last OWASP Summit 2011 represents the best of what OWASP can do, and nothing we did that year come even close in generating so much work, energy, serendipity and connections (not projects, chapters or conferences)

What you had there was a week of massive collaboration, relationship creation, work , brainstorming and planning (just look at this amazing picture Ofer , Carlos, Vlatko (can you fell the energy!!! :)  ).


I want to vote for a Summit Team+Vision , NOT for a venue

I wrote the text below in 11/Mar/12 and sent it originally to the OWASP Summit 2013 mailing list (you can see some comments to it there) and with the recent Cancelation of the OWASP Summit 2013 announcement, I wanted to write a number of blog posts about OWASP Summits (so here is the first one)

Saturday, 24 March 2012

Running O2 natively on OSX (via mono) - but not 100% stable

ok, you asked, demanded, requested, looked for it ... and finally here it is:

I just got O2 to run on OSx via mono, and here is the proof:

Main GUI



Find an O2 Script



O2 Log Viewer



As you can probably see above I'm controlling which script is executed via the O2_Setup.cs file.

At the moment you can only open the scripts directly since there is some issue with the mono WinForms that crashes when multiple Forms are opened (at least the way O2 does it (with no problems) in Windows))

Ok, so the hard part is now done.

O2 is doing dynamically compilation and most of the issues seem to be on the GUI controls (which we should probably use GTK# when in mono). So for example, the static analysis part should work ok.

If you want to check it out you need to grab the Mono_Branch versions of the main O2 repositories:


And finally, here is first picture of O2 running on another user's box (Dennis Groves), via a GitHub Sync and Mono Develop compilation :)


Running O2 REPL Script environment inside Visual Studio 2010

For the VisualStudio 2010 users, here is how to setup the VisualStudio 2010 AddIn that is included with the latest version of O2 and same examples on how to use it, for example O2's REPL Script environment

In the folder you installed O2, if you go to the O2.Platform.Projects/binaries folder, you should find a file called O2_Platform_VisualStudio_AddIn.AddIn

Friday, 23 March 2012

O2 and REPL

One of the (many) great concepts that Dennis Groves introduced me to was: REPL

He said: "Wow, O2 is just a great REPL engine for C# and Security Analysis"

I was like Rewhaaattt????

It turns out that the O2 Scripting environment is actually something called REPL which stands for: Read - Eval  - Print - Loop (see http://en.wikipedia.org/wiki/REPL for more details).

Tuesday, 20 March 2012

Installer for O2 Platform v4.0 (first release)

UPDATE: This is now not recommended for first time O2 users. Try the direct download you get from the O2 Download page



Hey, try this out: https://github.com/o2platform/O2_Install

That is an installer for the 4.0 version of the O2 Platform (which is based on the .NET 4.0 Framework)

You can get that installler by doing a git clone of that repository or by downloading the zip file: https://github.com/o2platform/O2_Install/zipball/master

You will see an Install_O2.bat script which if all goes acording to plan will:
Note that you DON'T need to have Windows GIT installed on the Box/VM you try this. I added support for the amazing NGIT (https://github.com/mono/ngit) project to O2, so now O2 has native (C#) support for GIT repositories :)


Let me know if it works or if you had any issues with it

Thanks

Thursday, 19 January 2012

Fixing broken Left-Mouse Click on VMWare fusion

After a reboot the right-click of my windows box running on Fusion (OSX) stopped working.

After finding similar reports online I was able to fix it by adding this line to the Image vmx file:

mouse.vusb.enable = "TRUE"

Here is the post that provided me the solution:



And here are a couple more posts talking about this problem:

Wednesday, 14 December 2011

"...O2 in Seattle..." and "...Please Hack TeamMentor (beta)..."

I'm presenting an updated version of O2 at tonigth's OWASP Chapter meeting (https://www.owasp.org/index.php/Seattle).

There are a number of new O2 features that I will cover, but to make it relevant to the audience, I will present O2 as part of a challenge which is 'Please Hack TeamMentor'.

TeamMentor is the WebApp product (currently in Beta) I have been developing for Security Innovation with the help of O2 (you can download TeamMentor Beta and its source code from GitHub).

Showing O2 this way will allow me to:
  • present and discuss the architecture of a real world app and its security implications
  • how me (as a developer) see security and its position on the development/management food-chain (btw on this topic, if you haven't you should also see my 'Making Security Invisible by Becoming the Developer's Best Friends' presentation deliveled at OWASP AppSec Brazil and this amazing video response to it: A developer's rant about security professionals )
  • how O2 allows me to deal with real world problems such as:
    • creating Unit Tests for jQuery/Ajax/WebServices based websites,
    • dealing with automation problems that ALL current browser automation engines have (WatiN, WatiR, Selenium, Cucumber, WebKit, QUnit, etc...) ,  and visualizing the data created using custom GUIs (note that O2 has native support for WatiN, NUnit and QUnit and has access/control to all of .NET's WinForms/WPF)
    • creating cached versions of the site (controlled by a built-inside-O2 web proxy),
    • direcly invoke/compile specific parts/components of the application (this is used to create targeted Unit Tests & fuzzing), 
    • running consolidated (i.e. all available) NUnit tests using NUnit's GUI, command line and O2 scripts
    • dealing with complex webservices
    • view, analyse and test the server side RoleBase Authorization mappings (created using .NET Attributes) which affects the exposed WebServices
  • how the APIs and tools created by O2 purely as 'developer aids' (i.e. not for security) are then massively important, useful and usable on the UnitTesting phase.
For the 'hands-on' part of the crowd, I want to use the following OWASP projects to help me with TeamMentor development and testing (and I really could do with some help here):
  • ESAPI (both .NET and Javascript) - Starting with the Encoding part to deal with XSS (needs to be integrated with .NET's AntiXSS)
  • AppSensor  - to allow TeamMentor to modify its behaviour depending on its current 'attack' level
  • OpenSAMM - create a score card  
  • ZAP Proxy - feed the existing O2 Browser automation scripts via ZAP's proxy and fire up its tests
  • Agnitio (not yet an OWASP)  - map out to its check lists
  • OWASP Testing, Code Review and Developer Guides 
  • ... other OWASP projects?  (if you are involved in an OWASP project that you think would be a good fit, please go for it)
What is interesting about TeamMentor is that it is a complex real world app (with legacy code), containing tons of WebServices and JavaScript/jQuery activity. This makes it very hard to test by today's tools (or even manual process). 

Also very important, is the fact that we are dealing with a team/company that welcomes the 'Security' part of the SDL (which doesn't happen very often :)  )

I'm very happy that SI is ok with this, and my hope is that this will allow us to have a number of interesting conversations/threads (hard to happen in test apps like WebGoat or HacmeBank, or apps where the main developers are not directly engaged in the process)

For the ones that can't come tonight, I will follow up later this week with more detailed instructions.

So here is your official invite: Go and HACK TeamMentor (GitHub) and report your findings as O2, NUnit, Python, Boo, etc. scripts. 

Btw, since this is a Beta version, I'm sure that there are still a number of areas which have juicy security vulnerabilities! Good luck in finding then :) 

Only one condition, I WILL NOT READ any findings reported in PDF format :)

Thursday, 24 November 2011

Please root these devices (project and customer awareness)

Here is a cool opportunity which also raises some interesting questions

I just got asked to see if I could recommend a good AppSec and Reverse Engineer person to spend one month breaking the security of a tablet (and another device) that is coming to a place near you next year.

The brief is quite an interesting one, since it basically says: '...please root this device, show how to install malicious apps on it without root, and/or show how to extract encrypted content...'  (so if you know somebody or are interested please ping me directly)

What is interesting about this gig is the company that it is from. Usually those corporate folks are bit more gentle and politically correct, but this shows that these guys really want to know first the problems (which is a nice evolution in our market). I have to say that 'finally' I have seen more people/customers who want to be secure (vs being compliant or wanting to been seen doing something about it).

It also shows how interconnected out day-to-day devices are becoming, and how big a can of worms (from a security point of view) they can/will be.

Note how web app security is staring to be more and more dependent with the devices that use it, for example, there could be a number of vulnerabilities created by how the client/server exchanges occur (it would be cool to root the device by tricking it into installing something via an reflected exploit on the server, would we call that a 'Reflected Root' vulnerability? :)   ) . 

This also feels a lot like the 'return of the fat client', where the vendors have so much control over the client's device that they extend the attack surface to it (which could lead to a number of security decisions being made on the wrong location).

Wednesday, 23 November 2011

Heads up on O2 WebProxy and WAF Simulator

For the more advanced O2 users out there, I just committed a new set of O2 scripts that implement two very powerful capabilities
  • O2 Web Proxy - native (to O2) web proxy that sits between the IE automation object and the rest of the world (although inside the same O2 .Net process). This was based on the code in http://www.codeproject.com/KB/IP/HTTPSDebuggingProxy.aspx and it givesO2 something that I have been wanting for years now: Programatically access to a Web Proxy. This opens up a LARGE number of testing/fuzzing capabilities and dramatically simplify IE analysis tasts (for example, something that is now simple to get is the full value of the Cookies (and Headers) sent to/from the IE browser (the http-only cookes for example were really hard to get) )
  • O2 WAF Simulator - built on top of the  O2 Web Proxy, I was able to quickly create a WAF simulator which uses the O2 Proxy's callbacks to fix a couple vulnerabilities in the test app I was looking at (great when talking to developers about the vulnerabilities discovered and its possible fixes)
I will shortly put more details about this on the O2 blog

What I like the most about these two new capabilities, is that this was all created/implemented in about 4h of focused-development (and shows how powerful O2's APIs and quick-prototyping development environment have become)

Help on running Cucumber via security tools and .NET

Hi, I need to integrate Cucumber into O2, so I was wondering if I could get some help.

Here is my first set of challenges:
  • I need a couple Cucumber scripts (running on top of Ruby) that do some kind of web actions (ideally on a vuln app like webgoat, http://google-gruyere.appspot.com, hacmebank, etc...) so that we can test the following scenarios:
    • Trigger this tests directly from O2 (including seeing its results). This could be as simple as triggering Cucumber from the command line
    • Run those same tests via a security proxy/tool/scanner so that we can 'teach it' how to app works. This should work for any tool that can act like a proxy, but to start, I would like to run it on
      • OWASP ZAP
      • NetSparker
      • AppScan Standard
      • Burp
  • Use IronPython to run cucumber tests/features directly in .NET/O2 so that I can create a solid two way communication and instrumentation between those scripts and O2 (i.e. O2 to consume them directly, and the scripts being able to access O2 APIs)
Thanks

Friday, 11 November 2011

Comment on reply to post: Mark on 'Models for Better Security Communities'

(comment I made on the OWASP mailing list last week which contains some ideas on where I see OWASP going next)

Stephen, you absolutely shouldn't feel guilty of 'only' contributing to OWASP through your regular bursts of energy (I put 'only' in quotes, since you are one of my favorite OWASP stories, and a talent that I'm very proud to have helped to attract to OWASP) . Your type of contributions is one of the things that have built OWASP and it is one of its most amazing characteristics.

In fact, my view, the job of OWASP 'the organization' is to make sure that when you do focus and want to commit some energy, there is an environment (or ecosystem) that will make that process as productive, enjoyable and efficient as possible.

In that light, OWASP 'the organization' should be much more like an event organizer (think 'music production company') than a big 'we have the vision and know it all' type of org.

Please don't be to hard on Mark since his heart is absolutely on the right place (and let's not really judge Microsoft's ethics since most large companies these days wont get a clean bill of health :)  ). 

One think I learned from playing music is that you have to listen to the audience's comments, and most of the times they say (from your point of view of course) the right thing the wrong way (or not the same way you would articulate it).

Mark wants a more professional and focused approach to OWASP, where there is energy and commitment in the creation of very professional, high-quality, well presented, easy to use/adopt and community-friendly deliveries (tools, books, guides, dev outreach, etc...). 

Which is exactly what I also want.
  • That doesn't mean that we stop supporting the grassroots movements and activities that allowed OWASP to be want is it today (and empower its contributors to 'just get on with it and try to find a solution'). It means instead that we need to put a lot more investment and effort into creating an operational machine that will support it (we have the talent at OWASP, what we don't have is the operational machine (which OWASP's leaders are not really good at, or have time to dedicated to it)).
Part of the problem is that there is still this view at OWASP that we need: 
  • a strong mission, vision, etc...
  • high level commitments/endorsements and 
  • centrally controlled activities
.... as if we had those anything would happen because of it :)

Part of the problem of this type of thinking, is that it creates an environment where Mark (correctly under that thinking) was expecting a level of support and endorsement for his ideas that is just not possible at OWASP. 

The irony is that there are lots of really great leaders inside OWASP that share Mark's wish for a more professional and dev-community-friendly OWASP. Unfortunately we (OWASP) still have not come up with an operational model that allow those groups to aggregate and flourish (I don't think the current Commitees structure are the right structure, but maybe the https://www.owasp.org/index.php/Security_Ecosystem_Project is a better one).

Btw, for me the only vision and mission that OWASP needs is three (or maybe two) words: Web Application Security or maybe just even two: Application Security

So please embrace Mark's ideas and comments, you might not like his style (like many don't like mine), but he is carrying a important message.

Think about this, we are lucky that Mark cared enough about OWASP that he spent his time documenting and talking about his issues and problems. We would be much worse if he had just ignored OWASP. In fact, I wish he blogged more about his ideas for OWASP since there are some great stuff in there :). He also talks to a lot of people about OWASP, specially from people who would like to be involved at OWASP but have not found their sweet spot. We need to hear those voices and find ways to connect to them.

Wednesday, 9 November 2011

Solution for fixing Spring's JPetStore AutoBinding vulnerabilities

Here is an O2 blog post that describes my preferred solution for Fixing one of JPetStore's AutoBinding Vulnerabilities (changing the purchase price)

I have to say that as a developer doing the code fix, it was simply amazing and very powerful to have the complete web workflow of the shopping cart available as an automated O2 script .

This allowed me to quickly ensure that: 
  a) the app still behaved as it should (after the fix)
  b) the vulnerabilities identified where properly fixed

What do you think of the solution?

Tuesday, 8 November 2011

Integrating Security into the User's Gui - In this case Rational AppScan Source in AppScan Standard

Based on an SI engagement I'm currently involved in, which is focused on the integration AppScan Source and Standard findings, here is a pretty cool PoC of what we are doing there:



Monday, 7 November 2011

In ASP.NET, prevent XSS with automatic html encoding

Yesterday when looking for the ASP.NET XSS mappings I found an article that presents a solution that I have been looking for ages: Changing the behaviour of the ASP.NET <%= tag so that it encodes by default.


His technique of hooking the compilation step is absolutely brilliant

The future of secure code? Fixing/Encoding .NET code in real time (in this case Response.Write)

If we really want to help developers to fix they code, we ultimately need to move all the way into their IDEs and actually provide them code-fixes in context!

A while back somebody asked me how to perform actually .NET code changes and patches using O2's .NET Static Analysis engine, and I wrote a little PoC that clearly shows how that can be done (and a preview of what the future looks like).

I just wrote a O2 blog post about it which you can find here:
http://o2platform.wordpress.com/2011/11/07/fixingencoding-net-code-in-real-time-in-this-case-response-write (if you have O2 installed just run the Fixing Response.Write.h2 script)

Here is a 20 sec video that shows this script in action:




I really like this concept and it is sort of similar to what Spring is doing with Roo (http://www.springsource.org/spring-roo) where the developer's code is automatically refactored in order to meet specific objectives

Sunday, 6 November 2011

ASP.NET Anchor tag allows XSS payloads, is this a vulnerability on the .NET Framework?

I just posted a blog entry on an O2 script I wrote a couple days ago that checked if the HREF tag in ASP.NET HtmlAnchor control is vulnerable to XSS: http://o2platform.wordpress.com/2011/11/06/checking-if-nets-htmlanchor-href-property-is-vulnerable-to-xss/

There are a number of really cool techniques on this script:
  • Render the Html Tag control in isolation (which will allow these tests to be run from vanilla UnitTests)
  • Quickly put Html content in a browser and see what it looks like
  • Quickly fire-up an .NET Webserver on a local directory, create a test *.aspx page, and see its contents (rendered from the ASP.NET server)
  • Test some payloads on the *.aspx page and confirm (or not) the exploitability of this control (a good follow-up script to write is to run the FuzzDB on this property and see which ones work)
Since it is safe to assume that the Href from an HtmlAnchor should not have " (and other dangerous chars) in its rendered text (it should be encoded), shouldn't this be classified as a vulnerability in the Asp.Net Framework? Specially since it bypasses the ASP.NET build-in validation.

Is this documented somewhere? I know there is (somewhere) a list of all ASP.NET mappings (so it should be there), but I just looked at the MS pages for the HtmlAnchor tag and there is no mention in there for the security implications of this:

Saturday, 5 November 2011

New O2 main GUI (as 2.0 beta version)

I just pushed a new simpler GUI for O2 which will hopefully make it easier to quickly start using O2 and find useful scripts.

This is what it looks like:

Let me know what you think of it.

Do you like it?

Does it make it easier?

You can read mode details about this new GUI at Details of new O2 main GUI (as 2.0 beta version) and you can download the latest version of O2 from here

Wednesday, 2 November 2011

Using O2 to help an AppScan Source (and Standard) user

Yesterday I had a great session with a potential SI customer where I was tasked to help them make the most out of AppScan Source resources.

The scenario is a very typical one for any SAST client (namely Ounce/AS.Source or Fortify):

Unit Tests to detect problems with site and content integrity

So with the public launch of TeamMentor Beta I now have a nice problem to solve:

"How to write UnitTests (Browser Automation and WS driven) that test for the valid state of the TM test websites (http://50.19.221.68:90 and http://50.19.221.68:91) and ensure that they have not been spectacularly modified, modified or hacked :)"

Here is a list of what I would like to keep an eye on or do:

  • Is the website still up?
  • What about its response time?
  • Do the normal N user activities still work? (open page, view content, login, edit content)
  • Is there any malicious content on the TM websites? (namely on the changes recently changes)
  • Activity logs and detect malicious/weird activity?
  • How to automatically rebuild the server (maybe every day)?

All these should be written as UnitTest and executed on demand (or in a schedule). Sounds like a job for O2 :)

Humm, it looks like I really need to add AppSensor capabilities to TM, since that would allow some of these tests/activities to be detected in real time :)

TeamMentor v3.0 Beta is out of the bag (try it or download it now)

UPDATE (Oct 2012): THIS POST IS OUT-OF-DATE .The latest version of TeamMentor to test is at: Test and Hack TeamMentor server with 3.2 RC5 code and SI library


Last night SI (Security Innovation) released the public beta of the product I have been working for the past 7 months. It is called TeamMentor (TM) and it is a web based tool to create and distribute security knowledge.

There are lots that I want to talk about this project (specially since O2 was used for its development and there is product is a great case study of the power of O2 when used as a developer-helping tool). Also, SI is more than happy for me to talk about the internals of TM, how it evolved and its architecture (which is a rare thing in product companies)

So to kick start this, here are the main links:
Here are the login details (note that the editor role change change all content, so try to be gentle with the version online :)  )
  • Administrator - admin/changeme 
  • Reader - Reader/changeme 
  • Editor - Editor/changeme 
  • Developer - Developer/changeme
If you download the TM code and want to run it locally, once you unzip it:
  • Launch the server but runing either the "Start NET35.bat" file or the "Start  NET4.bat" file ( use the one that works for you). 
    •  Give it a couple of seconds to load. An icon in the system tray should appear, indicating that the "Cassandra" server is running.
    • Please, note that the "Cassandra" server does not bind to external interfaces by default, so it will only be available on the local machine when started from the bundled scripts. 
  • Open the site. A web browser should open automatically on the main page. 
  • Login to the application with one of the pre-defined user accounts (listed above)
If you find bugs or security issues, please add them here: https://github.com/SecurityInnovation/TeamMentor-3.0-beta/issues (this is beta so I expect you guys to find good stuff in there :) )

Let me know what you think of TM :)