search
HomeBackend DevelopmentPHP Tutorial 关于sql注入的请问

关于sql注入的请教
刚才看了这个帖子
http://topic.csdn.net/u/20121011/08/ed0d9538-0ed1-49c4-95c3-0fc1ef686aa2.html

他的登录代码是这样的:

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
$sql="select * from users where username='$username' and password='$password'";

后来根据他的方法,在知道用户名的情况下确实可以绕过密码提交登录成功。

不过他的方法首要先满足get_magic_quotes_gpc过滤关闭的情况下,这是基础条件。

然后他的登录代码似乎太落后了,现在的密码一般都是用md5加密一下,比如我的登录验证一般是这样写的:
PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->$username = $_REQUEST['username'];
$password = md5($_REQUEST['password']);//改了这行
$sql="select * from users where username='$username' and password='$password'";

这样提交表单得到的$sql就成了:
Select * from users where username='sean' and password='7e2705cbd698f255b7fe11eff40de898'


像这种情况应该怎么注入呢?

------解决方案--------------------
不是还有 $username 吗?干嘛非要是 $password

只要 magic_quotes_gpc = on 这些小儿科的攻击立即失效
Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
php request什么意思php request什么意思Jul 07, 2021 pm 01:49 PM

request的中文意思为“请求”,是php中的一个全局变量,是一个包含了“$_POST”、“$_GET”和“$_COOKIE”的数组。“$_REQUEST”变量可以获取POST或GET方式提交的数据、COOKIE信息。

Python 3.x 中如何使用urllib.request.urlopen()函数发送GET请求Python 3.x 中如何使用urllib.request.urlopen()函数发送GET请求Jul 30, 2023 am 11:28 AM

Python3.x中如何使用urllib.request.urlopen()函数发送GET请求在网络编程中,我们经常需要通过发送HTTP请求来获取远程服务器的数据。在Python中,我们可以使用urllib模块中的urllib.request.urlopen()函数来发送HTTP请求,并获取服务器返回的响应。本文将介绍如何使用

jquery如何隐藏select元素jquery如何隐藏select元素Aug 15, 2023 pm 01:56 PM

jquery隐藏select元素的方法:1、hide()方法,在HTML页面中引入jQuery库,可以使用不同选择器来隐藏select元素,ID选择器将selectId替换为你实际使用的select元素的ID;2、css()方法,使用ID选择器选择需要隐藏的select元素,使用css()方法将display属性设置为none,并将selectId替换为select元素的ID。

使用golang进行Select Channels Go并发式编程的异步处理方法使用golang进行Select Channels Go并发式编程的异步处理方法Sep 28, 2023 pm 05:27 PM

使用golang进行SelectChannelsGo并发式编程的异步处理方法引言:并发式编程是现代软件开发中的一个重要领域,它可以有效地提高应用程序的性能和响应能力。在Go语言中,使用Channels和Select语句可以简单而高效地实现并发编程。本文将介绍如何使用golang进行SelectChannelsGo并发式编程的异步处理方法,并提供具体的

PHP中的Request对象是什么?PHP中的Request对象是什么?Feb 27, 2024 pm 09:06 PM

PHP中的Request对象是用于处理客户端发送到服务器的HTTP请求的对象。通过Request对象,我们可以获取客户端的请求信息,比如请求方法、请求头信息、请求参数等,从而实现对请求的处理和响应。在PHP中,可以使用$_REQUEST、$_GET、$_POST等全局变量来获取请求的信息,但是这些变量并不是对象,而是数组。为了更加灵活和方便地处理请求信息,可

怎么将Vue3 Axios拦截器封装成request文件怎么将Vue3 Axios拦截器封装成request文件May 19, 2023 am 11:49 AM

1、创建一个名为request.js的新文件,并导入Axios:importaxiosfrom&#39;axios&#39;;2、创建一个名为request的函数,并将其导出:这将创建一个名为request的函数,并将其设置为具有基本URL的新的Axios实例。要在封装的Axios实例中添加超时设置,可以在创建Axios实例时传递timeout选项。exportconstrequest=axios.create({baseURL:&#39;https://example.

PHP中Request的作用及意义PHP中Request的作用及意义Feb 27, 2024 pm 12:54 PM

PHP中Request的作用及意义在PHP编程中,Request是指向Web服务器发送请求的一种机制,它在Web开发中起着至关重要的作用。Request主要用于获取客户端发送过来的数据,比如表单提交、GET或POST请求等,通过Request能够获取到用户输入的数据,并对这些数据进行处理和响应。本文将介绍PHP中Request的作用及意义,并给出具体的代码示

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code<form name="myform"

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.