From 3d59ef7a8d57da7a5b0b589b8974a7c8db5cb8a3 Mon Sep 17 00:00:00 2001 From: Postmodern Date: Sat, 30 Sep 2023 03:11:25 -0700 Subject: [PATCH] Added the `--print-http` option to `CLI::WebVulnCommand` (closes #51). --- lib/ronin/vulns/cli/web_vuln_command.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ronin/vulns/cli/web_vuln_command.rb b/lib/ronin/vulns/cli/web_vuln_command.rb index d4525c4..89e79ef 100644 --- a/lib/ronin/vulns/cli/web_vuln_command.rb +++ b/lib/ronin/vulns/cli/web_vuln_command.rb @@ -48,6 +48,8 @@ class WebVulnCommand < Command option :print_curl, desc: 'Also prints an example curl command for each vulnerability' + option :print_http, desc: 'Also prints an example HTTP request for each vulnerability' + option :header, short: '-H', value: { type: /[A-Za-z0-9-]+:\s*\w+/, @@ -287,6 +289,12 @@ def log_vuln(vuln) puts puts " #{vuln.to_curl}" puts + elsif options[:print_http] + puts + vuln.to_http.each_line do |line| + puts " #{line}" + end + puts end end