Skip to content

Commit f9aa713

Browse files
committed
Version 0.3
1 parent 72f7798 commit f9aa713

6 files changed

Lines changed: 139 additions & 5 deletions

File tree

CodeBreak.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
elif select == '4':
2929
startProgram('infoServerDisc.py')
3030
elif select == '5':
31-
Soon()
31+
startProgram('ipInfo.py')
3232
elif select == '6':
3333
Soon()
3434
elif select == '7':

config/config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def TIME_YELLOW():
190190
{"num": 4, "titre": "Discord Invitation Info"},
191191
{"num": 9, "titre": "Soon"},
192192
{"num": 14, "titre": "Soon"},
193-
{"num": 5, "titre": "Soon"},
193+
{"num": 5, "titre": "IpScan"},
194194
{"num": 10, "titre": "Soon"},
195195
{"num": 15, "titre": "Soon"},
196196
]
@@ -273,7 +273,8 @@ def upData(existing_data, newData):
273273
"excludeIds": [
274274
"726772485252710503"
275275
],
276-
"censureToken": "False"
276+
"censureToken": "False",
277+
"ipinfoToken": "null"
277278
}
278279

279280
def main():

menu/setting.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
{"num": 5, "titre": "bot token censorship"},
1818
{"num": 8, "titre": "Soon"},
1919
{"num": 2, "titre": "Soon"},
20-
{"num": 6, "titre": "Soon"},
20+
{"num": 6, "titre": "IpInfo Token"},
2121
{"num": 9, "titre": "Soon"},
2222
{"num": 3, "titre": "Soon"},
2323
{"num": 7, "titre": "Soon"},
@@ -42,7 +42,7 @@
4242
elif select == '5':
4343
startProgram('censorToken.py')
4444
elif select == '6':
45-
Soon()
45+
startProgram('ipinfoToken.py')
4646
elif select == '7':
4747
Soon()
4848
elif select == '8':

program/IpInfo.py

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# © 2024 CIPIX
2+
# All rights reserved.
3+
# Tous droits réservés.
4+
5+
import os, sys, requests
6+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
7+
from config.config import *
8+
from config.menu import Prompt
9+
10+
terminalTitle('IpInfo')
11+
12+
def pprint(text, info):
13+
print(f'{ADD} {text} : {lightLilac}{info}{reset}')
14+
15+
def scanIp(ip):
16+
global token
17+
token = data['ipinfoToken']
18+
if ip in ['myip', 'my', 'me'] :
19+
if token == 'null':
20+
url = f"https://ipinfo.io/json"
21+
else:
22+
url = f"https://ipinfo.io/json?token={token}"
23+
else :
24+
if token == 'null':
25+
url = f"https://ipinfo.io/{ip}"
26+
else:
27+
url = f"https://ipinfo.io/{ip}?token={token}"
28+
response = requests.get(url)
29+
if response.status_code == 200:
30+
return response.json()
31+
else:
32+
return None
33+
34+
def main():
35+
print(f'\n{TIME()} {INPUT} please enter an ip address (enter "me" for your IP information){reset}\n')
36+
ip = input(Prompt('IpInfo')).lower().replace(' ','')
37+
info = scanIp(ip)
38+
print('')
39+
if info:
40+
if info.get("bogon"):
41+
print(f"{TIME_RED()} {ADD_RED} The IP {ip} is a bogon address ! {reset}")
42+
43+
else :
44+
pprint("IP", info.get('ip'))
45+
pprint("Hostname", info.get('hostname'))
46+
pprint("City", info.get('city'))
47+
pprint("Region", info.get('region'))
48+
pprint("Country", info.get('country'))
49+
pprint("Location", info.get('loc'))
50+
pprint("Organization", info.get('org'))
51+
pprint("Postal", info.get('postal'))
52+
pprint("Timezone", info.get('timezone'))
53+
54+
if token == 'null':
55+
print(f"\n{TIME_YELLOW()} {INFO_YELLOW} With a token, you could obtain much more information.\n For more details, please visit https://ipinfo.io/.")
56+
57+
else:
58+
asn = info.get('asn', {})
59+
pprint("ASN", asn.get('asn'))
60+
pprint("ASN Name", asn.get('name'))
61+
pprint("ASN Domain", asn.get('domain'))
62+
pprint("ASN Route", asn.get('route'))
63+
pprint("ASN Type", asn.get('type'))
64+
65+
company = info.get('company', {})
66+
pprint("Company Name", company.get('name'))
67+
pprint("Company Domain", company.get('domain'))
68+
pprint("Company Type", company.get('type'))
69+
70+
carrier = info.get('carrier', {})
71+
pprint("Carrier Name", carrier.get('name'))
72+
pprint("Carrier MCC", carrier.get('mcc'))
73+
pprint("Carrier MNC", carrier.get('mnc'))
74+
75+
privacy = info.get('privacy', {})
76+
pprint("VPN", privacy.get('vpn'))
77+
pprint("Proxy", privacy.get('proxy'))
78+
pprint("Tor", privacy.get('tor'))
79+
pprint("Relay", privacy.get('relay'))
80+
pprint("Hosting", privacy.get('hosting'))
81+
pprint("Service", privacy.get('service'))
82+
83+
abuse = info.get('abuse', {})
84+
pprint("Abuse Address", abuse.get('address'))
85+
pprint("Abuse Country", abuse.get('country'))
86+
pprint("Abuse Email", abuse.get('email'))
87+
pprint("Abuse Name", abuse.get('name'))
88+
pprint("Abuse Network", abuse.get('network'))
89+
pprint("Abuse Phone", abuse.get('phone'))
90+
else:
91+
print(f"{TIME_RED()} {ERROR} Unable to retrieve information for this IP.")
92+
93+
if __name__ == "__main__":
94+
main()
95+
print('')
96+
Pause()
97+
mainMenu()

program/infoServerDisc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def deep_update(d, u):
3737
else:
3838
d[k] = v
3939
return d
40+
4041
def Sbadges():
4142
user_flags = invite_info['inviter']['public_flags']
4243
badges = []
@@ -137,11 +138,13 @@ def saveFile(content):
137138
{ADD} Username : {lightLilac}{invite_info['inviter']['username']}
138139
{ADD} Global Name : {lightLilac}{invite_info['inviter']['global_name']}
139140
{ADD} Avatar : {lightLilac}{invite_info['inviter']['avatar']}
141+
{ADD} Link avatar : {lightLilac}https://cdn.discordapp.com/avatars/{invite_info['inviter']['id']}/{invite_info['inviter']['avatar']}.png
140142
{ADD} Discriminator : {lightLilac}{invite_info['inviter']['discriminator']}
141143
{ADD} Public Flags : {lightLilac}{invite_info['inviter']['public_flags']}
142144
{ADD} Flags : {lightLilac}{invite_info['inviter']['flags']}
143145
{ADD} Badges : {lightLilac}{Sbadges()}
144146
{ADD} Banner : {lightLilac}{invite_info['inviter']['banner']}
147+
{ADD} Link banner : {lightLilac}https://cdn.discordapp.com/banners/{invite_info['inviter']['id']}/{invite_info['inviter']['banner']}.png
145148
{ADD} Accent Color : {lightLilac}{invite_info['inviter']['accent_color']}
146149
{ADD} Banner Color : {lightLilac}{invite_info['inviter']['banner_color']}
147150
""")
@@ -174,11 +177,13 @@ def saveFile(content):
174177
Username : {invite_info['inviter']['username']}
175178
Global Name : {invite_info['inviter']['global_name']}
176179
Avatar : {invite_info['inviter']['avatar']}
180+
Link avatar : https://cdn.discordapp.com/avatars/{invite_info['inviter']['id']}/{invite_info['inviter']['avatar']}.png
177181
Discriminator : {invite_info['inviter']['discriminator']}
178182
Public Flags : {invite_info['inviter']['public_flags']}
179183
Flags : {invite_info['inviter']['flags']}
180184
Badges : {Sbadges()}
181185
Banner : {invite_info['inviter']['banner']}
186+
Link Banner : https://cdn.discordapp.com/banners/{invite_info['inviter']['id']}/{invite_info['inviter']['banner']}.png
182187
Accent Color : {invite_info['inviter']['accent_color']}
183188
Banner Color : {invite_info['inviter']['banner_color']}
184189
"""

program/ipinfoToken.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# © 2024 CIPIX
2+
# All rights reserved.
3+
# Tous droits réservés.
4+
5+
try :
6+
import sys, os
7+
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
8+
from config.config import *
9+
from config.menu import *
10+
except Exception as e :
11+
errorModule(e)
12+
13+
terminalTitle('Setting/IpInfo Token')
14+
15+
16+
try :
17+
print(f'\n{TIME_YELLOW()} {INFO_YELLOW} IpInfo token : {data['ipinfoToken']}')
18+
print(f"{TIME()} {INPUT} Please provide the token obtained from https://ipinfo.io/ (leave blank if you don't have one). {reset}\n")
19+
choice = input(Prompt('Setting')).strip()
20+
21+
if choice == '':
22+
data['ipinfoToken'] = 'null'
23+
else :
24+
data['ipinfoToken'] = choice
25+
Sauvegarde()
26+
print(f'\n{TIME()} {INFO} IpInfo token set to :{lightLilac} {data['ipinfoToken']}')
27+
except Exception as error :
28+
print(f'{TIME_RED()} {ERROR} Error : {error}')
29+
30+
Pause()
31+
startMenu('setting.py')

0 commit comments

Comments
 (0)