#!/usr/bin/env python3importsysfromCrypto.HashimportSHA1fromCrypto.CipherimportAES,BlowfishfromCrypto.Utilimportstrxor,PaddingclassNavicat11Crypto:def__init__(self,Key=b'3DC5CA39'):self._Key=SHA1.new(Key).digest()self._Cipher=Blowfish.new(self._Key,Blowfish.MODE_ECB)self._IV=self._Cipher.encrypt(b'\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF')defEncryptString(self,s:str):iftype(s)!=str:raiseTypeError('Parameter s must be a str.')else:plaintext=s.encode('ascii')ciphertext=b''cv=self._IVfull_round,left_length=divmod(len(plaintext),8)foriinrange(0,full_round*8,8):t=strxor.strxor(plaintext[i:i+8],cv)t=self._Cipher.encrypt(t)cv=strxor.strxor(cv,t)ciphertext+=tifleft_length!=0:cv=self._Cipher.encrypt(cv)ciphertext+=strxor.strxor(plaintext[8*full_round:],cv[:left_length])returnciphertext.hex().upper()defDecryptString(self,s:str):iftype(s)!=str:raiseTypeError('Parameter s must be str.')else:plaintext=b''ciphertext=bytes.fromhex(s)cv=self._IVfull_round,left_length=divmod(len(ciphertext),8)foriinrange(0,full_round*8,8):t=self._Cipher.decrypt(ciphertext[i:i+8])t=strxor.strxor(t,cv)plaintext+=tcv=strxor.strxor(cv,ciphertext[i:i+8])ifleft_length!=0:cv=self._Cipher.encrypt(cv)plaintext+=strxor.strxor(ciphertext[8*full_round:],cv[:left_length])returnplaintext.decode('ascii')classNavicat12Crypto(Navicat11Crypto):def__init__(self):super().__init__()defEncryptStringForNCX(self,s:str):cipher=AES.new(b'libcckeylibcckey',AES.MODE_CBC,iv=b'libcciv libcciv ')padded_plaintext=Padding.pad(s.encode('ascii'),AES.block_size,style='pkcs7')returncipher.encrypt(padded_plaintext).hex().upper()defDecryptStringForNCX(self,s:str):cipher=AES.new(b'libcckeylibcckey',AES.MODE_CBC,iv=b'libcciv libcciv ')padded_plaintext=cipher.decrypt(bytes.fromhex(s))returnPadding.unpad(padded_plaintext,AES.block_size,style='pkcs7').decode('ascii')if__name__=='__main__':defHelp():print('Usage:')print(' NavicatCrypto.py <enc|dec> [-ncx] <plaintext|ciphertext>')print('')print(' <enc|dec> "enc" for encryption, "dec" for decryption.')print(' This parameter must be specified.')print('')print(' [-ncx] Indicate that plaintext/ciphertext is')print(' prepared for/exported from NCX file.')print(' This parameter is optional.')print('')print(' <plaintext|ciphertext> Plaintext string or ciphertext string.')print(' NOTICE: Ciphertext string must be a hex string.')print(' This parameter must be specified.')print('')defMain(argc:int,argv:list):ifargc==3:ifargv[1].lower()=='enc':print(Navicat11Crypto().EncryptString(argv[2]))elifargv[1].lower()=='dec':print(Navicat11Crypto().DecryptString(argv[2]))else:Help()return-1elifargc==4:ifargv[1].lower()=='enc'andargv[2].lower()=='-ncx':print(Navicat12Crypto().EncryptStringForNCX(argv[3]))elifargv[1].lower()=='dec'andargv[2].lower()=='-ncx':print(Navicat12Crypto().DecryptStringForNCX(argv[3]))else:Help()return-1else:Help()return0exit(Main(len(sys.argv),sys.argv))
<html><head><metacharset="utf-8"/><title>quic-AUTH</title><linkrel="stylesheet"href="/style.css"/></head><body><h1>Secret</h1><p> Congratulations, you loaded this page using HTTP/3!
Your files have been encrypted and saved,Enjoy it!
Pass is :
admin::SecretServer:d158262017948de9:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:010100000000000058b2da67cbe0d001c575cfa48d38bec50000000002001600450047004900540049004d002d00500043003100340001001600450047004900540049004d002d00500043003100340004001600650067006900740069006d002d00500043003100340003001600650067006900740069006d002d0050004300310034000700080058b2da67cbe0d0010600040002000000080030003000000000000000000000000030000065d85a4000a167cdbbf6eff657941f52bc9ee2745e11f10c61bb24db541165800a001000000000000000000000000000000000000900240063006900660073002f003100390032002e003100360038002e0031002e00310030003700000000000000000000000000
</p></body></html>