add dockerfile, fix donut command in linux + path separator issues

This commit is contained in:
eversinc33
2022-10-15 19:37:52 +02:00
parent fd297bc509
commit 269d58e0b1
2 changed files with 17 additions and 4 deletions
+13
View File
@@ -0,0 +1,13 @@
FROM ubuntu:jammy
RUN apt update && apt install -y curl python3 python3-pip mingw-w64=8.0.0-1
RUN apt install -y wget git
RUN wget https://nim-lang.org/choosenim/init.sh && CHOOSENIM_CHOOSE_VERSION=1.6.2 bash init.sh -y
ENV PATH=/root/.nimble/bin:$PATH
RUN nimble install -y nimcrypto docopt ptr_math strenc winim
RUN cd /opt/ && git clone https://github.com/S4ntiagoP/donut --branch syscalls && cd donut && make
ENV PATH=/opt/donut/:$PATH
ADD . /opt/packer
WORKDIR /opt/packer
RUN nim c -d:noRES NimSyscallLoader.nim
RUN mkdir /shared
ENTRYPOINT ["/opt/packer/NimSyscallLoader"]
+4 -4
View File
@@ -559,12 +559,12 @@ if (peinject):
discard os.execShellCmd(fmt"{packerPath}\sgn\sgn.exe -a 64 -c 3 -o tmpshellcode.bin tmpshellcode.bin")
sgn = false
elif system.hostOS == "linux":
discard os.execShellCmd(fmt"donut {filename} -b 1 -o tmpshellcode.bin")
discard os.execShellCmd(fmt"donut --input:{filename} -b 1 -o tmpshellcode.bin")
if (sgn):
if (compileX86):
discard os.execShellCmd(fmt"{packerPath}\sgn\sgn -c 3 -o tmpshellcode.bin tmpshellcode.bin")
discard os.execShellCmd(fmt"{packerPath}/sgn/sgn -c 3 -o tmpshellcode.bin tmpshellcode.bin")
else:
discard os.execShellCmd(fmt"{packerPath}\sgn\sgn -a 64 -c 3 -o tmpshellcode.bin tmpshellcode.bin")
discard os.execShellCmd(fmt"{packerPath}/sgn/sgn -a 64 -c 3 -o tmpshellcode.bin tmpshellcode.bin")
sgn = false
blob = readFile("tmpshellcode.bin")
shellcode = true
@@ -1758,4 +1758,4 @@ if (pump):
writeFile(fmt"{outfile}",pumpsequence)
if (retrieveFromURL):
echo fmt"[!] Make sure to host the {shellcodeFile} file on your webserver with the correct file-Name to have a working payload ;-)"
echo fmt"[!] Make sure to host the {shellcodeFile} file on your webserver with the correct file-Name to have a working payload ;-)"