ronin-support 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/ChangeLog.md +17 -0
  2. data/Gemfile +5 -5
  3. data/README.md +10 -9
  4. data/Rakefile +1 -0
  5. data/gemspec.yml +2 -2
  6. data/lib/ronin/formatting/extensions/binary/string.rb +1 -2
  7. data/lib/ronin/network.rb +1 -0
  8. data/lib/ronin/network/extensions.rb +2 -0
  9. data/lib/ronin/network/extensions/dns.rb +20 -0
  10. data/lib/ronin/network/extensions/dns/net.rb +24 -0
  11. data/lib/ronin/network/extensions/http/uri/http.rb +47 -45
  12. data/lib/ronin/network/http/http.rb +26 -25
  13. data/lib/ronin/network/mixins/dns.rb +1 -1
  14. data/lib/ronin/network/mixins/esmtp.rb +3 -1
  15. data/lib/ronin/network/mixins/http.rb +23 -21
  16. data/lib/ronin/network/mixins/imap.rb +3 -1
  17. data/lib/ronin/network/mixins/pop3.rb +3 -1
  18. data/lib/ronin/network/mixins/smtp.rb +3 -1
  19. data/lib/ronin/network/mixins/ssl.rb +5 -1
  20. data/lib/ronin/network/mixins/tcp.rb +17 -1
  21. data/lib/ronin/network/mixins/telnet.rb +3 -1
  22. data/lib/ronin/network/mixins/udp.rb +12 -0
  23. data/lib/ronin/network/smtp/smtp.rb +2 -2
  24. data/lib/ronin/network/ssl.rb +122 -117
  25. data/lib/ronin/network/tcp.rb +9 -9
  26. data/lib/ronin/network/telnet.rb +1 -1
  27. data/lib/ronin/network/udp.rb +7 -7
  28. data/lib/ronin/support/support.rb +1 -0
  29. data/lib/ronin/support/version.rb +1 -1
  30. data/lib/ronin/ui/output/output.rb +1 -1
  31. data/lib/ronin/ui/output/terminal/color.rb +5 -5
  32. data/lib/ronin/ui/output/terminal/raw.rb +5 -5
  33. data/spec/extensions/string_spec.rb +14 -12
  34. data/spec/network/dns_spec.rb +6 -6
  35. data/spec/network/tcp_spec.rb +25 -22
  36. data/spec/network/udp_spec.rb +24 -21
  37. metadata +25 -23
@@ -43,7 +43,7 @@ module Ronin
43
43
  #
44
44
  # The DNS Resolver to use.
45
45
  #
46
- # @see DNS#dns_resolver
46
+ # @see Network::DNS#dns_resolver
47
47
  #
48
48
  def dns_resolver(nameserver=self.nameserver)
49
49
  super(nameserver)
@@ -93,6 +93,8 @@ module Ronin
93
93
  # @return [Net::SMTP]
94
94
  # The ESMTP enabled session.
95
95
  #
96
+ # @see Network::ESMTP#esmtp_connect
97
+ #
96
98
  # @api public
97
99
  #
98
100
  def esmtp_connect(options={},&block)
@@ -117,7 +119,7 @@ module Ronin
117
119
  # @yieldparam [Net::SMTP] session
118
120
  # The ESMTP session.
119
121
  #
120
- # @see esmtp_connect
122
+ # @see Network::ESMTP#esmtp_session
121
123
  #
122
124
  # @api public
123
125
  #
@@ -113,6 +113,8 @@ module Ronin
113
113
  # @return [Net::HTTP]
114
114
  # The HTTP session object.
115
115
  #
116
+ # @see Network::HTTP#http_session
117
+ #
116
118
  # @api public
117
119
  #
118
120
  def http_session(options={},&block)
@@ -156,7 +158,7 @@ module Ronin
156
158
  # @return [Net::HTTP::Response]
157
159
  # The response of the HTTP request.
158
160
  #
159
- # @see #http_session
161
+ # @see Network::HTTP#http_request
160
162
  #
161
163
  # @api public
162
164
  #
@@ -179,7 +181,7 @@ module Ronin
179
181
  # @return [Integer]
180
182
  # The HTTP Response Status.
181
183
  #
182
- # @see #http_request
184
+ # @see Network::HTTP#http_status
183
185
  #
184
186
  # @since 1.1.0
185
187
  #
@@ -207,7 +209,7 @@ module Ronin
207
209
  # @return [Boolean]
208
210
  # Specifies whether the response had an HTTP OK status code or not.
209
211
  #
210
- # @see #http_status
212
+ # @see Network::HTTP#http_ok?
211
213
  #
212
214
  # @since 1.1.0
213
215
  #
@@ -235,7 +237,7 @@ module Ronin
235
237
  # @return [String]
236
238
  # The HTTP `Server` header.
237
239
  #
238
- # @see #http_request
240
+ # @see Network::HTTP#http_server
239
241
  #
240
242
  # @since 1.1.0
241
243
  #
@@ -263,7 +265,7 @@ module Ronin
263
265
  # @return [String]
264
266
  # The HTTP `X-Powered-By` header.
265
267
  #
266
- # @see #http_request
268
+ # @see Network::HTTP#http_powered_by
267
269
  #
268
270
  # @since 1.1.0
269
271
  #
@@ -292,7 +294,7 @@ module Ronin
292
294
  # @return [Net::HTTP::Response]
293
295
  # The response of the HTTP request.
294
296
  #
295
- # @see #http_request
297
+ # @see Network::HTTP#http_copy
296
298
  #
297
299
  # @api public
298
300
  #
@@ -316,7 +318,7 @@ module Ronin
316
318
  # @return [Net::HTTP::Response]
317
319
  # The response of the HTTP request.
318
320
  #
319
- # @see #http_request
321
+ # @see Network::HTTP#http_delete
320
322
  #
321
323
  # @api public
322
324
  #
@@ -340,7 +342,7 @@ module Ronin
340
342
  # @return [Net::HTTP::Response]
341
343
  # The response of the HTTP request.
342
344
  #
343
- # @see #http_request
345
+ # @see Network::HTTP#http_get
344
346
  #
345
347
  # @api public
346
348
  #
@@ -364,7 +366,7 @@ module Ronin
364
366
  # @return [String]
365
367
  # The body of the HTTP Get request.
366
368
  #
367
- # @see #http_get
369
+ # @see Network::HTTP#http_get_body
368
370
  #
369
371
  # @api public
370
372
  #
@@ -388,7 +390,7 @@ module Ronin
388
390
  # @return [Net::HTTP::Response]
389
391
  # The response of the HTTP request.
390
392
  #
391
- # @see #http_request
393
+ # @see Network::HTTP#http_head
392
394
  #
393
395
  # @api public
394
396
  #
@@ -412,7 +414,7 @@ module Ronin
412
414
  # @return [Net::HTTP::Response]
413
415
  # The response of the HTTP request.
414
416
  #
415
- # @see #http_request
417
+ # @see Network::HTTP#http_lock
416
418
  #
417
419
  # @api public
418
420
  #
@@ -436,7 +438,7 @@ module Ronin
436
438
  # @return [Net::HTTP::Response]
437
439
  # The response of the HTTP request.
438
440
  #
439
- # @see #http_request
441
+ # @see Network::HTTP#http_mkcol
440
442
  #
441
443
  # @api public
442
444
  #
@@ -460,7 +462,7 @@ module Ronin
460
462
  # @return [Net::HTTP::Response]
461
463
  # The response of the HTTP request.
462
464
  #
463
- # @see #http_request
465
+ # @see Network::HTTP#http_move
464
466
  #
465
467
  # @api public
466
468
  #
@@ -484,7 +486,7 @@ module Ronin
484
486
  # @return [Net::HTTP::Response]
485
487
  # The response of the HTTP request.
486
488
  #
487
- # @see #http_request
489
+ # @see Network::HTTP#http_options
488
490
  #
489
491
  # @api public
490
492
  #
@@ -514,7 +516,7 @@ module Ronin
514
516
  # @return [Net::HTTP::Response]
515
517
  # The response of the HTTP request.
516
518
  #
517
- # @see #http_request
519
+ # @see Network::HTTP#http_post
518
520
  #
519
521
  # @api public
520
522
  #
@@ -538,7 +540,7 @@ module Ronin
538
540
  # @return [String]
539
541
  # The body of the Post request.
540
542
  #
541
- # @see #http_post
543
+ # @see Network::HTTP#http_post_body
542
544
  #
543
545
  # @api public
544
546
  #
@@ -571,7 +573,7 @@ module Ronin
571
573
  # @return [Net::HTTP::Response]
572
574
  # The response of the HTTP request.
573
575
  #
574
- # @see #http_request
576
+ # @see Network::HTTP#http_put
575
577
  #
576
578
  # @since 0.4.0
577
579
  #
@@ -597,7 +599,7 @@ module Ronin
597
599
  # @return [Net::HTTP::Response]
598
600
  # The response of the HTTP request.
599
601
  #
600
- # @see #http_request
602
+ # @see Network::HTTP#http_prop_find
601
603
  #
602
604
  # @api public
603
605
  #
@@ -621,7 +623,7 @@ module Ronin
621
623
  # @return [Net::HTTP::Response]
622
624
  # The response of the HTTP request.
623
625
  #
624
- # @see #http_request
626
+ # @see Network::HTTP#http_prop_patch
625
627
  #
626
628
  # @api public
627
629
  #
@@ -645,7 +647,7 @@ module Ronin
645
647
  # @return [Net::HTTP::Response]
646
648
  # The response of the HTTP request.
647
649
  #
648
- # @see #http_request
650
+ # @see Network::HTTP#http_trace
649
651
  #
650
652
  # @api public
651
653
  #
@@ -669,7 +671,7 @@ module Ronin
669
671
  # @return [Net::HTTP::Response]
670
672
  # The response of the HTTP request.
671
673
  #
672
- # @see #http_request
674
+ # @see Network::HTTP#http_unlock
673
675
  #
674
676
  # @api public
675
677
  #
@@ -88,6 +88,8 @@ module Ronin
88
88
  # Indicates wether or not to use SSL when connecting to the
89
89
  # server.
90
90
  #
91
+ # @see Network::IMAP#imap_connect
92
+ #
91
93
  # @api public
92
94
  #
93
95
  def imap_connect(options={},&block)
@@ -109,7 +111,7 @@ module Ronin
109
111
  # @yieldparam [Net::IMAP] session
110
112
  # The newly created IMAP session object.
111
113
  #
112
- # @see imap_connect
114
+ # @see Network::IMAP#imap_session
113
115
  #
114
116
  # @api public
115
117
  #
@@ -83,6 +83,8 @@ module Ronin
83
83
  # @return [Net::POP3]
84
84
  # The newly created POP3 session.
85
85
  #
86
+ # @see Network::POP3#pop3_connect
87
+ #
86
88
  # @api public
87
89
  #
88
90
  def pop3_connect(options={},&block)
@@ -104,7 +106,7 @@ module Ronin
104
106
  # @yieldparam [Net::POP3] session
105
107
  # The newly created POP3 session.
106
108
  #
107
- # @see pop3_connect
109
+ # @see Network::POP3#pop3_session
108
110
  #
109
111
  # @api public
110
112
  #
@@ -92,6 +92,8 @@ module Ronin
92
92
  # @return [Net::SMTP]
93
93
  # The SMTP session.
94
94
  #
95
+ # @see Network::SMTP#smtp_connect
96
+ #
95
97
  # @api public
96
98
  #
97
99
  def smtp_connect(options={},&block)
@@ -112,7 +114,7 @@ module Ronin
112
114
  # @yieldparam [Net::SMTP] session
113
115
  # The SMTP session.
114
116
  #
115
- # @see smtp_connect
117
+ # @see Network::SMTP#smtp_session
116
118
  #
117
119
  # @api public
118
120
  #
@@ -86,6 +86,8 @@ module Ronin
86
86
  # @example
87
87
  # socket = ssl_connect
88
88
  #
89
+ # @see Network::SSL#ssl_connect
90
+ #
89
91
  # @api public
90
92
  #
91
93
  def ssl_connect(host,port,options={},&block)
@@ -128,11 +130,13 @@ module Ronin
128
130
  #
129
131
  # @example
130
132
  # ssl_session do |socket|
131
- # socket.write("GET /\n\n")
133
+ # socket.write("GET / HTTP/1.1\n\r\n\r")
132
134
  #
133
135
  # socket.each_line { |line| puts line }
134
136
  # end
135
137
  #
138
+ # @see Network::SSL#ssl_session
139
+ #
136
140
  # @api public
137
141
  #
138
142
  def ssl_session(options={},&block)
@@ -84,12 +84,14 @@ module Ronin
84
84
  #
85
85
  # @example
86
86
  # tcp_connect do |socket|
87
- # socket.write("GET /\n\n")
87
+ # socket.write("GET / HTTP/1.1\n\r\n\r")
88
88
  #
89
89
  # puts socket.readlines
90
90
  # socket.close
91
91
  # end
92
92
  #
93
+ # @see Network::TCP#tcp_connect
94
+ #
93
95
  # @api public
94
96
  #
95
97
  def tcp_connect(&block)
@@ -114,6 +116,8 @@ module Ronin
114
116
  # @return [TCPSocket]
115
117
  # The newly created TCPSocket object.
116
118
  #
119
+ # @see Network::TCP#tcp_connect_and_send
120
+ #
117
121
  # @api public
118
122
  #
119
123
  def tcp_connect_and_send(data,&block)
@@ -136,6 +140,8 @@ module Ronin
136
140
  #
137
141
  # @return [nil]
138
142
  #
143
+ # @see Network::TCP#tcp_session
144
+ #
139
145
  # @api public
140
146
  #
141
147
  def tcp_session(&block)
@@ -164,6 +170,8 @@ module Ronin
164
170
  # tcp_banner
165
171
  # # => "220 mx.google.com ESMTP c20sm3096959rvf.1"
166
172
  #
173
+ # @see Network::TCP#tcp_banner
174
+ #
167
175
  # @api public
168
176
  #
169
177
  def tcp_banner(&block)
@@ -184,6 +192,8 @@ module Ronin
184
192
  # Net.tcp_send(buffer)
185
193
  # # => true
186
194
  #
195
+ # @see Network::TCP#tcp_send
196
+ #
187
197
  # @api public
188
198
  #
189
199
  def tcp_send(data)
@@ -212,6 +222,8 @@ module Ronin
212
222
  # @example
213
223
  # tcp_server
214
224
  #
225
+ # @see Network::TCP#tcp_server
226
+ #
215
227
  # @api public
216
228
  #
217
229
  def tcp_server(&block)
@@ -244,6 +256,8 @@ module Ronin
244
256
  # client2.close
245
257
  # end
246
258
  #
259
+ # @see Network::TCP#tcp_server_session
260
+ #
247
261
  # @api public
248
262
  #
249
263
  def tcp_server_session(&block)
@@ -277,6 +291,8 @@ module Ronin
277
291
  # client.puts 'lol'
278
292
  # end
279
293
  #
294
+ # @see Network::TCP#tcp_server_single_server
295
+ #
280
296
  # @api public
281
297
  #
282
298
  def tcp_single_server(&block)
@@ -132,6 +132,8 @@ module Ronin
132
132
  # telnet_connect
133
133
  # # => Net::Telnet
134
134
  #
135
+ # @see Network::Telnet#telnet_connect
136
+ #
135
137
  # @api public
136
138
  #
137
139
  def telnet_connect(options={},&block)
@@ -159,7 +161,7 @@ module Ronin
159
161
  # movie.each_line { |line| puts line }
160
162
  # end
161
163
  #
162
- # @see telnet_connect
164
+ # @see Network::Telnet#telnet_session
163
165
  #
164
166
  # @api public
165
167
  #
@@ -88,6 +88,8 @@ module Ronin
88
88
  # puts socket.readlines
89
89
  # end
90
90
  #
91
+ # @see Network::UDP#udp_connect
92
+ #
91
93
  # @api public
92
94
  #
93
95
  def udp_connect(&block)
@@ -114,6 +116,8 @@ module Ronin
114
116
  # @return [UDPSocket]
115
117
  # The newly created UDPSocket object.
116
118
  #
119
+ # @see Network::UDP#udp_connect_and_send
120
+ #
117
121
  # @api public
118
122
  #
119
123
  def udp_connect_and_send(data,&block)
@@ -138,6 +142,8 @@ module Ronin
138
142
  #
139
143
  # @return [nil]
140
144
  #
145
+ # @see Network::UDP#udp_session
146
+ #
141
147
  # @api public
142
148
  #
143
149
  def udp_session(&block)
@@ -161,6 +167,8 @@ module Ronin
161
167
  # Net.udp_send(buffer)
162
168
  # # => true
163
169
  #
170
+ # @see Network::UDP#udp_send
171
+ #
164
172
  # @api public
165
173
  #
166
174
  # @since 0.4.0
@@ -191,6 +199,8 @@ module Ronin
191
199
  # @example
192
200
  # udp_server
193
201
  #
202
+ # @see Network::UDP#udp_server
203
+ #
194
204
  # @api public
195
205
  #
196
206
  def udp_server(&block)
@@ -217,6 +227,8 @@ module Ronin
217
227
  # data, sender = server.recvfrom(1024)
218
228
  # end
219
229
  #
230
+ # @see Network::UDP#udp_server_session
231
+ #
220
232
  # @api public
221
233
  #
222
234
  def udp_server_session(&block)
@@ -169,7 +169,7 @@ module Ronin
169
169
  # # ...
170
170
  # end
171
171
  #
172
- # @see smtp_connect
172
+ # @see #smtp_connect
173
173
  #
174
174
  # @api public
175
175
  #
@@ -197,7 +197,7 @@ module Ronin
197
197
  # @yieldparam [SMTP::Email] email
198
198
  # The new email to be sent.
199
199
  #
200
- # @see smtp_session
200
+ # @see #smtp_session
201
201
  #
202
202
  # @example
203
203
  # smtp_send_message 'www.example.com', :to => 'joe@example.com',