當前位置: 首頁>>代碼示例>>Python>>正文


Python LOG.warning方法代碼示例

本文整理匯總了Python中impacket.LOG.warning方法的典型用法代碼示例。如果您正苦於以下問題:Python LOG.warning方法的具體用法?Python LOG.warning怎麽用?Python LOG.warning使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在impacket.LOG的用法示例。


在下文中一共展示了LOG.warning方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: write_raw

# 需要導入模塊: from impacket import LOG [as 別名]
# 或者: from impacket.LOG import warning [as 別名]
def write_raw(self,tid,fid,data, offset = 0, wait_answer=1):
        LOG.warning("[MS-CIFS] This command was introduced in the CorePlus dialect, but is often listed as part of the LAN Manager 1.0 dialect.This command has been deprecated.Clients SHOULD use SMB_COM_WRITE_ANDX")
        smb = NewSMBPacket()
        smb['Tid']    = tid

        writeRaw = SMBCommand(SMB.SMB_COM_WRITE_RAW)
        writeRaw['Parameters'] = SMBWriteRaw_Parameters()
        writeRaw['Parameters']['Fid'] = fid
        writeRaw['Parameters']['Offset'] = offset
        writeRaw['Parameters']['Count'] = len(data)
        writeRaw['Parameters']['DataLength'] = 0
        writeRaw['Parameters']['DataOffset'] = 0
        smb.addCommand(writeRaw)

        self.sendSMB(smb)
        self._sess.send_packet(data)

        if wait_answer:
            smb = self.recvSMB()
            if smb.isValidAnswer(SMB.SMB_COM_WRITE_RAW):
                return smb
        return None 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:24,代碼來源:smb.py

示例2: decode

# 需要導入模塊: from impacket import LOG [as 別名]
# 或者: from impacket.LOG import warning [as 別名]
def decode(self, aBuffer):
        i = ImpactPacket.IP(aBuffer)
        self.set_decoded_protocol ( i )
        off = i.get_header_size()
        end = i.get_ip_len()
        # If ip_len == 0 we might be facing TCP segmentation offload, let's calculate the right len
        if end == 0:
            LOG.warning('IP len reported as 0, most probably because of TCP segmentation offload. Attempting to fix its size')
            i.set_ip_len(len(aBuffer))
            end = i.get_ip_len()

        if i.get_ip_p() == ImpactPacket.UDP.protocol:
            self.udp_decoder = UDPDecoder()
            packet = self.udp_decoder.decode(aBuffer[off:end])
        elif i.get_ip_p() == ImpactPacket.TCP.protocol:
            self.tcp_decoder = TCPDecoder()
            packet = self.tcp_decoder.decode(aBuffer[off:end])
        elif i.get_ip_p() == ImpactPacket.ICMP.protocol:
            self.icmp_decoder = ICMPDecoder()
            packet = self.icmp_decoder.decode(aBuffer[off:end])
        elif i.get_ip_p() == ImpactPacket.IGMP.protocol:
            self.igmp_decoder = IGMPDecoder()
            packet = self.igmp_decoder.decode(aBuffer[off:end])
        else:
            self.data_decoder = DataDecoder()
            packet = self.data_decoder.decode(aBuffer[off:end])
        i.contains(packet)
        return i 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:30,代碼來源:ImpactDecoder.py

示例3: __init__

# 需要導入模塊: from impacket import LOG [as 別名]
# 或者: from impacket.LOG import warning [as 別名]
def __init__(self, hive, isRemote = False):
        self.__hive = hive
        if isRemote is True:
            self.fd = self.__hive
            self.__hive.open()
        else:
            self.fd = open(hive,'rb')
        data = self.fd.read(4096)
        self.__regf = REG_REGF(data)
        self.indent = ''
        self.rootKey = self.__findRootKey()
        if self.rootKey is None:
            LOG.error("Can't find root key!")
        elif self.__regf['MajorVersion'] != 1 and self.__regf['MinorVersion'] > 5:
            LOG.warning("Unsupported version (%d.%d) - things might not work!" % (self.__regf['MajorVersion'], self.__regf['MinorVersion'])) 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:17,代碼來源:winregistry.py

示例4: tree_connect

# 需要導入模塊: from impacket import LOG [as 別名]
# 或者: from impacket.LOG import warning [as 別名]
def tree_connect(self, path, password = '', service = SERVICE_ANY):
        LOG.warning("[MS-CIFS] This is an original Core Protocol command.This command has been deprecated.Client Implementations SHOULD use SMB_COM_TREE_CONNECT_ANDX")

        # return 0x800
        if password:
            # Password is only encrypted if the server passed us an "encryption" during protocol dialect
            if self._dialects_parameters['ChallengeLength'] > 0:
                # this code is untested
                password = self.get_ntlmv1_response(ntlm.compute_lmhash(password))

        if not unicode_support:
            if unicode_convert:
                path = str(path)
            else:
                raise Exception('SMB: Can\t conver path from unicode!')

        smb = NewSMBPacket()
        treeConnect = SMBCommand(SMB.SMB_COM_TREE_CONNECT)
        treeConnect['Parameters'] = SMBTreeConnect_Parameters()
        treeConnect['Data']       = SMBTreeConnect_Data()
        treeConnect['Data']['Path'] = path.upper()
        treeConnect['Data']['Password'] = password
        treeConnect['Data']['Service'] = service
        smb.addCommand(treeConnect)
        self.sendSMB(smb)

        while 1:
            smb = self.recvSMB()
            if smb.isValidAnswer(SMB.SMB_COM_TREE_CONNECT):
                # XXX Here we are ignoring the rest of the response
                return smb['Tid']
            return smb['Tid'] 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:34,代碼來源:smb.py

示例5: get_protocol_version

# 需要導入模塊: from impacket import LOG [as 別名]
# 或者: from impacket.LOG import warning [as 別名]
def get_protocol_version(self):
        LOG.warning('deprecated soon')
        return self.get_ip_v() 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:5,代碼來源:IP6.py

示例6: get_destination_address

# 需要導入模塊: from impacket import LOG [as 別名]
# 或者: from impacket.LOG import warning [as 別名]
def get_destination_address(self):
        LOG.warning('deprecated soon')
        return self.get_ip_dst() 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:5,代碼來源:IP6.py

示例7: set_protocol_version

# 需要導入模塊: from impacket import LOG [as 別名]
# 或者: from impacket.LOG import warning [as 別名]
def set_protocol_version(self, version):
        LOG.warning('deprecated soon')
        self.set_ip_v(version) 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:5,代碼來源:IP6.py

示例8: set_source_address

# 需要導入模塊: from impacket import LOG [as 別名]
# 或者: from impacket.LOG import warning [as 別名]
def set_source_address(self, source_address):
        LOG.warning('deprecated soon')
        self.set_ip_src(source_address) 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:5,代碼來源:IP6.py

示例9: set_destination_address

# 需要導入模塊: from impacket import LOG [as 別名]
# 或者: from impacket.LOG import warning [as 別名]
def set_destination_address(self, destination_address):
        LOG.warning('deprecated soon')
        self.set_ip_dst(destination_address) 
開發者ID:joxeankoret,項目名稱:CVE-2017-7494,代碼行數:5,代碼來源:IP6.py

示例10: get_source_address

# 需要導入模塊: from impacket import LOG [as 別名]
# 或者: from impacket.LOG import warning [as 別名]
def get_source_address(self):
        LOG.warning('deprecated soon')
        return self.get_ip_src() 
開發者ID:Coalfire-Research,項目名稱:Slackor,代碼行數:5,代碼來源:IP6.py


注:本文中的impacket.LOG.warning方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。