sipcapture / heplify-server

HEP Capture Server for HOMER
https://sipcapture.org
GNU Affero General Public License v3.0
186 stars 90 forks source link

sending HEP3 payload to ws://xx.xx.xx.xx:3000 encapsulate buffer via hep.js showing Malformed packet #497

Open sudoGenie opened 2 years ago

sudoGenie commented 2 years ago

We are trying to send HEP3 payload buffer array (hep.js) over to ws://xx.xx.xx.xx:3000

I only see 1 log in /var/log/messages and i get this showing from decoder.go

heplify-server: 2022/08/22 06:09:21.900048 decoder.go:111: WARN malformed packet with length 1906 which is neither hep nor protobuf encapsulated

When I send the 418 byte payload its showing 1980byes on the tcpdump trace.

https://github.com/sipcapture/homer/wiki/HEP-WS-WSS-Socket (this was what i was referencing to find any documentation going the ws route)

    var hep_encoder = await HEPjs.encapsulate(payload, rcinfo); // returns data buffer

i took the buffer from hepgen.js and took the raw payload and tried to send that.

not sure if theres an example payload to send via ws:// or what is a good UDP payload i need to convert to to send

echo -ne "$(echo '4845503301c1XXXX' sed -e 's/../\\x&/g')" | nc -4u -w0 xx.xx.xx.xx 9060

sudoGenie commented 2 years ago

Update:

so i found that sending that payload via Postman (now supports ws://)

i was able to take the data payload with the HEP3 section from the wireshark and hepgen.js and upload that into ws:// and connect to socket (interesting enough auth doesn't care on this ws:// connection.

I send it as Binary (Hexadecimal) and HEP was able to extract / parse as it had to start with 48455033 ....

a few things i noticed though is overtime our ws:// sockets stop working and i have to restart heplifiy-server to get that back online to send but i would need more debug ws:// logs to determine if that is something to warrant as a new type of bug.

kYroL01 commented 1 year ago

Hi @sudoGenie Thanks a lot for trying and giving us feedback. Feel free to send a PR or suggest how to improve in order to share with the community.