Tente adicionar as opções -a
ou --binary-file=text
grep -aE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' file.pcap
ou
grep --binary-file=text -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' file.pcap
Isso parece funcionar para um arquivo pcap aleatório que baixei do wiki.wireshark.org, ou seja,
$ grep -E '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' NTLM-wenchao.pcap
Binary file NTLM-wenchao.pcap matches
mas
$ grep -aE '[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+' NTLM-wenchao.pcap
Host: 192.168.0.55
Host: 192.168.0.55
Host: 192.168.0.55
Location: http://192.168.0.55/default.aspx
MicrosoftSharePointTeamServices: 12.0.0.6421
<body><h1>Object Moved</h1>This document may be found <a HREF="http://192.168.0."_?"_Ea@yÀ¨[À¨ÃPþµû%RÑ_Pü>ÕGET /default.aspx HTTP/1.1
Host: 192.168.0.55
etc.
Esteja ciente do aviso (da página de manual man grep
) que
If TYPE is text, grep processes a binary file as if it
were text; this is equivalent to the -a option. Warning: grep
--binary-files=text might output binary garbage, which can have
nasty side effects if the output is a terminal and if the
terminal driver interprets some of it as commands.
Observe que, embora seja possível usar o \d
regex (para d igit), ele só é suportado pelo grep no modo PCRE (ou seja, com a opção -P
).