require 'thor' require 'threat_agent' module ThreatAgent module Tasks # A namespace for Pwnxy Thor tasks # # @author Erran Carey class Pwnxy < Thor desc 'pwnxy info', 'List information on Pwnxy instances' def info info = $threat_agent_client.request(:pwnxy_info) # TODO: Add a UI class/method. $stdout.puts info end desc 'pwnxy logs [INSTANCE] [OPTIONS]', 'Show logs for a Pwnxy instance' # TODO: Add logs(identifier = :last), add support in the TA API # Support last/first in the TA API. Currently 0 returns first. Use # -1 for last? # TODO: Add support for dropping all logs? def logs(identifier = 0) log = $threat_agent_client.request(:pwnxy_logs, { p: identifier }) # TODO: Add a UI class/method. $stdout.puts log end end end end