扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:青野志狼 来源:xfocus.net 2007年10月22日
关键字: SQL Server 应用程序 SQL 注入
在本页阅读全文(共4页)
Select id,forename,surname from authors |
Select id,forename,surname from authors where forename'john' and surname='smith' |
Forename:jo'hn Surname:smith |
Select id,forename,surname from authors where forename='jo'hn' and surname='smith' |
Server:Msg 170, Level 15, State 1, Line 1 Line 1:Incorrect syntax near 'hn' |
Forename:jo';drop table authors— Surname: |
Select id,forename,surname from authors where id=1234 |
<HTML> <HEAD> <TITLE>Login Page</TITLE> </HEAD> <BODY bgcolor='000000' text='cccccc'> <FONT Face='tahoma' color='cccccc'> <CENTER><H1>Login</H1> <FORM action='process_loginasp' method=post> <TABLE> <TR><TD>Username:</TD><TD><INPUT type=text name=username size=100 width=100></TD></TR> <TR> <TD>Password:</TD><TD><INPUT type=password name=password size=100 withd=100></TD> </TR> </TABLE> <INPUT type=submit value='Submit'><INPUT type=reset value='Reset'> </FORM> </Font> </BODY> </HTML> |
<HTML> <BODY bgcolor='000000' text='ffffff'> <FONT Face='tahoma' color='ffffff'> <STYLE> p { font-size=20pt ! important} font { font-size=20pt ! important} h1 { font-size=64pt ! important} </STYLE> <%@LANGUAGE = JScript %> <% function trace( str ) { if( Request.form("debug") == "true" ) Response.write( str ); } function Login( cn ) { var username; var password; username = Request.form("username"); password = Request.form("password"); var rso = Server.CreateObject("ADODB.Recordset"); var sql = "select * from users where username = '" + username + "' and password = '" + password + "'"; trace( "query: " + sql ); rso.open( sql, cn ); if (rso.EOF) { rso.close(); %> <FONT Face='tahoma' color='cc0000'> <H1> <BR><BR> <CENTER>ACCESS DENIED</CENTER> </H1> </BODY> </HTML> <% Response.end return; } else { Session("username") = "" + rso("username"); %> <FONT Face='tahoma' color='00cc00'> <H1> <CENTER>ACCESS GRANTED<BR> <BR> Welcome, <% Response.write(rso("Username")); Response.write( "</BODY></HTML>" ); Response.end } } function Main() { //Set up connection var username var cn = Server.createobject( "ADODB.Connection" ); cn.connectiontimeout = 20; cn.open( "localserver", "sa", "password" ); username = new String( Request.form("username") ); if( username.length > 0) { Login( cn ); } cn.close(); } Main(); %> |
Var sql="select * from users where username='"+username+"' and password='"+password+"'"; |
Username:';drop table users— Password: |
Username:admin'— |
Username:' or 1=1— |
Username:' union select 1,'fictional_user','some_password',1— |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者