Пример #1
0
    def __init__(self, host, port=443, proxies={}):
        """Connection initialization
        
            @param host: the host to connect to.
            @type host: string

            @param port: the port number to connect to
            @type port: integer

            @param proxies: proxies that we can use to connect
            @type proxies: L{gnet.proxy.ProxyInfos}"""
        HTTP.__init__(self, host, port, proxies)
        self._http_proxy = None
Пример #2
0
    def __init__(self, host, port=443, proxies={}):
        """Connection initialization
        
            @param host: the host to connect to.
            @type host: string

            @param port: the port number to connect to
            @type port: integer

            @param proxies: proxies that we can use to connect
            @type proxies: L{gnet.proxy.ProxyInfos}"""
        HTTP.__init__(self, host, port, proxies)
        self._http_proxy = None
Пример #3
0
    def __init__(self, host, port=443, proxy=None):
        """Connection initialization
        
            @param host: the host to connect to.
            @type host: string

            @param port: the port number to connect to
            @type port: integer

            @param proxy: proxy that we can use to connect
            @type proxy: L{gnet.proxy.ProxyInfos}"""
        HTTP.__init__(self, host, port)
        assert(proxy is None or proxy.type == 'https')
        self.__proxy = proxy
Пример #4
0
    def __init__(self, host, port=443, proxy=None):
        """Connection initialization
        
            @param host: the host to connect to.
            @type host: string

            @param port: the port number to connect to
            @type port: integer

            @param proxy: proxy that we can use to connect
            @type proxy: L{gnet.proxy.ProxyInfos}"""
        HTTP.__init__(self, host, port)
        assert proxy is None or proxy.type == "https"
        self.__proxy = proxy
Пример #5
0
    packet = IPv4(eth.data)
    print(packet.dest_add)
    print(packet.src_add)
    print(packet.protocol)

    #TCP
    if packet.protocol == 6:
        tcp = TCP(packet.data)
        print(tcp.src_port)
        print(tcp.dest_port)
        print(tcp.ack)
        print(tcp.seq_no, ' ', tcp.ack_no)
        print(tcp.ack)
        print(tcp.offset)
        print(tcp.src_port, " ", tcp.dest_port)

        if tcp.src_port == 80 or tcp.dest_port == 80:
            http = HTTP(tcp.data)
            print(http.data)

    #UDP
    elif packet.protocol == 17:
        u = UDP(packet.data)
        print(u.src_port)
        print(u.dest_port)

#arp
elif eth.proto == 2054:
    print('arp')
    #idk