Class: Penkit::CLI
- Inherits:
-
Thor
- Object
- Thor
- Penkit::CLI
- Includes:
- Helpers
- Defined in:
- lib/penkit/cli/tools.rb,
lib/penkit/cli/penkit.rb,
lib/penkit/cli/container/ps.rb,
lib/penkit/cli/container/rm.rb,
lib/penkit/cli/container/pull.rb,
lib/penkit/cli/container/stop.rb,
lib/penkit/cli/container/start.rb
Instance Method Summary collapse
- #curl(*args) ⇒ Object
- #ftp(*args) ⇒ Object
- #metasploit(*args) ⇒ Object
- #netcat(*args) ⇒ Object
- #nmap(*args) ⇒ Object
- #ping(*args) ⇒ Object
- #ps(*args) ⇒ Object
- #pull(image) ⇒ Object
- #rm(*containers) ⇒ Object
- #rpcinfo(*args) ⇒ Object
- #showmount(*args) ⇒ Object
- #smbclient(*args) ⇒ Object
- #sqlmap(*args) ⇒ Object
- #start(image) ⇒ Object
- #stop(*containers) ⇒ Object
- #version ⇒ Object
- #wget(*args) ⇒ Object
- #wpscan(*args) ⇒ Object
Instance Method Details
#curl(*args) ⇒ Object
6 7 8 |
# File 'lib/penkit/cli/tools.rb', line 6 def curl(*args) docker.run("cli:net", "curl", *args) end |
#ftp(*args) ⇒ Object
11 12 13 |
# File 'lib/penkit/cli/tools.rb', line 11 def ftp(*args) docker.run("cli:net", "lftp", *args) end |
#metasploit(*args) ⇒ Object
16 17 18 |
# File 'lib/penkit/cli/tools.rb', line 16 def (*args) docker.run("cli:metasploit", *args) end |
#netcat(*args) ⇒ Object
21 22 23 |
# File 'lib/penkit/cli/tools.rb', line 21 def netcat(*args) docker.run("cli:net", "nc", *args) end |
#nmap(*args) ⇒ Object
28 29 30 |
# File 'lib/penkit/cli/tools.rb', line 28 def nmap(*args) docker.run("cli:net", "nmap", *args) end |
#ping(*args) ⇒ Object
33 34 35 |
# File 'lib/penkit/cli/tools.rb', line 33 def ping(*args) docker.run("cli:net", "ping", *args) end |
#ps(*args) ⇒ Object
4 5 6 |
# File 'lib/penkit/cli/container/ps.rb', line 4 def ps(*args) docker.ps(*args) end |
#pull(image) ⇒ Object
4 5 6 |
# File 'lib/penkit/cli/container/pull.rb', line 4 def pull(image) docker.pull(image) end |
#rm(*containers) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/penkit/cli/container/rm.rb', line 5 def rm(*containers) if containers.any? docker.rm(*containers) else rm_all end end |
#rpcinfo(*args) ⇒ Object
38 39 40 |
# File 'lib/penkit/cli/tools.rb', line 38 def rpcinfo(*args) docker.run("cli:net", "rpcinfo", *args) end |
#showmount(*args) ⇒ Object
43 44 45 |
# File 'lib/penkit/cli/tools.rb', line 43 def showmount(*args) docker.run("cli:net", "showmount", *args) end |
#smbclient(*args) ⇒ Object
48 49 50 |
# File 'lib/penkit/cli/tools.rb', line 48 def smbclient(*args) docker.run("cli:net", "smbclient", *args) end |
#sqlmap(*args) ⇒ Object
53 54 55 |
# File 'lib/penkit/cli/tools.rb', line 53 def sqlmap(*args) docker.run("cli:sqlmap", *args) end |
#start(image) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/penkit/cli/container/start.rb', line 5 def start(image) puts "Pulling latest image..." docker.pull(image, quiet: true) # Quietly updates the image if has_config?(image) opts = .dup opts[:name] ||= unique_name(image) docker_compose.up(image, opts) else docker.start(image, .dup) end end |
#stop(*containers) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/penkit/cli/container/stop.rb', line 5 def stop(*containers) if containers.any? docker.stop(*containers) else stop_all end end |
#version ⇒ Object
15 16 17 |
# File 'lib/penkit/cli/penkit.rb', line 15 def version puts VERSION end |
#wget(*args) ⇒ Object
58 59 60 |
# File 'lib/penkit/cli/tools.rb', line 58 def wget(*args) docker.run("cli:net", "wget", *args) end |
#wpscan(*args) ⇒ Object
63 64 65 |
# File 'lib/penkit/cli/tools.rb', line 63 def wpscan(*args) docker.run("cli:wpscan", *args) end |