CS后门源码特征分析与IDS入侵检测

news/2024/9/30 21:29:39

CS后门源码特征分析与IDS入侵检测考核作业

上线x64

getshell

抓心跳包,对特征字符解密Uqd3

用java的checksum8算法得到93,说明是x64的木马

public class EchoTest {
public static long checksum8(String text) {
if (text.length() < 4) {
return 0L;
}
text = text.replace("/", "");
long sum = 0L;
for (int x = 0; x < text.length(); x++) {
sum += text.charAt(x);
}
return sum % 256L;
}
public static void main(String[] args) throws Exception {
System.out.println(checksum8("Uqd3"));
}
}

再上线一个32位的木马

抓心跳包

GET /7sy9 HTTP/1.1
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)
Host: 192.168.225.128:2222
Connection: Keep-Alive
Cache-Control: no-cache

再算一下发现是92,是一个32位的木马

心跳包解密:

看报错缺了依赖,pip install xxxxx下好

win+r cmd使用命令netstat -ano,查看被控端的连接

看到有2222端口,再去看wireshark的流量,过滤这俩的流量包,找到uid,就能找到伪装的exe木马

# suricata规则
# http-beacon-staging,向c2服务器发起get请求,下载大小约210kb的stager,请求地址符合
checksum8规则
# 调用lua检查uri是否符合checksum8规则:计算uri的ascii之和并与256做取余计算,余数为92则符合
规则
alert http any any -> any any (gid:3333; sid:30001; rev:1; \msg:"http-beacon-checksum8-path-parse"; \classtype: http-beacon; \flow: established, to_server; \urilen:4<>6; \luajit:checksum8_check.lua; \
)
# checksum8_check.lua
function init (args)local needs = {}needs["http.uri"] = tostring(true)return needs
end
function match(args)local uri_raw = tostring(args["http.uri"])local uri = string.sub(uri_raw, 2, -1) -- 去除uri中的"/"local sum = 0
for i=1,#uri dolocal x = string.sub(uri,i,i)sum = sum + string.byte(x)
endif (sum % 256) == 92 thenreturn 1 -- 符合checksum8规则,匹配成功elsereturn 0 -- 不符合checksum8规则,匹配失败end
end

创建一个http的规则文件,命名位cshttp将规则写入

然后放入suricata的规则文件夹之中运行之后再查看日志

之后再生成一个https型的后门,先创建一个新的监听器

再生成一个可执行的恶意文件

之后在物理机中运行用wirehshark进行流量监测可以发现JA3码具有明显的特征

编写规则文件

# https-beacon-ja3指纹,client-hello
alert tls any any -> any any (gid:6666; sid:30005; rev:1; \msg:"https-beacon-ja3-hash"; \classtype: https-beacon; \ja3.hash;
pcre:"/652358a663590cfc624787f06b82d9ae|4d93395b1c1b9ad28122fb4d09f28c5e|72a589d
a586844d7f0818ce684948eea|a0e9f5d64349fb13191bc781f81f42e1/"; \
)
# https-beacon-ja3s指纹,server-hello
alert tls any any -> any any (gid:6666; sid:30006; rev:1; \msg:"https-beacon-ja3s-hash"; \classtype: https-beacon; \ja3s.hash;
pcre:"/fd4bc6cea4877646ccd62f0792ec0b62|15af977ce25de452b96affa2addb1036|b742b40
7517bac9536a77a7b0fee28e9/"; \
)

查看日志

加壳免杀处理流量分析

因为是在无安全软件的干扰下进行的我们直接用一个最简单的upx壳来当作免杀处理

加壳之后先运行64位的后门软件,然后运行抓包,再将心跳包后缀改为vir文件解密

看上去upx壳并不能对最后解析的结果产生作用

再运行32位的http后门,将生成的心跳包用工具解密

可以看到同样也将心跳包的内容解密出来了

由此可见一些简单的加壳对心跳包的解读是没有影响的

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hjln.cn/news/45109.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈,一经查实,立即删除!

相关文章

Teamcenter AWC aw-chart自定义图表

1.从服务器获取数据:export const queryChartsData =function(data) { // return new Promise(function (resolve) { // setTimeout(function () {var URL_service =get_URL_service()+"reports/get_workflow_datas";//eventBus.publish("progress.start&…

VideoGeneration

一些读过的视频生成相关的论文Stable Video Diffusion: Scaling Latent Video Diffusion Models to Large Datasets 主要贡献:设计了一套数据清洗策略来清洗大规模的低质量的数据,用于训练T2V的SOTA模型,并证明了此模型具有足够强的关于动作和3D的先验知识可以用于视频相关的…

Beego仿小米商城RBAC管理模块

Beego仿小米商城RBAC管理模块 原创 Go大神 Go大神 2024-05-20 20:38 浙江一、RBAC表结构 1、表结构图2、models\manager.go package modelsimport ( _ "github.com/jinzhu/gorm")type Manager struct { Id int Username string Password string Mobile …

第1章 计算机网络和因特网

本章流程图1.1 什么是因特网 回答这个问题:我们更够描述因特网的具体构成(nuts and bolts),即构成因特网的基本硬件和软件组件。 我们能够根据为分布式应用提供服务的联网基础设施来描述因特网。1.1.1 具体构成描述 端系统通过通信链路(communication link)和分组交换机(…

TCP协议的客户端和服务端的多路复用

#include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <arpa/inet.h> #include <unistd.h> #include <string.h> #include <sys/time.h> #include <sys/select.h> int main(void) {//1.创建套接字in…

Web应用课 第四讲 内外边距、盒子模型、位置、浮动、名片实战

内外边距 margin 内边距 margin属性为给定元素设置所有四个(上下左右)方向的外边距属性。 可以接受1~4个值(上、右、下、左的顺序) 可以分别指明四个方向:margin-top、margin-right、margin-bottom、margin-left 取值 length:固定值 percentage:相对于包含块的宽度,以百…

红日复现为什么失败之struct漏洞复现

struts2漏洞 一、指纹识别 s2的url路径组成(详见struts.xml配置文件):name工程名+namespace命名空间+atcion名称+extends拓展名部署在根目录下,工程名可为空;当然namespace名称也可设置为空;拓展名也可设置为空。 方法一 (1)url会有.action或.do后缀文件名(eg:http://…

使用getaddrinfo函数来获取并打印出www.baidu.com的所有IP地址(IPv4和IPv6)

#include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <arpa/inet.h>int main() {struct addrinfo hints, *res, *p;int status;char ipstr[INET6_ADDRSTRLEN];// 设置h…