Site Tools


eve-ng

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
eve-ng [2025/02/17 23:36] – created - external edit 127.0.0.1eve-ng [2025/12/14 14:03] (current) Name
Line 20: Line 20:
       * Paste into CiscoIOUKeygen.py (should be an empty file first)       * Paste into CiscoIOUKeygen.py (should be an empty file first)
         * <code>print("*********************************************************************")         * <code>print("*********************************************************************")
-print("Cisco IOU License Generator - Kal 2011, python port of 2006 C version")+print("Cisco IOU License Generator - Kal 2011, python port of 2006 C version. Modified by Timothy C. Fox 2025. https://tim.army")
 import os import os
 import socket import socket
Line 37: Line 37:
 md5input=iouPad1 + iouPad2 + struct.pack('!i', ioukey) + iouPad1 md5input=iouPad1 + iouPad2 + struct.pack('!i', ioukey) + iouPad1
 iouLicense=hashlib.md5(md5input).hexdigest()[:16] iouLicense=hashlib.md5(md5input).hexdigest()[:16]
-  + 
-print("\nAdd the following text to ~/.iourc:"+# Add to .iourc file 
-print("[license]\n" + hostname + " = " + iouLicense + ";\n"+#print("\nAdd the following text to /opt/unetlab/addons/iol/bin/.iourc:"
-with open("iourc.txt", "wt") as out_file:+#print("[license]\n" + hostname + " = " + iouLicense + ";\n"
 +with open("/opt/unetlab/addons/iol/bin/.iourc", "wt") as out_file:
  out_file.write("[license]\n" + hostname + " = " + iouLicense + ";\n")  out_file.write("[license]\n" + hostname + " = " + iouLicense + ";\n")
-print("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nCopied to the file iourc.txt\n ") +print("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nCopied to the file /opt/unetlab/addons/iol/bin/.iourc\n ") 
-  + 
-print("You can disable the phone home feature by:"+#print("The old way of disabling the call home feature was by editing the host file."
-print("echo '127.0.0.127 xml.cisco.com>> /et[c]/hosts\n")</code>+#print("That method no longer works with the x86_64_crb_linux images. The new way is the following:"
 +#print("You can disable the phone home feature by:"
 +#print("iptables -I OUTPUT -p udp --dport 53 -m string --hex-string \"|03|xml|05|cisco|03|com\" --algo bm -j DROP"
 + 
 +# Add the following to iptables to block Cisco Call-Home and set the timeout value to 10 seconds 
 +os.system('timeout 10 iptables -I OUTPUT -p udp --dport 53 -m string --hex-string "|03|xml|05|cisco|03|com" --algo bm -j DROP'
 + 
 +# Display the iptables 
 +os.system('iptables -L') 
 + 
 +print("if the line is duplicated, then execute the following:"
 +print("iptables -L OUTPUT -p udp --dport 53 -m string --hex-string \"|03|xml|05|cisco|03|com\" --algo bm -j DROP"
 + 
 +# Fix permissions and set the timeout value to 60 seconds 
 +print("Fixing permissions . . . standby"
 +os.system('timeout 60 /opt/unetlab/wrappers/unl_wrapper -a fixpermissions'
 +print("Permissions fixed")</code> 
 + 
 +Execute the Python script
   * <code>python3 /opt/unetlab/addons/iol/bin/CiscoIOUKeygen.py</code>   * <code>python3 /opt/unetlab/addons/iol/bin/CiscoIOUKeygen.py</code>
 +To Fix Permissions
   * <code>/opt/unetlab/wrappers/unl_wrapper -a fixpermissions</code>   * <code>/opt/unetlab/wrappers/unl_wrapper -a fixpermissions</code>
  
eve-ng.1739835392.txt.gz · Last modified: by 127.0.0.1