Spaces:
Sleeping
Sleeping
| 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() | |