Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #102

Merged
merged 3 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading