Hack Forums
MSF RHOST Random IP - 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: MSF RHOST Random IP (/showthread.php?tid=6166488)



MSF RHOST Random IP - PingByte1337 - Aug 4, 2021

Hey guys,

is it possible to set Random IP in Metasploit Options like nmap -iR?


RE: MSF RHOST Random IP - Volcan - Aug 4, 2021

(Aug 4, 2021 02:29 AM)1337Ragna Wrote:  Hey guys,

is it possible to set Random IP in Metasploit Options like nmap -iR?

the RHOST should be the ip who will receive the reversed connection so if u put random ip you will not get the reversed tcp connection


RE: MSF RHOST Random IP - PingByte1337 - Aug 4, 2021

(Aug 4, 2021 03:08 AM)Volcan Wrote:  the RHOST should be the ip who will receive the reversed connection so if u put random ip you will not get the reversed tcp connection

for a scanner u dont need a reverse connection...


RE: MSF RHOST Random IP - Volcan - Aug 4, 2021

(Aug 4, 2021 03:26 AM)1337Ragna Wrote:  for a scanner u dont need a reverse connection...

your talking about MSF RHOST and i answer about that not about scanner


RE: MSF RHOST Random IP - Money- - Aug 4, 2021

(Aug 4, 2021 03:08 AM)Volcan Wrote:  the RHOST should be the ip who will receive the reversed connection so if u put random ip you will not get the reversed tcp connection

Isn't LHOST the one you need to receive reverse connection? RHOST is the target where u wana exploit and LHOST to receive shell if target vulnerable.


(Aug 4, 2021 02:29 AM)1337Ragna Wrote:  Hey guys,

is it possible to set Random IP in Metasploit Options like nmap -iR?

I think I have a rough or dumb idea to do it without any googling.

You can write a bash script to generate random IPs with whatever method you want , nmap or whatever.

Then in the bash script you can write a " for loop " on the list of random IPs
and chain them with the MSF command in it example " set RHOST $randomIPs " via the for loop.

then with the bash script write the MSF command into a " .rc " file which can be read via metasploit and execute the full MSF module u wana run.

https://docs.rapid7.com/metasploit/resource-scripts/

Well some coding is needed tho , this is how I automate my MSF scans with the RC file method.

I don't know if MSF have the ability to do it dint google much about it,  but try typing " show advanced " command on the MSF module you are running
to see if there is a settings that allows it.


RE: MSF RHOST Random IP - Volcan - Aug 4, 2021

(Aug 4, 2021 03:55 AM)Money- Wrote:  Isn't LHOST the one you need to receive reverse connection? RHOST is the target where u wana exploit and LHOST to receive shell if target vulnerable.



I think I have a rough or dumb idea to do it without any googling.

You can write a bash script to generate random IPs with whatever method you want , nmap or whatever.

Then in the bash script you can write a " for loop " on the list of random IPs
and chain them with the MSF command in it example " set RHOST $randomIPs " via the for loop.

then with the bash script write the MSF command into a " .rc " file which can be read via metasploit and execute the full MSF module u wana run.

https://docs.rapid7.com/metasploit/resource-scripts/

Well some coding is needed tho , this is how I automate my MSF scans with the RC file method.

I don't know if MSF have the ability to do it dint google much about it,  but try typing " show advanced " command on the MSF module you are running
to see if there is a settings that allows it.

100% true i mixed things up 😁 thanks for correcting me


RE: MSF RHOST Random IP - PingByte1337 - Aug 4, 2021

If i use an exploit i need a lhost of course but not for scan plugin.....

[Image: Unbenannt.png]

Okay, best way is script or with nmap export


RE: MSF RHOST Random IP - Money- - Aug 4, 2021

(Aug 4, 2021 07:18 AM)1337Ragna Wrote:  If i use an exploit i need a lhost of course but not for scan plugin.....

[Image: Unbenannt.png]

Okay, best way is script or with nmap export

How does nmap export works? Export nmap xml results and import into MSF?


RE: MSF RHOST Random IP - PingByte1337 - Aug 4, 2021

(Aug 4, 2021 07:29 AM)Money- Wrote:  How does nmap export works? Export nmap xml results and import into MSF?


Yes, install zenmap then u can export it with gui to csv and in msf u can set rhost the file contains the ips


RE: MSF RHOST Random IP - dangerous0666 - Oct 12, 2021

Volcan is a scammer . Do not trust