create account

SQLMAP Part 1 by evil0x00

View this thread on: hive.blogpeakd.comecency.com
· @evil0x00 ·
$0.06
SQLMAP Part 1
### <center>SQLMAP Part 1</center>

<center>![](https://cdn.steemitimages.com/DQmQ2LNT1quvZ4ywpQQicSxtHSf6SnVPqbMQv5BqaT8B4wD/image.png)</center>

放上大佬写的一个流程图

<center>![](https://cdn.steemitimages.com/DQmYBaBMZkS2qDxQy9ttL6vAdG2kfaTnYWmwEGZdkfP2CSr/image.png)</center>


em .... 这篇文章 只写自己注入的一个方式 error-based injection

error-based也有叫做DOUBLE QUERY INJECTION,即双查询注入

### <center><B>Error-based tests - WHERE or HAVING clause</B> </center>

payload 如下:

```
AND (SELECT 2*(IF((SELECT * FROM (SELECT CONCAT('[DELIMITER_START]',(SELECT (ELT([RANDNUM]=[RANDNUM],1))),'[DELIMITER_STOP]','x'))s), 8446744073709551610, 8446744073709551610)))
```


其中  

SELECT (ELT([RANDNUM]=[RANDNUM],1))

会返回NULL 如下:

<center>![](https://cdn.steemitimages.com/DQmVned9DgTG5ocw3DSV9rDYsVuvFMy5atZh2ksm5GHJ3JH/image.png)</center>

```
SELECT CONCAT('[DELIMITER_START]',(SELECT (ELT([RANDNUM]=[RANDNUM],1))),'[DELIMITER_STOP]','x')
```


ELT() 函数使用方法如下: 这张图 能很好地解释了

<center>![](https://cdn.steemitimages.com/DQmdACX4Pwek7jK9vBeF4j93ZdER4oTubE4zM2CUDnckrfD/image.png)</center>


CONCAT() 函数 如下:

```
mysql> SELECT CONCAT(’My’, ‘S’, ‘QL’);

-> ‘MySQL’

```

if() 函数用法如下:

```
if(expr1,expr2,expr3) 
如果 expr1 是TRUE ,则if()的返回值为expr2; 否则返回值则为 expr3。
if() 的返回值为数字值或字符串值,具体情况视其所在语境而定。

```

至于为什么会报错 你只要在mysql中 执行如下命令 就可以就明白了:

select 3 * 8446744073709551610;


```
mysql> select 3 * 8446744073709551610;
ERROR 1690 (22003): BIGINT value is out of range in '(3 * 8446744073709551610)'
mysql>
```
👍  , , , ,
properties (23)
authorevil0x00
permlinksqlmap-part-1
categorycn
json_metadata{"tags":["cn","cn-reader","blog","cn-curation","cn-malaysia"],"image":["https://cdn.steemitimages.com/DQmQ2LNT1quvZ4ywpQQicSxtHSf6SnVPqbMQv5BqaT8B4wD/image.png","https://cdn.steemitimages.com/DQmYBaBMZkS2qDxQy9ttL6vAdG2kfaTnYWmwEGZdkfP2CSr/image.png","https://cdn.steemitimages.com/DQmVned9DgTG5ocw3DSV9rDYsVuvFMy5atZh2ksm5GHJ3JH/image.png","https://cdn.steemitimages.com/DQmdACX4Pwek7jK9vBeF4j93ZdER4oTubE4zM2CUDnckrfD/image.png"],"app":"steemit/0.1","format":"markdown"}
created2018-09-13 09:32:24
last_update2018-09-13 09:32:24
depth0
children3
last_payout2018-09-20 09:32:24
cashout_time1969-12-31 23:59:59
total_payout_value0.050 HBD
curator_payout_value0.005 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,464
author_reputation106,257,240,660
root_title"SQLMAP Part 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,161,462
net_rshares51,293,978,629
author_curate_reward""
vote details (5)
@lynnhua ·
Hi ~ I'm a robot of lynnhua.I just upvoted your post! 
 Please come visit me here: https://steemit.com/@lynnhua 
 Thanks so much~!!
properties (22)
authorlynnhua
permlinkre-sqlmap-part-1-20180913t100040
categorycn
json_metadata"{"app": "piston-lib/0.5.7"}"
created2018-09-13 10:00:42
last_update2018-09-13 10:00:42
depth1
children1
last_payout2018-09-20 10:00:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length133
author_reputation38,886,868,214
root_title"SQLMAP Part 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,163,231
net_rshares0
@evil0x00 ·
$0.05
thanks
👍  ,
properties (23)
authorevil0x00
permlinkre-lynnhua-re-sqlmap-part-1-20180913t100040-20180913t113203039z
categorycn
json_metadata{"tags":["cn"],"app":"steemit/0.1"}
created2018-09-13 11:32:06
last_update2018-09-13 11:32:06
depth2
children0
last_payout2018-09-20 11:32:06
cashout_time1969-12-31 23:59:59
total_payout_value0.035 HBD
curator_payout_value0.010 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6
author_reputation106,257,240,660
root_title"SQLMAP Part 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,169,063
net_rshares42,848,307,230
author_curate_reward""
vote details (2)
@root0x00 ·
$0.05
我们都是脚本小子
👍  ,
properties (23)
authorroot0x00
permlinkre-evil0x00-sqlmap-part-1-20180913t142809478z
categorycn
json_metadata{"tags":["cn"],"app":"steemit/0.1"}
created2018-09-13 14:28:18
last_update2018-09-13 14:28:18
depth1
children0
last_payout2018-09-20 14:28:18
cashout_time1969-12-31 23:59:59
total_payout_value0.043 HBD
curator_payout_value0.002 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length8
author_reputation75,627,896,971
root_title"SQLMAP Part 1"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id71,183,746
net_rshares41,634,908,502
author_curate_reward""
vote details (2)