FunnyWolf / Viper

Attack Surface Management & Red Team Simulation Platform 互联网攻击面管理&红队模拟平台
https://www.yuque.com/vipersec
BSD 3-Clause "New" or "Revised" License
3.7k stars 527 forks source link

Problem with loading msf #221

Closed hawaii67 closed 2 months ago

hawaii67 commented 2 months ago

I'm using VIPER for a long time. Really great work. Well, something has changed, since starting the docker image msf worker status is red.

So the problem is here: start-stop-daemon --start --background --quiet --pidfile /root/metasploit-framework/puma.pid --exec /root/.rbenv/shims/puma -- -C /root/metasploit-framework/config/puma_production.rb

Where can I configure the paths since they are different on my box:

/root/metasploit-framework/ /root/.rbenv/shims/puma

Moreover do I have to install puma? Actually I did....but doesn't help

FunnyWolf commented 2 months ago

@hawaii67 do not recommend user start msf manual, if msf status is red, you can try to restart viper container by docker compose down docker compose start. if restart is not work, the most likely reason is redis-server is not start (msf rely on redis-server). I suggest install viper on ubuntu22 or kali rolling (In order to use the updated version of the Linux kernel, Docker Compose and Redis Server require)

hawaii67 commented 2 months ago

Thanks for your reply. I don't start msf manually. I am aware that viper should start it but it doesn't since the paths are not matching for the start-stop-daemon. I restarted viper many times. I installed viper on kali rolling.

FunnyWolf commented 2 months ago

Thanks for your reply. I don't start msf manually. I am aware that viper should start it but it doesn't since the paths are not matching for the start-stop-daemon. I restarted viper many times. I installed viper on kali rolling.

make suer you are using latest viper images , it should work if you use kali rolling. you can use docker exec -it viper-c bash into docker container. check if msf is running by ps -ef | grep puma if puma not runing use cd /root/metasploit-framework thin -c /root/metasploit-framework -l /root/viper/Docker/log/thin.log --rackup /root/metasploit-framework/msf-json-rpc.ru --address 127.0.0.1 --port 60005 --environment production --daemonize --threaded start to start manual.

hawaii67 commented 2 months ago

Sorry mate, this doesn't help. I think you are using harcoded paths, like /root/metasploit-framework/

ps -ef |grep start-stop 

root      480927  480667 99 14:37 ?        00:00:27 start-stop-daemon --start --background --quiet --pidfile /root/metasploit-framework/puma.pid --exec /root/.rbenv/shims/puma -- -C /root/metasploit-framework/config/puma_production.rb

On my Kali rolling box it is /usr/share/metasploit-framework/

Just wondering if anybody else has the same issue..............

FunnyWolf commented 2 months ago

Sorry mate, this doesn't help. I think you are using harcoded paths, like /root/metasploit-framework/

ps -ef |grep start-stop 

root      480927  480667 99 14:37 ?        00:00:27 start-stop-daemon --start --background --quiet --pidfile /root/metasploit-framework/puma.pid --exec /root/.rbenv/shims/puma -- -C /root/metasploit-framework/config/puma_production.rb

On my Kali rolling box it is /usr/share/metasploit-framework/

Just wondering if anybody else has the same issue..............

you should not using vipermsf soucecode to run viper

hawaii67 commented 2 months ago

I do not. I am using docker. This is a bash script I made for updating/starting/stopping VIPER:

#!/bin/bash

if [ "$#" -eq  "0" ];then
        echo 
        echo 
        echo 
        echo "No arugments supplied"
        echo
        echo
        echo "Usage: VIPER <start|stop|update>"
        echo
        echo
        echo
        echo "Exiting...................."
        echo

elif [ $1  == "update" ];then

    cd /root/VIPER              # Viper installation directory

    # stop and update
    docker compose down         # Delete old container

    rm -f ./db/*
    rm -f ./module/*

    docker compose pull

elif [ $1  == "start" ];then

    # start
    cd /root/VIPER              # Viper installation directory
    docker compose up -d

elif [ $1  == "stop" ];then
    #stop 
    cd /root/VIPER              # Viper installation directory
    docker compose down         # Delete old container

fi
FunnyWolf commented 2 months ago

I do not. I am using docker. This is a bash script I made for updating/starting/stopping VIPER:

#!/bin/bash

if [ "$#" -eq  "0" ];then
        echo 
        echo 
        echo 
        echo "No arugments supplied"
        echo
        echo
        echo "Usage: VIPER <start|stop|update>"
        echo
        echo
        echo
        echo "Exiting...................."
        echo

elif [ $1  == "update" ];then

  cd /root/VIPER              # Viper installation directory

  # stop and update
  docker compose down         # Delete old container

  rm -f ./db/*
  rm -f ./module/*

  docker compose pull

elif [ $1  == "start" ];then

  # start
  cd /root/VIPER              # Viper installation directory
  docker compose up -d

elif [ $1  == "stop" ];then
  #stop 
  cd /root/VIPER              # Viper installation directory
  docker compose down         # Delete old container

fi

everything looks good, you have mention /root/metasploit-framework do not exist, after you start docker by docker compose up -d, docker exec -it viper-c bash ls /root/metasploit-framework all vipermsf file should store in this dir

hawaii67 commented 2 months ago

Ok, we are getting closer. Issuing docker exec -it viper-c bash and ls /root/metasploit-framework will show all content - it is there. I wonder why there is this start-stop-daemon processes on bare kali .- outside the docker container! ......please see the picture.

grafik

FunnyWolf commented 2 months ago

Ok, we are getting closer. Issuing docker exec -it viper-c bash and ls /root/metasploit-framework will show all content - it is there. I wonder why there is this start-stop-daemon processes on bare kali .- outside the docker container! ......please see the picture.

grafik

every cmd you run should in docker container, not in kali cmdline. if you want to debug vipermsf, you can use puma or thin, i will close this issus

hawaii67 commented 2 months ago

Ok, just to clear, and inform you, this was my problem:

https://discuss.linuxcontainers.org/t/why-processes-running-inside-the-container-are-visible-outside-the-container-on-host-machine/10832