-
Notifications
You must be signed in to change notification settings - Fork 1
/
Hello.py
450 lines (382 loc) · 17.6 KB
/
Hello.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
import sys
import ipaddress
import keyboard
import socket
import os
from os import system,name
from colorama import init
from colorama import Fore, Back,Style
import platform
import subprocess
init(autoreset=True)
def clear_screen():
if os.name == 'nt':
_ = os.system('cls')
else:
_ = os.system('clear')
if __name__ == "__main__":
clear_screen()
print(Fore.GREEN + "Pingovator v.1.1 от 13.03.2023\n")
def testlink():
number = 1
while number >0 and number <7:
print("Проверка доступности портов:")
print(
"1. Сбербанк \n2. Банк Открытие \n3. Платформа ОФД \n4. Сертификаты Ingenico\n5. Ввести свои данные\n6. Выход")
print()
number = int(input("Выберите значение:"))
clear_screen()
if number == 1:
print()
print("Проверка начата. Дождитесь завершения...")
print()
print("Основной")
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.89', 670))
port = ("IP 194.54.14.89, port 670 (Транзакции + сверка итогов)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.89', 700))
port = ("IP 194.54.14.89, port 700 (Транзакции + сверка итогов)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.89', 740))
port = ("IP 194.54.14.89, port 740 (Транзакции + сверка итогов)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.89', 666))
port = ("IP 194.54.14.89, port 666 (Удаленная загрузка)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.89', 650))
port = ("IP 194.54.14.89, port 650 (Мониторинг)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.89', 690))
port = ("IP 194.54.14.89, port 690 (Отправка логов)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
print()
print("Резервный")
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.15.25', 670))
port = ("IP 194.54.15.25, port 670 (Транзакции + сверка итогов)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.15.25', 700))
port = ("IP 194.54.15.25, port 700 (Транзакции + сверка итогов)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.15.25', 740))
port = ("IP 194.54.15.25, port 740 (Транзакции + сверка итогов)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.15.25', 666))
port = ("IP 194.54.15.25, port 666 (Удаленная загрузка)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.15.25', 650))
port = ("IP 194.54.15.25, port 650 (Мониторинг)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.15.25', 690))
port = ("IP 194.54.15.25, port 690 (Отправка логов)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
print()
print("Резервный")
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.162', 670))
port = ("IP 194.54.14.162, port 670 (Транзакции + сверка итогов)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.162', 700))
port = ("IP 194.54.14.162, port 700 (Транзакции + сверка итогов)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.162', 740))
port = ("IP 194.54.14.162, port 740 (Транзакции + сверка итогов)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.162', 666))
port = ("IP 194.54.14.162, port 666 (Удаленная загрузка)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.162', 650))
port = ("IP 194.54.14.162, port 650 (Мониторинг)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.162', 690))
port = ("IP 194.54.14.162, port 690 (Отправка логов)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
print()
print("Тестовый")
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.24', 668))
port = ("IP 194.54.14.24, port 668 (Транзакции)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.24', 666))
port = ("IP 194.54.14.24, port 666 (Удаленная загрузка)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.14.24', 650))
port = ("IP 194.54.14.24, port 650 (Мониторинг)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
print()
print("UPOS 2.0")
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('185.157.96.41', 80))
port = ("IP 185.157.96.41, port 80 (Основной)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('194.54.15.98', 80))
port = ("IP 194.54.15.98, port 80 (Основной)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('185.157.96.24', 80))
port = ("IP 185.157.96.24, port 80 (Основной)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
print()
print("Проверка завершена.\n")
#keyboard.read_key()
if number == 2:
print()
print("Проверка начата. Дождитесь завершения...")
print()
print("Сервера TMS ЕКП")
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('91.197.176.148', 8001))
port = ("IP 91.197.176.148, port 8001 (Verifone/Pax)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('91.197.176.148', 8002))
port = ("IP 91.197.176.148, port 8002 (Ingenico)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
#sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#result = sock.connect_ex(('91.197.176.108', 8003))
#port = ("IP 91.197.176.108, port 8003 (NEXGO)")
#if result == 0:
# print(Fore.GREEN + "Открыт:", port)
#else:
# print(Fore.RED + "Закрыт:", port)
#sock.close()
print()
print("Процессинг (Загрузка ключей, транзакции)")
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('91.197.176.117', 443))
port = ("IP 91.197.176.117, port 443 (БО - TID на 2,4. Единый на все терминалы)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('91.197.176.109', 443))
port = ("IP 91.197.176.109, port 443 (ББ - TID на Y,W. Verifone, Pax)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('91.197.176.110', 443))
port = ("IP 91.197.176.110, port 443 (ББ - TID на Y,W. Ingenico)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('91.197.176.111', 443))
port = ("IP 91.197.176.111, port 443 (ББ - TID на Y,W. NEXGO)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
print()
print("Проверка завершена.\n")
print()
#keyboard.read_key()
if number == 3:
print()
print("Проверка начата. Дождитесь завершения...\n")
print("Хосты платформы ОФД")
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('185.170.204.91', 21101))
port = ("IP 185.170.204.91, port 21101 (Данные для регистрации ККТ и отправки чеков)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('185.170.204.91', 21102))
port = ("IP 185.170.204.91, port 21102 (Данные для работы ИСМ по маркировке (по ФФД 1.2)")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
print()
print("Проверка завершена.\n")
#keyboard.read_key()
if number == 4:
print()
print("Проверка начата. Дождитесь завершения...\n")
print("Сертификаты Ingenico")
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
result = sock.connect_ex(('91.208.214.91', 12050))
port = ("IP 91.208.214.91, port 12050")
if result == 0:
print(Fore.GREEN + "Открыт:", port)
else:
print(Fore.RED + "Закрыт:", port)
sock.close()
print()
print("Проверка завершена.\n")
print()
#keyboard.read_key()
if number == 5:
if __name__ == "__main__":
sock = socket.socket()
try:
server_ip = input("Введите IP-адрес сервера (например, 192.168.0.3): ")
Ipport = int(input("Введите IP порт:"))
port = (server_ip, Ipport)
print()
print("Проверка начата. Дождитесь завершения...\n")
sock.connect((server_ip, Ipport))
print(Fore.GREEN + "Открыт:", port)
except Exception as err:
print(Fore.RED + "Закрыт:", port)
finally:
sock.close()
print()
print("Проверка завершена.\n")
#print()
#Ipadr = ipaddress.ip_address(input("Введите IP адрес:"))
#Ipport = int(input("Введите IP порт:"))
#print(Ipadr, Ipport)
#sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#result = sock.connect_ex(('91.208.214.91', Ipport))
#port = (Ipadr, Ipport)
#if result == 0:
#print(Fore.GREEN + "Открыт:", port)
#else:
#print(Fore.RED + "Закрыт:", port)
#sock.close()
#print()
#print("Проверка завершена.\nДля продолжения нажмите любую клавишу...")
#print()
#keyboard.read_key()
if number == 6:
sys.exit()
#else:
if number < 1 or number > 6:
print(Fore.RED +"\nНе подходит условиям выбора\n")
testlink()
testlink()