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
| #!/usr/bin/python
#-*- coding:UTF8 -*-#
import cherrypy
from pierky.ipdetailscache import IPDetailsCache
import geocoder, os, socket, dns, dns.resolver
class MonSiteWeb():
def index(self):
return '<!DOCTYPE html>' \
'<html>' \
'<head>' \
'<title>' \
'</title>' \
'</head>' \
'<style type="text/css">' \
'body {' \
'margin: auto;' \
'padding: 10px;' \
'text-align: center;' \
'}' \
'.centre {' \
'margin-top: 140px;' \
'position: center;' \
'}' \
'input[type="text"]{' \
'height: 30px;' \
'width: 400px;' \
'font-size: 19px;' \
'border-radius: : 2px solid gray;' \
'margin-left: 20px;' \
'box-shadow:1px 1px 1px gray;' \
'}' \
'input[type="submit"]{' \
'height: 40px;' \
'width: 100px;' \
'font-size: 17px;' \
'font-weight: bolder;' \
'background: lightblue;' \
'box-shadow:1px 1px 1px gray;' \
'cursor:pointer;' \
'}' \
'.audit{' \
'font-family: Georgia;' \
'font-size: 50px;' \
'font-weight: bolder' \
'}' \
'</style>' \
'<body>' \
'<form class = centre action ="resultat" method = "POST">' \
'<span class="audit"> Audit Site Web </span>' \
'<p>' \
'<input type="text" name="reponse" placeholder="Entrer URL">' \
'<input type="submit" value="Scan">' \
'</p>' \
'</form>' \
'</body>' \
'</html>'
index.exposed = True
def resultat(self, reponse = None):
if reponse:
name = socket.gethostbyname(reponse)
command = "whois" + " " + reponse
process = os.popen(command) # appel d'un commande systeme "popen" ppur executer la commande au dessus
results = str(process.read())
return ('\n',results,'\n')
else:
return 'Veuillez svp fournir une URL <a href="/">ici</a>.'
resultat.exposed = True
cherrypy.quickstart(MonSiteWeb()) |
Partager