Main

December 03, 2006

User Privilege Gain using Flash Active X Flaw ??!

Listen to this article Listen to this article :: Talkr

Most of you would have noticed that my site was down for almost two weeks without any notice. When I checked with my service provider he goes "We have received complaints from our data center that your site is causing some serious security violation" and when I dug into this further he says that a Flash file was being used to compromise the system. Holy crap!! What the hell are you saying? I knew that there was a Active X flaw in Flash Player earlier which gives the ability to do a buffer overflow hack (whatever that means) but I have only read about such things in Wired magazine and have never even done anything close to that.

After hours (or should I say days) of investigation I was told that the file in question was the example SWF which I posted for this entry in my blog. The file is a very simple example which uses the ContextMenu API to open a link in a new window and how could that possibly cause a security violation and that too of this intense a nature.

This was the message which I got from my service provider:

------------------------------------------------------------------------------------------------------
From: xxxxxx
Sent: 09 November 2006 18:11
To: xxxxxxxxxxx
Subject: SNORT ALERT: 1 in Application:snort:ALERT
--------------------------------------------------------------------------------

EVENT #
353
EVENT LOG
Application
EVENT TYPE
Information
SOURCE
snort
EVENT ID
1
COMPUTERNAME
xxxxx
TIME
11/9/2006 6:11:16 PM
MESSAGE
[1:7978:2] WEB-CLIENT ShockwaveFlash.ShockwaveFlash ActiveX CLSID access [Classification: Attempted User Privilege Gain] [Priority: 1]: {TCP} xx.xx.xxx.xxx:xx -> xxx.xxx.x.xx:xxxx


Does anyone out there have any clue of what had gone wrong? This is the first time in my life I am hearing of anything like this. Believe me I was almost feeling like I am in a deep trouble for nothing. Finally I removed three SWF’s from my site which I suspected to be the troublemakers and got my site to life again. Will someone from Adobe care to look into this?

May 04, 2006

Hacking your way around FlashPaper API's - A almost complete Object Dump of the various Flash Paper API's

Listen to this article Listen to this article :: Talkr

FlashPaper is do damn good but the only problem is that you cant really get the full potential until you hack around a bit. In my case I was creating a online catalog which has multiple pages and a page flip effect and there are around
1000's of these pdf documents which has to be converted into online and have the flip effect.

Obviously the easiest approach would be to batch convert these PDF files into FlashPaper SWF's and then loading them into a Flip Book Player. But the only problem is that you really cant have each of the page on a flip book contain all the FlashPaper controls. I started hacking around it and I am almost done disbaling everything and customizing the look to what I want it to look like.

Here is a Object Dump of all the FlashPaper SWF contains and luckily most of them can be tweeked. Check this out, it has 100's of properties which you can hack around.

This page contains the Object Dump which lists (mostly) all the API's available and their values and types : FlashPaper API - Object Dump.html

Out of all these the most used ones would be:

1) To make the complete toolbar invisible. With this you should be able to get rid of the Flash Paper logo as well

.toolbar_mc._visible = false;

2) If you are working on a single page SWF and you dont want to show the disable scrollbar which lies there useless then you can use the ones below.

_root.theDocMC.document_mc.y_sb._alpha = 0;
_root.theDocMC.document_mc.x_sb._alpha = 0;

Note:

The page flip effects seems to be damn slow when using SWF's instead of JPG's or MovieClips. Does anybody out there know of a good opensource Flip Book which is fast, sleek, fancy and still works great with external SWF's?

April 14, 2006

I am a NERD God ?!!

Listen to this article Listen to this article :: Talkr

This thing is spreading like fire. Thought I will give it a try too and here is the result:

I am nerdier than 95% of all people. Are you nerdier? Click here to find out!

Math – MathML & Flash – What I have been doing lately

Listen to this article Listen to this article :: Talkr

It has been more than a couple of months since I last posted to my blog and the reason was that I has been involved fulltime in architecturing and developing a Math based RIA in Flash for my employer. The key features included:

• Creating an authoring component and player component which can be used to create mathematical equations using Flash and play them back using the player (an SWF file)
• Being able to render back these mathematical equations as images in the server
• Generating MathML inside Flash and creating corresponding MathML’s on the server
• Maintaining compliance with MathML 2.0 standards
• Creating a customizable panel where a user can select and create his own Math items
• And a lot more…this whole page wouldn’t fit to spell out all the features

Believe me it was not an easy job to create one, we slogged day in and day out. Hit almost all the bugs in Flash, found workarounds and nothing but equations were running through my mind all the time.

Due to copyright issues and IP’s I will not be able to really give you a link to this application but here is a sample image which the application generates. This sample depicts only a very small subset of the supported elements and the application supports more than 400 elements including foreign characters.

The front-end and the business logic were built in Flash and the backend was Java with openamf. Because the image which was send to the server was huge (pixel data) I had developed some compression algorithm which would compress the pixel dump before it send to the server and server side script would decode it when it receives it.

One of the key challenges we faced was with sending the data to the Director wrapper in the standalone version. We have to use LCO’s to send data from Flash to Director and LCO’s had a size limit so we literally had to split the data into parts – send it to Director and then reassemble the whole content inside Director. It was a pain on the ***.

I learnt a lot, a real lot when creating this application. I am really happy to have created this application, which as far as my knowledge goes has never been created in this form elsewhere. A very close, but very light version of a similar implementation is here but this is way too simple than the one I am speaking about.

A very close application which resembles the one I am speaking about is MathType by Design Science but this is not developed in Flash.
Apart from all the technical learning I got from this project I had a great personal learning which I would carry for my life. I always used to flop Mathematics in school and that was my most hated subject of all but now most of the applications I am working on are Mathematical based applications and though I am able to successfully architecture, develop and deliver them I don’t have a clue of what they all mean and now I am realizing how important it was to learn Maths. The proof of this is the sample image above – I am sure that it doesn’t make any sense mathematically ;)

Take good care of yourself till me meet in my next post.

February 09, 2006

Detecting Print Screen in Flash

Listen to this article Listen to this article :: Talkr

This should be probably the nth time somebody has asked me about this. Thought I will just blog this so someone else who is looking for the same solution would find this useful.

For capturing Print Screen, the traditional Key.addListener(myListener); method wouldn't work and the alternative which I use on my projects is this one and it works:

this.onEnterFrame = function (){
if (Key.isDown(44)) {
trace("Dont try to capture me!");
}
}

Usually this method is used to prevent the user from capturing the screen but definelty this is not a 100% fool prrof method and by the time Flash detects the key press and does something - Windows would have already captured the screen. But yes if you want to warn your user not to take a screen shot you can use this.

If someone out there know of a better solution just post a comment and let the world know of it.

November 23, 2005

Usable Flash Menus

Listen to this article Listen to this article :: Talkr

I am not going to give you gyans about Usability but just a simple way to make your Flash Navigation System more usable. How many times have you come across a site which has a flash menu system and desperately wanted to right click on it and choose "Open in New Window" - one hundred times may be? Yes, this is not a very big usablilty funda but adds value to your site especially if you rely on a flash based menu system for naviagtion. How long would it take one to create such an option for the flash menu, just a few minutes and a few lines of code.

Here is the code :

var cm:ContextMenu = new ContextMenu();

cm.hideBuiltInItems();

cm.customItems.push(new ContextMenuItem("Open in a new window", itemHandler));



function itemHandler(obj, item) {

    getURL(obj.__url, "_blank");

}

this.menu = cm;

this.__url = "http://www.macromedia.com";

Just add this to the timeline of your menu item movieclip.

Sample (Right click on the button):





October 05, 2005

Post-It type Guestbook using FileReference API

Listen to this article Listen to this article :: Talkr

I have created a prototype of a Post-It type guestbook application using new Flash 8 features and FileReference API to include user photos along with comments.

Check out the application here.

Still have to tune up the application a bit. Will post the source files once it's done.

The design is inspired by the Post-It experiment by Oscar Trelles.