Last active
September 28, 2015 03:37
-
-
Save brianjolly/1378120 to your computer and use it in GitHub Desktop.
Revisions
-
brianjolly revised this gist
Jun 10, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ require 'colorize' device = 'en3' tracking_server = "your.tracking.server.com" IO.popen("sudo tcpdump -i #{device} -s 0 -l -w - port 80 and host #{tracking_server}").each do |line| begin -
brianjolly revised this gist
Jun 10, 2013 . 1 changed file with 37 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,29 +1,57 @@ #!/usr/bin/env ruby require 'uri' require 'cgi' require 'iconv' require 'date' require 'rubygems' require 'colorize' device = 'en3' tracking_server = "t.herceptin.com" IO.popen("sudo tcpdump -i #{device} -s 0 -l -w - port 80 and host #{tracking_server}").each do |line| begin ic = Iconv.new('UTF-8//IGNORE', 'UTF-8') valid_string = ic.iconv(line + ' ')[0..-2] rescue Iconv::InvalidCharacter=>e puts e end if valid_string match = valid_string.match(/GET (.*) HTTP/) end if match uri = URI.parse "#{tracking_server}#{match[1]}" uri_params = CGI.parse(uri.query) puts " " puts "--------------------------------------------------------------------------------" #uri_params.each_key { |key| puts "#{key} : #{uri_params[key]}" } uri_params.each_key { |key| case key when "t" puts "#{key} : #{uri_params[key]}".green when "c15" puts "#{key} : #{uri_params[key]}".yellow when "c35" puts "#{key} : #{uri_params[key]}".yellow when "c36" puts "#{key} : #{uri_params[key]}".yellow when "c37" puts "#{key} : #{uri_params[key]}".yellow when "events" puts "#{key} : #{uri_params[key]}".yellow when "pageName" puts "#{key} : #{uri_params[key]}".yellow when "pe" puts "#{key} : #{uri_params[key]}".yellow else puts "#{key} : #{uri_params[key]}" end } end end -
brianjolly created this gist
Nov 18, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ #!/usr/bin/env ruby require 'uri' require 'cgi' require 'iconv' require 'date' tracking_server = "your tracking server" IO.popen("sudo tcpdump -i en1 -s 0 -l -w - port 80 and host #{tracking_server}").each do |line| begin ic = Iconv.new('UTF-8//IGNORE', 'UTF-8') valid_string = ic.iconv(line + ' ')[0..-2] rescue Iconv::InvalidCharacter=>e puts e end if valid_string match = valid_string.match(/GET (.*) HTTP/) end if match uri = URI.parse "#{tracking_server}#{match[1]}" uri_params = CGI.parse(uri.query) uri_params.each_key { |key| puts "#{key} : #{uri_params[key]}" } end end