This module quickly fires up a web server that serves a payload. The
provided command will start the specified scripting language
interpreter and then download and execute the payload. The main
purpose of this module is to quickly establish a session on a target
machine when the attacker has to manually type in the command
himself, e.g. Command Injection, RDP Session, Local Access or maybe
Remote Command Exec. This attack vector does not write to disk so it
is less likely to trigger AV solutions and will allow privilege
escalations supplied by Meterpreter. When using either of the PSH
targets, ensure the payload architecture matches the target computer
or use SYSWOW64 powershell.exe to execute x86 payloads on x64
machines.

This time we use a PHP script we execute on the client machine with a Reverse TCP Payload we spawn a Meterpreter Shell.

This videos Exploits a weakness by staying in Memory and therefore bypassing av (antivirus) detection.
Hacking can be considered an illegal crime so makes your staying with in the law when running tests.

This video is purely for educational purposes as a Proof of Concept.
I do not condone or recommend attempting any of the techniques in this video on any network or part of
any network you do not have 100% written consent to do so on. I hold no responsibility for any loss of service,
corruption or loss of data due to following the steps in this video.

source