Hack FAQ < Volume 7 > by Wang
Frequently
asked questions about hacking and computers
Took a bit longer to get this volume out, been quite busy and updated a number of programs on the site. I have also been plugging away at the hacking challenges on the net - and starting on writing one myself for the Wang Products web site called "Mod-X". I had a couple of late requests for topics, so they haven't quite made it into this volume - but they will be written and included in Volume 8. Massive thanks must go out to Chawmp (General Chawmp of Cyberarmy) who wrote the Hacking CGI scripts topic below. Also, thanks to anyone else that has helped! Anyhow, enjoy :)
If you have any topics you want covering, please email me at Wang@most-wanted.com and I will consider putting them into the next volume, or you can fill in my online question form on the site. If you have any other methods of solving the questions that I have answered, please send them to me and I will consider putting your solution in as well (with full credit to you obviously).
If you want to join our mailing list and be notified as soon as a new Hack FAQ is released, you can sign up by clicking here
Topics covered
Hacking used to be something which was difficult to learn, and even more difficult to practise safely. With the introduction of the Internet, this has changed. Hackers can now freely exchange their knowledge without risk of being identified, and make themselves known to other hackers/hacking groups. The Internet has brought Hackers together...and given birth to many new opportunities. Recently, a lot of hacking challenges have appeared on the net - most inspired by the hacking challenge at Cyberarmy.com - Zebulun. I thought it would be nice to take a look at a couple of the best ones I have found - and hopefully get some of you lot to try them!
Explanation of ratings
All Ratings are out of 10.
Design is the rating for how good the idea behind the challenge is, and how good the graphics/layout of the challenge is
Features is the rating for what extra bits you can do in the challenge - e.g. message boards to talk to other hackers, challenge statistics, user rankings, special level privaleges etc.
Challenges covers how good the actual challenges are (suprisingly :) and how well thought out they. I also take into consideration how many different aspects of hacking are covered, and in what depth.
Difficulty is rated on how hard the challenges are, and how hard they get as you progress.
Zebulun
( http://www.cyberarmy.com/zebulun )
The original - Zebulun is still respected as the 'main' hacking challenge. I am not sure how it came to be, but Zebulun seems to be THE challenge to prove yourself one. It has the biggest user database of all the challenges we are looking at, and consists of different levels, each with its own challenge. As you go up the levels in Zebulun, you are awarded different ranks - e.g. Trooper, Captain etc., also you are given different privaleges at each level - e.g. being able to administer lower level message boards, being able to access other areas of the web site etc. The design of Zebulun is very slick, nice simple layouts, and loads of features. Each level has its own message board so you are able to talk with people on the same level, and improvements are constantly being made.
Challenges have been designed to test different aspects of hacking, and although there is one challenge per level - a challenge may require you to do a number of things. Challenges have been well designed to ensure that they are realistic enough for you to practise your skills on - but legally. For Zebulun, you will need to know a number of different topics, ranging from understanding basic javascript to finding and using exploits and encryption.
Design: 10
Features: 10
Challenges: 8
Difficulty: 8
Comments: Very professional, and packed full of features and level privaleges. Challenges are nicely thought out, but in places not very taxing. Some may argue that it is not testing a hackers ability at all, as it does not require a user to write a program of his own - in fact, little programming knowledge is required at all. Despite this, other areas are covered nicely.
Disavowed
( http://www.disavowed.net )
Disavowed takes a more hands on approach to the hacking challenge idea. There is no messing with 'ranks' or user registration. However...it comes out very nicely. The design is simple, and revolves around the idea that you are being initiated into joining a team of elite hackers. There are 3 stages - Easy, Medium, and Hard - each consists of 4 challenges. The 4 challenges on each stage are Java, Programming, Research, and Unix/www. At each stage you must complete the 4 challenges to proceed. After completing all 3 stages - you become a member of the team and the challenge changes to being far more complex!
Java looks at increasingly more difficult javascript protections, which you must find the password to. This teaches you to recognise 'easy' ways of breaking javascript protections - and to realise that they are not secure enough to protect pages. Programming sets you the task of making a program (in any language you choose) to find the solution to a problem. These problems range easy to damn hard! and even the best of programmers will find themselves having to think. Research is something which is pretty unique to disavowed.net, it requires you to find something out using the Internet. You will be given just enough information to get you started - and the rest will be up to your brain and your search engine of choice. Unix/www is designed to test your knowledge of unix and the Internet (suprisingly!), although possibly more the Internet than unix. Each stage also provides you with a message board to talk to others on the same level.
Design: 10
Features: 7
Challenges: 10
Difficulty: 10
Comments: Clever design using good imagery and storyline to make you work towards 'joining the team'. Challenges are very difficult, without good programming/Internet experience you would not get through. Perhaps, you could say there is less interaction than Zebulun - but it doesn't seem to matter. I feel it covers important aspects of hacking in great depth, and you will almost certainly come away having learnt something.
Arcanum
( http://www.arcanum.co.nz )
I have had a go at a number of small challenges that various people on Zebulun have made, and although some of them are quite fun - they never really make you want to go back. I thought that Trapper's challenge 'Arcanum' would be the same - but it suprised me. It is not complete yet (well, actually most of these challenges are still work in progress) but what I can see already is looking good. At the moment, the design echo's Zebulun quite closely (colour schemes, fonts etc.) but I have a feeling it will develop its own feel later.
There are 5 levels at this point in time, and each level consists of 4 challenges. The 4 challenges are each level are Logic, Programming, Encryption, and Unknown. Logic challenges are basically brain teasers, or mental challenges. It will give you a problem (usually mathematical) and ask you to solve it. This is the only challenge that I feel is a little weak, I personally don't see the point in it - and so far I have treated it as a second programming challenge. The problem is, it is too easy to write a simple program to solve the logic problems - admitadly there was one that you actually had to work out because a program wouldn't do it...but thats not really enough. The programming challenges are nice, they start off easy and gradually get to a hard level which really makes you think! The encryption is also nice, again starting from ridiculously easy algorithm's to much more complex ones. Unknown - from what I have seen so far is used to test your knowledge of many others aspects (like unix, www, cracking) and is a nice way to bring other aspects to the challenge. What is good about Arcanum is that you are awarded a star each time you complete a challenge on a level. On the members lists you can then see how many challenges on each level people have completed - which is a nice touch. Arcanum also provides a message board at each level to communicate with users on the same level.
Design: 7
Features: 8
Challenges: 8
Difficulty: 7
Comments: A nice little challenge, I can see this one progressing into something bigger. This challenge is not complete and at present level 5 is just going up. I did feel that up until level 4 the challenges were very simple, and I did wonder if they were going to get better - but level 4/5 there seems to be a jump in the difficulty and things get quite interesting. A good start!
Hacking CGI Scripts ( Written for Hack FAQ by Chawmp )
*********************** by Chawmp (Tom McIntyre)
* - Hacking CGI - * homepage: http://home.cyberarmy.com/chawmp
* - Version 1.01c - * email: tom@holodeck.f9.co.uk
*********************** ICQ: 2724168
Introduction
-------------------
CGI programs are a major source of security holes. On a typical
site the server and config files may be secure, but if CGI
programs are not meticulously checked before they are used then
serious security flaws can often be uncovered.
If at any time you are having difficulty, see the Notes section near the bottom of this document.
CGI basics
========
The letters "CGI" stand for "Common Gateway Interface". CGI is a way to add flexibility to websites by providing a mechanism for programs to be executed on the server (sometimes with input from the user on the client-side), and for their output to be displayed back to the client (or just logged somewhere on the server for later inspection). These programs can be written in any language, but by far the most common is perl. Perl is ideal for handling text-based input easily, so it's the language of choice for many CGI developers. Usually the term "CGI script" actually refers to "perl script".
What makes
a CGI program dangerous?
================================
There are, for example, several places where CGI programs are made available for free. If you downloaded a set of perl scripts from a site such as this you would probably expect them to be bug-free and install them without a second thought. There are also the problems of time and operator competence. Most people don't have the time or the knowledge to go through a 5000-line bulletin board script to find that single vulnerable statement. This isn't just limited to free scripts though. Some very high-profile professional script-packages have recently been found to be vulnerable to attack.
Preparation
==========
If you know what script a site is using and it's freely available, get it! By examining the code and playing with it on your own system you'll be able to find holes a lot more easily than by just guessing. And your failed attempts won't be noticed by the server administrator.
Methods of
attack
==============
Insecure
shell calls
------------------------------
This applies to
CGI programs written in many languages, but most commonly perl.
If the program does not treat user input carefully there is a
risk that a malicious user may craft it to be processed by the
program in a dangerous way.
Consider this example. The classic vulnerable "mail"
script, for example a feedback form. A website visitor is asked
for comments that will be sent to the webmaster's email address
by a script running on the server.