-
Notifications
You must be signed in to change notification settings - Fork 0
WIP: Simplify Dockerfile #2
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
Open
oxr463
wants to merge
8
commits into
neverrend:master
Choose a base branch
from
oxr463:simplify-dockerfile
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
023764e
Simplify Dockerfile
oxr463 c0f4d46
Update Dockerfile
oxr463 9c64726
Rename LICENSE to COPYING
oxr463 e4ee1b6
Create docker-compose.yml
oxr463 9e13bf1
Update README.md
oxr463 f69266c
Update docker-compose.yml
oxr463 7ae0b68
Update README.md
oxr463 cd166eb
Debug container exiting
oxr463 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,28 @@ | ||
| FROM debian:latest | ||
|
|
||
| RUN apt-get update && apt-get install -y gcc \ | ||
| make \ | ||
| vim \ | ||
| gdb \ | ||
| bison flex \ | ||
| man \ | ||
| ftp | ||
| COPY . /wu-ftpd | ||
| RUN apt-get update && \ | ||
| apt-get install -y bison \ | ||
| flex \ | ||
| ftp \ | ||
| gcc \ | ||
| gdb \ | ||
| make \ | ||
| man \ | ||
| vim | ||
|
|
||
| WORKDIR /wu-ftpd/wu-ftpd-2.6.0/ | ||
| RUN ./configure | ||
| RUN mkdir /usr/man/ | ||
| RUN mkdir /usr/man/man8 && cp ./doc/ftpd.8 /usr/man/man8 | ||
| RUN mkdir /usr/man/man1 && cp ./doc/ftpcount.1 /usr/man/man1 | ||
| RUN mkdir /usr/man/man5 && cp ./doc/ftpaccess.5 /usr/man/man5 | ||
| RUN sed -i 's/\t=\t{/\t{/g' src/ftpcmd.y | ||
| RUN make && make install | ||
| RUN cp ../configs/* /etc/ | ||
| COPY configs/* /etc/ | ||
| COPY wu-ftpd-2.6.0 /usr/src/wu-ftpd | ||
| WORKDIR /usr/src/wu-ftpd/ | ||
|
|
||
| RUN echo "ftp:*:400:400:Anonymous FTP:/home/ftp:/bin/tru" >> /etc/passwd | ||
| RUN echo "ftp:x:400:" >> /etc/group | ||
| RUN mkdir /home/ftp | ||
| RUN chmod 555 /home/ftp | ||
| RUN chown root:ftp /home/ftp | ||
| RUN mkdir /home/ftp/bin/ | ||
| RUN chmod 111 /home/ftp/bin/ | ||
|
|
||
| WORKDIR bin/ | ||
| RUN ./configure --mandir="/usr/share/man" && \ | ||
| sed -i 's/\t=\t{/\t{/g' src/ftpcmd.y && \ | ||
| make && make install && \ | ||
| echo "ftp:*:400:400:Anonymous FTP:/home/ftp:/bin/tru" >> /etc/passwd && \ | ||
| echo "ftp:x:400:" >> /etc/group && \ | ||
| mkdir -p /home/ftp/bin && \ | ||
| chmod 555 /home/ftp && \ | ||
| chown root:ftp /home/ftp && \ | ||
| chmod 111 /home/ftp/bin | ||
|
|
||
| ENTRYPOINT ["/usr/src/wu-ftpd/bin/ftpd"] | ||
| CMD ["-S"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,58 @@ | ||
| # wu-ftp_Exploit_Test | ||
| Docker build of wu-ftp to allow for easy exploitation. | ||
|
|
||
| _Dockerized wu-ftp for easy exploitation_ | ||
|
|
||
| ## Build Instructions | ||
| `docker build -t wu-ftpd:v1 .` | ||
|
|
||
| ### Docker Compose | ||
|
|
||
| ```sh | ||
| docker-compose build | ||
| ``` | ||
|
|
||
| ### Docker | ||
|
|
||
| ```sh | ||
| docker build -t neverrend/wu-ftpd:v1 . | ||
| ``` | ||
|
|
||
| ## Run Instructions | ||
| `docker run -p 21:21 -it wu-ftpd` | ||
|
|
||
| From the container run to start the FTPD service: | ||
| `# ./ftpd -S` | ||
| Note: these commands assume they are being run directly from the repository. | ||
|
|
||
| ### Docker Compose | ||
|
|
||
| ```sh | ||
| docker-compose up -d | ||
| ``` | ||
|
|
||
| ### Docker | ||
|
|
||
| ```sh | ||
| docker run -v "$(pwd)/exploits:/tmp/exploits" -p 21:21 -d neverrend/wu-ftpd:v1 | ||
| ``` | ||
|
|
||
| ## Connecting Instructions | ||
| On the host machine connect with ftp: | ||
| `ftp localhost` | ||
|
|
||
| Use the username anonymous and pass foo. | ||
| On the host machine connect via `ftp`: | ||
|
|
||
| ```sh | ||
| ftp localhost | ||
| ``` | ||
|
|
||
| The username is `anonymous` and the password is `foo`. | ||
|
|
||
| Alternatively, one can also access the service via `curl`: | ||
|
|
||
| ## Misc | ||
| THIS IS FOR TESTING EXPLOITS DO NOT USE THIS AS A REAL FTP SERVER!!!! | ||
| ```sh | ||
| curl -u anonymous:foo ftp://localhost | ||
| ``` | ||
|
|
||
| ## WARNING | ||
|
|
||
| **THIS IS FOR TESTING EXPLOITS DO NOT USE THIS AS A REAL FTP SERVER!!!!** | ||
|
|
||
| ## TODO | ||
| Add code highlight the exploits | ||
|
|
||
| - Add code highlight the exploits | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| version: "3" | ||
| services: | ||
| ftp: | ||
| build: . | ||
| image: neverrend/wu-ftpd:v1 | ||
| ports: | ||
| - 21:21 | ||
| volumes: | ||
| - ./exploits:/tmp/exploits |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@neverrend can you provide a reference for this fix?
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.
Reference?
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.
Yes, for where you got this fix. Or at least a comment for what it does.
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.
Oooh ok I got it right here, they didnt explicitly say use that
sedline I wrote but that's the best way I could come up with based on the conversation:https://lists.gnu.org/archive/html/help-bison/2004-04/msg00006.html