-
-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathxosint
executable file
·2875 lines (2452 loc) · 114 KB
/
xosint
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
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
import signal
import tempfile
from googlesearch import search # type: ignore
from smtplib import SMTP, SMTPRecipientsRefused, SMTPSenderRefused, SMTPResponseException
from email.mime.multipart import MIMEMultipart
import re
import json
import os
import time
import socket
import requests
from ping3 import ping
import ipaddress
import readline
import colorama
from colorama import *
from time import sleep
import sys
import json
from PIL import Image
from PIL.ExifTags import TAGS
import piexif
from prompt_toolkit import print_formatted_text, HTML
from pathlib import Path
import platform
from datetime import datetime
import phonenumbers # type: ignore
from phonenumbers import geocoder # type: ignore
import opencage
from bs4 import BeautifulSoup as bs
import tkinter as tk
from tkinter import messagebox
import webbrowser
import stripe # type: ignore
import tkinter as tk
from tkinter import filedialog, simpledialog, messagebox
from PIL import Image, ImageTk
import base64
from googleapiclient.discovery import build # type: ignore
import requests
from bs4 import BeautifulSoup
import webbrowser
from datetime import datetime, timedelta
from flask import Flask, request, render_template_string
import requests
from cryptography.fernet import Fernet # type: ignore
import subprocess
import shutil
import distro
##DISCLAIMER
ACCEPTANCE_FILE = '.disclaimer_accepted'
DISCLAIMER_TEXT = """\033[1;97m
Welcome to Xosint!!
Disclaimer:
The information contained on the Service is for general information purposes only.
The Company (TermuxHackz) assumes no responsibility for errors or omissions in the contents of the Service
In no event shall the Company (TermuxHackz) be liable for any special, direct, indirect, consequential, or incidental damages or any damages whatsoever, whether in an action of contract, negligence or other tort, arising out of or in connection with the use of the Service or the contents of the Service. The Company reserves the right to make additions, deletions, or modifications to the contents on the Service at any time without prior notice.
For more details, please visit:
https://bit.ly/3TeaSMn
By using this tool, you acknowledge and agree that you are solely responsible for your use of the tool.
The developer of this tool is not liable for any misuse or illegal activities conducted using this tool.
\033[0m"""
def check_disclaimer():
if not os.path.exists(ACCEPTANCE_FILE):
print(DISCLAIMER_TEXT)
user_input = input("\033[1;93m[+]\033[1;97m Do you accept the disclaimer? (yes/no): ").strip().lower()
if user_input == 'yes':
with open(ACCEPTANCE_FILE, 'w') as f:
f.write('accepted')
print("\033[1;93m[+]\033[1;97m Thank you for accepting the disclaimer.\033[0m")
os.chmod(ACCEPTANCE_FILE, 0o644)
sleep(1)
os.system("clear || cls")
else:
print("\033[1;91m[+]\033[1;92m You must accept the disclaimer to use X-Osint.\033[0m")
sys.exit(1)
##Exiftool
def check_exiftool_installed():
"""Check if ExifTool is installed."""
try:
result = subprocess.run(["exiftool", "-ver"], capture_output=True, text=True)
if result.returncode == 0:
print(f"ExifTool version {result.stdout.strip()} is already installed.")
return True
else:
return False
except FileNotFoundError:
return False
def install_exiftool_windows():
url = "https://exiftool.org/exiftool-12.66.zip"
zip_file = "exiftool.zip"
exe_file = "exiftool.exe"
# Download the ExifTool zip file
print("Downloading ExifTool...")
subprocess.run(["curl", "-L", "-o", zip_file, url], check=True)
# Extract the zip file
print("Extracting ExifTool...")
subprocess.run(["tar", "-xf", zip_file], check=True)
# Rename the executable
extracted_file = "exiftool(-k).exe"
os.rename(extracted_file, exe_file)
# Optionally, add to PATH (e.g., copying to C:\Windows)
# Uncomment the following line to copy to C:\Windows
# subprocess.run(["copy", exe_file, "C:\\Windows"], check=True)
print("ExifTool installed successfully on Windows!")
def install_exiftool_macos():
# Install ExifTool using Homebrew
print("Installing ExifTool via Homebrew...")
subprocess.run(["brew", "install", "exiftool"], check=True)
print("ExifTool installed successfully on macOS!")
def install_exiftool_linux():
distroName = ""
# Check if python version <= 3.5,
# platform.linux_distribution is deprecated since 3.5
# and removed since 3.7
if (sys.version_info[0] <= 3 and sys.version_info[1] <= 5):
distroName = platform.linux_distribution()[0].lower()
else:
distroName = distro.id()
if 'ubuntu' in distroName or 'debian' in distroName:
print("Installing ExifTool on Ubuntu/Debian...")
subprocess.run(["sudo", "apt-get", "update"], check=True)
subprocess.run(["sudo", "apt-get", "install", "-y", "libimage-exiftool-perl"], check=True)
elif 'centos' in distroName or 'rhel' in distroName:
print("Installing ExifTool on CentOS/RHEL...")
subprocess.run(["sudo", "yum", "install", "-y", "perl-Image-ExifTool"], check=True)
else:
print("Unsupported Linux distribution. Please install ExifTool manually.")
print("ExifTool installed successfully on Linux!")
def install_exiftool():
os_name = platform.system().lower()
if check_exiftool_installed():
print("ExifTool is already installed.")
return
if os_name == "windows":
install_exiftool_windows()
elif os_name == "darwin":
install_exiftool_macos()
elif os_name == "linux":
install_exiftool_linux()
else:
print(f"Unsupported OS: {os_name}. Please install ExifTool manually.")
##installpackage
def install_package(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])
# Check and install required packages
try:
import speedtest
except ImportError:
print("speedtest-cli not found. Installing...")
install_package('speedtest-cli')
import speedtest
try:
from ping3 import ping
except ImportError:
print("ping3 not found. Installing...")
install_package('ping3')
from ping3 import ping
try:
import spacy
except ImportError:
print("spaCy not found. Installing...")
install_package('spacy')
os.system("python -m spacy download en_core_web_sm")
import spacy
try:
from flask import Flask, render_template
except ImportError:
print("Flask not found. Installing...")
install_package('flask')
from flask import Flask, render_template
try:
from wifi import Cell, Scheme
except ImportError:
print("wifi not found. Installing...")
install_package('wifi')
from wifi import Cell, Scheme
try:
import qrcode
except ImportError:
print("qrcode not found. Installing...")
install_package('qrcode')
import qrcode
try:
install_exiftool()
except subprocess.CalledProcessError as e:
print(f"An error occurred during installation: {e}")
sys.exit(1)
except Exception as e:
print(f"An unexpected error occurred: {e}")
sys.exit(1)
def get_geoip_info(ip):
response = requests.get(f"https://ipinfo.io/{ip}/json")
return response.json()
def get_whois_info(ip):
response = requests.get(f"https://whois.arin.net/rest/ip/{ip}.json")
return response.json()
def dns_query(dns_ip, domain_query):
try:
result = socket.gethostbyname_ex(domain_query)
return result
except Exception as e:
return str(e)
def test_speed():
# Runs a speed test and returns download, upload speeds, and latency
st = speedtest.Speedtest()
st.get_best_server()
download_speed = st.download() / 1_000_000 # Convert to Mbps
upload_speed = st.upload() / 1_000_000 # Convert to Mbps
latency = st.results.ping
return download_speed, upload_speed, latency
#COLORS
RED = "\033[1;91m"
GREEN = "\033[1;92m"
YELLOW = "\033[1;93m"
BLUE = "\033[1;94m"
WHITE = "\033[1;97m"
RESET = "\033[0m"
##Metadatadef extract_metadata(file_path):
def extract_metadata(file_path):
try:
# Build and run the ExifTool command
command = ["exiftool", "-j", file_path]
##print(f"{BLUE}Running command:{RESET} {' '.join(command)}")
# Execute the command and capture output
result = subprocess.run(command, capture_output=True, text=True)
# Print raw output for debugging
#print(f"{YELLOW}Raw ExifTool output:{RESET} {result.stdout}")
# Check if the output is empty or invalid
if result.returncode != 0:
print(f"{RED}Error running ExifTool:{RESET} {result.stderr}")
return None
if not result.stdout:
print(f"{RED}Error:{RESET} No metadata was returned by ExifTool.")
return None
# Parse the JSON output
try:
metadata = json.loads(result.stdout)
except json.JSONDecodeError as e:
print(f"{RED}Error decoding JSON:{RESET} {e}")
return None
if len(metadata) > 0:
return metadata[0] # ExifTool returns a list of dictionaries
else:
print(f"{RED}Error:{RESET} Metadata list is empty.")
return None
except Exception as e:
print(f"{RED}Error extracting metadata:{RESET} {e}")
return None
def extract_specific_metadata(metadata):
if not metadata:
return {}
title = metadata.get("PDF:Title") or metadata.get("ID3:Title") or metadata.get("XMP:Title")
author = metadata.get("PDF:Author") or metadata.get("ID3:Artist") or metadata.get("XMP:Creator")
creation_date = (metadata.get("EXIF:CreateDate") or
metadata.get("PDF:CreationDate") or
metadata.get("ID3:Year") or
metadata.get("QuickTime:CreateDate") or
metadata.get("XMP:CreateDate"))
latitude = (metadata.get("Composite:GPSLatitude") or
metadata.get("EXIF:GPSLatitude") or
metadata.get("QuickTime:GPSLatitude") or
metadata.get("XMP:GPSLatitude"))
longitude = (metadata.get("Composite:GPSLongitude") or
metadata.get("EXIF:GPSLongitude") or
metadata.get("QuickTime:GPSLongitude") or
metadata.get("XMP:GPSLongitude"))
if latitude and longitude:
# Convert latitude and longitude from degrees and minutes to decimal degrees
latitude = convert_to_decimal_degrees(latitude)
longitude = convert_to_decimal_degrees(longitude)
return {
"Title": title,
"Author/Artist": author,
"Creation Date": creation_date,
"Location": (latitude, longitude) if latitude and longitude else None,
}
def convert_to_decimal_degrees(coord):
"""Convert GPS coordinates from degrees and minutes to decimal degrees."""
try:
if isinstance(coord, str):
coord = coord.replace("°", "").replace("'", "").replace('"', "").strip()
degrees, minutes = map(float, coord.split())
return degrees + (minutes / 60)
return coord
except ValueError:
return None
def print_all_metadata(metadata):
for key, value in metadata.items():
print(f"{BLUE}{key}:{RESET} {WHITE}{value}{RESET}")
def print_specific_metadata(specific_metadata):
for key, value in specific_metadata.items():
print(f"{BLUE}{key}:{RESET} {WHITE}{value}{RESET}")
def open_map_location(lat, lon):
# Google Maps URL
google_maps_url = f"https://www.google.com/maps?q={lat},{lon}"
# Apple Maps URL
apple_maps_url = f"https://maps.apple.com/?q={lat},{lon}"
print(f"{GREEN}Opening location in Google Maps:{RESET} {google_maps_url}")
webbrowser.open(google_maps_url)
print(f"{GREEN}Opening location in Apple Maps:{RESET} {apple_maps_url}")
webbrowser.open(apple_maps_url)
##network mpapping
app = Flask(__name__)
def scan_wifi_networks():
networks = []
try:
os_type = platform.system()
if os_type == "Linux":
scan_output = os.popen('sudo iwlist scan 2>/dev/null').read()
ssids = re.findall(r'ESSID:"(.*?)"', scan_output)
signals = re.findall(r'Signal level=(-\d+) dBm', scan_output)
networks = [{'ssid': ssid, 'signal': signal} for ssid, signal in zip(ssids, signals)]
elif os_type == "Darwin": # macOS
scan_output = subprocess.check_output(['/usr/sbin/system_profiler', 'SPNetworkDataType'], text=True)
ssids = re.findall(r'SSID: (.+)', scan_output)
signals = re.findall(r'RSSI: (-\d+)', scan_output)
networks = [{'ssid': ssid, 'signal': signal} for ssid, signal in zip(ssids, signals)]
else:
print("Unsupported OS")
except Exception as e:
print(f"Error scanning Wi-Fi networks: {e}")
return networks # Always return a list
def get_current_wifi():
try:
os_type = platform.system()
if os_type == "Linux":
return os.popen("iwgetid -r").read().strip()
elif os_type == "Darwin":
scan_output = subprocess.check_output(['/usr/sbin/system_profiler', 'SPNetworkDataType'], text=True)
match = re.search(r'SSID: (.+)', scan_output)
return match.group(1) if match else "Not Connected"
else:
return "Unsupported OS"
except Exception as e:
print(f"Error getting current Wi-Fi: {e}")
return "Unknown"
def generate_wifi_qr(ssid, password=None):
if ssid and ssid != "Not Connected":
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_L,
box_size=10,
border=4,
)
wifi_data = f"WIFI:S:{ssid};T:WPA;P:{password};;" if password else f"WIFI:S:{ssid};;"
qr.add_data(wifi_data)
qr.make(fit=True)
img = qr.make_image(fill='black', back_color='white')
img.save("static/wifi_qr.png")
@app.route('/')
def index():
return render_template('index.html')
@app.route('/network_mapper')
def network_mapper():
current_wifi = get_current_wifi()
wifi_networks = scan_wifi_networks()
print("Current Wi-Fi:", current_wifi)
print("Wi-Fi Networks:", wifi_networks)
generate_wifi_qr(current_wifi) # Generate QR code for current Wi-Fi
return render_template('network_mapper.html', current_wifi=current_wifi, wifi_networks=wifi_networks)
##Code Analysis
def run_command(command):
"""Run a command in the shell and return its output."""
result = subprocess.run(command, shell=True, capture_output=True, text=True)
return result.stdout.strip(), result.stderr.strip()
def analyze_python_file(file_path):
"""Analyze a Python file for errors using pylint and flake8."""
print(f"\033[1;93m[+]\033[1;97m Analyzing Python file: {file_path}")
print("")
pylint_command = f"pylint {file_path}"
flake8_command = f"flake8 {file_path}"
pylint_output, pylint_errors = run_command(pylint_command)
flake8_output, flake8_errors = run_command(flake8_command)
if pylint_errors:
print(f"\033[1;91m[!]\033[1;97m Pylint errors:\n{pylint_errors}")
print("")
else:
print(f"\033[1;91m[+]\033[1;97m Pylint output:\n{pylint_output}")
if flake8_errors:
print(f"\033[1;91m[+]\033[1;97m Flake8 errors:\n{flake8_errors}")
else:
print(f"\033[1;91m[+]\033[1;97m Flake8 output:\n{flake8_output}")
def analyze_javascript_file(file_path):
"""Analyze a JavaScript file for errors using eslint."""
print(f"\033[1;91m[+]\033[1;97m Analyzing JavaScript file: {file_path}")
eslint_command = f"eslint {file_path}"
eslint_output, eslint_errors = run_command(eslint_command)
if eslint_errors:
print(f"\033[1;91m[+]\033[1;97m ESLint errors:\n{eslint_errors}")
else:
print(f"\033[1;91m[+]\033[1;97m ESLint output:\n{eslint_output}")
##Check for updates from GIthub Repo
##Fetchupdates
def get_latest_commit(repo_owner, repo_name):
url = f"https://api.github.com/repos/{repo_owner}/{repo_name}/commits/master"
response = requests.get(url)
response.raise_for_status()
return response.json()['sha']
def get_local_commit():
result = subprocess.run(['git', 'rev-parse', 'HEAD'], capture_output=True, text=True)
return result.stdout.strip()
def update_repo():
subprocess.run(['git', 'fetch', 'origin'], check=True)
subprocess.run(['git', 'reset', '--hard', 'origin/master'], check=True)
def copy_to_bin(script_name):
bin_path = '/usr/local/bin'
script_path = os.path.join(os.getcwd(), script_name)
target_path = os.path.join(bin_path, script_name)
if os.path.exists(script_path):
shutil.copy(script_path, target_path)
# Ensure the script is executable
os.chmod(target_path, 0o755)
else:
print(f"\033[1;91m[!]\033[1;97m Script {script_name} not found in the current directory.\033[0m")
def restart_script():
python = sys.executable
os.execl(python, python, *sys.argv)
def check_for_updates(repo_owner, repo_name, script_name):
try:
latest_commit = get_latest_commit(repo_owner, repo_name)
local_commit = get_local_commit()
if latest_commit != local_commit:
print("Update available. Updating...")
update_repo()
copy_to_bin(script_name)
restart_script()
else:
print("\033[1;91m[+]\033[1;97m Already up-to-date.")
except requests.RequestException as e:
print(f"\033[1;91m[!]\033[1;97m Failed to fetch latest commit: {e}")
except subprocess.CalledProcessError as e:
print(f"\033[1;91m[!]\033[1;97m Failed to update repo: {e}")
def update_script():
repo_owner = "TermuxHackz"
repo_name = "X-Osint"
script_name = "xosint"
# Check for updates
check_for_updates(repo_owner, repo_name, script_name)
# Your existing script logic here
print("\033[1;91m[+]\033[1;97m Running main script...")
time.sleep(0.5)
# Define the ImageSearchApp function
API_KEY_FILE = "api_keys.txt"
def save_api_keys(api_key, search_engine_id):
with open(API_KEY_FILE, "w") as f:
f.write(f"{api_key}\n{search_engine_id}")
def load_api_keys():
if os.path.exists(API_KEY_FILE):
with open(API_KEY_FILE, "r") as f:
keys = f.read().splitlines()
if len(keys) == 2:
return keys[0], keys[1]
return None, None
def image_hunt():
root = tk.Tk()
root.title("Reverse Image Search")
# Add title label
title_label = tk.Label(root, text="Reverse Image Search", font=("Arial", 18, "bold"))
title_label.pack(pady=10)
# Ask user if they want to watch a demo
response = messagebox.askquestion("Demo", "Kindly watch a video on how to get your API keys?")
if response == 'yes':
# Open YouTube video in web browser
webbrowser.open("https://youtu.be/g2WU0aFExMM")
# Add upload button
upload_button = tk.Button(root, text="Upload Image", command=lambda: upload_image(root), font=("Arial", 12, "bold"))
upload_button.pack(pady=20)
# Add image label
global image_label
image_label = tk.Label(root)
image_label.pack(pady=10)
# Add result label
global result_label
result_label = tk.Label(root, text="")
result_label.pack(pady=10)
root.protocol("WM_DELETE_WINDOW", lambda: on_closing(root))
root.mainloop()
def upload_image(root):
api_key, search_engine_id = load_api_keys()
if not api_key or not search_engine_id:
api_key = simpledialog.askstring("API Key", "Enter your Google Custom Search API Key:")
search_engine_id = simpledialog.askstring("Search Engine ID", "Enter your Google Custom Search Engine ID:")
if api_key and search_engine_id:
save_api_keys(api_key, search_engine_id)
else:
messagebox.showerror("Error", "API key and Search Engine ID are required.")
return
file_path = filedialog.askopenfilename(filetypes=[("Image files", "*.jpg *.png")])
if file_path:
try:
image = Image.open(file_path)
image = image.resize((400, 400), Image.LANCZOS)
photo = ImageTk.PhotoImage(image)
image_label.config(image=photo)
image_label.image = photo # Keep a reference to avoid garbage collection
google_results = reverse_image_search_google(api_key, search_engine_id, file_path)
show_results(google_results)
except Exception as e:
messagebox.showerror("Error", str(e))
def reverse_image_search_google(api_key, search_engine_id, image_path):
service = build("customsearch", "v1", developerKey=api_key)
with open(image_path, "rb") as image_file:
image_content = base64.b64encode(image_file.read()).decode('utf-8')
search_response = service.cse().list(
q='',
cx=search_engine_id,
searchType='image',
num=10
).execute()
results = []
if 'items' in search_response:
for item in search_response['items']:
results.append(item['link'])
return results
def show_results(google_results):
if google_results:
google_text = "Google Search Results:\n" + "\n".join(google_results[:5])
else:
google_text = "No Google search results found."
result_label.config(text=google_text)
def on_closing(root):
root.destroy()
exit()
###Add News OSint script here
def get_news_articles(query, api_key):
url = f'https://newsapi.org/v2/everything?q={query}&apiKey={api_key}'
response = requests.get(url)
if response.status_code == 200:
return response.json()['articles']
else:
print(f"Error: {response.status_code}")
return []
def newsOsint():
api_key = 'a701b803d0ac4fc89aaded6143de644d'
# Prompt the user to input a name
name = input("\033[1;91m[+]\033[1;97mEnter the name you want to search for: \033[0m")
# Fetch news articles related to the input name
articles = get_news_articles(name, api_key)
# Display the articles
if articles:
print(f"\nNews articles about {name}:\n")
for i, article in enumerate(articles, start=1):
print(f"{i}. {article['title']}")
print(f" Source: {article['source']['name']}")
print("")
print(f" Link: {article['url']}\n")
else:
print("No articles found.")
###Phone number Location
def get_api_keys():
if os.path.exists('numandcage_keys.txt'):
with open('numandcage_keys.txt', 'r') as file:
keys = file.readlines()
if len(keys) == 4:
ipqualityscore_api_key = keys[0].strip()
opencage_api_key = keys[1].strip()
vonage_api_key = keys[2].strip()
vonage_api_secret = keys[3].strip()
else:
ipqualityscore_api_key, opencage_api_key, vonage_api_key, vonage_api_secret = get_and_save_api_keys()
else:
ipqualityscore_api_key, opencage_api_key, vonage_api_key, vonage_api_secret = get_and_save_api_keys()
return ipqualityscore_api_key, opencage_api_key, vonage_api_key, vonage_api_secret
def get_and_save_api_keys():
while True:
ipqualityscore_api_key = input("\033[1;91m[\033[1;33;40m*\033[0m\033[1;91m] \033[1;97m Enter your IPQualityScore API key: \033[0m").strip()
opencage_api_key = input("\033[1;91m[\033[1;33;40m*\033[0m\033[1;91m] \033[1;97m Enter your OpenCage API key: \033[0m").strip()
vonage_api_key = input("\033[1;91m[\033[1;33;40m*\033[0m\033[1;91m] \033[1;97m Enter your Vonage API key: \033[0m").strip()
vonage_api_secret = input("\033[1;91m[\033[1;33;40m*\033[0m\033[1;91m] \033[1;97m Enter your Vonage API secret: \033[0m").strip()
if ipqualityscore_api_key and opencage_api_key and vonage_api_key and vonage_api_secret:
with open('numandcage_keys.txt', 'w') as file:
file.write(f"{ipqualityscore_api_key}\n{opencage_api_key}\n{vonage_api_key}\n{vonage_api_secret}")
return ipqualityscore_api_key, opencage_api_key, vonage_api_key, vonage_api_secret
else:
print("\033[1;91m[\033[1;33;40m!\033[0m\033[1;91m] \033[1;97m Please enter valid API keys. \033[0m")
def get_phone_info(phone_number, ipqualityscore_api_key, vonage_api_key, vonage_api_secret):
ipqualityscore_url = f"https://ipqualityscore.com/api/json/phone/{ipqualityscore_api_key}/{phone_number}"
response = requests.get(ipqualityscore_url)
ipqualityscore_info = response.json()
vonage_url = f"https://api.nexmo.com/ni/advanced/async/json"
vonage_params = {
'api_key': vonage_api_key,
'api_secret': vonage_api_secret,
'number': phone_number
}
response = requests.get(vonage_url, params=vonage_params)
vonage_info = response.json()
phone_info = {**ipqualityscore_info, **vonage_info} # Merge dictionaries
return phone_info
def get_location_info(country_code, location, opencage_api_key):
opencage_url = f"https://api.opencagedata.com/geocode/v1/json?q={location}&countrycode={country_code}&key={opencage_api_key}"
response = requests.get(opencage_url)
return response.json()
def is_valid_phone_number(phone_number):
# Basic validation to check if phone number includes a country code and is numeric
if phone_number.startswith('+') and phone_number[1:].isdigit():
return True
return False
def open_in_maps(latitude, longitude):
choice = input("\033[1;91m[\033[1;33;40m*\033[0m\033[1;91m] \033[1;97m Would you like to open the location in Google Maps or Apple Maps? (Enter 'google' or 'apple'): \033[0m").strip().lower()
if choice == 'google':
webbrowser.open(f"https://www.google.com/maps/search/?api=1&query={latitude},{longitude}")
elif choice == 'apple':
webbrowser.open(f"https://maps.apple.com/?q={latitude},{longitude}")
else:
print("Invalid choice. Skipping map opening.")
def phone_inf():
ipqualityscore_api_key, opencage_api_key, vonage_api_key, vonage_api_secret = get_api_keys()
while True:
print("")
phone_number = input("\033[1;91m[\033[1;33;40m+\033[0m\033[1;91m] \033[1;93m Enter the phone number (with country code, e.g., +1234567890): \033[0m").strip()
if is_valid_phone_number(phone_number):
break
else:
print("\033[1;91m[\033[1;33;40m!\033[0m\033[1;91m] \033[1;97mPlease enter a valid phone number with country code.")
phone_info = get_phone_info(phone_number, ipqualityscore_api_key, vonage_api_key, vonage_api_secret)
if phone_info.get('valid', False):
print("")
print(f"\033[1;91m➤\033[1;97mPhone Number : {phone_info.get('phone_number', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mCountry : {phone_info.get('country', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mLocation : {phone_info.get('location', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mCarrier : {phone_info.get('carrier', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mLine Type : {phone_info.get('line_type', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mRisk Score : {phone_info.get('risk_score', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mSpammer : {phone_info.get('spammer', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mActive : {phone_info.get('active', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mRecent Abuse : {phone_info.get('recent_abuse', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mFraud Score : {phone_info.get('fraud_score', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mPorted : {phone_info.get('ported', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mCaller Type : {phone_info.get('caller_type', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mCaller Name : {phone_info.get('caller_name', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mRoaming : {phone_info.get('roaming', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mReachable : {phone_info.get('reachable', 'N/A')}")
print("")
print(f"\033[1;91m➤\033[1;97mHandset Status : {phone_info.get('handset_status', 'N/A')}")
print("")
if phone_info.get('country_code', False) and phone_info.get('location', False):
location_info = get_location_info(phone_info['country_code'], phone_info['location'], opencage_api_key)
if location_info['results']:
location = location_info['results'][0]['geometry']
latitude = location['lat']
longitude = location['lng']
print(f"Latitude: {latitude}, Longitude: {longitude}")
# Ask the user if they want to open the location in maps
open_in_maps(latitude, longitude)
else:
print("Could not find location information.")
else:
print("Invalid phone number or failed to retrieve phone number information.")
####Second Method for Phone Number
def find_api_keys():
if os.path.exists('numandcage_keys.txt'):
with open('numandcage_keys.txt', 'r') as file:
keys = file.readlines()
if len(keys) == 2:
numverify_api_key = keys[0].strip()
opencage_api_key = keys[1].strip()
else:
numverify_api_key, opencage_api_key = find_and_save_keys()
else:
numverify_api_key, opencage_api_key = find_and_save_keys()
return numverify_api_key, opencage_api_key
def find_and_save_keys():
while True:
numverify_api_key = input("\033[1;91m[\033[1;33;40m+\033[0m\033[1;91m] \033[1;93m Enter your Numverify API key: \033[0m").strip()
opencage_api_key = input("\033[1;91m[\033[1;33;40m+\033[0m\033[1;91m] \033[1;93m Enter your OpenCage API key: \033[0m").strip()
if numverify_api_key and opencage_api_key:
with open('numandcage_keys.txt', 'w') as file:
file.write(f"{numverify_api_key}\n{opencage_api_key}")
return numverify_api_key, opencage_api_key
else:
print("\033[1;91m[\033[1;33;40m!\033[0m\033[1;91m] \033[1;93mPlease enter valid API keys.")
def find_phone_info(phone_number, numverify_api_key):
numverify_url = f"http://apilayer.net/api/validate?access_key={numverify_api_key}&number={phone_number}"
response = requests.get(numverify_url)
return response.json()
def find_location_info(country_code, location, opencage_api_key):
opencage_url = f"https://api.opencagedata.com/geocode/v1/json?q={location}&countrycode={country_code}&key={opencage_api_key}"
response = requests.get(opencage_url)
return response.json()
def phone_inf2():
numverify_api_key, opencage_api_key = find_api_keys()
phone_number = input("\033[1;97m[+]\033[0m\033[1;91m Enter the phone number: \033[0m")
print("")
phone_info = find_phone_info(phone_number, numverify_api_key)
if phone_info['valid']:
print(f"\033[1;91m➤\033[1;97mPhone Number : {phone_info['international_format']}")
print("")
print(f"\033[1;91m➤\033[1;97mCountry : {phone_info['country_name']}")
print("")
print(f"\033[1;91m➤\033[1;97m Valid : {phone_info['valid']}")
print("")
print(f"\033[1;91m➤\033[1;97mLocation : {phone_info['location']}")
print("")
print(f"\033[1;91m➤\033[1;97mCarrier : {phone_info['carrier']}")
print("")
print(f"\033[1;91m➤\033[1;97mLine Type : {phone_info['line_type']}")
print("")
print(f"\033[1;91m➤\033[1;97mCountry Prefix : {phone_info['country_prefix']}")
print("")
print(f"\033[1;91m➤\033[1;97mLocal format : {phone_info['local_format']}")
print("")
print(f"\033[1;91m➤\033[1;97mCountry Code : {phone_info['country_code']}")
print("")
location_info = find_location_info(phone_info['country_code'], phone_info['location'], opencage_api_key)
if location_info['results']:
location = location_info['results'][0]['geometry']
print(f"Latitude: {location['lat']}, Longitude: {location['lng']}")
else:
print("Could not find location information.")
else:
print("Invalid phone number.")
RED = "\033[91m"
GREEN = "\033[92m"
BLUE = "\033[94m"
WHITE = "\033[0;37m"
class bcolors:
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
BOLD = '\033[1m'
ENDC = '\033[0m'
class colors:
CRED2 = "\33[91m"
CBLUE2 = "\33[94m"
ENDC = "\033[0m"
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
tookie_banner = ("""\033[32m
,,,,,
╓▄▓▓▓███████████▓▓▓▄╥
▄▓███▓▀╨╙└ └╙╙▀▓███▌▄
▄▓██▓╨─ ,▄▄▄▌▓▓▌▌▄▄╥, ╙▀██▓▄
Φ██▓╨ ╔ ╓▄▓▓▀▀╙├,,,,,,,├╙▀█▓▄ ╙▓██▌
▄██▓└ ╓▓██▄,=░░░░░░░░░░░░░░»└▓█─ └▓██▄
,▓██╨ æ ╓▓█▀┤░░░▒▒▄╣╣▓╣╣▒▒▒▒▒░░▄▓██▄ ╙██▓
╒███ ,▓█╬░░░░░░╫▓██▀▀▀██▓╬╠╠╫██└ ╙██⌐ ^███
███ ╓ ╔█▓╟╣╬░░░▒╫▓█╜]▄╫█▄╫█▓╬▓█▀ ▓█─ ███
▓██ ▐████╬░░░╚╙╠╫█Q'╝█▓┌╫█▓██▄░ █▌ ╚██▌
]██▌ φ─ ▀▓█▓▒▒▄╠▒»,╔▒╬██▓▌▓██▓█▌╙▓▓▌▄▄░ █▌ ███
╫██Γ ██╠▓▓▓▒▒▒▒ ▒▒╬╬╩▒╫▓█▌ ╓▓██▒╫█⌐ ▓██
╫██µ ╫█▓███▒▒▒▒▒▒▒▒▒▒╣╬▒▒╠▓██▓▓██▀ ███╙ ╙▀ ╫██
╟██▄ " ▀███╬▓██▒▒▒▓▒▒▒▒╩▓▓▓▄╠▓████▌ ▀╙ ⁿ ███
███ ~ .██╬▓█▓████▒▒▒▒▒▒▒╣▓█████████, ªÆ ]██▓
▓██▄ , ╫█████▓╬▓██▒▒▓▓▒▒▒▓▒╠╬▀▓▓▓████µ ╓µ ███
███▄ └` ▄███▓███████████▓▓█▓▒▒▒▓▌▒▒███┴ ▓██▀
███▄ ╟███████▓╬█▓╬╬╣████▓██▓▓████████µ ,███▀
▀███┬▐███████████▓▓███████████▓█▓▓███ ▄███Γ
└██████▓▓███████████████▓██▓▓███████▒▄███▀
└▓███████▓▓▓██▓▓████▓▓███████████████▀
▀██████████████████████████████▀╙
╙▀██████████████████████▀▀─
╙╙▀▀▓███████▀▀▀╙└
\033[0m""")
banner = ("""\033[38;5;208m
▒██ ██▒ ▒█████ ██████ ██▓ ███▄ █ ▄▄▄█████▓
▒▒ █ █ ▒░▒██▒ ██▒▒██ ▒ ▓██▒ ██ ▀█ █ ▓ ██▒ ▓▒
░░ █ ░▒██░ ██▒░ ▓██▄ ▒██▒▓██ ▀█ ██▒▒ ▓██░ ▒░
░ █ █ ▒ ▒██ ██░ ▒ ██▒░██░▓██▒ ▐▌██▒░ ▓██▓ ░
▒██▒ ▒██▒░ ████▓▒░▒██████▒▒░██░▒██░ ▓██░ ▒██▒ ░
▒▒ ░ ░▓ ░░ ▒░▒░▒░ ▒ ▒▓▒ ▒ ░░▓ ░ ▒░ ▒ ▒ ▒ ░░
░░ ░▒ ░ ░ ▒ ▒░ ░ ░▒ ░ ░ ▒ ░░ ░░ ░ ▒░ ░
░ ░ ░ ░ ░ ▒ ░ ░ ░ ▒ ░ ░ ░ ░ ░
░ ░ ░ ░ ░ ░ ░
\033[1;37mAn Open Source Intelligence Framework
Created by: AnonyminHack5
Team: TermuxHackz Society\033[0m
Version: \033[1;92m2.3\033[0m
\033[1;97mPlatform: \033[0m\033[1;96m""" + platform.system())
for col in banner:
print(colors.CRED2 + col, end="")
sys.stdout.flush()
time.sleep(0.0025)
main_menu = ("""
\033[1;91m[??] Choose an option:
\033[1;91m[\033[1;33;40m1\033[0m\033[1;91m] \033[1;97m IP Address Info
\033[1;91m[\033[1;33;40m2\033[0m\033[1;91m] \033[1;97m Email Address Info
\033[1;91m[\033[1;33;40m3\033[0m\033[1;91m] \033[1;97m Extract Location from Image
\033[1;91m[\033[1;33;40m4\033[0m\033[1;91m] \033[1;97m Host Search
\033[1;91m[\033[1;33;40m5\033[0m\033[1;91m] \033[1;97m Ports
\033[1;91m[\033[1;33;40m6\033[0m\033[1;91m] \033[1;97m Exploit CVE
\033[1;91m[\033[1;33;40m7\033[0m\033[1;91m] \033[1;97m Exploit O.S.V.D
\033[1;91m[\033[1;33;40m8\033[0m\033[1;91m] \033[1;97m DNS Lookup
\033[1;91m[\033[1;33;40m9\033[0m\033[1;91m] \033[1;97m DNS Reverse
\033[1;91m[\033[1;33;40m10\033[0m\033[1;91m] \033[1;97mEmail Finder \033[1;91m[\033[1;33;40m101\033[0m\033[1;91m] \033[1;97mWhat's New?
\033[1;91m[\033[1;33;40m11\033[0m\033[1;91m] \033[1;97mMetadata Extraction\033[1;91m[\033[1;92mNEW\033[0m\033[1;91m]
\033[1;91m[\033[1;33;40m12\033[0m\033[1;91m]\033[1;97m Check Twitter Status
\033[1;91m[\033[1;33;40m13\033[0m\033[1;91m]\033[1;97m Subdomain Enumeration
\033[1;91m[\033[1;33;40m14\033[0m\033[1;91m]\033[1;97m Google Dork Hacking
\033[1;91m[\033[1;33;40m15\033[0m\033[1;91m]\033[1;97m SMTP Analysis
\033[1;91m[\033[1;33;40m16\033[0m\033[1;91m]\033[1;97m Check Global InfoStealer Attack
\033[1;91m[\033[1;33;40m17\033[0m\033[1;91m]\033[1;97m Dark Web Search
\033[1;91m[\033[1;33;40m18\033[0m\033[1;91m]\033[38;5;208m Next Tools >
\033[1;91m[\033[1;33;40m19\033[0m\033[1;91m]\033[1;97m Report bugs
\033[1;91m[\033[1;33;40m99\033[0m\033[1;91m]\033[1;97m Update X-osint
\033[1;91m[\033[1;33;40m100\033[0m\033[1;91m]\033[1;97m About
\033[1;91m[\033[1;33;40m00\033[0m\033[1;91m]\033[1;97m Quit
""")
about = """\033[1;90m
This is an osint tool which gathers useful and yet credible valid information about a phone number, user email address and ip address, \nVIN, Protonmail account and so much more, X-osint is an Open source intelligence framework, \nfeel free to clone this repo, if you have features you would like to add or any fixes please open an issue or create a merge
\033[0m"""
def traceip():
targetip = input("\033[1;91mEnter IP Address: \033[0m")
r = requests.get("http://ip-api.com/json/" + targetip)
print("\n\033[1;91m[*]\033[1;97m IP detail is given down below\n")
#print()
sleep(0.1)
print("\033[1;92m \033[1;91m➤\033[1;97m Status Code : " + str(r.status_code))
sleep(0.1)
if str(r.json() ['status']) == 'success':
print(" \033[1;91m➤\033[1;97m Status :\033[1;92m " + str(r.json() ['status']))
sleep(0.1)