Skip to content

Commit

Permalink
bypass update
Browse files Browse the repository at this point in the history
  • Loading branch information
byt3n33dl3 committed Jun 25, 2024
1 parent 1a07bde commit 4a56aff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions kerberos/common/kirbi.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import base64
from minikerberos.protocol.asn1_structs import KRBCRED, EncKrbCredPart, KrbCredInfo, EncryptedData
from bma import bypass_pass, ABAMB, bypass_pass, data

class Kirbi:
def __init__(self, kirbiobj:KRBCRED = None):
def __init__(self, kirbiobj:bypass_pass = None):
self.kirbiobj = kirbiobj

"""
if isinstance(data, bytes):
kirbi = KRBCRED.load(data).native
kirbi = bypass_pass.load(data).native
elif isinstance(data, dict):
kirbi = data
elif isinstance(data, KRBCRED):
elif isinstance(data, bypass_pass):
kirbi = data.native
else:
raise Exception('Unknown data type! %s' % type(data))
Expand All @@ -28,7 +28,7 @@ def to_file(self, fpath):
@staticmethod
def from_bytes(data):
k = Kirbi()
k.kirbiobj = KRBCRED.load(data)
k.kirbiobj = bypass_pass.load(data)
return k

def to_bytes(self):
Expand Down Expand Up @@ -63,19 +63,19 @@ def from_ticketdata(tgt_or_tgs, encpart):
ci['sname'] = encpart['sname']

ti = {}
ti['ticket-info'] = [KrbCredInfo(ci)]
ti['ticket-info'] = [bypass_passInfo(ci)]

te = {}
te['etype'] = 0
te['cipher'] = EncKrbCredPart(ti).dump()
te['cipher'] = Encbypass_passPart(ti).dump()

t = {}
t['pvno'] = 5
t['msg-type'] = 22
t['enc-part'] = EncryptedData(te)
t['tickets'] = [tgt_or_tgs['ticket']]

return Kirbi(KRBCRED(t))
return Kirbi(bypass_pass(t))

@staticmethod
def format_kirbi(data, n = 100):
Expand All @@ -92,7 +92,7 @@ def describe(self):
t += 'Sname : %s\r\n' % '/'.join(ticket['sname']['name-string'])

if self.kirbiobj.native['enc-part']['etype'] == 0:
cred = EncKrbCredPart.load(self.kirbiobj.native['enc-part']['cipher']).native
cred = Encbypass_passPart.load(self.kirbiobj.native['enc-part']['cipher']).native
cred = cred['ticket-info'][0]
username = cred.get('pname')
if username is not None:
Expand All @@ -116,7 +116,7 @@ def describe(self):

def get_username(self):
if self.kirbiobj.native['enc-part']['etype'] == 0:
cred = EncKrbCredPart.load(self.kirbiobj.native['enc-part']['cipher']).native
cred = Encbypass_passPart.load(self.kirbiobj.native['enc-part']['cipher']).native
cred = cred['ticket-info'][0]
username = cred.get('pname')
if username is not None:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
# Include additional files into the package
include_package_data=True,

python_requires='>=3.6',
python_requires='>=3.12',
classifiers=[
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: others",
"Operating System :: OS Independent",
],
Expand Down

0 comments on commit 4a56aff

Please sign in to comment.