emonti-buby 1.1.4 → 1.1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/History.txt +5 -0
  2. data/buby.gemspec +1 -1
  3. data/lib/buby.rb +9 -3
  4. metadata +1 -1
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 1.1.4.1 / 2009-09-22
2
+ * fix
3
+ * Buby.harvest_cookies_from_history() was broken.
4
+ It now implements select() block semantics and always returns an array.
5
+
1
6
  == 1.1.4 / 2009-09-14
2
7
  * enhancements
3
8
  * buby got implants! (har har)
data/buby.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{buby}
5
- s.version = "1.1.4"
5
+ s.version = "1.1.4.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Eric Monti - Matasano Security"]
data/lib/buby.rb CHANGED
@@ -644,12 +644,18 @@ class Buby
644
644
  # urlrx = optional: regular expression to match urls against
645
645
  # statefile = optional: filename for a burp session file to temporarily load
646
646
  # and harvest from.
647
+ #
648
+ # Takes an optional block as additional 'select' criteria for cookies.
649
+ # The block return value of true/false will determine whether a cookie is
650
+ # string is selected.
647
651
  def harvest_cookies_from_history(cookie=nil, urlrx=nil, statefile=nil)
648
652
  ret = []
649
653
  search_proxy_history(statefile, urlrx) do |hrr|
650
- ret += hrr.rsp_headers.select do |h|
651
- h[0].downcase == 'set-cookie'
652
- end.map{|h| h[1]}
654
+ if heads=hrr.rsp_headers
655
+ ret += heads.select do |h|
656
+ h[0].downcase == 'set-cookie' and (not block_given? or yield(h[1]))
657
+ end.map{|h| h[1]}
658
+ end
653
659
  end
654
660
  return ret
655
661
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emonti-buby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Monti - Matasano Security