this is continuing my post about step by step hacking website,after discuss about sql injection,xss cookie stealer,cookie manipulation and RFI , now we will discuss about Null Byte, First of all, what is a ‘Null Byte’? A null character/null byte/null terminator is a character with a value of zero that is shown in the ASCII Charest. And, in programming languages (php included) the null byte is used as, what’s know as, a ’string terminator’.
When the null byte is read the string ends. The null byte is represented with ‘%00′ in php. We are able to harness the ‘power’ of the null byte to trick a picture upload form into letting us upload our own phpshell. There are allot of websites with image uploading features, so they are not hard to find. You can use the Google dork: “Upload Image” to find some of them.
Now that we have a target we are able to start exploiting.go to your targets upload page and click the ‘Browse’ button and navigate to a php shell.just for the sake of Proof of Concept, try to upload this file normally. You will get an error such as:
“We’re sorry, but the file you entered is using an extension that is not alloud. Images only please!”
We see from this that only images are supported - and a regular php shell will not wok. let’s browse to our shell again, but this time we will change the upload bar to look like this, adding in the nullbyte character:
C:\c99.php%00.jpg
When the script checks if our file it will see the .jpg and ’say’ “Yep, looks like an image to me” and upload it. Fortunately for us, when the file is actually uploaded it is uploaded with the .php extension because the null byte terminates anything after that. If it worked we will see:
“Thank you for uploading your pictures - view your file at /c99.php”
and you’re done, this post will be two section , the first will post about null byte picture upload and the second will be on exploiting cgi files using the null byte.so keep read my articles
[Read the rest on (it)gossips network: admin]
CGI Exploitation
Subscribe to Our FREE Newsletter Now:

























3 Comments
Hello

Is there any body in the world that can hack this web site
http://www.iaut.ac.ir
I need adminstrator pass to change the website(this is IRANian website)
please help me to hack thsi web site.
You have a great blog with great info.Thankyou for shareing this.
Dear sir,
I’m erick adn i want to know how to hacking web php,
could you tell more details.
thanks