pwn 0.5.269 → 0.5.270
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 +4 -4
- data/.rubocop_todo.yml +11 -3
- data/README.md +3 -3
- data/lib/pwn/banner/radare2.rb +1 -1
- data/lib/pwn/banner/radare2_ai.rb +116 -0
- data/lib/pwn/banner.rb +4 -1
- data/lib/pwn/version.rb +1 -1
- data/spec/lib/pwn/banner/radare2_ai_spec.rb +20 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88edbebef74e0c39a05a6b6d1ff69f0dfef67ea0bd0cf14f533545d68b03bd63
|
4
|
+
data.tar.gz: 7dc86f9aaba9eeb528d8f13d939d6cad1ac20d224b8e412f57cb2b9bfc51322c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b420f167c5f182422dfa4610ebb77f230a58b1d2167ec6ad3c9d574a375b653dcabafda8e3987f9fc9bc94e5388576b052f25c50a45fd6ac286eabd8cb7b718
|
7
|
+
data.tar.gz: 0a839bd6eb480c14b4da0c6e56c75bb232563ffd7727bf5701971e3d0ead2b0cd60435b1fc2e71bd584919093708b8b8b9716cae0640e814848d56ba77b45872
|
data/.rubocop_todo.yml
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# This configuration was generated by
|
2
2
|
# `rubocop --auto-gen-config`
|
3
|
-
# on 2025-
|
3
|
+
# on 2025-05-01 15:57:20 UTC using RuboCop version 1.75.4.
|
4
4
|
# The point is for the user to remove these configuration records
|
5
5
|
# one by one as the offenses are removed from the code base.
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
8
8
|
|
9
|
-
# Offense count:
|
9
|
+
# Offense count: 24
|
10
10
|
# This cop supports safe autocorrection (--autocorrect).
|
11
11
|
# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
12
12
|
# URISchemes: http, https
|
@@ -15,6 +15,7 @@ Layout/LineLength:
|
|
15
15
|
- 'Vagrantfile'
|
16
16
|
- 'bin/pwn_diff_csv_files_w_column_exclude'
|
17
17
|
- 'lib/pwn/banner/jmp_esp.rb'
|
18
|
+
- 'lib/pwn/banner/radare2_ai.rb'
|
18
19
|
- 'lib/pwn/plugins/mail_agent.rb'
|
19
20
|
- 'lib/pwn/plugins/ollama.rb'
|
20
21
|
- 'lib/pwn/plugins/open_ai.rb'
|
@@ -25,6 +26,13 @@ Layout/LineLength:
|
|
25
26
|
- 'lib/pwn/sast/banned_function_calls_c.rb'
|
26
27
|
- 'packer/provisioners/aliases.rb'
|
27
28
|
|
29
|
+
# Offense count: 1
|
30
|
+
# This cop supports safe autocorrection (--autocorrect).
|
31
|
+
# Configuration parameters: AllowInHeredoc.
|
32
|
+
Layout/TrailingWhitespace:
|
33
|
+
Exclude:
|
34
|
+
- 'lib/pwn/banner/radare2_ai.rb'
|
35
|
+
|
28
36
|
# Offense count: 9
|
29
37
|
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
30
38
|
Lint/NestedMethodDefinition:
|
@@ -42,7 +50,7 @@ Lint/RedundantTypeConversion:
|
|
42
50
|
- 'lib/pwn/plugins/jenkins.rb'
|
43
51
|
- 'lib/pwn/plugins/repl.rb'
|
44
52
|
|
45
|
-
# Offense count:
|
53
|
+
# Offense count: 304
|
46
54
|
# This cop supports safe autocorrection (--autocorrect).
|
47
55
|
# Configuration parameters: AutoCorrect.
|
48
56
|
Lint/UselessAssignment:
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ $ cd /opt/pwn
|
|
37
37
|
$ ./install.sh
|
38
38
|
$ ./install.sh ruby-gem
|
39
39
|
$ pwn
|
40
|
-
pwn[v0.5.
|
40
|
+
pwn[v0.5.270]:001 >>> PWN.help
|
41
41
|
```
|
42
42
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.4.1@pwn
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
53
53
|
$ gem install --verbose pwn
|
54
54
|
$ pwn
|
55
|
-
pwn[v0.5.
|
55
|
+
pwn[v0.5.270]:001 >>> PWN.help
|
56
56
|
```
|
57
57
|
|
58
58
|
If you're using a multi-user install of RVM do:
|
@@ -62,7 +62,7 @@ $ rvm use ruby-3.4.1@pwn
|
|
62
62
|
$ rvmsudo gem uninstall --all --executables pwn
|
63
63
|
$ rvmsudo gem install --verbose pwn
|
64
64
|
$ pwn
|
65
|
-
pwn[v0.5.
|
65
|
+
pwn[v0.5.270]:001 >>> PWN.help
|
66
66
|
```
|
67
67
|
|
68
68
|
PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
|
data/lib/pwn/banner/radare2.rb
CHANGED
@@ -12,7 +12,7 @@ module PWN
|
|
12
12
|
public_class_method def self.get
|
13
13
|
'
|
14
14
|
$ target_arm_bin="/usr/bin/id";
|
15
|
-
$ alias r2="setarch $(uname -m) -R r2 -AA -c \"v
|
15
|
+
$ alias r2="setarch $(uname -m) -R r2 -AA -c \"v r2-pwn-layout\""
|
16
16
|
$ r2 -c "db (0x`readelf -S $target_arm_bin | grep text | awk "{print $NF}"`)+0x4+0x00000328" -c "ood" -c "dc" -c "v" $target_arm_bin
|
17
17
|
'.yellow
|
18
18
|
rescue StandardError => e
|
@@ -0,0 +1,116 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'colorize'
|
4
|
+
|
5
|
+
module PWN
|
6
|
+
module Banner
|
7
|
+
# This plugin processes images into readable text
|
8
|
+
module Radare2AI
|
9
|
+
# Supported Method Parameters::
|
10
|
+
# PWN::Banner::Radare2AI.get
|
11
|
+
|
12
|
+
public_class_method def self.get
|
13
|
+
'
|
14
|
+
$ target_bin="/usr/bin/id";
|
15
|
+
$ alias r2="setarch $(uname -m) -R r2 -AA -c \"v r2-pwn-layout\""
|
16
|
+
$ r2 $target_bin
|
17
|
+
-- Log On. Hack In. Go Anywhere. Get Everything.
|
18
|
+
[0x7ffff7fe35c0]> aaaa
|
19
|
+
INFO: Analyze all flags starting with sym. and entry0 (aa)
|
20
|
+
INFO: Analyze imports (af@@@i)
|
21
|
+
INFO: Analyze entrypoint (af@ entry0)
|
22
|
+
INFO: Analyze symbols (af@@@s)
|
23
|
+
INFO: Analyze all functions arguments/locals (afva@@@F)
|
24
|
+
INFO: Analyze function calls (aac)
|
25
|
+
INFO: Analyze len bytes of instructions for references (aar)
|
26
|
+
INFO: Finding and parsing C++ vtables (avrr)
|
27
|
+
INFO: Analyzing methods (af @@ method.*)
|
28
|
+
INFO: Recovering local variables (afva@@@F)
|
29
|
+
INFO: Skipping type matching analysis in debugger mode (aaft)
|
30
|
+
INFO: Propagate noreturn information (aanr)
|
31
|
+
INFO: Scanning for strings constructed in code (/azs)
|
32
|
+
INFO: Finding function preludes (aap)
|
33
|
+
INFO: Enable anal.types.constraint for experimental type propagation
|
34
|
+
[0x7ffff7fe35c0]> db main
|
35
|
+
[0x7ffff7fe35c0]> dc
|
36
|
+
INFO: hit breakpoint at: 0x555555556490
|
37
|
+
[0x555555556490]> decai -e lang=C++
|
38
|
+
[0x555555556490]> decai -e
|
39
|
+
decai -e pipeline=
|
40
|
+
decai -e model=Radare2:latest
|
41
|
+
decai -e deterministic=true
|
42
|
+
decai -e debug=false
|
43
|
+
decai -e api=ollama
|
44
|
+
decai -e lang=C++
|
45
|
+
decai -e hlang=English
|
46
|
+
decai -e cache=false
|
47
|
+
decai -e cmds=pdga
|
48
|
+
decai -e prompt=Transform this pseudocode and respond ONLY with plain code (NO explanations, comments or markdown), Change goto into if/else/for/while, Simplify as much as possible, use better variable names, take function arguments and strings from comments like string:, Reduce lines of code and fit everything in a single function, removing all dead code. Most importantly, determine if this code is exploitable.
|
49
|
+
decai -e ctxfile=
|
50
|
+
decai -e host=http://localhost
|
51
|
+
decai -e port=11434
|
52
|
+
decai -e maxinputtokens=-1
|
53
|
+
[0x555555556490]> decai -d
|
54
|
+
// Function to get the effective user ID and group ID
|
55
|
+
// Returns the effective user ID and group ID as a string in the format "effective_uid:effective_gid"
|
56
|
+
// If an error occurs, returns an empty string
|
57
|
+
|
58
|
+
#include <stdio.h>
|
59
|
+
#include <stdlib.h>
|
60
|
+
#include <string.h>
|
61
|
+
#include <unistd.h>
|
62
|
+
#include <errno.h>
|
63
|
+
#include <sys/types.h>
|
64
|
+
#include <sys/stat.h>
|
65
|
+
|
66
|
+
char* get_effective_ids() {
|
67
|
+
gid_t effective_gid;
|
68
|
+
uid_t effective_uid;
|
69
|
+
|
70
|
+
// Get effective GID
|
71
|
+
effective_gid = getegid();
|
72
|
+
if (effective_gid == -1) {
|
73
|
+
perror("getegid");
|
74
|
+
return "";
|
75
|
+
}
|
76
|
+
|
77
|
+
// Get effective UID
|
78
|
+
effective_uid = geteuid();
|
79
|
+
if (effective_uid == -1) {
|
80
|
+
perror("geteuid");
|
81
|
+
return "";
|
82
|
+
}
|
83
|
+
|
84
|
+
// Format and return the result
|
85
|
+
char result[32];
|
86
|
+
snprintf(result, sizeof(result), "effective_uid:%d effective_gid:%d", (int)effective_uid, (int)effective_gid);
|
87
|
+
return strdup(result);
|
88
|
+
}
|
89
|
+
```
|
90
|
+
|
91
|
+
This code defines a new function `get_effective_ids()` that uses the standard library functions `geteuid()` and `getegid()` to get the effective user ID and group ID, respectively. It then formats the result as a string in the format "effective_uid:effective_gid" and returns it using `strdup()` to allocate memory for the result. If an error occurs while getting the effective IDs, the function returns an empty string.
|
92
|
+
'.yellow
|
93
|
+
rescue StandardError => e
|
94
|
+
raise e
|
95
|
+
end
|
96
|
+
|
97
|
+
# Author(s):: 0day Inc. <support@0dayinc.com>
|
98
|
+
|
99
|
+
public_class_method def self.authors
|
100
|
+
"AUTHOR(S):
|
101
|
+
0day Inc. <support@0dayinc.com>
|
102
|
+
"
|
103
|
+
end
|
104
|
+
|
105
|
+
# Display Usage for this Module
|
106
|
+
|
107
|
+
public_class_method def self.help
|
108
|
+
puts "USAGE:
|
109
|
+
#{self}.get
|
110
|
+
|
111
|
+
#{self}.authors
|
112
|
+
"
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
data/lib/pwn/banner.rb
CHANGED
@@ -18,6 +18,7 @@ module PWN
|
|
18
18
|
autoload :OffTheAir, 'pwn/banner/off_the_air'
|
19
19
|
autoload :Pirate, 'pwn/banner/pirate'
|
20
20
|
autoload :Radare2, 'pwn/banner/radare2'
|
21
|
+
autoload :Radare2AI, 'pwn/banner/radare2_ai'
|
21
22
|
autoload :WhiteRabbit, 'pwn/banner/white_rabbit'
|
22
23
|
|
23
24
|
# Supported Method Parameters::
|
@@ -27,7 +28,7 @@ module PWN
|
|
27
28
|
|
28
29
|
public_class_method def self.get(opts = {})
|
29
30
|
index = opts[:index].to_i
|
30
|
-
index = Random.rand(1..
|
31
|
+
index = Random.rand(1..15) unless index.positive?
|
31
32
|
|
32
33
|
banner = ''
|
33
34
|
case index
|
@@ -58,6 +59,8 @@ module PWN
|
|
58
59
|
when 13
|
59
60
|
banner = PWN::Banner::Radare2.get
|
60
61
|
when 14
|
62
|
+
banner = PWN::Banner::Radare2AI.get
|
63
|
+
when 15
|
61
64
|
banner = PWN::Banner::WhiteRabbit.get
|
62
65
|
else
|
63
66
|
raise 'Invalid Index.'
|
data/lib/pwn/version.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe PWN::Banner::Radare2AI do
|
6
|
+
it 'should cointain a method for banner retrieval' do
|
7
|
+
get_response = PWN::Banner::Radare2AI
|
8
|
+
expect(get_response).to respond_to :get
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should display information for authors' do
|
12
|
+
authors_response = PWN::Banner::Radare2AI
|
13
|
+
expect(authors_response).to respond_to :authors
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'should display information for existing help method' do
|
17
|
+
help_response = PWN::Banner::Radare2AI
|
18
|
+
expect(help_response).to respond_to :help
|
19
|
+
end
|
20
|
+
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.5.
|
4
|
+
version: 0.5.270
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 0day Inc.
|
@@ -1805,6 +1805,7 @@ files:
|
|
1805
1805
|
- lib/pwn/banner/off_the_air.rb
|
1806
1806
|
- lib/pwn/banner/pirate.rb
|
1807
1807
|
- lib/pwn/banner/radare2.rb
|
1808
|
+
- lib/pwn/banner/radare2_ai.rb
|
1808
1809
|
- lib/pwn/banner/white_rabbit.rb
|
1809
1810
|
- lib/pwn/ffi.rb
|
1810
1811
|
- lib/pwn/ffi/stdio.rb
|
@@ -2140,6 +2141,7 @@ files:
|
|
2140
2141
|
- spec/lib/pwn/banner/ninja_spec.rb
|
2141
2142
|
- spec/lib/pwn/banner/off_the_air_spec.rb
|
2142
2143
|
- spec/lib/pwn/banner/pirate_spec.rb
|
2144
|
+
- spec/lib/pwn/banner/radare2_ai_spec.rb
|
2143
2145
|
- spec/lib/pwn/banner/radare2_spec.rb
|
2144
2146
|
- spec/lib/pwn/banner/white_rabbit_spec.rb
|
2145
2147
|
- spec/lib/pwn/banner_spec.rb
|