12/**3* ASRepToHashcat converts an AS-REP message to a hashcat format4*/5export function ASRepToHashcat(asrep: any): string | null {6return null;7}891011/**12* CheckKrbError checks if the response bytes from the KDC are a KRBError.13*/14export function CheckKrbError(b: Uint8Array): Uint8Array | null {15return null;16}17181920/**21* NewKerberosClientFromString creates a new kerberos client from a string22* by parsing krb5.conf23* @example24* ```javascript25* const kerberos = require('nuclei/kerberos');26* const client = kerberos.NewKerberosClientFromString(`27* [libdefaults]28* default_realm = ACME.COM29* dns_lookup_kdc = true30* `);31* ```32*/33export function NewKerberosClientFromString(cfg: string): Client | null {34return null;35}36373839/**40* sendtokdc.go deals with actual sending and receiving responses from KDC41* SendToKDC sends a message to the KDC and returns the response.42* It first tries to send the message over TCP, and if that fails, it falls back to UDP.(and vice versa)43* @example44* ```javascript45* const kerberos = require('nuclei/kerberos');46* const client = new kerberos.Client('acme.com');47* const response = kerberos.SendToKDC(client, 'message');48* ```49*/50export function SendToKDC(kclient: Client, msg: string): string | null {51return null;52}53545556/**57* TGStoHashcat converts a TGS to a hashcat format.58*/59export function TGStoHashcat(tgs: any, username: string): string | null {60return null;61}62636465/**66* Known Issues:67* Hardcoded timeout in gokrb5 library68* TGT / Session Handling not exposed69* Client is kerberos client70* @example71* ```javascript72* const kerberos = require('nuclei/kerberos');73* // if controller is empty a dns lookup for default kdc server will be performed74* const client = new kerberos.Client('acme.com', 'kdc.acme.com');75* ```76*/77export class Client {78798081public Krb5Config?: Config;82838485public Realm?: string;868788// Constructor of Client89constructor(public domain: string, public controller?: string ) {}909192/**93* SetConfig sets additional config for the kerberos client94* Note: as of now ip and timeout overrides are only supported95* in EnumerateUser due to fastdialer but can be extended to other methods currently96* @example97* ```javascript98* const kerberos = require('nuclei/kerberos');99* const client = new kerberos.Client('acme.com', 'kdc.acme.com');100* const cfg = new kerberos.Config();101* cfg.SetIPAddress('192.168.100.22');102* cfg.SetTimeout(5);103* client.SetConfig(cfg);104* ```105*/106public SetConfig(cfg: Config): void {107return;108}109110111/**112* EnumerateUser and attempt to get AS-REP hash by disabling PA-FX-FAST113* @example114* ```javascript115* const kerberos = require('nuclei/kerberos');116* const client = new kerberos.Client('acme.com', 'kdc.acme.com');117* const resp = client.EnumerateUser('pdtm');118* log(resp);119* ```120*/121public EnumerateUser(username: string): EnumerateUserResponse | null {122return null;123}124125126/**127* GetServiceTicket returns a TGS for a given user, password and SPN128* @example129* ```javascript130* const kerberos = require('nuclei/kerberos');131* const client = new kerberos.Client('acme.com', 'kdc.acme.com');132* const resp = client.GetServiceTicket('pdtm', 'password', 'HOST/CLIENT1');133* log(resp);134* ```135*/136public GetServiceTicket(User: string): TGS | null {137return null;138}139140141}142143144145/**146* Config is extra configuration for the kerberos client147*/148export class Config {149150151// Constructor of Config152constructor() {}153/**154* SetIPAddress sets the IP address for the kerberos client155* @example156* ```javascript157* const kerberos = require('nuclei/kerberos');158* const cfg = new kerberos.Config();159* cfg.SetIPAddress('10.10.10.1');160* ```161*/162public SetIPAddress(ip: string): Config | null {163return null;164}165166167/**168* SetTimeout sets the RW timeout for the kerberos client169* @example170* ```javascript171* const kerberos = require('nuclei/kerberos');172* const cfg = new kerberos.Config();173* cfg.SetTimeout(5);174* ```175*/176public SetTimeout(timeout: number): Config | null {177return null;178}179180181}182183184185/**186* AuthorizationDataEntry Interface187*/188export interface AuthorizationDataEntry {189190ADData?: Uint8Array,191192ADType?: number,193}194195196197/**198* BitString Interface199*/200export interface BitString {201202Bytes?: Uint8Array,203204BitLength?: number,205}206207208209/**210* BitString Interface211*/212export interface BitString {213214Bytes?: Uint8Array,215216BitLength?: number,217}218219220221/**222* Config Interface223*/224export interface Config {225226LibDefaults?: LibDefaults,227228Realms?: Realm,229}230231232233/**234* EncTicketPart Interface235*/236export interface EncTicketPart {237238EndTime?: Date,239240RenewTill?: Date,241242CRealm?: string,243244AuthTime?: Date,245246StartTime?: Date,247248Flags?: BitString,249250Key?: EncryptionKey,251252CName?: PrincipalName,253254Transited?: TransitedEncoding,255256CAddr?: HostAddress,257258AuthorizationData?: AuthorizationDataEntry,259}260261262263/**264* EncryptedData Interface265*/266export interface EncryptedData {267268EType?: number,269270KVNO?: number,271272Cipher?: Uint8Array,273}274275276277/**278* EncryptionKey Interface279*/280export interface EncryptionKey {281282KeyType?: number,283284KeyValue?: Uint8Array,285}286287288289/**290* EnumerateUserResponse is the response from EnumerateUser291*/292export interface EnumerateUserResponse {293294Valid?: boolean,295296ASREPHash?: string,297298Error?: string,299}300301302303/**304* HostAddress Interface305*/306export interface HostAddress {307308AddrType?: number,309310Address?: Uint8Array,311}312313314315/**316* LibDefaults Interface317*/318export interface LibDefaults {319320CCacheType?: number,321322K5LoginAuthoritative?: boolean,323324Proxiable?: boolean,325326RDNS?: boolean,327328K5LoginDirectory?: string,329330KDCTimeSync?: number,331332VerifyAPReqNofail?: boolean,333334DefaultTGSEnctypes?: string[],335336DefaultTGSEnctypeIDs?: number[],337338DNSCanonicalizeHostname?: boolean,339340Forwardable?: boolean,341342/**343* time in nanoseconds344*/345346RenewLifetime?: number,347348/**349* time in nanoseconds350*/351352TicketLifetime?: number,353354DefaultClientKeytabName?: string,355356DefaultTktEnctypeIDs?: number[],357358DNSLookupRealm?: boolean,359360ExtraAddresses?: Uint8Array,361362DefaultRealm?: string,363364NoAddresses?: boolean,365366PreferredPreauthTypes?: number[],367368PermittedEnctypeIDs?: number[],369370RealmTryDomains?: number,371372DefaultKeytabName?: string,373374DefaultTktEnctypes?: string[],375376DNSLookupKDC?: boolean,377378IgnoreAcceptorHostname?: boolean,379380AllowWeakCrypto?: boolean,381382Canonicalize?: boolean,383384SafeChecksumType?: number,385386UDPPreferenceLimit?: number,387388/**389* time in nanoseconds390*/391392Clockskew?: number,393394PermittedEnctypes?: string[],395396KDCDefaultOptions?: BitString,397}398399400401/**402* PrincipalName Interface403*/404export interface PrincipalName {405406NameString?: string[],407408NameType?: number,409}410411412413/**414* Realm Interface415*/416export interface Realm {417418Realm?: string,419420AdminServer?: string[],421422DefaultDomain?: string,423424KDC?: string[],425426KPasswdServer?: string[],427428MasterKDC?: string[],429}430431432433/**434* TGS is the response from GetServiceTicket435*/436export interface TGS {437438Ticket?: Ticket,439440Hash?: string,441442ErrMsg?: string,443}444445446447/**448* Ticket Interface449*/450export interface Ticket {451452TktVNO?: number,453454Realm?: string,455456SName?: PrincipalName,457458EncPart?: EncryptedData,459460DecryptedEncPart?: EncTicketPart,461}462463464465/**466* TransitedEncoding Interface467*/468export interface TransitedEncoding {469470TRType?: number,471472Contents?: Uint8Array,473}474475476477