This is our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Hi,

I'm looking for a way to decrypt ISAKMP ikev2 messages using tshark. I was able to do through preferences in wireshark. But not sure how will I give that preference with the "-o" option in tshark.

Any help is appreciated.

asked 16 May '15, 18:29

shakti's gravatar image

shakti
6112
accept rate: 0%

edited 17 May '15, 07:05

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237


You would use -o if you want to override a current preferences value. You already configured the decryption in Wireshark and if it works there, it will also work in tshark. Both read the same preferences file.

permanent link

answered 17 May '15, 02:24

Roland's gravatar image

Roland
7642415
accept rate: 13%

To decrypt ISAKMP/IKE frames, please fill the following file with the same paramaters you entered in the GUI:

IKEv1:

File: %APPDATA%\Wireshark\ikev1_decryption_table

IKEv2:

File: %APPDATA%\Wireshark\ikev2_decryption_table

If you don't know what to put into those files, first fill in the values in the GUI and then take the generated files as an example.

Then enable ISAKMP/IKE decryption in tshark, you need the following -o options:

tshark -nr ipsec.cap -o isakmp.ikev1_decryption_table:TRUE -V > IKEv1_decrypted.txt
tshark -nr ipsec.cap -o isakmp.ikev2_decryption_table:TRUE -V > IKEv2_decrypted.txt

After that, you'll see the decrypted IKE frames in the output files.

   Encrypted Data (40 bytes)    <================ HERE 
        Type Payload: Identification (5)
            Next payload: Hash (8)
            Payload length: 12
            ID type: IPV4_ADDR (1)
            Protocol ID: Unused
            Port: Unused
            Identification Data:192.168.140.205
                ID_IPV4_ADDR: 192.168.140.205 (192.168.140.205)
        Type Payload: Hash (8)
            Next payload: NONE / No Next Payload  (0)
            Payload length: 24
            Hash DATA: 3321b19237fb86a3231239d2049260d1b4a6e0e7
        Extra data: 00000000

See also my other answers related to IKE/ESP decryption:

https://ask.wireshark.org/questions/12019/how-can-i-decrypt-ikev1-andor-esp-packets
https://ask.wireshark.org/questions/22874/tshark-decrypt-esp-packets-with-command-line-arguments

Regards
Kurt

permanent link

answered 17 May '15, 07:03

Kurt%20Knochner's gravatar image

Kurt Knochner ♦
24.8k1039237
accept rate: 15%

edited 17 May '15, 07:04

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×832
×8
×6

question asked: 16 May '15, 18:29

question was seen: 4,165 times

last updated: 17 May '15, 07:05

p​o​w​e​r​e​d by O​S​Q​A