offensive-security / kali-nethunter

The Kali NetHunter Project
https://github.com/offensive-security/kali-nethunter/wiki
3.52k stars 890 forks source link

Error while starting metasploit #1255

Open GetRektBoy724 opened 5 years ago

GetRektBoy724 commented 5 years ago

Device:

OS version (KitKat/Lollipop/Marshmallow/Nougat):

Lollipop

Built from repo (date and build command) or downloaded from website (links):

Output of cat /proc/version in adb shell or NetHunter Terminal:

Issue:

While i start msfconsole Its comes up with this Last login: Mon Feb 11 08:31:08 UTC 2019 on pts/2 Linux kali 3.10.49-4815461 #1 SMP PREEMPT Fri May 22 13:30:31 KST 2015 armv7l

The programs included with the Kali GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright.

Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. root@kali:~# nano

root@kali:~# ls root@kali:~# ls persistance.sh persistance.sh.bak root@kali:~# nano persistance.sh root@kali:~# ls persistance.sh persistance.sh.bak root@kali:~# msfconsole /usr/share/metasploit-framework/lib/msf/core/payload/dalvik.rb:72:in not_after=': bignum too big to convert intolong' (RangeError) from /usr/share/metasploit-framework/lib/msf/core/payload/dalvik.rb:72:in generate_cert' from /usr/share/metasploit-framework/modules/payloads/stagers/android/reverse_tcp.rb:54:ingenerate_jar' from /usr/share/metasploit-framework/lib/msf/core/payload/dalvik.rb:27:in generate' from /usr/share/metasploit-framework/lib/msf/core/payload.rb:200:insize' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:158:in block (2 levels) in recalculate' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:102:ineach_pair' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:102:in block in recalculate' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:98:ineach_pair' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:98:in recalculate' from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:276:inblock in load_modules' from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:273:in each' from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:273:inload_modules' from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:117:in block in load_modules' from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:115:ineach' from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:115:in load_modules' from /usr/share/metasploit-framework/lib/msf/core/module_manager/module_paths.rb:41:inblock in add_module_path' from /usr/share/metasploit-framework/lib/msf/core/module_manager/module_paths.rb:40:in each' from /usr/share/metasploit-framework/lib/msf/core/module_manager/module_paths.rb:40:inadd_module_path' from /usr/share/metasploit-framework/lib/msf/base/simple/framework/module_paths.rb:50:in block in init_module_paths' from /usr/share/metasploit-framework/lib/msf/base/simple/framework/module_paths.rb:49:ineach' from /usr/share/metasploit-framework/lib/msf/base/simple/framework/module_paths.rb:49:in init_module_paths' from /usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:212:ininitialize' from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in new' from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:62:indriver' 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:instart' from /usr/bin/msfconsole:48:in <main> root@kali:~# msfconsole /usr/share/metasploit-framework/lib/msf/core/payload/dalvik.rb:72:innot_after=': bignum too big to convert into long' (RangeError) from /usr/share/metasploit-framework/lib/msf/core/payload/dalvik.rb:72:ingenerate_cert' from /usr/share/metasploit-framework/modules/payloads/stagers/android/reverse_https.rb:64:in generate_jar' from /usr/share/metasploit-framework/lib/msf/core/payload/dalvik.rb:27:ingenerate' from /usr/share/metasploit-framework/lib/msf/core/payload.rb:200:in size' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:158:inblock (2 levels) in recalculate' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:102:in each_pair' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:102:inblock in recalculate' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:98:in each_pair' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:98:inrecalculate' root@kali:~# msfconsole /usr/share/metasploit-framework/lib/msf/core/payload/dalvik.rb:72:in not_after=': bignum too big to convert intolong' (RangeError) from /usr/share/metasploit-framework/lib/msf/core/payload/dalvik.rb:72:in generate_cert' from /usr/share/metasploit-framework/modules/payloads/stagers/android/reverse_https.rb:64:ingenerate_jar' from /usr/share/metasploit-framework/lib/msf/core/payload/dalvik.rb:27:in generate' from /usr/share/metasploit-framework/lib/msf/core/payload.rb:200:insize' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:158:in block (2 levels) in recalculate' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:102:ineach_pair' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:102:in block in recalculate' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:98:ineach_pair' from /usr/share/metasploit-framework/lib/msf/core/payload_set.rb:98:in recalculate' from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:276:inblock in load_modules' from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:273:in each' from /usr/share/metasploit-framework/lib/msf/core/modules/loader/base.rb:273:inload_modules' from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:117:in block in load_modules' from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:115:ineach' from /usr/share/metasploit-framework/lib/msf/core/module_manager/loading.rb:115:in load_modules' from /usr/share/metasploit-framework/lib/msf/core/module_manager/module_paths.rb:41:inblock in add_module_path' from /usr/share/metasploit-framework/lib/msf/core/module_manager/module_paths.rb:40:in each' from /usr/share/metasploit-framework/lib/msf/core/module_manager/module_paths.rb:40:inadd_module_path' from /usr/share/metasploit-framework/lib/msf/base/simple/framework/module_paths.rb:50:in block in init_module_paths' from /usr/share/metasploit-framework/lib/msf/base/simple/framework/module_paths.rb:49:ineach' from /usr/share/metasploit-framework/lib/msf/base/simple/framework/module_paths.rb:49:in init_module_paths' from /usr/share/metasploit-framework/lib/msf/ui/console/driver.rb:212:ininitialize' from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:62:in new' from /usr/share/metasploit-framework/lib/metasploit/framework/command/console.rb:62:indriver' 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:instart' from /usr/bin/msfconsole:48:in `

' root@kali:~#

GetRektBoy724 commented 5 years ago

My metasploit is latest version

5trohm commented 5 years ago

/usr/share/metasploit-framework/lib/msf/core/payload/dalvik.rb:72:in not_after=': bignum too big to convert into long' (RangeError) After trying the install uninstall reinstall foolishness I finally edited the file: /usr/share/metasploit-framework/lib/msf/core/payload/android.rb

I changed the following line:

cert.not_after = cert.not_before + 36002436520 # 20 years (old)

cert.not_after = cert.not_before + 3600243652 # 2 years

i changed the 20 years to 15 and its just working fine