Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish Docker Image

on:
workflow_dispatch:
push:
branches:
- master
paths:
- scanner.py
- requirements.txt
- Dockerfile

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io

jobs:
docker-build:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Lowercase REPO
run: |
echo "IMAGE_NAME=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}

# Login against a Docker registry
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
push: true
labels: org.opencontainers.image.source=https://github.com/${GITHUB_REPOSITORY}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM python:3.12.12-alpine
WORKDIR /opt/react2shell
RUN --mount=type=bind,src=requirements.txt,target=/opt/react2shell/requirements.txt \
pip install --no-cache-dir -r requirements.txt
COPY ["scanner.py", "."]
ENTRYPOINT ["python3", "scanner.py"]
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ The `--vercel-waf-bypass` flag uses an alternative payload variant specifically

The `--windows` flag switches the payload from Unix shell (`echo $((41*271))`) to PowerShell (`powershell -c "41*271"`) for targets running on Windows.

### Docker Support

You can use prebuilt Docker Image `ghcr.io/assetnote/react2shell-scanner` or build it locally with Dockerfile provided.

## Requirements

- Python 3.9+
Expand All @@ -34,10 +38,26 @@ The `--windows` flag switches the payload from Unix shell (`echo $((41*271))`) t

## Installation

### Regular

```
pip install -r requirements.txt
```

### Docker

#### Pull

```shell
docker pull ghcr.io/assetnote/react2shell-scanner
```

#### Or build

```shell
docker build -t react2shell-scanner:latest .
```

## Usage

Scan a single host:
Expand Down Expand Up @@ -81,6 +101,34 @@ Scan with WAF bypass:
```
python3 scanner.py -u https://example.com --waf-bypass
```
## Docker

All the scripts above are available using the docker image. For example:

Scan a single host:

```shell
docker run --rm ghcr.io/assetnote/react2shell-scanner -u https://example.com
```

### Bind mounts
Working directory in Docker container is `/opt/react2shell`. Bind mount to this directory if you need to share files between container and Docker host.

Scan a list of hosts:

```shell
docker run --rm -v $PWD/hosts.txt:/opt/react2shell/hosts.txt:ro ghcr.io/assetnote/react2shell-scanner -l hosts.txt
```

Scan with multiple threads and save results:
```shell
touch results.json # create file before mount
docker run --rm \
-v $PWD/results.json:/opt/react2shell/results.json \
-v $PWD/hosts.txt:/opt/react2shell/hosts.txt:ro \
ghcr.io/assetnote/react2shell-scanner -l hosts.txt -t 20 -o results.json
```
etc.

## Options

Expand Down