ronin-web-user_agents 0.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +5 -0
- data/.github/workflows/ruby.yml +31 -0
- data/.gitignore +14 -0
- data/.rspec +1 -0
- data/.ruby-version +1 -0
- data/.yardopts +1 -0
- data/COPYING.txt +165 -0
- data/ChangeLog.md +5 -0
- data/Gemfile +26 -0
- data/README.md +177 -0
- data/Rakefile +34 -0
- data/corpus/.gitkeep +0 -0
- data/data/android/devices.txt +1393 -0
- data/data/chrome/versions.txt +394 -0
- data/data/firefox/langs.txt +125 -0
- data/data/firefox/versions.txt +584 -0
- data/gemspec.yml +21 -0
- data/lib/ronin/web/user_agents/chrome.rb +301 -0
- data/lib/ronin/web/user_agents/data_dir.rb +30 -0
- data/lib/ronin/web/user_agents/firefox.rb +360 -0
- data/lib/ronin/web/user_agents/google_bot.rb +140 -0
- data/lib/ronin/web/user_agents/os/android.rb +79 -0
- data/lib/ronin/web/user_agents/os/linux.rb +52 -0
- data/lib/ronin/web/user_agents/os/mac_os.rb +116 -0
- data/lib/ronin/web/user_agents/os/windows.rb +53 -0
- data/lib/ronin/web/user_agents/version.rb +28 -0
- data/lib/ronin/web/user_agents.rb +142 -0
- data/ronin-web-user_agents.gemspec +61 -0
- data/scripts/index_user_agents +281 -0
- data/spec/chrome_spec.rb +511 -0
- data/spec/firefox_spec.rb +414 -0
- data/spec/google_bot_spec.rb +231 -0
- data/spec/os/android_spec.rb +55 -0
- data/spec/os/linux_spec.rb +48 -0
- data/spec/os/mac_os_spec.rb +73 -0
- data/spec/os/windows_spec.rb +52 -0
- data/spec/spec_helper.rb +4 -0
- data/spec/user_agents_spec.rb +49 -0
- metadata +110 -0
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ronin/web/user_agents/os/android'
|
3
|
+
|
4
|
+
describe Ronin::Web::UserAgents::OS::Android do
|
5
|
+
describe "VERSIONS" do
|
6
|
+
subject { described_class::VERSIONS }
|
7
|
+
|
8
|
+
it { expect(subject).to_not be_empty }
|
9
|
+
it { expect(subject).to include('10') }
|
10
|
+
it { expect(subject).to include('10.0') }
|
11
|
+
it { expect(subject).to include('11') }
|
12
|
+
it { expect(subject).to include('11.0') }
|
13
|
+
it { expect(subject).to include('12') }
|
14
|
+
it { expect(subject).to include('12.1') }
|
15
|
+
it { expect(subject).to include('4.0.4') }
|
16
|
+
it { expect(subject).to include('4.1.2') }
|
17
|
+
it { expect(subject).to include('4.2.2') }
|
18
|
+
it { expect(subject).to include('4.4.2') }
|
19
|
+
it { expect(subject).to include('4.4.4') }
|
20
|
+
it { expect(subject).to include('5.0') }
|
21
|
+
it { expect(subject).to include('5.0.2') }
|
22
|
+
it { expect(subject).to include('5.1') }
|
23
|
+
it { expect(subject).to include('5.1.1') }
|
24
|
+
it { expect(subject).to include('6.0') }
|
25
|
+
it { expect(subject).to include('6.0.1') }
|
26
|
+
it { expect(subject).to include('7.0') }
|
27
|
+
it { expect(subject).to include('7.1.1') }
|
28
|
+
it { expect(subject).to include('7.1.2') }
|
29
|
+
it { expect(subject).to include('8.0') }
|
30
|
+
it { expect(subject).to include('8.0.0') }
|
31
|
+
it { expect(subject).to include('8.1') }
|
32
|
+
it { expect(subject).to include('8.1.0') }
|
33
|
+
it { expect(subject).to include('9') }
|
34
|
+
it { expect(subject).to include('9.0') }
|
35
|
+
end
|
36
|
+
|
37
|
+
describe "ARCHES" do
|
38
|
+
subject { described_class::ARCHES }
|
39
|
+
|
40
|
+
it "must map :arm to 'arm'" do
|
41
|
+
expect(subject[:arm]).to eq('arm')
|
42
|
+
end
|
43
|
+
|
44
|
+
it "must map :arm64 to 'arm_64'" do
|
45
|
+
expect(subject[:arm64]).to eq('arm_64')
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
describe "DEVICES" do
|
50
|
+
subject { described_class::DEVICES }
|
51
|
+
|
52
|
+
it { expect(subject).to_not be_empty }
|
53
|
+
it { expect(subject).to all(be_kind_of(String)) }
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ronin/web/user_agents/os/linux'
|
3
|
+
|
4
|
+
describe Ronin::Web::UserAgents::OS::Linux do
|
5
|
+
describe "DISTROS" do
|
6
|
+
subject { described_class::DISTROS }
|
7
|
+
|
8
|
+
it "must map :ubuntu to 'Ubuntu'" do
|
9
|
+
expect(subject[:ubuntu]).to eq('Ubuntu')
|
10
|
+
end
|
11
|
+
|
12
|
+
it "must map :fedora to 'Fedora'" do
|
13
|
+
expect(subject[:fedora]).to eq('Fedora')
|
14
|
+
end
|
15
|
+
|
16
|
+
it "must map :arch to 'Arch'" do
|
17
|
+
expect(subject[:arch]).to eq('Arch')
|
18
|
+
end
|
19
|
+
|
20
|
+
it "must map nil to nil" do
|
21
|
+
expect(subject[nil]).to be(nil)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "ARCHES" do
|
26
|
+
subject { described_class::ARCHES }
|
27
|
+
|
28
|
+
it "must map :x86_64 to 'x86_64'" do
|
29
|
+
expect(subject[:x86_64]).to eq('x86_64')
|
30
|
+
end
|
31
|
+
|
32
|
+
it "must map :aarch64 to 'aarch64'" do
|
33
|
+
expect(subject[:aarch64]).to eq('aarch64')
|
34
|
+
end
|
35
|
+
|
36
|
+
it "must map :arm64 to 'aarch64'" do
|
37
|
+
expect(subject[:arm64]).to eq('aarch64')
|
38
|
+
end
|
39
|
+
|
40
|
+
it "must map :i686 to 'i686'" do
|
41
|
+
expect(subject[:i686]).to eq('i686')
|
42
|
+
end
|
43
|
+
|
44
|
+
it "must map :x86 to 'i686'" do
|
45
|
+
expect(subject[:x86]).to eq('i686')
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ronin/web/user_agents/os/mac_os'
|
3
|
+
|
4
|
+
describe Ronin::Web::UserAgents::OS::MacOS do
|
5
|
+
describe "VERSIONS" do
|
6
|
+
subject { described_class::VERSIONS }
|
7
|
+
|
8
|
+
it { expect(subject).to_not be_empty }
|
9
|
+
it { expect(subject).to include('10.10') }
|
10
|
+
it { expect(subject).to include('10.10.3') }
|
11
|
+
it { expect(subject).to include('10.10.4') }
|
12
|
+
it { expect(subject).to include('10.11.6') }
|
13
|
+
it { expect(subject).to include('10.12.0') }
|
14
|
+
it { expect(subject).to include('10.12.1') }
|
15
|
+
it { expect(subject).to include('10.12.6') }
|
16
|
+
it { expect(subject).to include('10.13.4') }
|
17
|
+
it { expect(subject).to include('10.13.6') }
|
18
|
+
it { expect(subject).to include('10.14.0') }
|
19
|
+
it { expect(subject).to include('10.14.1') }
|
20
|
+
it { expect(subject).to include('10.14.2') }
|
21
|
+
it { expect(subject).to include('10.14.5') }
|
22
|
+
it { expect(subject).to include('10.14.6') }
|
23
|
+
it { expect(subject).to include('10.14.8') }
|
24
|
+
it { expect(subject).to include('10.15.1') }
|
25
|
+
it { expect(subject).to include('10.15.2') }
|
26
|
+
it { expect(subject).to include('10.15.4') }
|
27
|
+
it { expect(subject).to include('10.15.6') }
|
28
|
+
it { expect(subject).to include('10.15.7') }
|
29
|
+
it { expect(subject).to include('10.16') }
|
30
|
+
it { expect(subject).to include('10.16.0') }
|
31
|
+
it { expect(subject).to include('10.31.7') }
|
32
|
+
it { expect(subject).to include('10.4') }
|
33
|
+
it { expect(subject).to include('10.55') }
|
34
|
+
it { expect(subject).to include('10.7.0') }
|
35
|
+
it { expect(subject).to include('11.0.0') }
|
36
|
+
it { expect(subject).to include('11.15') }
|
37
|
+
it { expect(subject).to include('11.6.3') }
|
38
|
+
it { expect(subject).to include('12.2.0') }
|
39
|
+
it { expect(subject).to include('16.55') }
|
40
|
+
end
|
41
|
+
|
42
|
+
describe "VERSIONS_UNDERSCORED" do
|
43
|
+
subject { described_class::VERSIONS_UNDERSCORED }
|
44
|
+
|
45
|
+
it "must map known X.Y versions to X_Y notation" do
|
46
|
+
expect(subject['10.10']).to eq('10_10')
|
47
|
+
end
|
48
|
+
|
49
|
+
it "must map known X.Y.Z versions to X_Y_Z notation" do
|
50
|
+
expect(subject['10.10.3']).to eq('10_10_3')
|
51
|
+
end
|
52
|
+
|
53
|
+
it "must map unknwon X.Y versions to X_Y notation" do
|
54
|
+
expect(subject['20.20']).to eq('20_20')
|
55
|
+
end
|
56
|
+
|
57
|
+
it "must map unknwon X.Y.Z versions to X_Y_Z notation" do
|
58
|
+
expect(subject['20.20.20']).to eq('20_20_20')
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe "ARCHES" do
|
63
|
+
subject { described_class::ARCHES }
|
64
|
+
|
65
|
+
it "must map :intel to 'Intel'" do
|
66
|
+
expect(subject[:intel]).to eq('Intel')
|
67
|
+
end
|
68
|
+
|
69
|
+
it "must map :x86_64 to 'Intel'" do
|
70
|
+
expect(subject[:x86_64]).to eq('Intel')
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ronin/web/user_agents/os/windows'
|
3
|
+
|
4
|
+
describe Ronin::Web::UserAgents::OS::Windows do
|
5
|
+
describe "VERSIONS" do
|
6
|
+
subject { described_class::VERSIONS }
|
7
|
+
|
8
|
+
it "must map :xp to '5.2'" do
|
9
|
+
expect(subject[:xp]).to eq('5.2')
|
10
|
+
end
|
11
|
+
|
12
|
+
it "must map :vista to '6.0'" do
|
13
|
+
expect(subject[:vista]).to eq('6.0')
|
14
|
+
end
|
15
|
+
|
16
|
+
it "must map 7 to '6.1'" do
|
17
|
+
expect(subject[7]).to eq('6.1')
|
18
|
+
end
|
19
|
+
|
20
|
+
it "must map 8 to '6.2'" do
|
21
|
+
expect(subject[8]).to eq('6.2')
|
22
|
+
end
|
23
|
+
|
24
|
+
it "must map 8.1 to '6.3'" do
|
25
|
+
expect(subject[8.1]).to eq('6.3')
|
26
|
+
end
|
27
|
+
|
28
|
+
it "must map 10 to '10.0'" do
|
29
|
+
expect(subject[10]).to eq('10.0')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe "ARCHES" do
|
34
|
+
subject { described_class::ARCHES }
|
35
|
+
|
36
|
+
it "must map :wow64 to 'WOW64'" do
|
37
|
+
expect(subject[:wow64]).to eq('WOW64')
|
38
|
+
end
|
39
|
+
|
40
|
+
it "must map :win64 to 'Win64; x64'" do
|
41
|
+
expect(subject[:win64]).to eq('Win64; x64')
|
42
|
+
end
|
43
|
+
|
44
|
+
it "must map :x86_64 to 'Win64; x64'" do
|
45
|
+
expect(subject[:x86_64]).to eq('Win64; x64')
|
46
|
+
end
|
47
|
+
|
48
|
+
it "must map nil to nil" do
|
49
|
+
expect(subject[nil]).to be(nil)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ronin/web/user_agents'
|
3
|
+
|
4
|
+
describe Ronin::Web::UserAgents do
|
5
|
+
it "must define a VERSION constant" do
|
6
|
+
expect(subject.const_defined?('VERSION',false)).to be(true)
|
7
|
+
end
|
8
|
+
|
9
|
+
describe ".chrome" do
|
10
|
+
it "must return Ronin::Web::UserAgents::Chrome" do
|
11
|
+
expect(subject.chrome).to eq(Ronin::Web::UserAgents::Chrome)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
describe ".google_chrome" do
|
16
|
+
it "must return Ronin::Web::UserAgents::Chrome" do
|
17
|
+
expect(subject.google_chrome).to eq(Ronin::Web::UserAgents::Chrome)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
describe ".firefox" do
|
22
|
+
it "must return Ronin::Web::UserAgents::Firefox" do
|
23
|
+
expect(subject.firefox).to eq(Ronin::Web::UserAgents::Firefox)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe ".google_bot" do
|
28
|
+
it "must return Ronin::Web::UserAgents::GoogleBot" do
|
29
|
+
expect(subject.google_bot).to eq(Ronin::Web::UserAgents::GoogleBot)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
describe ".random" do
|
34
|
+
it "must return a random User-Agent string" do
|
35
|
+
expect(subject.random).to match(
|
36
|
+
%r{
|
37
|
+
^(?:
|
38
|
+
Mozilla/5\.0\ \([^\)]+\)\ AppleWebKit/537\.36\ \(KHTML,\ like\ Gecko\)\ Chrome/\d+(\.\d+)*\ (?:Mobile\ )?Safari/537\.36|
|
39
|
+
Mozilla/5\.0\ \([^\)]+\)\ Gecko/(?:20100101|\d+(?:\.\d+)*)\ Firefox/\d+(\.\d+)*
|
40
|
+
)$
|
41
|
+
}x
|
42
|
+
)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "must return a random User-Agent string each time" do
|
46
|
+
expect(subject.random).to_not eq(subject.random)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
metadata
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ronin-web-user_agents
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0.beta1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Postmodern
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-01-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
description: Yet another User-Agent string generator library.
|
28
|
+
email: postmodern.mod3@gmail.com
|
29
|
+
executables: []
|
30
|
+
extensions: []
|
31
|
+
extra_rdoc_files:
|
32
|
+
- COPYING.txt
|
33
|
+
- ChangeLog.md
|
34
|
+
- README.md
|
35
|
+
files:
|
36
|
+
- ".document"
|
37
|
+
- ".github/workflows/ruby.yml"
|
38
|
+
- ".gitignore"
|
39
|
+
- ".rspec"
|
40
|
+
- ".ruby-version"
|
41
|
+
- ".yardopts"
|
42
|
+
- COPYING.txt
|
43
|
+
- ChangeLog.md
|
44
|
+
- Gemfile
|
45
|
+
- README.md
|
46
|
+
- Rakefile
|
47
|
+
- corpus/.gitkeep
|
48
|
+
- data/android/devices.txt
|
49
|
+
- data/chrome/versions.txt
|
50
|
+
- data/firefox/langs.txt
|
51
|
+
- data/firefox/versions.txt
|
52
|
+
- gemspec.yml
|
53
|
+
- lib/ronin/web/user_agents.rb
|
54
|
+
- lib/ronin/web/user_agents/chrome.rb
|
55
|
+
- lib/ronin/web/user_agents/data_dir.rb
|
56
|
+
- lib/ronin/web/user_agents/firefox.rb
|
57
|
+
- lib/ronin/web/user_agents/google_bot.rb
|
58
|
+
- lib/ronin/web/user_agents/os/android.rb
|
59
|
+
- lib/ronin/web/user_agents/os/linux.rb
|
60
|
+
- lib/ronin/web/user_agents/os/mac_os.rb
|
61
|
+
- lib/ronin/web/user_agents/os/windows.rb
|
62
|
+
- lib/ronin/web/user_agents/version.rb
|
63
|
+
- ronin-web-user_agents.gemspec
|
64
|
+
- scripts/index_user_agents
|
65
|
+
- spec/chrome_spec.rb
|
66
|
+
- spec/firefox_spec.rb
|
67
|
+
- spec/google_bot_spec.rb
|
68
|
+
- spec/os/android_spec.rb
|
69
|
+
- spec/os/linux_spec.rb
|
70
|
+
- spec/os/mac_os_spec.rb
|
71
|
+
- spec/os/windows_spec.rb
|
72
|
+
- spec/spec_helper.rb
|
73
|
+
- spec/user_agents_spec.rb
|
74
|
+
homepage: https://ronin-rb.dev/
|
75
|
+
licenses:
|
76
|
+
- LGPL-3.0
|
77
|
+
metadata:
|
78
|
+
documentation_uri: https://rubydoc.info/gems/ronin-web-user_agents
|
79
|
+
source_code_uri: https://github.com/ronin-rb/ronin-web-user_agents
|
80
|
+
bug_tracker_uri: https://github.com/ronin-rb/ronin-web-user_agents/issues
|
81
|
+
changelog_uri: https://github.com/ronin-rb/ronin-web-user_agents/blob/master/ChangeLog.md
|
82
|
+
rubygems_mfa_required: 'true'
|
83
|
+
post_install_message:
|
84
|
+
rdoc_options: []
|
85
|
+
require_paths:
|
86
|
+
- lib
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: 3.0.0
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
requirements: []
|
98
|
+
rubygems_version: 3.3.26
|
99
|
+
signing_key:
|
100
|
+
specification_version: 4
|
101
|
+
summary: generate random User-Agent strings
|
102
|
+
test_files:
|
103
|
+
- spec/chrome_spec.rb
|
104
|
+
- spec/firefox_spec.rb
|
105
|
+
- spec/google_bot_spec.rb
|
106
|
+
- spec/os/android_spec.rb
|
107
|
+
- spec/os/linux_spec.rb
|
108
|
+
- spec/os/mac_os_spec.rb
|
109
|
+
- spec/os/windows_spec.rb
|
110
|
+
- spec/user_agents_spec.rb
|