Skip to content

About

Shell scripts to automate the process of adding a pwnable challenge in a ctf server

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CTF Pwnables Setup Automation Script

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

Getting started

Overview

  • makeprob.sh
  • removeprob.sh
  • dropprob.sh
  • reloadprob.sh

Environment

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/Linux

Prerequisites

You need the following package(s) pre-installed.

xinetd

Running the program

Build

They 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.

Run

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.sh will 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.sh to delete everything related to a problem from the server

Management

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/pwn1

Then login to your server, cd to home directory for mychal.

$ cat pwn1 > mychal

Identical for the flag. First scp the flag to your server.

$ scp flag user@yourctfserver:/home/mychal/flaggg

Then login to your server, cd to home directory for mychal.

$ cat flaggg > flag

You 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.

Acknowledgements

Authors

  • James Sung - Initial work - sjkywalker
  • Copyright © 2018 James Sung. All rights reserved.

About

Shell scripts to automate the process of adding a pwnable challenge in a ctf server

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages