Adm1n_0v3rride

DNS and IP changer.rb

Jan 15th, 2018
102
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/usr/bin/env ruby -w
  2.  
  3. =begin
  4.  
  5. Ip address changer (C) 2018 Adm1n_0v3rride
  6.  
  7. =end
  8.  
  9. puts "Please enter the interface name: "
  10.  
  11. name = gets
  12.  
  13. puts "Please enter the ip address you want: "
  14.  
  15. address = gets
  16.  
  17. system("netsh interface ipv4 set address name=#{name} static 192.168.3.8 255.255.255.0 #{address}
  18. ")
  19.  
  20. puts "Do you want to change DNS?:\n1.Yes\n2.No"
  21. choice = gets
  22.  
  23. if choice == 1
  24.     puts "Please enter the interface name: "
  25.    
  26.     a = gets
  27.    
  28.     puts "Please enter the ip address you want: "
  29.    
  30.     b = gets
  31.    
  32.     system("netsh interface ipv4 set dns name=#{a} static #{b}")
  33.     if choice  == 2
  34.     puts "Hello,world"
  35.     end
  36. end
RAW Paste Data