-
Notifications
You must be signed in to change notification settings - Fork 0
/
Interface.py
executable file
·120 lines (107 loc) · 3.16 KB
/
Interface.py
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
112
113
114
115
116
117
118
119
120
import datetime
import os
import subprocess as sp
import threading
import time
import ipScanner
arryAct = []
arryDeAct = []
arryLaAct = []
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def Clear():
sr = '\033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F \033[F'
print(sr)
def Title():
Clear()
status, result = sp.getstatusoutput("pwd")
f = open(result + "/Logo/AMA_S.txt", "r")
next = f.read()
while next != "":
print(bcolors.FAIL + next + bcolors.ENDC)
next = f.read()
def ReadData():
next = ''
try:
status, result = sp.getstatusoutput("pwd")
f = open(result + "/Ip.txt", "r")
next = f.readline()
except:
next = ''
for i in range(255):
ip = ''
tm = ''
if next != '':
ip = next.split(' ')[0]
ip = ip[0:15]
tm = next.split(' ')[1]
tm = tm[0:-2]
arryAct.append([ip, tm])
# if arryAct.count([ip, tm]) == 0:
arryLaAct.append([ip, tm])
try:
next = f.readline()
except:
ip = ip
else:
break
def Print():
Title()
ReadData()
for i in range(9):
ip = ''
tm = ''
try:
iptm = arryAct.pop(0)
arryAct.append(iptm)
ip = iptm[0]
tm = iptm[1]
except:
ip = ip
Lip = ''
Ltm = ''
for i in range(100):
try:
Liptm = arryLaAct.pop(0)
arryLaAct.append(Liptm)
if arryAct.count(Liptm) == 0:
Lip = Liptm[0]
Ltm = Liptm[1]
break
except:
break
print('\033[91m ▐\033[0m' + ip.center(18,' ') + tm.center(18,' ') + '\033[91m▐' + Lip.center(18,' ') + Ltm.center(15,' ') + '▐\033[0m')
print('\033[91m ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄\033[0m')
def Ip_Scan():
status, result = sp.getstatusoutput('ifconfig | grep "inet " | grep -v 127.0.0.1[2]')
result = result.split(' ')
ip = result[len(result) - 1][:result[len(result) - 1].rfind('.')] + '.'
inputip = input('ip address (difalt "' + ip + '): ')
if inputip != '':
ip = inputip
f = open('s.txt', 'w')
f.writelines('true')
while True:
arryAct.clear()
a = ipScanner
a.Serch(ip + '0', ip + '255')
time.sleep(15)
processThread = threading.Thread(target = Ip_Scan)
processThread.start()
f = open('s.txt', 'w')
f.writelines('fals')
while True:
status, result = sp.getstatusoutput("pwd")
f = open(result + "/s.txt", "r")
next = f.read()
if next == 'fals':
continue
Print()
time.sleep(5)