========== Game Rules ========== -------- Overview -------- In each lab (every week), you are asked to solve a set of challenges (typically 10 challenges except for the first two weeks). In each challenge, you have to submit three things, namely, a flag, the exploit, and its write-up via `scoreboard `_: the flag you got from the challenge, the exploit that you wrote, and the write-up that summarizes how you formulated the exploit (see below). A flag is a 512-byte hex string (like below) and you can find it in ``/proc/flag`` once you properly initialize the distributed VM. .. code-block:: bash $ cat /proc/flag CB25682B33EF8BF23545A767562A1D5AA33C88EEACC1AE562D950CB9F1E5725D 864725DB51460902ECBD52BA4CBED86A10F3A98A35F6FB71871019702A0E9199 5BC59332C390A3C27D0EC2CE85BC13E956A6027E3171352F90467A8C12346D9A 2A26EE914B3078ED031FDB14BB6224C3D743D79A733FB49EB4E9C1F383CF810E F6841EE935FE2DA2C57DB4804B6823884B36AE62B08848486918C120E4C2AA94 E1D3F8A6E9E2251AC39E5F37971FB07DFF839E0BC1C4E6C1D4A24E0948F8751B 25BFFE854CD84A8D8E28814398FF192CD9AD37150D83DA872E944DF1552F97DD 1649508E5B9E356925F0762AAF53A4683F48AD4B88C0C863FB03DC5B9C5F77A3 9B3156D4E91ED42B76BDDD3962B39BEAF3520BEC297EC89250F10776A869C2C0 5EAA97231C1F0780B25958FA950816D4DD94C448DF99EC3813183BD20C3006F7 D0825569DAEC45534A355094E4F1A5CC2760F45ED6E8B586DCBA23B27B26E19C 99DDA9B1D17983D1138E3EB7B25BEB927FC34B1FCADEC408CBE7CA04D3E27E39 466D051D4DCA562F292AA623884E9D34BA790E6E46F400F1F6B410F2DDCB8D29 1B0AEBF92CBBA24CB37B8C407F036873C65F568DE58BFD6246ABBABC7D06ADF2 E5A86F2C76E927CF741E8E2B75CAA6530B313EAB80F1C0B7E6B8B22E6D9703C1 A0591DD166168C791A26D32AE6ED3730BA1185B53517436721EE0E3458DB6EF4 Your job is to read this flag by exploiting the distributed challenges. -------------------------------- Taking actions #1 (Registration) -------------------------------- 1) You should provide your own public key to us. Let's generate your private and public key pair. .. code-block:: bash [host] $ sudo apt-get install openssh-client [host] $ ssh-keygen Generating public/private rsa key pair. # select your key location Enter file in which to save the key (/home/YOUR_ID/.ssh/id_rsa): => type YOUR_LOCATION or use default path # type password Enter passphrase (empty for no passphrase): Enter same passphrase again: # check your key location Your identification has been saved in YOUR_LOCATION. Your public key has been saved in YOUR_LOCATION. 2) Register your account and receive an api-key - Visit the submission site: `here `_. You will use the **registration menu**. - Input your e-mail address (we only accept @gatech.edu account) and click the **Email api-key** button. - Once you succeed, you will receive an email including your API-key. You will use this api-key when you login to the course website. 3) Login and upload your public key - Go back to the submission site: `here `_. You will use the **Login menu**. - Input your received api-key and click the **Submit api-key** button. - After login, follow the **Upload public-key** link. - Paste your public key contents and click the **Submit** button. 4) After you upload your public key, we will generate your account in the course CTF server. Then, you can connect to the server and begin your lab challenges. When you login to CTF server, you should use your email account as username (e.g., username for abc@gatech.edu is abc). Since Linux machine consider username with dot(**.**) bad name, we don't allow student to use email account with dot. .. code-block:: bash # login to one of CTF servers [host] $ ssh YOURID@computron.gtisc.gatech.edu -p 2022 # checkin [CTF_server] $ checkin Find your api-key at https://tc.gtisc.gatech.edu/cs6265/2017/submit/handin.py Enter api-key> VRQW0P7AI79T6.... # let's start lab01! [CTF_server] $ cd /home/seclab/ [CTF server] $ cd lab01 [CTF server] $ cat README [CTF server] $ ./bomb - These are available servers for your study. You can choose one among these list. .. code-block:: bash # For current week [host] $ ssh YOURID@computron.gtisc.gatech.edu -p 2022 [host] $ ssh YOURID@computron.gtisc.gatech.edu -p 2023 [host] $ ssh YOURID@cyclonus.gtisc.gatech.edu -p 2022 [host] $ ssh YOURID@cyclonus.gtisc.gatech.edu -p 2023 # For previous week (1 week late submission, 50% score) [host] $ ssh YOURID@cyclonus.gtisc.gatech.edu -p 2024 [host] $ ssh YOURID@computron.gtisc.gatech.edu -p 2024 5) Submit your solution and flag .. code-block:: bash # Submit Flag [CTF server] $ /home/seclab/bin/submit -l -p -f # Submit Writeup [CTF server] $ /home/seclab/bin/submit -l -p -w # NOTE. you don't get a score until you submit writeup # NOTE. you can also submit your flag and writeup through the class website ---------------------------------------------- Taking actions #2 (Building local environment) ---------------------------------------------- Although you can solve all challenges in the remote server, it may be inconvenient because you may not be able to install your own toolbox. In this case, you can build your own environment. However, you still have to read ``/proc/flag`` through the course CTF server to get a real flag. To build your own environment: 1) Download and install Virtualbox/Vagrant - Download and install the latest version of virtualbox at https://www.virtualbox.org/wiki/Downloads - Download and install the latest version of vagrant at http://www.vagrantup.com/downloads.html - Windows: Download and install git at http://git-scm.com/download/win Note: Ubuntu users may want to use the following commands to install Virtualbox and Vagrant .. code-block:: bash [host] $ sudo apt-get install virtualbox [host] $ sudo apt-get install vagrant 2) Add guest OS and run the VM .. code-block:: bash # download a 64-bit VM [host] $ vagrant box add https://atlas.hashicorp.com/ubuntu/trusty64 ==> box: Loading metadata for box 'ubuntu/trusty64' box: URL: https://atlas.hashicorp.com/ubuntu/trusty64 ==> box: Adding box 'ubuntu/trusty64' (v20160822.0.0) for provider: virtualbox box: Downloading: https://atlas.hashicorp.com/ubuntu/boxes/trusty64/versions/20160822.0.0/providers/virtualbox.box ==> box: Successfully added box 'ubuntu/trusty64' (v20160822.0.0) for 'virtualbox'! # move to your working directory [host] $ mkdir seclab [host] $ cd seclab # initialize the VM [host] $ vagrant init ubuntu/trusty64 A `Vagrantfile` has been placed in this directory. You are now ready to `vagrant up` your first virtual environment! Please read the comments in the Vagrantfile as well as documentation on `vagrantup.com` for more information on using Vagrant. # launch! [host] $ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'ubuntu/trusty64'... ... [host] $ vagrant ssh Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-93-generic x86_64) ... vagrant@vagrant-ubuntu-trusty-64:~$ 3) Once you have the VM up and running, let's initialize your VM for this course: .. code-block:: bash # check your kernel version [vm] $ uname -a Linux vagrant-ubuntu-trusty-64 3.13.0-135-generic #184-Ubuntu SMP Wed Oct 18 11:55:51 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux # in the VM, install git/gcc [vm] $ sudo apt-get update [vm] $ sudo apt-get install git [vm] $ sudo apt-get install gcc-multilib # it's time for setting up your environment # [vm] $ git clone git://tc.gtisc.gatech.edu/seclab-pub seclab ... [vm] $ cd seclab [vm] $ ls README ; general info bin/ ; scripts lab/lab01 ; binaries for lab01 ... # initialize your working environment (need to be done once per lab) [vm] $ ./bin/init # you should type your api-key Find your api-key at https://tc.gtisc.gatech.edu/cs6265/2017/submit/handin.py Enter api-key> 4) To do labs: .. code-block:: bash # to do lab1 [vm] $ git pull [vm] $ cd lab01 [vm] $ cat README [vm] $ ./bomb ... # NOTE. test your environment setup [vm] $ bin/checkin Feel free to ask for any help `on Piazza `__, or at the office hours if you ahve any trouble during the setup. ------------ General rule ------------ If not specified (e.g., first two weeks), we will follow the scoring rules stated below: - Approximately 10 challenges every week. - 20 points (flag) x 1.0 (write-up/exploit) = 20 points (each challenge). - 200 points (20 points x 10 challenges) are the maximum points, in theory. - Bonus: first and second bloods (i.e., fastest solvers) will get 10 and 5 bonus points respectively for each challenge. - Late policy: 50% of the original points (only within one week past the due date). --------------- Write-up sample --------------- .. code-block:: bash In this problem, ebp and ret value are protected by gsstack. while debugging, you can see all ebp and ret values are keep tracking and storing somewhere. However, when you make an input large enough, you will see that a function pointer will be overwritten. And the overwritten value will be store in EAX and make it jump at . I put my shellcode as env, get the address, and put it. In my case, the function pointer(0x08048b0a at 0xbffff654) was overwritten. So we could learn, we could jump using the weakpoint even though the stackshiled is working on. $(python -c 'print "\x90"*108+"\x90"*44+"\x87\xf8\xff\xbf"+"\x90"*50')