Sign in to follow this  
mesvak

how TO DOX AND GET AND DO THE PASSIVE RECON ON THE TARGET WHO CONNECTED TO UR VPS .PY

Recommended Posts

WELP WHAT IT ESSENTIALLY DO IS GET IPS WHICH ARE FAILED TO CONNECT TO UR VPS 

anD USE THAT IP AGAINST THEM 

 

LETS SEE THE SCRIPT IF U HAVE TROUBLE UNDERSTANDING IT TELL ME I WILL MAKE A GUIDE FOR IT

 

 

[hide]

 

#!/usr/bin/python3.4
#BY MESVAK
import re
import urllib.request
import json
log_path = "/var/log/auth.log"
hosts = []
key = "{YOUR_API_KEY}"
#GET FAILED PASSWORD ATTEMPT
def get_host(test):
       for line in text.split('\n'):
               if line.find("Failed password for invalid ") != -1:
                       if get_ip(line) not in hosts:
                               hosts.append(get_ip(line))
       return hosts
#GET USERNAME
def get_username(line):
       username_word = line.split("Failed password for invalid user ")
       username = (username_word[1]).split(" ")
       return username[0]

#LOCATE IP WITH GEOIP
def geoip(host):
       response = urllib.request.urlopen("http://freegeoip.net/json/"+host)
       geoip = response.read().decode("utf-8")
       geoip = json.loads(geoip)
       print("\n[+] Tracking ip {}".format(geoip['ip']))
       print("-------------------------------")
       print('\tCountry : {}\n\ttimezone : {}\n\tlatitude : {}\n\tlongitude : {}'.format(geoip['country_name'],geoip['time_zone'],geoip['latitude'],geoip['longitude']))
def passive_recon(host,key):
       url = "https://api.shodan.io/shodan/host/{}?key={}&minify=true".format(host,key)
       try:
               response = urllib.request.urlopen(url)
               result = response.read().decode('utf-8')
               result = json.loads(result)
               print("[+] Passive Recon using shodan.io")
               print("-------------------------------")
               print("\tPort : {}\n\tOrganisation {}".format(result['ports'],result['org']))
               for x in range(len(result['ports'])):
                       print("Banner {}".format(result['data'][x]['data']))
       except:
               print("[+] Passive Recon using shodan.io")
               print("-------------------------------")
               print("\tCan't retrieve information")
               pass
if __name__ == "__main__":
       with open(log_path, 'rt') as log:
               text = log.read()
get_host(text)
for host in hosts:
       geoip(host)
       passive_recon(host,key)

 

 

[/hide]

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this