Skip to content

Commit

Permalink
Develop (#102)
Browse files Browse the repository at this point in the history
* add masscan

* added --keep option

* added badges
  • Loading branch information
htrgouvea authored Jun 9, 2024
1 parent 11bd5b1 commit 8649e6e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ FROM perl:5.32-threaded
COPY . /usr/src/spellbook
WORKDIR /usr/src/spellbook

RUN apt-get update && \
apt-get install -y masscan

RUN cpanm --installdeps .

ENTRYPOINT [ "perl", "./spellbook.pl" ]
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
<a href="https://github.com/htrgouvea/spellbook/releases">
<img src="https://img.shields.io/badge/version-0.3.3-blue.svg">
</a>
<br/>
<img src="https://github.com/htrgouvea/spellbook/actions/workflows/linter.yml/badge.svg">
<img src="https://github.com/htrgouvea/spellbook/actions/workflows/sast.yml/badge.svg">
<img src="https://github.com/htrgouvea/spellbook/actions/workflows/security-gate.yml/badge.svg">
<img src="https://github.com/htrgouvea/spellbook/actions/workflows/test.yml/badge.svg">
</p>
</p>

Expand Down
17 changes: 12 additions & 5 deletions lib/Spellbook/Helper/Scope.pm
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package Spellbook::Helper::Scope {
use strict;
use warnings;
use YAML::Tiny; # https://metacpan.org/pod/YAML::Tiny
use YAML::Tiny;
use Spellbook::Core::Module;
use Spellbook::Core::Orchestrator;

sub new {
my ($self, $parameters) = @_;
my ($help, $scope, $information, $entrypoint, $save, @results, @response);
my ($help, $scope, $information, $entrypoint, $save, $keep, @results, @response);

my $threads = 10;

Expand All @@ -18,6 +18,7 @@ package Spellbook::Helper::Scope {
"i|information=s" => \$information,
"e|entrypoint=s" => \$entrypoint,
"t|threads=i" => \$threads,
"K|keep" => \$keep,
"save:s" => \$save
);

Expand All @@ -43,10 +44,15 @@ package Spellbook::Helper::Scope {
}

if ($save) {
for (keys @results) {
$yamlfile -> [0] -> {$save} = [@results];
$yamlfile -> write ($scope);
if ($keep && exists $yamlfile->[0]->{$save}) {
push @{$yamlfile->[0]->{$save}}, @results;
}

else {
$yamlfile->[0]->{$save} = [@results];
}

$yamlfile->write($scope);
}

return @results;
Expand All @@ -60,6 +66,7 @@ package Spellbook::Helper::Scope {
\r-S, --scope Define a YML file as a scope
\r-i, --information Set an information to extract from your scope
\r-e, --entrypoint Send informations to another entrypoint module
\r-K, --keep Keep the current values in the file and add news values
\r--save Save the output on some attribute\n\n";
}

Expand Down

0 comments on commit 8649e6e

Please sign in to comment.