Skip to content

Commit

Permalink
dec01 patch
Browse files Browse the repository at this point in the history
  • Loading branch information
409H committed Jan 17, 2019
1 parent 2b51a4f commit 9813304
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions _utils/webcheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ const request = require('request')
class web {
lookup (input) {
return new Promise(function(resolve, reject) {
var result = request('https://urlscan.io/api/v1/search/?q=domain%3A' + input,
{timeout: 30*1000}, function(e, response, body) {
var result = request('https://urlscan.io/api/v1/search/?q=domain:' + encodeURIComponent(input),{timeout: 30*1000}, function(e, response, body) {
if(e || !([200, 301, 302].includes(response.statusCode))) {
resolve(e)
}
Expand Down
6 changes: 3 additions & 3 deletions run.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ function startWebServer() {
template = template.replace("{{ verified.urlscan }}", "<b>Urlscan Scan Results</b>: {{ verified.urlscan }}<BR>");
template = template.replace("{{ verified.urlscreenshot }}", "<b>Urlscan Screenshot</b>:<BR> {{ verified.urlscreenshot }}<BR>");
webcheck.lookup( url.parse(verified.url).hostname ).then(function(output) {
if(output.total == 0){
if(!('total' in output) || output.total == 0){
template = template.replace("{{ verified.urlscan }}", "Not Yet");
res.send(default_template.replace('{{ content }}', template));
} else if(output.total != 0){
Expand All @@ -665,7 +665,7 @@ function startWebServer() {
template = template.replace("{{ verified.urlscan }}", "<a style='text-color:green' href='{{ verified.urlscanlink }}' target='_blank'>Link</a>");
template = template.replace("{{ verified.urlscanlink }}", 'https://urlscan.io/result/' + output.results[index]._id);
urllookup.lookup( output.results[index].result ).then(function(lookupout) {
if(lookupout.data != null){
if('data' in lookupout && lookupout.data != null){
template = template.replace("{{ verified.urlscreenshot }}", "<div id='scam-screenshot'><img src=" + lookupout.task.screenshotURL + " alt='Screenshot of website' style='width: 100%; height: 80%;'></img></div>");
res.send(default_template.replace('{{ content }}', template));
} else{
Expand Down Expand Up @@ -781,7 +781,7 @@ function startWebServer() {
template = template.replace("{{ scam.urlscan }}", "<b>Urlscan Scan Results</b>: {{ scam.urlscan }}<BR>");
template = template.replace("{{ scam.urlscreenshot }}", "<b>Urlscan Screenshot</b>:<BR> {{ scam.urlscreenshot }}<BR>");
webcheck.lookup( url.parse(scam.url).hostname ).then(function(output) {
if(output.total == 0){
if(!output || !('total' in output) || output.total == 0){
template = template.replace("{{ scam.urlscan }}", "Not Yet");
res.send(default_template.replace('{{ content }}', template));
} else if(output.total != 0){
Expand Down

0 comments on commit 9813304

Please sign in to comment.