当前位置: 首页>>代码示例>>Python>>正文


Python commands.getoutput方法代码示例

本文整理汇总了Python中commands.getoutput方法的典型用法代码示例。如果您正苦于以下问题:Python commands.getoutput方法的具体用法?Python commands.getoutput怎么用?Python commands.getoutput使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在commands的用法示例。


在下文中一共展示了commands.getoutput方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: mycallback

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def mycallback(self):
        listselection=""
	try:
		listselection=self.lilnew1.get(self.lilnew1.curselection()[0])
	except:
		listselection=""
		
	h1="mon0"
	print listselection
	print self.fname
         
        listoutput=commands.getoutput("airodump-ng"+" "+format(self.var1.get())+" "+(self.t1.get(1.0, 'end')).strip()+" "+format(self.var2.get())+" "+(self.t2.get(1.0, 'end')).strip()+" "+format(self.var3.get())+" "+(self.t3.get(1.0, 'end')).strip()+" "+format(self.var4.get())+" "+(self.t4.get(1.0, 'end')).strip()+" "+\
                            format(self.var5.get())+" "+(self.t5.get(1.0, 'end')).strip()+" "+format(self.var6.get())+" "+(self.t6.get(1.0, 'end')).strip()+" "+format(self.var7.get())+" "+(self.t7.get(1.0, 'end')).strip()+" "+format(self.var8.get())+" "+(self.t8.get(1.0, 'end')).strip()+" "+\
                            format(self.var9.get())+" "+(self.t9.get(1.0, 'end')).strip()+" "+format(self.var10.get())+" "+(self.t10.get(1.0, 'end')).strip()+" "+format(self.var11.get())+" "+(self.t11.get(1.0, 'end')).strip()+" "+format(self.var12.get())+" "+(self.t12.get(1.0, 'end')).strip()+" "+\
                            format(self.var13.get())+" "+(self.t13.get(1.0, 'end')).strip()+" "+format(self.var14.get())+" "+(self.t14.get(1.0, 'end')).strip()+" "+format(self.var15.get())+" "+(self.t15.get(1.0, 'end')).strip()+" "+format(self.var16.get())+" "+(self.t16.get(1.0, 'end')).strip()+" "+\
                            format(self.var17.get())+" "+(self.t17.get(1.0, 'end')).strip()+" "+format(self.var18.get())+" "+(self.t18.get(1.0, 'end')).strip()+" "+format(self.var19.get())+" "+(self.t19.get(1.0, 'end')).strip()+" "+format(self.var20.get())+" "+(self.t20.get(1.0, 'end')).strip()+" "+\
                            format(self.var21.get())+" "+ (self.t21.get(1.0, 'end')).strip()+" "+format(self.var22.get())+" "+(self.t22.get(1.0, 'end')).strip()+" "+format(self.var23.get())+" "+(self.t23.get(1.0, 'end')).strip()+" "+format(self.var24.get())+" "+(self.t24.get(1.0, 'end')).strip()+" "+\
                            format(self.var25.get())+" "+(self.t25.get(1.0, 'end')).strip()+" "+format(self.var26.get())+" "+(self.t26.get(1.0, 'end')).strip()+" "+listselection+" "+self.fname)
       
      
        self.output.insert(INSERT,listoutput) 
开发者ID:hiteshchoudhary,项目名称:Airvengers,代码行数:23,代码来源:Airodump-ng.py

示例2: portScan

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def portScan(ip,user,password):
	try:
		result={}
		with open("result.json","r") as fn:
			data=fn.readlines()
			fn.close()
			result=json.loads(data[0])
		result[u"ip"]=ip
		result[u"username"]=user
		result[u"password"]=password
		#进行端口扫描
		print u"[*]对主机%s进行端口扫描......"%ip
		commandResult=commands.getoutput("python port_scan.py %s"%ip)
		result[u"端口详情"]=ast.literal_eval(commandResult)
		#将主机信息,端口扫描信息保存到json中
		with open("result.json",'w') as fn:
			json.dump(result,fn,ensure_ascii=False)
			fn.close()
		print u"[+]本次端口扫描结束"
	except Exception as e:
		print u"[-]端口扫描失败,请重新扫描"
		print e 
开发者ID:vulscanteam,项目名称:vulscan,代码行数:24,代码来源:main.py

示例3: detect_desktop_environment

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def detect_desktop_environment():
        '''Checks for known desktop environments

        Return the desktop environments name, lowercase (kde, gnome, xfce)
        or "generic"

        '''

        desktop_environment = 'generic'

        if os.environ.get('KDE_FULL_SESSION') == 'true':
            desktop_environment = 'kde'
        elif os.environ.get('GNOME_DESKTOP_SESSION_ID'):
            desktop_environment = 'gnome'
        else:
            try:
                info = commands.getoutput('xprop -root _DT_SAVE_MODE')
                if ' = "xfce4"' in info:
                    desktop_environment = 'xfce'
            except (OSError, RuntimeError):
                pass

        return desktop_environment 
开发者ID:liorbenhorin,项目名称:pipeline,代码行数:25,代码来源:email.py

示例4: show

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def show(self,ntime):
    data = self.data
    which = data.findtime(ntime)
    time,box,atoms,bonds,tris,lines = data.viz(which)
    if self.boxflag == 2: box = data.maxbox()
    self.distance = compute_distance(box)

    self.xtrans = self.ytrans = self.ztrans = 0.0
    output = self.single(1,self.file,box,atoms,bonds,tris,lines)
    print output
    nums = re.findall("translation to:\s*(\S*)\s*(\S*)\s*(\S*)\s",output)
    self.xtrans = float(nums[0][0])
    self.ytrans = float(nums[0][1])
    self.ztrans = float(nums[0][2])
    
    self.single(0,self.file,box,atoms,bonds,tris,lines)
    cmd = "%s %s.png" % (PIZZA_DISPLAY,self.file)
    commands.getoutput(cmd)

  # -------------------------------------------------------------------- 
开发者ID:lammps,项目名称:pizza,代码行数:22,代码来源:raster.py

示例5: slot_autoload_victim_clients

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def slot_autoload_victim_clients(self):
        
        # clear
        self.combo_wep_mac_cfrag.clear()
        self.combo_wpa_mac_hand.clear()

        # check *.csv files
        if not glob.glob(config_dir + "*.csv"):
            self.output("no csv files in " + config_dir, 1)
            return
        
        # open dump file
        dump_file = commands.getoutput("cat " + config_dir + "*.csv | egrep -e '^[0-9a-fA-F]{2,2}:[0-9a-fA-F]{2,2}:[0-9a-fA-F]{2,2}:[0-9a-fA-F]{2,2}:[0-9a-fA-F]{2,2}:[0-9a-fA-F]{2,2}.+[0-9a-fA-F]{2,2}:[0-9a-fA-F]{2,2}:[0-9a-fA-F]{2,2}:[0-9a-fA-F]{2,2}:[0-9a-fA-F]{2,2}:[0-9a-fA-F]{2,2},' | grep " + self.ac + " | tr ',' ' ' | awk ' { print $1 } '")
        dump_file = dump_file.split('\n')        
        
        for mac in dump_file:
            self.combo_wep_mac_cfrag.insertItem(0, mac)
            self.combo_wpa_mac_hand.insertItem(0, mac)

    #
    # Add cracked key to database
    # 
开发者ID:Frozenbox,项目名称:airmode,代码行数:24,代码来源:airmode.py

示例6: replay_pcr_data

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def replay_pcr_data(pcr_list):
    info_print('Replay TPM data.\n')
    check_and_run_resource_manager()

    for pcr_data in pcr_list:
        info_print('    [>>] PCR %s, SHA256 = %s\n' % (pcr_data[0], pcr_data[1]))
        output = commands.getoutput('tpm2_extendpcrs -g 0x0b -P %s -i %s' % (pcr_data[0], pcr_data[1]))
        print output + '\n'

    # Last one for PCR #7
    info_print('    [>>] Last PCR 7, SHA256 = %s\n' % (sha256_bootmgfw_cert))
    output = commands.getoutput('tpm2_extendpcrs -g 0x0b -P 7 -i %s' % sha256_bootmgfw_cert)
    print output + '\n'

    os.system('sudo killall resourcemgr')
    
# 
# Extract TPM encoded blob from Dislocker tool
# 
开发者ID:kkamagui,项目名称:bitleaker,代码行数:21,代码来源:bitleaker.py

示例7: mycallback

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def mycallback(self):
         
	listselection=""
	try:
		listselection=self.lilnew1.get(self.lilnew1.curselection()[0])
	except:
		listselection=""
		
	h1="mon0"
	print listselection
	print self.fname

        listoutput=commands.getoutput("airtun-ng"+" "+format(self.var1.get())+" "+(self.t1.get(1.0, 'end')).strip()+" "+format(self.var2.get())+" "+(self.t2.get(1.0, 'end')).strip()+" "+format(self.var3.get())+" "+(self.t3.get(1.0, 'end')).strip()+" "+format(self.var4.get())+" "+(self.t4.get(1.0, 'end')).strip()+" "+\
                            format(self.var5.get())+" "+(self.t5.get(1.0, 'end')).strip()+" "+format(self.var6.get())+" "+(self.t6.get(1.0, 'end')).strip()+" "+format(self.var7.get())+" "+(self.t7.get(1.0, 'end')).strip()+" "+format(self.var8.get())+" "+(self.t8.get(1.0, 'end')).strip()+" "+format(self.var9.get())+" "+(self.t9.get(1.0, 'end')).strip()+" "+format(self.var10.get())+" "+(self.t10.get(1.0, 'end')).strip()+" "+format(self.var11.get())+" "+(self.t11.get(1.0, 'end')).strip()+" "+format(self.var12.get())+" "+(self.t12.get(1.0, 'end')).strip()+" "+listselection+" "+self.fname)

        self.output.insert(INSERT,listoutput) 
开发者ID:hiteshchoudhary,项目名称:Airvengers,代码行数:18,代码来源:Airtun-ng.py

示例8: mycallback

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def mycallback(self):
         
        listselection=""
	try:
		listselection=self.lilnew1.get(self.lilnew1.curselection()[0])
	except:
		listselection=""
		
	h1="mon0"
	print listselection
	print self.fname
         
        listoutput=commands.getoutput("aircrack-ng"+" "+format(self.var1.get())+" "+(self.t1.get(1.0, 'end')).strip()+" "+format(self.var2.get())+" "+(self.t2.get(1.0, 'end')).strip()+" "+format(self.var3.get())+" "+(self.t3.get(1.0, 'end')).strip()+" "+format(self.var4.get())+" "+(self.t4.get(1.0, 'end')).strip()+" "+\
                            format(self.var5.get())+" "+(self.t5.get(1.0, 'end')).strip()+" "+format(self.var6.get())+" "+(self.t6.get(1.0, 'end')).strip()+" "+format(self.var7.get())+" "+(self.t7.get(1.0, 'end')).strip()+" "+format(self.var8.get())+" "+(self.t8.get(1.0, 'end')).strip()+" "+\
                            format(self.var9.get())+" "+(self.t9.get(1.0, 'end')).strip()+" "+format(self.var10.get())+" "+(self.t10.get(1.0, 'end')).strip()+" "+format(self.var11.get())+" "+(self.t11.get(1.0, 'end')).strip()+" "+format(self.var12.get())+" "+(self.t12.get(1.0, 'end')).strip()+" "+\
                            format(self.var13.get())+" "+(self.t13.get(1.0, 'end')).strip()+" "+format(self.var14.get())+" "+(self.t14.get(1.0, 'end')).strip()+" "+format(self.var15.get())+" "+(self.t15.get(1.0, 'end')).strip()+" "+format(self.var16.get())+" "+(self.t16.get(1.0, 'end')).strip()+" "+\
                            format(self.var17.get())+" "+(self.t17.get(1.0, 'end')).strip()+" "+format(self.var18.get())+" "+(self.t18.get(1.0, 'end')).strip()+" "+format(self.var19.get())+" "+(self.t19.get(1.0, 'end')).strip()+" "+format(self.var20.get())+" "+(self.t20.get(1.0, 'end')).strip()+" "+\
                            format(self.var21.get())+" "+ (self.t21.get(1.0, 'end')).strip()+" "+format(self.var22.get())+" "+(self.t22.get(1.0, 'end')).strip()+" "+format(self.var23.get())+" "+(self.t23.get(1.0, 'end')).strip()+" "+format(self.var24.get())+" "+(self.t24.get(1.0, 'end')).strip()+" "+\
                            format(self.var25.get())+" "+(self.t25.get(1.0, 'end')).strip()+" "+format(self.var26.get())+" "+(self.t26.get(1.0, 'end')).strip()+" "+format(self.var27.get())+" "+(self.t27.get(1.0, 'end')).strip()+" "+format(self.var28.get())+" "+(self.t28.get(1.0, 'end')).strip()+" "+format(self.var29.get())+" "+(self.t29.get(1.0, 'end')).strip()+" "+format(self.var30.get())+" "+(self.t30.get(1.0, 'end')).strip()+" "+format(self.var31.get())+" "+(self.t31.get(1.0, 'end')).strip()+" "+format(self.var32.get())+" "+(self.t32.get(1.0, 'end')).strip()+" "+format(self.var33.get())+" "+(self.t33.get(1.0, 'end')).strip()+" "+format(self.var34.get())+" "+(self.t34.get(1.0, 'end')).strip()+" "+listselection+" "+self.fname)  

        self.output.insert(INSERT,listoutput) 
开发者ID:hiteshchoudhary,项目名称:Airvengers,代码行数:23,代码来源:Aircrack-ng.py

示例9: mycallback

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def mycallback(self):
         
        listselection=""
	try:
		listselection=self.lilnew1.get(self.lilnew1.curselection()[0])
	except:
		listselection=""
		
	h1="mon0"
	print listselection
	print self.fname
         
        listoutput=commands.getoutput("airbase-ng"+" "+format(self.var1.get())+" "+(self.t1.get(1.0, 'end')).strip()+" "+format(self.var2.get())+" "+(self.t2.get(1.0, 'end')).strip()+" "+format(self.var3.get())+" "+(self.t3.get(1.0, 'end')).strip()+" "+format(self.var4.get())+" "+(self.t4.get(1.0, 'end')).strip()+" "+\
                            format(self.var5.get())+" "+(self.t5.get(1.0, 'end')).strip()+" "+format(self.var6.get())+" "+(self.t6.get(1.0, 'end')).strip()+" "+format(self.var7.get())+" "+(self.t7.get(1.0, 'end')).strip()+" "+format(self.var8.get())+" "+(self.t8.get(1.0, 'end')).strip()+" "+\
                            format(self.var9.get())+" "+(self.t9.get(1.0, 'end')).strip()+" "+format(self.var10.get())+" "+(self.t10.get(1.0, 'end')).strip()+" "+format(self.var11.get())+" "+(self.t11.get(1.0, 'end')).strip()+" "+format(self.var12.get())+" "+(self.t12.get(1.0, 'end')).strip()+" "+\
                            format(self.var13.get())+" "+(self.t13.get(1.0, 'end')).strip()+" "+format(self.var14.get())+" "+(self.t14.get(1.0, 'end')).strip()+" "+format(self.var15.get())+" "+(self.t15.get(1.0, 'end')).strip()+" "+format(self.var16.get())+" "+(self.t16.get(1.0, 'end')).strip()+" "+\
                            format(self.var17.get())+" "+(self.t17.get(1.0, 'end')).strip()+" "+format(self.var18.get())+" "+(self.t18.get(1.0, 'end')).strip()+" "+format(self.var19.get())+" "+(self.t19.get(1.0, 'end')).strip()+" "+format(self.var20.get())+" "+(self.t20.get(1.0, 'end')).strip()+" "+\
                            format(self.var21.get())+" "+ (self.t21.get(1.0, 'end')).strip()+" "+format(self.var22.get())+" "+(self.t22.get(1.0, 'end')).strip()+" "+format(self.var23.get())+" "+(self.t23.get(1.0, 'end')).strip()+" "+format(self.var24.get())+" "+(self.t24.get(1.0, 'end')).strip()+" "+\
                            format(self.var25.get())+" "+(self.t25.get(1.0, 'end')).strip()+" "+format(self.var26.get())+" "+(self.t26.get(1.0, 'end')).strip()+" "+format(self.var27.get())+" "+(self.t27.get(1.0, 'end')).strip()+" "+format(self.var28.get())+" "+(self.t28.get(1.0, 'end')).strip()+" "+format(self.var29.get())+" "+(self.t29.get(1.0, 'end')).strip()+" "+format(self.var30.get())+" "+(self.t30.get(1.0, 'end')).strip()+" "+format(self.var31.get())+" "+(self.t31.get(1.0, 'end')).strip()+" "+format(self.var32.get())+" "+(self.t32.get(1.0, 'end')).strip()+" "+format(self.var33.get())+" "+(self.t33.get(1.0, 'end')).strip()+" "+format(self.var34.get())+" "+(self.t34.get(1.0, 'end')).strip()+" "+listselection+" "+self.fname)  
      
        self.output.insert(INSERT,listoutput) 
开发者ID:hiteshchoudhary,项目名称:Airvengers,代码行数:23,代码来源:Airbase-ng.py

示例10: mycallback

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def mycallback(self):
         
        listselection=""
	try:
		listselection=self.lilnew1.get(self.lilnew1.curselection()[0])
	except:
		listselection=""
		
	h1="mon0"
	print listselection
	print self.fname

        listoutput=commands.getoutput("airolib-ng"+" "+format(self.var1.get())+" "+(self.t1.get(1.0, 'end')).strip()+" "+format(self.var2.get())+" "+(self.t2.get(1.0, 'end')).strip()+" "+format(self.var3.get())+" "+(self.t3.get(1.0, 'end')).strip()+" "+format(self.var4.get())+" "+(self.t4.get(1.0, 'end')).strip()+" "+\
                            format(self.var5.get())+" "+(self.t5.get(1.0, 'end')).strip()+" "+format(self.var6.get())+" "+(self.t6.get(1.0, 'end')).strip()+" "+format(self.var7.get())+" "+(self.t7.get(1.0, 'end')).strip()+" "+format(self.var8.get())+" "+(self.t8.get(1.0, 'end')).strip())

        self.output.insert(INSERT,listoutput) 
开发者ID:hiteshchoudhary,项目名称:Airvengers,代码行数:18,代码来源:Airolib-ng.py

示例11: mycallback

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def mycallback(self):
         
        listselection=""
	try:
		listselection=self.lilnew1.get(self.lilnew1.curselection()[0])
	except:
		listselection=""
		
	h1="mon0"
	print listselection
	print self.fname

        listoutput=commands.getoutput("airdecap-ng"+" "+format(self.var1.get())+" "+(self.t1.get(1.0, 'end')).strip()+" "+format(self.var2.get())+" "+(self.t2.get(1.0, 'end')).strip()+" "+format(self.var3.get())+" "+(self.t3.get(1.0, 'end')).strip()+" "+format(self.var4.get())+" "+(self.t4.get(1.0, 'end')).strip()+" "+\
                            format(self.var5.get())+" "+(self.t5.get(1.0, 'end')).strip()+" "+format(self.var6.get())+" "+(self.t6.get(1.0, 'end')).strip()+" "+listselection+" "+self.fname)

        self.output.insert(INSERT,listoutput) 
开发者ID:hiteshchoudhary,项目名称:Airvengers,代码行数:18,代码来源:Airdecap-ng.py

示例12: mycallback

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def mycallback(self):
         
        listselection=""
	try:
		listselection=self.lilnew1.get(self.lilnew1.curselection()[0])
	except:
		listselection=""
		
	h1="mon0"
	print listselection
	print self.fname

        listoutput=commands.getoutput("airdecloak-ng"+" "+format(self.var1.get())+" "+(self.t1.get(1.0, 'end')).strip()+" "+format(self.var2.get())+" "+(self.t2.get(1.0, 'end')).strip()+" "+format(self.var3.get())+" "+(self.t3.get(1.0, 'end')).strip()+" "+format(self.var4.get())+" "+(self.t4.get(1.0, 'end')).strip()+" "+\
                            format(self.var5.get())+" "+(self.t5.get(1.0, 'end')).strip()+" "+format(self.var6.get())+" "+(self.t6.get(1.0, 'end')).strip()+" "+format(self.var7.get())+" "+(self.t7.get(1.0, 'end')).strip()+" "+format(self.var8.get())+" "+(self.t8.get(1.0, 'end')).strip()+" "+listselection+" "+self.fname)

        self.output.insert(INSERT,listoutput) 
开发者ID:hiteshchoudhary,项目名称:Airvengers,代码行数:18,代码来源:Airdecloak-ng.py

示例13: get_my_ip

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def get_my_ip():
    """
    Try to obtain our external ip (from the pyro nameserver's point of view)

    This tries to sidestep the issue of bogus `/etc/hosts` entries and other
    local misconfigurations, which often mess up hostname resolution.

    If all else fails, fall back to simple `socket.gethostbyname()` lookup.

    """
    import socket
    try:
        import Pyro4
        # we know the nameserver must exist, so use it as our anchor point
        ns = Pyro4.naming.locateNS()
        s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
        s.connect((ns._pyroUri.host, ns._pyroUri.port))
        result, port = s.getsockname()
    except:
        try:
            # see what ifconfig says about our default interface
            import commands
            result = commands.getoutput("ifconfig").split("\n")[1].split()[1][5:]
            if len(result.split('.')) != 4:
                raise Exception()
        except:
            # give up, leave the resolution to gethostbyname
            result = socket.gethostbyname(socket.gethostname())
    return result 
开发者ID:loretoparisi,项目名称:word2vec-twitter,代码行数:31,代码来源:word2vecReaderUtils.py

示例14: get_gpu_temp

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def get_gpu_temp():
    gpu_temp = commands.getoutput( '/opt/vc/bin/vcgencmd measure_temp' ).replace( 'temp=', '' ).replace( '\'C', '' )
    return float(gpu_temp)
    # Uncomment the next line if you want the temp in Fahrenheit
    # return float(1.8* gpu_temp)+32 
开发者ID:spoonysonny,项目名称:SAKS-SDK,代码行数:7,代码来源:main.py

示例15: getstatus

# 需要导入模块: import commands [as 别名]
# 或者: from commands import getoutput [as 别名]
def getstatus(file):
    """Return output of "ls -ld <file>" in a string."""
    import warnings
    warnings.warn("commands.getstatus() is deprecated", DeprecationWarning, 2)
    return getoutput('ls -ld' + mkarg(file))


# Get the output from a shell command into a string.
# The exit status is ignored; a trailing newline is stripped.
# Assume the command will work with '{ ... ; } 2>&1' around it..
# 
开发者ID:glmcdona,项目名称:meddle,代码行数:13,代码来源:commands.py


注:本文中的commands.getoutput方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。