/**
* Zod schemas for password cracking tools
*/
import { z } from "zod";
/**
* Hydra brute force schema
*/
export const HydraSchema = z.object({
target: z
.string()
.describe("Target host or IP address"),
service: z
.enum(["ssh", "ftp", "http-get", "http-post", "https-get", "https-post", "mysql", "smb", "rdp", "telnet"])
.describe("Service to attack"),
username: z
.string()
.optional()
.describe("Single username to test"),
username_list: z
.string()
.optional()
.describe("File containing usernames (one per line)"),
password: z
.string()
.optional()
.describe("Single password to test"),
password_list: z
.string()
.optional()
.describe("File containing passwords (one per line)"),
port: z
.number()
.int()
.min(1)
.max(65535)
.optional()
.describe("Custom port number"),
threads: z
.number()
.int()
.min(1)
.max(64)
.default(16)
.describe("Number of parallel connections"),
timeout: z
.number()
.int()
.min(10)
.max(3600)
.default(1800)
.describe("Scan timeout in seconds"),
verbose: z
.boolean()
.default(false)
.describe("Verbose output"),
});
export type HydraInput = z.infer<typeof HydraSchema>;
/**
* John the Ripper schema
*/
export const JohnSchema = z.object({
hash_file: z
.string()
.describe("File containing password hashes"),
format: z
.string()
.optional()
.describe("Hash format (e.g., 'md5', 'sha256', 'des', 'nt')"),
wordlist: z
.string()
.optional()
.describe("Wordlist file for dictionary attack"),
rules: z
.string()
.optional()
.describe("Mangling rules to apply"),
incremental: z
.boolean()
.default(false)
.describe("Use incremental mode (brute force)"),
timeout: z
.number()
.int()
.min(10)
.max(3600)
.default(3600)
.describe("Cracking timeout in seconds"),
});
export type JohnInput = z.infer<typeof JohnSchema>;
/**
* Hashcat schema
*/
export const HashcatSchema = z.object({
hash_file: z
.string()
.describe("File containing password hashes"),
mode: z
.number()
.int()
.describe("Hash type mode (e.g., 0=MD5, 100=SHA1, 1000=NTLM, 1400=SHA256)"),
attack_type: z
.enum(["dictionary", "combinator", "brute-force", "hybrid"])
.default("dictionary")
.describe("Attack mode"),
wordlist: z
.string()
.optional()
.describe("Wordlist file for dictionary attack"),
mask: z
.string()
.optional()
.describe("Mask for brute-force attack (e.g., '?a?a?a?a?a?a?a?a')"),
rules: z
.string()
.optional()
.describe("Rules file"),
timeout: z
.number()
.int()
.min(10)
.max(3600)
.default(3600)
.describe("Cracking timeout in seconds"),
});
export type HashcatInput = z.infer<typeof HashcatSchema>;