• 搜索
  • 夜间模式
    ©2015-2025  Ethan's Blog Theme by OneBlog
    搜索
    标签
    # Amule # Gargoyle # LUCI # VIM # Python # Nginx # 反代 # Ansible # Apache # LNMP
  • 首页>
  • Cisco>
  • 正文
  • CiscoIOUKeygen3f.py

    2018年12月03日 58 阅读 0 评论 1251 字
    #! /usr/bin/python3
    print("*********************************************************************")
    print("Cisco IOU License Generator - Kal 2011, python port of 2006 C version")
    import os
    import socket
    import hashlib
    import struct
    # get the host id and host name to calculate the hostkey
    hostid=os.popen("hostid").read().strip()
    hostname = socket.gethostname()
    ioukey=int(hostid,16)
    for x in hostname:
     ioukey = ioukey + ord(x)
    print("hostid=" + hostid +", hostname="+ hostname + ", ioukey=" + hex(ioukey)[2:])
    # create the license using md5sum
    iouPad1 = b'\x4B\x58\x21\x81\x56\x7B\x0D\xF3\x21\x43\x9B\x7E\xAC\x1D\xE6\x8A'
    iouPad2 = b'\x80' + 39*b'\0'
    md5input=iouPad1 + iouPad2 + struct.pack('!i', ioukey) + iouPad1
    iouLicense=hashlib.md5(md5input).hexdigest()[:16]
     
    print("\nAdd the following text to ~/.iourc:")
    print("[license]\n" + hostname + " = " + iouLicense + ";\n")
    with open("iourc.txt", "wt") as out_file:
     out_file.write("[license]\n" + hostname + " = " + iouLicense + ";\n")
    print("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAlready copy to the file iourc.txt\n ")
     
    print("You can disable the phone home feature with something like:")
    print(" echo '127.0.0.127 xml.cisco.com' >> /etc/hosts\n")
    本文著作权归作者 [ Ethan ] 享有,未经作者书面授权,禁止转载,封面图片来源于 [ 互联网 ] ,本文仅供个人学习、研究和欣赏使用。如有异议,请联系博主及时处理。
    — END —
    Copyright©2015-2025  All Rights Reserved.  Load:0.003 s
    Theme by OneBlog V3.6.3
    夜间模式

    开源不易,请尊重作者版权,保留基本的版权信息。