package Resources::Models::Exploit;

use Moose;
with 'Resources::API::GINIndexing'
    ; ## this roles enables gin indexing, extract_index return the indexed fields

has 'LHOST'       => ( is => "rw" );
has 'RPORT'       => ( is => "rw" );
has 'RHOST'       => ( is => "rw" );
has 'URIPATH'     => ( is => "rw" );
has 'type'        => ( is => "rw" );
has 'module'      => ( is => "rw" );
has 'rank'        => ( is => "rw" );
has 'description' => ( is => "rw" );
has 'name'        => ( is => "rw" );
has 'successful'  => ( is => "rw", default => sub {0} );
has 'targets' => (
    isa     => "ArrayRef",
    default => sub { [] },
    is      => "rw"
);
has 'references' => (
    is      => "rw",
    isa     => "ArrayRef",
    default => sub { [] }
);
has 'default_rport' => ( is => "rw" );
has 'tags' => (
    is      => "rw",
    isa     => "ArrayRef",
    default => sub { [] }
);

sub extract_index {
    my $self = shift;
    return {
        default_rport => $self->default_rport,
        RPORT         => $self->RPORT,
        module        => $self->module,
    };
}

1;
