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

how to run pkt2flow from python #7

Open
fbinishaq opened this issue Jan 21, 2015 · 3 comments
Open

how to run pkt2flow from python #7

fbinishaq opened this issue Jan 21, 2015 · 3 comments

Comments

@fbinishaq
Copy link

Hello,

how can I use pkt2flow in python scripts? I am generating the pcap file from python script and I want to get tcp sessions from that pcap file using a python script as well pkt2flow

Thanks,

@caesar0301
Copy link
Owner

Unfortunately, you can not use pkt2flow in python directly. Instead, you can write the pcap file to disk, and invoke pkt2flow using subprocess module in python to process the pcap file. May this help u.

@fbinishaq
Copy link
Author

I tried to invoke but i failed. Do you have any idea how to do it?

Many thanks,

Sent from my iPhone

On Jan 21, 2015, at 6:11 PM, Xiaming [email protected] wrote:

Unfortunately, you can not use pkt2flow in python directly. Instead, you can write the pcap file to disk, and invoke pkt2flow using subprocess module in python to process the pcap file. May this help u.


Reply to this email directly or view it on GitHub.

@caesar0301
Copy link
Owner

Give a try

cmd = '/path/to/pkt2flow -o flows {0}'.format(pcap_file_name)
Popen(cmd, shell=True, stdout=PIPE).communicate()

Good luck! 👍

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

2 participants