Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Commit

Permalink
Merge pull request #2113 from tehnlulz/blacklists/phishfort
Browse files Browse the repository at this point in the history
added phishfort blacklist
  • Loading branch information
gamalielhere authored Oct 29, 2018
2 parents c489b51 + 010e38f commit 73e5d0a
Showing 4 changed files with 60 additions and 8 deletions.
33 changes: 29 additions & 4 deletions app/includes/background/extension.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@
localStorage.getItem("iosiro-blacklisted-domains") === null
? getDomains("iosiro")
: checkIfDataIsRecent("iosiro");
localStorage.getItem("phishfort-blacklisted-domains") === null
? getDomains("phishfort")
: checkIfDataIsRecent("phishfort");

localStorage.getItem("409h-whitelisted-domains") === null
? getDomains("409h")
@@ -47,6 +50,15 @@ function querycB(tabs) {
identifer: "iosiro"
};

let phishfort = {
timestamp: 0,
domains: [],
format: "plain",
repo:
"https://raw.githubusercontent.com/phishfort/phishfort-lists/master/blacklists/domains.json",
identifer: "phishfort"
};

let whitelistDef = {
timestamp: 0,
domains: [],
@@ -59,15 +71,20 @@ function querycB(tabs) {
const ealBlacklisted = localStorage.getItem("eal-blacklisted-domains")
? JSON.parse(localStorage.getItem("eal-blacklisted-domains"))
: eal;

const iosiroBlacklisted = localStorage.getItem("iosiro-blacklisted-domains")
? JSON.parse(localStorage.getItem("iosiro-blacklisted-domains"))
: iosiro;

const phishfortBlacklisted = localStorage.getItem("phishfort-blacklisted-domains")
? JSON.parse(localStorage.getItem("phishfort-blacklisted-domains"))
: phishfort;

const whitelisted = localStorage.getItem("409h-whitelisted-domains")
? JSON.parse(localStorage.getItem("409h-whitelisted-domains"))
: whitelistDef;

const allDomains = ealBlacklisted.domains.concat(iosiroBlacklisted.domains);
const allDomains = ealBlacklisted.domains.concat(iosiroBlacklisted.domains).concat(phishfortBlacklisted.domains);
let urlRedirect;
let foundWhitelist = whitelisted.domains.find(dom => {
if (tabs[0] !== undefined) {
@@ -128,7 +145,7 @@ function extractRootDomain(url) {

function checkIfDataIsRecent(str) {
let storedName =
str === "eal" || str === "iosiro"
str === "eal" || str === "iosiro" || str === "phishfort"
? str + "-blacklisted-domains"
: str + "-whitelisted-domains";
let dataObj = JSON.parse(localStorage.getItem(storedName));
@@ -158,6 +175,14 @@ function getDomains(str) {
repo:
"https://raw.githubusercontent.com/iosiro/counter_phishing_blacklist/master/blacklists/domains.json",
identifer: "iosiro"
},
phishfort: {
timestamp: 0,
domains: [],
format: "plain",
repo:
"https://raw.githubusercontent.com/phishfort/phishfort-lists/master/blacklists/domains.json",
identifer: "phishfort"
}
};

@@ -174,10 +199,10 @@ function getDomains(str) {

let newName;

if (str && str !== "" && (str === "eal" || str === "iosiro")) {
if (str && str !== "" && (str === "eal" || str === "iosiro" || str == "phishfort")) {
newName = str + "-blacklisted-domains";
setInStorage(blackListDomains[str], newName);
} else if (str && str !== "" && (str !== "eal" || str !== "iosiro")) {
} else if (str && str !== "" && (str !== "eal" || str !== "iosiro" || str != "phishfort")) {
newName = str + "-whitelisted-domains";
setInStorage(whiteListDomains[str], newName);
} else {
2 changes: 2 additions & 0 deletions app/includes/header.tpl
Original file line number Diff line number Diff line change
@@ -87,6 +87,8 @@
or
<a href="https://kb.myetherwallet.com/migration/moving-from-private-key-to-metamask.html" target="_blank" rel="noopener noreferrer">MetaMask</a>
or
<a href="https://chrome.google.com/webstore/detail/phishfort-protect/bdiohckpogchppdldbckcdjlklanhkfc" target="_blank" rel="noopener noreferrer">PhishFort</a>
or
<a href="https://chrome.google.com/webstore/detail/cryptonite-by-metacert/keghdcpemohlojlglbiegihkljkgnige" target="_blank" rel="noopener noreferrer">Cryptonite</a>
</span>
</div>
31 changes: 27 additions & 4 deletions chrome-extension/background/extension.js
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@
localStorage.getItem("iosiro-blacklisted-domains") === null
? getDomains("iosiro")
: checkIfDataIsRecent("iosiro");
localStorage.getItem("phishfort-blacklisted-domains") === null
? getDomains("phishfort")
: checkIfDataIsRecent("phishfort");

localStorage.getItem("409h-whitelisted-domains") === null
? getDomains("409h")
@@ -47,6 +50,15 @@ function querycB(tabs) {
identifer: "iosiro"
};

let phishfort = {
timestamp: 0,
domains: [],
format: "plain",
repo:
"https://raw.githubusercontent.com/phishfort/phishfort-lists/master/blacklists/domains.json",
identifer: "phishfort"
};

let whitelistDef = {
timestamp: 0,
domains: [],
@@ -62,12 +74,15 @@ function querycB(tabs) {
const iosiroBlacklisted = localStorage.getItem("iosiro-blacklisted-domains")
? JSON.parse(localStorage.getItem("iosiro-blacklisted-domains"))
: iosiro;
const phishfortBlacklisted = localStorage.getItem("phishfort-blacklisted-domains")
? JSON.parse(localStorage.getItem("phishfort-blacklisted-domains"))
: phishfort;

const whitelisted = localStorage.getItem("409h-whitelisted-domains")
? JSON.parse(localStorage.getItem("409h-whitelisted-domains"))
: whitelistDef;

const allDomains = ealBlacklisted.domains.concat(iosiroBlacklisted.domains);
const allDomains = ealBlacklisted.domains.concat(iosiroBlacklisted.domains).concat(phishfortBlacklisted.domains);
let urlRedirect;
let foundWhitelist = whitelisted.domains.find(dom => {
if (tabs[0] !== undefined) {
@@ -128,7 +143,7 @@ function extractRootDomain(url) {

function checkIfDataIsRecent(str) {
let storedName =
str === "eal" || str === "iosiro"
str === "eal" || str === "iosiro" || str === "phishfort"
? str + "-blacklisted-domains"
: str + "-whitelisted-domains";
let dataObj = JSON.parse(localStorage.getItem(storedName));
@@ -158,6 +173,14 @@ function getDomains(str) {
repo:
"https://raw.githubusercontent.com/iosiro/counter_phishing_blacklist/master/blacklists/domains.json",
identifer: "iosiro"
},
phishfort: {
timestamp: 0,
domains: [],
format: "plain",
repo:
"https://raw.githubusercontent.com/phishfort/phishfort-lists/master/blacklists/domains.json",
identifer: "phishfort"
}
};

@@ -174,10 +197,10 @@ function getDomains(str) {

let newName;

if (str && str !== "" && (str === "eal" || str === "iosiro")) {
if (str && str !== "" && (str === "eal" || str === "iosiro" || str === "phishfort")) {
newName = str + "-blacklisted-domains";
setInStorage(blackListDomains[str], newName);
} else if (str && str !== "" && (str !== "eal" || str !== "iosiro")) {
} else if (str && str !== "" && (str !== "eal" || str !== "iosiro" || str !== "phishfort")) {
newName = str + "-whitelisted-domains";
setInStorage(whiteListDomains[str], newName);
} else {
2 changes: 2 additions & 0 deletions chrome-extension/phishing.html
Original file line number Diff line number Diff line change
@@ -87,6 +87,8 @@
or
<a href="https://kb.myetherwallet.com/migration/moving-from-private-key-to-metamask.html" target="_blank" rel="noopener noreferrer">MetaMask</a>
or
<a href="https://chrome.google.com/webstore/detail/phishfort-protect/bdiohckpogchppdldbckcdjlklanhkfc" target="_blank" rel="noopener noreferrer">PhishFort</a>
or
<a href="https://chrome.google.com/webstore/detail/cryptonite-by-metacert/keghdcpemohlojlglbiegihkljkgnige" target="_blank" rel="noopener noreferrer">Cryptonite</a>
</span>
</div>

0 comments on commit 73e5d0a

Please sign in to comment.