Skip to content

Commit

Permalink
Merge pull request #82 from ngn13/tcp-com
Browse files Browse the repository at this point in the history
migrating to TCP for server-agent communication
  • Loading branch information
ngn13 authored Nov 21, 2024
2 parents 0538179 + 991cf9a commit e50ad98
Show file tree
Hide file tree
Showing 71 changed files with 2,666 additions and 2,866 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ jobs:

- name: 'Build Inventory Image'
run: |
docker build . --tag ghcr.io/ngn13/ezcat:latest
docker build . --tag ghcr.io/ngn13/ezcat:latest --tag ghcr.io/ngn13/ezcat:${GITHUB_REF##*/}
docker push ghcr.io/ngn13/ezcat:${GITHUB_REF##*/}
docker push ghcr.io/ngn13/ezcat:latest
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ COPY payloads ./payloads
COPY docker/init.sh ./

RUN chmod +x "init.sh"
ENV STATIC_DIR "./static"
ENV PAYLOAD_DIR "./payloads"

ARG API_URL
ENV API_URL $API_URL
ENV EZCAT_STATIC_DIR "./static"
ENV EZCAT_PAYLOAD_DIR "./payloads"

ENTRYPOINT ["dumb-init", "./init.sh"]
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
format:
$(MAKE) -C server format
$(MAKE) -C payloads/stage format
cd app && npm run format

.PHONY: format
34 changes: 15 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,40 @@ https://github.com/ngn13/ezcat/assets/78868991/75c3c7c5-6768-47e4-9ef1-0a9e66710

---

> [!NOTE]
> I'm migrating the agent communication from DNS to TCP because there is really no reason to use DNS
> since the reverse shell connection goes over plain TCP anyway, [see this PR](https://github.com/ngn13/ezcat/pull/82)
### 📋 Features
- Easy to install
- Simple web interface
- Agent communication over DNS
- Agent communication over TCP
- Receive TCP reverse shells
- Linux & Windows support
- Self deletion because why not

### 🚀 Install
You can easily install ezcat with docker:
```
docker run --rm --network host \
-e PASSWORD=securepassword \
docker run --rm --network host \
-e EZCAT_PASSWORD=securepassword \
ghcr.io/ngn13/ezcat
```

### ⚙️ Configuration
Configuration is handled with environment variables, here are all the options:

- **`PASSWORD`**: Used to change the login password, by default it's `ezcat`, and for security, you should
- **`EZCAT_PASSWORD`**: Used to change the login password, by default it's `ezcat`, and for security, you should
definitely change it
- **`SHELLIP`**: By default ezcat will try to detect your interface IP address (giving priority to tunnel interfaces).
- **`EZCAT_SHELLIP`**: By default ezcat will try to detect your interface IP address (giving priority to tunnel interfaces).
If you want set this IP address to something else by default, you can use the `SHELLIP` environment variable
- **`DISABLE_MEGAMIND`**: When set to `1`, it disables the "no shells?" megamind meme that's displayed on the dashboard if you don't have
- **`EZCAT_DISABLE_MEGAMIND`**: When set to `1`, it disables the "no shells?" megamind meme that's displayed on the dashboard if you don't have
any active shells
- **`HTTP_PORT`**: Used to change the port that the API server will listen on, default is 5566
- **`AGENT_PORT`**: Used to change the agent communication port, default is 1053
- **`API_URL`**: Used to change the API URL for the front-end application
- **`DATA_DIR`**: Directory that the server will use to store stage builds, default is `./data`
- **`STATIC_DIR`**: Used to change the front-end application (static) directory, it's pre-set in the Dockerfile,
- **`EZCAT_HTTP_PORT`**: Used to change the port that the API server will listen on, default is 5566
- **`EZCAT_AGENT_PORT`**: Used to change the agent communication port, default is 1053
- **`EZCAT_API_URL`**: Used to change the API URL for the front-end application
- **`EZCAT_DIST_DIR`**: Directory that the server will use to store payload/stage builds, default is `./data`
- **`EZCAT_STATIC_DIR`**: Used to change the front-end application (static) directory, it's pre-set in the Dockerfile,
you don't need to worry about it unless you are working on something
- **`PAYLOAD_DIR`**: Specifies the directory that contains the payloads, it's pre-set in the Dockerfile, just like
the `STATIC_DIR` option, don't worry about it
- **`DEBUG`**: When set to `1`, it enables debug output for the server and the stage builds
- **`EZCAT_PAYLOAD_DIR`**: Specifies the directory that contains the payloads, it's pre-set in the Dockerfile, just like
the `EZCAT_STATIC_DIR` option, don't worry about it
- **`EZCAT_DEBUG`**: When set to `1`, it enables debug output for the server and the stage builds

### ⚒️ Build
To build ezcat, install a recent version go. Then download and [extract the latest release](http://github.com/ngn13/ezcat/releases/latest).
Expand All @@ -52,7 +48,7 @@ go build
- To build the front-end application, install a recent version of node and npm change directory into the `app/` directory and run:
```bash
npm i
npm run build
npm run build
```

To build different payloads during runtime, you will need GNU `coreutils` and `bash`, `build-essential` tools and optionally `mingw`
Expand Down
3 changes: 0 additions & 3 deletions app/README.md

This file was deleted.

Loading

0 comments on commit e50ad98

Please sign in to comment.