/** * Grammar-Based Bash Syntax Generator * * Uses fc.letrec to generate random valid bash syntax based on the grammar. * This provides true fuzzing by exploring the syntax space systematically * rather than using predefined patterns. */ import fc from "fast-check"; /** Valid bash identifier (variable name) */ export declare const identifier: fc.Arbitrary; /** Strict pollution identifiers - only dangerous names, no regular identifiers */ export declare const strictPollutionIdentifier: fc.Arbitrary; /** Dangerous/special identifier names for prototype pollution testing */ export declare const dangerousIdentifier: fc.Arbitrary; /** Chained property paths for deep pollution attempts */ export declare const pollutionChain: fc.Arbitrary; /** Integer literal */ export declare const integerLiteral: fc.Arbitrary; /** Simple word (no special characters) */ export declare const simpleWord: fc.Arbitrary; /** Command name */ export declare const commandName: fc.Arbitrary; /** Grammar type for bash syntax generation */ export interface BashGrammarArbitraries { script: fc.Arbitrary; statement: fc.Arbitrary; pipeline: fc.Arbitrary; command: fc.Arbitrary; simpleCommand: fc.Arbitrary; compoundCommand: fc.Arbitrary; word: fc.Arbitrary; expansion: fc.Arbitrary; arithmeticExpr: fc.Arbitrary; } /** * Create a grammar-based bash script generator. * @param _maxDepth - Maximum nesting depth (currently unused, for future depth control) */ export declare function createBashGrammar(_maxDepth?: number): BashGrammarArbitraries; /** Generate a random bash script */ export declare const bashScript: fc.Arbitrary; /** Generate a random bash statement */ export declare const bashStatement: fc.Arbitrary; /** Generate a random bash command */ export declare const bashCommand: fc.Arbitrary; /** Generate a random bash word with possible expansions */ export declare const bashWord: fc.Arbitrary; /** Generate a random bash expansion */ export declare const bashExpansion: fc.Arbitrary; /** Generate a random arithmetic expression */ export declare const bashArithmetic: fc.Arbitrary; /** Generate a random compound command (control structure) */ export declare const bashCompound: fc.Arbitrary; /** Generate a random simple command */ export declare const bashSimpleCommand: fc.Arbitrary; /** Generate pollution-focused assignment statements (always uses strict pollution names) */ export declare const pollutionAssignment: fc.Arbitrary; /** Generate pollution-focused expansion patterns (always uses strict pollution names) */ export declare const pollutionExpansion: fc.Arbitrary; /** Generate complete pollution test scripts (always uses strict pollution names) */ export declare const pollutionScript: fc.Arbitrary; /** cat command variations */ export declare const catCommand: fc.Arbitrary; /** head/tail command variations */ export declare const headTailCommand: fc.Arbitrary; /** grep command variations */ export declare const grepCommand: fc.Arbitrary; /** sed command variations */ export declare const sedCommand: fc.Arbitrary; /** awk command variations */ export declare const awkCommand: fc.Arbitrary; /** sort command variations */ export declare const sortCommand: fc.Arbitrary; /** uniq command variations */ export declare const uniqCommand: fc.Arbitrary; /** wc command variations */ export declare const wcCommand: fc.Arbitrary; /** cut command variations */ export declare const cutCommand: fc.Arbitrary; /** tr command variations */ export declare const trCommand: fc.Arbitrary; /** ls command variations */ export declare const lsCommand: fc.Arbitrary; /** File manipulation commands */ export declare const fileManipCommand: fc.Arbitrary; /** stat/file commands */ export declare const statCommand: fc.Arbitrary; /** find command variations */ export declare const findCommand: fc.Arbitrary; /** jq command variations */ export declare const jqCommand: fc.Arbitrary; /** base64 command variations */ export declare const base64Command: fc.Arbitrary; /** gzip command variations */ export declare const gzipCommand: fc.Arbitrary; /** echo command variations */ export declare const echoCommand: fc.Arbitrary; /** printf command variations */ export declare const printfCommand: fc.Arbitrary; /** seq command variations */ export declare const seqCommand: fc.Arbitrary; /** expr command variations */ export declare const exprCommand: fc.Arbitrary; /** date command variations */ export declare const dateCommand: fc.Arbitrary; /** Environment commands */ export declare const envCommand: fc.Arbitrary; /** Path manipulation */ export declare const pathCommand: fc.Arbitrary; /** test command variations */ export declare const testCommand: fc.Arbitrary; /** xargs command variations */ export declare const xargsCommand: fc.Arbitrary; /** diff command variations */ export declare const diffCommand: fc.Arbitrary; /** Complete AWK program */ export declare const awkProgram: fc.Arbitrary; /** AWK command with program and optional input */ export declare const awkGrammarCommand: fc.Arbitrary; /** AWK pollution-focused program */ export declare const awkPollutionProgram: fc.Arbitrary; /** AWK pollution-focused command */ export declare const awkPollutionCommand: fc.Arbitrary; /** Complete SED program */ export declare const sedProgram: fc.Arbitrary; /** SED command with program and input */ export declare const sedGrammarCommand: fc.Arbitrary; /** SED pollution-focused program */ export declare const sedPollutionProgram: fc.Arbitrary; /** SED pollution-focused command */ export declare const sedPollutionCommand: fc.Arbitrary; /** Complete JQ filter */ export declare const jqFilter: fc.Arbitrary; /** JQ command with filter and JSON input */ export declare const jqGrammarCommand: fc.Arbitrary; /** JQ pollution-focused program */ export declare const jqPollutionFilter: fc.Arbitrary; /** JQ pollution-focused command */ export declare const jqPollutionCommand: fc.Arbitrary; /** Generate a random command from all supported commands */ export declare const supportedCommand: fc.Arbitrary; /** Generate a pipeline of supported commands */ export declare const commandPipeline: fc.Arbitrary; /** Generate a script using multiple supported commands */ export declare const commandScript: fc.Arbitrary;