1.代码审计发现 这里没有用escape_string,因此存在注入. function show($username){ global $conn; $sql = "select role from `user` where username ='".$username."'"; $res = $conn ->query($sql); if($res->num_rows>0){ echo "$username is ".$re…
$id=check_addslashes($_GET['id']);$id= preg_replace('/o*r/i',"", $id); //strip out OR (non case sensitive) $id= preg_replace('/a*nd/i',"", $id); //Strip out AND (non case sensitive)$id= preg_replace('%26%26',"", $id);$id= pre…
1.自定义一个HttpModule,并将其中的方法添加到HttpApplication相应的事件中!即:创建一个实现了IHttpmodule接口的类,并将配置WebConfig. 在自定义的HttpModule中,可以将一个方法注册到HttpApplication的任意一个事件中,在之后执行HttpApplication一些列事件时,按照事件的顺序(事件又按照添加方法先后的顺序)执行注册在事件中的方法! namespace MvcStore.Models { public class Excu…