Python253

is_valid_ip

Mar 3rd, 2024 (edited)
1,060
0
Never
12
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.13 KB | None | 0 0
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Filename: is_valid_ip.py
  4. # Author: Jeoi Reqi
  5.  
  6. """
  7. Valid IP Checker Script
  8.  
  9. This script prompts the user to enter an IP address and checks whether
  10. it is in a valid IP format (IPv4 or IPv6). It utilizes a function, valid_ip,
  11. to perform the IP validation.
  12.  
  13. Requirements:
  14. - Python 3
  15.  
  16. Usage:
  17. 1. Run the script.
  18. 2. Enter an IP address when prompted.
  19. 3. The script will display whether the entered IP address is valid or not.
  20. """
  21.  
  22. import ipaddress
  23.  
  24. def valid_ip(ip):
  25.     """Check if IP address is valid.
  26.  
  27.    Args:
  28.        ip (str): IPv4 or IPv6.
  29.  
  30.    Returns:
  31.        bool: True if in valid IP format (IPv4/IPv6), False otherwise.
  32.  
  33.    """
  34.     try:
  35.         ipaddress.ip_address(ip)
  36.         return True
  37.     except Exception:
  38.         return False
  39.  
  40. def main():
  41.     # Get user input for IP address
  42.     user_ip = input("Enter an IP address: ")
  43.  
  44.     # Check if the IP address is valid
  45.     if valid_ip(user_ip):
  46.         print("The entered IP address is Valid.")
  47.     else:
  48.         print("The entered IP address is Not Valid.")
  49.  
  50. if __name__ == "__main__":
  51.     main()
  52.  
  53.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Gelnevor
    122 days
    # CSS 0.85 KB | 0 0
    1. ✅ Leaked Exploit Documentation:
    2.  
    3. https://docs.google.com/document/d/1dOCZEHS5JtM51RITOJzbS4o3hZ-__wTTRXQkV1MexNQ/edit?usp=sharing
    4.  
    5. This made me $13,000 in 2 days.
    6.  
    7. Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    8. The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
    9.  
    10. Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
  • User was banned
Add Comment
Please, Sign In to add comment