gushmazuko / metasploit_in_termux

Install Metasploit Framework 6 in Termux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] msfconsole tried to open /etc/resolv.conf

Def-Try opened this issue · comments

Important
Do not duplicate, search your issue before creating one!
^^^ There is one issue same as this, but it's marked as completed without solution

Describe the bug
After installation, msfconsole just doesn't start.
Screenshots

Metasploit tip: Use the resource command to run commands from a file
/data/data/com.termux/files/usr/opt/metasploit-framework/lib/net/dns/resolver.rb:1087:in `foreach': No such file or directory @ rb_sysopen - /etc/resolv.conf (Errno::ENOENT)
        from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/net/dns/resolver.rb:1087:in `parse_config_file'
        from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/rex/proto/dns/resolver.rb:67:in `initialize'
        from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/rex/proto/dns/cached_resolver.rb:25:in `initialize'
        from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/msf/ui/console/driver.rb:83:in `new'
        from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/msf/ui/console/driver.rb:83:in `initialize'
        from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/metasploit/framework/command/console.rb:66:in `new'
        from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/metasploit/framework/command/console.rb:66:in `driver'
        from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/metasploit/framework/command/console.rb:54:in `start'
        from /data/data/com.termux/files/usr/opt/metasploit-framework/lib/metasploit/framework/command/base.rb:82:in `start'
        from /data/data/com.termux/files/usr/bin/msfconsole:23:in `<main>'

Smartphone (please complete the following information):

  • Device: Realme C25Y
  • OS: Android 11

Solution (if anyone has this problem too):

cd $PREFIX/opt/metasploit-framework

sed -i '0,/\"\/etc\/resolv.conf\"/s//\"\/data\/data\/com.termux\/files\/usr\/etc\/resolv.conf\"/' $(find . -name 'resolver.rb')

thanks to dedshit for answering that