Class: Penkit::CLI

Inherits:
Thor
  • Object
show all
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/stop.rb,
lib/penkit/cli/container/start.rb

Instance Method Summary collapse

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 metasploit(*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



26
27
28
# File 'lib/penkit/cli/tools.rb', line 26

def nmap(*args)
  docker.run("cli:net", "nmap", *args)
end

#ping(*args) ⇒ Object



31
32
33
# File 'lib/penkit/cli/tools.rb', line 31

def ping(*args)
  docker.run("cli:net", "ping", *args)
end

#psObject



4
5
6
# File 'lib/penkit/cli/container/ps.rb', line 4

def ps
  docker.ps
end

#rm(*containers) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/penkit/cli/container/rm.rb', line 4

def rm(*containers)
  if containers.any?
    docker.rm(*containers)
  else
    rm_all
  end
end

#rpcinfo(*args) ⇒ Object



36
37
38
# File 'lib/penkit/cli/tools.rb', line 36

def rpcinfo(*args)
  docker.run("cli:net", "rpcinfo", *args)
end

#showmount(*args) ⇒ Object



41
42
43
# File 'lib/penkit/cli/tools.rb', line 41

def showmount(*args)
  docker.run("cli:net", "showmount", *args)
end

#smbclient(*args) ⇒ Object



46
47
48
# File 'lib/penkit/cli/tools.rb', line 46

def smbclient(*args)
  docker.run("cli:net", "smbclient", *args)
end

#sqlmap(*args) ⇒ Object



51
52
53
# File 'lib/penkit/cli/tools.rb', line 51

def sqlmap(*args)
  docker.run("cli:sqlmap", *args)
end

#start(image) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/penkit/cli/container/start.rb', line 5

def start(image)
  if has_config?(image)
    opts = options.dup
    opts[:name] ||= unique_name(image)
    docker_compose.up(image, opts)
  else
    docker.start(image, options.dup)
  end
end

#stop(*containers) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/penkit/cli/container/stop.rb', line 4

def stop(*containers)
  if containers.any?
    docker.stop(*containers)
  else
    stop_all
  end
end

#versionObject



14
15
16
# File 'lib/penkit/cli/penkit.rb', line 14

def version
  puts VERSION
end

#wget(*args) ⇒ Object



56
57
58
# File 'lib/penkit/cli/tools.rb', line 56

def wget(*args)
  docker.run("cli:net", "wget", *args)
end

#wpscan(*args) ⇒ Object



61
62
63
# File 'lib/penkit/cli/tools.rb', line 61

def wpscan(*args)
  docker.run("cli:wpscan", *args)
end