Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.
####1. anchor file Create an anchor file somewhere with your redirection rule like:
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 80 -> 127.0.0.1 port 5000
####2. config file Create a config file somewhere to load the anchor file:
rdr-anchor "forwarding"
load anchor "forwarding" from "/path/to/<anchor file>"
####3. test the configuration file
sudo pfctl -vnf /path/to/<config file>
####4. load the configuration file
sudo pfctl -evf /path/to/<config file>