Skip to content

Conversation

@Selora
Copy link
Contributor

Added reporting capabilities.
Capturing MSF output and putting it in "report.csv"
Also create an MSF RCscript for every modules ran against a given host. That way, you can reproduce whatever caused an exploit to work.

Copy link
Contributor

@EkultekEkultek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this but I have to test it first

Copy link
Contributor

@EkultekEkultek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ekultek
Copy link
Contributor

Copy link
Contributor

@EkultekEkultek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last thing, is this compatible with python3.x?

@Selora
Copy link
ContributorAuthor

It should be compatible with Python3.x, now it's a bit harder to test since raw_inputs is used elsewhere in the original codebase.

I haven't made use of python2-specific features so it shouldn't be a problem to port.

Regarding the modification of import statements, can you please elaborate on what needs to be done? I've read this chapter and I'm not seeing what needs to be modified.
https://www.python.org/dev/peps/pep-0008/#imports

@Ekultek
Copy link
Contributor

Metasploit output is logged (anything prefixed by '[+||-||*]') Changed from straight command-line invocation to rc-scripts per-hosts/per-modules. MSF module output to console
@Selora
Copy link
ContributorAuthor

I modified the two import lines as asked. It's the same commit ID, I forced-pushed it after an amended commit.

@Ekultek
Copy link
Contributor

I'll get it tested soon, gotta install a VM first

@Ekultek
Copy link
Contributor

Did you originally fork from master?

@Selora
Copy link
ContributorAuthor

Forked from dev-beta, fast-forwarded every commits hitherto so it should painless to merge to dev-beta

@Ekultek
Copy link
Contributor

I like it put there's a couple things I don't like about it.

lib/settings.py Outdated
)
return process'''
#os.system(command)
lib.output.info("Executing command{}".format(command))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command needs to be wrapped in single quotes and stripped example:

executing command 'sudo msfconsole <SOMETHING> <OPTS>'

lib/settings.py Outdated
stdout_buff= []
forstdout_lineiniter(proc.stdout.readline, b''):
stdout_buff+= [stdout_line.rstrip()]
print(">>>>{}".format(stdout_line).rstrip())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need an output image for this, something like:

(msf)>> OUTPUT

@Ekultek
Copy link
Contributor

Decided I'd just do it myself, lemme retest real quick

@EkultekEkultek merged commit 74c6fef into NullArray:dev-betaApr 3, 2018
@Ekultek
Copy link
Contributor

I'm gonna go ahead and merge this, I'll fix stuff I don't like later on.

@Selora
Copy link
ContributorAuthor

Selora commented Apr 3, 2018

It creates a structure like the following:

<autosploit_out> | `- YYYY-MM-DD_HHhMMmSSs | `- report.csv | `- <IP> | | | `- <escaped_module_name_rcscipt> | `- <escaped_module_name_rcscipt> | `- (. . .) `- <IP> | | `- <escaped_module_name_rcscipt> | `- <escaped_module_name_rcscipt> | `- (. . .) (. . .) 

Report (csv) looks like:

"Target Host","Date (UTC)","MSF Module","LocalHost","Listening Port","Successful Logs","Failure Logs","All Logs" "<ip_victim_redacted>","2018-04-03_14h39m58s","exploit/windows/ftp/ms09_053_ftpd_nlst","<ip_lhost_redacted>","4444","","[-] <IP_REDACTED>:21 - Exploit failed [unreachable]: Rex::ConnectionRefused The connection was refused by the remote host (<IP_REDACTED>:21).","<ALL MSF_OUTPUT_HERE_REDACTED_CAN_BE_LONG>(. . .) 

@Ekultek
Copy link
Contributor

Yeah I saw it, good job I like it.

@EkultekEkultek mentioned this pull request Apr 3, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@Selora@Ekultek@NullArray