




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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茶叶种植苗木购销合同标准模板
- 论文写作试题及答案
- 黑龙江省期末省考数学试卷
- 合肥单招数学试卷
- 低碳生活视觉引导-洞察及研究
- 历城一中考试试题及答案
- 医学临床“三基”训练护士分册(第五版)考试题(附答案)
- DBJ51T 118-2019 四川省城镇供水厂运行管理标准
- 全国统一市政工程预算定额
- 中波发射台供配电系统
- 沧州小升初分班数学试卷
- 河道防洪治理工程的成本控制方案
- 《声光影的内心感动:电影视听语言》期末考试
- 夏天来了安全饮食
- 高考作文-“新八段文”精讲
- 解读-刑法修正案十一
- 抚养权变更协议模板2024年
评论
0/150
提交评论