From 22dc7426a9209080b37f5fba26cce1fe24011a1b Mon Sep 17 00:00:00 2001 From: "f.amato" Date: Thu, 23 Jan 2014 05:07:23 -0800 Subject: [PATCH] Adding support to Faraday using RPC Api --- README.md | 1 + docs/CHANGES | 5 +++++ isrcore/main.pm | 2 ++ isrcore/shellz.pm | 21 +++++++++++++++++++-- 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3db8eae..2a27650 100644 --- a/README.md +++ b/README.md @@ -598,6 +598,7 @@ will fill out for you (agentmd5, agentsha256, and agentsize) that can't be done Data::Dump Digest::MD5 Time::HiRes + RPC::XML .:: [MORE INFORMATION] ::. diff --git a/docs/CHANGES b/docs/CHANGES index 8641c55..f87befe 100755 --- a/docs/CHANGES +++ b/docs/CHANGES @@ -1,3 +1,8 @@ +Version 2.0.6 - 17-01-2014 +-------------------------- +-Adding support to Faraday www.faradaysec.com - RPC Api connection + + Version 2.0.5 - 06-05-2013 -------------------------- - Adding support for Windows by Elian Gidoni diff --git a/isrcore/main.pm b/isrcore/main.pm index dff74fa..2cbb908 100755 --- a/isrcore/main.pm +++ b/isrcore/main.pm @@ -30,6 +30,8 @@ use Data::Dump qw(dump); my $options = { 'port' => { 'val' => 80, 'desc' => 'Webserver listening port'}, 'sslport' => { 'val' => 443, 'desc' => 'Webserver SSL listening port'}, + 'RPCfaraday' => { 'val' => "http://127.0.0.1:9876/", 'desc' => 'Faraday RPC Server'}, + 'faraday' => { 'val' => 0, 'desc' => 'Enable RPC Faraday connection'}, 'debug' => { 'val' => 1, 'desc' => 'Debug mode'}, 'DNSPort' => { 'val' => 53, 'desc' => 'Listen Name Server port'}, 'DNSEnable' => { 'val' => 1, 'desc' => 'Enable DNS Server ( handle virtual request on modules )'}, diff --git a/isrcore/shellz.pm b/isrcore/shellz.pm index 592d8d5..bab1e2c 100755 --- a/isrcore/shellz.pm +++ b/isrcore/shellz.pm @@ -33,7 +33,8 @@ use isrcore::ASCIITable; use isrcore::dnsserver; #external modules use Data::Dump qw(dump); - +require RPC::XML; +require RPC::XML::Client; #ignore child's process to avoid zombie $SIG{CHLD} = 'IGNORE'; @@ -440,6 +441,22 @@ sub console_cmd { if ($file) { $self->{'webserver'}->{'users'}->{$ip}->{$module}->{'file'}=($tfile) ? "$tfile\n$md5,$sha256,'$cwd',$file" :"$md5,$sha256,'$cwd',$file"; } + + #RPC faraday connection + if ($self->{'isrmain'}->{'Base'}->{'options'}->{'faraday'}->{'val'} == 1){ + eval { + my $cli = RPC::XML::Client->new($self->{'isrmain'}->{'Base'}->{'options'}->{'RPCfaraday'}->{'val'}); + my $resp = $cli->send_request('devlog','Importing evilgrade information'); + my $h_id = $cli->send_request('createAndAddHost',$ip,"unknown"); + + my $var = RPC::XML::array->new("URL-http://github.com/infobyte/evilgrade/"); + my $v_id = $cli->send_request('createAndAddVulnToHost',$h_id->value,"Evilgrade injection -".$module,"This ip is interacted with evilgrade framework see the notes inside the host for more information",$var,"HIGH"); + #add note host id, note, value + my $n_id = $cli->send_request('createAndAddNoteToHost',$h_id->value,"Evilgrade -".$module,$action) if ($action); + my $n_id2 = $cli->send_request('createAndAddNoteToHost',$h_id->value,"Evilgrade file -".$module,($tfile) ? "$tfile\n$md5,$sha256,'$cwd',$file" :"$md5,$sha256,'$cwd',$file"); + + } + } } ########################################################################## @@ -452,7 +469,7 @@ sub smry_configure {"Configure "} sub smry_reload {"Reload to update all the modules"} sub smry_start {"Start webserver"} sub smry_status {"Get webserver status"} -sub smry_stop {"Stop webserver"} +sub smry_stop {"Stop webserverR"} sub smry_restart {"Restart webserver"} sub smry_vhosts {"Show vhosts enable"}