三步堵死SQL注入漏洞_MySQL
SQL注入
SQL注入是什么?
许多网站程序在编写时,没有对用户输入数据的合法性进行判断,使应用程序存在安全隐患。用户可以提交一段数据库查询代码(一般是在浏览器地址栏进行,通过正常的www端口访问),根据程序返回的结果,获得某些想得知的数据,这就是所谓的SQL Injection,即SQL注入。
网站的恶梦——SQL注入
SQL注入通过网页对网站数据库进行修改。它能够直接在数据库中添加具有管理员权限的用户,从而最终获得系统管理员权限。黑客可以利用获得的管理员权限任意获得网站上的文件或者在网页上加挂木马和各种恶意程序,对网站和访问该网站的网友都带来巨大危害。
防御SQL注入有妙法
第一步:很多新手从网上下载SQL通用防注入系统的程序,在需要防范注入的页面头部用 来防止别人进行手动注入测试(如图1)。
图1
可是如果通过SQL注入分析器就可轻松跳过防注入系统并自动分析其注入点(图2)。然后只需要几分钟,你的管理员账号及密码就会被分析出来(图3)。
图2
图3
第二步:对于注入分析器的防范,笔者通过实验,发现了一种简单有效的防范方法。首先我们要知道SQL注入分析器是如何工作的。在操作过程中,发现软件并不是冲着“admin”管理员账号去的,而是冲着权限(如flag=1)去的。这样一来,无论你的管理员账号怎么变都无法逃过检测。
第三步:既然无法逃过检测,那我们就做两个账号,一个是普通的管理员账号,一个是防止注入的账号,为什么这么说呢?笔者想,如果找一个权限最大的账号制造假象,吸引软件的检测,而这个账号里的内容是大于千字以上的中文字符,就会迫使软件对这个账号进行分析的时候进入全负荷状态甚至资源耗尽而死机。下面我们就来修改数据库吧。
1.对表结构进行修改。将管理员的账号字段的数据类型进行修改,文本型改成最大字段255(其实也够了,如果还想做得再大点,可以选择备注型),密码的字段也进行相同设置。
2.对表进行修改。设置管理员权限的账号放在ID1,并输入大量中文字符(最好大于100个字)。
3.把真正的管理员密码放在ID2后的任何一个位置(如放在ID549上)。
我们通过上面的三步完成了对数据库的修改。
这时是不是修改结束了呢?其实不然,要明白你做的ID1账号其实也是真正有权限的账号,现在计算机处理速度那么快,要是遇上个一定要将它算出来的软件,这也是不安全的。我想这时大多数人已经想到了办法,对,只要在管理员登录的页面文件中写入字符限制就行了!就算对方使用这个有上千字符的账号密码也会被挡住的,而真正的密码则可以不受限制。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

When using Win11 system, sometimes you will encounter a prompt that requires you to enter the administrator username and password. This article will discuss how to deal with this situation. Method 1: 1. Click [Windows Logo], then press [Shift+Restart] to enter safe mode; or enter safe mode this way: click the Start menu and select Settings. Select "Update and Security"; select "Restart Now" in "Recovery"; after restarting and entering the options, select - Troubleshoot - Advanced Options - Startup Settings -&mdash

As a content-rich social e-commerce platform, Xiaohongshu has attracted a large number of users. For those who want to conduct multiple businesses on Xiaohongshu, it is particularly important to have multiple accounts. So, how does Xiaohongshu have multiple accounts? How can we make these accounts have traffic? This article will analyze these issues in detail and provide you with helpful guidance. 1. How to have multiple accounts on Xiaohongshu? When registering a Xiaohongshu account, you can choose to register multiple accounts using different mobile phone numbers or email addresses in order to have multiple accounts. Real-name authentication is an effective measure to improve account security and credibility. It is recommended to conduct real-name authentication for each account, so that the account will be more authoritative and credible. 3. Improve the information: Improve the information of each account, including personal homepage, header

Google Chrome is a web browsing tool used by many people. In order to make it more convenient to use, some users want to log in to their Google account first, but a prompt that the account cannot be logged in appears. Regarding this issue, many users do not know what to do. How to solve it, then today the editor will share the complete solution with you. I hope that the content of today’s software tutorial can help the majority of users. Google account shows that you cannot log in. Solution: 1. Click on a browser on the desktop and you will see something like this after opening it. 2. If a login pops up at this time, click it. If you can't see it, click the upper right corner. 3. Click Login, then enter your account number. You do not need to enter the account after @, and click Next. 4. Enter the password,

In the digital age, Xiaohongshu has become a platform for many people to share their lives and discover good things. Over time, we may need to change the mobile phone number on the account. So, how to change Xiaohongshu’s mobile phone number? 1. How to change the mobile phone number of Xiaohongshu account? 1. Log in to your Xiaohongshu account and enter the “My” page. 2. Click "..." in the upper right corner and select "Settings". 3. On the settings page, find the "Account and Security" option and click to enter. 4. On the Account and Security page, find the "Mobile Phone Number" option and click to enter. 5. At this time, the page will display the current mobile phone number, click "Change Mobile Number". 6. Enter the new mobile phone number, receive the verification code, and fill it out. 7. Set a new password to ensure account security. 8. After completing the above steps,

HQL and SQL are compared in the Hibernate framework: HQL (1. Object-oriented syntax, 2. Database-independent queries, 3. Type safety), while SQL directly operates the database (1. Database-independent standards, 2. Complex executable queries and data manipulation).

The Win11 system administrator has blocked you from running this application. When using the Windows 11 operating system, you may encounter a common problem, that is, the system administrator has blocked you from running an application. This can be confusing and frustrating because you may need to run this application to get work done or enjoy entertainment. However, don't worry, there is usually a solution to this problem. First, we need to understand why this problem occurs. The Windows 11 operating system has higher security and privacy protection measures. In order to prevent malware or viruses from running, system administrators may restrict the running permissions of certain applications. This is to protect the security of your computer and personal information. However, sometimes system administrators may

As a platform that integrates community, content and e-commerce, Xiaohongshu has attracted the attention of many creators and users. Some users want to have two Xiaohongshu accounts to better manage and operate different types of content. This article will explore how to create two Xiaohongshu accounts and explore the potential benefits of this approach for creators. 1. How to have two Xiaohongshu accounts? Registering a new account is very simple. Just download the Xiaohongshu APP from the mobile app store, then fill in the relevant information according to the prompts and set the nickname, avatar and password. 2. Log in to the original account: After registering a new account, you need to log out of the Xiaohongshu APP and then log in to your original account again. 3. Switch accounts: In the Xiaohongshu APP, click "My" in the lower right corner, then click the avatar and select "

What should I do if my Kuaishou account is activated abnormally? If your Kuaishou account is abnormal and needs to be activated, you can try the following steps to solve the problem: Try to log in again: First, make sure to log in to your Kuaishou account again with the accurate username and password. Verify the accuracy of the information entered. 2. Check network connection: Make sure your device is connected to the Internet properly. Sometimes, network problems may cause abnormal account login. 3. Check account status: If your account is banned or frozen by Kuaishou due to violations or other reasons, you need to contact Kuaishou's customer support department to solve the problem. They may require you to provide identity verification or other information to activate your account. 4. Verification code or mobile phone verification: Kuaishou may require you to conduct mobile phone verification or enter a verification code to ensure the security of your account.
