forked from 0xInfection/TIDoS-Framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnet_info.py
More file actions
75 lines (73 loc) · 3.45 KB
/
Copy pathnet_info.py
File metadata and controls
75 lines (73 loc) · 3.45 KB
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
from __future__ import print_function
import os, io, platform, sys, socket, time
from time import sleep
from urllib2 import urlopen
#########################################
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
W = '\033[0m' # white (normal)
R = '\033[31m' # red
G = '\033[32m' # green
O = '\033[33m' # orange
B = '\033[34m' # blue
P = '\033[35m' # purple
C = '\033[36m' # cyan
GR = '\033[37m' # gray
T = '\033[93m' # tan
#########################################
mac_address = os.popen("cat /sys/class/net/eth0/address").read()
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(('google.com', 0))
localaddr = s.getsockname()[0] # local subnet
ipaddr = urlopen('http://ip.42.pl/raw').read()
def_gw_device = os.popen("route | grep '^default' | grep -o '[^ ]*$'").read()
def info():
print (""+O+color.BOLD+" +=====================================================+")
print (""+T+" _______ __ .___ _____ ")
print (""+T+" \ \ _____/ |_ | | _____/ ____\____ ")
print (""+T+" / | \_/ __ \ __\ | |/ \ __\/ _ \ ")
print (""+T+" / | \ ___/| | | | | \ | ( <_> ) ")
print (""+T+" \____|__ /\___ >__| |___|___| /__| \____/ ")
print (""+T+" \/ \/ \/ ")
print (""+O+" +=====================================================+"+ color.END)
print (""+GR+" +------------------------------------+")
time.sleep (0.2)
print (" |"+C+color.BOLD+" Mac Address: " + mac_address)
time.sleep (0.2)
print (""+GR+" +------------------------------------+")
time.sleep (0.2)
print (" |"+R+color.BOLD+" Local address: " + localaddr)
time.sleep (0.2)
print (""+GR+" +------------------------------------+")
time.sleep (0.2)
print (" |"+G+color.BOLD+" IP: " + ipaddr)
time.sleep (0.2)
print (""+GR+" +------------------------------------+")
time.sleep (0.2)
print (" |"+T+color.BOLD+" Operating System: " + platform.system())
time.sleep (0.2)
print (""+GR+" +------------------------------------+")
time.sleep (0.2)
print (" |"+P+color.BOLD+" Name: " + platform.node())
time.sleep (0.2)
print (""+GR+" +------------------------------------+")
time.sleep (0.2)
print (" |"+O+color.BOLD+" Interface: " + def_gw_device)
time.sleep (0.2)
print (""+GR+" +------------------------------------+" + color.END)
print (""+O+" +=======================================================+")
info()