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

Running msfconsole on kali linux giving errors and booting me back to terminal. #18422

Closed
cyph0ne opened this issue Oct 4, 2023 · 6 comments
Closed
Labels

Comments

@cyph0ne
Copy link

cyph0ne commented Oct 4, 2023

Steps to reproduce

How'd you do it?

  1. Run msfconsole

Were you following a specific guide/tutorial or reading documentation?

No

Expected behavior

No errors when loading msfconsole and the ablility to use msfconsole

Current behavior

                                                                                                                                                                                                                                           
┌──(kali㉿kali)-[~]
└─$ msfconsole   
                                                  

MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMM                MMMMMMMMMM
MMMN$                           vMMMM
MMMNl  MMMMM             MMMMM  JMMMM
MMMNl  MMMMMMMN       NMMMMMMM  JMMMM
MMMNl  MMMMMMMMMNmmmNMMMMMMMMM  JMMMM
MMMNI  MMMMMMMMMMMMMMMMMMMMMMM  jMMMM
MMMNI  MMMMMMMMMMMMMMMMMMMMMMM  jMMMM
MMMNI  MMMMM   MMMMMMM   MMMMM  jMMMM
MMMNI  MMMMM   MMMMMMM   MMMMM  jMMMM
MMMNI  MMMNM   MMMMMMM   MMMMM  jMMMM
MMMNI  WMMMM   MMMMMMM   MMMM#  JMMMM
MMMMR  ?MMNM             MMMMM .dMMMM
MMMMNm `?MMM             MMMM` dMMMMM
MMMMMMN  ?MM             MM?  NMMMMMN
MMMMMMMMNe                 JMMMMMNMMM
MMMMMMMMMMNm,            eMMMMMNMMNMM
MMMMNNMNMMMMMNx        MMMMMMNMMNMMNM
MMMMMMMMNMMNMMMMm+..+MMNMMNMNMMNMMNMM
        https://metasploit.com


       =[ metasploit v6.3.31-dev                          ]
+ -- --=[ 2346 exploits - 1220 auxiliary - 413 post       ]
+ -- --=[ 1390 payloads - 46 encoders - 11 nops           ]
+ -- --=[ 9 evasion                                       ]

Metasploit tip: Use help <command> to learn more 
about any command
Metasploit Documentation: https://docs.metasploit.com/

/usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require': stream closed in another thread (IOError)
        from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.11/lib/zeitwerk/kernel.rb:38:in `require'
        from /usr/lib/ruby/vendor_ruby/pry.rb:8:in `<top (required)>'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
        from /usr/share/metasploit-framework/vendor/bundle/ruby/3.1.0/gems/zeitwerk-2.6.11/lib/zeitwerk/kernel.rb:38:in `require'
        from /usr/share/metasploit-framework/lib/rex/ui/text/shell.rb:126:in `run'
        from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:48:in `start'
        from /usr/share/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
        from /usr/bin/msfconsole:23:in `<main>'
                                                                                                                                                                                                                                           
┌──(kali㉿kali)-[~]
└─$ 

Metasploit version

metasploit v6.3.31-dev

Additional Information

I have tried to reinstall metasploit, I have tried apt-get update & upgrade and I have also tried to reinitialise the db but nothing has worked, I checked for antivirus and I have no AV running on my machine.

Metasploit was running fine until one day I tried to use dns_enum and now whenever I try to run msfconsole I just get booted back into standard terminal.

@ghost
Copy link

ghost commented Oct 5, 2023

"You can use the following commands to get Metasploit working again; however, please note that you will lose any exploits or anything you've saved in .msf4. Here are the steps to follow:

  1. sudo apt remove metasploit-framework
    
  2. rm -rf ~/.msf4
    
  3.  sudo apt autoremove
    
  4. sudo apt update
    
  5. sudo apt install metasploit-framework
    
  6.  msfconsole
    

@cyph0ne
Copy link
Author

cyph0ne commented Oct 5, 2023

"You can use the following commands to get Metasploit working again; however, please note that you will lose any exploits or anything you've saved in .msf4. Here are the steps to follow:

1. ```
   sudo apt remove metasploit-framework
   ```

2. ```
   rm -rf ~/.msf4
   ```

3. ```
    sudo apt autoremove
   ```

4. ```
   sudo apt update
   ```

5. ```
   sudo apt install metasploit-framework
   ```

6. ```
    msfconsole
   ```

Thanks! This seems to have fixed things for now, if I run into this issue again I'll just run through these steps again.

Much appreciated!

@sh0ckSec
Copy link

sh0ckSec commented Oct 5, 2023

Hello - I've attempted the following instructions above but unfortunately it did not work I am I am still getting this error:
image

@sh0ckSec
Copy link

sh0ckSec commented Oct 5, 2023

"You can use the following commands to get Metasploit working again; however, please note that you will lose any exploits or anything you've saved in .msf4. Here are the steps to follow:

1. ```
   sudo apt remove metasploit-framework
  1. rm -rf ~/.msf4
    
  2.  sudo apt autoremove
    
  3. sudo apt update
    
  4. sudo apt install metasploit-framework
    
  5.  msfconsole
    

Thanks! This seems to have fixed things for now, if I run into this issue again I'll just run through these steps again.

Much appreciated!

Did you reboot or anything after you performed those steps? Didn't seem to work for me.

@cyph0ne
Copy link
Author

cyph0ne commented Oct 5, 2023

"You can use the following commands to get Metasploit working again; however, please note that you will lose any exploits or anything you've saved in .msf4. Here are the steps to follow:

1. ```
   sudo apt remove metasploit-framework
  1. rm -rf ~/.msf4
    
  2.  sudo apt autoremove
    
  3. sudo apt update
    
  4. sudo apt install metasploit-framework
    
  5.  msfconsole
    

Thanks! This seems to have fixed things for now, if I run into this issue again I'll just run through these steps again.
Much appreciated!

Did you reboot or anything after you performed those steps? Didn't seem to work for me.

The first time I tried this, I got prompted to reboot twice during the process but waited until I had done everything before I reboot, then once I ran msfconsole, it worked, so exited and re-entered msfconsole and got prompted with the exact same error that I had before.

I rebooted my system and input the commands one by one again but after I ran
sudo apt remove metasploit-framework
I then got prompted that a file couldn't be removed as it wasn't empty, so I ran
sudo rm -rf /usr/share/metasploit-framework/config
To remove the file that was giving me the error and then I continued with the rest of the commands in order

The second time around I didn't get prompted to reboot my system, but after I ran all the commands and re-installed Metasploit, I ran msfconsole to see if the installation worked, then rebooted. After reboot I entered and exited msfconsole multiple times to see if I recieved any errors while attempting to enter the Metaspoit console again, and I haven't recieved any errors since.

Hope some of this information can be helpful!

@sh0ckSec
Copy link

sh0ckSec commented Oct 11, 2023

"You can use the following commands to get Metasploit working again; however, please note that you will lose any exploits or anything you've saved in .msf4. Here are the steps to follow:

1. ```
   sudo apt remove metasploit-framework
  1. rm -rf ~/.msf4
    
  2.  sudo apt autoremove
    
  3. sudo apt update
    
  4. sudo apt install metasploit-framework
    
  5.  msfconsole
    

Thanks! This seems to have fixed things for now, if I run into this issue again I'll just run through these steps again.
Much appreciated!

Did you reboot or anything after you performed those steps? Didn't seem to work for me.

The first time I tried this, I got prompted to reboot twice during the process but waited until I had done everything before I reboot, then once I ran msfconsole, it worked, so exited and re-entered msfconsole and got prompted with the exact same error that I had before.

I rebooted my system and input the commands one by one again but after I ran sudo apt remove metasploit-framework I then got prompted that a file couldn't be removed as it wasn't empty, so I ran sudo rm -rf /usr/share/metasploit-framework/config To remove the file that was giving me the error and then I continued with the rest of the commands in order

The second time around I didn't get prompted to reboot my system, but after I ran all the commands and re-installed Metasploit, I ran msfconsole to see if the installation worked, then rebooted. After reboot I entered and exited msfconsole multiple times to see if I recieved any errors while attempting to enter the Metaspoit console again, and I haven't recieved any errors since.

Hope some of this information can be helpful!

Awesome, thanks so much - that worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants