Skip to content

Commit

Permalink
Added Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
six-two committed Aug 31, 2024
1 parent 6910700 commit 9986f4c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/publish-docker-container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Deploy Images to GHCR

env:
DOTNET_VERSION: '6.0.x'

on:
push:
branches:
- main
workflow_dispatch:

jobs:
push-store-image:
runs-on: ubuntu-latest
defaults:
run:
working-directory: './Store'
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}

- name: 'Build Inventory Image'
run: |
docker build . --tag ghcr.io/six-two/self-unzip-html:latest
docker push ghcr.io/six-two/self-unzip-html:latest
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Create a base image
FROM python:slim
LABEL org.opencontainers.image.source="https://github.com/six-two/self-unzip.html"
RUN pip install --no-cache-dir --root-user-action=ignore pycryptodomex

# Install the app
COPY . /app
RUN pip install --root-user-action=ignore /app

# Just for convenience / app configuration
WORKDIR /share
VOLUME /share
ENTRYPOINT ["/usr/local/bin/self-unzip-html"]
CMD ["--help"]
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,22 @@ python3 -m pip install -U self-unzip-html

Example usage of the pip package:
```bash
self-unzip-html -t download -o psexec.html ~/Downloads/SysinternalsSuite/PsExec.exe
self-unzip-html --download -o psexec.html ~/Downloads/SysinternalsSuite/PsExec.exe
```

Or if you wanted to password-protect the output:
```bash
self-unzip-html -t download -o psexec.html -p YourPasswordHere ~/Downloads/SysinternalsSuite/PsExec.exe
self-unzip-html --download -o psexec.html -p YourPasswordHere ~/Downloads/SysinternalsSuite/PsExec.exe
```

Alternatively, you can also the `Dockerfile`:
```bash
docker build -t self-unzip-html .
```

Usage of docker image:
```bash
docker run --rm -v "$PWD:/share" self-unzip-html --download -o psexec.html ./PsExec.exe
```

You can show all flags with the `--help` flag and can see some example commands in `./test.sh`.
Expand Down
4 changes: 2 additions & 2 deletions python/self_unzip_html/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def replace_in_template(self, library_code: str, glue_code: str, payload_code: s

def main() -> None:
# @TODO: Support multiple input files for certain options (download, driveby, etc)?
ap = argparse.ArgumentParser()
ap = argparse.ArgumentParser(description="This tools can create self-decompressing HTML pages, that can be used to minify documents or circumvent web proxy download restrictions and filtering.")
# ap_input = ap.add_argument_group("input options")
# ap_input_mutex = ap_input.add_mutually_exclusive_group(required=True)
ap.add_argument("file", help="the file to encode. Use '-' to read from standard input")
Expand Down Expand Up @@ -208,7 +208,7 @@ def main() -> None:
initial_page_contents_mutex = ap_template.add_mutually_exclusive_group()
initial_page_contents_mutex.add_argument("--html", metavar="HTML_STRING", help="the HTML to show when the page is first loaded or if the unpacking fails")
initial_page_contents_mutex.add_argument("--html-file", metavar="FILE", help="like --html, but read the contents from the given file")
ap_template.add_argument("--obscure-action", action="store_true", help="obscures the action that is performed decoding and basically evaling the code")
ap_template.add_argument("--obscure-action", action="store_true", help="obscures the action JavaScript code")
args = ap.parse_args()

if args.quiet:
Expand Down

0 comments on commit 9986f4c

Please sign in to comment.