2014年2月10日 星期一

[tiny] firefox 跟 google-chrome 跳過擋 port 的限制

Google 跟 firefox 都會針對某些安全上的考量,所以不允許用某些 port 來瀏覽網路。所以像 http://URL:110/ 或 http://URL:21/ 這樣的 URL 都會被擋下來,避免非法的使用。

但是這樣的使用方式,其實在某些 MIS 管的很嚴雞婆的時候,就會造成妨礙。

所以這篇要簡短註記一下, firefox 跟 google-chrome 怎麼跳過這種限制:

firefox 是在 pref.js 底下加入:
user_pref("network.security.ports.banned.override", "110,21"); 

google-chrome 是在 command line 底下加入:
--explicitly-allowed-ports=601

--
2014-02-20 更新:
google-chrome 在 linux 底下啟動 script 的修正有點麻煩,改在 google-chrome.desktop 底下基本上是沒辦法用到 xdg-open 上面的,所以要更新到 /usr/bin/google-chrome 的啟動的 script 裡面去:
--- /usr/bin/google-chrome.old      2014-02-20 10:21:54.072225459 +0800
+++ /usr/bin/google-chrome   2014-02-20 10:21:03.460228563 +0800
@@ -48,5 +48,6 @@
   fi
 fi
 
+EXTRA_OPT="--explicitly-allowed-ports=110,21"
 # Note: exec -a below is a bashism.
-exec -a "$0" "$HERE/chrome" --user-data-dir="${XDG_CONFIG_HOME:-${HOME}/.config}/google-chrome-unstable" "$@"
+exec -a "$0" "$HERE/chrome" --user-data-dir="${XDG_CONFIG_HOME:-${HOME}/.config}/google-chrome-unstable" "$@" $EXTRA_OPT

--
參考資料:
* http://www-archive.mozilla.org/projects/netlib/PortBanning.html
* https://productforums.google.com/forum/#!topic/chrome/wVmm0ZPexbA

沒有留言:

張貼留言