Esempio n. 1
0
 def dns(self, target):
     # target sample: [['ip', port, 'username', 'passwd', 'original dns', 'type], '8.8.4.4']
     dns = target[1]
     if not self.valid_ip(dns):
         print 'illegal dns address'
         sys.exit(-1)
     dns_thread = DnsSetFactory(target[0][0], target[0][1], target[0][2],
                                target[0][3], target[0][4], target[0][5],
                                dns)
     dns_thread.produce()
Esempio n. 2
0
 def dns(self, target):
     # target sample: [['ip', port, 'username', 'passwd', 'original dns', 'type], '8.8.4.4']
     dns = target[1]
     if not self.valid_ip(dns):
         print 'illegal dns address'
         sys.exit(-1)
     dns_thread = DnsSetFactory(target[0][0], target[0][1], target[0][2],
                                target[0][3], target[0][4],
                                target[0][5], dns)
     dns_thread.produce()
Esempio n. 3
0
    ret = test_crawl.produce()
    sys.exit(0)

if d_debug:
    # add the plugins path to sys.path to load plugins
    sys.path.append('dnsset/plugins')
    for arg in xrange(7):
        try:
            print args[arg]
        except Exception:
            print 'arg should include ip, port ,username, password, plugin, dns1, dns2'
            sys.exit(-1)
    test_setter = DnsSetFactory(addr=args[0], port=int(args[1]),
                                username=args[2], password=args[3], original_dns=args[6],
                                plugin=args[4], dns=args[5], debug=True)
    ret = test_setter.produce()
    sys.exit(0)

if u_debug:
    # add the plugins path to sys.path to load plugins
    sys.path.append('upgrade/plugins')
    for arg in xrange(6):
        try:
            print args[arg]
        except Exception:
            print 'arg should include ip, port, username, password, plugin, firmware'
            sys.exit(-1)
    if not os.path.exists(args[5]):
        print 'can not find the firmware file, please check the path'
        sys.exit(-1)
Esempio n. 4
0
    sys.path.append('dnsset/plugins')
    for arg in xrange(7):
        try:
            print args[arg]
        except Exception:
            print 'arg should include ip, port ,username, password, plugin, dns1, dns2'
            sys.exit(-1)
    test_setter = DnsSetFactory(addr=args[0],
                                port=int(args[1]),
                                username=args[2],
                                password=args[3],
                                original_dns=args[6],
                                plugin=args[4],
                                dns=args[5],
                                debug=True)
    ret = test_setter.produce()
    sys.exit(0)

if u_debug:
    # add the plugins path to sys.path to load plugins
    sys.path.append('upgrade/plugins')
    for arg in xrange(6):
        try:
            print args[arg]
        except Exception:
            print 'arg should include ip, port, username, password, plugin, firmware'
            sys.exit(-1)
    if not os.path.exists(args[5]):
        print 'can not find the firmware file, please check the path'
        sys.exit(-1)