daniels2 פורסם 2019 ביולי 14 Share פורסם 2019 ביולי 14 התחלתי לכתוב קודים בפייטון אבל רציתי להגיע עם זה יותר לרמה של פיתוח כלי איסוף מידע מאשר פיתוח רגיל, הקוד שלי לשינוי Mac address, אשמח לקבל עצות לשיפור הקוד. import subprocess import optparse def get_arg(): opt = optparse.OptionParser() opt.add_option("-i", "--interface", dest="interface", help="This sets the interface") opt.add_option("-m", "--mac", dest="mac", help="This sets the Mac address") return opt.parse_args() def change_MAC(interface, mac): print("[+] Changing the Mac address for", interface, "for MAC", mac) subprocess.call(["ifconfig", interface, "down"]) subprocess.call(["ifconfig", interface, "hw", "ether", mac]) subprocess.call(["ifconfig", interface, "up"]) (options, arg) = get_arg() change_MAC(options.interface, options.mac) קישור לתוכן שתף באתרים אחרים More sharing options...
Recommended Posts
ארכיון
דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.