Skip to content

Commit 87f0763

Browse files
committed
pwn REPL - implement multiple LLM support for pwn-irc (e.g. OpenAI, Ollama via Open WebUI w/ its respective models, etc). Update PWN::Plugins::Ollama module to get working #chat method that works identically to #PWN::Plugins::OpenAI.chat method. This is to support AI agent collaboration / context switching / reduce cost of usage via pwn-irc command
1 parent 3be8b75 commit 87f0763

File tree

10 files changed

+332
-328
lines changed

10 files changed

+332
-328
lines changed

.rubocop_todo.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2024-05-27 22:02:31 UTC using RuboCop version 1.64.0.
3+
# on 2024-05-31 18:04:59 UTC using RuboCop version 1.64.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -35,19 +35,19 @@ Layout/LineLength:
3535
- 'lib/pwn/reports/uri_buster.rb'
3636
- 'lib/pwn/sast/banned_function_calls_c.rb'
3737

38-
# Offense count: 8
38+
# Offense count: 9
3939
# Configuration parameters: AllowedMethods, AllowedPatterns.
4040
Lint/NestedMethodDefinition:
4141
Exclude:
4242
- 'lib/pwn/plugins/repl.rb'
4343

44-
# Offense count: 315
44+
# Offense count: 306
4545
# This cop supports unsafe autocorrection (--autocorrect-all).
4646
# Configuration parameters: AutoCorrect.
4747
Lint/UselessAssignment:
4848
Enabled: false
4949

50-
# Offense count: 4
50+
# Offense count: 5
5151
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
5252
# AllowedMethods: refine
5353
Metrics/BlockLength:
@@ -58,7 +58,7 @@ Metrics/BlockLength:
5858
- 'lib/pwn/plugins/repl.rb'
5959
- 'lib/pwn/sast/banned_function_calls_c.rb'
6060

61-
# Offense count: 48
61+
# Offense count: 44
6262
# Configuration parameters: CountBlocks, Max.
6363
Metrics/BlockNesting:
6464
Enabled: false
@@ -81,7 +81,7 @@ Metrics/MethodLength:
8181
Exclude:
8282
- 'lib/pwn/banner/code_cave.rb'
8383

84-
# Offense count: 8
84+
# Offense count: 9
8585
# Configuration parameters: CountComments, Max, CountAsOne.
8686
Metrics/ModuleLength:
8787
Exclude:
@@ -93,6 +93,7 @@ Metrics/ModuleLength:
9393
- 'lib/pwn/plugins/nessus_cloud.rb'
9494
- 'lib/pwn/plugins/open_ai.rb'
9595
- 'lib/pwn/plugins/packet.rb'
96+
- 'lib/pwn/plugins/repl.rb'
9697

9798
# Offense count: 1
9899
# This cop supports safe autocorrection (--autocorrect).
@@ -106,7 +107,7 @@ Style/Alias:
106107
Style/ClassVars:
107108
Enabled: false
108109

109-
# Offense count: 278
110+
# Offense count: 279
110111
# This cop supports safe autocorrection (--autocorrect).
111112
# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
112113
# SupportedStyles: assign_to_condition, assign_inside_condition
@@ -126,13 +127,12 @@ Style/IfUnlessModifier:
126127
- 'lib/pwn/plugins/baresip.rb'
127128
- 'lib/pwn/plugins/mail_agent.rb'
128129

129-
# Offense count: 11
130+
# Offense count: 10
130131
# This cop supports unsafe autocorrection (--autocorrect-all).
131132
Style/MapIntoArray:
132133
Exclude:
133134
- 'bin/pwn_android_war_dialer'
134135
- 'bin/pwn_domain_reversewhois'
135-
- 'bin/pwn_ibm_appscan_enterprise'
136136
- 'bin/pwn_jenkins_install_plugin'
137137
- 'bin/pwn_jenkins_thinBackup_aws_s3'
138138
- 'bin/pwn_www_uri_buster'
@@ -156,7 +156,7 @@ Style/RedundantStringEscape:
156156
- 'lib/pwn/sast/redos.rb'
157157
- 'vagrant/provisioners/kali_customize.rb'
158158

159-
# Offense count: 52
159+
# Offense count: 54
160160
# This cop supports unsafe autocorrection (--autocorrect-all).
161161
Style/SlicingWithRange:
162162
Enabled: false

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ gem 'colorize', '1.1.0'
2626
gem 'credit_card_validations', '6.2.0'
2727
gem 'eventmachine', '1.2.7'
2828
gem 'executable-hooks', '1.7.1'
29-
gem 'faker', '3.3.1'
29+
gem 'faker', '3.4.1'
3030
gem 'faye-websocket', '0.11.3'
3131
gem 'ffi', '1.16.3'
3232
gem 'fftw3', '0.3'
@@ -46,7 +46,7 @@ gem 'jwt', '2.8.1'
4646
gem 'libusb', '0.7.1'
4747
gem 'luhn', '1.0.2'
4848
gem 'mail', '2.8.1'
49-
gem 'meshtastic', '0.0.66'
49+
gem 'meshtastic', '0.0.67'
5050
gem 'metasm', '1.0.5'
5151
gem 'mongo', '2.20.0'
5252
gem 'msfrpc-client', '1.1.2'
@@ -76,7 +76,7 @@ gem 'rmagick', '6.0.1'
7676
gem 'rqrcode', '2.2.0'
7777
gem 'rspec', '3.13.0'
7878
gem 'rtesseract', '3.1.3'
79-
gem 'rubocop', '1.64.0'
79+
gem 'rubocop', '1.64.1'
8080
gem 'rubocop-rake', '0.6.0'
8181
gem 'rubocop-rspec', '2.29.2'
8282
gem 'ruby-audio', '1.6.1'

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ cd /opt/pwn
3737
$ ./install.sh
3838
$ ./install.sh ruby-gem
3939
$ pwn
40-
pwn[v0.5.149]:001 >>> PWN.help
40+
pwn[v0.5.150]:001 >>> PWN.help
4141
```
4242

4343
[![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.3.1@pwn
5252
$ gem uninstall --all --executables pwn
5353
$ gem install --verbose pwn
5454
$ pwn
55-
pwn[v0.5.149]:001 >>> PWN.help
55+
pwn[v0.5.150]:001 >>> PWN.help
5656
```
5757

5858
If you're using a multi-user install of RVM do:
@@ -62,7 +62,7 @@ $ rvm use ruby-3.3.1@pwn
6262
$ rvmsudo gem uninstall --all --executables pwn
6363
$ rvmsudo gem install --verbose pwn
6464
$ pwn
65-
pwn[v0.5.149]:001 >>> PWN.help
65+
pwn[v0.5.150]:001 >>> PWN.help
6666
```
6767

6868
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:

bin/pwn_ibm_appscan_enterprise

Lines changed: 0 additions & 112 deletions
This file was deleted.

etc/pwn.yaml.EXAMPLE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ ai_engine: 'openai'
55
openai:
66
key: 'required - OpenAI API Key'
77
model: 'optional - OpenAI model to use'
8+
temp: 'optional - OpenAI temperature'
89

910
ollama:
1011
fqdn: 'required - FQDN for Open WebUI - e.g. https://ollama.local'
1112
key: 'required - Open WebUI API Key Under Settings >> Account >> JWT Token'
1213
model: 'required - Ollama model to use'
14+
temp: 'optional - Ollama temperature'
1315

1416
irc:
15-
ui_nick: 'human'
17+
ui_nick: '_human_'
1618
shared_chan: '#pwn'
1719
ai_agent_nicks:
1820
browser:

0 commit comments

Comments
 (0)