Last active
August 29, 2015 14:23
-
-
Save giwa/532a9f8342f7eba1ffb3 to your computer and use it in GitHub Desktop.
お手軽DeepPacketInspection ref: http://qiita.com/giwa/items/795f56d2137254d7bcdc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git clone https://github.com/KimiNewt/pyshark.git | |
$ cd pyshark/src | |
$ python setup.py install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyshark | |
for p in pyshark.FileCapture(pcap_file, display_filter='http'): | |
try: | |
if p.http.request_method == 'GET': | |
print(p.eth.src) | |
print(p.eth.dst) | |
print(p.ip.src) | |
print(p.ip.dst) | |
print(p.tcp.srcport) | |
print(p.tcp.dstport) | |
print(p.http.host) | |
print(p.http.request_full_uri) | |
print(p.sniff_time) | |
except AttributeError as e: | |
continue | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment