ola man, mira a ver q tal te va este post de fluproject:
http://www.flu-project.com/2011/05/badstore-aprende-seguridad-web-sin_4899.html
http://www.flu-project.com/2011/05/badstore-aprende-seguridad-web-sin_4899.html
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úchar *ficheroA;
FILE *pFichero;
char caracter;
pFichero=fopen("a.txt", "rb");
while (!feof(pFichero))
{
caracter = fgetc(pFichero);
sprintf(ficheroA,"%s%c",ficheroA,caracter);
}
fclose(pFichero);
sending(s1, ficheroA);
#pragma comment(lib, "wsock32.lib")
#include <stdio.h>
#include <windows.h>
#include <Winsock.h>
WSADATA ws;
char buf[10000];
void output(char *str)
{
FILE *fp = fopen("output.txt", "a+");
fprintf(fp, "%s\n", str);
fclose(fp);
}
SOCKET ConnectFTP(char* ftpname, int port)
{
WSAStartup(0x101, &ws);
// Open up a socket for out TCP/IP session
SOCKET s = socket(AF_INET, SOCK_STREAM, 0);
// Set up socket information.
struct sockaddr_in a = {AF_INET, htons(port)};
// Get the ip address of our ftp
struct hostent *h = gethostbyname(ftpname);
a.sin_addr.s_addr = inet_addr(inet_ntoa(*((struct in_addr *)h->h_addr)));
// Actually connect to the server
connect(s, (struct sockaddr *)&a, sizeof(a));
return s;
}
void receiving(SOCKET s, char* string)
{
char aa[1000] = {'/0'};
int ii = recv(s, aa, sizeof(aa), 0);
sprintf(buf, "~%s~", aa);
output(buf);
if(string !=0)
strcpy(string, aa);
}
void sending(SOCKET s, char* verb)
{
strcpy(buf, verb);
strcat(buf, "\r\n");
output("Sending: ");
output(buf);
send(s, buf, strlen(buf), 0);
}
int _stdcall WinMain(HINSTANCE i, HINSTANCE j, char* k, int l)
{
printf("Arrancando...\n");
SOCKET s1 = ConnectFTP("ftp.XXXXXXXXXXXXX.com", 21);
receiving(s1,0);
printf("Enviando usuario...\n");
sending(s1, "USER XXXXXX");
receiving(s1,0);
printf("Enviando contrasena...\n");
sending(s1, "PASS XXXYYYZZZ");
receiving(s1,0);
sending(s1, "CWD web");
sending(s1, "PASV");
char szString[1000];
receiving(s1, szString);
printf("Sending ...\n");
sending(s1, "STOR archivo.txt");
sending(s1, "QUIT");
receiving(s1,0);
return 0;
}