I have an attack scenario, first I send a malicious pdf to my victim, then I have a reverse tcp shell (Meterpreter session) on his computer then I want to exploit a samba server (which is already exploitable) on my victim network which is not accessible from outside, on this part can I use metasploit to exploit that server from inside of my first victim computer? (all of these computers are in my lab and under control of myself)
Certainly. If you are using a Metasploit module for the exploit you simply need to add a
route. Background your Meterpreter session and type
route -h it will help you, but basically you just need to add
route 192.168.1.0/24 1. The 1 at the end being the session ID number for which you want to route traffic (the exploit module) over and to whichever network you want. In this case I'm specifying the 192.168.1.0/24 range.
quickly state that I don't have an answer in regards to metasploit, but I think your scenario has similarities to this attack shown here: https://vimeo.com/11213607
basically from your first shell, create another reverse ssh tunnel which redirect a port on the samba server back to your attacking machine. ?