Saturday, February 28, 2009

Web Hacking and Server Rooting

Web Hacking and Server Rooting

For many newcomers and beginners, your might be confused about the difference between web hacking and server rooting. They are both different things, and firstly I shall introduce you to web hacking.

Web hacking

What is web hacking? It is the exploitation of vulnerabilities within a website to deface it or gain root access of the site. A prime example is the basic and realistic missions on hackthissite.

Example 1:

Bob finds a website he doesn’t like, www.website.com . He does a routine search and finds an improperly configured .htaccess file that leads him to be able to access the /haccess area.

After finding the password from the admin/.hpasswd area he realizes it is a hash. He opens up John the Ripper, cracks the hash and gains access to the website.

Example 2:

Bob finds another website, and he wishes to deface it. He finds a comment area, and finds it is vulnerable to directory transversals. So he sets the comment name to go back 2 directories to the index.php page and inputs the defacing code he wants.

Server rooting

This is the kind of hacking you see in movies involving Nmap, Backtrack and the “Black and white command prompt screen with strange code.” Unfortunately I have very little experience in rooting as HackThisSite teaches only web hacking. This type of hacking is also much more difficult because it involves exploiting vulnerabilities in the operating system.

Example 1:

Bob finds a website. He does a port scan of it and finds the telnet port open, port 23. He brings up the command prompt and inputs in the command:

telnet www.somewebsite.com 23.

He then exploits a vulnerability in the operating system which leads him to an Administrator account with full privileges.

Know you know,
IncandescentLight

Friday, February 13, 2009

The Art of Deception: Trojan horses

An introduction

Trojan horses are programs which appear to be legitimate but contain harmful payloads such as malware or virii. Trojan horses were actively used throughout warfare, not only as the Trojan horse Troy used but food trucks concealing missiles, etc. This tactic can also be used for cyber warfare, as many military tactics can.

Setting up the payload

Now decide on what payload you wish to use. I won’t go into much detail for this, because it’s simple, but I will focus on the “deception” part. Let’s say you wish to send an EXE concealed as a picture. Once the payload has been done, the file size isn’t very correct for a standard picture file.

Standard picture files are approximately 1 MB in size. To make your Trojan larger, just add large picture or music files into the project Trojan before compiling until you get the size wanted.

Next, a mistake which inexperienced Trojan makers make. Do not use the whole installation package. Otherwise, when the trap is sprung an installation application would pop up. Something like Troy giving the enemy a “Terms of use” contract and asking him to sign it. Just save it, compile the program in a sandbox and then get the app in the /bin file of your project in the Programming Language directory.

Concealing the Trojan

Now for the introduction of another program, Icon Changer, available from http://www.shelllabs.com/ . Download the trial version and install it. Now, go to the Trojan you wish to conceal and right click it. Select the option ‘Change Icon’.

The Icon Changer window will pop out. Now, select the icon you wish to use for the Trojan. Search your C: drive for icons. For this Trojan I will use the picture icon. Just double click it and the icon will be changed. The icon will stay the same on different Operating Systems because the core icon in the file is changed.

Springing the trap

Let’s say you’re going to upload it to a website/ send it over instant messaging. There will be security feature so that you can’t send EXEs over. Now, time for a little trick. Put the Trojan into a .zip file and send it. Of course there’s a little social engineering involved.

Have a nice day,
IncandescentLight

Saturday, February 7, 2009

Hackthissite Basic 11

Hello there, a new mission has been added, Basic 11. First of all take a quick peek at what the overview of the mission is:

“Sam decided to make a music site. Unfortunately he does not understand Apache.”

This basically tells us at first glance that Sam has messed up again, probably opening up a vulnerability or exploit somewhere which can help us with the mission.

Next, taking a brief look at the page, you will find something interesting in the source. Guess he is hiding that pirated music somewhere. Now, think of this:

How would a noob web designer stash his music when he has not much of an ability to write a PHP script to search for it?

Here’s a tip if you haven’t got it so far: Think who about the song title.

Then it’s time to get to basics and find out how he stashed the music. Found it so far? Hint: Take it one step until you’re fully up the ladder.

Then you will find that you cannot go any further. Now it’s time to do a little research. How does an Apache server keep files hidden? This will lead you to another file where the vulnerability search begins.

In the file you’ll see some code. Now, look at the first sentence. If you’ve done your research fully you will find that the settings will take place only if he restarts the server. This is where he made his mistake. The first sentence dictates that the file you are viewing cannot be viewed/is hidden. So the other file there is accessible. Now comes the part where if you’ve been to a grammar school will be easy.

Analyse the sentence which supposedly should contain the password. If you haven’t found it yet, there’s no need to take an English refresher course. Just think literally.

Found it? Now where do we input it? Since Sam doesn’t understand Apache, think where the default page should be. Then enter the password.

Congratulations, you have completed Basic 11!

Cheers,
IncandescentLight

Thursday, February 5, 2009

Levels of programming languages

There are many types of programming languages, and all of them consist
of different levels. There are three levels of programming languages:

Low-level programming languages
Medium-level programming languages
High-level programming languages
Very high-level programming languages

Firstly, let’s take a look at the low-level programming languages. A low level programming language does not need a complier or interpreter to run. Low-level programming languages are divided into two categories:

First generation: These programming languages are the only languages that a processor can understand directly, and is machine code. Writing code in machine code is highly difficult with it requiring alot of attention to the details.

Second generation: Assembly is an example of low-level second generation programming languages. This is easier to program in because it is not the microprocessor's native language but rather the programmer must understand registers and instructions.

Next, the medium-level programming languages. These programming languages are comprised of high-level and low-level language features. An example of this would be C++.

Thirdly, high-level programming languages are programming languages which are easy to use, portable and hide details of CPU operations. An example of this is BASIC. These come in three execution modes:

Interpreted- Interpreted languages are read and executed directly.

Compiled- Compiled languages are transformed into an executable file form and then run.

Machine code- The source code is directly compiled into machine code.

Translated- The source code is translated into a low-level programming language syntax.

Lastly, very high-level programming languages are programming languages which are used by professional programmers to increase productivity. A line of code in a very high-level programming language would translate to many lines of code in the lower levels of programming languages.

These are the main levels of programming languages. I hope this adds to your repertoire of knowledge.