Pull v1.0.10.1 from a.m.o.; change to MIT license

- Pull v1.0.10.1 from a.m.o.  Source files here included as-is.

 - Change to MIT license.  Closes #6.
This commit is contained in:
nullius 2018-01-07 04:42:39 +00:00
parent ee528226a8
commit c50bfa5f85
No known key found for this signature in database
GPG Key ID: C42793159F9EF949
10 changed files with 193 additions and 56 deletions

View File

@ -1,11 +1,21 @@
[Original license](https://addons.mozilla.org/en-US/firefox/addon/block-cloudflare-mitm-attack/license/1.0.0):
# MIT License
# Block Cloudflare MiTM Attack 1.0.0
# Source Code License
# WTFPL
Copyright (c) 20172018 cypherpunk, nullius. All rights reserved.
WTFPL
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
---
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Any modifications by nullius <nullius@nym.zone> are released to the public domain. Copyright is irrevocably disclaimed on behalf of self, heirs, assigns, etc., etc. In other words, NO LICENSE! The public domain is not a license. I politely request that derivative works either stay in the public domain, or keep a liberal license.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

21
src/LICENSE.txt Normal file
View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 cypherpunk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

52
src/META-INF/manifest.mf Normal file
View File

@ -0,0 +1,52 @@
Manifest-Version: 1.0
Name: LICENSE.txt
Digest-Algorithms: MD5 SHA1
MD5-Digest: qXb1tNEEzwKzeshtJ1M/kQ==
SHA1-Digest: 03detz1pRNQMPN5Zzrp9QUFgEzI=
Name: manifest.json
Digest-Algorithms: MD5 SHA1
MD5-Digest: QnJYk5CRbNCObYHSeZVH6g==
SHA1-Digest: jHusL8aDzwijyyieVxDd93fXaPA=
Name: setwhitelist.html
Digest-Algorithms: MD5 SHA1
MD5-Digest: fm+fbvhq6VT6zFDMVOqj0g==
SHA1-Digest: xO/+NXtU9pseGAziYa0dpLb2nKc=
Name: setwhitelist.js
Digest-Algorithms: MD5 SHA1
MD5-Digest: 5SSypsVZZWyJmmISP3hQIQ==
SHA1-Digest: 3r0rOXaShtVuuvJktGoEIEcj584=
Name: stop_cf_mitm.js
Digest-Algorithms: MD5 SHA1
MD5-Digest: Aou+XD559L8hukeSmmQ+Zw==
SHA1-Digest: hP9OxIjetlG8v+eU1467GVlY1UI=
Name: style.css
Digest-Algorithms: MD5 SHA1
MD5-Digest: qVs2pHeT+noWZ7sQttO/2Q==
SHA1-Digest: TgXktEJyUNImPTbaPF/viYfWcQo=
Name: icons/icon-16.png
Digest-Algorithms: MD5 SHA1
MD5-Digest: BMpS9q28ylgmlebPGO0HBw==
SHA1-Digest: ejT7934OdR+CRbKWJFoXPSvAo7M=
Name: icons/icon-32.png
Digest-Algorithms: MD5 SHA1
MD5-Digest: DPnYcEZnUZa6voVAI6nm0w==
SHA1-Digest: CqFkcPOpoKmq7Ly82vbmq/Ouhzs=
Name: icons/icon-48.png
Digest-Algorithms: MD5 SHA1
MD5-Digest: PVwvbCCjWU+2fJeaUrrwVA==
SHA1-Digest: upats+fdmYeFmAtgvIVwaW8mszA=
Name: icons/icon-64.png
Digest-Algorithms: MD5 SHA1
MD5-Digest: YVzojmSoYwjhM0m20OOk5A==
SHA1-Digest: sa4ES4gA5mSb0cu9UgGpp/2eh84=

BIN
src/META-INF/mozilla.rsa Normal file

Binary file not shown.

4
src/META-INF/mozilla.sf Normal file
View File

@ -0,0 +1,4 @@
Signature-Version: 1.0
MD5-Digest-Manifest: tYmdW52ce4gr/US0LpdDmA==
SHA1-Digest-Manifest: LIm4Ypuvhp+utHM2FncxT2GvyaE=

View File

@ -2,9 +2,9 @@
"manifest_version": 2,
"name": "Block Cloudflare MiTM Attack",
"description": "If the destination website use Cloudflare, block further request.",
"version": "1.0.8.6",
"version": "1.0.10.1",
"homepage_url": "https://trac.torproject.org/projects/tor/ticket/24351",
"permissions": ["webRequest","webRequestBlocking","<all_urls>","storage","activeTab"],
"permissions": ["webRequest","webRequestBlocking","<all_urls>","storage","activeTab","tabs"],
"options_ui": {
"page": "setwhitelist.html",
"browser_style": false

View File

@ -2,19 +2,23 @@
[Whitelist]<br>
1. Add FQDN or .FQDN you want to ignore. Click "Save".<br>
2. Open new tab and visit whitelisted website.<br>
<small>(<i><b>.</b>mozilla.org</i> will allow <i>mozilla.org</i> and <i>*.mozilla.org</i>)</small>
<small>(<i><b>.</b>mozilla.org</i> will allow <i>mozilla.org</i> and <i>*.mozilla.org</i>)</small><br>
<textarea cols="50" rows="12" id="myset_cfwhite" wrap="off"></textarea><br>
<label><input type="checkbox" id="myset_xautoclean"> Auto-remove whitelisted domain if it is no longer use MITM services</label><br><small>(Add-on will notify you)</small><br>
<br>
[Advanced]<br>
<label><input type="checkbox" id="myset_xincapsula"> Also detect and block Incapsula MiTM</label><br>
<label><input type="checkbox" id="myset_xgshield"> Also detect and block Google's Project Shield MiTM</label><br>
<label><input type="checkbox" id="myset_xsucuri"> Also detect and block Sucuri MiTM</label><br>
<label><input type="checkbox" id="myset_xign3p"> Ignore 3rd party resource (not recommend)</label><br>
<label><input type="checkbox" id="myset_xwhitemark"> Change whitelisted website's title, favicon, and website border</label><br>
<label><input type="checkbox" checked disabled> I don't like Man-in-the-middle attack.</label><br><!-- justajokedonttakethisseriouslyLOL //-->
<br>
Also detect:<br>
<label><input type="checkbox" id="myset_xincapsula"> Incapsula MiTM</label><br>
<label><input type="checkbox" id="myset_xgshield"> Google's Project Shield MiTM</label><br>
<label><input type="checkbox" id="myset_xsucuri"> Sucuri MiTM</label><br>
<br>
When MiTM attempt is detected:<br>
<label><input type="radio" name="acttype" id="myset_xsimplewarn_0" value="0"> Show security warning page</label><br>
<label><input type="radio" name="acttype" id="myset_xsimplewarn_1" value="1"> Just change title and favicon</label><br>
<label><input type="radio" name="acttype" id="myset_xsimplewarn_1" value="1"> Just change title, favicon, and website border</label><br>
<label><input type="radio" name="acttype" id="myset_xsimplewarn_2" value="2"> Cancel request immediately</label><br>
<br>
<input type="submit" value=" Save ">

View File

@ -17,10 +17,12 @@ browser.storage.local.set({myset_cfwhite: cf_tmpdata});document.querySelector("#
//workaround - simplewarn didn't work as expected if ign3p is active
if (document.querySelector("#myset_xsimplewarn_1").checked){document.querySelector("#myset_xign3p").checked=false;}
//ADVANCED
if (document.querySelector("#myset_xautoclean").checked){browser.storage.local.set({myset_xautoclean: "y"});}else{browser.storage.local.set({myset_xautoclean: "n"});}
if (document.querySelector("#myset_xincapsula").checked){browser.storage.local.set({myset_xincapsula: "y"});}else{browser.storage.local.set({myset_xincapsula: "n"});}
if (document.querySelector("#myset_xgshield").checked){browser.storage.local.set({myset_xgshield: "y"});}else{browser.storage.local.set({myset_xgshield: "n"});}
if (document.querySelector("#myset_xsucuri").checked){browser.storage.local.set({myset_xsucuri: "y"});}else{browser.storage.local.set({myset_xsucuri: "n"});}
if (document.querySelector("#myset_xign3p").checked){browser.storage.local.set({myset_xign3p: "y"});}else{browser.storage.local.set({myset_xign3p: "n"});}
if (document.querySelector("#myset_xwhitemark").checked){browser.storage.local.set({myset_xwhitemark: "y"});}else{browser.storage.local.set({myset_xwhitemark: "n"});}
//ACTION
if (document.querySelector("#myset_xsimplewarn_0").checked){browser.storage.local.set({myset_xsimplewarn:0});}
if (document.querySelector("#myset_xsimplewarn_1").checked){browser.storage.local.set({myset_xsimplewarn:1});}
@ -32,18 +34,19 @@ function setCurrentChoice(r){
//WHITELIST
document.querySelector("#myset_cfwhite").value = r.myset_cfwhite||"";
//ADVANCED
if (r.myset_xautoclean=='y'){document.querySelector("#myset_xautoclean").checked=true;}else{document.querySelector("#myset_xautoclean").checked=false;}
if (r.myset_xincapsula=='y'){document.querySelector("#myset_xincapsula").checked=true;}else{document.querySelector("#myset_xincapsula").checked=false;}
if (r.myset_xgshield=='y'){document.querySelector("#myset_xgshield").checked=true;}else{document.querySelector("#myset_xgshield").checked=false;}
if (r.myset_xsucuri=='y'){document.querySelector("#myset_xsucuri").checked=true;}else{document.querySelector("#myset_xsucuri").checked=false;}
if (r.myset_xign3p=='y'){document.querySelector("#myset_xign3p").checked=true;}else{document.querySelector("#myset_xign3p").checked=false;}
if (r.myset_xwhitemark=='y'){document.querySelector("#myset_xwhitemark").checked=true;}else{document.querySelector("#myset_xwhitemark").checked=false;}
if (r.myset_xsimplewarn){switch(r.myset_xsimplewarn){
case 1:document.querySelector("#myset_xsimplewarn_1").checked=true;break;
case 2:document.querySelector("#myset_xsimplewarn_2").checked=true;break;
default:document.querySelector("#myset_xsimplewarn_0").checked=true;break;
}}else{document.querySelector("#myset_xsimplewarn_0").checked=true;}
}
var getting=browser.storage.local.get();
getting.then(setCurrentChoice, onError);
var getting=browser.storage.local.get();getting.then(setCurrentChoice,onError);
}
document.addEventListener("DOMContentLoaded", loadWhitelist);
document.querySelector("form").addEventListener("submit", saveWhitelist);

File diff suppressed because one or more lines are too long