Information#
Version#
By | Version | Comment |
---|---|---|
noraj | 1.0 | Creation |
CTF#
- Name : IceCTF 2016
- Website : https://icec.tf/
- Type : Online
- Format : Jeopardy
- CTF Time : link
Description#
I found this awesome premium shell, but my demo version just ran out... can you help me crack it? /home/demo/
on the shell.
Solution#
- Connect to the shell provided by IceCTF.
- Go to
/home/demo/
. - Our goal is to display
flag.txt
but it is impossible ofr the moment:
- Display
demo.c
- To call
give_shell()
we have to bypass the if statement. - We need the
_
environment variable to be_=icesh
. - But our zsh shell don't allow us to change:
_
is read-only and we can't make it writable.
_
contain the name of the last command but launchingicesh
and then./demo
doesn't work in this environment because the last command is./demo
so_=./demo
.- As
give_shell()
will give us a/bin/sh
, let's try with it. - Start a
/bin/sh
. - With
/bin/sh
,_
contain the last command before last one, so runningicesh
and then./demo
will work:_=icesh
. - So that launch
give_shell()
and give a/bin/sh
enhanced with special gid instead of having I'm sorry, your free trial has ended. printed. - With this empowered shell we can display the
flag.txt
file: