ronin-support 0.4.0.rc1 → 0.4.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. data/.yardopts +1 -0
  2. data/ChangeLog.md +10 -0
  3. data/Gemfile +1 -1
  4. data/README.md +1 -1
  5. data/Rakefile +8 -0
  6. data/gemspec.yml +2 -1
  7. data/lib/ronin/extensions.rb +1 -1
  8. data/lib/ronin/extensions/enumerable.rb +1 -1
  9. data/lib/ronin/extensions/file.rb +1 -1
  10. data/lib/ronin/extensions/ip_addr.rb +1 -1
  11. data/lib/ronin/extensions/kernel.rb +1 -1
  12. data/lib/ronin/extensions/meta.rb +1 -1
  13. data/lib/ronin/extensions/regexp.rb +1 -1
  14. data/lib/ronin/extensions/resolv.rb +1 -1
  15. data/lib/ronin/extensions/string.rb +1 -1
  16. data/lib/ronin/formatting.rb +1 -1
  17. data/lib/ronin/formatting/binary.rb +1 -1
  18. data/lib/ronin/formatting/digest.rb +1 -1
  19. data/lib/ronin/formatting/extensions.rb +1 -1
  20. data/lib/ronin/formatting/extensions/binary.rb +1 -1
  21. data/lib/ronin/formatting/extensions/binary/file.rb +1 -1
  22. data/lib/ronin/formatting/extensions/binary/integer.rb +1 -1
  23. data/lib/ronin/formatting/extensions/binary/string.rb +1 -1
  24. data/lib/ronin/formatting/extensions/digest.rb +1 -1
  25. data/lib/ronin/formatting/extensions/digest/file.rb +1 -1
  26. data/lib/ronin/formatting/extensions/digest/string.rb +1 -1
  27. data/lib/ronin/formatting/extensions/html.rb +1 -1
  28. data/lib/ronin/formatting/extensions/html/integer.rb +1 -1
  29. data/lib/ronin/formatting/extensions/html/string.rb +1 -1
  30. data/lib/ronin/formatting/extensions/http.rb +1 -1
  31. data/lib/ronin/formatting/extensions/http/integer.rb +1 -1
  32. data/lib/ronin/formatting/extensions/http/string.rb +1 -1
  33. data/lib/ronin/formatting/extensions/sql.rb +1 -1
  34. data/lib/ronin/formatting/extensions/sql/string.rb +1 -1
  35. data/lib/ronin/formatting/extensions/text.rb +1 -1
  36. data/lib/ronin/formatting/extensions/text/array.rb +1 -1
  37. data/lib/ronin/formatting/extensions/text/string.rb +1 -1
  38. data/lib/ronin/formatting/html.rb +1 -1
  39. data/lib/ronin/formatting/http.rb +1 -1
  40. data/lib/ronin/formatting/sql.rb +1 -1
  41. data/lib/ronin/formatting/text.rb +1 -1
  42. data/lib/ronin/fuzzing.rb +1 -1
  43. data/lib/ronin/fuzzing/extensions.rb +1 -1
  44. data/lib/ronin/fuzzing/extensions/string.rb +1 -1
  45. data/lib/ronin/fuzzing/fuzzing.rb +1 -1
  46. data/lib/ronin/mixin.rb +1 -1
  47. data/lib/ronin/network.rb +1 -1
  48. data/lib/ronin/network/esmtp.rb +1 -1
  49. data/lib/ronin/network/extensions.rb +1 -1
  50. data/lib/ronin/network/extensions/esmtp.rb +1 -1
  51. data/lib/ronin/network/extensions/esmtp/net.rb +1 -1
  52. data/lib/ronin/network/extensions/http.rb +1 -1
  53. data/lib/ronin/network/extensions/http/net.rb +1 -1
  54. data/lib/ronin/network/extensions/http/uri/http.rb +1 -1
  55. data/lib/ronin/network/extensions/imap.rb +1 -1
  56. data/lib/ronin/network/extensions/imap/net.rb +1 -1
  57. data/lib/ronin/network/extensions/pop3.rb +1 -1
  58. data/lib/ronin/network/extensions/pop3/net.rb +1 -1
  59. data/lib/ronin/network/extensions/smtp.rb +1 -1
  60. data/lib/ronin/network/extensions/smtp/net.rb +1 -1
  61. data/lib/ronin/network/extensions/ssl.rb +1 -1
  62. data/lib/ronin/network/extensions/ssl/net.rb +1 -1
  63. data/lib/ronin/network/extensions/tcp.rb +1 -1
  64. data/lib/ronin/network/extensions/tcp/net.rb +1 -1
  65. data/lib/ronin/network/extensions/telnet.rb +1 -1
  66. data/lib/ronin/network/extensions/telnet/net.rb +1 -1
  67. data/lib/ronin/network/extensions/udp.rb +1 -1
  68. data/lib/ronin/network/extensions/udp/net.rb +1 -1
  69. data/lib/ronin/network/http.rb +1 -1
  70. data/lib/ronin/network/http/exceptions.rb +1 -1
  71. data/lib/ronin/network/http/exceptions/unknown_request.rb +1 -1
  72. data/lib/ronin/network/http/http.rb +103 -72
  73. data/lib/ronin/network/http/proxy.rb +1 -1
  74. data/lib/ronin/network/imap.rb +1 -1
  75. data/lib/ronin/network/mixins.rb +1 -1
  76. data/lib/ronin/network/mixins/esmtp.rb +1 -1
  77. data/lib/ronin/network/mixins/http.rb +3 -3
  78. data/lib/ronin/network/mixins/imap.rb +1 -1
  79. data/lib/ronin/network/mixins/mixin.rb +1 -1
  80. data/lib/ronin/network/mixins/pop3.rb +1 -1
  81. data/lib/ronin/network/mixins/smtp.rb +1 -1
  82. data/lib/ronin/network/mixins/ssl.rb +144 -0
  83. data/lib/ronin/network/mixins/tcp.rb +6 -5
  84. data/lib/ronin/network/mixins/telnet.rb +1 -1
  85. data/lib/ronin/network/mixins/udp.rb +29 -3
  86. data/lib/ronin/network/network.rb +1 -1
  87. data/lib/ronin/network/pop3.rb +1 -1
  88. data/lib/ronin/network/smtp.rb +1 -1
  89. data/lib/ronin/network/smtp/email.rb +1 -1
  90. data/lib/ronin/network/smtp/smtp.rb +1 -1
  91. data/lib/ronin/network/ssl.rb +3 -6
  92. data/lib/ronin/network/tcp.rb +27 -28
  93. data/lib/ronin/network/telnet.rb +1 -1
  94. data/lib/ronin/network/udp.rb +56 -19
  95. data/lib/ronin/path.rb +1 -1
  96. data/lib/ronin/spec/ui/output.rb +1 -1
  97. data/lib/ronin/support.rb +1 -1
  98. data/lib/ronin/support/inflector.rb +1 -1
  99. data/lib/ronin/support/support.rb +1 -1
  100. data/lib/ronin/support/version.rb +2 -2
  101. data/lib/ronin/templates.rb +1 -1
  102. data/lib/ronin/templates/erb.rb +1 -1
  103. data/lib/ronin/templates/template.rb +1 -1
  104. data/lib/ronin/ui/output.rb +1 -1
  105. data/lib/ronin/ui/output/helpers.rb +1 -1
  106. data/lib/ronin/ui/output/output.rb +1 -1
  107. data/lib/ronin/ui/output/terminal.rb +1 -1
  108. data/lib/ronin/ui/output/terminal/color.rb +1 -1
  109. data/lib/ronin/ui/output/terminal/raw.rb +1 -1
  110. data/lib/ronin/ui/shell.rb +67 -7
  111. data/lib/ronin/wordlist.rb +51 -1
  112. data/spec/extensions/ip_addr_spec.rb +1 -1
  113. data/spec/network/http/http_spec.rb +193 -0
  114. data/spec/network/tcp_spec.rb +244 -0
  115. data/spec/network/udp_spec.rb +245 -0
  116. data/spec/spec_helper.rb +5 -0
  117. data/spec/ui/shell_spec.rb +7 -3
  118. data/spec/wordlist_spec.rb +25 -0
  119. metadata +35 -19
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright (c) 2006-2011 Hal Brodigan (postmodern.mod3 at gmail.com)
2
+ # Copyright (c) 2006-2012 Hal Brodigan (postmodern.mod3 at gmail.com)
3
3
  #
4
4
  # This file is part of Ronin Support.
5
5
  #
@@ -129,7 +129,7 @@ module Ronin
129
129
  new_options[:host] = url.host
130
130
  new_options[:port] = url.port
131
131
 
132
- new_options[:user] = url.user if url.user
132
+ new_options[:user] = url.user if url.user
133
133
  new_options[:password] = url.password if url.password
134
134
 
135
135
  new_options[:path] = unless url.path.empty?
@@ -137,7 +137,7 @@ module Ronin
137
137
  else
138
138
  '/'
139
139
  end
140
- new_options[:path] += "?#{url.query}" if url.query
140
+ new_options[:path] += "?#{URI.escape(url.query)}" if url.query
141
141
 
142
142
  return new_options
143
143
  end
@@ -256,6 +256,12 @@ module Ronin
256
256
  # @option options [String] :path ('/')
257
257
  # The path to request.
258
258
  #
259
+ # @option options [String] :query
260
+ # The query-string to append to the request path.
261
+ #
262
+ # @option options [String] :query_params
263
+ # The query-params to append to the request path.
264
+ #
259
265
  # @option options [String] :body
260
266
  # The body of the request.
261
267
  #
@@ -297,7 +303,21 @@ module Ronin
297
303
  end
298
304
 
299
305
  headers = HTTP.headers(options[:headers])
300
- path = (options[:path] || '/').to_s
306
+ path = (options[:path] || '/').to_s
307
+ query = if options[:query]
308
+ URI.escape(options[:query])
309
+ elsif options[:query_params]
310
+ URI::QueryParams.dump(options[:query_params])
311
+ end
312
+
313
+ if query
314
+ # append the query-string onto the path
315
+ path += if path.include?('?')
316
+ "&#{query}"
317
+ else
318
+ "?#{query}"
319
+ end
320
+ end
301
321
 
302
322
  request = Net::HTTP.const_get(name).new(path,headers)
303
323
 
@@ -309,12 +329,11 @@ module Ronin
309
329
  end
310
330
  end
311
331
 
312
- if (user = options.delete(:user))
313
- user = user.to_s
314
-
315
- if (password = options.delete(:password))
316
- password = password.to_s
317
- end
332
+ if options[:user]
333
+ user = options[:user].to_s
334
+ password = if options[:password]
335
+ options[:password].to_s
336
+ end
318
337
 
319
338
  request.basic_auth(user,password)
320
339
  end
@@ -352,11 +371,11 @@ module Ronin
352
371
  # @option :ssl [Symbol] :verify
353
372
  # Specifies the SSL certificate verification mode.
354
373
  #
355
- # @yield [session]
374
+ # @yield [http]
356
375
  # If a block is given, it will be passed the newly created HTTP
357
376
  # session object.
358
377
  #
359
- # @yieldparam [Net::HTTP] session
378
+ # @yieldparam [Net::HTTP] http
360
379
  # The newly created HTTP session.
361
380
  #
362
381
  # @return [Net::HTTP]
@@ -367,36 +386,36 @@ module Ronin
367
386
  def http_connect(options={},&block)
368
387
  options = HTTP.expand_options(options)
369
388
 
370
- host = options[:host].to_s
371
- port = options[:port]
389
+ host = options[:host].to_s
390
+ port = options[:port]
372
391
  proxy = options[:proxy]
373
392
  proxy_host = if (proxy && proxy[:host])
374
393
  proxy[:host].to_s
375
394
  end
376
395
 
377
- sess = Net::HTTP::Proxy(
396
+ http = Net::HTTP::Proxy(
378
397
  proxy_host,
379
398
  proxy[:port],
380
399
  proxy[:user],
381
400
  proxy[:password]
382
- ).new(host.to_s,port)
401
+ ).new(host,port)
383
402
 
384
403
  if options[:ssl]
385
- sess.use_ssl = true
386
- sess.verify_mode = SSL::VERIFY[options[:ssl][:verify]]
404
+ http.use_ssl = true
405
+ http.verify_mode = SSL::VERIFY[options[:ssl][:verify]]
387
406
  end
388
407
 
389
- sess.start()
408
+ http.start()
390
409
 
391
410
  if block
392
411
  if block.arity == 2
393
- block.call(sess,options)
412
+ block.call(http,options)
394
413
  else
395
- block.call(sess)
414
+ block.call(http)
396
415
  end
397
416
  end
398
417
 
399
- return sess
418
+ return http
400
419
  end
401
420
 
402
421
  #
@@ -429,11 +448,11 @@ module Ronin
429
448
  # @option :ssl [Symbol] :verify
430
449
  # Specifies the SSL certificate verification mode.
431
450
  #
432
- # @yield [session]
451
+ # @yield [http]
433
452
  # If a block is given, it will be passed the newly created HTTP
434
453
  # session object.
435
454
  #
436
- # @yieldparam [Net::HTTP] session
455
+ # @yieldparam [Net::HTTP] http
437
456
  # The newly created HTTP session.
438
457
  #
439
458
  # @return [nil]
@@ -443,16 +462,16 @@ module Ronin
443
462
  # @api public
444
463
  #
445
464
  def http_session(options={},&block)
446
- http_connect(options) do |sess,expanded_options|
465
+ http_connect(options) do |http,expanded_options|
447
466
  if block
448
467
  if block.arity == 2
449
- block.call(sess,expanded_options)
468
+ block.call(http,expanded_options)
450
469
  else
451
- block.call(sess)
470
+ block.call(http)
452
471
  end
453
472
  end
454
473
 
455
- sess.finish
474
+ http.finish
456
475
  end
457
476
 
458
477
  return nil
@@ -499,7 +518,7 @@ module Ronin
499
518
  # @api public
500
519
  #
501
520
  def http_request(options={},&block)
502
- resp = nil
521
+ response = nil
503
522
 
504
523
  http_session(options) do |http,expanded_options|
505
524
  req = HTTP.request(expanded_options)
@@ -512,10 +531,10 @@ module Ronin
512
531
  end
513
532
  end
514
533
 
515
- resp = http.request(req)
534
+ response = http.request(req)
516
535
  end
517
536
 
518
- return resp
537
+ return response
519
538
  end
520
539
 
521
540
  #
@@ -627,10 +646,10 @@ module Ronin
627
646
  # @api public
628
647
  #
629
648
  def http_copy(options={})
630
- resp = http_request(options.merge(:method => :copy))
649
+ response = http_request(options.merge(:method => :copy))
631
650
 
632
- yield resp if block_given?
633
- return resp
651
+ yield response if block_given?
652
+ return response
634
653
  end
635
654
 
636
655
  #
@@ -663,10 +682,10 @@ module Ronin
663
682
  options[:header].merge!(original_headers)
664
683
  end
665
684
 
666
- resp = http_request(options.merge(:method => :delete))
685
+ response = http_request(options.merge(:method => :delete))
667
686
 
668
- yield resp if block_given?
669
- return resp
687
+ yield response if block_given?
688
+ return response
670
689
  end
671
690
 
672
691
  #
@@ -690,10 +709,10 @@ module Ronin
690
709
  # @api public
691
710
  #
692
711
  def http_get(options={},&block)
693
- resp = http_request(options.merge(:method => :get))
712
+ response = http_request(options.merge(:method => :get))
694
713
 
695
- yield resp if block_given?
696
- return resp
714
+ yield response if block_given?
715
+ return response
697
716
  end
698
717
 
699
718
  #
@@ -712,7 +731,13 @@ module Ronin
712
731
  # @api public
713
732
  #
714
733
  def http_get_headers(options={})
715
- http_get(options).to_hash
734
+ headers = {}
735
+
736
+ http_get(options).each_header do |name,value|
737
+ headers[HTTP.header_name(name)] = value
738
+ end
739
+
740
+ return headers
716
741
  end
717
742
 
718
743
  #
@@ -753,10 +778,10 @@ module Ronin
753
778
  # @api public
754
779
  #
755
780
  def http_head(options={},&block)
756
- resp = http_request(options.merge(:method => :head))
781
+ response = http_request(options.merge(:method => :head))
757
782
 
758
- yield resp if block_given?
759
- return resp
783
+ yield response if block_given?
784
+ return response
760
785
  end
761
786
 
762
787
  #
@@ -780,10 +805,10 @@ module Ronin
780
805
  # @api public
781
806
  #
782
807
  def http_lock(options={},&block)
783
- resp = http_request(options.merge(:method => :lock))
808
+ response = http_request(options.merge(:method => :lock))
784
809
 
785
- yield resp if block_given?
786
- return resp
810
+ yield response if block_given?
811
+ return response
787
812
  end
788
813
 
789
814
  #
@@ -807,10 +832,10 @@ module Ronin
807
832
  # @api public
808
833
  #
809
834
  def http_mkcol(options={},&block)
810
- resp = http_request(options.merge(:method => :mkcol))
835
+ response = http_request(options.merge(:method => :mkcol))
811
836
 
812
- yield resp if block_given?
813
- return resp
837
+ yield response if block_given?
838
+ return response
814
839
  end
815
840
 
816
841
  #
@@ -834,10 +859,10 @@ module Ronin
834
859
  # @api public
835
860
  #
836
861
  def http_move(options={},&block)
837
- resp = http_request(options.merge(:method => :move))
862
+ response = http_request(options.merge(:method => :move))
838
863
 
839
- yield resp if block_given?
840
- return resp
864
+ yield response if block_given?
865
+ return response
841
866
  end
842
867
 
843
868
  #
@@ -861,10 +886,10 @@ module Ronin
861
886
  # @api public
862
887
  #
863
888
  def http_options(options={},&block)
864
- resp = http_request(options.merge(:method => :options))
889
+ response = http_request(options.merge(:method => :options))
865
890
 
866
- yield resp if block_given?
867
- return resp
891
+ yield response if block_given?
892
+ return response
868
893
  end
869
894
 
870
895
  #
@@ -891,10 +916,10 @@ module Ronin
891
916
  # @api public
892
917
  #
893
918
  def http_post(options={},&block)
894
- resp = http_request(options.merge(:method => :post))
919
+ response = http_request(options.merge(:method => :post))
895
920
 
896
- yield resp if block_given?
897
- return resp
921
+ yield response if block_given?
922
+ return response
898
923
  end
899
924
 
900
925
  #
@@ -916,7 +941,13 @@ module Ronin
916
941
  # @api public
917
942
  #
918
943
  def http_post_headers(options={})
919
- http_post(options).to_hash
944
+ headers = {}
945
+
946
+ http_post(options).each_header do |name,value|
947
+ headers[HTTP.header_name(name)] = value
948
+ end
949
+
950
+ return headers
920
951
  end
921
952
 
922
953
  #
@@ -969,10 +1000,10 @@ module Ronin
969
1000
  options[:header].merge!(original_headers)
970
1001
  end
971
1002
 
972
- resp = http_request(options.merge(:method => :propfind))
1003
+ response = http_request(options.merge(:method => :propfind))
973
1004
 
974
- yield resp if block_given?
975
- return resp
1005
+ yield response if block_given?
1006
+ return response
976
1007
  end
977
1008
 
978
1009
  #
@@ -996,10 +1027,10 @@ module Ronin
996
1027
  # @api public
997
1028
  #
998
1029
  def http_prop_patch(options={},&block)
999
- resp = http_request(options.merge(:method => :proppatch))
1030
+ response = http_request(options.merge(:method => :proppatch))
1000
1031
 
1001
- yield resp if block_given?
1002
- return resp
1032
+ yield response if block_given?
1033
+ return response
1003
1034
  end
1004
1035
 
1005
1036
  #
@@ -1023,10 +1054,10 @@ module Ronin
1023
1054
  # @api public
1024
1055
  #
1025
1056
  def http_trace(options={},&block)
1026
- resp = http_request(options.merge(:method => :trace))
1057
+ response = http_request(options.merge(:method => :trace))
1027
1058
 
1028
- yield resp if block_given?
1029
- return resp
1059
+ yield response if block_given?
1060
+ return response
1030
1061
  end
1031
1062
 
1032
1063
  #
@@ -1050,10 +1081,10 @@ module Ronin
1050
1081
  # @api public
1051
1082
  #
1052
1083
  def http_unlock(options={},&block)
1053
- resp = http_request(options.merge(:method => :unlock))
1084
+ response = http_request(options.merge(:method => :unlock))
1054
1085
 
1055
- yield resp if block_given?
1056
- return resp
1086
+ yield response if block_given?
1087
+ return response
1057
1088
  end
1058
1089
  end
1059
1090
  end