Skip to content

Instantly share code, notes, and snippets.

@kernelsmith
Last active July 28, 2021 14:34
Show Gist options
  • Save kernelsmith/5492199 to your computer and use it in GitHub Desktop.
Save kernelsmith/5492199 to your computer and use it in GitHub Desktop.
MASH/MESH/SMASH ~ Metasploit Attack Shell or Metasploit Action Shell or Metasploit Exploitation Shell or whatever
MSF
ME
METASPLOIT
SH
BASH
to summarize earlier comments,
maybe soft linking into /usr/bin, maybe /usr/bin/msf/* or aliasing the root console-type commands
which would shovel a call to an rpc daemon running on localhost presumably. Could do a busybox type
approach where they all call into the same rb file, or if not, could put a bunch of rb files in
/usr/bin/msf directly instead of the busybox approach, but that would be ugly and harder to maintain
R7 folks familiar w/the RPC API etc:
Op3n4M3 or adfoster or inokii (which is Matthew, he authored quite a bit of the JSON RPC stuff, but it has been a while). Alan Foster's team is currently responsible for Framework bug fixes and features.
hdm:
need to figure out bash completion api for it though
4:47 here is the quick hack i did for it already
4:47 hmm. well, didnt save the other half of it
4:49 http://pastebin.com/WxyU7KMc
4:49 quick hack basically - one ruby script does the proxying of commands to console_command via rpc
4:49 and it spits out a list of commands, handles rpc setup, spawn the daemon, etc
4:50 bash script creates aliases from all supported commands, sets up tab completion, that kind of thing
4:50 alternatively just ln -sf mesh.rb ./bin/set ; etc
4:50 upside is that works outside of bash
notdurandal
4:59 https://github.com/iadnah/bashrc <-- has some of what is needed for bash.rc to make this happen
also
notdurandal
5:37 one other thought i had to maybe make it easier and not jack shit up if things don't work right..
initial bootstrap.sh or something to chroot you [or make msf paths available for tab completion]
5:38 then dynamically links the modules dir and all that fun or fakes it so you can still
"use some/folder/somewhere/exploit"
5:39 maybe ~/.msf4
HD's pastebin:
Creash mesh.sh
for i in `mesh.rb commands`; do
alias ${i}="mesh.rb ${i}";
done
Create mesh.rb ->
=begin
./mesh.rb commands
-> set
-> get
-> use
./mesh.rb config localhost 50505 username password
-> store in ~/.msf4/mesh.yml
./mesh.rb status
-> server is 'running'
./mesh.rb start
-> starting service
tab completion?
sessions?
exploit
run
=end
@gitdurandal
Copy link

Fixed bashrc so it wasn't b0rk. New one is https://github.com/gitbrew/bashrc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment