forked from C-REMO/Obscure-IP-Obfuscator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IP-Obfuscator.py
120 lines (114 loc) · 6.54 KB
/
IP-Obfuscator.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
#!/usr/bin/env python3
import argparse
import re
NAME, AUTHOR, VERSION = \
'IP Obfuscator ', 'Author: Omer Ramić <@sp_omer>', '0.1f'
def obscure_ip(ip):
print ("\n" + NAME + " #v" + VERSION + "\n " + AUTHOR + "\n")
print('[~] Obfuscated IPs:\n')
for match in re.finditer(r'((?P<a>\d+)\.)((?P<b>\d+)\.)((?P<c>\d+)\.)'
'(?P<d>\d+)', ip):
print('[+] http://'+str(int(match.group('a'))*256**3 +
int(match.group('b'))*256**2 +
int(match.group('c'))*256 +
int(match.group('d'))))
print('[+] http://'+str(hex(int(match.group('a'))*256**3 +
int(match.group('b'))*256**2 +
int(match.group('c'))*256 +
int(match.group('d')))))
print('[+] http://'+re.sub('o', '', str(oct(int(match.group('a')) *
256**3+int(match.group('b'))*256**2 +
int(match.group('c'))*256 +
int(match.group('d')))))+'\n')
print('[+] http://'+re.sub('o', '', str(oct(int(match.group('a')))) +
'.'+str(oct(int(match.group('b'))))+'.' +
str(oct(int(match.group('c'))))+'.' +
str(oct(int(match.group('d'))))))
print('[+] http://'+re.sub('o', '0000000',
str(oct(int(match.group('a'))))+'.' +
str(oct(int(match.group('b'))))+'.' +
str(oct(int(match.group('c'))))+'.' +
str(oct(int(match.group('d'))))))
print('[+] http://'+str(hex(int(match.group('a'))))+'.' +
str(hex(int(match.group('b'))))+'.' +
str(hex(int(match.group('c'))))+'.' +
str(hex(int(match.group('d')))))
print('[+] http://'+re.sub('x', 'x00000000',
str(hex(int(match.group('a'))))+'.' +
str(hex(int(match.group('b'))))+'.' +
str(hex(int(match.group('c'))))+'.' +
str(hex(int(match.group('d')))))+'\n')
print('[+] http://'+str(hex(int(match.group('a'))))+'.' +
str(hex(int(match.group('b'))))+'.' +
str(hex(int(match.group('c'))))+'.'+match.group('d'))
print('[+] http://'+str(hex(int(match.group('a'))))+'.' +
str(hex(int(match.group('b'))))+'.' +
match.group('c')+'.'+match.group('d'))
print('[+] http://'+str(hex(int(match.group('a'))))+'.' +
match.group('b')+'.'+match.group('c')+'.'+match.group('d'))
print('[+] http://'+match.group('a')+'.' +
str(hex(int(match.group('b'))))+'.' +
str(hex(int(match.group('c'))))+'.' +
str(hex(int(match.group('d')))))
print('[+] http://'+match.group('a')+'.'+match.group('b')+'.' +
str(hex(int(match.group('c'))))+'.' +
str(hex(int(match.group('d')))))
print('[+] http://'+match.group('a')+'.'+match.group('b')+'.' +
match.group('c')+'.'+str(hex(int(match.group('d'))))+'\n')
print('[+] http://'+re.sub('o', '', str(oct(int(match.group('a')))) +
'.'+str(oct(int(match.group('b'))))+'.' +
str(oct(int(match.group('c'))))+'.'+match.group('d')))
print('[+] http://'+re.sub('o', '', str(oct(int(match.group('a')))) +
'.'+str(oct(int(match.group('b'))))+'.' +
match.group('c')+'.'+match.group('d')))
print('[+] http://'+re.sub('o', '', str(oct(int(match.group('a')))) +
'.'+match.group('b')+'.'+match.group('c')+'.'+match.group('d')))
print('[+] http://'+re.sub('o', '', match.group('a')+'.' +
str(oct(int(match.group('b'))))+'.' +
str(oct(int(match.group('c'))))+'.' +
str(oct(int(match.group('d'))))))
print('[+] http://'+re.sub('o', '', match.group('a')+'.' +
match.group('b')+'.'+str(oct(int(match.group('c'))))+'.' +
str(oct(int(match.group('d'))))))
print('[+] http://'+re.sub('o', '', match.group('a')+'.' +
match.group('b')+'.'+match.group('c')+'.' +
str(oct(int(match.group('d')))))+'\n')
print('[+] http://'+str(hex(int(match.group('a'))))+'.' +
str(hex(int(match.group('b'))))+'.'+str(int(match.group('c')) *
256+int(match.group('d'))))
print('[+] http://'+str(hex(int(match.group('a'))))+'.' +
str(int(match.group('b'))*256**2+int(match.group('c'))*256 +
int(match.group('d'))))
print('[+] http://'+re.sub('o', '', str(oct(int(match.group('a')))) +
'.'+str(oct(int(match.group('b')))))+'.' +
str(int(match.group('c'))*256+int(match.group('d'))))
print('[+] http://'+re.sub('o', '', str(oct(int(match.group('a'))))) +
'.'+str(int(match.group('b'))*256**2+int(match.group('c'))*256 +
int(match.group('d'))))
print('[+] http://'+str(hex(int(match.group('a'))))+'.' +
re.sub('o', '', str(oct(int(match.group('b')))))+'.' +
str(int(match.group('c'))*256+int(match.group('d'))))
print('[+] http://'+re.sub('o', '', str(oct(int(match.group('a'))))) +
'.'+str(hex(int(match.group('b'))))+'.' +
str(int(match.group('c'))*256+int(match.group('d')))+'\n')
print('IPv4 mapping into IPv6 - not resolving as IPv4 do')
print('[+] http://'+'::ffff:'+str(hex(int(match.group('a'))*256**3 +
int(match.group('b'))*256**2+int(match.group('c'))*256 +
int(match.group('d'))))[2:])
print('[+] http://'+'0:0:0:0:0:ffff:'+str(hex(int(match.group('a')) *
256**3+int(match.group('b'))*256**2+int(match.group('c'))*256 +
int(match.group('d'))))[2:])
print('[+] http://'+'0000:0000:0000:0000:0000:ffff:' +
str(hex(int(match.group('a'))*256**3+int(match.group('b'))*256 **
2+int(match.group('c'))*256+int(match.group('d'))))[2:])
print('[+] http://'+'0000:0000:0000:0000:0000:ffff:'+ip+'\n')
if __name__ == '__main__':
parser = argparse.ArgumentParser(description=NAME+VERSION, epilog=AUTHOR)
parser.add_argument('--ip',
dest='ip',
help='Targeted IP (e.g. \'127.0.0.1\')')
args = parser.parse_args()
if args.ip:
obscure_ip(args.ip)
else:
parser.print_help()