The metasploit autoroute function is not working. It’s giving me an error that it’s deprecated.
[!] Meterpreter scripts are deprecated. Try post/multi/manage/autoroute.
[!] Example: run post/multi/manage/autoroute OPTION=value [...]
[-] Could not execute autoroute: ArgumentError wrong number of arguments (given 2, expected 0..1)
newer version of metasploit doesn’t support metasploit scripts. hence the autoroute script wont work.
You should use the post/multi/manage/autoroute module to achieve the same objective.
Same error as above. I did route in the meterpreter shell.
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 172.16.37.1 0.0.0.0 UG 0 0 0 ens192
link-local * 255.255.0.0 U 1000 0 0 ens192
172.16.37.0 * 255.255.255.0 U 0 0 0 ens192
172.16.50.0 * 255.255.255.0 U 0 0 0 ens224
Autoroute has the netmask option, so adding /24 to the IP it’s not necessary and will probably cause errors.
I’d migrate to a different payload than php if you want to autoroute via a meterpreter session as they are less prone to errors. For example; upload a .elf meterpreter payload and execute it on the target host.
RTNETLINK answers: File exists means you already have the route configured in your host. However, this won’t work if you want to pivot through this host as it’s not a router. You’d need to use auxiliary/server/socks_proxy metasploit module and proxychains.
You need to background your session and add a route in msfconsole.
route add x.x.x.0 255.255.255.0 1 (this is the session you want this to add to)
route list
You should see the route now.
Then go back into your session by:
sessions -i 1
Should work. Here is a video I was able to find explaining this. The video is a bit long but at 4-5 minutes is the explanation.
In which lab/blackbox is this? I did not see it yet… Okay the
ip route add ROUTETO via ROUTEFROM
command I saw, but nothing (yet) with metasploit or with pivoting from a machine to another in the eJPT course.
So I am wondering where I can practice this part.