Pivoting to Other Networks | 197




Download 22,59 Mb.
Pdf ko'rish
bet182/225
Sana14.05.2024
Hajmi22,59 Mb.
#232856
1   ...   178   179   180   181   182   183   184   185   ...   225
Bog'liq
learningkalilinux

Pivoting to Other Networks | 197


Hardware MAC : 00:00:00:00:00:00
IPv4 Address : 192.168.86.47
IPv4 Netmask : 255.255.255.0
IPv6 Address : fe80::20c:29ff:fefa:dd2a
IPv6 Netmask : ::
meterpreter > run autoroute -s 192.168.2.0/24
[
!
]
Meterpreter scripts are deprecated. Try post/multi/manage/autoroute.
[
!
]
Example: run post/multi/manage/autoroute 
OPTION
=
value 
[
...
]
[
*
]
Adding a route to 192.168.2.0/255.255.255.0...
[
+
]
Added route to 192.168.2.0/255.255.255.0 via 192.168.86.47
[
*
]
Use the -p option to list all active routes
meterpreter > run autoroute -p
[
!
]
Meterpreter scripts are deprecated. Try post/multi/manage/autoroute.
[
!
]
Example: run post/multi/manage/autoroute 
OPTION
=
value 
[
...
]
Active Routing 
Table
====================
Subnet Netmask Gateway
------ ------- -------
192.168.2.0 255.255.255.0 Session 1
After setting the route, you can run autoroute again to print out the routing table.
This shows us that the route is using Session 1 as a gateway. What you can do from
here is background the session using Ctrl-Z. You can then run other modules against
the network you have set a route to. Once you’ve dropped back to Metasploit, you can
show the routing table, as you can see in 
Example 6-20
. This shows that the route is
in place to be used from 
msfconsole
and other modules, outside the Meterpreter ses‐
sion directly.
Example 6-20. Route table from msfconsole
meterpreter >
Background session 1? 
[
y/N
]
y
msf exploit
(
multi/misc/java_rmi_server
)
> route
IPv4 Active Routing 
Table
=========================
Subnet Netmask Gateway
------ ------- -------
192.168.2.0 255.255.255.0 Session 1
Metasploit takes care of all of the work of directing traffic appropriately. If the system
you have compromised has multiple interfaces, you can set routes to all of the net‐

Download 22,59 Mb.
1   ...   178   179   180   181   182   183   184   185   ...   225




Download 22,59 Mb.
Pdf ko'rish