CESNET / ipfixprobe

BSD 3-Clause "New" or "Revised" License
37 stars 18 forks source link

README.md bug and question regarding sending unirec data as IPFIX over UDP #81

Open MigNov opened 2 years ago

MigNov commented 2 years ago

Hello, I've been trying to send the unirec data to the UDP netflow output and I tried to investigate the code but unfortunately I cannot find the way. Please let me explain the scenario I would like to do:

How could I do that? I have tried the following syntax but it does not work: ipfixprobe -i 'raw;ifc=ens192' -p http -p idpcontent -p smtp -o 'unirec;i=b:,u:http:timeout=WAIT;p=http,(pstats,phists,idpcontent)' I don't know how to define the output how to send unirec data using ipfix. Could you please help me?

Also, I am seeing a probable bug in the README.md. There's line:

# Capture from a COMBO card using ndp plugin, sends ipfix data to 127.0.0.1:4739 using TCP by default
./ipfixprobe -i 'ndp;dev=/dev/nfb0:0' -i 'ndp;dev=/dev/nfb0:1' -i 'ndp;dev=/dev/nfb0:2'

However there is no definition to send IPFIX data to 127.0.0.1:4739 over the TCP connection so I guess the comment is misleading. Could you please clarify whether am I reading/understanding it wrong?

Thanks a lot, Michal

hynekkar commented 2 years ago

Hi, why do you want to use unirec and not ipfix output plugin?

Regarding to your issue: ipfixprobe -i 'raw;ifc=ens192' -p http -p idpcontent -p smtp -o 'unirec;i=b:,u:http:timeout=WAIT;p=http,(pstats,phists,idpcontent)'

Let me explain the unirec output plugin parameters: -o 'unirec;i=u:http:timeout=WAIT,u:stats:timeout=WAIT;p=http,(pstats,phists,idpcontent)'

Thus I suppose, your desired arguments were: ipfixprobe -i 'raw;ifc=ens192' -p http -p idpcontent -p smtp -o 'unirec;i=u:http:timeout=WAIT;p=(http,idpcontent,smtp)

Karel

MigNov commented 2 years ago

Hi Karel, from what I understood now I can use:

ipfixprobe -i 'raw;ifc=ens192' -p http -p idpcontent -p smtp -o 'ipfix;u;host=${REMOTE_IP};port=${REMOTE_PORT}'

to use both idpcontent and smtp plugins and "convert" ens192 traffic to IPFIX format and send to ${REMOTE_IP} and ${REMOTE_PORT}. Is that correct?

Thanks, Michal

hynekkar commented 2 years ago

Hi Michal, Yes, you understand it correctly. IPFIX output plugin is going to send flow data enriched for http, idpcontent, and smtp, when applicable. Meaning, that when the flow does not contain HTTP or SMTP traffic, ipfixprobe will send flow enriched only for idpcontent. IDPContent does not export data when no payload is transmitted --- e.g. in the case of syn scan.

Karel

MigNov commented 2 years ago

Hi Karel, thanks for your reply. It might be good to change the README.md to include this information along with the example I put above and after that I think this issue #81 can be closed.

Thanks, Michal