MAJOR=4 MINOR=6 DEVNAME=tty6 ˆÉÈÎ 689ÇÂ̱‹½•ïsš0Æß÷¯Èx±w@¬Ö";+tµþ\eV·Ûy‘DÈ „’X´ýPìévu­w;_àùæû<Bb~²ûMw2pÀ�Ûí€Á÷›N« $ÂÇRBÛµ‹†¢j:= H�I Â,Ë”¬¤°Ô‡î D�‹”zBÁKÖ…¹yf]3 çW` *BbµbLV€ÍdKÁ)&úëbqÈIŒç4$ &S®xŒ%yÌ<.s¾ªsC"J ‡¼€@Ä9ym’2o±=玶ems#pçÄœ1¼ÞÔÎo&ï¹E�f[O›aj™"Ï(¤~\—K$ˤ‘xêÕ%H=s8 Q¼P|:— E]úÙjöå:(‚Mµe"¤d^—¾4ë½ë~Ý–¬Šˆ ÑÛšn®iHVq"†éœ|T<,ÄCúr|B»ÐØ„{)Meñ^ óˆ‡Q=òåYËy‚ =Tü äýcÐxpz®Ýz(�àÍ{wçø´’5@)‰°iJ<ÁÒõ.~áås<ãÉõë-Ø…K©É@o*O ²Œ1ËâC(9ð7q´egTmñÇÐhªœzãÑôNG«Ûq;æüp+üJŽ9í,Ê6´d�\rþ¯´ºª_Êš*«U ë5MàˆPSÊí³b‰äg_¬’ ™> ÕMˆþuU.[�. û7·Ã»—q¤?a§»ÇrbÉ»X4Y¯õ²V6ŽbÑ•êy±ˆ+'jWð”ëñ²lhkú4™|3¢Ø~ç¥2XŽÖ¼2¦3g�åÄ’`ÑJ@/Õtíøj¹2Îûe#'¨N�D£û íûîpu¿4–¶PçîrÝe�D¿‘}c�åÄ’ÿ�¥¤ÿX-Ü“áî´2áöà4aq²ÿäiÆx<5ˆl–Ðz¾” ŠeJeAà™¸ËêbÑ¿�þBYJ³r‰Ç[Œ�âùÐ ƒuöZÏÃÍþdescription = [[ Performs a simple form fuzzing against forms found on websites. Tries strings and numbers of increasing length and attempts to determine if the fuzzing was successful. ]] --- -- @usage -- nmap --script http-form-fuzzer --script-args 'http-form-fuzzer.targets={1={path=/},2={path=/register.html}}' -p 80 -- -- This script attempts to fuzz fields in forms it detects (it fuzzes one field at a time). -- In each iteration it first tries to fuzz a field with a string, then with a number. -- In the output, actions and paths for which errors were observed are listed, along with -- names of fields that were being fuzzed during error occurrence. Length and type -- (string/integer) of the input that caused the error are also provided. -- We consider an error to be either: a response with status 500 or with an empty body, -- a response that contains "server error" or "sql error" strings. ATM anything other than -- that is considered not to be an 'error'. -- TODO: develop more sophisticated techniques that will let us determine if the fuzzing was -- successful (i.e. we got an 'error'). Ideally, an algorithm that will tell us a percentage -- difference between responses should be implemented. -- -- @output -- PORT STATE SERVICE REASON -- 80/tcp open http syn-ack -- | http-form-fuzzer: -- | Path: /register.html Action: /validate.php -- | age -- | integer lengths that caused errors: -- | 10000, 10001 -- | name -- | string lengths that caused errors: -- | 40000 -- | Path: /form.html Action: /check_form.php -- | fieldfoo -- | integer lengths that caused errors: -- |_ 1, 2 -- -- @args http-form-fuzzer.targets a table with the targets of fuzzing, for example -- {{path = /index.html, minlength = 40002}, {path = /foo.html, maxlength = 10000}}. -- The path parameter is required, if minlength or maxlength is not specified, -- then the values of http-form-fuzzer.minlength or http-form-fuzzer.maxlength will be used. -- Defaults to {{path="/"}} -- @args http-form-fuzzer.minlength the minimum length of a string that will be used for fuzzing, -- defaults to 300000 -- @args http-form-fuzzer.maxlength the maximum length of a string that will be used for fuzzing, -- defaults to 310000 -- author = {"Piotr Olma", "Gioacchino Mazzurco"} license = "Same as Nmap--See https://nmap.org/book/man-legal.html" categories = {"fuzzer", "intrusive"} local shortport = require 'shortport' local http = require 'http' local httpspider = require 'httpspider' local stdnse = require 'stdnse' local string = require 'string' local table = require 'table' local url = require 'url' local rand = require 'rand' -- check if the response we got indicates that fuzzing was successful local function check_response(response) if not(response.body) or response.status==500 then return true end if response.body:find("[Ss][Ee][Rr][Vv][Ee][Rr]%s*[Ee][Rr][Rr][Oo][Rr]") or response.body:find("[Ss][Qq][Ll]%s*[Ee][Rr][Rr][Oo][Rr]") then return true end return false end -- check from response if request was too big local function request_too_big(response) return response.status==413 or response.status==414 end -- checks if a field is of type we want to fuzz local function fuzzable(f