Wargames.my 2015 - Slice of Life (Misc)

4 minute read

The challenge site returns a HTTP response containing an SVG. The HTTP response is reversed.

Solution

Connect to the site and you will get this in response:

-----
>gvs/<
>g/<
>/ "1:yticapo-ekorts;retim:niojenil-ekorts;ttub:pacenil-ekorts;xp1:htdiw-ekorts;enon:ekorts;oreznon:elur-llif;1:yticapo-llif;000000#:llif"=elyts
"2833htap"=di
"z 54308.91-,29935.73 54308.91-,29935.73 0,0 9080.73-,96949.5- 68686.42-,81451.4- 82014.21-,38396.1- 36884.15-,96877.8- 92772.43-,93840.6- 21582.71-,22692.2- 99669.43-,16252.4- 2882.32-,36299.2- 38107.11-,47560.1- 10167.12-,91094.2- 42224.41-,23124.2- 34542.7-,58279.0- 71932.91-,81277.3- 36675.21-,11476.3- 94213.6-,95419.1- 79494.02-,86739.4- 11396.31-,73480.3- 86189.6-,7470.1- 61823.81-,6878.0- 76252.21-,6890.0- 65511.6-,3350.0- 57937.9,39660.34- 44169.73,78542.34- 12326.11,98431.02- 3391.32,49544.12- 98445.41,55822.51- 87121.7,33878.7- 72593.92,64261.73- 60920.91,11052.52- 93930.9,34469.21- 4008.91,35970.92- 20323.31,6223.91- 90022.7,9132.9- 21784.21,80527.31- 76668.8,28567.8- 75394.4,75581.4- 94026.1,1520.2- 33080.1,60053.1- 10595.0,22726.0- 74523.3,22684.3- 67513.1,66763.1- 60635.1,78004.2- 17334.2,82786.3- 55893.0-,95937.0 30104.3,96710.4- c 0,0 l 99527.51-,63764.93 99527.51-,63764.93 0,0 26568.7-,55888.8 86036.5-,91295.5 3427.2-,24988.2 5648.11-,42527.31 54347.7-,19672.9 22703.3-,66121.5 82784.91-,15075.82 27867.21-,32891.91 98204.6-,38885.9 80898.92-,22030.73 39475.02-,83491.42 10255.01-,94248.11 29802.32-,49493.22 2267.51-,53104.41 78935.7-,57567.7 43465.91,96130.53- 98240.31,64453.32- 16098.5,28700.21- 52713.2-,19521.0- 59756.2-,85865.0 65767.0-,1690.0 56059.1,16228.0 48056.2,29437.0 7796.0,97501.0 42960.6,67872.0 71186.3,3380.0- 46294.2,5210.0 45329.81,53271.1 67006.21,24411.1 76552.6,96040.1 4859.02,28591.5 64258.31,56419.3 28689.6,89487.1 69986.81,9254.3 77165.21,28636.1 57124.6,5832.0 41145.12,23385.2 91083.41,58905.1 53752.7,11142.0 53577.43,66149.4 53841.32,5245.3 29716.11,77274.1 55315.15,17466.8 18092.43,24840.6 4932.71,76494.2 42135.73,19661.5 91210.52,45105.3 56695.21,39910.1 c 52424.331,44793.373 m"=d
htap<
>/ "1:yticapo-ekorts;retim:niojenil-ekorts;ttub:pacenil-ekorts;xp1:htdiw-ekorts;enon:ekorts;oreznon:elur-llif;1:yticapo-llif;000000#:llif"=elyts
"6733htap"=di
"z 49091.91-,43466.73 49091.91-,43466.73 0,0 54622.15-,53764.01 26747.33-,29417.9 81138.61-,24253.4 39791.401-,29235.82 33115.96-,2448.81 64878.43-,54389.8 94126.28-,4711.22 39310.55-,5099.41 30265.72-,74692.7 21308.25-,33284.81 11628.43-,48244.31 82663.71-,80508.6 2307.22-,56782.6 83115.51-,52848.2 6195.7-,27200.2 c 0,0 l 20106.81,58023.83- 20106.81,58023.83- 0,0 78656.12,26767.5- 25702.41,71528.4- 73410.7,20146.2- 92267.25,71643.71- 64804.53,50698.01- 73639.71,87056.4- 99353.28,5594.12- 62888.45,57383.41- 11465.72,30827.6- 82763.401,48030.92- 14143.96,46902.02- 88625.43,65026.01- 86100.35,10195.11- 91316.53,78166.6- 10681.81,63329.0- c 49216.752,6304.723 m"=d
htap<
>/ "1:yticapo-ekorts;retim:niojenil-ekorts;ttub:pacenil-ekorts;xp1:htdiw-ekorts;enon:ekorts;oreznon:elur-llif;1:yticapo-llif;000000#:llif"=elyts
"4733htap"=di
"z 85649.02-,11887.63 85649.02-,11887.63 0,0 85039.34-,45612.53- 26931.72-,59152.62- 8801.31-,32806.31- 22370.24-,75808.64- 26449.72-,29003.13- 56400.41-,71026.51- 52740.4-,86818.5- 18638.0-,63327.1- 38031.2-,80007.3- c 0,0 l 95485.32,70662.53- 95485.32,70662.53- 0,0 73906.2,62926.5 55138.1,89221.2 4615.2,15470.4 79502.14,29336.74 55391.82,20861.13 30271.41,9364.51 7795.34,75850.33 2196.03,29800.02 94939.61,87116.7 c 13733.072,86981.112 m"=d
htap<
>/ "1:yticapo-ekorts;retim:niojenil-ekorts;ttub:pacenil-ekorts;xp1:htdiw-ekorts;enon:ekorts;oreznon:elur-llif;1:yticapo-llif;000000#:llif"=elyts
"8633htap"=di
"z 39968.51,478713.93- 39968.51,478713.93- 0,0 31113.62,321042.32- 38824.81,983115.41- 19071.9,407113.7- 45721.33,645613.52- 73438.12,92781.71- 46056.01,578269.8- 41836.62,362805.02- 16379.71,999104.31- 47441.9,43084.6- 83448.12,14429.51- 25228.41,762.01- 1480.7,77155.5- 30296.41,10124.21- 67040.01,75830.8- 78479.4,33950.4- 85819.51,57934.8- 49648.01,34961.5- 8831.5,21261.3- 34695.61,94374.8- 69469.01,94838.5- 83335.5,33828.2- 54811.8,64715.4- 95914.5,23400.3- 28018.2,25782.1- c 0,0 l 9894.71-,63187.83 9894.71-,63187.83 0,0 92630.8-,22604.4 66983.5-,89088.2 73756.2-,3805.1 15993.61-,20154.8 91179.01-,84365.5 43263.5-,76910.3 73982.51-,91157.8 29511.01-,56089.5 55145.4-,96508.3 918.41-,440391.21 35878.9-,639621.8 86249.4-,642260.4 99038.12-,453367.51 79574.41-,804416.01 62012.7-,836053.5 79882.62-,197383.02 44553.71-,602018.31 57754.8-,258481.7 3641.33-,326112.52 12053.22-,988564.61 26540.11-,830024.8 82708.52-,423712.42 19016.61-,747987.61 42874.7-,659232.9 c 87951.744,446193.2 m"=d
htap<
>/ "1:yticapo-ekorts;retim:niojenil-ekorts;ttub:pacenil-ekorts;xp1:htdiw-ekorts;enon:ekorts;oreznon:elur-llif;1:yticapo-llif;000000#:llif"=elyts
"6633htap"=di
"z 24001.32-,778635.53 24001.32-,778635.53 0,0 c 16631.803,291833.01 63787.413,899221.32 54232.423,182522.43 83715.333,979351.54 5687.543,59337.85 21043.853,124350.27 17237.073,324225.58 81234.973,544070.69 44349.883,10828.501 C 112.11-,76039.31- 30552.7-,19634.9- 25912.3-,33260.5- c 0,0 l 68962.32,83436.53- 68962.32,83436.53- 0,0 31839.9,58588.31 31625.7,84395.8 11307.3,71054.4 26534.72,30166.03 94070.81,2926.02 85595.8,1627.01 12892.73,811864.04 22239.42,816219.62 76634.21,566884.31 46636.62,339443.43 80101.71,468164.32 85056.7,55703.21 c 91630.582,960578.54 m"=d
htap<
>"1reyal"=di
g<
>atadatem/<
>FDR:fdr/<
>kroW:cc/<
>eltit:cd/<>eltit:cd<
>/ "egamIllitS/epytimcd/cd/gro.lrup//:ptth"=ecruoser:fdr
epyt:cd<
>tamrof:cd/<lmx+gvs/egami>tamrof:cd<
>""=tuoba:fdr
kroW:cc<
>FDR:fdr<
>"7atadatem"=di
atadatem<
>/ "4sfed"=di
sfed<
>"mm012"=htdiw
"mm792"=thgieh
"7402263.2501 91884490.447 0 0"=xoBweiv
"2gvs"=di
"1.1"=noisrev
"gvs/0002/gro.3w.www//:ptth"=snlmx
"gvs/0002/gro.3w.www//:ptth"=gvs:snlmx
"#sn-xatnys-fdr-22/20/9991/gro.3w.www//:ptth"=fdr:snlmx
"#sn/gro.snommocevitaerc//:ptth"=cc:snlmx
"/1.1/stnemele/cd/gro.lrup//:ptth"=cd:snlmx
gvs<
>?"on"=enoladnats "8-FTU"=gnidocne "0.1"=noisrev lmx?<

KO 002 1.1/PTTH

There are some clues how this data has been transformed KO 002 1.1/PTTH is reversed and at the bottom. A proper HTTP response would have this at the top.

So we can easily write our script to:

  1. Reverse the order of a line from right to left.
  2. Reverse the order of lines.
#!/usr/bin/python

data = file("index.html").read()
data = data.split("\n")
result = ""
for i in data:
    temp = i[::-1]
    result = temp + "\n" + result
print result

In action:

$ python solve.py
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   version="1.1"
   id="svg2"
   viewBox="0 0 744.09448819 1052.3622047"
   height="297mm"
   width="210mm">
  <defs
     id="defs4" />
  <metadata
     id="metadata7">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title></dc:title>
      </cc:Work>
    </rdf:RDF>
  </metadata>
  <g
     id="layer1">
    <path
       d="m 45.875069,285.03619 c 12.30755,7.65058 23.461864,17.10108 34.344933,26.63664 13.488665,12.43667 26.912618,24.93222 40.468118,37.29821 10.7261,8.59558 20.6292,18.07049 30.66103,27.43562 4.45017,3.70311 8.59348,7.52613 13.88585,9.93813 0,0 -35.63438,23.26986 -35.63438,23.26986 l 0,0 c -5.06233,-3.21952 -9.43691,-7.25503 -13.93067,-11.211 C 105.82801,388.94344 96.070445,379.43218 85.522423,370.73271 72.053421,358.34012 58.73395,345.7865 45.153979,333.51738 34.225281,324.23245 23.122998,314.78736 10.338192,308.13661 c 0,0 35.536877,-23.10042 35.536877,-23.10042 z"
       id="path3366"
       style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
    <path
       d="m 2.391644,447.15978 c 9.232956,-7.47824 16.789747,-16.61091 24.217324,-25.80728 8.420038,-11.04562 16.465889,-22.35021 25.211623,-33.1463 7.184852,-8.45775 13.810206,-17.35544 20.383791,-26.28897 5.350638,-7.21026 10.614408,-14.47597 15.763354,-21.83099 4.062246,-4.94268 8.126936,-9.87853 12.193044,-14.819 3.80569,-4.54155 5.98065,-10.11592 8.75119,-15.28937 3.01967,-5.36234 5.56348,-10.97119 8.45102,-16.39951 1.5083,-2.65737 2.88098,-5.38966 4.40622,-8.03629 0,0 38.78136,-17.4989 38.78136,-17.4989 l 0,0 c -1.28752,2.81082 -3.00432,5.41959 -4.51746,8.11845 -2.82833,5.53338 -5.83849,10.96496 -8.47349,16.59643 -3.16212,5.1388 -5.16943,10.84694 -8.43975,15.91858 -4.05933,4.97487 -8.03857,10.04076 -12.42101,14.69203 -5.55177,7.0841 -10.267,14.82252 -15.92441,21.84438 -6.48034,9.14474 -13.401999,17.97361 -20.508263,26.63814 -8.962875,10.65064 -17.18729,21.83437 -25.316546,33.12754 -7.311704,9.17091 -14.511389,18.42883 -23.240123,26.31113 0,0 -39.317874,15.86993 -39.317874,15.86993 z"
       id="path3368"
       style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
    <path
       d="m 211.18968,270.33731 c 7.61178,16.93949 20.00892,30.6912 33.05857,43.5977 15.4639,14.17203 31.16802,28.19355 47.63392,41.20597 4.07451,2.5164 2.12298,1.83155 5.62926,2.60937 0,0 -35.26607,23.58459 -35.26607,23.58459 l 0,0 c -3.70008,-2.13083 -1.72336,-0.83681 -5.81868,-4.04725 -15.62017,-14.00465 -31.30092,-27.94462 -46.80857,-42.07322 -13.60823,-13.1088 -26.25195,-27.13962 -35.21654,-43.93058 0,0 36.78811,-20.94658 36.78811,-20.94658 z"
       id="path3374"
       style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
    <path
       d="m 327.4036,257.61294 c -0.92336,18.18601 -6.66187,35.61319 -11.59101,53.00168 -10.62056,34.52688 -20.20964,69.34141 -29.03084,104.36728 -6.72803,27.56411 -14.38375,54.88826 -21.4955,82.35399 -4.65078,17.93637 -10.89605,35.40846 -17.34617,52.76229 -2.64102,7.01437 -4.82517,14.20752 -5.76762,21.65687 0,0 -38.32085,18.60102 -38.32085,18.60102 l 0,0 c 2.00272,-7.5916 2.84825,-15.51138 6.28765,-22.7032 6.80508,-17.36628 13.44284,-34.82611 18.48233,-52.80312 7.29647,-27.56203 14.9905,-55.01393 22.1174,-82.62149 8.98345,-34.87846 18.8442,-69.51133 28.53292,-104.19793 4.35242,-16.83118 9.71492,-33.74762 10.46735,-51.22645 0,0 37.66434,-19.19094 37.66434,-19.19094 z"
       id="path3376"
       style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
    <path
       d="m 373.39744,133.42425 c 1.01993,12.59665 3.50154,25.01219 5.16691,37.53124 2.49467,17.2394 6.04842,34.29081 8.66471,51.51355 1.47277,11.61792 3.5425,23.14835 4.94166,34.77535 0.24111,7.25735 1.50985,14.38019 2.58332,21.54114 0.2385,6.42175 1.63682,12.56177 3.4529,18.68996 1.78498,6.98682 3.91465,13.85246 5.19582,20.9584 1.04069,6.25567 1.11442,12.60076 1.17235,18.92354 0.0125,2.49264 -0.0833,3.68117 0.27876,6.06924 0.10579,0.6977 0.73492,2.65084 0.82261,1.95065 0.0961,-0.76756 0.56858,-2.65795 -0.12591,-2.31725 -12.00782,5.89061 -23.35446,13.04289 -35.03169,19.56434 7.76575,-7.53987 14.40135,-15.7622 22.39494,-23.20892 11.84249,-10.55201 24.19438,-20.57493 37.03022,-29.89808 9.58883,-6.40289 19.19823,-12.76872 28.57051,-19.48728 5.12166,-3.30722 9.27691,-7.74345 13.72524,-11.8465 2.88942,-2.7243 5.59219,-5.63068 8.88855,-7.86562 0,0 39.46736,-15.72599 39.46736,-15.72599 l 0,0 c -4.01769,3.40103 0.73959,-0.39855 -3.68728,2.43371 -2.40087,1.53606 -1.36766,1.31576 -3.48622,3.32547 -0.62722,0.59501 -1.35006,1.08033 -2.0251,1.62049 -4.18557,4.49357 -8.76582,8.86667 -13.72508,12.48712 -9.2319,7.22009 -19.3226,13.32302 -29.07953,19.8004 -12.96443,9.03939 -25.25011,19.02906 -37.16246,29.39527 -7.87833,7.12178 -15.22855,14.54489 -21.44594,23.1933 -20.13489,11.62321 -43.24587,37.96144 -43.06693,9.73975 -0.0533,-6.11556 -0.0986,-12.25267 -0.8786,-18.32816 -1.0747,-6.98168 -3.08437,-13.69311 -4.93768,-20.49497 -1.91459,-6.31249 -3.67411,-12.57663 -3.77218,-19.23917 -0.97285,-7.24543 -2.42132,-14.42224 -2.49019,-21.76101 -1.06574,-11.70183 -2.99263,-23.2882 -4.25261,-34.96699 -2.29622,-17.28512 -6.04839,-34.27729 -8.77869,-51.48863 -1.69383,-12.41028 -4.15418,-24.68686 -5.94969,-37.0809 0,0 37.53992,-19.80345 37.53992,-19.80345 z"
       id="path3382"
       style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
  </g>
</svg>
-----

We have our .svg file assembled (and converted to PNG):

Converted to png The SVG image containing the flag

Flag: xyL

Leave a Comment