Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Commit

Permalink
feat: Spring Controller 内存马
Browse files Browse the repository at this point in the history
1. 支持 Spring Controller 内存马
2. 项目打包方式修改为 maven
  • Loading branch information
X1r0z committed Aug 20, 2023
1 parent 4d666d2 commit 7e4b1a0
Show file tree
Hide file tree
Showing 13 changed files with 669 additions and 72 deletions.
57 changes: 35 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Godzilla 插件: 一键注入 Suo5 内存马

目前支持的中间件和内存马类型

- Tomcat Filter
- Tomcat Servlet
- Tomcat Filter/Servlet
- Spring Controller
- WebLogic Filter
- Jetty Filter
- Resin Filter
- JBoss/WildFly Filter

具体版本的兼容性参考 GodzillaMemoryShellProject
部分中间件的兼容性参考 GodzillaMemoryShellProject

```
Tomcat 5 - 10
Expand All @@ -31,6 +31,8 @@ WebLogic 10.3.6 - 14

注意 Releases 中的 jar 不一定是最新的, 建议按照下面的说明自行手动编译

如果使用过程中出现问题欢迎提 issues

## Usage

内存马注入部分参考了 Godzilla 内置的 FilterShell 和 MemoryShell 插件
Expand Down Expand Up @@ -68,6 +70,16 @@ filterName 为可选项, 如果为空则使用 Godzilla 默认生成的随机名

同样, 如果想要删除注入的 Suo5 内存马, 需要在 ServletManage 插件中操作

## 注入 Spring Controller 内存马

仅支持基于 Servlet API 的 Spring 应用

需要指定 urlPattern

目前不支持卸载 Spring Controller, 待解决

![img19.png](img/img19.png)

### 注入 WebLogic Filter 内存马

需要指定 urlPattern
Expand Down Expand Up @@ -106,34 +118,35 @@ GitHub Releases 页面提供了基于 JDK8 编译的 jar 包

当然你也可以选择自己手动编译

打开 IDEA 的项目结构, 点击 模块, 手动导入 godzilla.jar 和 Tomcat 依赖 (位于 Tomcat 路径的 `lib/` 目录)

![img1.png](img/img1.png)
克隆本项目

点击 工件, 依照图示添加 JAR

![img2.png](img/img2.png)

默认回车即可

![img3.png](img/img3.png)

然后将输出布局中的以 "已提取" 开头的项全部删掉, 只留下 `Suo5MemShell 编译输出`

![img4.png](img/img4.png)
```shell
git clone https://github.com/X1r0z/Godzilla-Suo5MemShell
```

![img5.png](img/img5.png)
修改 pom.xml 中 godzilla 依赖的 systemPath 为自己本地的路径

点击 构建 - 构建工件, 选择 `Suo5MemShell:jar` 并构建
```xml
<dependency>
<groupId>godzilla</groupId>
<artifactId>godzilla</artifactId>
<version>0.1.0</version>
<scope>system</scope>
<systemPath>/Users/exp10it/Downloads/godzilla.jar</systemPath>
</dependency>
```

![img6.png](img/img6.png)
在当前项目目录执行如下命令

![img7.png](img/img7.png)
```shell
mvn package -Dmaven.test.skip=true
```

编译好的 jar 位于当前项目的 `out` 目录
生成的 jar 位于 `target` 目录

## Todo

- [x] 兼容更多中间件
- [ ] 支持卸载 Suo5 内存马
- [ ] 插件体验优化
- [ ] 想到了再写
Binary file removed img/img1.png
Binary file not shown.
Binary file added img/img19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/img2.png
Binary file not shown.
Binary file removed img/img3.png
Binary file not shown.
Binary file removed img/img4.png
Binary file not shown.
Binary file removed img/img5.png
Binary file not shown.
Binary file removed img/img6.png
Binary file not shown.
Binary file removed img/img7.png
Binary file not shown.
30 changes: 29 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,40 @@

<groupId>org.example</groupId>
<artifactId>Suo5MemShell</artifactId>
<version>1.0-SNAPSHOT</version>
<version>0.5</version>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.10</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>8.5.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>godzilla</groupId>
<artifactId>godzilla</artifactId>
<version>0.1.0</version>
<scope>system</scope>
<systemPath>/Users/exp10it/Downloads/godzilla.jar</systemPath>
</dependency>
</dependencies>

</project>
Loading

0 comments on commit 7e4b1a0

Please sign in to comment.