[解析] 本大题考查在Window Server 2003系统中DHCP服务器和DNS服务器配置的相关知识,属于常规考点。 在图2中,可分配的地址范围的起始IP地址为192.168.0.5,结束IP地址为192.168.0.253,即能够分配给客户端的有效IP地址范围是192.168.0.5到192.168.0.253,可分配的地址数为253-5+1=249。
1. [问题1] 以下是该后台管理登录页面login.asp的部分代码,请仔细阅读该段代码,根据上图将横线处的空缺代码补齐。 <! -- # include file= "conn . asp" - > <! -- # include file= "md5 . asp"--> <! -- # include file=',bbb.asp"--> <% If request . Form("submit") = "管理登陆" Then User name= request. Form ("______") Password = request.Form("______") Verifycode = request.Form("______") If user name = " " Then Call infoback("用户名不能为空!") End If …… Set______= server.CreateObj ect ("adodb . recordset") Sq1 = "select * from administrator______ user name = ' "&user_nam'amehe&" ' And password= ' "&md5 (password) &"'" rs. Open______, conn, 1,1 If ______ rs. EOF Then Session ("user name") = user name response . redirect"information . asp" Else Call infoback("用户名或密码错误!" ) End If End If %> <html> …… <body> <form method = "post " action = " login * asp " id = "login "> <hl>管理员登陆</hl> <label for = "user name">用户名: Input name = "user name" type = "text" class = "user name"id = "uname" Size= "2 5 " /> </label> <label for = "password">密码: <input name = "password" type = "password" id = "pword"size = "25"/> </label> <label for = "verifycode">验证码: <input name = "verifycode" type = "text" class = "verifycode"id = "'vcode" Size = "10 " maxlength= "4" /> <img src = "code . asp " onclick = " j avascript : this . src = 'code . asp? tm= ' + Math. Random() style = " cursor : pointer"alt = "单击更换"title = "单击更换"/> </label> <p class = "center"> <input name= "reset" type = "______,'class = "submit"value = "清除数据"/> <input type = "______" name = "submit "class = "submit " vahlue = "管理登陆"/> </p> </form> </body> </html> A.pword B.where C.uname D.vcode E.reset F.submit G.rs H.sql I.Not
C A D G B H I E F
[解析] 本大题考查网页设计的基本知识。 本问题考查html代码及asp编程的基础知识。根据图示网页及提供的程序代码,对于login.asp文档中的第1-3空对应于程序后面的表单id属性值,第8-9空可以在图中判断其表单类型值,第4-7空是asp程序,用于创建数据库连接实例、sql查询语句、判断数据记录集合。所以代码应为如下: <! -- # include file= "conn . asp" - > <! -- # include file= "md5 . asp"--> <! -- # include file=',bbb.asp"--> <% If request . Form("submit") = "管理登陆" Then User name= request. Form ("uname") Password = request.Form("pword") Verifycode = request.Form("vcode") If user name = " " Then Call infoback("用户名不能为空!") End If …… Set rs= server.CreateObj ect ("adodb . recordset") Sql = "select * from administrator where user__name-' "&user__name&"'. and Password= ' "&md5-(password) &"'" rs. Open spl, conn. 1,1 If Not rs. EOF Then Session ("user__name") = user__name response . redirect "information . asp" Else Call infoback("用户名或密码错误!" ) End If End If %> <html> …… <body> <form method = "post " action = " login * asp " id = "login "> <hl>管理员登陆</hl> <label for = "user name">用户名: <input name = "user name" type = "text" class = "user name"id = "uname" <Size= "25 " /> </labe1> <labe1 for = "password">密 码: <input name = "password" type = "password" id = "pword"size = "25" /> </label1> <label for = "verifycode">验证码: <input name = "verifycode" type = "text" class = "verifycode"id = "'vcode" Size = "10" maxlength= "4"/> <img src = "code . asp " onclick = " j avascript : this . src = 'code . asp? tm= ' + Math. Random() style = " cursor : pointer"alt = "点击更换" title = "点击更换"/> </label> <p class = "center"> <input name= "reset" type = "reset" class = "submit"value = "清除数据"/> <input type = "submit" name = "submit "class = "submit " vahlue = "管理登陆"/> </p> </form> </body> </html>
2. [问题2] 1.在登录页面login.Asp中通过<! -- # include file="bbb.asp"-->导入了bbb.Asp的代码,以下是bbb.asp的部分代码,请仔细阅读该段代码,将空缺代码补齐。 <% Dim GetFlag Rem(提交方式) Dim ErrorSq1 Rem(非法字符) Dim RequestKey Rem(提交数据) Dim For1 Rem(循环标记) ErrorSq1 = ¨'~;~and~(~)~)-exec~update-.count~ * ~ % ~chr~mid~master~truncate~char~declare"Rem(每个敏感字符或者词语请使用半角”~”格开) ErrorSq1 = Split(ErrorSq1,"~") If Request.ServerVariables("REQUEST METHOD") ="GET" Then GetFlag = True Else GetFlag = False End If If GetFlag Then For Each RequestKey In Request.QueryString For Forl = 0 To UBound(ErrorSql) If InStr (LCase (Request.QueryString (RequestKey), ErrorSql (Forl)<>0 Then Response.Write"<script>alert(" "警告,:\n请不要使用特殊字符\n 比如英文的单引号" ");history.go (-1);</script>" Response.______ ______ Next ______ ______ For Each RequestKey In Request.Form For Forl = 0 To UBound(ErrorSql) …… %> A.Else B.Endlf C.End D.Next 2.根据上述代码可以判断,登录页面login.Asp导入bbb.Asp的代码的目的是______。
C B D A 防止sql注入攻击
[解析] 本问题考查asp基本编程知识,主要是程序的基本结构。 1.依照ASP程序的基本语法,第一空应是程序在此结束,所以此处为end属性。第二空对应于If InStr(LCase(Request.QueryString(RequestKey),ErrorSql(Forl)<>0,此处为选择语句结束标记End If;第三空对应于For EachRequestKey In Request.QueryString,为Next,第四空对应IfGetFlag Then语句,为else。所以该程序代码如下: <% Dim GetFlag Rem(提交方式) Dim ErrorSq1 Rem(非法字符) Dim RequestKey Rem(提交数据) Dim For1 Rem(循环标记) ErrorSql = ¨'~;~and~(~)~exec~update~count~ * ~ % ~chr~mid~master~ Truncate~char~declare"Rem(每个敏感字符或者词语请使用半角”~”格开) ErrorSq1 = Split(ErrorSq1,"~") If Request.ServerVariables("REQUEST_METHOD") ="GET" Then GetFlag = True Else GetFlag = False End If If GetFlag Then For Each RequestKey In Request.QueryString For Forl = 0 To UBound(ErrorSql) If InStr (LCase (Request.QueryString (RequestKey), ErrorSql (Forl)<>0 Then Response.Write"<script>alert(" "警告,:\n请不要使用特殊字符\n比如英文的单引号" ");history.go (-1);</script>" Response.End End If Next Next Else For Each RequestKey In Request.Form For Forl = 0 To UBound(ErrorSql) …… %> 问题2的备选答案如下: A.Else B.Endlf C.End D.Next 2.该程序的代码的主要作用在于屏蔽sql注入攻击时的一些关键字,所以其主要作用在于防止sql注入攻击。