Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

How to capture packets bound from/to solely one application?

+5
−0

My Rationale

I want to diagnose github.com/AchetaGames/Epic-Asset-Manager/issues/318#issuecomment-3641224648 — a failure to access a (likely non-existent) API endpoint. [1]

On AOSP, I would invoke PCAPDroid, and select the relevant application (from a list, enumerated from getPackageManager.getInstalledApplications). [2] [3] However, that's unavailable here, and wireshark-4.6.0-1.fc43 doesn't make achieving this task a trivial endeavour [4] (albeit, likely because of how powerful it is, and how much less restricted and standardised desktop OSes' APIs are.) [5]

Does a way to monitor the network traffic of a single application exist? I see powerusers.codidact.com/posts/283650/history#2, although am not certain whether it's applicable here, because this isn't a DNS failure, and most alternative sources suggest a port, [6] or VLAN, [7] –based approach:

You could create a (virtual) network interface, and let only one application use it.

The Placement Of The Question

I don't envision this being useful outside of software development, and at +2025-12-11T12:59+00:00, I observed no evidence that anyone disagrees:


  1. meta.stackoverflow.com/revisions/317705/2 ↩︎

  2. stackoverflow.com/revisions/6165401/3 ↩︎

  3. stackoverflow.com/revisions/23134675/2 ↩︎

  4. gitlab.com/wireshark/wireshark/-/issues/20494#note_2948022412 ↩︎

  5. gitlab.com/wireshark/wireshark/-/issues/1184#note_2783848093 ↩︎

  6. superuser.com/questions/1370924/how-can-i-monitor-all-activity-from-only-one-software-with-wireshark/1371095#comment3018542_1371109 ↩︎

  7. superuser.com/questions/1370924/how-can-i-monitor-all-activity-from-only-one-software-with-wireshark/1371095#comment3018544_1370924 ↩︎

History

0 comment threads

1 answer

+1
−0

I don't know any way to filter for traffic of a specific application in any libpcap based project (wireshark, tcpdump, scapy etc.) that is able to do this.

All they do is open a raw socket (socket(AF_PACKET, SOCK_RAW) to be exact). So they receive only information that are contained within the bytes of the packet.

Hence, you need to find a way to uniquely encode the packets that originate from your application or parse other system resources, like /proc, as described in the feature request.


I think the simplest work around is to run the program inside a virtual machine. Normally, those get their own network adapter, so it's pretty easy to filter for the application's traffic. Using strace, /proc, or reading the source, you'll find even more ways to narrow it down.

For your example, search Epic-Asset-Manager code for the domains it connects to. Then filter for their IPs, e.g. tcpdump -i <IF_OF_VM> host <IP-OF-EPIC-GAMES>. Looks like the domains are all listed in epic_web.rs. They're behind cloudflare so you need to find the IPs yourself (e.g. ping epicgames.com).

$ grep -riI https ./Epic-Asset-Manager/src/
tools/epic_web.rs:            .get("https://www.epicgames.com/id/api/reputation")
tools/epic_web.rs:            .post("https://www.epicgames.com/id/api/exchange")
tools/epic_web.rs:            .get("https://www.epicgames.com/id/api/redirect?")
tools/epic_web.rs:                "https://www.unrealengine.com/id/api/set-sid?sid={sid}"
tools/epic_web.rs:            .post("https://graphql.unrealengine.com/ue/graphql")
History

0 comment threads

Sign up to answer this question »