Home
Calendar
Certifications
Columns
Features
Forum
Resources
Vitals
Latest Additions
April 2013 Free Giveaway Sponsor - eLearnSecurity
Human Intelligence to Navigate the Security Data Deluge
February 2013 Free Giveaway Winner of SANS CyberCon Training
Interview: Bugcrowd Founders on Herding Ninjas for Crowdsourced Bug Bounties
Network Forensics: The Tree in the Forest
March 2013 Free Giveaway Sponsor - Mile2
Book Review: Violent Python
February 2013 Free Giveaway Sponsor - SANS
Holiday 2012 Free Giveaway Winner of Metasploit Pro by Rapid7
Course Review: SANS FOR408 Computer Forensic Investigations – Windows In-Depth
The Security Consulting Sugar High
Tutorial: Fun with SMB on the Command Line
Interview: Ilia Kolochenko, CEO of High-Tech Bridge
October 2012 Free Giveaway Winner of LearningGate Training
The Broken: Assessing Corporate Security in 2012 to Make a Better 2013
EH-Net Login
Welcome Guest.
Username:
Password:
Remember me
Lost Password?
No account yet?
Register
Who's Online
We have 56 guests online
You are here:
Home
Ethical Hacking Discussions and Related Certifications
Network Pen Testing
Limited shell
EH-Net
May 25, 2013, 08:23:59 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Go back to The Ethical Hacker Network Online Magazine
Home Page
Home
Help
Calendar
Login
Register
EH-Net
>
Ethical Hacking Discussions and Related Certifications
>
Network Pen Testing
(Moderator:
don
) >
Limited shell
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Limited shell (Read 3097 times)
0 Members and 1 Guest are viewing this topic.
H1t M0nk3y
Hero Member
Offline
Posts: 865
Limited shell
«
on:
January 16, 2013, 08:45:05 AM »
Ok, here's another problem I have had for way too long now and I want to fix.
Here's the scenario: I have got a limited shell on a server in a lab through a web application vulnerability.
By "limited shell", I mean:
- The shell doesn't give me any output on the screen and I cannot output results of commands in a file
- I can change directory and list files (using a second ASP shell), but that's about it.
- I am able to ftp files/modify files into the web root directory (for example, I have uploaded nc.exe in C:\inetpub\wwwroot)
So for example:
C:\Windows\system32>cd ../.. (works)
C:\>cd inetpub\wwwroot (works)
C:\inetpub\wwwroot> dir (doesn't display anything)
C:\inetpub\wwwroot> dir > files.txt (doesn't create a file)
C:\inetpub\wwwroot> nc.exe -lvp 4444 (doesn't work)
C:\inetpub\wwwroot> nc.exe -v 192.168.1.20 4444 (doesn't work either)
I have tried 5 or 6 different ASP shells, but couldn't get much more out of it.
So what approach should I take at this point? Write my own ASP shell code? Focus on trying to get a full shell (for example, using netcat somehow)? Maybe priv escalation (I don't think so at this point, but I could be wrong)
I really just need a direction so I can continue working on a solution...
Thanks
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
ziggy_567
Sr. Member
Offline
Posts: 361
Re: Limited shell
«
Reply #1 on:
January 16, 2013, 08:56:01 AM »
The link below is Linux specific, but there's quite a bit that could be adapted to Windows.
http://pen-testing.sans.org/blog/pen-testing/2012/06/06/escaping-restricted-linux-shells
Also, maybe something in there will click for you and give you some further avenues to explore.
Good luck!
Logged
--
Ziggy
eCPPT - GSEC - GCIH - GCUX - RHCE - SCSecA - Security+ - Network+
Dark_Knight
Sr. Member
Offline
Posts: 292
Re: Limited shell
«
Reply #2 on:
January 16, 2013, 09:26:00 AM »
Quote from: H1t M0nk3y on January 16, 2013, 08:45:05 AM
Ok, here's another problem I have had for way too long now and I want to fix.
Here's the scenario: I have got a limited shell on a server in a lab through a web application vulnerability.
By "limited shell", I mean:
- The shell doesn't give me any output on the screen and I cannot output results of commands in a file
- I can change directory and list files (using a second ASP shell), but that's about it.
- I am able to ftp files/modify files into the web root directory (for example, I have uploaded nc.exe in C:\inetpub\wwwroot)
So for example:
C:\Windows\system32>cd ../.. (works)
C:\>cd inetpub\wwwroot (works)
C:\inetpub\wwwroot> dir (doesn't display anything)
C:\inetpub\wwwroot> dir > files.txt (doesn't create a file)
C:\inetpub\wwwroot> nc.exe -lvp 4444 (doesn't work)
C:\inetpub\wwwroot> nc.exe -v 192.168.1.20 4444 (doesn't work either)
I have tried 5 or 6 different ASP shells, but couldn't get much more out of it.
So what approach should I take at this point? Write my own ASP shell code? Focus on trying to get a full shell (for example, using netcat somehow)? Maybe priv escalation (I don't think so at this point, but I could be wrong)
I really just need a direction so I can continue working on a solution...
Thanks
Are you able to run "net" commands for "net user" etc?
Logged
CEH, OSCP, GPEN, GWAPT, GCIA
http://sector876.blogspot.com
H1t M0nk3y
Hero Member
Offline
Posts: 865
Re: Limited shell
«
Reply #3 on:
January 16, 2013, 09:31:53 AM »
Thanks ziggy_567, I will be reading this tonight!!
Quote
Are you able to run "net" commands for "net user" etc?
No, it doesn't work either...
The IIS server is run with a pretty limited user...
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
ajohnson
Recruiters
Hero Member
Offline
Posts: 1060
aka dynamik
Re: Limited shell
«
Reply #4 on:
January 16, 2013, 10:20:07 AM »
What shells are you trying to use? What OS and version of IIS are you using?
I've encountered instances where i can blindly execute commands, but I can't think of a time where I was using a web shell and wasn't able to receive output for non-privileged commands.
Here's another collection of shells you might want to try:
http://laudanum.inguardians.com/
I'm pretty sure there is at least one ASP-based shell in there.
Logged
WIP: GCFA |
www.infosiege.net
| @infosiege
The day you stop learning is the day you start becoming obsolete.
H1t M0nk3y
Hero Member
Offline
Posts: 865
Re: Limited shell
«
Reply #5 on:
January 16, 2013, 11:57:16 AM »
Quote
What shells are you trying to use? What OS and version of IIS are you using?
Microsoft Windows 2000 SP4
Microsoft IIS httpd 5.1
Using ASPshell and zephir4 (tried 3 or 4 others that I don't remember)
But I am not really looking for help to debug this problem. I am more looking at a methodology or links with tricks I could try.
I have already tried something like 25 differents tricks (not all listed here, obviously), but I would like to learn a few other ones.
I might write my own ASP shell code tonight or modify an existing one...
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
ajohnson
Recruiters
Hero Member
Offline
Posts: 1060
aka dynamik
Re: Limited shell
«
Reply #6 on:
January 16, 2013, 10:34:44 PM »
Methodology-wise, I'd skip the fancy shells and just see if a basic script works. Something like executing the the value of a GET variable called cmd and output it to the screen. The web service account should at least be about to output a directory listing. If not, there may be something else quirky going on.
Logged
WIP: GCFA |
www.infosiege.net
| @infosiege
The day you stop learning is the day you start becoming obsolete.
ajohnson
Recruiters
Hero Member
Offline
Posts: 1060
aka dynamik
Re: Limited shell
«
Reply #7 on:
January 17, 2013, 09:20:43 AM »
Also, remember that you can use msfpayload/msfencode or msfvenom to create asp files that contain Meterpreter, reverse shells, etc.
Logged
WIP: GCFA |
www.infosiege.net
| @infosiege
The day you stop learning is the day you start becoming obsolete.
H1t M0nk3y
Hero Member
Offline
Posts: 865
Re: Limited shell
«
Reply #8 on:
January 17, 2013, 10:16:43 AM »
I didn't know that.
I will play with this later today.
Thanks ajohnson
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
ajohnson
Recruiters
Hero Member
Offline
Posts: 1060
aka dynamik
Re: Limited shell
«
Reply #9 on:
January 17, 2013, 10:33:07 AM »
This tutorial uses WebDAV as the delivery mechanism, but shows how to create the asp file, which works regardless of how you get it up to the web server:
http://carnal0wnage.attackresearch.com/2010/05/more-with-metasploit-and-webdav.html
Logged
WIP: GCFA |
www.infosiege.net
| @infosiege
The day you stop learning is the day you start becoming obsolete.
H1t M0nk3y
Hero Member
Offline
Posts: 865
Re: Limited shell
«
Reply #10 on:
January 17, 2013, 12:12:10 PM »
I appreciate it ajohnson. Thanks
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
H1t M0nk3y
Hero Member
Offline
Posts: 865
Re: Limited shell
«
Reply #11 on:
January 18, 2013, 11:09:43 AM »
As an update, the Meterpreter as an ASP payload did the trick.
Other useful information related to this subject:
http://www.ethicalhacker.net/component/option,com_smf/Itemid,54/topic,9169.0/
http://www.ethicalhacker.net/component/option,com_smf/Itemid,54/topic,5966.msg31666/#msg31666
http://www.room362.com/blog/2012/8/25/post-exploitation-command-lists-request-to-edit.html
Thanks again!
Logged
OSCP, GPEN, GWAPT, GSEC, CEH, CISSP
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
EH-Net
-----------------------------
=> Calendar Of Events
===> ChicagoCon 2007
===> ChicagoCon 2008s
===> ChicagoCon 2008f
===> ChicagoCon 2009s
=> Ethical Hacktivism
=> News Items and General Discussion About EH-Net
===> Greetings
=> Special Events
-----------------------------
Ethical Hacking Discussions and Related Certifications
-----------------------------
=> General Certification
===> Networking
===> OS
===> Security
=> Compliance, Regulations & Standards
=> Control Systems
=> Cyber Warfare
=> Forensics
===> CCE / MCCE - (Master) Certified Computer Examiner
===> CHFI - Computer Hacking Forensic Investigator
===> EnCE - EnCase® Certified Examiner
===> GCFA - GIAC Certified Forensics Analyst
=> Hardware
=> Incident Response
===> CSIH - Computer Security Incident Handler
===> GCIH - GIAC Certified Incident Handler
=> Malware
===> Advisories
=> Mobile
=> Network Pen Testing
===> CEH - Certified Ethical Hacker
===> CPTC - Certified Penetration Testing Consultant
===> CPTE - Certified Penetration Testing Engineer
===> CSTA - Certified Security Testing Associate
===> eCPPT - eLearnSecurity Certified Professional Penetration Tester
===> ECSA - EC-Council Certified Security Analyst
===> GPEN - GIAC Certified Penetration Tester
===> OSCP - Offensive Security Certified Professional
=> Physical Security
=> Programming
=> Social Engineering
=> Web Applications
=> Wireless
===> CWNP Certs
===> GAWN - GIAC Assessing Wireless Networks
===> OSWP - Offensive Security Wireless Professional
=> Other
-----------------------------
Columns
-----------------------------
=> Editor-In-Chief
=> Andress
=> Gates
=> Haddix
=> Hadnagy
=> Heffner
=> Hoffman
=> Linn
=> RichM
=> Murray
=> J. Peltier
=> Weidman
=> Wilson
-----------------------------
Features
-----------------------------
=> /root
=> Book Reviews
=> Opinions
=> Skillz
===> Examples
===> May 06 - Star Hacks, Episode V: The Empire Hacks Back
===> July 06 - Hack Bill!
===> Sept 06 - Netcat in the Hat
===> Nov 06 - Hitch-Hackers Guide to the Galaxy
===> Dec 06 - A Christmas (Hacking) Story
===> Feb 07 - Charlottes Web Site
===> April 07 - Microsoft Office Space
===> June 07 - Serenity Hack
===> Oct 07 - Worst. Ethical. Hacker. Challenge. Ever.
===> Dec 07 - Frosty the Snow Crash
===> March 2008 - It Happened One Friday
===> Oct 2008 - Scooby Doo and the Crypto Caper
===> Dec 08 - Santa Claus Is Hacking to Town
===> Feb 2009 - Brady Bunch Boondoggle
===> July 2009 - Prison Break
===> October 2009 - SSHliders
===> December 2009 - Miracle on Thirty-Hack Street
===> December 2010 - The Nightmare Before Charlie Browns Christmas
-----------------------------
Resources
-----------------------------
=> Career Central
===> Looking For Work
===> Looking To Hire
=> Links to cool sites.
=> Mass Media
=> News from the Outside World
=> Tools
=> Tutorials
===> Tutorial Requests
Loading...
Exclusive Deal
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:
Great!
Better.
About the same.
Little worse.
FUBAR!
Recent Forum Topics
News Items and General Discussion About EH-Net
: Change is Coming to EH-Net!!
(30) by
don
Tools
: Symbolic Exploit Assistant project is looking for collaborators
(0) by
galapag0
Greetings
: Hi from the UK
(5) by
prats84
GCIH - GIAC Certified Incident Handler
: Passed my GCIH
(9) by
prats84
Network Pen Testing
: Want a challenge? Want a GXPN practice exam?
(0) by
ajohnson
GCIH - GIAC Certified Incident Handler
: GCIH Free Practice test attempt
(1) by
prats84
EH-Net News Feeds
Latest Additions
Privacy Notice
for TDCC & All Properties
© 2013 The Ethical Hacker Network
Joomla!
is Free Software released under the GNU/GPL License.