版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、部署平安的網站系部署平安的網站系統統 LNLNiUnsecured Operating System ConfigurationUnmonitored AccessExploit Operating System WeaknessDistribute Virusesi iUSE LoginGO- Add account named webuser to Login databaseEXEC sp_addlogin webuser, m1x2y3z4p5t6l7k8, Login- Grant webuser access to the databaseEXEC sp_grantdbaccess
2、 webuser- Limit webuser to calling proc_IsUserValidGRANT EXECUTE ON proc_IsUserValid TO webuserserver=localhost;database=pubs;Trusted_Connection=yes string hash = FormsAuthentication.HashPasswordForStoringInConfigFile (password, SHA1);string CreateSaltedPasswordHash (string password) / Generate rand
3、om salt string RNGCryptoServiceProvider csp = new RNGCryptoServiceProvider (); byte saltBytes = new byte16; csp.GetNonZeroBytes (saltBytes); string saltString = Convert.ToBase64String (saltBytes); / Append the salt string to the password string saltedPassword = password + saltString; / Hash the salt
4、ed password string hash = FormsAuthentication.HashPasswordForStoringInConfigFile (saltedPassword, SHA1); / Append the salt to the hash string saltedHash = hash + saltString; return saltedHash;bool ValidatePassword (string password, string saltedHash) / Extract hash and salt string string saltString
5、= saltedHash.Substring (saltedHash.Length - 24); string hash1 = saltedHash.Substring (0, saltedHash.Length - 24); / Append the salt string to the password string saltedPassword = password + saltString; / Hash the salted password string hash2 = FormsAuthentication.HashPasswordForStoringInConfigFile (
6、saltedPassword, SHA1); / Compare the hashes return (hash1.CompareTo (hash2) = 0);if (Authenticate (name, password) string url = FormsAuthentication.GetRedirectUrl (name, true); FormsAuthentication.SetAuthCookie (name, true); HttpCookie cookie = Response.Cookies FormsAuthentication.FormsCookieName; /
7、 Set the cookie to expire 1 days from now cookie.Expires = DateTime.Now.AddDays (1); Response.Redirect (url);void Application_Error (Object sender, EventArgs e) / Formulate message to write to event log string msg = Error accessing + Request.Path + n + Server.GetLastError ().ToString (); / Write the message to Windows event log EventLog log
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 《京东金融介绍》课件
- 《债权法教学》课件
- 《管理心理学导论》课件
- 《ISPS保安计划》课件
- 《伤口换药技术》课件
- 6树和喜鹊一年级部编
- 2026年立德树人教育测试题及答案
- 2026年体质标准健康测试题及答案
- 2026年全国国学素养测试题及答案
- 2026年剑桥英语分班测试题及答案
- FZ∕T 61002-2019 化纤仿毛毛毯
- 门式脚手架搭设方案(2篇)
- 《直流工程深井接地极技术导则》(V1)
- CJJ-T 135-2009 (2023年版) 透水水泥混凝土路面技术规程
- 居住区环境调研报告
- C++语言程序设计-清华大学-郑莉
- GA/T 1992-2022公安监管场所安全防范与信息管理系统技术要求
- 《热学》(李椿-章立源-高教版)-课后答案
- 理气葬法-赖布衣著
- 社会保险信息登记表
- 化学制药工艺路线选择的依据
评论
0/150
提交评论