These are shell scripts that automate some procedures shown here. These scripts are helpful when adding remote pwnable problems to your ctf server.
Several features are:
- Creates directories along with default files (binary & flag)
- Sets recommended permissions associated to each file
- Does not harm other files in server
- makeprob.sh
- removeprob.sh
- dropprob.sh
- reloadprob.sh
user@ubuntu:~/ctf-remote-pwnable-setup$ uname -a
Linux ubuntu 4.15.0-30-generic #32~16.04.1-Ubuntu SMP Thu Jul 26 20:25:39 UTC 2018 x86_64 x86_64 x86_64 GNU/LinuxYou need the following package(s) pre-installed.
xinetdThey are all shell scripts (bash). No need to build!
You might want to remove the .sh extension so that scripts can be executed just like any other command.
Formats are specified in each file.
You need root priviledges to run all four scripts because they can cause fatal issues in your directory tree.
makeprob.shwill create a default executble and flag. Replace those with your own ones- When you want to keep the problem but off the port, use
dropprob.sh - To re-run a dropped problem on a specific port, use
reloadprob.sh removeprob.shto delete everything related to a problem from the server
When you eventually add your actual pwnable challenge, feed the default file with your binary.
Let's consider your real binary pwn1 and the default binary mychal (created by ./makeprob.sh mychal).
Example
$ scp pwn1 user@yourctfserver:/home/mychal/pwn1Then login to your server, cd to home directory for mychal.
$ cat pwn1 > mychalIdentical for the flag. First scp the flag to your server.
$ scp flag user@yourctfserver:/home/mychal/flagggThen login to your server, cd to home directory for mychal.
$ cat flaggg > flagYou can just scp as pwn1 as mychal, or flag as flag, but you will have to reset the ownership and permission settings. That's why feeding is recommended. Default binary and flag have the correct permissions set.
- James Sung - Initial work - sjkywalker
- Copyright © 2018 James Sung. All rights reserved.