aboutsummaryrefslogtreecommitdiffstats
path: root/www
diff options
context:
space:
mode:
Diffstat (limited to 'www')
-rwxr-xr-xwww/html/destination.py55
1 files changed, 55 insertions, 0 deletions
diff --git a/www/html/destination.py b/www/html/destination.py
new file mode 100755
index 0000000..cc8713a
--- /dev/null
+++ b/www/html/destination.py
@@ -0,0 +1,55 @@
+#!/usr/bin/python3
+# -*- coding: utf-8 -*-
+
+import mod_python
+from fonctions import baseHTML, connexionBD, lien
+import socket
+
+def index(req):
+ req.content_type="text/html"
+
+#check si ip est bien la
+ try:
+ ip=req.form["ip"]
+ except KeyError:
+ mod_python.util.redirect(req, "index.py")
+
+#check si ip a le bon format
+ try:
+ socket.inet_aton(ip)
+ except socket.error:
+ mod_python.util.redirect(req, "index.py")
+
+ content=str()
+
+#sql part
+ conn=connexionBD()
+ cur=conn.cursor()
+ sql="select * from paquet where ip_destination='{}';".format(ip)
+ cur.execute(sql)
+ conn.commit()
+ data=cur.fetchall()
+ conn.close()
+#sql part
+
+#takes every lines from the select
+ for i in data :
+ content+=("""<tr>""" +
+"""<td>""" + str(i[1]) + """</td>""" +
+"""<td>""" + str(i[2]) + """</td>""" +
+"""<td>""" + str(i[3]) + """</td>""" +
+"""<td>""" + lien('destination.py?ip=' + str(i[4]), str(i[4])) + """</td>""" +
+"""<td>""" + str(i[5]) + """</td>""" +
+"""<td>""" + str(i[6]) + """</td>""" +
+"""</tr>""")
+
+#write the html page
+ req.write(baseHTML("Destination","""
+<center><h1>IP Destination : """ + ip + """</h1></center>
+<center><table>
+<tr><th>Heure</th><th>Protocole</th><th>IP Source</th><th>IP Destination</th><th>Port Source</th><th>Port Destination</th></tr>
+"""
++ content +
+"""
+</table></center>
+"""))
-2/+2 2021-05-19Update README.mdv3.2.1Clyhtsuriva1-1/+1 2021-05-19Update README.mdClyhtsuriva1-3/+3 2021-05-19Update README.mdClyhtsuriva1-1/+1 2021-05-19Update README.mdClyhtsuriva1-8/+10 2021-05-19Update README.mdClyhtsuriva1-1/+2 2021-05-19Update README.mdClyhtsuriva1-8/+7 2021-05-19Update README.mdrelease/3.2.1Clyhtsuriva1-6/+21 2021-05-19Big updaterelease/3.2Clyhtsuriva55-235/+193 Restructuring the packages and adding a Constants.kt for the api URL. Also adding gson in Singletons.kt 2021-05-19Update README.mdClyhtsuriva1-1/+5 2021-05-14Update README.mdClyhtsuriva1-1/+3 2021-05-14Update README.mdClyhtsuriva1-0/+23 2021-05-14Update README.md and adding logo onto the main screenrelease/3.1Clyhtsuriva2-10/+13 2021-05-14Singletons on all pages : OKClyhtsuriva6-125/+81 2021-05-14Singletons : DetailTopManga : OKClyhtsuriva2-21/+49 2021-05-14Addedd Singletons for TopManga.Clyhtsuriva3-23/+43