版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 民族团结进步年工作总结
- 钢结构柱梁制作工艺流程
- 工业废水处理工职业技能竞赛参与考核试卷及答案
- 2025年职业技能鉴定考试(电力行业油务员-初级)历年参考题库含答案
- 酒店餐饮部年度工作总结
- 2025年工会工作个人总结
- 2025年企业培训师(高级)企业社会责任伦理道德理论知识试卷及答案
- 通风与空调系统调试方案
- 建设工程施工合同纠纷要素式起诉状模板完整版无缺失
- 信息与信息技术的
- 秦腔课件教学
- DB51-T 1959-2022 中小学校学生宿舍(公寓)管理服务规范
- 水利工程施工监理规范(SL288-2014)用表填表说明及示例
- 妊娠合并胆汁淤积综合征
- 河南省安阳市滑县2024-2025学年高二数学上学期期末考试试题文
- 新疆维吾尔自治区普通高校学生转学申请(备案)表
- 内镜中心年终总结
- 园林苗木容器育苗技术
- 陕西省2023-2024学年高一上学期新高考解读及选科简单指导(家长版)课件
- 儿科学热性惊厥课件
- 《高职应用数学》(教案)
评论
0/150
提交评论