moby.rb 2.0.1 → 2.1.0

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: 581350e2303d9070c849e3768aa3d6bb6fb043326d41fdf9d2203f89d054029b
4
- data.tar.gz: 32a0549736c2716df0361c51072df302a52757c51a7d1b4446beb76d421443d2
3
+ metadata.gz: ea5753adffb397d0fac04ca72298366c2bb8d9c87c066c2dfe8de3af606f510b
4
+ data.tar.gz: 754b6d481b1987fb9b7ee4e921c5ca8b4705512a772311c807ecd3be903ea62f
5
5
  SHA512:
6
- metadata.gz: 17f1bd8bee97352f64560d545039653cb369cd52602254bc583aa008f1876298360a6b2bda370828399f5f0697a8ef8caee4190931fcd066690c3754b73dbc68
7
- data.tar.gz: 5aa838cc20cad5e7bf8c22ff3b93b6c69edfed285b59a2c5e8836a9c02c25bad2aa2bedf3d98c0580cfd2a2246b043ea5b0951a1879e21f44f5a65f01275c359
6
+ metadata.gz: b3ead9e9efbd5b51a363c0da8a94cb70d953c0e3b3f0fbd70babfcd9b7676a7800ad885f0a1845d0eb34d5763119ffa74c61c57417234adcea41cca8a558a3fa
7
+ data.tar.gz: 18db52de4d569c2a2e24de03ecc42d3f67ec6a0ecfda3e226c6820a596a8f8d5e23e0d56d7c893d958db124383c578b5fc23071628799ff030a4048db0f2802b
data/CHANGELOG CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## 20260812
4
4
 
5
+ 2.1.0: Expose the word list on the command line.
6
+
7
+ 1. + bin/moby: + --word-list (--word-list-path), which sets Configuration's word_list_path. The 2.0.0 backend already read a configurable word list — RandomInputGenerator reads word_list_path, defaulting to /usr/share/dict/words — but bin/moby exposed no switch to reach it; this connects the flag to the plumbing.
8
+ 2. ~ bin/moby: group switches() into blank-line-separated blocks (location; client and backend; run; form; username field; password field; username generation; output; help and version) in place of the alphabetical list.
9
+ 3. + test/Moby/Configuration_test.rb: a #word_list_path test — its /usr/share/dict/words default and a given override. It was the one Configuration setting without coverage, and --word-list is what makes it reachable.
10
+ 4. ~ lib/Moby/VERSION.rb: VERSION: /2.0.2/2.1.0/
11
+
12
+ 2.0.2: Adopt the CHANGELOG-matching version test.
13
+
14
+ 1. ~ test/Moby/VERSION_test.rb: replace the hardcoded "version is X.Y.Z" assertion and the loose semver check with the standard form — VERSION is a String, an anchored X.Y.Z, and matches the newest CHANGELOG entry. It no longer needs a per-release edit and it guards against VERSION.rb ↔ CHANGELOG drift.
15
+ 2. ~ lib/Moby/VERSION.rb: VERSION: /2.0.1/2.0.2/
16
+
5
17
  2.0.1: Tidy the gemspec and guard it with a test.
6
18
 
7
19
  1. ~ moby.rb.gemspec: declare the dependencies as data — spec.dependencies = [...] and spec.development_dependencies = [...], via setters added in a local reopening of Gem::Specification — in place of the add_dependency/add_development_dependency calls; - spec.date, which was a stale literal (2.0.0 shipped the gem with it), letting RubyGems' default stand (rubygems.org uses the push time regardless).
data/bin/moby CHANGED
@@ -12,28 +12,38 @@ require 'switches.rb'
12
12
  def switches
13
13
  Switches.new do |s|
14
14
  s.banner = 'Usage: moby <url> and any of the following options...'
15
+
16
+ s.set(:url){'The location of the phishing form.'}
17
+
15
18
  s.set(:a, :user_agent){'What webclient I should pretend to be.'}
16
19
  s.set(:b, :backend){'Which backend to use: mechanize (default) or selenium.'}
17
20
  s.set(:browser){'Which browser the selenium backend should drive: chrome (default) or firefox.'}
18
- s.set(:debug?){'Show debugging information.'}
21
+
22
+ s.set(:iterations){'How many submissions to make. If left empty, moby runs until interrupted.'}
19
23
  s.set(:delay){'Seconds to wait between submissions.'}
20
- s.set(:e?, :username_is_email_address?){'Automatically generate a username which is in the form of an email address.'}
24
+ s.set(:word_list, :word_list_path){'Where to find an alternate list of words to the default, which is at /usr/share/dict/words.'}
25
+
21
26
  s.set(:f, :form, :form_name){'If left empty, the first form on the page will be used.'}
22
- s.set(:help){'Usage: moby <url> and any of the following options...'}
23
- s.set(:iterations){'How many submissions to make. If left empty, moby runs until interrupted.'}
24
27
  s.set(:n, :form_number){'This will set the number of the form in order of appearance on the page. Use zero-based indexing.'}
25
- s.set(:pass_field, :password_field, :pass_field_name, :password_field_name){'The name of the password field.'}
26
- s.set(:pass_field_number, :password_field_number){'The position of the password field in relation to the form it is attached to. Use zero-based indexing.'}
27
- s.set(:url){'The location of the phishing form.'}
28
+
28
29
  s.set(:user_field, :username_field, :user_field_name, :username_field_name){'The name of the username field.'}
29
30
  s.set(:user_field_number, :username_field_number){'The position of the username field in relation to the form it is attached to. Use zero-based indexing.'}
31
+
32
+ s.set(:pass_field, :password_field, :pass_field_name, :password_field_name){'The name of the password field.'}
33
+ s.set(:pass_field_number, :password_field_number){'The position of the password field in relation to the form it is attached to. Use zero-based indexing.'}
34
+
35
+ s.set(:e?, :username_is_email_address?){'Automatically generate a username which is in the form of an email address.'}
30
36
  s.set(:username_hostname){'The hostname to be used when the username is an email address.'}
31
37
  s.set(:username_prefilled?){'The username is already filled in on the form, so only submit the password.'}
38
+
39
+ s.set(:debug?){'Show debugging information.'}
32
40
  s.set(:v?, :verbose?){'Outputs each submission as it goes.'}
41
+
42
+ s.set(:help){'Usage: moby <url> and any of the following options...'}
33
43
  s.perform(:version) do
34
- puts "moby #{Moby::VERSION}"
35
- exit
36
- end
44
+ puts "moby #{Moby::VERSION}"
45
+ exit
46
+ end
37
47
  end
38
48
  end
39
49
 
@@ -56,7 +66,8 @@ def main
56
66
  username_hostname: args[:username_hostname],
57
67
  username_is_email_address: args[:username_is_email_address?],
58
68
  username_prefilled: args[:username_prefilled?],
59
- verbose: args[:verbose?]
69
+ verbose: args[:verbose?],
70
+ word_list_path: args[:word_list_path]
60
71
  )
61
72
  moby.counter_phish
62
73
  end
data/lib/Moby/VERSION.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # Moby::VERSION
3
3
 
4
4
  class Moby
5
- VERSION = '2.0.1'
5
+ VERSION = '2.1.0'
6
6
  end
@@ -131,4 +131,14 @@ describe Moby::Configuration do
131
131
  _(Moby::Configuration.new(url: url, form_name: 'login').using_form_name?).must_equal(true)
132
132
  end
133
133
  end
134
+
135
+ describe "#word_list_path" do
136
+ it "defaults to /usr/share/dict/words" do
137
+ _(Moby::Configuration.new(url: url).word_list_path).must_equal('/usr/share/dict/words')
138
+ end
139
+
140
+ it "returns the given path" do
141
+ _(Moby::Configuration.new(url: url, word_list_path: '/tmp/words').word_list_path).must_equal('/tmp/words')
142
+ end
143
+ end
134
144
  end
@@ -4,20 +4,17 @@ require_relative '../test_helper'
4
4
 
5
5
  describe Moby do
6
6
  describe "VERSION" do
7
- it "has VERSION constant" do
8
- _(defined?(Moby::VERSION)).wont_be_nil
7
+ it "is a string" do
8
+ _(Moby::VERSION).must_be_instance_of String
9
9
  end
10
10
 
11
- it "version is a string" do
12
- _(Moby::VERSION).must_be_kind_of(String)
11
+ it "is three numbers separated by dots" do
12
+ _(Moby::VERSION).must_match(/\A\d+\.\d+\.\d+\z/)
13
13
  end
14
14
 
15
- it "version follows semver pattern" do
16
- _(Moby::VERSION).must_match(/\d+\.\d+\.\d+/)
17
- end
18
-
19
- it "version is 2.0.1" do
20
- _(Moby::VERSION).must_equal('2.0.1')
15
+ it "matches the newest entry in the CHANGELOG" do
16
+ changelog = File.read(File.expand_path('../../CHANGELOG', __dir__))
17
+ _(changelog[/^(\d+\.\d+\.\d+):/, 1]).must_equal Moby::VERSION
21
18
  end
22
19
  end
23
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moby.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoran