iagox86 / dnscat2

BSD 3-Clause "New" or "Revised" License
3.4k stars 599 forks source link

How to fix / solve: dnscat2 server not run on debain 11? #179

Closed mrboxly closed 1 year ago

mrboxly commented 1 year ago

HOW TO FIX/SLOVE:

ruby dnscat2.rb                                                                                                                                                                                                

New window created: 0                                                                                                                                                                                              
Traceback (most recent call last):                                                                                                                                                                                 
        11: from dnscat2.rb:20:in `<main>'                                                                                                                                                                         
        10: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:85:in `require'                                                                                                                     
         9: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:85:in `require'                                                                                                                     
         8: from /opt/dnscat2/server/controller/controller.rb:13:in `<top (required)>'                                                                                                                             
         7: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:85:in `require'                                                                                                                     
         6: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:85:in `require'                                                                                                                     
         5: from /opt/dnscat2/server/controller/session.rb:10:in `<top (required)>'                                                                                                                                
         4: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:85:in `require'                                                                                                                     
         3: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:85:in `require'                                                                                                                     
         2: from /opt/dnscat2/server/controller/encryptor.rb:11:in `<top (required)>'                                                                                                                              
         1: from /usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:85:in `require'                                                                                                                     
/usr/lib/ruby/vendor_ruby/rubygems/core_ext/kernel_require.rb:85:in `require': cannot load such file -- salsa20 (LoadError)   

If you use Debain 11 aka Bullseye or any updated system.

the following step no longer work due to updated ruby!

<snip> Ruby as root

If you're having trouble running Ruby as root, this is what I do to run it the first time: <snip>

$ cd dnscat2/server
$ su
# gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
# \curl -sSL https://get.rvm.io | bash
# source /etc/profile.d/rvm.sh
# rvm install 1.9
# rvm use 1.9
# bundle install
# ruby ./dnscat2.rb

Instead do this:

# <sinp>
# rvm install 3.0.1
# rvm use 3.0.1
# <sinp>

### Install ruby-dev sudo apt-get install ruby-full

NOTE: If you get this messge please be patince and wait: Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine. Official way to install nvm, if you struggle on this steps: Installing RVM