hgascon/pulsar

Error in rep(1:N,Sapply(ngrams[-total],length)): invalid times argument

santhoshn16 opened this issue · 6 comments

Tried pulsar on FTP capture but unable to get ahead of this.

Calls: loadPrismaData -> readPrismaInput -> readFSally -> sparseMatrix
Execution halted
Error during clustering (not enough data?)
Cluster file not generated: /home/santhosh/pulsar/models/44304/44304.cluster
Exiting learning module...

I have tried with different pcap files which has unique ip's and ports for source and destination but states are not generating.

How large are your PCAP files?

I have worked with pcap files of size less than 5 MB

Like discussed in previous issues, larger file sizes have prevented this problem (e.g >100Mb or ~Gb)

Do pcap files need to contain only one application protocol?I tried mixed ICS protocols ,and there's a problem:
python pulsar.py -l -p 1.pcap

Extracting DERRICK files from 1
Generating PRISMA input files from 1
Traceback (most recent call last):
File "pulsar.py", line 98, in
mg.generate_model()
File "/home/d/pulsar/pulsar/core/model.py", line 59, in generate_model
self._generate_model_pcaps()
File "/home/d/pulsar/pulsar/core/model.py", line 76, in _generate_model_pcaps
self._generate_prisma_input(pcap_noext)
File "/home/d/pulsar/pulsar/core/model.py", line 159, in _generate_prisma_input
h.generate_prisma_input(drk_file)
File "/home/d/pulsar/pulsar/core/harry.py", line 43, in generate_prisma_input
dr = DerrickReader(drk_file)
File "/home/d/pulsar/pulsar/core/derrick.py", line 27, in init
self.messages = [DerrickPacket(l.rstrip("\r\n")) for l in g]
File "/home/d/pulsar/pulsar/core/derrick.py", line 27, in
self.messages = [DerrickPacket(l.rstrip("\r\n")) for l in g]
TypeError: a bytes-like object is required, not 'str'

and when i tried the itunes-xbmc.pcap to test,the same problem occurred.

Yes, pcap files need to contain only one protocol and a unique communication channel, that is, packets exchanged between a unique combination of source and destiny IPs and ports (e.g. SRC_IP:SRC_PORT and DST_IP:DST_PORT).

The error might be due to the changes in python3. @dushize can you find exactly what is triggering the error?

Thanks,the error is due to the changes in python3.I changed the python version to python2.In addition,'import urllib.request, urllib.parse, urllib.error' is not available in python2,I changed it to 'import urllib'.Finally,I went through the test on itunes-xbmc.pcap.