Skip to content

angelamcosta/tinky-winkey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Keyboard tinky winkey

Tinky Winkey is a Windows service project written in C++. The goal is to explore Windows API concepts such as service management, token handling, and process creation inside a controlled virtual environment.


📜 Mandatory Features

  • The program must never crash or quit unexpectedly.
  • A NMakefile must be provided and evaluated using NMAKE.
  • Compilation must use cl with flags /Wall and /WX.
  • Only C or C++ languages are allowed.
  • Must run on Windows 10 or higher inside a virtual machine.
  • You may use official Microsoft Windows 10+ images.
  • Windows Defender may be temporarily disabled for testing.
  • Proper error handling and handle cleanup are mandatory.

🚀 Mandatory Part

Structure

The project contains two executables:

Executable Description
svc A Windows service named tinky that can be installed, started, stopped, and deleted.
winkey A keylogger launched by the service under a SYSTEM token.

Required Windows API Functions

Function Purpose
OpenSCManager Opens a handle to the Service Control Manager.
CreateService Installs the service.
OpenService Opens an existing service.
StartService Starts a service.
ControlService Sends control codes to a service (e.g., stop).
CloseServiceHandle Closes service-related handles.
DuplicateTokenEx Duplicates an access token for impersonation or process creation.

Service (svc)

The service must:

  • Accept the following commands: install, start, stop, and delete.
  • Register itself in the Service Control Manager (SCM) as tinky.
  • Impersonate a SYSTEM token using DuplicateTokenEx.
  • Launch the winkey process with that token.
  • Ensure only one instance of winkey runs at a time.
  • Terminate winkey when the service is deleted.

Keylogger (winkey)

According to the original subject, winkey should:

  • Capture keyboard input using a low-level keyboard hook.
  • Record the foreground process, timestamp, and keystrokes.
  • Store data in a human-readable format, following the locale identifier.

🧰 Compilation

Requirements

  • Use Developer Command Prompt for VS (x64).
  • Run all commands with Administrator privileges (required for SCM operations).

Build

  nmake

About

Windows? What’s that?

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages