RE: Shodanier - A expanded version of Shodan search engine 12-30-2018, 10:14 AM
#17
No, it doesn't work that way.
The JSON entry must be hosted in a server and then use the script above to get the JSON data.
Here is the script disassembled.
Defines a keyword in the prompt.
Starts the script if not equal to null
Starts the xmlhttp
Specifies that the JSON string has a object myObj.
(This object must exist inside the JSON string)
Overwrittes the html page with a new one
Make a hyperlink with a JSON object called ip_str inside matches inside myObj
HTML CODE
Url to request the JSON String
TIP: I was trying to comment the keys as they appear on your post but it's missing code. Hope it highlights all the important questions.
The JSON entry must be hosted in a server and then use the script above to get the JSON data.
Here is the script disassembled.
Defines a keyword in the prompt.
Code:
var keyword = prompt("Type a targeted keyword!", "radio");Starts the script if not equal to null
Code:
if (keyword != null) {Starts the xmlhttp
Code:
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {Specifies that the JSON string has a object myObj.
(This object must exist inside the JSON string)
Code:
var myObj = JSON.parse(this.responseText);Overwrittes the html page with a new one
Code:
document.write("<html><head><title>Shodani....Make a hyperlink with a JSON object called ip_str inside matches inside myObj
Code:
document.write('<a href="http://'+ myObj.matches[x].ip_str +'" target="_blank">'+ myObj.matches[x].ip_str +'</a><br>');HTML CODE
Code:
document.write('</td></tr></table></center>');
document.write('</center></center></div></body></html>');Url to request the JSON String
Code:
xmlhttp.open("GET", "https://api.shodan.io/shodan/host/search?key=CevVNIYrV6gUzMoxiMhcaO3JIJOmpCY1&facets=&query="+keyword+"", true);TIP: I was trying to comment the keys as they appear on your post but it's missing code. Hope it highlights all the important questions.
(This post was last modified: 12-30-2018, 10:16 AM by hacxx.)





![[+]](https://sinister.li/images/modern/collapse_collapsed.png)