BIS Project
BIS Project
A Keylogger (short for keystroke logger) is a tool that records every key
you press on your keyboard. While some keyloggers are used for
legitimate purposes like parental control or IT troubleshooting, many
are used for illegal spying and data theft.
Passwords
Credit card numbers
Personal messages
Banking details
Understanding how keyloggers work, how they are installed, and how
to prevent them is a critical part of learning Basics of Information
Security (BIS).
Purpose of a Keylogger
Legitimate Uses:
o Parental control and employee monitoring (with consent)
o IT troubleshooting
o Law enforcement investigations
Malicious Uses:
o Stealing login credentials
o Monitoring chats or emails secretly
o Identity theft
o Unauthorized surveillance
Prevention Tips:
1. Software-Based Keyloggers
These are applications installed on a device to capture keystrokes.
2. Hardware-Based Keyloggers
Physical devices attached between a keyboard and the computer, or
embedded inside the keyboard.
Sub-types:
Advantages of Keyloggers
Modules Used
def check_processes():
...
def on_press(key):
...
Example Output:
def reset_detection():
...
def on_release(key):
...
Exits the program gracefully when the Escape (ESC) key is pressed.
def monitor_system():
...
def monitor_keyboard():
...
import threading
import time
whitelist = ["HidMonitorSvc.exe"]
typed_chars = []
detected_keywords = set()
def check_processes():
if proc_name in whitelist:
continue
if keyword.lower() in proc_name.lower():
def on_press(key):
try:
char = key.char.lower()
typed_chars.append(char)
typed_chars.pop(0)
typed_str = ''.join(typed_chars)
detected_keywords.add(keyword)
print(f"[KEY] {key.char}")
except AttributeError:
print(f"[KEY] {key}")
def reset_detection():
global detected_keywords
while True:
time.sleep(15)
detected_keywords.clear()
def on_release(key):
if key == Key.esc:
while True:
check_processes()
time.sleep(10)
def monitor_keyboard():
listener.join()
if _name_ == "_main_":
system_thread = threading.Thread(target=monitor_system)
keyboard_thread = threading.Thread(target=monitor_keyboard)
reset_thread = threading.Thread(target=reset_detection)
system_thread.start()
keyboard_thread.start()
reset_thread.start()
Output
Conclusion
This program acts as a basic but effective Keylogger Detection Tool. It
is useful in Information Security education for understanding how
malicious activity can be detected using Python scripting. While not a
replacement for commercial anti-spyware, it demonstrates: