Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit 773ad5a

Browse files
committed
Merge branch 'development'
2 parents b062c38 + 4697ee0 commit 773ad5a

File tree

414 files changed

+1891
-105
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

414 files changed

+1891
-105
lines changed

.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,9 @@ Lint/UnusedMethodArgument:
5252
Style/ClassVars:
5353
Enabled: false
5454
Description: 'There are genuine use cases for using class vars.'
55+
56+
Metrics/BlockLength:
57+
Enabled: true
58+
Description: 'Some unit tests are going to be naturally long; no need to flag this up.'
59+
Exclude:
60+
- spec/**/*

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.4.1
1+
2.4.2

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: ruby
22
rvm:
3-
- 2.3.4
4-
- 2.4.1
3+
- 2.3.5
4+
- 2.4.2
55
before_install:
66
- "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc"
77
script: bundle exec rspec

Gemfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
# frozen_string_literal: true
2+
13
source 'https://rubygems.org'
24
gem 'colorize', '>=0.8.1'
35
gem 'mime-types', '>=3.1'
4-
gem 'nokogiri', '~>1.8.0'
6+
gem 'nokogiri', '~>1.8.1'
57
gem 'require_all', '~>1.4'
6-
gem 'rubyzip', '~>1.2'
7-
gem 'slop', '~>4.5'
8-
gem 'typhoeus', '~>1.1.2'
8+
gem 'rubyzip', '~>1.2.1'
9+
gem 'slop', '~>4.6.0'
10+
gem 'typhoeus', '~>1.3.0'
911

1012
group :test do
11-
gem 'rspec', '~>3.5'
13+
gem 'rspec', '~>3.7'
1214
end

README.md

Lines changed: 1 addition & 1 deletion

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.7
1+
1.8

env.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'date'
24
require 'fileutils'
35
require 'json'

github_updater.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'json'
24
require 'typhoeus'
35
require 'fileutils'

lib/cli/auto_complete.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Cli
24
# Functionality for configuring auto-complete functionality in Readline lib.
35
module AutoComplete

lib/cli/console.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'readline'
24

35
require 'modules'

lib/cli/context.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Cli
24
# A context which modules will be used in.
35
class Context

lib/cli/help.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Cli
24
# Methods for handling commands that provide the user with help info.
35
module Help

lib/cli/loaded_module.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Cli
24
# Methods for handling commands that interact with the currently loaded module.
35
module LoadedModule

lib/cli/module_info.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Cli
24
# Helper methods for outputing information about the currently loaded module.
35
module ModuleInfo

lib/cli/modules.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Cli
24
# Methods for handling module loading and searching.
35
module Modules

lib/cli/options.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Cli
24
# Methods for handling commands that interact with module options.
35
module Options

lib/cli/output.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Cli
24
# Methods for handling output to the screen.
35
module Output

lib/wpxf/core.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
# The root namespace.
24
module Wpxf
35
# The namespace for WordPress mixins and classes.
@@ -72,5 +74,7 @@ def self.change_stdout_sync(enabled)
7274
require 'wpxf/wordpress/stored_xss'
7375
require 'wpxf/wordpress/shell_upload'
7476
require 'wpxf/wordpress/file_download'
77+
require 'wpxf/wordpress/comments'
78+
require 'wpxf/wordpress/hash_dump'
7579

7680
require 'wpxf/core/module'

lib/wpxf/core/data_file.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
# Represents a data file found in the data directory.
35
class DataFile

lib/wpxf/core/event_emitter.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
# An event emitter that allows one or more subscribers.
35
class EventEmitter

lib/wpxf/core/module.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
# The base class for all modules.
35
class Module

lib/wpxf/core/module_authentication.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
# Provides functionality for authenticating modules with a WordPress target.
35
module ModuleAuthentication

lib/wpxf/core/module_info.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
# Provides functionality for specifying module metadata.
35
module ModuleInfo

lib/wpxf/core/options.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'wpxf/core/opts/option'
24
require 'wpxf/core/opts/boolean_option'
35
require 'wpxf/core/opts/enum_option'

lib/wpxf/core/opts/boolean_option.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
# frozen_string_literal: true
3+
24
module Wpxf
35
# A boolean option.
46
class BooleanOption < Option

lib/wpxf/core/opts/enum_option.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
# frozen_string_literal: true
3+
24
module Wpxf
35
# An enum option.
46
class EnumOption < Option

lib/wpxf/core/opts/integer_option.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
# frozen_string_literal: true
3+
24
module Wpxf
35
# An integer option.
46
class IntegerOption < Option

lib/wpxf/core/opts/option.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
# frozen_string_literal: true
3+
24
module Wpxf
35
# The base class for all module options.
46
class Option

lib/wpxf/core/opts/path_option.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
# frozen_string_literal: true
3+
24
module Wpxf
35
# A file system path option.
46
class PathOption < Option

lib/wpxf/core/opts/port_option.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
# frozen_string_literal: true
3+
24
module Wpxf
35
# A network port option.
46
class PortOption < Option

lib/wpxf/core/opts/string_option.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
# A string option.
35
class StringOption < Option

lib/wpxf/core/output_emitters.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
# Provides methods for emitting events that should output information
35
# to the user interface of the calling application.

lib/wpxf/core/payload.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'base64'
24

35
module Wpxf
@@ -124,7 +126,7 @@ def enqueue_command(cmd)
124126
private
125127

126128
def raw_payload_with_random_var_names
127-
payload = "#{php_preamble} #{raw}"
129+
payload = "#{php_preamble} #{raw}".dup
128130
vars = generate_vars(obfuscated_variables)
129131
obfuscated_variables.each { |v| payload.gsub!("$#{v}", "$#{vars[v]}") }
130132
payload

lib/wpxf/net/cookie_jar.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
module Net
35
# A Hash derivitive that provides cookie parsing functionality.

lib/wpxf/net/http_client.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'uri'
24

35
module Wpxf

lib/wpxf/net/http_options.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
module Net
35
# Provides access to various HTTP based options.

lib/wpxf/net/http_response.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
module Net
35
# A response from a request made by a HttpClient.

lib/wpxf/net/http_server.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'cgi'
24
require 'socket'
35

@@ -45,7 +47,7 @@ def http_server_bind_port
4547
# to send to the client. If a hash is returned, it should contain the keys:
4648
# * +:body+ - the body text of the response.
4749
# * +:type+ - the MIME type of the response.
48-
# * +:headers+ - a hash of header keys and values.
50+
# * +:headers+ - an array of header strings.
4951
def on_http_request(path, params, headers)
5052
end
5153

lib/wpxf/net/typhoeus_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
module Net
35
# Provides helper functions for interfacing with Typhoeus in a module.

lib/wpxf/net/user_agent.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
module Net
35
# Provides functionality for generating user agent strings.

lib/wpxf/utility/body_builder.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'fileutils'
24

35
module Wpxf

lib/wpxf/utility/reference_inflater.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
module Utility
35
# A URL inflater for module references.

lib/wpxf/utility/text.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
require 'digest'
24

35
module Wpxf
@@ -6,9 +8,12 @@ module Utility
68
module Text
79
# Generate a random numeric string.
810
# @param length [Integer] the number of characters to include.
11+
# @param allow_leading_zero [Boolean] if set to true, will allow a number starting with zero.
912
# @return [String] a random numeric string.
10-
def self.rand_numeric(length)
11-
Array.new(length) { [*'0'..'9'].sample }.join
13+
def self.rand_numeric(length, allow_leading_zero = false)
14+
value = Array.new(length) { [*'0'..'9'].sample }.join
15+
value[0] = [*'1'..'9'].sample unless allow_leading_zero
16+
value
1217
end
1318

1419
# Generate a random alphanumeric string.

lib/wpxf/versioning/browser_versions.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
module Versioning
35
# Provides functionality for generating random browser versions.

lib/wpxf/versioning/os_versions.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# frozen_string_literal: true
2+
13
module Wpxf
24
module Versioning
35
# Provides functionality for generating random OS versions.

0 commit comments

Comments
 (0)