{"action":"created","issue":{"url":"https://api.github.com/repos/evilsocket/bettercap/issues/73","labels_url":"https://api.github.com/repos/evilsocket/bettercap/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/evilsocket/bettercap/issues/73/comments","events_url":"https://api.github.com/repos/evilsocket/bettercap/issues/73/events","html_url":"https://github.com/evilsocket/bettercap/issues/73","id":112809789,"number":73,"title":"HTTP Proxy port redirection not working on OS X 10.6 because it uses \"ipfw\" instead of \"pfctl\"","user":{"login":"kourbou","id":708912,"avatar_url":"https://avatars.githubusercontent.com/u/708912?v=3","gravatar_id":"","url":"https://api.github.com/users/kourbou","html_url":"https://github.com/kourbou","followers_url":"https://api.github.com/users/kourbou/followers","following_url":"https://api.github.com/users/kourbou/following{/other_user}","gists_url":"https://api.github.com/users/kourbou/gists{/gist_id}","starred_url":"https://api.github.com/users/kourbou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kourbou/subscriptions","organizations_url":"https://api.github.com/users/kourbou/orgs","repos_url":"https://api.github.com/users/kourbou/repos","events_url":"https://api.github.com/users/kourbou/events{/privacy}","received_events_url":"https://api.github.com/users/kourbou/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/evilsocket/bettercap/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/evilsocket/bettercap/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-22T14:01:26Z","updated_at":"2015-11-23T16:37:24Z","closed_at":"2015-11-23T16:28:05Z","body":"Hello,\r\nI got bettercap to run flawlessly on OSX 10.6 apart from the port redirection simply because the command \"pfctl\" was introduced in Mac OS X 10.7. I tried fixing this myself by downloading the source code and changing the pfctl command to a the equivalent in ipfw in the firewalls/osx.rb file but to no avail. The target just tries to connect endlessly before running in a timeout.\r\nI changed:\r\n```\r\nconfig_file = \"/tmp/bettercap_pf_#{Process.pid}.conf\"\r\n\r\nFile.open( config_file, 'a+t' ) do |f|\r\n    f.write \"rdr pass on #{iface} proto #{proto} from any to any port #{from} -> #{addr} port #{to}\\n\"\r\n\r\nshell.execute(\"pfctl -f #{config_file} >/dev/null 2>&1\")\r\n```\r\nTo:\r\n```\r\nshell.execute(\"ipfw add fwd #{addr},#{to} #{proto} from any to any #{from}\")\r\n```\r\nFull file at http://gist.github.com/kourbou/af253ddf128777bdf74b\r\nDo you know what I'm doing wrong in the ipfw command?\r\n\r\nOS: Mac OS X 10.6 10.6\r\nRuby: ruby 2.2.3p173 (2015-08-18 revision 51636) [i386-darwin10.0]\r\nLog: \r\n```\r\nname:folder user$ sudo bettercap -X -T 192.168.50.8 -I en1 --proxy --no-discovery --debug\r\n _          _   _\r\n| |__   ___| |_| |_ ___ _ __ ___ __ _ _ __\r\n| '_ \\ / _ \\ __| __/ _ \\ '__/ __/ _` | '_ \\\r\n| |_) |  __/ |_| ||  __/ | | (_| (_| | |_) |\r\n|_.__/ \\___|\\__|\\__\\___|_|  \\___\\__,_| .__/\r\n                                     |_| v1.1.5\r\nhttp://bettercap.org/\r\n\r\n\r\n\r\n\r\n[D] ifconfig en1\r\n[D] OSX ifconfig en1:\r\n[\"en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500\", \"inet 10.0.0.1 netmask 0xff000000 broadcast 10.255.255.255\", \"inet6 fe80::223:8ff:fe53:35b3%en1 prefixlen 64 scopeid 0x4\", \"inet 192.168.50.32 netmask 0xffffff00 broadcast 192.168.50.255\", \"ether 00:23:08:53:35:b3\", \"media: autoselect status: active\", \"supported media: autoselect\"]\r\n[D] NETSTAT:\r\nRouting tables\r\n\r\nInternet:\r\nDestination        Gateway            Flags        Refs      Use   Netif Expire\r\ndefault            192.168.50.1       UGSc           24      526     en1\r\n10                 link#4             UC              0        0     en1\r\n127                127.0.0.1          UCS             0        0     lo0\r\n127.0.0.1          127.0.0.1          UH              1      266     lo0\r\n169.254            link#4             UCS             1        0     en1\r\n192.168.50         link#4             UC              2        0     en1\r\n192.168.50.1       4c:e6:76:ea:5e:bd  UHLWI          33      928     en1   1193\r\n192.168.50.8       9c:d9:17:98:53:27  UHLWI           0      969     en1    189\r\n192.168.50.32      127.0.0.1          UHS             0        1     lo0\r\n\r\nInternet6:\r\nDestination                             Gateway                         Flags         Netif Expire\r\n::1                                     ::1                             UH              lo0\r\nfdd2:d466:9973:228a:223:8ff:fe53:35b3   link#1                          UHL             lo0\r\nfe80::%lo0/64                           fe80::1%lo0                     Uc              lo0\r\nfe80::1%lo0                             link#1                          UHL             lo0\r\nfe80::%en1/64                           link#4                          UC              en1\r\nfe80::223:8ff:fe53:35b3%en1             0:23:8:53:35:b3                 UHL             lo0\r\nfe80::%en0/64                           link#5                          UC              en0\r\nff01::/32                               ::1                             Um              lo0\r\nff02::/32                               ::1                             UmC             lo0\r\nff02::/32                               link#4                          UmC             en1\r\nff02::/32                               link#5                          UmC             en0\r\n\r\n[D] network=192.168.50.0 gateway=192.168.50.1 local_ip=192.168.50.32\r\n[D] IFCONFIG: {:iface=>\"en1\", :ip_saddr=>\"192.168.50.32\", :ip_src=>\"\\xC0\\xA82 \", :ip4_obj=>#<IPAddr: IPv4:192.168.50.0/255.255.255.0>, :ip6_saddr=>\"fe80::223:8ff:fe53:35b3\", :ip6_obj=>#<IPAddr: IPv6:fe80:0000:0000:0000:0223:08ff:fe53:35b3/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff>, :eth_saddr=>\"00:23:08:53:35:b3\", :eth_src=>\"\\x00#\\bS5\\xB3\"}\r\n[D] ARP SPOOFER SELECTED\r\n[I] Getting gateway 192.168.50.1 MAC address ...\r\n[I]   Gateway : 192.168.50.1 ( 4c:e6:76:ea:5e:bd )\r\n[I] Starting ARP spoofer ( Full Duplex ) ...\r\n[D] Enabling packet forwarding.\r\n[W] WARNING: Both HTTP transparent proxy and URL parser are enabled, you're gonna see duplicated logs.\r\n[I] Redirecting traffic from port 80 to 192.168.50.32:8080\r\n[I] ARP watcher started ...\r\n[W] Getting target 192.168.50.8 MAC address ...\r\n[D] 00600 fwd 192.168.50.32,8080 tcp from any to any dst-port 80 <--- This is the result from the ipfw execute\r\n[I]   Target MAC    : 9c:d9:17:98:53:27\r\n[D] Preloading hardware vendor prefixes ...\r\n[I] Starting sniffer ...\r\n[I] HTTP Proxy started on 192.168.50.32:8080 ...\r\n[D] Loading parser FTP ...\r\n[D] Loading parser HTTPAUTH ...\r\n[D] Loading parser HTTPS ...\r\n[D] Loading parser IRC ...\r\n[D] Loading parser MAIL ...\r\n[D] Loading parser NTLMSS ...\r\n[D] Loading parser POST ...\r\n[D] Loading parser URL ...\r\n```"},"comment":{"url":"https://api.github.com/repos/evilsocket/bettercap/issues/comments/158989754","html_url":"https://github.com/evilsocket/bettercap/issues/73#issuecomment-158989754","issue_url":"https://api.github.com/repos/evilsocket/bettercap/issues/73","id":158989754,"user":{"login":"kourbou","id":708912,"avatar_url":"https://avatars.githubusercontent.com/u/708912?v=3","gravatar_id":"","url":"https://api.github.com/users/kourbou","html_url":"https://github.com/kourbou","followers_url":"https://api.github.com/users/kourbou/followers","following_url":"https://api.github.com/users/kourbou/following{/other_user}","gists_url":"https://api.github.com/users/kourbou/gists{/gist_id}","starred_url":"https://api.github.com/users/kourbou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kourbou/subscriptions","organizations_url":"https://api.github.com/users/kourbou/orgs","repos_url":"https://api.github.com/users/kourbou/repos","events_url":"https://api.github.com/users/kourbou/events{/privacy}","received_events_url":"https://api.github.com/users/kourbou/received_events","type":"User","site_admin":false},"created_at":"2015-11-23T16:37:24Z","updated_at":"2015-11-23T16:37:24Z","body":"lol Hackintosh. Can't update. :P"}}