12/**3* SSHClient is a client for SSH servers.4* Internally client uses github.com/zmap/zgrab2/lib/ssh driver.5* @example6* ```javascript7* const ssh = require('nuclei/ssh');8* const client = new ssh.SSHClient();9* ```10*/11export class SSHClient {121314// Constructor of SSHClient15constructor() {}16/**17* SetTimeout sets the timeout for the SSH connection in seconds18* @example19* ```javascript20* const ssh = require('nuclei/ssh');21* const client = new ssh.SSHClient();22* client.SetTimeout(10);23* ```24*/25public SetTimeout(sec: number): void {26return;27}282930/**31* Connect tries to connect to provided host and port32* with provided username and password with ssh.33* Returns state of connection and error. If error is not nil,34* state will be false35* @example36* ```javascript37* const ssh = require('nuclei/ssh');38* const client = new ssh.SSHClient();39* const connected = client.Connect('acme.com', 22, 'username', 'password');40* ```41*/42public Connect(host: string, port: number, username: string): boolean | null {43return null;44}454647/**48* ConnectWithKey tries to connect to provided host and port49* with provided username and private_key.50* Returns state of connection and error. If error is not nil,51* state will be false52* @example53* ```javascript54* const ssh = require('nuclei/ssh');55* const client = new ssh.SSHClient();56* const privateKey = `-----BEGIN RSA PRIVATE KEY----- ...`;57* const connected = client.ConnectWithKey('acme.com', 22, 'username', privateKey);58* ```59*/60public ConnectWithKey(host: string, port: number, username: string): boolean | null {61return null;62}636465/**66* ConnectSSHInfoMode tries to connect to provided host and port67* with provided host and port68* Returns HandshakeLog and error. If error is not nil,69* state will be false70* HandshakeLog is a struct that contains information about the71* ssh connection72* @example73* ```javascript74* const ssh = require('nuclei/ssh');75* const client = new ssh.SSHClient();76* const info = client.ConnectSSHInfoMode('acme.com', 22);77* log(to_json(info));78* ```79*/80public ConnectSSHInfoMode(host: string, port: number): HandshakeLog | null | null {81return null;82}838485/**86* Run tries to open a new SSH session, then tries to execute87* the provided command in said session88* Returns string and error. If error is not nil,89* state will be false90* The string contains the command output91* @example92* ```javascript93* const ssh = require('nuclei/ssh');94* const client = new ssh.SSHClient();95* client.Connect('acme.com', 22, 'username', 'password');96* const output = client.Run('id');97* log(output);98* ```99*/100public Run(cmd: string): string | null {101return null;102}103104105/**106* Close closes the SSH connection and destroys the client107* Returns the success state and error. If error is not nil,108* state will be false109* @example110* ```javascript111* const ssh = require('nuclei/ssh');112* const client = new ssh.SSHClient();113* client.Connect('acme.com', 22, 'username', 'password');114* const closed = client.Close();115* ```116*/117public Close(): boolean | null {118return null;119}120121122}123124125126/**127* Algorithms Interface128*/129export interface Algorithms {130131Kex?: string,132133HostKey?: string,134135W?: DirectionAlgorithms,136137R?: DirectionAlgorithms,138}139140141142/**143* DirectionAlgorithms Interface144*/145export interface DirectionAlgorithms {146147Cipher?: string,148149MAC?: string,150151Compression?: string,152}153154155156/**157* EndpointId Interface158*/159export interface EndpointId {160161SoftwareVersion?: string,162163Comment?: string,164165Raw?: string,166167ProtoVersion?: string,168}169170171172/**173* HandshakeLog Interface174*/175export interface HandshakeLog {176177Banner?: string,178179UserAuth?: string[],180181ServerID?: EndpointId,182183ClientID?: EndpointId,184185ServerKex?: KexInitMsg,186187ClientKex?: KexInitMsg,188189AlgorithmSelection?: Algorithms,190}191192193194/**195* KexInitMsg Interface196*/197export interface KexInitMsg {198199KexAlgos?: string[],200201CiphersClientServer?: string[],202203MACsServerClient?: string[],204205LanguagesClientServer?: string[],206207CompressionClientServer?: string[],208209CompressionServerClient?: string[],210211Reserved?: number,212213MACsClientServer?: string[],214215/**216* fixed size array of length: [16]217*/218219Cookie?: Uint8Array,220221ServerHostKeyAlgos?: string[],222223CiphersServerClient?: string[],224225LanguagesServerClient?: string[],226227FirstKexFollows?: boolean,228}229230231232