pwn 0.4.705 → 0.4.707

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3649788ab9739969e27230bbd48fc1a73e10cf1d725d26a840a56554e5ade27d
4
- data.tar.gz: 446c43688c957a5f77c7efb50f1214ce8508f2ec8389151cd05eb9961f8db893
3
+ metadata.gz: 37cfc2e423ee677fac02ad04aa54d6c49bf88ba3be1fc7f88b728e11d7e1590a
4
+ data.tar.gz: 7a341899d51adf15fcfda3ec0dc929a6c91da77076a654cdd10bb3c29d5be8cf
5
5
  SHA512:
6
- metadata.gz: 4b6c2e422c24c0636009984ecbe54b4ee5cc1847bb3f3a259147cb8478f16bd7b8175b7ecd1dffe2f42fc7189bee229725be9c05b6fad22a1aed54714effff21
7
- data.tar.gz: '0079c85c8d6dfe8c5cdea947a666bc2afe1d462b5d671f87c4a329106fbbc3bd104931a42c63b47e9b8157cf974dc1e1c1cfba95a735bf77e572a3bf29e4dfc6'
6
+ metadata.gz: c8046638ca7becec2cb0cdb1e465eb21304d8c3af1afaeaf61fdcc2d193db9a24a8a05e09b3051cb1b4ac166ddec25d34cd8fe736d9e6311ab0f6427b306a3df
7
+ data.tar.gz: bffdca2fe82e1edf821e0b039c52883394d9ea4d0fe42780bb230ad999bfeb55e11ceff1970f7097dc0eb6ef7eb0ca8f573a92131f79b6ee8eee504135a3f170
data/README.md CHANGED
@@ -37,7 +37,7 @@ $ rvm use ruby-3.2.2@pwn
37
37
  $ rvm list gemsets
38
38
  $ gem install --verbose pwn
39
39
  $ pwn
40
- pwn[v0.4.705]:001 >>> PWN.help
40
+ pwn[v0.4.707]:001 >>> PWN.help
41
41
  ```
42
42
 
43
43
  [![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](https://youtu.be/G7iLUY4FzsI)
@@ -52,7 +52,7 @@ $ rvm use ruby-3.2.2@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.4.705]:001 >>> PWN.help
55
+ pwn[v0.4.707]:001 >>> PWN.help
56
56
  ```
57
57
 
58
58
 
@@ -11,7 +11,10 @@ module PWN
11
11
 
12
12
  public_class_method def self.type
13
13
  return :cygwin if OS.cygwin?
14
+ return :freebsd if OS.freebsd?
14
15
  return :linux if OS.linux?
16
+ return :netbsd if OS.host_os.include?('netbsd')
17
+ return :openbsd if OS.host_os.include?('openbsd')
15
18
  return :osx if OS.osx?
16
19
  return :windows if OS.windows?
17
20
  rescue StandardError => e
@@ -12,25 +12,25 @@ module PWN
12
12
  public_class_method def self.list(opts = {})
13
13
  pid = opts[:pid]
14
14
 
15
- format = 'user,pcpu,pid,ppid,uid,gid,euid,egid,uname,group,args:1000,pmem'
15
+ which_os = PWN::Plugins::DetectOS.type
16
16
 
17
- if pid.nil?
18
- stdout, _stderr, _status = Open3.capture3(
19
- 'ps',
20
- 'ax',
21
- '-o',
22
- format
23
- )
17
+ case which_os
18
+ when :cygwin, :linux
19
+ cmd = 'ps'
20
+ format = 'user,pcpu,pid,ppid,uid,group,gid,cpu,command:1000,pmem'
21
+ params = "-p #{pid} -o #{format}"
22
+ params = "ax -o #{format}" if pid.nil?
23
+ when :freebsd, :netbsd, :openbsd, :osx
24
+ cmd = 'ps'
25
+ format = 'user,pcpu,pid,ppid,uid,group,gid,cpu,command,pmem'
26
+ params = "-p #{pid} -o #{format}"
27
+ params = "ax -o #{format}" if pid.nil?
24
28
  else
25
- stdout, _stderr, _status = Open3.capture3(
26
- 'ps',
27
- '-p',
28
- pid.to_s,
29
- '-o',
30
- format
31
- )
29
+ raise "Unsupported OS: #{which_os}"
32
30
  end
33
31
 
32
+ stdout, _stderr, _status = Open3.capture3(cmd, params)
33
+
34
34
  proc_list_arr = []
35
35
  stdout_arr = stdout.split("\n")
36
36
  stdout_arr.each do |line|
data/lib/pwn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.4.705'
4
+ VERSION = '0.4.707'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.705
4
+ version: 0.4.707
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.