cf. ATND - katagaitai CTF勉強会 #5 - 関東|med
- vagrant
- この環境でExploitできるようです!!
### prepare your working dir. for example:
# mkdir -p ~/ctf/katagaitai-6/tp
# cd ~/ctf/katagaitai-6/tp
### pull ubuntu 14.04 box
#### (see https://atlas.hashicorp.com/bento/boxes/ubuntu-14.04)
vagrant init bento/ubuntu-14.04; vagrant up --provider virtualbox
添付の Vagrantfile に置き換えてください。 同じディレクトリに、添付の bootstrap.sh を置いてください。【重要】 Vagrantfileがあるディレクトリにtpのファイルを置くと幸せになります
VMを立ち上げます。<20分かかります。アニメでも見てくつろいでいてください。 このフェーズで http://pastebin.com/RjmDapEv にあるインストールが完了します。
vagrant up
tpが動く&デバック環境が出来上がり!
[K_atc]% vagrant ssh at [~/ctf/katagaitai-kanto-med-2016/tp]
Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.13.0-86-generic x86_64)
* Documentation: https://help.ubuntu.com/
vagrant@vagrant:~$ ls -la
total 48
drwxr-xr-x 7 vagrant vagrant 4096 Jul 2 04:21 .
drwxr-xr-x 3 root root 4096 May 21 22:49 ..
-rw-r--r-- 1 vagrant vagrant 220 May 21 22:49 .bash_logout
-rw-r--r-- 1 vagrant vagrant 3637 May 21 22:49 .bashrc
drwx------ 2 vagrant vagrant 4096 May 21 22:50 .cache
-rw-r--r-- 1 vagrant vagrant 81 Jul 2 04:17 .gdbinit
drwxr-xr-x 9 vagrant vagrant 4096 Jul 2 04:23 katana
drwxr-xr-x 10 vagrant vagrant 4096 Jul 2 04:17 libseccomp
drwxr-xr-x 4 vagrant vagrant 4096 Jul 2 04:16 peda
-rw-r--r-- 1 vagrant vagrant 675 May 21 22:49 .profile
drwx------ 2 vagrant vagrant 4096 Jul 2 04:11 .ssh
-rw-r--r-- 1 vagrant vagrant 6 May 21 22:50 .vbox_version
vagrant@vagrant:~$ cat .gdbinit
source /home/vagrant/peda/peda.py
define heap
python from libheap import *
end
vagrant@vagrant:~$ cd /vagrant/
vagrant@vagrant:/vagrant$ ls
bootstrap.sh Dockerfile problem_414d338fffb41107a3cf70bd0a7feffe.elf Vagrantfile
vagrant@vagrant:/vagrant$ echo | ./problem_414d338fffb41107a3cf70bd0a7feffe.elf
Check failed at problem.cc:183 (Success): ReadLen(STDIN_FILENO, &command, sizeof(command)) == sizeof(command)
Killed
vagrant@vagrant:/vagrant$ gdb -q problem_414d338fffb41107a3cf70bd0a7feffe.elf
Reading symbols from problem_414d338fffb41107a3cf70bd0a7feffe.elf...(no debugging symbols found)...done.
gdb-peda$ heap
gdb-peda$ q
vagrant@vagrant:/vagrant$ katana
>
vagrant halt
vagrant destroy
- katana がうまくビルドできない問題を解決 by bataさん
- この環境でリモートでExploitできることを確認 by bataさん