Skip to content

Instantly share code, notes, and snippets.

@jwsy
Created October 27, 2020 12:34
Show Gist options
  • Save jwsy/22a83fb055d99ee45584529d3db70661 to your computer and use it in GitHub Desktop.
Save jwsy/22a83fb055d99ee45584529d3db70661 to your computer and use it in GitHub Desktop.
Dockerfile updated, add a script to show how to run sweethoney on files local to the host (vs. within the docker guest container)
FROM ubuntu
LABEL maintainer="Matthew Schwartz @schwartz1375"
USER root
ENV DEBIAN_FRONTEND=noninteractive
#RUN DEBIAN_FRONTEND=noninteractive \
RUN apt-get -y update && apt-get -y \
dist-upgrade && apt-get clean && apt-get install -y \
ca-certificates tmux vim wget curl tar zip \
git golang\
build-essential libffi-dev python3 python3-dev python3-pip libfuzzy-dev
RUN pip3 install pefile python-magic termcolor ssdeep sslyze
RUN go get -u github.com/xyproto/elfinfo
RUN cd /root/go/src/github.com/xyproto/elfinfo/; go build ; cp elfinfo /usr/bin/elfinfo
# RUN chmod +x sweethoney.py
WORKDIR /root
COPY sweethoney.py .
ENTRYPOINT ["python3", "./sweethoney.py"]
#!/bin/bash -x
# Mounts a local file to the docker container and runs sweethoney on the file
# Usage:
# $ ./sweethoney.sh FILE
set -o nounset
set -o errexit
FILE=$1
docker run -v"$(realpath $FILE):/root/${FILE}" schwartz1375/sweethoney ${FILE}
$ # Build the image
$ docker build -t schwartz1375/sweethoney:latest -f ./Dockerfile .
$ # Run the image on a local file, in this example it's a zip file
$ ./sweethoney.sh ../usaf/mordor/datasets/small/windows/collection/msf_record_mic.zip
+ set -o nounset
+ set -o errexit
+ FILE=../usaf/mordor/datasets/small/windows/collection/msf_record_mic.zip
++ realpath ../usaf/mordor/datasets/small/windows/collection/msf_record_mic.zip
+ docker run -v/Users/jyee/work/usaf/mordor/datasets/small/windows/collection/msf_record_mic.zip:/root/../usaf/mordor/datasets/small/windows/collection/msf_record_mic.zip schwartz1375/sweethoney ../usaf/mordor/datasets/small/windows/collection/msf_record_mic.zip
PE check for '../usaf/mordor/datasets/small/windows/collection/msf_record_mic.zip':
***************************************
Getting filetype...
***************************************
Zip archive data, at least v2.0 to extract
***************************************
Aw Snap, invaild format!
Manual inspection required!
***************************************
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment