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
Show file tree
Hide file tree
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
Expand Up @@ -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")
Expand Down Expand Up @@ -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: [],
Expand All @@ -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) {
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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"
}
};

Expand All @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions app/includes/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
31 changes: 27 additions & 4 deletions chrome-extension/background/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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: [],
Expand All @@ -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) {
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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"
}
};

Expand All @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions chrome-extension/phishing.html
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 73e5d0a

Please sign in to comment.