0
I want to convert some linux commands into OSX. (Mavericks 10.9.4)
root@bt:/# /etc/init.d/apache2 start (will "sudo apachectl start" do the same?)
root@bt:/# echo “some Site Goes Here!” > /var/www/index.html
Now I have a site that I host on my macbook local host (8080). So would echo localhost:8080 > /var/www/index.html
do the same as above in OSX ?
Next set of cammands I have no idea how to replace in OSX. Please help
root@bt:/# iptables -t nat --flush
root@bt:/# iptables --zero
root@bt:/# iptables -A FORWARD --in-interface eth0 -j ACCEPT
root@bt:/# iptables -t nat --append POSTROUTING --out-interface eth0 -j MASQUERADE
# Forward to our site
root@bt:/# iptables -t nat -A PREROUTING -p tcp --dport 80 --jump DNAT --to-destination <Proxy’s IP>
thanks a lot for clearing up the Apache stuff. I am still a bit confused with the
iptable
stuff. Would you mind walking me though the commands i posted in the question and tell me exactly what they are doing? And what is your command doing ? – sukhvir – 2014-07-21T01:08:26.947The command that I've stated simply redirects all HTTP connections to localhost, nothing else, but I don't know if that's exactly what are you looking for. If possible, describe what you need with those iptables commands. – denisvm – 2014-07-21T01:13:06.383
ok so I am following this tutorial here http://www.arppoisoning.com/demonstrating-an-arp-poisoning-attack/ . I have managed to get everything working uptill step 5 in that tutorial.
PS - how do i reverse your redirection command later on ?
I see, in this case you will really need the redirection. I'll update it there. – denisvm – 2014-07-21T01:26:53.960
would this redirection be different from the one you posted? – sukhvir – 2014-07-21T01:28:21.293
1Just updated the firewall rules. – denisvm – 2014-07-21T01:32:24.987
You are a legend dude. Just a few follow up questions: 1> should i disable the NAT redirections first and then run the firewall commands? 2> should the
PROXY-IP
in the second command be replaced with192.168.0.18:8080
(ip of my macbook hosting the site) ? – sukhvir – 2014-07-21T01:37:34.653If it's running in the same box you can change "PROXY-IP" to "127.0.0.1 port 8080", if another box, "192.168.0.18 port 8080". The command "-F nat" will flush all NAT and redirections rules. There are few apps to manage Mavericks native firewall: IceFloor and Little Snitch. You can get more info on http://www.hanynet.com/icefloor/ http://blog.scottlowe.org/2013/05/15/using-pf-on-os-x-mountain-lion/
– denisvm – 2014-07-21T01:46:37.957could you please check the quotation marks in thr Firewall part of your answer. Seems like you are missing some. Also
echo "nat from !(en1) -> en1
gives me the error :-bash: !: event not found
– sukhvir – 2014-07-21T04:02:17.2671Change the double quotes to single quotes or escape exclamation sign with backslash (
\!
) – denisvm – 2014-07-21T04:08:25.137