This repository has been archived by the owner on Jan 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
new_tool.js
77 lines (60 loc) · 2.75 KB
/
new_tool.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
var hostnameAddr = location.hostname // Gets originating hostname of the webserver
var hostUrl = 'http://' + hostnameAddr + ':3000' // This needs to be active on the live server. Do not use the static version below in production
//var hostUrl = "http://127.0.0.1:3000" // This is a static version for testing. I host this site myself for myself.
function clicker() {
// console.log('Debug |Test') // Test function functionality
// $('.output').append($('.test-box').val() + '\n') // Test function functionality
var ipData = $('.test-box').val(); // Set data to send in GET request
var typeData = $(".select-list-type").val();
var sendObj = {
"ip": ipData,
"typeData": typeData,
"authenticationBits": "<g3BB>j#&Pb7L4x^e3Y6h%J(^"
}
//console.log('Debug |' + 'Request URL: ' + hostUrl);
//console.log('Debug |' + 'Send data: ' + sendData);
$('.output').append("Server contacted. It is running...")
$.get( hostUrl, sendObj).done(function(data) {
//console.log(data)
$('.output').append(data)
var split_list = data.split("\n")
for (i=0;i<split_list.length;i++) { // This portion allows us to create the link list
if (split_list[i].includes("/tcp")) {
if (split_list[i].split(" ").includes("open")) {
var link_create = "http://" + $('.test-box').val() + ":" + split_list[i].split("/")[0]
$(".links").append("<a href='" + link_create + "'>"+ link_create + "</a>" + "<br>")
console.log("<a href='" + link_create + "'>"+ link_create + "</a>")
}
}
}
})
var ip_search_string = "https://ipinfo.io/" + ipData
var json_data = $.get(ip_search_string, function(response) {
console.log(response)
$(".ip-info").append("IP Address: " + response.ip + "\n");
$(".ip-info").append("Country: " + response.country + "\n");
$(".ip-info").append("Region: " + response.region + "\n");
$(".ip-info").append("Potential ISP: " + response.org);
}, "jsonp")
var hostUrlTwo = hostUrl + '/udp'
var ipDataTwo = $('.test-box').val(); // Set data to send in GET request
var sendObjTwo = {
"ip": ipDataTwo,
}
//console.log('Debug |' + 'Request URL: ' + hostUrl);
//console.log('Debug |' + 'Send data: ' + sendData);
$('.trace-info').append("Tracing tracing tracing...")
$('.trace-info').append("<br>")
$.get( hostUrlTwo, sendObjTwo).done(function(data) {
//console.log(data)
$('.trace-info').append(data)
})
}
function clearOut() {
$( ".output" ).html('')
$( ".fraud-output" ).text('')
$(".test-box").val('')
$( ".ip-info" ).html('')
$(".links").html("")
$(".trace-info").html("")
} // Clears out the output fields.