Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support version 3.3 protocol decoding #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

emontnemery
Copy link

No description provided.

data, err = aesDecrypt(b[len(Version)+16:], Key) // ignore signature
if version == Version_3_1 {
// Should this be 12?
data, err = aesDecrypt(b[len(version)+16:], Key, version) // ignore signature
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if the offset should be changed to 12 here since the return code is now skipped?

block, er2 := aes.NewCipher([]byte(key))
if er2 != nil {
return []byte{}, er2
}
bs := block.BlockSize()
if nc%bs != 0 && nc < 16 {
return []byte{}, errors.New("Bad ciphertext len")
if nc%bs != 0 || nc < 16 {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this check should be changed to:

if nc%bs != 0 && (nc < 16 ||  version != Version_3_1)

@py60800
Copy link
Owner

py60800 commented May 15, 2020

Hi Erik,

As you might have noticed, I am not very active on this topic these days.

I have tried to understand your proposals but I have no way to test them. Could you tell me how you have been able to perform your tests ?

@emontnemery
Copy link
Author

All my devices are using protocol 3.3, and I can add some .pcap-files + config files with v3.3 data to the PR.
Do you have some data available for v3.1, then I can verify that my changes don't break anything.

@py60800
Copy link
Owner

py60800 commented Jun 3, 2020

As of now, support for 3.3 protocol crashes when using 3.1 protocol. I am trying to fix this issue.

@emontnemery
Copy link
Author

Do you mean my changes crash if decoding is set to protocol 3.1, but supplied data is 3.3? If so, I should fix that..

@py60800
Copy link
Owner

py60800 commented Jun 21, 2020

I have created a new branch "3.3-Support" that includes the support of 3.3 version protocol.
It has been more complicated than I expected to support both versions in the same function so I have created two different functions.
You can get access to this new release by selecting the new branch.
Thank you very much for your help and for providing the tcpdump samples.

Tell me if there is anything wrong and if you wish some improvement (I am not very active on this topic now).

@briggitteorellana
Copy link

Hellooo, sorry I am trying to run the project but I could not do it directly, I have problems with GPATH and GOROOT. I had to make new files and run them again, but now I get PCAP access error: no such device, help me please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants