feat(detector): Enhance port detection and service fingerprinting with improved HTTP/HTTPS and SSH checks, update test scripts for verbose output, and revise documentation with new hints and a detailed improvement plan.

This commit is contained in:
2025-05-26 09:40:16 +00:00
parent f54a2908ac
commit 7e1b99827c
11 changed files with 414 additions and 13 deletions

44
ts/detector.interfaces.ts Normal file
View File

@@ -0,0 +1,44 @@
export enum ServiceType {
HTTP = 'http',
HTTPS = 'https',
SSH = 'ssh',
FTP = 'ftp',
SMTP = 'smtp',
POP3 = 'pop3',
IMAP = 'imap',
MYSQL = 'mysql',
POSTGRESQL = 'postgresql',
MONGODB = 'mongodb',
REDIS = 'redis',
UNKNOWN = 'unknown'
}
export interface IDetectorResult {
isActive: boolean;
serviceType?: ServiceType;
protocol?: 'tcp' | 'udp';
responseTime?: number;
tlsVersion?: string;
serviceBanner?: string;
error?: string;
}
export interface INetworkDiagnostics {
ping?: {
reachable: boolean;
averageLatency: number;
packetLoss: number;
};
traceroute?: Array<{
hop: number;
hostname: string;
ip: string;
latency: number;
}>;
}
export interface IDetectorOptions {
timeout?: number;
includeNetworkDiagnostics?: boolean;
detectServiceType?: boolean;
}