pwn 0.5.711 → 0.5.712

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ab0eff0005f523bb5972be43cf49ab4c15ab9eaecda0968c9206621e2997e47
4
- data.tar.gz: 2a166f6ff6b5620e820de709d5dc1ae356550e23afffbc52de138d3ab6499d7f
3
+ metadata.gz: 24bf2b4c619ee3d57fe991bff09ab97838506283144fbcde635d39c7e368a3b1
4
+ data.tar.gz: 1ed8d4f63cfc8331fd494172e65724037131a378cd42716df2d36e22dfdce6d5
5
5
  SHA512:
6
- metadata.gz: c74d677beb74e9cd348faebbc1b02dff1b48956b0225487ef48af1be080f94137472f892dce6698a2d55c0febbbb1637a477e4ec090098ffe64cc5e26030b33b
7
- data.tar.gz: 6bf02d8127f74b609d3cc8ae1c03586b96f29e44c921e00893dc550f516817c6b4d3456ad516262c1d919e93a36cceffedc7891039460801de2c937dfbbaf2d1
6
+ metadata.gz: d8ce0b58ac26c52adacedd0ae58df169357d87d53f1e5040d9c6eba4083bf83545065c8e504a6f2e7baebb84409b807af99fa6ef2cfd148682e898962794b67e
7
+ data.tar.gz: 712a254b7346e7eb3668634c1b47bf336dce6393e960ad1ed24e0d0abc812752ed1cd442f277c44bd6b1c3360472b8d44075418758909fd7bbf435ea2d8ebe2f
@@ -108,8 +108,9 @@ pwn setup --list-profiles
108
108
  `24.04`) via `PWN::Setup.packages_for`. Family fallbacks still live in
109
109
  `PWN::Setup::NATIVE_GEMS` / `::TOOLCHAIN`. Tools with no OS package on this
110
110
  distro (Frida, one_gadget, ROPgadget, checksec, ropper, kube-hunter, or
111
- Kali-only names on Ubuntu) install via `pip` / `gem` or are skipped so
112
- `apt-get` does not abort the whole profile.
111
+ Kali-only names on Ubuntu) install via `pipx` (Debian/Kali/Ubuntu) or `pip`
112
+ / `gem`, or are skipped so one missing apt name cannot abort the whole
113
+ profile. Each OS package is installed in its own `apt-get`/`dnf`/… command.
113
114
  3. Show the exact commands, prompt (unless `--yes`), run them, then
114
115
  `gem pristine` / `gem install` any native extension that still fails to
115
116
  load, and re-run the doctor.
@@ -44,6 +44,10 @@ PWN::Setup.packages_for(opts)
44
44
  - `authors`
45
45
  - `help`
46
46
 
47
+ ## References
48
+
49
+ - `references/urls.md` — URLs from source
50
+
47
51
  ## Source
48
52
 
49
53
  `pwn/setup.rb`
@@ -0,0 +1,3 @@
1
+ # PWN::Setup source links
2
+
3
+ - https://install.pwndbg.re
data/lib/pwn/setup.rb CHANGED
@@ -262,6 +262,7 @@ module PWN
262
262
  },
263
263
  'pwndbg' => {
264
264
  apt: %w[pwndbg], dnf: %w[], pacman: %w[pwndbg], brew: %w[], port: %w[],
265
+ script: "curl --proto '=https' --tlsv1.2 -LsSf 'https://install.pwndbg.re' | sh -s -- -t pwndbg-gdb",
265
266
  plugins: %w[PWN::Plugins::GDB]
266
267
  },
267
268
  'ropper' => {
@@ -373,6 +374,18 @@ module PWN
373
374
 
374
375
  t[bin] = t[bin].merge(ubuntu: [], debian: [])
375
376
  end
377
+ {
378
+ 'checksec' => %w[checksec],
379
+ 'ROPgadget' => %w[python3-ropgadget],
380
+ 'ropper' => %w[ropper],
381
+ 'pwndbg' => [],
382
+ 'semgrep' => [],
383
+ 'vol' => []
384
+ }.each do |bin, pkgs|
385
+ next unless t[bin]
386
+
387
+ t[bin] = t[bin].merge(kali: pkgs)
388
+ end
376
389
  end.freeze
377
390
 
378
391
  # Capability profiles — how you get the ergonomics of `pwn-full`
@@ -653,6 +666,8 @@ module PWN
653
666
  gems.each { |g| os_pkgs.concat(Array(NATIVE_GEMS.dig(g, pm[:key]))) }
654
667
  bins.each { |b| os_pkgs.concat(packages_for(bin: b, distro: distro, version: version, pm_key: pm[:key])) }
655
668
  os_pkgs = os_pkgs.reject(&:empty?).uniq
669
+ alts = alt_install_cmds(bins: bins, pm_key: pm[:key], distro: distro, version: version)
670
+ os_pkgs = (['pipx'] + os_pkgs).uniq if pm[:key] == :apt && alts.any? { |c| c.include?('pipx install') }
656
671
 
657
672
  io.puts "Profile : #{profile} — #{prof[:desc]}"
658
673
  io.puts "Distro : #{distro} #{version}"
@@ -661,14 +676,13 @@ module PWN
661
676
  io.puts "Ruby exts : #{gems.empty? ? '(none)' : gems.join(' ')}"
662
677
  io.puts
663
678
 
664
- cmds = []
665
- cmds << "#{pm[:install]} #{os_pkgs.map { |p| Shellwords.escape(p) }.join(' ')}" unless os_pkgs.empty?
679
+ cmds = os_pkgs.map { |pkg| "#{pm[:install]} #{Shellwords.escape(pkg)}" }
666
680
  unless gems.empty?
667
681
  broken = gems.reject { |g| gem_loadable?(name: g) }
668
682
  cmds << "gem pristine #{broken.map { |g| Shellwords.escape(g) }.join(' ')}" unless broken.empty?
669
683
  cmds << "gem install #{broken.map { |g| Shellwords.escape(g) }.join(' ')}" unless broken.empty?
670
684
  end
671
- cmds.concat(alt_install_cmds(bins: bins, pm_key: pm[:key], distro: distro, version: version))
685
+ cmds.concat(alts)
672
686
 
673
687
  if cmds.empty?
674
688
  io.puts "Nothing to do — profile '#{profile}' is already satisfied."
@@ -922,13 +936,25 @@ module PWN
922
936
  next if packages_for(bin: b, pm_key: pm_key, distro: distro, version: version).any?
923
937
 
924
938
  if meta[:pip].to_s != ''
925
- "python3 -m pip install --user #{Shellwords.escape(meta[:pip])}"
939
+ pip_install_cmd(pkg: meta[:pip], distro: distro)
926
940
  elsif meta[:gem].to_s != ''
927
941
  "gem install #{Shellwords.escape(meta[:gem])}"
942
+ elsif meta[:script].to_s != ''
943
+ meta[:script].to_s
928
944
  end
929
945
  end
930
946
  end
931
947
 
948
+ private_class_method def self.pip_install_cmd(opts = {})
949
+ pkg = opts[:pkg].to_s
950
+ distro = opts[:distro].to_s.to_sym
951
+ if %i[kali debian ubuntu mint pop chromeos].include?(distro)
952
+ "pipx install #{Shellwords.escape(pkg)}"
953
+ else
954
+ "python3 -m pip install --user #{Shellwords.escape(pkg)}"
955
+ end
956
+ end
957
+
932
958
  private_class_method def self.bin?(opts = {})
933
959
  !which(name: opts[:name]).empty?
934
960
  end
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.5.711'
4
+ VERSION = '0.5.712'
5
5
  end
@@ -117,21 +117,24 @@ describe PWN::Setup do
117
117
  it 'every TOOLCHAIN row has an OS package or pip/gem installer' do
118
118
  PWN::Setup::TOOLCHAIN.each do |bin, meta|
119
119
  has_pkg = %i[apt dnf pacman brew port].any? { |k| Array(meta[k]).any? }
120
- has_alt = meta[:pip].to_s != '' || meta[:gem].to_s != ''
120
+ has_alt = meta[:pip].to_s != '' || meta[:gem].to_s != '' || meta[:script].to_s != ''
121
121
  expect(has_pkg || has_alt).to be(true), "#{bin} has no apt/dnf/pacman/brew/port/pip/gem installer"
122
122
  end
123
123
  end
124
124
 
125
- it 'deps --profile full dry-run emits pip/gem for unpackaged toolchain bins' do
125
+ it 'deps --profile full dry-run emits pipx/gem for bins with no distro package' do
126
126
  io = StringIO.new
127
127
  r = PWN::Setup.deps(profile: :full, dry_run: true, io: io)
128
128
  cmds = Array(r[:ran]).map { |h| h[:cmd] }.join("\n")
129
129
  expect(r[:skipped]).not_to be true
130
- unpackaged = PWN::Setup::TOOLCHAIN.select do |_bin, meta|
131
- %i[apt dnf pacman brew port].none? { |k| Array(meta[k]).any? }
132
- end
133
- unpackaged.each do |bin, meta|
134
- token = meta[:pip] || meta[:gem] || bin
130
+ distro = PWN::Plugins::DetectOS.distro
131
+ version = PWN::Plugins::DetectOS.version
132
+ PWN::Setup::TOOLCHAIN.each do |bin, meta|
133
+ next if PWN::Setup.packages_for(bin: bin, distro: distro, version: version).any?
134
+
135
+ token = meta[:pip] || meta[:gem]
136
+ next unless token
137
+
135
138
  expect(cmds).to include(token.to_s), "full dry-run missing installer for #{bin} (#{token})"
136
139
  end
137
140
  end
@@ -155,4 +158,37 @@ describe PWN::Setup do
155
158
  expect(cmds).not_to include('burpsuite')
156
159
  expect(cmds).not_to include('zaproxy')
157
160
  end
161
+
162
+ it 'maps Kali 2026.3 apt names for checksec ROPgadget ropper' do
163
+ k = { distro: :kali, version: '2026.3', pm_key: :apt }
164
+ expect(PWN::Setup.packages_for(k.merge(bin: 'checksec'))).to eq(%w[checksec])
165
+ expect(PWN::Setup.packages_for(k.merge(bin: 'ROPgadget'))).to eq(%w[python3-ropgadget])
166
+ expect(PWN::Setup.packages_for(k.merge(bin: 'ropper'))).to eq(%w[ropper])
167
+ end
168
+
169
+ it 'does not apt-get Kali-missing names and does not pip --user on Kali' do
170
+ k = { distro: :kali, version: '2026.3', pm_key: :apt }
171
+ %w[pwndbg semgrep vol].each do |b|
172
+ expect(PWN::Setup.packages_for(k.merge(bin: b))).to eq([])
173
+ end
174
+ r = PWN::Setup.deps(profile: :full, dry_run: true, io: StringIO.new, distro: :kali, version: '2026.3')
175
+ cmds = Array(r[:ran]).map { |h| h[:cmd] }
176
+ apt = cmds.select { |c| c.include?('apt-get') }.join("\n")
177
+ expect(apt).to include('checksec')
178
+ expect(apt).to include('python3-ropgadget')
179
+ expect(apt).to include('ropper')
180
+ expect(apt).not_to match(/\bpwndbg\b/)
181
+ expect(apt).not_to match(/\bsemgrep\b/)
182
+ expect(apt).not_to include('volatility3')
183
+ expect(cmds.join("\n")).not_to include('pip install --user')
184
+ expect(cmds.join("\n")).to include('install.pwndbg.re')
185
+ expect(cmds.join("\n")).to include('pwndbg-gdb')
186
+ end
187
+
188
+ it 'issues one apt-get per package so a missing name cannot abort the rest' do
189
+ r = PWN::Setup.deps(profile: :net, dry_run: true, io: StringIO.new, distro: :kali, version: '2026.3')
190
+ apt = Array(r[:ran]).map { |h| h[:cmd] }.select { |c| c.include?('apt-get install') }
191
+ expect(apt.length).to be > 1
192
+ apt.each { |c| expect(c).to match(/apt-get install -y \S+\z/) }
193
+ end
158
194
  end
@@ -3195,6 +3195,7 @@
3195
3195
  {"messages":[{"role":"user","content":"PWN::Setup.list_profiles Usage"},{"role":"assistant","content":"`PWN::Setup.list_profiles`: Supported Method Parameters\n\nPWN::Setup.list_profiles(\n\nio: 'optional - IO to write to (default $stdout)'\n\n)\n"}]}
3196
3196
  {"messages":[{"role":"user","content":"PWN::Setup.migrate Usage"},{"role":"assistant","content":"`PWN::Setup.migrate`: Supported Method Parameters\n\nPWN::Setup.migrate(\n\nfix: 'optional - also autofix incompatible ~/.pwn files (default false)',\ndry_run: 'optional - print what WOULD happen (default false)',\nyes: 'optional - alias for fix:true (CI-friendly)',\nio: 'optional - IO to write to (default $stdout)'\n\n)\n\nDelegate to PWN::Migrate.run — verify every ~/.pwn state file is compatible with THIS pwn release and (optionally) autofix it. A timestamped backup of ~/.pwn is taken first. See ‘PWN::Migrate.help`.\n"}]}
3197
3197
  {"messages":[{"role":"user","content":"PWN::Setup.packages_for Usage"},{"role":"assistant","content":"`PWN::Setup.packages_for`: Supported Method Parameters\n\nPWN::Setup.packages_for(\n\nbin: 'required - TOOLCHAIN key (e.g. nmap or burpsuite)',\ndistro: 'optional - DetectOS.distro symbol (defaults to live detect)',\nversion: 'optional - DetectOS.version string (defaults to live detect)',\npm_key: 'optional - package-manager family (:apt :dnf :pacman :brew :port :pkg …)'\n\n)\n"}]}
3198
+ {"messages":[{"role":"user","content":"PWN::Setup.pip_install_cmd Usage"},{"role":"assistant","content":"`PWN::Setup.pip_install_cmd`: "}]}
3198
3199
  {"messages":[{"role":"user","content":"PWN::Setup.pkg_manager Usage"},{"role":"assistant","content":"`PWN::Setup.pkg_manager`: Supported Method Parameters\n\nPWN::Setup.pkg_manager\n"}]}
3199
3200
  {"messages":[{"role":"user","content":"PWN::Setup.terminal Usage"},{"role":"assistant","content":"`PWN::Setup.terminal`: Supported Method Parameters\n\nPWN::Setup.terminal(\n\nyes: 'optional - assume yes; non-interactive (default false)',\ndry_run: 'optional - print what WOULD happen (default false)',\nio: 'optional - IO to write to (default $stdout)'\n\n)\n\nOpt-in installer for SHIFT+ENTER multi-line support in the pwn-ai / pwn-asm REPL. Never runs implicitly — the user invokes it with ‘pwn setup –terminal` after PWNMultiLineInput#ensure_vte_shift_enter tells them their emulator can’t distinguish Shift+Enter from Enter.\n\nWhat it does:\n\n1. Prints the two `~/.tmux.conf` lines that persist the runtime\n `tmux set -s` calls PWNMultiLineInput already makes.\n2. If running under Terminator (a VTE host), copies\n third_party/terminator/pwn_shift_enter.py to\n ~/.config/terminator/plugins/ and enables the PWNShiftEnter\n plugin in ~/.config/terminator/config — WITH confirmation and\n a .pwnbak backup. This is the only VTE emulator we can fix at\n the GTK layer without patching libvte itself.\n\nEverything here is host-config mutation, which is why it lives in ‘pwn setup` and NOT in the REPL’s runtime path. See GNOME/vte issues #2601 / #2607 for why VTE can’t be fixed with escape sequences alone.\n"}]}
3200
3201
  {"messages":[{"role":"user","content":"PWN::Setup.which Usage"},{"role":"assistant","content":"`PWN::Setup.which`: "}]}
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.5.711
4
+ version: 0.5.712
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
@@ -5478,6 +5478,7 @@ files:
5478
5478
  - etc/default_skills/pwn/sdr/son_micro_rfid/SKILL.md
5479
5479
  - etc/default_skills/pwn/sessions/SKILL.md
5480
5480
  - etc/default_skills/pwn/setup/SKILL.md
5481
+ - etc/default_skills/pwn/setup/references/urls.md
5481
5482
  - etc/default_skills/pwn/version/SKILL.md
5482
5483
  - etc/default_skills/pwn/www/SKILL.md
5483
5484
  - etc/default_skills/pwn/www/app_cobalt_io/SKILL.md