From 1becf51a5673acf0eab38c2abe568ca23b3da680 Mon Sep 17 00:00:00 2001 From: Nat Lasseter Date: Thu, 20 Feb 2025 09:14:12 +0000 Subject: [5.1] Tickets no longer double encrypted --- 5.1/charon.rb | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100755 5.1/charon.rb (limited to '5.1/charon.rb') diff --git a/5.1/charon.rb b/5.1/charon.rb new file mode 100755 index 0000000..7a69e39 --- /dev/null +++ b/5.1/charon.rb @@ -0,0 +1,80 @@ +#!/usr/bin/env ruby + +require 'openssl' +require 'securerandom' +require 'sinatra' + +Users = { + "Athena" => "Passw0rd!" +} + +Services = { + "_TGS" => "eiqu@a5ahs8mooqu9Eng", + "Mail" => "{FvM= ts + next "Ticket expired\n" unless Time.now.to_i < (ts + ls) + begin + aun, aws, als, ats = decrypt(data["authenticator"], sk).split(?,) + als = als.to_i + ats = ats.to_i + rescue OpenSSL::Cipher::CipherError + next "Invalid session key\n" + end + next "Invalid authenticator\n" unless aun == un + next "Invalid authenticator\n" unless aws == ws + next "Invalid authenticator\n" unless Time.now.to_i >= ats + next "Authenticator expired\n" unless Time.now.to_i < (ats + als) + anc, svt = ticket(un, ws, data["service"]) + "#{encrypt(anc, sk)},#{svt}" +end -- cgit v1.2.1