ronin-listener 0.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +7 -0
  2. data/.document +4 -0
  3. data/.github/workflows/ruby.yml +47 -0
  4. data/.gitignore +14 -0
  5. data/.rspec +1 -0
  6. data/.rubocop.yml +11 -0
  7. data/.ruby-version +1 -0
  8. data/.yardopts +1 -0
  9. data/COPYING.txt +165 -0
  10. data/ChangeLog.md +8 -0
  11. data/Gemfile +40 -0
  12. data/README.md +132 -0
  13. data/Rakefile +43 -0
  14. data/bin/ronin-listener +34 -0
  15. data/data/completions/ronin-listener +103 -0
  16. data/data/new/dns.rb.erb +7 -0
  17. data/data/new/http.rb.erb +14 -0
  18. data/gemspec.yml +39 -0
  19. data/lib/ronin/listener/cli/command.rb +40 -0
  20. data/lib/ronin/listener/cli/commands/completion.rb +61 -0
  21. data/lib/ronin/listener/cli/commands/dns.rb +137 -0
  22. data/lib/ronin/listener/cli/commands/http.rb +159 -0
  23. data/lib/ronin/listener/cli/commands/new/dns.rb +123 -0
  24. data/lib/ronin/listener/cli/commands/new/http.rb +130 -0
  25. data/lib/ronin/listener/cli/commands/new.rb +71 -0
  26. data/lib/ronin/listener/cli.rb +50 -0
  27. data/lib/ronin/listener/output_formats.rb +39 -0
  28. data/lib/ronin/listener/root.rb +28 -0
  29. data/lib/ronin/listener/version.rb +26 -0
  30. data/man/ronin-listener-completion.1 +76 -0
  31. data/man/ronin-listener-completion.1.md +78 -0
  32. data/man/ronin-listener-dns.1 +59 -0
  33. data/man/ronin-listener-dns.1.md +55 -0
  34. data/man/ronin-listener-http.1 +69 -0
  35. data/man/ronin-listener-http.1.md +60 -0
  36. data/man/ronin-listener-new-dns.1 +35 -0
  37. data/man/ronin-listener-new-dns.1.md +36 -0
  38. data/man/ronin-listener-new-http.1 +38 -0
  39. data/man/ronin-listener-new-http.1.md +39 -0
  40. data/man/ronin-listener-new.1 +56 -0
  41. data/man/ronin-listener-new.1.md +52 -0
  42. data/man/ronin-listener.1 +38 -0
  43. data/man/ronin-listener.1.md +40 -0
  44. data/ronin-listener.gemspec +62 -0
  45. data/scripts/setup +58 -0
  46. metadata +153 -0
@@ -0,0 +1,38 @@
1
+ .\" Generated by kramdown-man 1.0.0
2
+ .\" https://github.com/postmodern/kramdown-man#readme
3
+ .TH ronin-listener-new-http 1 "2023-02-01" Ronin Listener "User Manuals"
4
+ .SH SYNOPSIS
5
+ .PP
6
+ \fBronin-listener new http\fR \[lB]\fIoptions\fP\[rB] \[lB]\fIPATH\fP\[rB]
7
+ .SH DESCRIPTION
8
+ .PP
9
+ Creates a new standalone HTTP listener Ruby script\.
10
+ .SH ARGUMENTS
11
+ .TP
12
+ \fIPATH\fP
13
+ The path to the new Ruby script file to create\.
14
+ .SH OPTIONS
15
+ .TP
16
+ \fB-H\fR, \fB--host\fR \fIIP\fP
17
+ The interface to listen on\. Defaults to \fB0.0.0.0\fR if not given\.
18
+ .TP
19
+ \fB-p\fR, \fB--port\fR \fIPORT\fP
20
+ The port to listen on\. Defaults to \fB8080\fR if not given\.
21
+ .TP
22
+ \fB--vhost\fR \fIHOST\fP
23
+ The \fBHost:\fR header to filter requests by\.
24
+ .TP
25
+ \fB-R\fR, \fB--root\fR \fIDIR\fP
26
+ The root directory to filter requests by\.
27
+ .TP
28
+ \fB-h\fR, \fB--help\fR
29
+ Print help information
30
+ .SH AUTHOR
31
+ .PP
32
+ Postmodern
33
+ .MT postmodern\.mod3\[at]gmail\.com
34
+ .ME
35
+ .SH SEE ALSO
36
+ .PP
37
+ .BR ronin\-listener\-new (1)
38
+ .BR ronin\-listener\-new\-dns (1)
@@ -0,0 +1,39 @@
1
+ # ronin-listener-new-http 1 "2023-02-01" Ronin Listener "User Manuals"
2
+
3
+ ## SYNOPSIS
4
+
5
+ `ronin-listener new http` [*options*] [*PATH*]
6
+
7
+ ## DESCRIPTION
8
+
9
+ Creates a new standalone HTTP listener Ruby script.
10
+
11
+ ## ARGUMENTS
12
+
13
+ *PATH*
14
+ : The path to the new Ruby script file to create.
15
+
16
+ ## OPTIONS
17
+
18
+ `-H`, `--host` *IP*
19
+ : The interface to listen on. Defaults to `0.0.0.0` if not given.
20
+
21
+ `-p`, `--port` *PORT*
22
+ : The port to listen on. Defaults to `8080` if not given.
23
+
24
+ `--vhost` *HOST*
25
+ : The `Host:` header to filter requests by.
26
+
27
+ `-R`, `--root` *DIR*
28
+ : The root directory to filter requests by.
29
+
30
+ `-h`, `--help`
31
+ : Print help information
32
+
33
+ ## AUTHOR
34
+
35
+ Postmodern <postmodern.mod3@gmail.com>
36
+
37
+ ## SEE ALSO
38
+
39
+ [ronin-listener-new](ronin-listener-new.1.md) [ronin-listener-new-dns](ronin-listener-new-dns.1.md)
@@ -0,0 +1,56 @@
1
+ .\" Generated by kramdown-man 1.0.1
2
+ .\" https://github.com/postmodern/kramdown-man#readme
3
+ .TH ronin-listener-new 1 "2023-02-01" Ronin Listener "User Manuals"
4
+ .SH NAME
5
+ .PP
6
+ ronin\-listener\-new \- Creates a new DNS or HTTP listener Ruby script
7
+ .SH SYNOPSIS
8
+ .PP
9
+ \fBronin\-listener new\fR \[lB]\fIoptions\fP\[rB] \[lB]\fICOMMAND\fP\[rB]
10
+ .SH DESCRIPTION
11
+ .PP
12
+ Creates a new DNS or HTTP listener Ruby script\.
13
+ .SH ARGUMENTS
14
+ .TP
15
+ \fICOMMAND\fP
16
+ The optional command to get detailed new information on\.
17
+ .SH OPTIONS
18
+ .TP
19
+ \fB\-h\fR, \fB\-\-help\fR
20
+ Print help information
21
+ .SH COMMANDS
22
+ .TP
23
+ \fIdns\fP
24
+ Generates a new standalone DNS listener Ruby script\.
25
+ .TP
26
+ \fIhttp\fP
27
+ Generates a new standalone HTTP listener Ruby script\.
28
+ .TP
29
+ \fIhelp\fP
30
+ Lists available \fBronin\-listener new\fR commands\.
31
+ .SH EXAMPLES
32
+ .PP
33
+ Generate a new DNS listener Ruby script:
34
+ .PP
35
+ .RS 4
36
+ .EX
37
+ \[Do] ronin\-listener new dns file\.rb
38
+ .EE
39
+ .RE
40
+ .PP
41
+ Generate a new HTTP listener Ruby script:
42
+ .PP
43
+ .RS 4
44
+ .EX
45
+ \[Do] ronin\-listener new http file\.rb
46
+ .EE
47
+ .RE
48
+ .SH AUTHOR
49
+ .PP
50
+ Postmodern
51
+ .MT postmodern\.mod3\[at]gmail\.com
52
+ .ME
53
+ .SH SEE ALSO
54
+ .PP
55
+ .BR ronin\-listener\-new\-dns (1)
56
+ .BR ronin\-listener\-new\-http (1)
@@ -0,0 +1,52 @@
1
+ # ronin-listener-new 1 "2023-02-01" Ronin Listener "User Manuals"
2
+
3
+ ## NAME
4
+
5
+ ronin-listener-new - Creates a new DNS or HTTP listener Ruby script
6
+
7
+ ## SYNOPSIS
8
+
9
+ `ronin-listener new` [*options*] [*COMMAND*]
10
+
11
+ ## DESCRIPTION
12
+
13
+ Creates a new DNS or HTTP listener Ruby script.
14
+
15
+ ## ARGUMENTS
16
+
17
+ *COMMAND*
18
+ : The optional command to get detailed new information on.
19
+
20
+ ## OPTIONS
21
+
22
+ `-h`, `--help`
23
+ : Print help information
24
+
25
+ ## COMMANDS
26
+
27
+ *dns*
28
+ : Generates a new standalone DNS listener Ruby script.
29
+
30
+ *http*
31
+ : Generates a new standalone HTTP listener Ruby script.
32
+
33
+ *help*
34
+ : Lists available `ronin-listener new` commands.
35
+
36
+ ## EXAMPLES
37
+
38
+ Generate a new DNS listener Ruby script:
39
+
40
+ $ ronin-listener new dns file.rb
41
+
42
+ Generate a new HTTP listener Ruby script:
43
+
44
+ $ ronin-listener new http file.rb
45
+
46
+ ## AUTHOR
47
+
48
+ Postmodern <postmodern.mod3@gmail.com>
49
+
50
+ ## SEE ALSO
51
+
52
+ [ronin-listener-new-dns](ronin-listener-new-dns.1.md) [ronin-listener-new-http](ronin-listener-new-http.1.md)
@@ -0,0 +1,38 @@
1
+ .\" Generated by kramdown-man 1.0.1
2
+ .\" https://github.com/postmodern/kramdown-man#readme
3
+ .TH ronin-listener 1 "2023-02-01" Ronin Listener "User Manuals"
4
+ .SH NAME
5
+ .PP
6
+ ronin\-listener \- A Ruby CLI utility for receiving exfiltrated data
7
+ .SH SYNOPSIS
8
+ .PP
9
+ \fBronin\-listener\fR \[lB]\fIoptions\fP\[rB] \[lB]\fICOMMAND\fP\[rB]
10
+ .SH DESCRIPTION
11
+ .PP
12
+ Allows quickly starting a DNS or HTTP server for receiving exfiltrated data\.
13
+ .SH OPTIONS
14
+ .TP
15
+ \fB\-h\fR, \fB\-\-help\fR
16
+ Prints help information\.
17
+ .SH COMMANDS
18
+ .TP
19
+ \fBdns\fR
20
+ Starts a DNS server for receiving exfiltrated data\.
21
+ .TP
22
+ \fBhttp\fR
23
+ Starts a HTTP server for receiving exfiltrated data\.
24
+ .TP
25
+ \fBnew\fR
26
+ Creates a new DNS or HTTP listener Ruby script\.
27
+ .TP
28
+ \fBhelp\fR
29
+ Prints help information about this command or another command\.
30
+ .SH AUTHOR
31
+ .PP
32
+ Postmodern
33
+ .MT postmodern\.mod3\[at]gmail\.com
34
+ .ME
35
+ .SH SEE ALSO
36
+ .PP
37
+ .BR ronin\-listener\-dns (1)
38
+ .BR ronin\-listener\-http (1)
@@ -0,0 +1,40 @@
1
+ # ronin-listener 1 "2023-02-01" Ronin Listener "User Manuals"
2
+
3
+ ## NAME
4
+
5
+ ronin-listener - A Ruby CLI utility for receiving exfiltrated data
6
+
7
+ ## SYNOPSIS
8
+
9
+ `ronin-listener` [*options*] [*COMMAND*]
10
+
11
+ ## DESCRIPTION
12
+
13
+ Allows quickly starting a DNS or HTTP server for receiving exfiltrated data.
14
+
15
+ ## OPTIONS
16
+
17
+ `-h`, `--help`
18
+ : Prints help information.
19
+
20
+ ## COMMANDS
21
+
22
+ `dns`
23
+ : Starts a DNS server for receiving exfiltrated data.
24
+
25
+ `http`
26
+ : Starts a HTTP server for receiving exfiltrated data.
27
+
28
+ `new`
29
+ : Creates a new DNS or HTTP listener Ruby script.
30
+
31
+ `help`
32
+ : Prints help information about this command or another command.
33
+
34
+ ## AUTHOR
35
+
36
+ Postmodern <postmodern.mod3@gmail.com>
37
+
38
+ ## SEE ALSO
39
+
40
+ [ronin-listener-dns](ronin-listener-dns.1.md) [ronin-listener-http](ronin-listener-http.1.md)
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'yaml'
4
+
5
+ Gem::Specification.new do |gem|
6
+ gemspec = YAML.load_file('gemspec.yml')
7
+
8
+ gem.name = gemspec.fetch('name')
9
+ gem.version = gemspec.fetch('version') do
10
+ lib_dir = File.join(File.dirname(__FILE__),'lib')
11
+ $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
12
+
13
+ require 'ronin/listener/version'
14
+ Ronin::Listener::VERSION
15
+ end
16
+
17
+ gem.summary = gemspec['summary']
18
+ gem.description = gemspec['description']
19
+ gem.licenses = Array(gemspec['license'])
20
+ gem.authors = Array(gemspec['authors'])
21
+ gem.email = gemspec['email']
22
+ gem.homepage = gemspec['homepage']
23
+ gem.metadata = gemspec['metadata'] if gemspec['metadata']
24
+
25
+ glob = ->(patterns) { gem.files & Dir[*patterns] }
26
+
27
+ gem.files = `git ls-files`.split($/)
28
+ gem.files = glob[gemspec['files']] if gemspec['files']
29
+ gem.files += Array(gemspec['generated_files'])
30
+ # exclude test files from the packages gem
31
+ gem.files -= glob[gemspec['test_files'] || 'spec/{**/}*']
32
+
33
+ gem.executables = gemspec.fetch('executables') do
34
+ glob['bin/*'].map { |path| File.basename(path) }
35
+ end
36
+
37
+ gem.extensions = glob[gemspec['extensions'] || 'ext/**/extconf.rb']
38
+ gem.extra_rdoc_files = glob[gemspec['extra_doc_files'] || '*.{txt,md}']
39
+
40
+ gem.require_paths = Array(gemspec.fetch('require_paths') {
41
+ %w[ext lib].select { |dir| File.directory?(dir) }
42
+ })
43
+
44
+ gem.requirements = gemspec['requirements']
45
+ gem.required_ruby_version = gemspec['required_ruby_version']
46
+ gem.required_rubygems_version = gemspec['required_rubygems_version']
47
+ gem.post_install_message = gemspec['post_install_message']
48
+
49
+ split = ->(string) { string.split(/,\s*/) }
50
+
51
+ if gemspec['dependencies']
52
+ gemspec['dependencies'].each do |name,versions|
53
+ gem.add_dependency(name,split[versions])
54
+ end
55
+ end
56
+
57
+ if gemspec['development_dependencies']
58
+ gemspec['development_dependencies'].each do |name,versions|
59
+ gem.add_development_dependency(name,split[versions])
60
+ end
61
+ end
62
+ end
data/scripts/setup ADDED
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env bash
2
+
3
+ #
4
+ # Prints a log message.
5
+ #
6
+ function log()
7
+ {
8
+ if [[ -t 1 ]]; then
9
+ echo -e "\x1b[1m\x1b[32m>>>\x1b[0m \x1b[1m$1\x1b[0m"
10
+ else
11
+ echo ">>> $1"
12
+ fi
13
+ }
14
+
15
+ #
16
+ # Prints a warn message.
17
+ #
18
+ function warn()
19
+ {
20
+ if [[ -t 1 ]]; then
21
+ echo -e "\x1b[1m\x1b[33m***\x1b[0m \x1b[1m$1\x1b[0m" >&2
22
+ else
23
+ echo "*** $1" >&2
24
+ fi
25
+ }
26
+
27
+ #
28
+ # Prints an error message.
29
+ #
30
+ function error()
31
+ {
32
+ if [[ -t 1 ]]; then
33
+ echo -e "\x1b[1m\x1b[31m!!!\x1b[0m \x1b[1m$1\x1b[0m" >&2
34
+ else
35
+ echo "!!! $1" >&2
36
+ fi
37
+ }
38
+
39
+ #
40
+ # Prints an error message and exists with -1.
41
+ #
42
+ function fail()
43
+ {
44
+ error "$@"
45
+ exit -1
46
+ }
47
+
48
+ # default to installing gems into vendor/bundle
49
+ if [[ ! -f .bundle/config ]]; then
50
+ bundle config set --local path vendor/bundle >/dev/null || \
51
+ fail "Failed to run 'bundle config'"
52
+ fi
53
+
54
+ log "Installing gems ..."
55
+ bundle install || fail "Failed to run 'bundle install'!"
56
+
57
+ log "Setting up the project ..."
58
+ bundle exec rake setup || "Failed to run 'rake setup'!"
metadata ADDED
@@ -0,0 +1,153 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ronin-listener
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0.rc1
5
+ platform: ruby
6
+ authors:
7
+ - Postmodern
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-06-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: ronin-listener-dns
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.0.rc1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.1.0.rc1
27
+ - !ruby/object:Gem::Dependency
28
+ name: ronin-listener-http
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.0.rc1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.1.0.rc1
41
+ - !ruby/object:Gem::Dependency
42
+ name: ronin-core
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.2.0.rc1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.2.0.rc1
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ description: |
70
+ ronin-listener is a small CLI utility for receiving exfiltrated data over DNS
71
+ or HTTP.
72
+ email: postmodern.mod3@gmail.com
73
+ executables:
74
+ - ronin-listener
75
+ extensions: []
76
+ extra_rdoc_files:
77
+ - COPYING.txt
78
+ - ChangeLog.md
79
+ - README.md
80
+ files:
81
+ - ".document"
82
+ - ".github/workflows/ruby.yml"
83
+ - ".gitignore"
84
+ - ".rspec"
85
+ - ".rubocop.yml"
86
+ - ".ruby-version"
87
+ - ".yardopts"
88
+ - COPYING.txt
89
+ - ChangeLog.md
90
+ - Gemfile
91
+ - README.md
92
+ - Rakefile
93
+ - bin/ronin-listener
94
+ - data/completions/ronin-listener
95
+ - data/new/dns.rb.erb
96
+ - data/new/http.rb.erb
97
+ - gemspec.yml
98
+ - lib/ronin/listener/cli.rb
99
+ - lib/ronin/listener/cli/command.rb
100
+ - lib/ronin/listener/cli/commands/completion.rb
101
+ - lib/ronin/listener/cli/commands/dns.rb
102
+ - lib/ronin/listener/cli/commands/http.rb
103
+ - lib/ronin/listener/cli/commands/new.rb
104
+ - lib/ronin/listener/cli/commands/new/dns.rb
105
+ - lib/ronin/listener/cli/commands/new/http.rb
106
+ - lib/ronin/listener/output_formats.rb
107
+ - lib/ronin/listener/root.rb
108
+ - lib/ronin/listener/version.rb
109
+ - man/ronin-listener-completion.1
110
+ - man/ronin-listener-completion.1.md
111
+ - man/ronin-listener-dns.1
112
+ - man/ronin-listener-dns.1.md
113
+ - man/ronin-listener-http.1
114
+ - man/ronin-listener-http.1.md
115
+ - man/ronin-listener-new-dns.1
116
+ - man/ronin-listener-new-dns.1.md
117
+ - man/ronin-listener-new-http.1
118
+ - man/ronin-listener-new-http.1.md
119
+ - man/ronin-listener-new.1
120
+ - man/ronin-listener-new.1.md
121
+ - man/ronin-listener.1
122
+ - man/ronin-listener.1.md
123
+ - ronin-listener.gemspec
124
+ - scripts/setup
125
+ homepage: https://ronin-rb.dev/
126
+ licenses:
127
+ - LGPL-3.0
128
+ metadata:
129
+ documentation_uri: https://ronin-rb.dev/docs/ronin-listener
130
+ source_code_uri: https://github.com/ronin-rb/ronin-listener
131
+ bug_tracker_uri: https://github.com/ronin-rb/ronin-listener/issues
132
+ changelog_uri: https://github.com/ronin-rb/ronin-listener/blob/main/ChangeLog.md
133
+ rubygems_mfa_required: 'true'
134
+ post_install_message:
135
+ rdoc_options: []
136
+ require_paths:
137
+ - lib
138
+ required_ruby_version: !ruby/object:Gem::Requirement
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: 3.0.0
143
+ required_rubygems_version: !ruby/object:Gem::Requirement
144
+ requirements:
145
+ - - ">="
146
+ - !ruby/object:Gem::Version
147
+ version: '0'
148
+ requirements: []
149
+ rubygems_version: 3.3.27
150
+ signing_key:
151
+ specification_version: 4
152
+ summary: A Ruby CLI utility for receiving exfiltrated data.
153
+ test_files: []