Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/ruby
- #simple macchanger, the OUI is selected from one of many in the array for a unique valid MAC
- # usage: `sudo macchange <iface>`
- class Array
- # If +number+ is greater than the size of the array, the method
- # will simply return the array itself sorted randomly
- def randomly_pick(number)
- sort_by{ rand }.slice(0...number)
- end
- end
- macs = [ "00:04:23" , "00:1e:64" , "00:26:b0" , "00:26:08" , "00:19:d2" , "00:26:b6" , "79:ca:39" , "c4:17:fe" ]
- oui = macs.randomly_pick(1)
- 3.times do
- rand_hex = ((0xff)* rand).to_i.to_s(16)
- $new_mac = oui << ":" + rand_hex
- end
- print "\033[00;31m[SYSTEM]\033[00m \033[00;34myour new MAC Address is #{$new_mac}\033[00m\n"
- `ifconfig #{ARGV[0]} down`
- `ifconfig #{ARGV[0]} hw ether #{$new_mac}`
- `ifconfig #{ARGV[0]} up`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement