Fundamentals of Hacker Attacks

There is no such thing as a universal method to break into an Internet site or server. Every time, an individual approach must be taken to open the necessary doorway. Although some attacks can overpower any defense, for example, a distributed denial-of-service (DoS) attack or brute-force password guessing, they can be too expensive in terms of time and computer resources to implement. Moreover, these attacks are as smart and subtle as driving a tank up to a bank and blasting the vault open. A hacker who breaks into a server using a brute-force attack to discover the password or who takes it out of commission by launching a distributed DoS attack against it will never be recognized as a professional; thus, these methods are used as a last resort and mostly by beginning crackers.

Why are attacks on computers increasing every year? The information about the security holes and vulnerabilities in computer systems used to be stored on bulletin board systems (BBSs), and only a few people with special privileges had access to it. So, it was hackers among these chosen few who carried out attacks with impunity, because their level of education and experience were quite high. It was difficult, often impossible, for a beginner or someone not belonging to the inner circle to gain access to such BBSs. This means that information about vulnerabilities and programs for implementing attacks were available only to a limited number of people.

Nowadays, this information and the necessary tools are available to anyone; thus, anyone can get into the cracking business. The situation is exacerbated by a host of utilities that automate the break-in process and are available to anyone at a number of Internet sites. With some of these utilities, all you have to do is to enter the address of the site to crack and click the Go button. The rest is done by the computer without any involvement on your part. You will not know how the computer did this, but there are quite a few individuals who could not care less; the only thing they are interested in is the results.

Full version | Tag: Security | Date: 3/1/2009 3:48:38 AM

ASP.NET and SQL Injection

How to protect ASP.NET application from SQL Injection vulnerabilities? The first step we can take to protect our software is to understand the SQL Injection vulnerability problem. SQL Injection is a vulnerability that allows hackers to inject malicious code into your SQL script. More info about SQL Injection may be found in my SQL Injection and PHP article.

How to prevent SQL Injection in ASP.NET applications? I do not recommend you to use regular expressions to prevent users or hackers from entering characters that may allow them to break into the database. It is not the best practice in ASP.NET application. Do not try to remove any symbols from the parameters with the data received from the WEB site users. The best practice is to use parameterized SQL queries. You have to use parameters in you queries!

Let's take a look at the next example that use parameterized query to prevent SQL Injection attack on my ASP.NET application:

Full version | Tag: ASP.NET | Date: 3/4/2009 7:30:06 AM

How do viruses spread?

Every executable file has a header. This header contains the entry point: a program address from which it starts its execution. When a virus piggybacks on a program, it adds itself at the program's end and changes the entry point to itself, passing control to the old entry point only after the virus code executes. This way, when an infected executable file starts, the virus code executes first, after which control is passed to the program.

Some especially lazy virus writes do not like bothering with headers. They do it the other way around: They add the executable file to their virus, that is, the virus's body goes first.

This is the main manner of operation of most attachable viruses that were common until about 2000 – MS DOS viruses in particular. The least you can do to protect against this type of malicious code is to check the headers of executable files. A modified header is good cause for alarm, as this may have been done by a virus or a worm. Of course, keeping track of all file headers is a difficult task to carry out manually. At least the size of the main programs, however, can be checked, for it changes when a virus attaches itself to a file.

Full version | Tag: Security | Date: 3/19/2009 3:01:43 PM

Sensitivity to spaces, carriage returns, and tabs

PHP is not sensitive to spaces, carriage returns, and tabs. This means that you can break one command into several lines, or delimit variables, values, or operators with different number of spaces. For example, as the following:

<?php
 $index = 10;
 $index   =  10  +   20;
 $index=10+10;
 $index=
 10
 +

 10;
?>

All of the code above is correct and will work without a hitch.

Each PHP command is terminated with a colon (;). In this way, the interpreter separates one command from another. Do not forget to use this character where it is required, because failing to do so may cause unpredictable errors, which usually cannot be attributed to a missing command separator.

The command separator makes it possible to write one command on several lines or place several commands in one line. The interpreter will be able to tell the commands apart thanks to the command separator.

Full version | Tag: PHP Development | Date: 3/10/2009 1:06:01 PM