1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- # from tls_parser.cipher_suites import CipherSuites
- # from tls_parser.record_protocol import TlsRecordTlsVersionBytes
- # from tls_parser.tls_version import TlsVersionEnum
- # from tls_parser.handshake_protocol import TlsHandshakeRecord, TlsHandshakeTypeByte, TlsRsaClientKeyExchangeRecord
- client_Hello_Data = "010000a30303e8b053270e022bfe0c771a240ec8d9095150a4ff26260d7a790fce9e0eabe8f5200cdf6b004db973c33cfb23de2199b851e990f5f012b2bc3b10c745a450014eb5000213010100005800000013001100000e7777772e676f6f676c652e636f6d002b0003020304003300260024001d00201d7b6027f0995e601903d1f0b6286a2d9fa0ca1ff30bd15e4abeee1cd303f405000d000400020807000a00040002001d"
- a = "160303007a0200007603033abf3568fb44b8cafed7cc76ed09f5390e701cb23f89ad5af697ca950cb11c89200cdf6b004db973c33cfb23de2199b851e990f5f012b2bc3b10c745a450014eb5130100002e00330024001d00204ef89cc66d2c642ccd49152732655931c3e59fa06fd29f4148f72d917c46b93e002b00020304"
- b = "140303000101"
- c = "1703030a10e3c049ff6fc98fb743e6b57c7b41da6d9fc81ebf61f53ec50114ecae46f990c68e63d0f92855df593c38c6613f4b82b9d18a161f565e65e64bd67ec58aed3cedd09c1ca4e83ee16f9f5ff20424819254ab65115142169a3b554994e4ab8bd64cf0891857b096e44d351e5d6d2ec506418d288a64c0fbb34a51ed95c2a06c88ddc5ffa72aaee3627652e967679775163d9644446e73e3ea2ab1d1841f7db02d4b23b273c3e509aac16f9228200018b3cc33f5f1c1082a71faed95425b4ffd6395d77669baa3ccb177e57cd105775487619aff7cc87f7857968f7310e0c92e60ea8380f578830b71f8bdd3682d9e7d79723d336a8077e36a577480ecb648813f5ea4249972ae194a1c289569b7fafc649f97fe538815bd7cec40c7cc6bb46e36f3e2822476cd81611bbe7fc103db03380a7e7d920096fbbd92a6a5dfd92d147cf6867fd4809c2d26a182261a67d4b3604c0227fc510330a7510d57b204dc5c15836efed30c9e63fb7daac3478e3543bfaa05d17cb83ce06f7eb7d107f588ee4322465eb0cf1fadd8c60324bc8a847229304bf8e9355d36f3ddbebe159d8ae33c739441ec328dce55d358604f5ca378d4b59a0b5a5e8485a49419e54a7fa78762ecd3fe2623f14c22cd40566fbcff6b3bed25dfa17452c5050bcacb2a70b08afd932a316830c3d9c5c9747be30f59029af433d9bb4d9905b52a7ef50738c2744d299d66d522389ff1660046bd6c69aadb231cbdb780e5a53590f36f2af6372baf102a48fe671f8e0f121274fe7deda7a52ee8484ce8f13253f5083db25dcef66e05c2af105e541295b7170044ca21a737ef657ed1562e4e7ebd4bd2fbcacc0daff0bbc5fc55f41421ae2628f752ca2393ad831fa9c6c6de09857218621cee3068f374edd2544df5360b6573e82c9a1cb32731c0dee00df457a20996591293303a38021b8808baa22ce906aaa4df7164da75560ed8fbbaf11b26e29c47b18450b27a57180639a3d63aa2fdfce53112457e4edffe75db33d962801bd445bba5d52731ba2fcd46eff4d74026086d4a1fd59bd5f411ad195e3b3dc3d220282b9badf3dc7fbd598d9bf0f3044275a09e0ee39e5b3e1cdfac889203ceffaf6df0a03ee8b38099ceb309d2c418ee188afb0d0140ed70d7000e1a060f940820f520b481460e331edf716ab60655e30f83cd6d90c22b5a80b5bf0cd576c5753b0630410192292db10bd8bd17a5927e1ea837d811d148dba429ec176c3c56cb1d70864107aadb432386c953bb856db78bd8b9eafc35190843c0aef518a4abe486460fb7403ca8b6ef60e4e6d17359631411b592a1bebf64323f63e1e3b9854f9ee5ac265c6f9147b552bea31f9ddd172fd650396113ee9974acf9b073d7d010072fdae06db81c8504d4d23f47417ef34e027134b92122db0a49e3a28255cc8dd8ec37e25bb2920f8cb2a4a3b5ad710a521434fbf9f906d848fc0f532bc11211005caee2db4c59ce7581e967eb6d927c87c72790f34f218ba35c262395beffa579bfa29972d8b67d531d5b7076ad5ddbe9459f6dc8677b1dce7cad2b4d794e97a6448085b17195af688a5b806e58840817b6472e443981e6f739fee387d7579175fd5487fa0b84e57ec136b8fcb25168aab5fb16890a2bff51d913946c4f678881af04c31f1aeb9e0a08332a6c231b250c922263d815ba97e211a5b6623c6f15da71946c9dbe48ab8c73c2204b540826a6c5784a866efbedc7bdd7938d5c5134fb45ad8ec5a4f63dbc2fd85d4526d2d1fd86c33d8a5ba2d70dabeb83cd6c3012b000a21ccb3ecb3d00e2afcde51f51aff7401d15c293c3d0406e04975d80576e424ed633869d2883a9f134bd1e255f28b3a6dcc7347f1c11fab55e46ded18d554686fde57b096677d91c3dfb42bd9de4e1a1bf7bdb55791038d698b7eaee7f0f1b2a63ec303bd1af2dee3c746202418142c9f83ad53fbbbe48d9f3d76c58515017a791b6f8a7a221bb216e71d096d62637b25e79d15157d2eef1ece4bc61cb71d04dd29235e40096ae11e6654f7562f1df03f5ff9aaa748019fd3e99bc95c9e0d9250fba18f5e5ea3436044cbafdbd2915b6924abddce0e47287ebd841d3eccb2dd95eee98d58fcec8ff5e71f1050baeb8db7c33866c9704558e9cc911837f585f69aecaf6a8aba0f6abbfe4592f05a9707506c79e18246e52efd2db0eb26aafe05c0a2bd2319cd1f57ed8eb7fdec0f8b83eb5a4a080b25d5c8568fa7932e32abf2da3e2c0e027bc2adf63e49ca59e12d77e9afc4631d0db0b3778db5e84db9d425b4bd576f41cfb90ed622acf6ecf46a67ec6629fc1a96f65905cd10b613edf8b73b547a6c9e31609584ecaa92dffc09c44745ef3ccd85406ed189f756807a6cf32c8e8000695a459fa64319ddff8ce194187084bd7837c416b8d62e8b0fce3c8b39e8fef6175da51b76cf5aeef69b10793a189fa3c31f4b8541e8951dd6d0b93d65b7901bba7cb0b1286fd322f186f88ed8b7acce27a1eadf6f9fa873c6360c62614279448b93a826476fad603942aa6096043a92c01bec5343ca65a7c7acee91337755269b03a0a2466ce5a748f91a5bc85c0d18a7de8158d3160994e89f10d63f9f6588d1f634263baa79f39cf6f9650ee9fdca516d31a60d289c5aec84de6a36eb7723b596902c12916d021bb36b1f01c3ff251b33974d63480c7b0b83ab40aef3f2ac0f5ebdce822edd613529c6ef6b65dfdd7e4ac2aad5c9cf41b2361de9a485cd23f536dee44015d72f1619d8d809e3a7715c3c300c744e65a1e316ff67d853b71378e11e79e10b93c727e23ad7a5860a215c38bff1b756c121fe67b196779a5752f237a9f26f41d33a47265ad5f255513b0813316ef48f057e6bea6a16a2d239b161dc1aaa599e94bddfb63f996207a5f849ed5231341bb2b7d809265b6bb6b17979a974d847a47bb7efa816e3148955a9f8e1845b3830f3e088c739aedbc8c654c7c788259f91de60621fdaf2790559f68fcd73b18aa789931a63450758d1f853a28d9e3a47cf0dfa0d10f86fe84fb35fe6839d9d16d41bdaf8f23aa027c191994f2b05499279f05751b2a19471f32a8a06412f8ce496d0e733481df46345b2917bfd573c2845dbe670c2d269f234c111a471aacf7897994cbf9ea96e26f030680dbc79118ec7165b5c228ba852c93ee69a49c46cad9233bded9104af6bfb71a859d1c746bd768e895bc74efd7826d918f13a919aec23c16d0235acdbdcc6326f5de542cf7e531fe8d7b0c9d8132dc34938ddd955f818e99af741e602b6fa7c4827d75975899d5a3e0b60790f7540661b683064983e8510000e95c3c123d2abe661ae1377ccb8353a80b0f907c57363ffafd853f84a47229bf0d0061f3fa6afd4e00c1877609a088b0a49cbb3645c0362ba2906e57af9ef7fa90b0b4d9ea000efaec943c58d89fa58aa36d9eec811e42e31e2bf36f5e0ab0f5af5e4300842357b27f4c524bdd8e355698525141b1b40de7f8c7c1c4433d1a4fab738d149c9cbfb8f2ab90881ba035972803d0db0e893f6e51c9c2589a195037f7e2c83e465654df3e6b82a96e3736c682ed4b76cc03e3c0572b75c2d12c5c8ea070ac125acc868af3283ee6787a86ce5986766c71b47d84b4"
- d = "1703030013c43fa0e8c268db21dee2a9b06a64b899c991a3"
- pr = "edc6ecc27b33c081a56c5682a4c0bd3509a11333b32d6a4a20126e087a2b3966"
- pu = "1d7b6027f0995e601903d1f0b6286a2d9fa0ca1ff30bd15e4abeee1cd303f405"
- # mv = memoryview(msg)
- from tcp import TLSClientSession
- # import donna25519 as d
- # # mysecret = bytes.fromhex(pr)
- # # mysecret[0] &= 248
- # # mysecret[31] &= 127
- # # mysecret[31] |= 64
- # p1 = d.PrivateKey(bytes.fromhex(pr))
- # p2 = d.PublicKey(bytes.fromhex(pu))
- # c = p1.do_exchange(p2)
- # print("\n")
- # print(bytes(p1.private).hex())
- # print(pr)
- # print("\n")
- # print(bytes(p2.public).hex())
- # print(pu)
- # print("\n")
- # print(bytes(c).hex())
- # print("\n")
- tcp = TLSClientSession(bytes.fromhex(pr),bytes.fromhex(pu),bytearray(client_Hello_Data,"utf-8"))
- tcp.tls_response(memoryview(bytes.fromhex(a)))
- # tcp.tls_response(memoryview(bytes.fromhex(b)))
- # tcp.tls_response(memoryview(bytes.fromhex(c)))
- # from tls.Crypto.Util.number import long_to_bytes
- # from tls.Crypto.Util import Counter
- # init_value = 0xca
- # prefix=long_to_bytes(init_value, 12)
- # print(prefix)
- # print(32 // 8)
|