摘要:
How to access existing files safely FileInfo file = new FileInfo(Path.Combine(。。。。。在网站中如果使用get方法进行传递文件名称的时候,比如:http://localhost:4245/WebSite2/getfile.aspx?filename=example2.容易被攻击 如http://localhost:4245/WebSite2/getfile.aspx?filename=web.config也可以http://localhost:4245/WebSite2/getfile.aspx?filename=h 阅读全文
摘要:
1、通过写入 OR 1=1 等等形式进行注入 OR 1=1 '--- 这个写法使得后面的内容被去掉,比如 select * from News where uu='' or 1=1 '--- and uuu='' 后面将被省略2、为了获取整个数据表的表结构 使用 hava 1=13、可通union select sum(username) from logins-- 来获取某个字段的类型4、通过'; insert into logins values('yourUsername', 'yourPassword 阅读全文
摘要:
asp.net的每一个请求都包含一个身份验证,即使你没有使用。通过page.user属性来实现默认情况下,在web.config中是<authentication mode= “ Windows “ /> 因此User.Identity.Name 为计算机名称+\登录名 None Uses no authentication. Your application expects only anonymous users, or, if you wish, your application can provide its own authentication process. Form 阅读全文
摘要:
1、在使用querystring的时候,不要使用自动增长的作为依据如以下?XXX=001 xxx=0022、GUID 并不能很好的解决这个问题3、不要再hidden field放重要信息 4、http://www.codeplex.com/AntiCSRF 使用这个组件来anti CSRF5、net的事件验证Eventvalidation is the default behavior for ASP.NET. When validation is enabled, controls that render(which excludes those controls that are not 阅读全文
摘要:
1、输入安全安全隐患:xss方案: 使用微软提供的antixss使用方法:1. Use the Confi guration Generation tool to analyze your Web application project and generatea confi guration fi le, which must be copied to your Web application root directory. The configuration tool examines the assemblies produced when you compile a Web appli 阅读全文