Spaces:
Running
Running
File size: 4,779 Bytes
257dfc5 |
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 |
import gradio as gr
import requests
import phonenumbers
from phonenumbers import geocoder, carrier, timezone
import json
def track_ip(ip_address):
try:
response = requests.get(f"http://ip-api.com/json/{ip_address}")
data = response.json()
if data['status'] == 'success':
result = f"""IP Tracking Results:
Country: {data['country']}
Region: {data['regionName']}
City: {data['city']}
ZIP: {data['zip']}
Latitude: {data['lat']}
Longitude: {data['lon']}
ISP: {data['isp']}
Organization: {data['org']}
AS: {data['as']}"""
return result
else:
return "Error: Invalid IP address or tracking failed."
except Exception as e:
return f"Error: {str(e)}"
def track_phone(phone_number):
try:
# Parse the phone number
parsed_number = phonenumbers.parse(phone_number, None)
# Validate the phone number
if not phonenumbers.is_valid_number(parsed_number):
return "Error: Invalid phone number."
# Get location
location = geocoder.description_for_number(parsed_number, "en")
# Get carrier
carrier_name = carrier.name_for_number(parsed_number, "en")
# Get timezone
timezones = timezone.time_zones_for_number(parsed_number)
# Check if number is valid
is_valid = phonenumbers.is_valid_number(parsed_number)
# Check if number is possible
is_possible = phonenumbers.is_possible_number(parsed_number)
result = f"""Phone Tracking Results:
Number: {phone_number}
Valid: {is_valid}
Possible: {is_possible}
Location: {location}
Carrier: {carrier_name}
Timezones: {', '.join(timezones)}"""
return result
except Exception as e:
return f"Error: {str(e)}"
def track_username(username):
try:
# List of social media platforms to check
platforms = {
"GitHub": f"https://github.com/{username}",
"Twitter": f"https://twitter.com/{username}",
"Instagram": f"https://instagram.com/{username}",
"Reddit": f"https://reddit.com/user/{username}",
"Facebook": f"https://facebook.com/{username}",
}
results = []
for platform, url in platforms.items():
try:
response = requests.get(url, timeout=5)
if response.status_code == 200:
results.append(f"{platform}: Found - {url}")
else:
results.append(f"{platform}: Not Found")
except:
results.append(f"{platform}: Not Found")
return "\n".join(results)
except Exception as e:
return f"Error: {str(e)}"
with gr.Blocks(title="GhostTrack - OSINT Tool") as demo:
gr.Markdown("""
# GhostTrack - OSINT Information Gathering Tool
Useful tool to track location or mobile number. This tool can be used for OSINT (Open Source Intelligence) and information gathering.
""")
with gr.Tab("IP Tracker"):
gr.Markdown("""
### IP Address Tracker
Enter an IP address to get geolocation and ISP information.
""")
ip_input = gr.Textbox(label="IP Address", placeholder="Enter IP address (e.g., 8.8.8.8)")
ip_output = gr.Textbox(label="Tracking Results", lines=12)
ip_button = gr.Button("Track IP")
ip_button.click(fn=track_ip, inputs=ip_input, outputs=ip_output)
with gr.Tab("Phone Tracker"):
gr.Markdown("""
### Phone Number Tracker
Enter a phone number with country code to get location and carrier information.
""")
phone_input = gr.Textbox(label="Phone Number", placeholder="Enter phone number with country code (e.g., +1234567890)")
phone_output = gr.Textbox(label="Tracking Results", lines=12)
phone_button = gr.Button("Track Phone")
phone_button.click(fn=track_phone, inputs=phone_input, outputs=phone_output)
with gr.Tab("Username Tracker"):
gr.Markdown("""
### Username Tracker
Enter a username to check its presence on various social media platforms.
""")
username_input = gr.Textbox(label="Username", placeholder="Enter username (e.g., johnsmith)")
username_output = gr.Textbox(label="Tracking Results", lines=12)
username_button = gr.Button("Track Username")
username_button.click(fn=track_username, inputs=username_input, outputs=username_output)
gr.Markdown("""
---
**Note:** This tool is for educational purposes only. Please use responsibly and ethically.
""")
if __name__ == "__main__":
demo.launch()
|