###################################################################### Luigi Auriemma Application: Abyss webserver (http://www.aprelium.com) Version: 1.0.3 (patch 2) and previous, both Windows and Linux, (patch 2) fix the administration bug Bug: Directory traversal and administration bugs he can administrate the Abyss server without any login. Read the "Bug" section for have more details Date: 22 Aug 2002 Author: Luigi Auriemma e-mail: aluigi@autistici.org web: aluigi.org ###################################################################### 1) Introduction 2) Bug 3) The Code 4) Fix ###################################################################### =============== 1) Introduction =============== Abyss is a free webserver that runs on Win32 and Linux x86 systems. It is tiny and it has some interesting features like for example the use of a "console" for administrate the server remotely. Unfortunately the usage of this console is the most dangerous thing in this webserver because an attacker can do what he want without any password. This bug was found by Aprelium in June and has been fixed in the patch 2 release. However a misunderstanding with CNET have limited the diffusion of this version. The other bug is another dangerous problem: directory traversal bug. The last problem is a minor vulnerability in the management of files with some characters added at the end. ###################################################################### ====== 2) Bug ====== A] Directory traversal bug ========================== The first problem I want to show, is about viewing all the files in the systems where Abyss 1.0.3 (patch 2) and previous run. This problem is caused by the character '\' (%5c) that is not checked as bad character, so the server follow the path in the URI that the attacker give until it reach the file requested. The following are two simple examples for see the winnt\win.ini file: http://host/%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5cwinnt%5cwin.ini "GET /\..\..\..\..\..\winnt\win.ini HTTP/1.0" This last is an HTTP request that can be sent with telnet because some browsers can modify the "\.." chars. It is also possible to view the index of the directories (but not the root) ONLY if the AutoIndex option is not disabled (default is enable). This is for view winnt: http://host/%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5cwinnt/ In Linux fortunately the attacker cannot go down to the path, but he can go only in the Abyss folder and see SOME files like, for example, the files in cgi-bin and chl directory but NOT the abyss.conf or the logs (this is the same also on Windows). Two simple example are: http://host/%2f%2e%2e%2f http://host/%2f%2e%2e%2fcgi-bin/ and we will see the index of the Abyss and cgi-bin folder. B] Administration bug (fixed in patch 2 release) ================================================ The console used in Abyss is the same web server that is binded to port 9999 (another default port can be the 81) and look to the files in the CHL directory of the server. In this directory there are all the files to manage the server remotely so the administrator can change the parameters without modifing the abyss.conf file manually. This bug is really incredible... an attacker without login can reconfigure every parameter of the server. Some examples of what the attacker can do are: - Stop, Run and Halt the server - change username and password of the administrator - change all the advanced parameters of the server (log files, number of requests, etc...) - all the thing that the real administrator can do The only limit for the attacker is that he cannot know the current settings of the server, but I think that it is not so important because he can redefine all! Remember that the attacker can redifine the administrator login and he will be the real administrator. The proof-of-concept can be downloaded from my userpage: http://aluigi.org/poc/abyss-adm.zip C] Characters adding ==================== This is a problem that is diffused on almost all the Windows applications and not only. The problem is that adding some characters (in this case the '+') the attacker can read "for example" the .chl files bypassing the login. Not a bad bug, but is better to fix bugs like this before they can be used for more dangerous exploitations. Simple examples are: http://host:9999/srvstatus.chl+ http://host:9999/consport.chl+ http://host:9999/conspass.chl+ http://host:9999/general.chl+ ###################################################################### =========== 3) The Code =========== A] Example of the directory traversal bug on Win: http://host/%5c%2e%2e%5c%2e%2e%5c%2e%2e%5c%2e%2e%5cwinnt%5cwin.ini "GET /\..\..\..\..\..\winnt\win.ini HTTP/1.0" Abyss index on Linux: http://host/%2f%2e%2e%2f B] For the administration bug watch the html file in my userpage http://aluigi.org/poc/abyss-adm.zip It can be used to test the server that run on the same machine, at the address 127.0.0.1. If you want to test other machines simply replace the string "http://127.0.0.1:9999" at line 4 of the html with the host and the port you want. C] Add the '+' char at the end of the file requested. ###################################################################### ====== 4) Fix ====== Abyss 1.0.3 (patch 3) from the Aprelium web-site: http://www.aprelium.com or directly the updated executable: http://www.aprelium.com/news/patch1033.html ######################################################################