Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker运行访问不了 #3

Closed
loongst opened this issue May 30, 2023 · 4 comments
Closed

docker运行访问不了 #3

loongst opened this issue May 30, 2023 · 4 comments

Comments

@loongst
Copy link

loongst commented May 30, 2023

image

如图,我是用的1.3版本,运行后访问不成功。安装步骤是:
1、点击下载下载最新发布
2、解压并进入到项目目录下打开操控终端。
3、输入命令,使用docker-compose启动项目,并且导入数据库。
sudo docker-compose up -d
sudo docker exec electricrat-mysql /bin/bash -c 'cd /data && mysqladmin -u root -pAAsd123rdsgA create mycms && mysqladmin -u root -pAAsd123rdsgA create mycms_gbk && mysql -u root -pAAsd123rdsgA -Dmycms < dump-mycms.sql && mysql -u root -pAAsd123rdsgA -Dmycms_gbk < dump-mycms_gbk.sql'

@loongst loongst closed this as completed May 30, 2023
@loongst loongst reopened this May 30, 2023
@loongst
Copy link
Author

loongst commented May 30, 2023

image

@en0th
Copy link
Owner

en0th commented Jun 2, 2023

您好!
我很抱歉现在才看到你问题。我仔细的阅读了你反馈的内容。我看你使用的是192的子网ip,我猜测你应该是使用虚拟机上的docker搭建的。从你提供的docker日志来看Tomcat服务已经启动完毕。

0x00 检查Tomcat容器

您可以尝试使用
curl http://127.0.0.1:12666/ElectricRat/index.html
命令来判断服务是否启动完毕。如下图所示,那么恭喜你已经成功部署了。
image

0x01 检查防护墙

在这种情况下您还无法访问,那么请通过命令:
systemctl status firewalld
检查您的防火墙是否开启,如下图所示,防火墙是开启的。
image
那么你可以使用命令:
systemctl stop firewalld
暂时关闭防火墙,也可以使用:
systemctl disable firewalld
永久关闭防火墙。

0x02 检查代理

如果此时仍然无法访问,那么请检查你是否使用了系统代理或者游览器代理。例如下图:
image
将它通过直接连接的方式进行访问。
如果上述情况任然无法解决您的问题,请继续同我反馈。

0x03 感谢

非常感谢您使用我的靶场,同时也非常感谢您的反馈!

@en0th en0th pinned this issue Jun 2, 2023
@loongst
Copy link
Author

loongst commented Jun 2, 2023

第一个错误通过跳过所以jar包的TLD检查,tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*.jar解决了,但是出现了新问题

貌似时java编译和运行版本不一致
image

我不知道是否只有我遇到了以上问题,如果有时间的话,麻烦复现一下吧。

@en0th
Copy link
Owner

en0th commented Jun 2, 2023

是的,你是对的。我编译时用的Java版本与Tomcat提供的docker版本里预装的Java版本不同。在实际的测试过程中,我可以通过VPS发行版本为CentOS 7尝试部署,部署使用两条命令执行结果均为成功。

(base) [root@VM-20-10-centos ~]# cat /etc/redhat-release 
CentOS Linux release 7.9.2009 (Core)

尽管会出现一些问题,但都可以忽略,测试下来没有程序崩溃的问题。

(base) [root@VM-20-10-centos ElectricRat-docker]# docker-compose up -d
[+] Building 0.0s (0/0)                                                                                                                                                                                                                     
[+] Running 2/2
 ✔ Container electricrat-mysql  Started                                                                                                                                                                                                0.4s 
 ✔ Container electricrat-web    Started                                                                                                                                                                                                0.6s 
(base) [root@VM-20-10-centos ElectricRat-docker]# docker ps -aq
5a60d5eb4760
f292aabd27ef
(base) [root@VM-20-10-centos ElectricRat-docker]# docker ps 
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                               NAMES
5a60d5eb4760        tomcat:latest       "catalina.sh run"        10 seconds ago      Up 8 seconds        0.0.0.0:12666->8080/tcp             electricrat-web
f292aabd27ef        mysql:8.0.25        "docker-entrypoint..."   10 seconds ago      Up 9 seconds        0.0.0.0:3306->3306/tcp, 33060/tcp   electricrat-mysql
(base) [root@VM-20-10-centos ~]# docker exec electricrat-mysql /bin/bash -c 'cd /data && mysqladmin -u root -pAAsd123rdsgA create mycms && mysqladmin -u root -pAAsd123rdsgA create mycms_gbk && mysql -u root -pAAsd123rdsgA -Dmycms < dump-mycms.sql && mysql -u root -pAAsd123rdsgA -Dmycms_gbk < dump-mycms_gbk.sql'
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.
mysql: [Warning] Using a password on the command line interface can be insecure.

log:
image

@en0th en0th closed this as completed Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants