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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
| #!/usr/bin/python
# -*-Coding:UTF-8 -*-
import socket
import dns.resolver
import dns
from pierky.ipdetailscache import IPDetailsCache
import geocoder
import os
from Tkinter import *
class Findme:
"this class show some informations on website"
def data_web(self,ip):
self.ip = ip
self.name = socket.gethostbyname(self.ip) # Convert the site web name in address ip x.x.x.x
self.cache = IPDetailsCache() # call the Class 'IPDetailsCache()'
self.r = self.cache.GetIPInformation(self.name) # use the 'GetIPInformation()' methods
print("adresse IPV4 : {0}".format(self.name)) # show the website ip
print("******************************************************************")
print("\n\t\t\tASN informations:\n") # show ASN informations
for cle, valeur in self.r.items(): # select the items methods for show 'cle and valeur' values in boucle
print cle, ":", valeur
print("******************************************************************")
print("\n\t\t\tLocalisation:\n")
i = geocoder.maxmind(self.name)
a = i.json
for local, loac in a.items():
print local, ":", loac
print("******************************************************************")
print("\n\t\t\tMAILS SERVERS:\n")
reponse = dns.resolver.query(self.ip, 'MX') # the variable 'reponse' contains the value MX of dns server
for rdata in reponse:
print"seveurs mails:", (rdata.exchange) # show the server mail
print("******************************************************************")
print("\n\t\t\tDNS SERVERS:\n")
contenu = dns.resolver.query(self.ip, 'NS') # the variable 'contenu' contains the value NS of dns server
for resultat in contenu:
print"seveurs DNS:", (resultat) # show all name servers dns
print("******************************************************************")
print("\n\t\t\tWHOIS GATHERING INFORMATIONS:\n")
self.command = "whois" + " " + self.ip
process = os.popen(self.command)
self.results = str(process.read())
print(self.results)
print("******************************************************************")
print("\n\t\t\tTRANSFERT ZONE LOADING...\n")
self.f = "fierce" + " " + "-dns" + " " + self.ip
self.process = os.popen(self.f)
self.result = str(self.process.read())
print(self.result)
class Graphic:
"create the GUI"
def __init__(self):
self.fen = Tk()
self.fen.geometry('800x700')
self.fen.title('Findme')
s1 = Scrollbar(self.fen, orient=VERTICAL)
s2 = Scrollbar(self.fen, orient=HORIZONTAL)
self.t1 = Text(self.fen, width=80, height=45, wrap=NONE, fg = 'red')
self.hidou = StringVar()
self.hidou.set('')
Entry(self.fen, width= 40, textvariable= self.hidou, bg= 'black', fg= 'white').place(x='160', y='670') # create a zone text string
Label(self.fen, text='input your website:', fg='red').place(x='40', y='670') # show the title"input youur website"
Button(self.fen, text='SCAN', fg='RED',command= self.messages).place(x='500', y='665')
Button(self.fen, text='EXIT', fg='RED', command=self.fen.destroy).place(x='570', y='665')
Button(self.fen, text='EXPORT', fg='RED').place(x='630', y='665')
s1.config(command=self.t1.yview)
s2.config(command=self.t1.xview)
self.t1.config(yscrollcommand=s1.set, xscrollcommand=s2.set)
self.t1.grid(column=0, row=0)
s1.grid(column=1, row=0, sticky=S + N)
s2.grid(column=0, row=1, sticky=W + E)
def messages(self):
self.donnees = self.hidou.get()
self.sh = Findme()
self.example = self.sh.data_web(self.donnees)
self.t1.insert(END, self.example)
if __name__ == "__main__":
graphical = Graphic()
graphical.fen.mainloop() |