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


Python DB.fetchone方法代码示例

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


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

示例1: system

# 需要导入模块: from lib.db import DB [as 别名]
# 或者: from lib.db.DB import fetchone [as 别名]
            command1 = "mkdir " + webserver + mypath
            system(command1)
            androidagent = config.get('ANDROIDAGENT')
            command = "cp " + androidagent + " " + webserver + mypath + myfile
            system(command)
        
        elif  arsplit[1] == "IPHONE" :
            pass
        
        elif  arsplit[1] == "BLACKBERRY" :
            pass
        
        elif  arsplit[1] == "AGENTS" :
            db = DB(config=config)            
            db.query("SELECT COUNT(*) from agents")
            row       = db.fetchone()[0]
            fullpath2 = webserver + path + "/text2.txt"
            CLEARFILE2 = open(fullpath2, 'w')
            CLEARFILE2.close()
            GETFILE = open(fullpath2, 'w')

            if  row == 0 :
                GETFILE.write( key + " NONE\n")
                GETFILE.close()
            
            else :
                GETFILE.write(key + " AGEN\n")
                for i in range(1,row+1):
                    db.query("SELECT number from agents where id=" + i)
                    r           = db.fetchone()[0]
                    db.query("SELECT controlkey from agents where id=" + i)
开发者ID:0x7678,项目名称:Smartphone-Pentest-Framework,代码行数:33,代码来源:poller.py

示例2: DB

# 需要导入模块: from lib.db import DB [as 别名]
# 或者: from lib.db.DB import fetchone [as 别名]
    if  line == "":
        pass
    else:
        print line + "\n"

    if  select.select([sys.stdin, ], [], [], 0.5)[0]:
        foo = sys.stdin().readline().strip()
        if  foo == "exit":
            break

        elif comm.lower == "sms":
            command = agentkey + " " + "PORT" + " " + port1 + " " + foo
            db = DB(config=config)

            db.query("SELECT path from modems where id=" + modem)
            path2 = db.fetchone()[0]
            db.query("SELECT controlkey from modems where id=" + modem)
            key2 = db.fetchone()[0]
            number2 = agentnumber
            db.query("SELECT type from modems where id=" + modem)
            modemtype2 = db.fetchone()[0]

            if  modemtype2 == "usb":
                usb = serial.serialposix(port='/dev/ttyUSB2', baudrate=115200,
                bytesize=8, parity='N', stopbits=1)
                usb.write("ATZ\r\n")
                sleep(1)
                line = read_modem(usb)
                print line
                sleep(1)
                usb.write("AT+CMGF=1\r\n")
开发者ID:captainhooligan,项目名称:Smartphone-Pentest-Framework,代码行数:33,代码来源:shellpoll.py

示例3: system

# 需要导入模块: from lib.db import DB [as 别名]
# 或者: from lib.db.DB import fetchone [as 别名]
            		command9 = "chmod 777 " + sploitfile
            		system(command9)
			results = webserver + localpath + "/results"
            		command8   = "touch " + results
            		system(command8)
            		command9 = "chmod 777 " + results
            		system(command9)
            		sploitfiletext = "<?php\necho \"You Got Phished!\";\n$agent = $_SERVER['HTTP_USER_AGENT'];\n$page = " + x + ";\n$thing = $page . \" \" . $agent;\n$file = results;\n$current = file_get_contents($file);\n$current .= $thing . \"\\n\";\nfile_put_contents($file, $current);\n?>"
    			SPLOITFILE = open(sploitfile, 'w')
    			SPLOITFILE.write(sploitfiletext)
    			SPLOITFILE.close()
			modem = 1
			db = DB(config=config)

                	db.query("SELECT path from modems where id=%s", (modem,))
               		path2 = db.fetchone()[0].replace('"', '')
			print path2

                	db.query("SELECT controlkey from modems where id=%s", (modem,))
                	key2 = db.fetchone()[0]
			print key2
                	db.query("SELECT type from modems where id=%s", (modem,))
                	modemtype2 = db.fetchone()[0]
			control = webserver + path2 + "/getfunc"
			sleep(5)
                    	with open(control, 'w') as f:
                                msg = "This is a cool page: "
                            	command2 = key2 + " " + "SEND" + " " + x + " " + msg + link
				f.write(command2)
	
开发者ID:AngAven,项目名称:Smartphone-Pentest-Framework,代码行数:31,代码来源:apipoller.py


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