mailpillager.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:SPF 作者: Exploit-install 项目源码 文件源码
def scrapeContacts(self):
        if (not self.srv):
            return

        self.getUIDs()

        if (not self.uids):
            return None

        contacts = []
        for uid in self.uids:
            resp, data = self.srv.fetch(uid, "(RFC822)")
            for response_part in data:
                if isinstance(response_part, tuple):
                    msg = email.message_from_string(response_part[1])
                    fromaddr = msg['from']
                    if (fromaddr):
                        sender = msg['from'].split()[-1]
                        address = re.sub(r'[<>]','',sender)
                        # Ignore any occurences of own email address and add to list
                        if not re.search(r'' + re.escape(self.user),address) and not address in contacts:
                            contacts.append(address)
                            print "IDENTIFED new contact [%s]" % (address)

        return contacts
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号