@@ -93,6 +93,11 @@ type ServerConfig struct {
9393 AmnezH2 string // ResponseHeader (magic)
9494 AmnezH3 string // CookieHeader (magic)
9595 AmnezH4 string // TransportHeader (magic)
96+ AmnezI1 string // Init Packet Magic
97+ AmnezI2 string // Response Packet Magic
98+ AmnezI3 string // Cookie Packet Magic
99+ AmnezI4 string // Transport Packet Magic
100+ AmnezI5 string // Additional obfuscation
96101}
97102
98103// PeerData holds all necessary information about a peer, including its
@@ -353,6 +358,7 @@ func main() {
353358 config .AmnezH2 = * tempWgCfg .H2
354359 config .AmnezH3 = * tempWgCfg .H3
355360 config .AmnezH4 = * tempWgCfg .H4
361+ config .AmnezI1 = * tempWgCfg .I1
356362
357363 configDirty = true
358364 }
@@ -385,6 +391,24 @@ func main() {
385391 }
386392 }
387393
394+ if config .AmnezH1 != "" && ! strings .Contains (config .AmnezH1 , "-" ) {
395+ fmt .Printf ("\n %s%s======================================================================%s\n " , colorRed , colorBold , colorReset )
396+ fmt .Printf ("%s%s[CRITICAL WARNING] VULNERABLE AMNEZIA WG CONFIGURATION DETECTED!%s\n \n " , colorRed , colorBold , colorReset )
397+
398+ fmt .Printf ("%sYour server is currently using legacy AmneziaWG 1.5 obfuscation parameters.%s\n " , colorYellow , colorReset )
399+ fmt .Printf ("These parameters use static headers and are %svulnerable to DPI heuristic blocking%s.\n \n " , colorRed , colorReset )
400+
401+ fmt .Printf ("It is strictly recommended to generate new AWG 2.0 parameters (ranged\n " )
402+ fmt .Printf ("headers and zero-collision padding) to ensure connection stability.\n \n " )
403+
404+ fmt .Printf ("How to upgrade:\n " )
405+ fmt .Printf ("1. Delete the current database (this will reset the server keys and peers).\n " )
406+ fmt .Printf (" %srm %s%s\n " , colorCyan , dbPath , colorReset )
407+ fmt .Printf ("2. Run this tool again to generate a fresh, secure configuration.\n " )
408+ fmt .Printf ("3. Add your peers and scan the new QR codes on all devices.\n " )
409+ fmt .Printf ("%s%s======================================================================%s\n \n " , colorRed , colorBold , colorReset )
410+ }
411+
388412 // --- Action Router ---
389413 if command == "show" {
390414 runShowPeer (peerName )
@@ -479,6 +503,10 @@ func main() {
479503 configWg .H2 = strPtr (config .AmnezH2 )
480504 configWg .H3 = strPtr (config .AmnezH3 )
481505 configWg .H4 = strPtr (config .AmnezH4 )
506+
507+ if config .AmnezI1 != "" { // Amnezia 2.0 marker
508+ configWg .I1 = strPtr (config .AmnezI1 )
509+ }
482510 }
483511
484512 if err := wgClient .ConfigureDevice (argIface , configWg ); err != nil {
@@ -1107,6 +1135,9 @@ func printClientConfig(peerName string, peerData PeerData, serverPublicKey wgtyp
11071135 amneziaParamsBuilder .WriteString (fmt .Sprintf ("H2 = %s\n " , config .AmnezH2 ))
11081136 amneziaParamsBuilder .WriteString (fmt .Sprintf ("H3 = %s\n " , config .AmnezH3 ))
11091137 amneziaParamsBuilder .WriteString (fmt .Sprintf ("H4 = %s\n " , config .AmnezH4 ))
1138+ if config .AmnezI1 != "" {
1139+ amneziaParamsBuilder .WriteString (fmt .Sprintf ("I1 = %s\n " , config .AmnezI1 ))
1140+ }
11101141 }
11111142
11121143 clientConfig := fmt .Sprintf (`[Interface]
0 commit comments