class Crowbar::Rules::FTPRule

Overview

Structure-preserving rule for RFC 959 FTP command and response streams. Maintains strict CRLF line framing while mutating command arguments (e.g. PORT octets, RETR paths, credentials) or response status codes and messages.

Defined in:

crowbar/rules/ftp.cr

Constant Summary

COMMON_COMMANDS = ["USER", "PASS", "ACCT", "CWD", "CDUP", "SMNT", "QUIT", "REIN", "PORT", "PASV", "TYPE", "STRU", "MODE", "RETR", "STOR", "STOU", "APPE", "ALLO", "REST", "RNFR", "RNTO", "ABOR", "DELE", "RMD", "MKD", "PWD", "LIST", "NLST", "SITE", "SYST", "STAT", "HELP", "NOOP", "FEAT", "SIZE", "EPSV", "EPRT", "AUTH", "PBSZ", "PROT"]
RESPONSE_CODES = ["125", "150", "200", "211", "215", "220", "221", "226", "227", "230", "331", "332", "350", "421", "425", "426", "450", "451", "500", "501", "502", "503", "504", "530", "550", "552", "553", "999", "000"]

Constructors

Instance Method Summary

Instance methods inherited from class Crowbar::Rule

apply(context : Context, buffer : Buffer) : Bool apply, description : String description, match?(buffer : Buffer) : Bool match?, name : String name, targets(*targets : Symbol) targets, weight : Float64 weight, weight=(weight : Float64) weight=

Constructor methods inherited from class Crowbar::Rule

new(weight : Float64 = 1.0) new

Constructor Detail

def self.new(weight : Float64 = 1.0, mutate_responses : Bool = true, mutate_verbs : Bool = false) #

Instance Method Detail

def apply(context : Context, buffer : Buffer) : Bool #
Description copied from class Crowbar::Rule

Applies a structure-preserving transformation to the buffer


def description : String #

def match?(buffer : Buffer) : Bool #
Description copied from class Crowbar::Rule

Checks whether the buffer matches the format handled by this rule


def mutate_responses=(mutate_responses : Bool) #

def mutate_responses? : Bool #

def mutate_verbs=(mutate_verbs : Bool) #

def mutate_verbs? : Bool #

def name : String #