Add Dockerfile for 06-challenge-binsh-shellcode#59
Add Dockerfile for 06-challenge-binsh-shellcode#59cristina-marina1407 wants to merge 2 commits intoopen-education-hub:mainfrom
Conversation
razvand
left a comment
There was a problem hiding this comment.
Use present tense in commit message.
Use proper name Cristina Postelnicu <cristinapostelnicu3107@gmail.com>
chapters/exploitation-techniques/shellcodes/drills/06-challenge-binsh-shellcode/src/README.md
Outdated
Show resolved
Hide resolved
chapters/exploitation-techniques/shellcodes/drills/06-challenge-binsh-shellcode/src/README.md
Outdated
Show resolved
Hide resolved
chapters/exploitation-techniques/shellcodes/drills/06-challenge-binsh-shellcode/src/Dockerfile
Show resolved
Hide resolved
a2e6ba8 to
987688e
Compare
razvand
left a comment
There was a problem hiding this comment.
Rewrite your commit history to do two commits:
- One commit adds
Makefile.solas the Makefile to build the vulnerable app. - One commit adds
Dockerfile,MakefileandREADME.md- introducing the support for Docker.
To do this, you would do:
git config --global user.name "Cristina Postelnicu" # set commit author name globally
git config --global user.email "cristinapostelnicu3107@gmail.com" # set commit email globally
git reset HEAD^2 # revert the two current commits
git add Makefile.sol
git commit -s # commit and sign Makefile.sol
git add Makefile README.md Dockerfile
git commit -s # commit and sign Makefile README.md Dockerfile
git push --force origin 06-challenge-binsh-shellcode
Take a good look at the above commands, make sure you understand them. Ask for further clarification if required.
Also, be sure to use proper commit messages. Start commit message lines with 06-binsh-chall: prefix. Add a commit description detailing the motivation / rationale of the commit. Take a look at these instructions and the commit history.
| objcopy --set-section-flags .bss=code,alloc,data $@ | ||
|
|
||
| binsh_shellcode.bin: binsh_shellcode.nasm | ||
| nasm $< -o $@ |
There was a problem hiding this comment.
You have an extra Tab here, right?
|
|
||
|
|
There was a problem hiding this comment.
Remove extra two ending newlines.
| FROM gcc:latest AS build | ||
| WORKDIR /app | ||
| COPY vuln.c . | ||
| RUN gcc -o vuln vuln.c |
There was a problem hiding this comment.
Copy Makefile.sol and then run make.
| FROM gcc:latest AS build | ||
| WORKDIR /app |
There was a problem hiding this comment.
Use a blank line after FROM line.
| RUN gcc -o vuln vuln.c | ||
|
|
||
| # Runtime stage | ||
| FROM debian:bullseye-slim |
There was a problem hiding this comment.
Use a blank line after FROM line.
| COPY --from=build /app/vuln . | ||
|
|
||
| # Expose port 31344 for external connections | ||
| EXPOSE 31344 |
There was a problem hiding this comment.
Use a blank line after EXPOSE line.
chapters/exploitation-techniques/shellcodes/drills/06-challenge-binsh-shellcode/src/Makefile
Outdated
Show resolved
Hide resolved
Add Makefile.sol as the Makefile for the vulnerable app. This Makefile builds the vuln binary, assembles the shellcode and adds a clean target. It will be used in the Dockerfile. Signed-off-by: Cristina Postelnicu <cristinapostelnicu3107@gmail.com>
- Dockerfile builds vuln and shellcode using Makefile.sol - Makefile manages the container usage and runs the exploit script - README.md explains how to build and run the container using the provided Makefile Signed-off-by: Cristina Postelnicu <cristinapostelnicu3107@gmail.com>
987688e to
34bfeed
Compare
Prerequisite Checklist
Description of changes