pwn 0.5.471 → 0.5.474

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: 93a5c7a3a8bbb7534d1af6b0e7acb1a2f4468bd0a0dd1e613d85dfc051c8c839
4
- data.tar.gz: f65767723f2d0f6c90a97caae612d9e7806b9925b7277dbcf0eacb8f621c3a37
3
+ metadata.gz: 205b293783f7b7ba571878bd22b91df82b690ae650e25c3482ac9b05efda23d3
4
+ data.tar.gz: e619b23e3c6eb018e2e24b35e16402da95e942b9c248976b67c3baa4669ea27e
5
5
  SHA512:
6
- metadata.gz: 4f97be5a6be3e05223f8720ec0fd6619bba8c5bae1b814e4f90e746b0d5cf57814b9b2d6e6ae7657df5d7aa78a1c10f0f8e305ac657d9654cb58788099f32dbf
7
- data.tar.gz: '03809a0e80825ce97be5c82444a4370c94b663a8d5942e015ee4b88d81465e10a6b09d189c6abd43df823927b407eeb6d8244b3cb356ea2bd6598a695b3cab1f'
6
+ metadata.gz: ca6eb9d45d2bda968d5def83735281b76da7474594c39ea544566cf55f2c94adc3b54c8696f279666026e179a42202573336709f27fd1008cbba6541f870b09b
7
+ data.tar.gz: 334999ee78694482ddbc78eca1c649ecb2067559af70d16c1d5dace058a782dafcfacb3d8e7fc70514b80f65fe62e1763f6209950a04956222e9760607040108
data/Gemfile CHANGED
@@ -11,7 +11,7 @@ gemspec
11
11
  # In some circumstances custom flags are passed to gems in order
12
12
  # to build appropriately. Defer to ./reinstall_pwn_gemset.sh
13
13
  # to review these custom flags (e.g. pg, serialport, etc).
14
- gem 'activesupport', '8.0.3'
14
+ gem 'activesupport', '<8.1.0'
15
15
  gem 'anemone', '0.7.2'
16
16
  gem 'authy', '3.0.1'
17
17
  gem 'aws-sdk', '3.3.0'
@@ -48,7 +48,7 @@ gem 'jwt', '3.1.2'
48
48
  gem 'libusb', '0.7.2'
49
49
  gem 'luhn', '3.0.0'
50
50
  gem 'mail', '2.8.1'
51
- gem 'meshtastic', '0.0.126'
51
+ gem 'meshtastic', '0.0.132'
52
52
  gem 'metasm', '1.0.5'
53
53
  gem 'mongo', '2.21.3'
54
54
  gem 'msfrpc-client', '1.1.2'
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.471]:001 >>> PWN.help
40
+ pwn[v0.5.474]: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.4.4@pwn
52
52
  $ gem uninstall --all --executables pwn
53
53
  $ gem install --verbose pwn
54
54
  $ pwn
55
- pwn[v0.5.471]:001 >>> PWN.help
55
+ pwn[v0.5.474]: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.4@pwn
62
62
  $ rvmsudo gem uninstall --all --executables pwn
63
63
  $ rvmsudo gem install --verbose pwn
64
64
  $ pwn
65
- pwn[v0.5.471]:001 >>> PWN.help
65
+ pwn[v0.5.474]: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:
@@ -6,7 +6,9 @@ cat Gemfile | awk '{print $2}' | grep -E "^'.+$" | grep -v -e rubygems.org | whi
6
6
  this_gem=`echo $gem | sed "s/'//g" | sed 's/\,//g'`
7
7
  latest_version=`gem search -r $this_gem | grep -E "^${this_gem}\s.+$" | awk '{print $2}' | sed 's/(//g' | sed 's/)//g' | sed 's/,//g'`
8
8
  echo "${this_gem} => $latest_version"
9
- if [[ $this_gem == 'bundler' ]]; then
9
+ if [[ $this_gem == 'activesupport' ]]; then
10
+ sed -i "s/^gem '${this_gem}'.*$/gem '${this_gem}', '<${latest_version}'/g" Gemfile
11
+ elif [[ $this_gem == 'bundler' ]]; then
10
12
  sed -i "s/^gem '${this_gem}'.*$/gem '${this_gem}', '>=${latest_version}'/g" Gemfile
11
13
  elif [[ $this_gem == 'json' ]]; then
12
14
  # Shakes fist at selenium-webdriver
data/lib/pwn/config.rb CHANGED
@@ -100,20 +100,22 @@ module PWN
100
100
  mqtt: {
101
101
  host: 'mqtt.meshtastic.org',
102
102
  port: 1883,
103
+ tls: false,
103
104
  user: 'meshdev',
104
105
  pass: 'large4cats'
105
106
  },
106
107
  channel: {
108
+ active: 'LongFast',
107
109
  LongFast: {
108
110
  psk: 'AQ==',
109
111
  region: 'US/<STATE>',
110
- channel_topic: '2/e/#',
112
+ topic: '2/e/#',
111
113
  channel_num: 8
112
114
  },
113
115
  PWN: {
114
116
  psk: 'required - PSK for pwn channel',
115
117
  region: 'US/<STATE>',
116
- channel_topic: '2/e/PWN/#',
118
+ topic: '2/e/PWN/#',
117
119
  channel_num: 99
118
120
  }
119
121
  }
@@ -81,8 +81,8 @@ module PWN
81
81
  exec_hook :after_read, eval_string, self
82
82
 
83
83
  begin
84
- complete_expr = true if config.pwn_ai || config.pwn_asm
85
- complete_expr = Pry::Code.complete_expression?(@eval_string) unless config.pwn_ai || config.pwn_asm
84
+ complete_expr = true if config.pwn_ai || config.pwn_asm || config.pwn_mesh
85
+ complete_expr = Pry::Code.complete_expression?(@eval_string) unless config.pwn_ai || config.pwn_asm || config.pwn_mesh
86
86
  rescue SyntaxError => e
87
87
  output.puts e.message.gsub(/^.*syntax error, */, 'SyntaxError: ')
88
88
  reset_eval_string
@@ -93,7 +93,8 @@ module PWN
93
93
  @eval_string.empty? ||
94
94
  @eval_string =~ /\A *#.*\n\z/ ||
95
95
  config.pwn_ai ||
96
- config.pwn_asm
96
+ config.pwn_asm ||
97
+ config.pwn_mesh
97
98
 
98
99
  # A bug in jruby makes java.lang.Exception not rescued by
99
100
  # `rescue Pry::RescuableException` clause.
@@ -116,10 +117,12 @@ module PWN
116
117
  reset_eval_string
117
118
 
118
119
  result = evaluate_ruby(eval_string) unless config.pwn_ai ||
119
- config.pwn_asm
120
+ config.pwn_asm ||
121
+ config.pwn_mesh
120
122
 
121
123
  result = eval_string if config.pwn_ai ||
122
- config.pwn_asm
124
+ config.pwn_asm ||
125
+ config.pwn_mesh
123
126
  rescue Pry::RescuableException, *jruby_exceptions => e
124
127
  # Eliminate following warning:
125
128
  # warning: singleton on non-persistent Java type X
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'fileutils'
4
+ require 'meshtastic'
4
5
  require 'pry'
5
6
  require 'tty-prompt'
6
7
  require 'yaml'
@@ -62,6 +63,18 @@ module PWN
62
63
  end
63
64
  end
64
65
 
66
+ if pi.config.pwn_mesh
67
+ active_channel = PWN::Env[:plugins][:meshtastic][:channel][:active].to_s.to_sym
68
+ region = PWN::Env[:plugins][:meshtastic][:channel][active_channel][:region]
69
+ topic = PWN::Env[:plugins][:meshtastic][:channel][active_channel][:topic]
70
+ channel_num = PWN::Env[:plugins][:meshtastic][:channel][active_channel][:channel_num]
71
+
72
+ pi.config.prompt_name = "pwn.mesh:#{region}/#{topic}:#{channel_num}"
73
+ name = "\001\e[1m\002\001\e[32m\002#{pi.config.prompt_name}\001\e[0m\002"
74
+ dchars = "\001\e[32m\002>>>\001\e[33m\002"
75
+ dchars = "\001\e[33m\002***\001\e[33m\002" if mode == :splat
76
+ end
77
+
65
78
  "#{name}[#{version}]:#{line_count} #{dchars} ".to_s.scrub
66
79
  end
67
80
  rescue StandardError => e
@@ -417,7 +430,37 @@ module PWN
417
430
  end
418
431
 
419
432
  Pry::Commands.create_command 'pwn-mesh' do
420
- description 'Initiate pwn.mesh network interface.'
433
+ description 'Communicate with Meshtastic network within pwn REPL.'
434
+
435
+ def process
436
+ pi = pry_instance
437
+ pi.config.pwn_mesh = true
438
+ meshtastic_env = PWN::Env[:plugins][:meshtastic]
439
+
440
+ mqtt_env = meshtastic_env[:mqtt]
441
+ host = mqtt_env[:host]
442
+ port = mqtt_env[:port]
443
+ tls = mqtt_env[:tls]
444
+ username = mqtt_env[:user]
445
+ password = mqtt_env[:pass]
446
+
447
+ mqtt_obj = Meshtastic::MQTT.connect(
448
+ host: host,
449
+ port: port,
450
+ tls: tls,
451
+ username: username,
452
+ password: password
453
+ )
454
+ PWN.const_set(:MqttObj, mqtt_obj)
455
+
456
+ active_channel = meshtastic_env[:channel][:active].to_s.to_sym
457
+ channel_env = meshtastic_env[:channel][active_channel]
458
+ psk = channel_env[:psk]
459
+ region = channel_env[:region]
460
+ topic = channel_env[:topic]
461
+ rescue StandardError => e
462
+ raise e
463
+ end
421
464
  end
422
465
 
423
466
  Pry::Commands.create_command 'pwn-vault' do
@@ -480,6 +523,8 @@ module PWN
480
523
  pi.config.pwn_ai_debug = false if pi.config.pwn_ai_debug
481
524
  pi.config.pwn_ai_speak = false if pi.config.pwn_ai_speak
482
525
  pi.config.completer = Pry::InputCompleter
526
+ PWN.send(:remove_const, :MqttObj) if PWN.const_defined?(:MqttObj)
527
+ pi.config.pwn_mesh = false if pi.config.pwn_mesh
483
528
  end
484
529
  end
485
530
  rescue StandardError => e
@@ -597,6 +642,46 @@ module PWN
597
642
  PWN::Env[:ai][engine][:response_history] = response_history
598
643
  end
599
644
  end
645
+
646
+ Pry.config.hooks.add_hook(:after_read, :pwn_mesh_hook) do |request, pi|
647
+ if pi.config.pwn_mesh && !request.chomp.empty?
648
+ mqtt_obj = PWN.const_get(:MqttObj)
649
+ from = "!#{mqtt_obj.client_id}"
650
+ active_channel = PWN::Env[:plugins][:meshtastic][:channel][:active].to_s.to_sym
651
+ region = PWN::Env[:plugins][:meshtastic][:channel][active_channel][:region]
652
+ topic = PWN::Env[:plugins][:meshtastic][:channel][active_channel][:topic]
653
+ channel_num = PWN::Env[:plugins][:meshtastic][:channel][active_channel][:channel_num]
654
+ psk = PWN::Env[:plugins][:meshtastic][:channel][active_channel][:psk]
655
+
656
+ psks = {}
657
+ psks[active_channel] = psk
658
+
659
+ text = pi.input.line_buffer
660
+ to = '!ffffffff'
661
+ # If text include @! with 8 byte length OR
662
+ if text.include?('@!')
663
+ to_raw = text.split('@').last.chomp[0..8]
664
+ # If to_raw[1..-1] is hex than set to = to_raw
665
+ to = to_raw if to_raw[1..-1].match?(/^[a-fA-F0-9]{8}$/)
666
+ end
667
+ puts "\nFrom: #{from}"
668
+ puts "To: #{to}"
669
+ puts "Region: #{region}"
670
+ puts "Topic: #{topic}"
671
+ puts "Channel #: #{channel_num}"
672
+ puts "Text: #{text}\n\n"
673
+ Meshtastic::MQTT.send_text(
674
+ mqtt_obj: mqtt_obj,
675
+ from: from,
676
+ to: to,
677
+ region: region,
678
+ topic: topic,
679
+ channel: channel_num,
680
+ text: text,
681
+ psks: psks
682
+ )
683
+ end
684
+ end
600
685
  rescue StandardError => e
601
686
  raise e
602
687
  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.471'
4
+ VERSION = '0.5.474'
5
5
  end
@@ -737,7 +737,7 @@
737
737
  {"messages":[{"role":"user","content":"PWN::Plugins::Jenkins.list_nested_jobs Usage"},{"role":"assistant","content":"`PWN::Plugins::Jenkins.list_nested_jobs`: Supported Method Parameters\n\nPWN::Plugins::Jenkins.list_nested_jobs(\n\njenkins_obj: 'required jenkins_obj returned from #connect method',\nview_path: 'required view path to list jobs'\n\n)\n"}]}
738
738
  {"messages":[{"role":"user","content":"PWN::Plugins::Jenkins.list_nested_views Usage"},{"role":"assistant","content":"`PWN::Plugins::Jenkins.list_nested_views`: Supported Method Parameters\n\nPWN::Plugins::Jenkins.list_nested_views(\n\njenkins_obj: 'required jenkins_obj returned from #connect method',\nview_path: 'required view path list sub-views'\n\n)\n"}]}
739
739
  {"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.authors Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.authors`: Author(s)\n\n0day Inc. <support@0dayinc.com>\n"}]}
740
- {"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.clone_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.clone_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraDataCenter.clone_issue(\n\nissue: 'required - issue to clone (e.g. Bug, Issue, Story, or Epic ID)'\n\n)\n"}]}
740
+ {"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.clone_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.clone_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraDataCenter.clone_issue(\n\nissue: 'required - issue to clone (e.g. Bug, Issue, Story, or Epic ID)',\ncopy_attachments: 'optional - boolean to indicate whether to copy attachments (Defaults to false)'\n\n)\n"}]}
741
741
  {"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.create_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.create_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraDataCenter.create_issue(\n\nproject_key: 'required - project key (e.g. PWN)',\nsummary: 'required - summary of the issue (e.g. Epic for PWN-1337)',\nissue_type: 'required - issue type (e.g. :epic, :story, :bug)',\ndescription: 'optional - description of the issue',\nepic_name: 'optional - name of the epic',\nadditional_fields: 'optional - additional fields to set in the issue (e.g. labels, components, custom fields, etc.)'\nattachments: 'optional - array of attachment paths to upload to the issue (e.g. [\"/tmp/file1.txt\", \"/tmp/file2.txt\"])',\ncomment: 'optional - comment to add to the issue (e.g. \"This is a comment\")'\n\n)\n"}]}
742
742
  {"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.delete_attachment Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.delete_attachment`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraDataCenter.delete_attachment(\n\nid: 'required - attachment ID to delete (e.g. 10000) found in #get_issue method'\n\n)\n"}]}
743
743
  {"messages":[{"role":"user","content":"PWN::Plugins::JiraDataCenter.delete_issue Usage"},{"role":"assistant","content":"`PWN::Plugins::JiraDataCenter.delete_issue`: Supported Method Parameters\n\nissue_resp = PWN::Plugins::JiraDataCenter.delete_issue(\n\nissue: 'required - issue to delete (e.g. Bug, Issue, Story, or Epic ID)'\n\n)\n"}]}
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.471
4
+ version: 0.5.474
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.
@@ -13,16 +13,16 @@ dependencies:
13
13
  name: activesupport
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - '='
16
+ - - "<"
17
17
  - !ruby/object:Gem::Version
18
- version: 8.0.3
18
+ version: 8.1.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - '='
23
+ - - "<"
24
24
  - !ruby/object:Gem::Version
25
- version: 8.0.3
25
+ version: 8.1.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: anemone
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -519,14 +519,14 @@ dependencies:
519
519
  requirements:
520
520
  - - '='
521
521
  - !ruby/object:Gem::Version
522
- version: 0.0.126
522
+ version: 0.0.132
523
523
  type: :runtime
524
524
  prerelease: false
525
525
  version_requirements: !ruby/object:Gem::Requirement
526
526
  requirements:
527
527
  - - '='
528
528
  - !ruby/object:Gem::Version
529
- version: 0.0.126
529
+ version: 0.0.132
530
530
  - !ruby/object:Gem::Dependency
531
531
  name: metasm
532
532
  requirement: !ruby/object:Gem::Requirement