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

Streaming PCAP file input #297

Open
foxt opened this issue Jul 10, 2023 · 1 comment
Open

Streaming PCAP file input #297

foxt opened this issue Jul 10, 2023 · 1 comment

Comments

@foxt
Copy link

foxt commented Jul 10, 2023

Hello,

I was wondering if it was possible to use something like the offline capture but for streams instead of data that is already written to a file.

For example, if I want to packet capture a remote host I can do something such as

 ssh [email protected] tcpdump -i eth0 -U -s0 -w - 'not port 22'

which will write the pcap data to stdout instead of a file, so that I can pipe it into something like wireshark -k -i - so that I can see the traffic on a remote machine in real time.

Is there any possiblity that this could be done with this library?

@foxt
Copy link
Author

foxt commented Jul 10, 2023

It seems like you can work around this by creating a FIFO

mkfifo /Users/foxt/pcapfifo
ssh [email protected] tcpdump -i eth0 -U -s0 -w - 'not port 22' > /Users/foxt/pcapfifo
const pcapSession = pcap.createOfflineSession("/Users/foxt/testfifo")

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