Sikkerhedsscanning med Nikto

Når alting kører og virker som det skal så er det på tide at ødelægget det hele igen, navnligt skal sikkerheden gennemgås, og der findes rigtig mange værktøjer der kan hjælpe dig på vej. Et af de rigtig gode er Nikto som er en Web Sårbarhedsscanner, her vil jeg gennemgå hvordan du selv kommer igang med Nikto.

Start med at tilføje non-free til dine repositories i /etc/apt/sources.list

deb http://mirrors.rackhosting.com/debian/ squeeze main non-free
deb-src http://mirrors.rackhosting.com/debian/ squeeze main non-free

og kør en:

# apt-get update

efterfulgt af:

apt-get install nikto

og så er vi faktisk klar til at køre en scanning:

# nikto -h xxxxxxx.com
- Nikto v2.1.1
---------------------------------------------------------------------------
+ Target IP:          10.10.10.10
+ Target Hostname:    xxxxxxx.com
+ Target Port:        80
+ Start Time:         2012-05-24 23:18:57
---------------------------------------------------------------------------
+ Server: Apache/2.2.16 (Debian)
+ robots.txt contains 2 entries which should be manually viewed.
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ DEBUG HTTP verb may show server debugging information. See http://msdn.microsoft.com/en-us/library/e8z01xdh%28VS.80%29.aspx for details.
+ Retrieved X-Powered-By header: PHP/5.3.3-7+squeeze9
+ Uncommon header 'x-pingback' found, with contents: http://xxxxxxx.com/xmlrpc.php
+ OSVDB-12184: /index.php?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000: PHP reveals potentially sensitive information via certain HTTP requests which contain specific QUERY strings.
+ OSVDB-12184: /some.php?=PHPE9568F36-D428-11d2-A769-00AA001ACF42: PHP reveals potentially sensitive information via certain HTTP requests which contain specific QUERY strings.
+ OSVDB-12184: /some.php?=PHPE9568F34-D428-11d2-A769-00AA001ACF42: PHP reveals potentially sensitive information via certain HTTP requests which contain specific QUERY strings.
+ OSVDB-12184: /some.php?=PHPE9568F35-D428-11d2-A769-00AA001ACF42: PHP reveals potentially sensitive information via certain HTTP requests which contain specific QUERY strings.
+ OSVDB-561: /server-status: This reveals Apache information. Comment out appropriate line in httpd.conf or restrict access to allowed hosts.
+ OSVDB-3092: /old/: This might be interesting...
+ OSVDB-3092: /readme: This might be interesting...
+ OSVDB-3268: /icons/: Directory indexing is enabled: /icons
+ OSVDB-3299: /forumscalendar.php?calbirthdays=1&action=getday&day=2001-8-15&comma=%22;echo%20'';%20echo%20%60id%20%60;die();echo%22: Vbulletin allows remote command execution. See http://www.securiteam.com/securitynews/5IP0B203PI.html
+ OSVDB-3299: /forumzcalendar.php?calbirthdays=1&action=getday&day=2001-8-15&comma=%22;echo%20'';%20echo%20%60id%20%60;die();echo%22: Vbulletin allows remote command execution. See http://www.securiteam.com/securitynews/5IP0B203PI.html
+ OSVDB-3299: /htforumcalendar.php?calbirthdays=1&action=getday&day=2001-8-15&comma=%22;echo%20'';%20echo%20%60id%20%60;die();echo%22: Vbulletin allows remote command execution. See http://www.securiteam.com/securitynews/5IP0B203PI.html
+ OSVDB-3299: /vbcalendar.php?calbirthdays=1&action=getday&day=2001-8-15&comma=%22;echo%20'';%20echo%20%60id%20%60;die();echo%22: Vbulletin allows remote command execution. See http://www.securiteam.com/securitynews/5IP0B203PI.html
+ OSVDB-3299: /vbulletincalendar.php?calbirthdays=1&action=getday&day=2001-8-15&comma=%22;echo%20'';%20echo%20%60id%20%60;die();echo%22: Vbulletin allows remote command execution. See http://www.securiteam.com/securitynews/5IP0B203PI.html
+ OSVDB-724: /ans.pl?p=../../../../../usr/bin/id|&blah: Avenger's News System allows commands to be issued remotely.  http://ans.gq.nu/ default admin string 'admin:aaLR8vE.jjhss:root@127.0.0.1', password file location 'ans_data/ans.passwd'
+ OSVDB-724: /ans/ans.pl?p=../../../../../usr/bin/id|&blah: Avenger's News System allows commands to be issued remotely.
+ OSVDB-3092: /xmlrpc.php: xmlrpc.php was found.
+ OSVDB-3233: /icons/README: Apache default file found.
+ /wp-content/plugins/akismet/readme.txt: The WordPress Akismet plugin 'Tested up to' version usually matches the WordPress version
+ /readme.html: This WordPress file reveals the installed version.
+ 3818 items checked: 23 item(s) reported on remote host
+ End Time:           2012-05-24 23:42:58 (1441 seconds)
---------------------------------------------------------------------------
+ 1 host(s) tested

Og nu har du så en tjekliste du kan gå igennem, skridt for skridt og sikre din side. Det er vigtigt at huske at ikke alle alarmerne er rigtige og at ikke alle fejl findes, men det her er en rigtig god start. Men lad os gå igennem et par stykker.

Hvis du ser på linie 15 til 32 ser du at de alle starter med OSVDB efterfulgt af en række tal, Osvdb står for “Open Source Vulnerability Database” og er en database med kendte sårbarheder, det betyder at vi kan slå dem op og ofte få mere information. Det gøres ved at konstruere flg. url : http://osvdb.org/show/osvdb/3092 du kan selvfølgelig også søge på siden, men når man kommer ind i rutinen er det langt nemmest at gå direkte ind på adresserne.

Andre steder som f.eks. i linie 12 er der direkte en URL, lige i det her tilfælde er det en false positive, fordi serveren åbenlyst ikke kører ASP.Net og derfor kan vi se bort fra den. Mange af linierne i denne her scanning vil uden tvivl vise sig at være false-positives når man går i dybden, men jeg kan allerede se et par stykker som vi skal have gjort noget ved.

Håber du kan bruge det til noget 🙂

Dette indlæg blev udgivet i Apache, Knowledge Base, Linux, Old Base. Bogmærk permalinket.

Skriv et svar