22nd October, 2006

NTFS Partition Restore /--evilbitz   

Here is how I burned away 4 precious hours from my life:

Yesterday I went and bought a new Western Digital 250GB HD because I wanted to install another two operating systems, I planned to install Windows Vista and Fedora Core 5 Linux.

I created some partitons for the OSs and first installed FC5, I’d also created a 180GB for misc files. After I installed Fedora, I filled the “Misc” partition with some files from my older HDs. then I noticed that I accidently created the 180GB partition as a primary one while the Vista partition was logical.

As you probably know, a maximum of 4 primary partitions could be created on the same HD, and operating systems could only be installed on primary partitions. You can however create one of those partitions to be an extended one and create more logical partitions inside of it.

Well, I turned to partition magic 8, a widely known partitioning tool for the windows platform, and done the following:

  1. Convert the Vista Partition to primary
  2. Convert the “Misc” partition to logical

I guess that those two simple tasks were hard for PM8 because after applying them, my computer didn’t show the “misc” partition at all!!!

I booted from my fresh fedora linux and installed the ntfs kernel module (arghhh Linux…), after this useless waist of time I didn’t have success in mounting the “misc” partition either. obviously those files where important to me so I tried to fix the partition.

After searching for and installing several partition restoring tools I encountered TestDisk (who gave it it’s name anyway?), a software that supposedly fixes partition tables, It’s being done by analyzing the HD and writing over the partition table. So I took the risk (the only thing I could lost is the new fedora installation). After booting again from windows, I was relieved to see that the partition appeared in “My Computer” and that the files are there!

The files are there alright but about 20% of them have additional random bytes added to them at the begining! but I still look on the bright side :-)



Posted in random | 1 Comment

22nd October, 2006

The 3 Quotations I Most Like /--evilbitz   

Here are the 3 quotations I most like:

  1. In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.
  2. There is only one difference between a madman and me. I am not mad.
  3. You must die! I alone am best!!

What you can conclude about me from these three is your own business, but if you want, you can add a comment :-)



Posted in random | Be The First To Comment!

22nd October, 2006

A MP3 Steganographic File System Approach /--evilbitz   

Inspired by Paranoia, a book by Joseph Finder, I decided to write this post. Paranoia really had influenced my thinking as I was reading about Adam Cassidy, a young man who was hired to do some dirty industrial espionage work for another firm. The tools that are needed for this kind of work are various, and I’m not going to discuss about these tools but rather about an imminent need for this kind of job, and that is: the place to collect your prize.

Well, you don’t have to be an industrial spy to see the advantages in a steganographic file system, even the most naive and simple PC user can find a Steganographic file system useful, as it can protect him from different kind of threats. Information Hiding can protect users against hacker attacks, and information theft in general, imagine that your password list or your bank account info is hidden in an encrypted way inside your mp3 files (this is what I’m going to talk about).

It looks naive and unsuspicious, who would imagine that your sensitive information is stored over some ordinary looking files. If we will go back to our industrial spy example – let’s say that he needs to get some documents from a competitive firm, first he will apply for a job there, then, after he is actually there and have access to these documents, he needs to steal them – his stolen documents are going to be stored inside some movies or other media files, it is innocent and even if he is getting caught somehow, he can just play the movies at his hard drive / removalble media device (usb key for example).

Design

Whem I’m looking for requirements for such a project, I try to see it as simple as I can. Implementing the file system over regular files let’s you be independent from technologies or operating systems, the stegnographic file system should be portable and easy to implement in any language / OS. The storing media is also taking into account when you can be using your local hard drive or your removable USB key, it let’s you be independant from low level issues. the most innocent looking files I can think of are music files like MP3s, and the media can be any MP3 Player / iPod.

The file system requirements are also not so wide. It should give you the ability to store various files, inside different directories, if it’s feasible. The operations that the file system supports are the follows:

  • Expand: Looping through a list of mp3 files and preparing them for future data.
  • Format: Deleting all files that are currently availble in the file system.
  • Add: Copy a file to the file system or from the file system.
  • Remove: Delete an existing file from the file system.
  • Rename: Changing the name of an existing file.
  • Extract: Copy a file from the file system to any other place.

Simple Implementation

Lets say, that on each MP3 file you have a different amount of free data to store, so the file system overall storing size is the sum of all free size of each and every MP3 file. Each MP3 file should be treated as a stream, that is, the free size will be filled with chunks of the original files that we are storing, each chunk will contain a simple header that describes the chunk. It can be something like the following struct:

typedef struct _ORIGFILE_CHUNK {
/* crc32 of the current chunk */
UINT32 chunk_crc32;
UINT32 origfile_crc32;

struct orig_filename {
UINT8 filename_size;
CHAR filename[];
};

struct orig_data {
/* the offset from the original file */
UINT32 offset;
UINT32 chunk_size;
BYTE chunk_data[];
};

} ORIGFILE_CHUNK, *PORIGFILE_CHUNK;

The original files will be stored in chunks, in any order, over as many files that are needed. The restoring process will be done as follows:

  1. Read all chunks into memory
  2. Validate integrity for all the loaded chunks
  3. Build a dictionary with the original filename as the key
  4. Build the original files from the chunks

When these steps are done, we should validate integrity for each file. We’ll do that using the origfile_crc32 field of each chunk and compare them to the calculated crc32 of the overall original file data of the corresponding chunk.

The underlying steganographic approach can be anything you can think of, a nice project that is looking quite good is mp3stego, and can be used to implement the steganographic part, The data is further protected with encryption.

Conclusion

Armed with our MP3 steganographic file system, our evil spy can go to work, insert his USB key and listen to his favourite music while stealing and collecting info from the firm.

Are you scared? ;-)



Posted in security, stega | 10 Comments

22nd October, 2006

Windows Customization Needs Help /--evilbitz   

It’s important to have a controlled environment when you are working, and any serious computer user fantasizes about the ultimate environment that will let him dominate over his PC!

Well, today, the situation is that the environment is intended for the less experienced computer users, which, by the way, is the bulk size of the users market. Some minorities are left behind and suffer. Along the way, everyone finds the right tools, but no centrialized environment exists that will let you complete customization abillity for your envionment.

As I see it, These are the requirements for the ultimate customized environment:

  • Free shape containers – a container can be a different desktop if you would like, which is placed in a customed shape over the main desktop which defines your environment.
  • A container can be filled with a toolbar, application, web page, mmc snap in, cpl or anything else.
  • Free resizing and scaling would be able to be done, also a script language (or some macro definitions) would control the current layout, and with a simple shortcut, things will be resized, shape transofromed and customized…

The list can go on… but you’ve got the idea on how it was supposed to be.

I don’t know what the fuck happened in vista, the aero gui interface seems to me like the end of the world – again, the stupid PC user is in the center of all things.

And btw: windows explorer sucks!

;-)



Posted in random | Be The First To Comment!

22nd October, 2006

Python IE Automation – Thorough Tutorial /--evilbitz   

I haven’t seen a lot of info on this topic, so I thought I should post something about this:

Python IE automation is extremely easy using the InternetExplorer.Application COM object. Using this COM object you can automate IE to do all kind of stuff like automating any login process, downloading files or creating some underground bots ;)

Here is how to acquire an interface to InternetExplorer.Application:

>>> from win32com.client import Dispatch
>>> ie = Dispatch(“InternetExplorer.Application”)
>>> ie.visible = 1
>>>
>>> # navigate to your favourite website
>>> ie.navigate(website_address)
>>>

Now your browser should navigate to the website address that you have specified, when the browser is finish loading the page, you can start doing the processing of the results…

This is how you wait for the page to finish loading:

>>> while (ie.ReadyState != 4):
>>> sleep(1)
>>>

When the page is done loading, you can get an interface to the document object, this is the same document that javascript & vbscript contains.

This gives you complete DOM control (domination!) over your current page that you last navigated to.

so let’s see how we can do some nice things with it:

>>> ie.navigate(“http://search.msn.com/“)
>>> ie.document.getElementById(“q”).value = “SinglePageMarketing”
>>> ie.document.getElementById(“srch_btn”).click()
>>>

ok, now what about parsing the results?
we can do this with a DOM like approach, or we can parse the text by ourselves… i chose the later method because it’s easier.

>>> result = ie.document.body.innerHtml
>>> len(result)
5619
>>>

Put aside that the result text is in unicode, to convert it to latin use the encode function:

>>> result = result.encode(‘latin-1′, ‘ignore’)

ok, now let’s get a list of all the links that were found by the search engine:

>>> import re
>>> re.findall(“your favourite regexp”, result)

well that’s it! now you know how to do the basics… it’s up to you to build your tools upon it!



Posted in hacking | 4 Comments

Top »
"If you can't join them, beat them!"
Search Evilbitz: