MCPcopy Index your code
hub / github.com/cSploit/android / sniff

Method sniff

cSploit/src/org/csploit/android/tools/TcpDump.java:51–70  ·  view source on GitHub ↗
(String filter, String pcap, TcpDumpReceiver receiver)

Source from the content-addressed store, hash-verified

49 }
50
51 public Child sniff(String filter, String pcap, TcpDumpReceiver receiver) throws ChildManager.ChildNotStartedException {
52
53 StringBuilder sb = new StringBuilder("-nvs 0 ");
54
55 if(pcap != null) {
56 // TODO: find a way to receive tcpdump output when saving to a file
57 // NOTE: tcpdump -w - | tee file.pcap | tcpdump -r -
58 sb.append("-Uw '");
59 sb.append(pcap);
60 sb.append("' ");
61 } else {
62 sb.append("-l ");
63 }
64
65 if(filter != null) {
66 sb.append(filter);
67 }
68
69 return super.async(sb.toString(), receiver);
70 }
71
72 public void sniff(TcpDumpReceiver receiver) throws ChildManager.ChildNotStartedException {
73 sniff(null, null, receiver);

Callers 1

onSessionReadyMethod · 0.80

Calls 3

appendMethod · 0.80
asyncMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected