Advertisement
egfw

egfw tool

Jan 25th, 2024 (edited)
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 7.55 KB | None | 0 0
  1. import os
  2. import subprocess
  3. import requests
  4. import json
  5. import random
  6. import time
  7. import string
  8. import socket
  9.  
  10. try:
  11.     import gratient
  12.     from colorama import Fore, Back, Style
  13. except ImportError:
  14.     print("Installing required modules...")
  15.     os.system('pip install gratient colorama')
  16.     print("Modules installed. Please restart the script.")
  17.     exit()
  18.  
  19. def apply_gradient(text, color1, color2):
  20.     gradient_text = f"{getattr(Fore, color1.upper())}{getattr(Back, color2.upper())}{text}{Style.RESET_ALL}"
  21.     return gradient_text
  22.  
  23. def print_gradient(text, color1, color2):
  24.     gradient_text = apply_gradient(text, color1, color2)
  25.     print(gradient_text)
  26.  
  27. try:
  28.     import gratient
  29. except ImportError:
  30.     print("Installing required modules...")
  31.     os.system('pip install gratient')
  32.     print("Modules installed. Please restart the script.")
  33.     exit()
  34.  
  35. def display_title():
  36.     FEDS_METHOD = """
  37.      
  38.                                                                          
  39. ███████╗░██████╗░███████╗░██╗░░░░░░░██╗  ████████╗░█████╗░░█████╗░██╗░░░░░
  40. ██╔════╝██╔════╝░██╔════╝░██║░░██╗░░██║  ╚══██╔══╝██╔══██╗██╔══██╗██║░░░░░
  41. █████╗░░██║░░██╗░█████╗░░░╚██╗████╗██╔╝  ░░░██║░░░██║░░██║██║░░██║██║░░░░░
  42. ██╔══╝░░██║░░╚██╗██╔══╝░░░░████╔═████║░  ░░░██║░░░██║░░██║██║░░██║██║░░░░░
  43. ███████╗╚██████╔╝██║░░░░░░░╚██╔╝░╚██╔╝░  ░░░██║░░░╚█████╔╝╚█████╔╝███████╗
  44. ╚══════╝░╚═════╝░╚═╝░░░░░░░░╚═╝░░░╚═╝░░  ░░░╚═╝░░░░╚════╝░░╚════╝░╚══════╝                                    
  45.                                                            cord : egfw
  46.                                                  
  47.                                                        
  48.        """
  49.  
  50.     gratient_text = gratient.blue(egfw tool)
  51.     print(gratient_text)
  52.  
  53. def display_options():
  54.     FEDS_OPTIONS = """
  55.  
  56.  
  57.          6 : IP LOOKUP
  58.          8 : exit
  59.  
  60.  
  61.  
  62.  
  63.        """
  64.     gratient_text = gratient.blue(egfw options)
  65.     print(gratient_text)
  66.  
  67. try:
  68.     import requests
  69. except ImportError:
  70.     print("Installing required modules...")
  71.     os.system('pip install requests')
  72.     print("Modules installed. Please restart the script.")
  73.     exit()
  74.  
  75. try:
  76.     import gratient
  77. except ImportError:
  78.     print("Installing required modules...")
  79.     os.system('pip install gratient')
  80.     print("Modules installed. Please restart the script.")
  81.     exit()
  82.  
  83. try:
  84.     from colorama import Fore, Back, Style
  85. except ImportError:
  86.     print("Installing required modules...")
  87.     os.system('pip install colorama')
  88.     print("Modules installed. Please restart the script.")
  89.     exit()
  90.  
  91. sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  92.  
  93. def send_packet(ip, port):
  94.     sock.sendto(b"X"*1024, (ip, port))
  95.     print("Packet sent to", ip)
  96.  
  97. def send_packets_continuously(ip, port, num_packets=1000):
  98.     for _ in range(num_packets):
  99.         send_packet(ip, port)
  100.  
  101. def check_ip():
  102.     subprocess.run(['ipconfig'])
  103.     input("Press Enter to continue...")
  104.  
  105. def ping_ip():
  106.     target_ip = input("Enter the IP address to ping: ")
  107.     subprocess.run(['ping', target_ip])
  108.     input("Press Enter to continue...")
  109.  
  110. def generate_nitro():
  111.     num_codes = int(input("Enter the number of Nitro codes to generate: "))
  112.     generate_to_file = input("Do you want to save the codes to 'nitro_codes.txt'? (yes/no): ").lower() == 'yes'
  113.  
  114.     nitro_codes = [f'https://discord.gift/{"".join([random.choice(string.ascii_uppercase + string.digits) for _ in range(16)])}' for _ in range(num_codes)]
  115.  
  116.     if generate_to_file:
  117.         file_path = 'nitro_codes.txt'
  118.         with open(file_path, 'a') as file:
  119.             file.write('\n'.join(nitro_codes))
  120.         print(f"Codes saved to {os.path.abspath(file_path)}")
  121.     else:
  122.         print('\n'.join(nitro_codes))
  123.  
  124.     input("Press Enter to continue...")
  125.  
  126. def url_shortener():
  127.     url = input("Enter the URL to shorten: ")
  128.     response = requests.get(f'http://tinyurl.com/api-create.php?url={url}')
  129.     print(f'Shortened URL: {response.text}')
  130.     input("Press Enter to continue...")
  131.  
  132. def grab_ip_send_webhook():
  133.     webhook_url = input("Enter your webhook URL: ")
  134.  
  135.     if not webhook_url:
  136.         print("Please enter a valid Discord webhook URL.")
  137.         input("Press Enter to continue...")
  138.         return
  139.  
  140.     ip = input("Enter an IP address to lookup: ")
  141.     url_template = "https://ipinfo.io/%s/json"
  142.  
  143.     try:
  144.         response = requests.get(url_template % ip)
  145.         data = response.json()
  146.  
  147.         payload = {
  148.             "content": f"IP Geolocation:\n```\n{json.dumps(data, indent=2)}\n```"
  149.         }
  150.  
  151.         requests.post(webhook_url, headers={"Content-Type": "application/json"}, data=json.dumps(payload))
  152.         print("IP Geolocation sent to webhook successfully!")
  153.  
  154.     except Exception as e:
  155.         print(f"Error: {e}. Please check if the IP is valid or if there are any connection issues.")
  156.  
  157.     input("Press Enter to continue...")
  158.  
  159. def ip_geo_lookup():
  160.     ip = input("Enter an IP address to lookup: ")
  161.     url_template = "https://ipinfo.io/%s/json"
  162.  
  163.     try:
  164.         response = requests.get(url_template % ip)
  165.         data = response.json()
  166.  
  167.         print(json.dumps(data, indent=2))
  168.  
  169.     except KeyError as e:
  170.         print(f"KeyError: {e}. Please check if the data structure has the required keys.")
  171.  
  172.     input("Press Enter to continue...")
  173.  
  174. def typing_effect(text):
  175.     for i in range(len(text)):
  176.         replaced_text = text[:i] + '^' + text[i+1:]
  177.         print(f"\r{replaced_text}", end='', flush=True)
  178.         time.sleep(0.1)
  179.     print(f"\r{text}", end='', flush=True)
  180.  
  181. def moving_banner_effect():
  182.     while True:
  183.         os.system('cls' if os.name == 'nt' else 'clear')
  184.         display_title()
  185.         display_options()
  186.  
  187. if __name__ == "__main__":
  188.     os.system('title .gg/fedsmethod')
  189.     while True:
  190.         os.system('cls' if os.name == 'nt' else 'clear')
  191.         display_title()
  192.         display_options()
  193.         typing_effect("Enter your choice: ")
  194.  
  195.         choice = input()
  196.  
  197.         if choice == "1":
  198.             check_ip()
  199.         elif choice == "2":
  200.             ping_ip()
  201.         elif choice == "3":
  202.             generate_nitro()
  203.         elif choice == "4":
  204.             url_shortener()
  205.         elif choice == "5":
  206.             grab_ip_send_webhook()
  207.         elif choice == "6":
  208.             ip_geo_lookup()
  209.         elif choice == "7":  
  210.             target_ip = input("Enter the target IP address: ")
  211.             target_port = int(input("Enter the target port: "))
  212.             send_packets_continuously(target_ip, target_port)
  213.         elif choice == "8":  
  214.             break
  215.         else:
  216.             print_gradient("Invalid choice. Please enter a valid option.", 'red', 'yellow')
  217.             input("Press Enter to continue...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement