Introduction to Software Bugs and Vulnerabilities

Welcome to Hacker Tips - The place where you master the skills behind hacking. 

In this post we are going to see the types of bugs and vulnerabilities of programs. We use C or Python to code and analyze. 

What is a bug?

According to wikipedia ...

A software bug is an error, flaw, failure or fault in a computer program or system that causes it to produce an incorrect or unexpected result, or to behave in unintended ways.

Not all the programs run as they were programmed to do. Unfortunately, what was written doesn't always coincide with what the program was programmed to do.

A story from the book "Hacking- The art of exploitation" : 

A man is walking through the woods, and he finds a magic lamp on
the ground. Instinctively, he picks the lamp up, rubs the side of it
with his sleeve, and out pops a genie. The genie thanks the man for
freeing him, and offers to grant him three wishes. The man is ecstatic
and knows exactly what he wants.
“First,” says the man, “I want a billion dollars.”
The genie snaps his fingers and a briefcase full of money
materializes out of thin air.
The man is wide eyed in amazement and continues, “Next, I want
a Ferrari.”
The genie snaps his fingers and a Ferrari appears from a puff
of smoke.
The man continues, “Finally, I want to be irresistible to women.”
The genie snaps his fingers and the man turns into a box
of chocolates.


Similarly, a program will follow the instructions exactly, but the results are not always what the programmer intended.

This flaw in the output of the program is called a BUG.

Off-By-One-Error

The most common and familiar bug is an off-by-one error. From the name itself it is an error occurred when you miscount something by 1. The compiler or the interpreter do not generate any warning or traceback. It directly leads to a weird output.  

Buffer Overflow

 
It is one the most dangerous Bugs. It occurs when the program tries to store something in a buffer of size less than the stored value. It is one of the favorite bugs of hackers.




Now we are going to exploit these bugs in the future  posts....

Comments