Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p3k self_build() #20

Closed
sir-go opened this issue Mar 3, 2016 · 0 comments
Closed

p3k self_build() #20

sir-go opened this issue Mar 3, 2016 · 0 comments

Comments

@sir-go
Copy link

sir-go commented Mar 3, 2016

#!/usr/bin/env python3
# coding:utf8

from scapy.all import *

def pkt_callback(pkt):
    if pkt.haslayer(HTTPRequest):
        print(pkt[HTTP])

sniff(iface="eth1", prn=pkt_callback, filter="port 80", store=0)

print(pkt[HTTP])
File "/usr/local/lib/python3.4/dist-packages/scapy/packet.py", line 283, in str
return repr(bytes(self))
File "/usr/local/lib/python3.4/dist-packages/scapy/packet.py", line 285, in bytes
return self.build()
File "/usr/local/lib/python3.4/dist-packages/scapy/packet.py", line 353, in build
p = self.do_build()
File "/usr/local/lib/python3.4/dist-packages/scapy/packet.py", line 345, in do_build
pay = self.do_build_payload()
File "/usr/local/lib/python3.4/dist-packages/scapy/packet.py", line 337, in do_build_payload
return self.payload.do_build()
File "/usr/local/lib/python3.4/dist-packages/scapy/packet.py", line 342, in do_build
pkt = self.self_build()
File "/data/proj/myssl/scapy_http.py", line 179, in self_build
return _self_build(self, field_pos_list)
File "/data/proj/myssl/scapy_http.py", line 101, in _self_build
val = _get_field_value(obj, f.name)
File "/data/proj/myssl/scapy_http.py", line 74, in _get_field_value
headers = _parse_headers(val)
File "/data/proj/myssl/scapy_http.py", line 18, in _parse_headers
headers = s.split("\r\n")
TypeError: 'str' does not support the buffer interface

@sir-go sir-go closed this as completed May 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant