");
+ res.send(default_template.replace('{{ content }}', template));
+ } else{
+ template = template.replace("{{ neutral.urlscreenshot }}", " Screenshot could not be displayed");
+ }
+ })
+ }
+ });
+
+ if ('Google_SafeBrowsing_API_Key' in config && config.Google_SafeBrowsing_API_Key && domainpage != 'undefined') {
+ var options = {
+ uri: 'https://safebrowsing.googleapis.com/v4/threatMatches:find?key=' + config.Google_SafeBrowsing_API_Key,
+ method: 'POST',
+ json: {
+ client: {
+ clientId: "Ethereum Scam Database",
+ clientVersion: "1.0.0"
+ },
+ threatInfo: {
+ threatTypes: ["THREAT_TYPE_UNSPECIFIED", "MALWARE", "SOCIAL_ENGINEERING", "UNWANTED_SOFTWARE", "POTENTIALLY_HARMFUL_APPLICATION"],
+ platformTypes: ["ANY_PLATFORM"],
+ threatEntryTypes: ["THREAT_ENTRY_TYPE_UNSPECIFIED", "URL", "EXECUTABLE"],
+ threatEntries: [{
+ "url": domainpage
+ }]
+ }
+ }
+ };
+ request(options, function(error, response, body) {
+ if (!error && response.statusCode == 200) {
+ if ('matches' in body && 0 in body.matches) {
+ template = template.replace("{{ neutral.googlethreat }}", "Blocked for " + body.matches[0]['threatType'] + '');
+ } else {
+ template = template.replace("{{ neutral.googlethreat }}", "Not Blocked");
+ }
+ } else {
+ template = template.replace("{{ neutral.googlethreat }}", " Could not pull data from Google SafeBrowsing");
+ }
+ });
+ } else {
+ template = template.replace("{{ neutral.googlethreat }}", " Could not pull data from Google SafeBrowsing");
+ console.log("Warning: No Google Safe Browsing API key found");
+ }
+ if ('VirusTotal_API_Key' in config && config.VirusTotal_API_Key && domainpage != 'undefined') {
+ var options = {
+ uri: 'https://www.virustotal.com/vtapi/v2/url/report?apikey=' + config.VirusTotal_API_Key + '&resource=http://' + domainpage,
+ method: 'GET',
+ };
+ request(options, function(error, response, body) {
+ if (!error && response.statusCode == 200) {
+ body = JSON.parse(body);
+ if(body.response_code != 0){
+ if (body.positives == 0) {
+ template = template.replace("{{ neutral.virustotal }}", " " + body.positives + ' / ' + body.total + '');
+ } else {
+ template = template.replace("{{ neutral.virustotal }}", " " + body.positives + ' / ' + body.total + " ");
+ }
+ if (body.scans.Phishtank.result == "clean site"){
+ template = template.replace("{{ neutral.phishtank }}", " " + "Clean Site" + '');
+ } else if(body.scans.Phishtank.result == "phishing site"){
+ template = template.replace("{{ neutral.phishtank }}", " " + "Phishing Site"+ '');
+ } else{
+ template = template.replace("{{ neutral.phishtank }}", " " + body.scans.Phishtank.result + '');
+ }
+ } else{
+ template = template.replace("{{ neutral.virustotal }}", " Could not pull data from VirusTotal");
+ template = template.replace("{{ neutral.phishtank }}", " Could not pull data from Phishtank");
+ }
+ } else {
+ template = template.replace("{{ neutral.virustotal }}", " Could not pull data from VirusTotal");
+ template = template.replace("{{ neutral.phishtank }}", " Could not pull data from Phishtank");
+ }
+ template = template.replace("{{ page.built }}", '
This page was built in ' + ((new Date()).getTime() - startTime) + 'ms, and last updated at ' + dateFormat(getCache().updated, "UTC:mmm dd yyyy, HH:MM") + ' UTC
');
+ });
+ } else {
+ template = template.replace("{{ neutral.virustotal }}", " Could not pull data from VirusTotal");
+ template = template.replace("{{ neutral.phishtank }}", " Could not pull data from Phishtank");
+ template = template.replace("{{ page.built }}", '
This page was built in ' + ((new Date()).getTime() - startTime) + 'ms, and last updated at ' + dateFormat(getCache().updated, "UTC:mmm dd yyyy, HH:MM") + ' UTC
');
+ } else {
+ template = template.replace("{{ verified.addresses }}", '');
+ }
+ if ('url' in verified) {
+ template = template.replace("{{ verified.url }}", 'URL: ' + verified.url + ' ');
+ } else {
+ template = template.replace("{{ verified.url }}", '');
+ }
+ if ('Google_SafeBrowsing_API_Key' in config && config.Google_SafeBrowsing_API_Key && domainpage != 'undefined') {
+ var options = {
+ uri: 'https://safebrowsing.googleapis.com/v4/threatMatches:find?key=' + config.Google_SafeBrowsing_API_Key,
+ method: 'POST',
+ json: {
+ client: {
+ clientId: "Ethereum Scam Database",
+ clientVersion: "1.0.0"
+ },
+ threatInfo: {
+ threatTypes: ["THREAT_TYPE_UNSPECIFIED", "MALWARE", "SOCIAL_ENGINEERING", "UNWANTED_SOFTWARE", "POTENTIALLY_HARMFUL_APPLICATION"],
+ platformTypes: ["ANY_PLATFORM"],
+ threatEntryTypes: ["THREAT_ENTRY_TYPE_UNSPECIFIED", "URL", "EXECUTABLE"],
+ threatEntries: [{
+ "url": domainpage
+ }]
+ }
+ }
+ };
+ request(options, function(error, response, body) {
+ if (!error && response.statusCode == 200) {
+ if ('matches' in body && 0 in body.matches) {
+ template = template.replace("{{ verified.googlethreat }}", " Blocked for " + body.matches[0]['threatType'] + '');
+ } else {
+ template = template.replace("{{ verified.googlethreat }}", " Not Blocked");
+ }
+ } else {
+ template = template.replace("{{ verified.googlethreat }}", " Could not pull data from Google SafeBrowsing");
+ }
+ });
+ } else {
+ template = template.replace("{{ verified.googlethreat }}", " Could not pull data from Google SafeBrowsing");
+ console.log("Warning: No Google Safe Browsing API key found");
+ }
+
+ if ('VirusTotal_API_Key' in config && config.VirusTotal_API_Key && domainpage != 'undefined') {
+ var options = {
+ uri: 'https://www.virustotal.com/vtapi/v2/url/report?apikey=' + config.VirusTotal_API_Key + '&resource=http://' + domainpage,
+ method: 'GET',
+ };
+ request(options, function(error, response, body) {
+ if (!error && response.statusCode == 200) {
+ body = JSON.parse(body);
+ if(body.response_code != 0){
+ if (body.positives == 0) {
+ template = template.replace("{{ verified.virustotal }}", " " + body.positives + ' / ' + body.total + '');
+ } else {
+ template = template.replace("{{ verified.virustotal }}", " " + body.positives + ' / ' + body.total + " ");
+ }
+ if (body.scans.Phishtank.result == "clean site"){
+ template = template.replace("{{ verified.phishtank }}", " " + "Clean Site" + '');
+ } else if(body.scans.Phishtank.result == "phishing site"){
+ template = template.replace("{{ verified.phishtank }}", " " + "Phishing Site"+ '');
+ } else{
+ template = template.replace("{{ verified.phishtank }}", " " + body.scans.Phishtank.result + '');
+ }
+ } else{
+ template = template.replace("{{ verified.virustotal }}", " Could not pull data from VirusTotal");
+ template = template.replace("{{ verified.phishtank }}", " Could not pull data from Phishtank");
+ }
+ } else {
+ template = template.replace("{{ verified.virustotal }}", " Could not pull data from VirusTotal");
+ template = template.replace("{{ verified.phishtank }}", " Could not pull data from Phishtank");
+ }
+ template = template.replace("{{ page.built }}", '
This page was built in ' + ((new Date()).getTime() - startTime) + 'ms, and last updated at ' + dateFormat(getCache().updated, "UTC:mmm dd yyyy, HH:MM") + ' UTC
');
+ });
+ } else {
+ template = template.replace("{{ verified.virustotal }}", " Could not pull data from VirusTotal");
+ template = template.replace("{{ verified.phishtank }}", " Could not pull data from Phishtank");
+ template = template.replace("{{ page.built }}", '
This page was built in ' + ((new Date()).getTime() - startTime) + 'ms, and last updated at ' + dateFormat(getCache().updated, "UTC:mmm dd yyyy, HH:MM") + ' UTC
');
+ if ('Google_SafeBrowsing_API_Key' in config && config.Google_SafeBrowsing_API_Key && 'url' in scam) {
+ var options = {
+ uri: 'https://safebrowsing.googleapis.com/v4/threatMatches:find?key=' + config.Google_SafeBrowsing_API_Key,
+ method: 'POST',
+ json: {
+ client: {
+ clientId: "Ethereum Scam Database",
+ clientVersion: "1.0.0"
+ },
+ threatInfo: {
+ threatTypes: ["THREAT_TYPE_UNSPECIFIED", "MALWARE", "SOCIAL_ENGINEERING", "UNWANTED_SOFTWARE", "POTENTIALLY_HARMFUL_APPLICATION"],
+ platformTypes: ["ANY_PLATFORM"],
+ threatEntryTypes: ["THREAT_ENTRY_TYPE_UNSPECIFIED", "URL", "EXECUTABLE"],
+ threatEntries: [{
+ "url": url.parse(scam.url).hostname
+ }]
+ }
+ }
+ };
+ request(options, function(error, response, body) {
+ if (!error && response.statusCode == 200) {
+ if ('matches' in body && 0 in body.matches) {
+ template = template.replace("{{ scam.googlethreat }}", " Blocked for " + body.matches[0]['threatType'] + '');
+ } else {
+ template = template.replace("{{ scam.googlethreat }}", " Not Blocked Yet");
+ }
+ } else {
+ template = template.replace("{{ scam.googlethreat }}", " Could not pull data from Google SafeBrowsing");
+ }
+ });
+ } else {
+ template = template.replace("{{ scam.googlethreat }}", " Could not pull data from Google SafeBrowsing");
+ console.log("Warning: No Google Safe Browsing API key found");
+ }
+ if ('VirusTotal_API_Key' in config && config.VirusTotal_API_Key && domainpage != 'undefined') {
+ var options = {
+ uri: 'https://www.virustotal.com/vtapi/v2/url/report?apikey=' + config.VirusTotal_API_Key + '&resource=http://' + domainpage,
+ method: 'GET',
+ };
+ request(options, function(error, response, body) {
+ if (!error && response.statusCode == 200) {
+ body = JSON.parse(body);
+ if(body.response_code != 0){
+ if (body.positives == 0) {
+ template = template.replace("{{ scam.virustotal }}", " " + body.positives + ' / ' + body.total + '');
+ } else {
+ template = template.replace("{{ scam.virustotal }}", " " + body.positives + ' / ' + body.total + " ");
+ }
+ if (body.scans.Phishtank.result == "clean site"){
+ template = template.replace("{{ scam.phishtank }}", " " + "Clean Site" + '');
+ } else if(body.scans.Phishtank.result == "phishing site"){
+ template = template.replace("{{ scam.phishtank }}", " " + "Phishing Site"+ '');
+ } else{
+ template = template.replace("{{ scam.phishtank }}", " " + body.scans.Phishtank.result + '');
+ }
+ } else{
+ template = template.replace("{{ scam.virustotal }}", " Could not pull data from VirusTotal");
+ template = template.replace("{{ scam.phishtank }}", " Could not pull data from Phishtank");
+ }
+ } else {
+ template = template.replace("{{ scam.virustotal }}", " Could not pull data from VirusTotal");
+ template = template.replace("{{ scam.phishtank }}", " Could not pull data from Phishtank");
+ }
+ template = template.replace("{{ page.built }}", '
This page was built in ' + ((new Date()).getTime() - startTime) + 'ms, and last updated at ' + dateFormat(getCache().updated, "UTC:mmm dd yyyy, HH:MM") + ' UTC
');
+ });
+ } else {
+ template = template.replace("{{ scam.virustotal }}", " Could not pull data from VirusTotal");
+ template = template.replace("{{ scam.phishtank }}", " Could not pull data from Phishtank");
+ template = template.replace("{{ page.built }}", '
This page was built in ' + ((new Date()).getTime() - startTime) + 'ms, and last updated at ' + dateFormat(getCache().updated, "UTC:mmm dd yyyy, HH:MM") + ' UTC