---
title: "WEB安全-SQL注入"
author: "lison5566"
date: "2010-04-29T11:05:34Z"
tags: ["SQL", "Web", "正则表达式", "脚本"]
categories: ["Web前端"]
slug: "web-sql"
draft: false
lastmod: "2010-04-29T11:05:34Z"
id: 655953
url: "https://lison5566.iteye.com/blog/655953"
---

sql注入 ' or 1 例如：select * form table1 where name=" ' "+param+" ' " 一般param是从页面输入控件传递来的数据 如果你在控件中输入 xxx' or 1=1-- 那么他将查询所有的数据出来 -- 表示后面的都被注释掉了 你还可以xxx' ; drop table table1 --那么他将删除该表，其中;是用来分割sql语句 黑客利用sql注入来给网站挂木马，也就是将恶意脚本代码插入到SQL数据库相应的数据中； 如：