-
Couldn't load subscription status.
- Fork 20
Add Dockerfile for 06-challenge-binsh-shellcode #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Dockerfile for 06-challenge-binsh-shellcode #59
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add ending newlines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have an extra Tab here, right?
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy Makefile.sol and then run make.
| FROM gcc:latest AS build | ||
| WORKDIR /app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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