版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 多模态纳米成像
- 支护题库及答案
- 2026 年中职精准农业技术(精准农业)试题及答案
- 高速铁路旅客服务心理学课件 第七章 高速铁路旅客群体心理与服务
- 办公楼租赁权合同协议2025年补充
- 办公家具安装协议(2025年安装版)
- 基于机器学习的故障预测技术
- 2025年创建全国文明城市知识竞赛试题50题
- 美术无纸化考试题库及答案
- 道路交通安全(第2版)课件全套 李锐 1-1:道路交通安全课程导入 -10-2:道路交通安全规划
- 购物中心开业安保执行方案
- 《积极心理学(第3版)》教学大纲
- 五年级上册小数除法竖式计算100道及答案
- G-T 42582-2023 信息安全技术 移动互联网应用程序(App)个人信息安全测评规范
- 国外惯性技术发展与回顾
- 国开2023秋《幼儿园教育质量评价》形考任务123 大作业参考答案
- 课本剧西门豹治邺剧本
- 中华人民共和国简史学习通超星课后章节答案期末考试题库2023年
- 成都空港产业兴城投资发展有限公司空中客车飞机全生命周期服务项目环境影响报告
- 回族上坟怎么念
- 绳结的各种打法
评论
0/150
提交评论