pcapr-local 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. data/.document +5 -0
  2. data/LICENSE.txt +20 -0
  3. data/README.md +64 -0
  4. data/Rakefile +57 -0
  5. data/VERSION +1 -0
  6. data/bin/pcap2par +49 -0
  7. data/bin/startpcapr +40 -0
  8. data/bin/stoppcapr +33 -0
  9. data/bin/xtractr +5 -0
  10. data/lib/environment.rb +106 -0
  11. data/lib/exe/xtractr +0 -0
  12. data/lib/mu/pcap.rb +110 -0
  13. data/lib/mu/pcap/ethernet.rb +148 -0
  14. data/lib/mu/pcap/header.rb +75 -0
  15. data/lib/mu/pcap/io_pair.rb +67 -0
  16. data/lib/mu/pcap/io_wrapper.rb +76 -0
  17. data/lib/mu/pcap/ip.rb +61 -0
  18. data/lib/mu/pcap/ipv4.rb +257 -0
  19. data/lib/mu/pcap/ipv6.rb +148 -0
  20. data/lib/mu/pcap/packet.rb +104 -0
  21. data/lib/mu/pcap/pkthdr.rb +155 -0
  22. data/lib/mu/pcap/reader.rb +61 -0
  23. data/lib/mu/pcap/reader/http_family.rb +170 -0
  24. data/lib/mu/pcap/sctp.rb +367 -0
  25. data/lib/mu/pcap/sctp/chunk.rb +123 -0
  26. data/lib/mu/pcap/sctp/chunk/data.rb +134 -0
  27. data/lib/mu/pcap/sctp/chunk/init.rb +100 -0
  28. data/lib/mu/pcap/sctp/chunk/init_ack.rb +68 -0
  29. data/lib/mu/pcap/sctp/parameter.rb +110 -0
  30. data/lib/mu/pcap/sctp/parameter/ip_address.rb +48 -0
  31. data/lib/mu/pcap/stream_packetizer.rb +72 -0
  32. data/lib/mu/pcap/tcp.rb +505 -0
  33. data/lib/mu/pcap/udp.rb +69 -0
  34. data/lib/mu/scenario/pcap.rb +164 -0
  35. data/lib/mu/scenario/pcap/fields.rb +50 -0
  36. data/lib/mu/scenario/pcap/rtp.rb +71 -0
  37. data/lib/pcapr_local.rb +159 -0
  38. data/lib/pcapr_local/config.rb +336 -0
  39. data/lib/pcapr_local/db.rb +197 -0
  40. data/lib/pcapr_local/scanner.rb +250 -0
  41. data/lib/pcapr_local/server.rb +178 -0
  42. data/lib/pcapr_local/www/favicon.ico +0 -0
  43. data/lib/pcapr_local/www/favicon.png +0 -0
  44. data/lib/pcapr_local/www/home/index.html +138 -0
  45. data/lib/pcapr_local/www/static/image/16x16/Cancel.png +0 -0
  46. data/lib/pcapr_local/www/static/image/16x16/Cancel.png.1 +0 -0
  47. data/lib/pcapr_local/www/static/image/16x16/Download.png +0 -0
  48. data/lib/pcapr_local/www/static/image/16x16/Folder3.png +0 -0
  49. data/lib/pcapr_local/www/static/image/16x16/Full Size.png +0 -0
  50. data/lib/pcapr_local/www/static/image/16x16/Minus.png +0 -0
  51. data/lib/pcapr_local/www/static/image/16x16/Plus.png +0 -0
  52. data/lib/pcapr_local/www/static/image/16x16/Search.png +0 -0
  53. data/lib/pcapr_local/www/static/image/16x16/User.png +0 -0
  54. data/lib/pcapr_local/www/static/image/48x48/Phone.png +0 -0
  55. data/lib/pcapr_local/www/static/image/48x48/Video.png +0 -0
  56. data/lib/pcapr_local/www/static/image/bar-orange.gif +0 -0
  57. data/lib/pcapr_local/www/static/image/beta.png +0 -0
  58. data/lib/pcapr_local/www/static/image/bg.png +0 -0
  59. data/lib/pcapr_local/www/static/image/blockquote.png +0 -0
  60. data/lib/pcapr_local/www/static/image/body-bg.png +0 -0
  61. data/lib/pcapr_local/www/static/image/body-h3.png +0 -0
  62. data/lib/pcapr_local/www/static/image/body-hl1-bg.png +0 -0
  63. data/lib/pcapr_local/www/static/image/body-hl1-h3.png +0 -0
  64. data/lib/pcapr_local/www/static/image/body-hl1-readmore.png +0 -0
  65. data/lib/pcapr_local/www/static/image/body-hl2-bg.png +0 -0
  66. data/lib/pcapr_local/www/static/image/body-hl2-h3.png +0 -0
  67. data/lib/pcapr_local/www/static/image/body-hl2-readmore.png +0 -0
  68. data/lib/pcapr_local/www/static/image/body-hl3-bg.png +0 -0
  69. data/lib/pcapr_local/www/static/image/body-hl3-h3.png +0 -0
  70. data/lib/pcapr_local/www/static/image/body-hl3-readmore.png +0 -0
  71. data/lib/pcapr_local/www/static/image/body-hl4-bg.png +0 -0
  72. data/lib/pcapr_local/www/static/image/body-hl4-h3.png +0 -0
  73. data/lib/pcapr_local/www/static/image/body-hl4-readmore.png +0 -0
  74. data/lib/pcapr_local/www/static/image/body-hl5-h3.png +0 -0
  75. data/lib/pcapr_local/www/static/image/body-hl6-h3.png +0 -0
  76. data/lib/pcapr_local/www/static/image/body-hl7-h3.png +0 -0
  77. data/lib/pcapr_local/www/static/image/body-hl8-h3.png +0 -0
  78. data/lib/pcapr_local/www/static/image/body-readmore.png +0 -0
  79. data/lib/pcapr_local/www/static/image/bottom-bg.png +0 -0
  80. data/lib/pcapr_local/www/static/image/bottom-l.png +0 -0
  81. data/lib/pcapr_local/www/static/image/bottom-r.png +0 -0
  82. data/lib/pcapr_local/www/static/image/btn-search.png +0 -0
  83. data/lib/pcapr_local/www/static/image/bullet-1.png +0 -0
  84. data/lib/pcapr_local/www/static/image/bullet-2.png +0 -0
  85. data/lib/pcapr_local/www/static/image/bullet-3.png +0 -0
  86. data/lib/pcapr_local/www/static/image/bullet-4.png +0 -0
  87. data/lib/pcapr_local/www/static/image/bullet-5.png +0 -0
  88. data/lib/pcapr_local/www/static/image/bullet-6.png +0 -0
  89. data/lib/pcapr_local/www/static/image/bullet-7.png +0 -0
  90. data/lib/pcapr_local/www/static/image/bullet-hl1.png +0 -0
  91. data/lib/pcapr_local/www/static/image/bullet-hl2.png +0 -0
  92. data/lib/pcapr_local/www/static/image/bullet-hl3.png +0 -0
  93. data/lib/pcapr_local/www/static/image/bullet-hl4.png +0 -0
  94. data/lib/pcapr_local/www/static/image/bullet-pathway.png +0 -0
  95. data/lib/pcapr_local/www/static/image/bullet-section1.png +0 -0
  96. data/lib/pcapr_local/www/static/image/bullet-section2.png +0 -0
  97. data/lib/pcapr_local/www/static/image/collapsed.gif +0 -0
  98. data/lib/pcapr_local/www/static/image/crosslink.png +0 -0
  99. data/lib/pcapr_local/www/static/image/expanded.gif +0 -0
  100. data/lib/pcapr_local/www/static/image/favicon.ico +0 -0
  101. data/lib/pcapr_local/www/static/image/favicon.png +0 -0
  102. data/lib/pcapr_local/www/static/image/icon-author.png +0 -0
  103. data/lib/pcapr_local/www/static/image/icon-created.png +0 -0
  104. data/lib/pcapr_local/www/static/image/p-expand.gif +0 -0
  105. data/lib/pcapr_local/www/static/image/pcapr-logo.png +0 -0
  106. data/lib/pcapr_local/www/static/image/powered-by.png +0 -0
  107. data/lib/pcapr_local/www/static/image/section1-bg.png +0 -0
  108. data/lib/pcapr_local/www/static/image/section1-h3.png +0 -0
  109. data/lib/pcapr_local/www/static/image/section1-readmore.png +0 -0
  110. data/lib/pcapr_local/www/static/image/section2-bg.png +0 -0
  111. data/lib/pcapr_local/www/static/image/section2-h3.png +0 -0
  112. data/lib/pcapr_local/www/static/image/section2-readmore.png +0 -0
  113. data/lib/pcapr_local/www/static/image/status-alert.png +0 -0
  114. data/lib/pcapr_local/www/static/image/status-download.png +0 -0
  115. data/lib/pcapr_local/www/static/image/status-info.png +0 -0
  116. data/lib/pcapr_local/www/static/image/status-note.png +0 -0
  117. data/lib/pcapr_local/www/static/image/tab-round.png +0 -0
  118. data/lib/pcapr_local/www/static/image/throbber.gif +0 -0
  119. data/lib/pcapr_local/www/static/image/user.jpg +0 -0
  120. data/lib/pcapr_local/www/static/script/closet/async.js +421 -0
  121. data/lib/pcapr_local/www/static/script/closet/closet.api.js +241 -0
  122. data/lib/pcapr_local/www/static/script/closet/closet.folders.js +94 -0
  123. data/lib/pcapr_local/www/static/script/closet/closet.js +187 -0
  124. data/lib/pcapr_local/www/static/script/closet/closet.mr.js +219 -0
  125. data/lib/pcapr_local/www/static/script/closet/closet.options.js +359 -0
  126. data/lib/pcapr_local/www/static/script/closet/closet.quantity.js +73 -0
  127. data/lib/pcapr_local/www/static/script/closet/closet.render.js +205 -0
  128. data/lib/pcapr_local/www/static/script/closet/closet.report.js +86 -0
  129. data/lib/pcapr_local/www/static/script/closet/closet.reports.http.js +135 -0
  130. data/lib/pcapr_local/www/static/script/closet/closet.reports.overview.js +163 -0
  131. data/lib/pcapr_local/www/static/script/closet/closet.reports.sip.js +159 -0
  132. data/lib/pcapr_local/www/static/script/closet/closet.reports.tcp.js +72 -0
  133. data/lib/pcapr_local/www/static/script/closet/closet.reports.visualize.js +263 -0
  134. data/lib/pcapr_local/www/static/script/closet/closet.util.js +40 -0
  135. data/lib/pcapr_local/www/static/script/jquery/jquery-1.4.2.min.js +154 -0
  136. data/lib/pcapr_local/www/static/script/jquery/jquery-ui.js +10921 -0
  137. data/lib/pcapr_local/www/static/script/jquery/jquery.flot.js +2123 -0
  138. data/lib/pcapr_local/www/static/script/jquery/jquery.flot.selection.js +184 -0
  139. data/lib/pcapr_local/www/static/script/jquery/jquery.flot.stack.js +184 -0
  140. data/lib/pcapr_local/www/static/script/jquery/jquery.form.js +643 -0
  141. data/lib/pcapr_local/www/static/script/jquery/jquery.jsonp.min.js +3 -0
  142. data/lib/pcapr_local/www/static/script/jquery/jquery.menu.js +142 -0
  143. data/lib/pcapr_local/www/static/script/jquery/jquery.suggest.js +308 -0
  144. data/lib/pcapr_local/www/static/script/jquery/jquery.ui.core.js +203 -0
  145. data/lib/pcapr_local/www/static/script/jquery/jquery.ui.slider.js +629 -0
  146. data/lib/pcapr_local/www/static/script/jquery/jquery.ui.sortable.js +1055 -0
  147. data/lib/pcapr_local/www/static/script/jquery/jquery.ui.widget.js +236 -0
  148. data/lib/pcapr_local/www/static/script/json2.js +481 -0
  149. data/lib/pcapr_local/www/static/script/sammy/plugins/sammy.cache.js +115 -0
  150. data/lib/pcapr_local/www/static/script/sammy/plugins/sammy.template.js +117 -0
  151. data/lib/pcapr_local/www/static/script/sammy/sammy.js +1696 -0
  152. data/lib/pcapr_local/www/static/script/tipsy/jquery.tipsy.js +104 -0
  153. data/lib/pcapr_local/www/static/style/c3p0.css +116 -0
  154. data/lib/pcapr_local/www/static/style/jquery.suggest.css +27 -0
  155. data/lib/pcapr_local/www/static/style/page.css +1113 -0
  156. data/lib/pcapr_local/www/static/style/tipsy.css +7 -0
  157. data/lib/pcapr_local/www/templates/browse.services.template +10 -0
  158. data/lib/pcapr_local/www/templates/browse.template +77 -0
  159. data/lib/pcapr_local/www/templates/flows.template +38 -0
  160. data/lib/pcapr_local/www/templates/pcap.template +63 -0
  161. data/lib/pcapr_local/www/templates/sip.calls.template +35 -0
  162. data/lib/pcapr_local/www/templates/statistics.template +6 -0
  163. data/lib/pcapr_local/xtractr.rb +179 -0
  164. data/lib/pcapr_local/xtractr/instance.rb +172 -0
  165. data/pcapr-local.gemspec +297 -0
  166. data/test/mu/pcap/reader/tc_http_family.rb +251 -0
  167. data/test/mu/pcap/tc_ethernet.rb +71 -0
  168. data/test/mu/pcap/tc_header.rb +56 -0
  169. data/test/mu/pcap/tc_ipv4.rb +103 -0
  170. data/test/mu/pcap/tc_ipv6.rb +83 -0
  171. data/test/mu/pcap/tc_packet.rb +44 -0
  172. data/test/mu/pcap/tc_pair.rb +58 -0
  173. data/test/mu/pcap/tc_pkthdr.rb +33 -0
  174. data/test/mu/pcap/tc_reader.rb +76 -0
  175. data/test/mu/pcap/tc_tcp.rb +426 -0
  176. data/test/mu/pcap/tc_udp.rb +33 -0
  177. data/test/mu/pcap/tc_wrapper.rb +80 -0
  178. data/test/mu/scenario/pcap/tc_fields.rb +67 -0
  179. data/test/mu/scenario/pcap/tc_rtp.rb +135 -0
  180. data/test/mu/scenario/sip_signalled_call_1.pcap +0 -0
  181. data/test/mu/scenario/tc_pcap.rb +190 -0
  182. data/test/mu/scenario/test_data/arp.pcap +0 -0
  183. data/test/mu/scenario/test_data/dns.pcap +0 -0
  184. data/test/mu/scenario/test_data/http-v6.pcap +0 -0
  185. data/test/mu/scenario/test_data/http.pcap +0 -0
  186. data/test/mu/scenario/test_data/http_chunked.pcap +0 -0
  187. data/test/mu/scenario/test_data/http_deflate.pcap +0 -0
  188. data/test/mu/scenario/test_data/httpauth3.pcap +0 -0
  189. data/test/mu/scenario/test_data/icmp.pcap +0 -0
  190. data/test/mu/scenario/test_data/sip_signalled_call_1.pcap +0 -0
  191. data/test/mu/tc_pcap.rb +39 -0
  192. data/test/mu/testcase.rb +86 -0
  193. data/test/pcapr_local/arp.pcap +0 -0
  194. data/test/pcapr_local/data.js +3 -0
  195. data/test/pcapr_local/http_chunked.pcap +0 -0
  196. data/test/pcapr_local/tc_api.rb +181 -0
  197. data/test/pcapr_local/test.tgz +0 -0
  198. data/test/pcapr_local/test_scanner.rb +241 -0
  199. data/test/pcapr_local/test_xtractr.rb +219 -0
  200. data/test/pcapr_local/testcase.rb +107 -0
  201. data/test/test_export_to_scenario.sh +25 -0
  202. data/test/test_pcapr_local.rb +29 -0
  203. metadata +450 -0
@@ -0,0 +1,297 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{pcapr-local}
8
+ s.version = "0.1.10"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Mu Dynamics"]
12
+ s.date = %q{2011-03-31}
13
+ s.description = %q{Index, Browse, and Query your vast pcap collection.}
14
+ s.email = %q{nbaggott@gmail.com}
15
+ s.executables = ["pcap2par", "startpcapr", "stoppcapr", "xtractr"]
16
+ s.extra_rdoc_files = [
17
+ "LICENSE.txt",
18
+ "README.md"
19
+ ]
20
+ s.files = [
21
+ ".document",
22
+ "LICENSE.txt",
23
+ "README.md",
24
+ "Rakefile",
25
+ "VERSION",
26
+ "bin/pcap2par",
27
+ "bin/startpcapr",
28
+ "bin/stoppcapr",
29
+ "bin/xtractr",
30
+ "lib/environment.rb",
31
+ "lib/exe/xtractr",
32
+ "lib/mu/pcap.rb",
33
+ "lib/mu/pcap/ethernet.rb",
34
+ "lib/mu/pcap/header.rb",
35
+ "lib/mu/pcap/io_pair.rb",
36
+ "lib/mu/pcap/io_wrapper.rb",
37
+ "lib/mu/pcap/ip.rb",
38
+ "lib/mu/pcap/ipv4.rb",
39
+ "lib/mu/pcap/ipv6.rb",
40
+ "lib/mu/pcap/packet.rb",
41
+ "lib/mu/pcap/pkthdr.rb",
42
+ "lib/mu/pcap/reader.rb",
43
+ "lib/mu/pcap/reader/http_family.rb",
44
+ "lib/mu/pcap/sctp.rb",
45
+ "lib/mu/pcap/sctp/chunk.rb",
46
+ "lib/mu/pcap/sctp/chunk/data.rb",
47
+ "lib/mu/pcap/sctp/chunk/init.rb",
48
+ "lib/mu/pcap/sctp/chunk/init_ack.rb",
49
+ "lib/mu/pcap/sctp/parameter.rb",
50
+ "lib/mu/pcap/sctp/parameter/ip_address.rb",
51
+ "lib/mu/pcap/stream_packetizer.rb",
52
+ "lib/mu/pcap/tcp.rb",
53
+ "lib/mu/pcap/udp.rb",
54
+ "lib/mu/scenario/pcap.rb",
55
+ "lib/mu/scenario/pcap/fields.rb",
56
+ "lib/mu/scenario/pcap/rtp.rb",
57
+ "lib/pcapr_local.rb",
58
+ "lib/pcapr_local/config.rb",
59
+ "lib/pcapr_local/db.rb",
60
+ "lib/pcapr_local/scanner.rb",
61
+ "lib/pcapr_local/server.rb",
62
+ "lib/pcapr_local/www/favicon.ico",
63
+ "lib/pcapr_local/www/favicon.png",
64
+ "lib/pcapr_local/www/home/index.html",
65
+ "lib/pcapr_local/www/static/image/16x16/Cancel.png",
66
+ "lib/pcapr_local/www/static/image/16x16/Cancel.png.1",
67
+ "lib/pcapr_local/www/static/image/16x16/Download.png",
68
+ "lib/pcapr_local/www/static/image/16x16/Folder3.png",
69
+ "lib/pcapr_local/www/static/image/16x16/Full Size.png",
70
+ "lib/pcapr_local/www/static/image/16x16/Minus.png",
71
+ "lib/pcapr_local/www/static/image/16x16/Plus.png",
72
+ "lib/pcapr_local/www/static/image/16x16/Search.png",
73
+ "lib/pcapr_local/www/static/image/16x16/User.png",
74
+ "lib/pcapr_local/www/static/image/48x48/Phone.png",
75
+ "lib/pcapr_local/www/static/image/48x48/Video.png",
76
+ "lib/pcapr_local/www/static/image/bar-orange.gif",
77
+ "lib/pcapr_local/www/static/image/beta.png",
78
+ "lib/pcapr_local/www/static/image/bg.png",
79
+ "lib/pcapr_local/www/static/image/blockquote.png",
80
+ "lib/pcapr_local/www/static/image/body-bg.png",
81
+ "lib/pcapr_local/www/static/image/body-h3.png",
82
+ "lib/pcapr_local/www/static/image/body-hl1-bg.png",
83
+ "lib/pcapr_local/www/static/image/body-hl1-h3.png",
84
+ "lib/pcapr_local/www/static/image/body-hl1-readmore.png",
85
+ "lib/pcapr_local/www/static/image/body-hl2-bg.png",
86
+ "lib/pcapr_local/www/static/image/body-hl2-h3.png",
87
+ "lib/pcapr_local/www/static/image/body-hl2-readmore.png",
88
+ "lib/pcapr_local/www/static/image/body-hl3-bg.png",
89
+ "lib/pcapr_local/www/static/image/body-hl3-h3.png",
90
+ "lib/pcapr_local/www/static/image/body-hl3-readmore.png",
91
+ "lib/pcapr_local/www/static/image/body-hl4-bg.png",
92
+ "lib/pcapr_local/www/static/image/body-hl4-h3.png",
93
+ "lib/pcapr_local/www/static/image/body-hl4-readmore.png",
94
+ "lib/pcapr_local/www/static/image/body-hl5-h3.png",
95
+ "lib/pcapr_local/www/static/image/body-hl6-h3.png",
96
+ "lib/pcapr_local/www/static/image/body-hl7-h3.png",
97
+ "lib/pcapr_local/www/static/image/body-hl8-h3.png",
98
+ "lib/pcapr_local/www/static/image/body-readmore.png",
99
+ "lib/pcapr_local/www/static/image/bottom-bg.png",
100
+ "lib/pcapr_local/www/static/image/bottom-l.png",
101
+ "lib/pcapr_local/www/static/image/bottom-r.png",
102
+ "lib/pcapr_local/www/static/image/btn-search.png",
103
+ "lib/pcapr_local/www/static/image/bullet-1.png",
104
+ "lib/pcapr_local/www/static/image/bullet-2.png",
105
+ "lib/pcapr_local/www/static/image/bullet-3.png",
106
+ "lib/pcapr_local/www/static/image/bullet-4.png",
107
+ "lib/pcapr_local/www/static/image/bullet-5.png",
108
+ "lib/pcapr_local/www/static/image/bullet-6.png",
109
+ "lib/pcapr_local/www/static/image/bullet-7.png",
110
+ "lib/pcapr_local/www/static/image/bullet-hl1.png",
111
+ "lib/pcapr_local/www/static/image/bullet-hl2.png",
112
+ "lib/pcapr_local/www/static/image/bullet-hl3.png",
113
+ "lib/pcapr_local/www/static/image/bullet-hl4.png",
114
+ "lib/pcapr_local/www/static/image/bullet-pathway.png",
115
+ "lib/pcapr_local/www/static/image/bullet-section1.png",
116
+ "lib/pcapr_local/www/static/image/bullet-section2.png",
117
+ "lib/pcapr_local/www/static/image/collapsed.gif",
118
+ "lib/pcapr_local/www/static/image/crosslink.png",
119
+ "lib/pcapr_local/www/static/image/expanded.gif",
120
+ "lib/pcapr_local/www/static/image/favicon.ico",
121
+ "lib/pcapr_local/www/static/image/favicon.png",
122
+ "lib/pcapr_local/www/static/image/icon-author.png",
123
+ "lib/pcapr_local/www/static/image/icon-created.png",
124
+ "lib/pcapr_local/www/static/image/p-expand.gif",
125
+ "lib/pcapr_local/www/static/image/pcapr-logo.png",
126
+ "lib/pcapr_local/www/static/image/powered-by.png",
127
+ "lib/pcapr_local/www/static/image/section1-bg.png",
128
+ "lib/pcapr_local/www/static/image/section1-h3.png",
129
+ "lib/pcapr_local/www/static/image/section1-readmore.png",
130
+ "lib/pcapr_local/www/static/image/section2-bg.png",
131
+ "lib/pcapr_local/www/static/image/section2-h3.png",
132
+ "lib/pcapr_local/www/static/image/section2-readmore.png",
133
+ "lib/pcapr_local/www/static/image/status-alert.png",
134
+ "lib/pcapr_local/www/static/image/status-download.png",
135
+ "lib/pcapr_local/www/static/image/status-info.png",
136
+ "lib/pcapr_local/www/static/image/status-note.png",
137
+ "lib/pcapr_local/www/static/image/tab-round.png",
138
+ "lib/pcapr_local/www/static/image/throbber.gif",
139
+ "lib/pcapr_local/www/static/image/user.jpg",
140
+ "lib/pcapr_local/www/static/script/closet/async.js",
141
+ "lib/pcapr_local/www/static/script/closet/closet.api.js",
142
+ "lib/pcapr_local/www/static/script/closet/closet.folders.js",
143
+ "lib/pcapr_local/www/static/script/closet/closet.js",
144
+ "lib/pcapr_local/www/static/script/closet/closet.mr.js",
145
+ "lib/pcapr_local/www/static/script/closet/closet.options.js",
146
+ "lib/pcapr_local/www/static/script/closet/closet.quantity.js",
147
+ "lib/pcapr_local/www/static/script/closet/closet.render.js",
148
+ "lib/pcapr_local/www/static/script/closet/closet.report.js",
149
+ "lib/pcapr_local/www/static/script/closet/closet.reports.http.js",
150
+ "lib/pcapr_local/www/static/script/closet/closet.reports.overview.js",
151
+ "lib/pcapr_local/www/static/script/closet/closet.reports.sip.js",
152
+ "lib/pcapr_local/www/static/script/closet/closet.reports.tcp.js",
153
+ "lib/pcapr_local/www/static/script/closet/closet.reports.visualize.js",
154
+ "lib/pcapr_local/www/static/script/closet/closet.util.js",
155
+ "lib/pcapr_local/www/static/script/jquery/jquery-1.4.2.min.js",
156
+ "lib/pcapr_local/www/static/script/jquery/jquery-ui.js",
157
+ "lib/pcapr_local/www/static/script/jquery/jquery.flot.js",
158
+ "lib/pcapr_local/www/static/script/jquery/jquery.flot.selection.js",
159
+ "lib/pcapr_local/www/static/script/jquery/jquery.flot.stack.js",
160
+ "lib/pcapr_local/www/static/script/jquery/jquery.form.js",
161
+ "lib/pcapr_local/www/static/script/jquery/jquery.jsonp.min.js",
162
+ "lib/pcapr_local/www/static/script/jquery/jquery.menu.js",
163
+ "lib/pcapr_local/www/static/script/jquery/jquery.suggest.js",
164
+ "lib/pcapr_local/www/static/script/jquery/jquery.ui.core.js",
165
+ "lib/pcapr_local/www/static/script/jquery/jquery.ui.slider.js",
166
+ "lib/pcapr_local/www/static/script/jquery/jquery.ui.sortable.js",
167
+ "lib/pcapr_local/www/static/script/jquery/jquery.ui.widget.js",
168
+ "lib/pcapr_local/www/static/script/json2.js",
169
+ "lib/pcapr_local/www/static/script/sammy/plugins/sammy.cache.js",
170
+ "lib/pcapr_local/www/static/script/sammy/plugins/sammy.template.js",
171
+ "lib/pcapr_local/www/static/script/sammy/sammy.js",
172
+ "lib/pcapr_local/www/static/script/tipsy/jquery.tipsy.js",
173
+ "lib/pcapr_local/www/static/style/c3p0.css",
174
+ "lib/pcapr_local/www/static/style/jquery.suggest.css",
175
+ "lib/pcapr_local/www/static/style/page.css",
176
+ "lib/pcapr_local/www/static/style/tipsy.css",
177
+ "lib/pcapr_local/www/templates/browse.services.template",
178
+ "lib/pcapr_local/www/templates/browse.template",
179
+ "lib/pcapr_local/www/templates/flows.template",
180
+ "lib/pcapr_local/www/templates/pcap.template",
181
+ "lib/pcapr_local/www/templates/sip.calls.template",
182
+ "lib/pcapr_local/www/templates/statistics.template",
183
+ "lib/pcapr_local/xtractr.rb",
184
+ "lib/pcapr_local/xtractr/instance.rb",
185
+ "pcapr-local.gemspec",
186
+ "test/mu/pcap/reader/tc_http_family.rb",
187
+ "test/mu/pcap/tc_ethernet.rb",
188
+ "test/mu/pcap/tc_header.rb",
189
+ "test/mu/pcap/tc_ipv4.rb",
190
+ "test/mu/pcap/tc_ipv6.rb",
191
+ "test/mu/pcap/tc_packet.rb",
192
+ "test/mu/pcap/tc_pair.rb",
193
+ "test/mu/pcap/tc_pkthdr.rb",
194
+ "test/mu/pcap/tc_reader.rb",
195
+ "test/mu/pcap/tc_tcp.rb",
196
+ "test/mu/pcap/tc_udp.rb",
197
+ "test/mu/pcap/tc_wrapper.rb",
198
+ "test/mu/scenario/pcap/tc_fields.rb",
199
+ "test/mu/scenario/pcap/tc_rtp.rb",
200
+ "test/mu/scenario/sip_signalled_call_1.pcap",
201
+ "test/mu/scenario/tc_pcap.rb",
202
+ "test/mu/scenario/test_data/arp.pcap",
203
+ "test/mu/scenario/test_data/dns.pcap",
204
+ "test/mu/scenario/test_data/http-v6.pcap",
205
+ "test/mu/scenario/test_data/http.pcap",
206
+ "test/mu/scenario/test_data/http_chunked.pcap",
207
+ "test/mu/scenario/test_data/http_deflate.pcap",
208
+ "test/mu/scenario/test_data/httpauth3.pcap",
209
+ "test/mu/scenario/test_data/icmp.pcap",
210
+ "test/mu/scenario/test_data/sip_signalled_call_1.pcap",
211
+ "test/mu/tc_pcap.rb",
212
+ "test/mu/testcase.rb",
213
+ "test/pcapr_local/arp.pcap",
214
+ "test/pcapr_local/data.js",
215
+ "test/pcapr_local/http_chunked.pcap",
216
+ "test/pcapr_local/tc_api.rb",
217
+ "test/pcapr_local/test.tgz",
218
+ "test/pcapr_local/test_scanner.rb",
219
+ "test/pcapr_local/test_xtractr.rb",
220
+ "test/pcapr_local/testcase.rb",
221
+ "test/test_export_to_scenario.sh",
222
+ "test/test_pcapr_local.rb"
223
+ ]
224
+ s.homepage = %q{http://github.com/pcapr-local/pcapr-local}
225
+ s.licenses = ["MIT"]
226
+ s.require_paths = ["lib"]
227
+ s.rubygems_version = %q{1.3.7}
228
+ s.summary = %q{Manage your pcap collection}
229
+ s.test_files = [
230
+ "test/mu/pcap/reader/tc_http_family.rb",
231
+ "test/mu/pcap/tc_ethernet.rb",
232
+ "test/mu/pcap/tc_header.rb",
233
+ "test/mu/pcap/tc_ipv4.rb",
234
+ "test/mu/pcap/tc_ipv6.rb",
235
+ "test/mu/pcap/tc_packet.rb",
236
+ "test/mu/pcap/tc_pair.rb",
237
+ "test/mu/pcap/tc_pkthdr.rb",
238
+ "test/mu/pcap/tc_reader.rb",
239
+ "test/mu/pcap/tc_tcp.rb",
240
+ "test/mu/pcap/tc_udp.rb",
241
+ "test/mu/pcap/tc_wrapper.rb",
242
+ "test/mu/scenario/pcap/tc_fields.rb",
243
+ "test/mu/scenario/pcap/tc_rtp.rb",
244
+ "test/mu/scenario/tc_pcap.rb",
245
+ "test/mu/tc_pcap.rb",
246
+ "test/mu/testcase.rb",
247
+ "test/pcapr_local/tc_api.rb",
248
+ "test/pcapr_local/test_scanner.rb",
249
+ "test/pcapr_local/test_xtractr.rb",
250
+ "test/pcapr_local/testcase.rb",
251
+ "test/test_pcapr_local.rb"
252
+ ]
253
+
254
+ if s.respond_to? :specification_version then
255
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
256
+ s.specification_version = 3
257
+
258
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
259
+ s.add_runtime_dependency(%q<rest-client>, [">= 1.6.1"])
260
+ s.add_runtime_dependency(%q<couchrest>, ["~> 1.0.1"])
261
+ s.add_runtime_dependency(%q<sinatra>, ["~> 1.1.0"])
262
+ s.add_runtime_dependency(%q<json>, [">= 1.4.6"])
263
+ s.add_runtime_dependency(%q<thin>, ["~> 1.2.7"])
264
+ s.add_runtime_dependency(%q<rack>, ["~> 1.2.1"])
265
+ s.add_runtime_dependency(%q<rack-contrib>, ["~> 1.1.0"])
266
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
267
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
268
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
269
+ s.add_development_dependency(%q<rcov>, [">= 0"])
270
+ else
271
+ s.add_dependency(%q<rest-client>, [">= 1.6.1"])
272
+ s.add_dependency(%q<couchrest>, ["~> 1.0.1"])
273
+ s.add_dependency(%q<sinatra>, ["~> 1.1.0"])
274
+ s.add_dependency(%q<json>, [">= 1.4.6"])
275
+ s.add_dependency(%q<thin>, ["~> 1.2.7"])
276
+ s.add_dependency(%q<rack>, ["~> 1.2.1"])
277
+ s.add_dependency(%q<rack-contrib>, ["~> 1.1.0"])
278
+ s.add_dependency(%q<shoulda>, [">= 0"])
279
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
280
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
281
+ s.add_dependency(%q<rcov>, [">= 0"])
282
+ end
283
+ else
284
+ s.add_dependency(%q<rest-client>, [">= 1.6.1"])
285
+ s.add_dependency(%q<couchrest>, ["~> 1.0.1"])
286
+ s.add_dependency(%q<sinatra>, ["~> 1.1.0"])
287
+ s.add_dependency(%q<json>, [">= 1.4.6"])
288
+ s.add_dependency(%q<thin>, ["~> 1.2.7"])
289
+ s.add_dependency(%q<rack>, ["~> 1.2.1"])
290
+ s.add_dependency(%q<rack-contrib>, ["~> 1.1.0"])
291
+ s.add_dependency(%q<shoulda>, [">= 0"])
292
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
293
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
294
+ s.add_dependency(%q<rcov>, [">= 0"])
295
+ end
296
+ end
297
+
@@ -0,0 +1,251 @@
1
+ # http://www.mudynamics.com
2
+ # http://labs.mudynamics.com
3
+ # http://www.pcapr.net
4
+
5
+ require 'mu/testcase'
6
+ require 'mu/pcap/reader/http_family'
7
+ require 'mu/pcap/io_pair'
8
+ require 'mu/pcap/io_wrapper'
9
+
10
+ module Mu
11
+ class Pcap
12
+ class Reader
13
+ class HttpFamily
14
+
15
+ class Test < Mu::TestCase
16
+
17
+ def test_family
18
+ reader = HttpFamily.new
19
+ assert_equal :http, reader.family
20
+ end
21
+
22
+ def test_record_write
23
+ reader = HttpFamily.new
24
+ assert_nil reader.record_write('')
25
+
26
+ state = {}
27
+ reader.record_write '', state
28
+ assert_equal({}, state)
29
+
30
+ bytes = "GET /admin/ HTTP/1.1\r\n" \
31
+ "Content-Length: 0\r\n" \
32
+ "User-Agent: Jakarta Commons-HttpClient/3.1\r\n" \
33
+ "Host: dell-7.musecurity.com\r\n" \
34
+ "\r\n"
35
+ reader.record_write bytes, state
36
+ assert_equal({:requests => ['GET']}, state)
37
+ reader.record_write bytes, state
38
+ assert_equal({:requests => ['GET', 'GET']}, state)
39
+ reader.record_write bytes.gsub('GET', 'POST'), state
40
+ assert_equal({:requests => ['GET', 'GET', 'POST']}, state)
41
+ end
42
+
43
+
44
+ def test_reader
45
+ # Msg no body.
46
+ reader = HttpFamily.new
47
+ reader.pcap2scenario = true
48
+ bytes = "GET /admin/ HTTP/1.1\r\n" \
49
+ "Content-Length: 0\r\n" \
50
+ "User-Agent: Jakarta Commons-HttpClient/3.1\r\n" \
51
+ "Host: dell-7.musecurity.com\r\n" \
52
+ "\r\n"
53
+ assert_equal bytes, reader.read_message(bytes)
54
+
55
+ # Don't include incomplete message
56
+ assert_equal bytes, reader.read_message(bytes + "extra")
57
+
58
+ # Empty message
59
+ assert_nil reader.read_message("")
60
+
61
+ # Incomplete/invalid message
62
+ assert_nil reader.read_message("lkjkljlkj")
63
+
64
+ # Incomplete message. Last byte missing.
65
+ bytes = "GET /admin/ HTTP/1.1\r\n" \
66
+ "Content-Length: 0\r\n" \
67
+ "User-Agent: Jakarta Commons-HttpClient/3.1\r\n" \
68
+ "Host: dell-7.musecurity.com\r\n" \
69
+ "\r"
70
+ assert_nil reader.read_message(bytes)
71
+
72
+ # Invalid message. No request line.
73
+ bytes = "XXXXXXXXXXXXXXXXXXXX\r\n" + # no request line
74
+ "Content-Length: 0\r\n" \
75
+ "User-Agent: Jakarta Commons-HttpClient/3.1\r\n" \
76
+ "Host: dell-7.musecurity.com\r\n" \
77
+ "\r\n"
78
+ assert_nil reader.read_message(bytes)
79
+
80
+ # Lowercase content-length.
81
+ bytes = "GET /admin/ HTTP/1.1\r\n" \
82
+ "content-length: 0\r\n" \
83
+ "User-Agent: Jakarta Commons-HttpClient/3.1\r\n" \
84
+ "Host: dell-7.musecurity.com\r\n" \
85
+ "\r\n"
86
+ assert_equal bytes, reader.read_message(bytes)
87
+
88
+ # In RFC, if there is a payload and no content-length header then
89
+ # you should read until the connection is close.
90
+ # We don't handle this and just treat it as a message with no body.
91
+ bytes = "POST /admin/ HTTP/1.1\r\n" \
92
+ "User-Agent: Jakarta Commons-HttpClient/3.1\r\n" \
93
+ "Host: dell-7.musecurity.com\r\n" \
94
+ "\r\n1"
95
+
96
+ assert_equal bytes[0..-2], reader.read_message(bytes)
97
+ #reader.read_message!(bytes)
98
+ reader.read_message!(bytes)
99
+ assert_equal "1", bytes
100
+
101
+ # 1 byte payload.
102
+ bytes = "GET /admin/ SIP/1.1\r\n" \
103
+ "content-length: 1\r\n" \
104
+ "User-Agent: Jakarta Commons-HttpClient/3.1\r\n" \
105
+ "Host: dell-7.musecurity.com\r\n" \
106
+ "\r\n1"
107
+ assert_equal bytes, reader.read_message(bytes)
108
+
109
+ # Support for SIP compact form of content-length
110
+ bytes = "GET /admin/ SIP/1.1\r\n" \
111
+ "l: 1\r\n" + # content-length
112
+ "User-Agent: Jakarta Commons-HttpClient/3.1\r\n" \
113
+ "Host: dell-7.musecurity.com\r\n" \
114
+ "\r\n1"
115
+ assert_equal bytes, reader.read_message(bytes.dup)
116
+
117
+ # SIP compact form should only be recognized for SIP.
118
+ bytes = "GET /admin/ HTTP/1.1\r\n" \
119
+ "l: 1\r\n" + # http doesn't have short form
120
+ "User-Agent: Jakarta Commons-HttpClient/3.1\r\n" \
121
+ "Host: dell-7.musecurity.com\r\n" \
122
+ "\r\n1" # so this extra byte will not be read
123
+ copy = bytes.dup
124
+ assert_equal bytes[0..-2], reader.read_message!(copy)
125
+ assert_equal "1", copy
126
+
127
+
128
+ # Reply to HEAD request
129
+ bytes = <<-HERE
130
+ HTTP/1.1 200 OK\r
131
+ Content-Encoding: gzip\r
132
+ Content-Length: 3\r
133
+ Keep-Alive: timeout=15, max=100\r
134
+ Connection: Keep-Alive\r
135
+ Content-Type: text/html\r
136
+ \r
137
+ HERE
138
+ assert_equal bytes, reader.read_message(bytes + "123", {:requests => ["HEAD"]})
139
+
140
+ # Chunked
141
+ bytes = <<-HERE
142
+ HTTP/1.1 200 OK\r
143
+ Transfer-Encoding: chunked\r
144
+ Content-Type: text/html\r
145
+ \r
146
+ HERE
147
+ # chunk1
148
+ bytes << "5\r\n"
149
+ bytes << "A"*5
150
+ bytes << "\r\n"
151
+ bytes << "3\r\n"
152
+ bytes << "B" * 3
153
+ bytes << "\r\n"
154
+ bytes << "0\r\n\r\n"
155
+ assert_equal bytes, reader.read_message(bytes)
156
+
157
+ # Chunked (incomplete)
158
+ bytes = <<-HERE
159
+ HTTP/1.1 200 OK\r
160
+ Transfer-Encoding: chunked\r
161
+ Content-Type: text/html\r
162
+ \r
163
+ HERE
164
+ # chunk1
165
+ bytes << "5\r\n"
166
+ bytes << "A"*5
167
+ bytes << "3\r\n"
168
+ bytes << "B" * 3
169
+ assert_nil reader.read_message(bytes)
170
+
171
+ end
172
+
173
+ def client_server_pair
174
+ IOPair.stream_pair.map do |io|
175
+ reader = HttpFamily.new
176
+ reader.pcap2scenario = true
177
+ IOWrapper.new io, reader
178
+ end
179
+ end
180
+
181
+ def test_get_chunks
182
+ reader = HttpFamily.new
183
+ # Chunks
184
+ raw_bytes = "5\r\nAAAAA\r\n3\r\nBBB\r\n0\r\n\r\n"
185
+ dechunked_bytes = "AAAAABBB"
186
+
187
+ raw, dechunked = reader.get_chunks(raw_bytes)
188
+ assert_equal raw_bytes, raw
189
+ assert_equal dechunked_bytes, dechunked
190
+
191
+ # Missing final CRLF
192
+ raw_bytes = "5\r\nAAAAA\r\n3\r\nBBB\r\n0\r\n"
193
+ dechunked_bytes = "AAAAABBB"
194
+ assert_nil reader.get_chunks(raw_bytes)
195
+
196
+ # Missing end of chunks
197
+ raw_bytes = "5\r\nAAAAA\r\n3\r\nBBB\r\n"
198
+ assert_nil reader.get_chunks(raw_bytes)
199
+
200
+ # Malformed chunk size line
201
+ raw_bytes = "5\r\nAAAAA3\r\nBBB0foo\r\n"
202
+ assert_nil reader.get_chunks(raw_bytes)
203
+
204
+ # Second chunk missing a byte
205
+ raw_bytes = "5\r\nAAAAA3\r\nBB0\r\n\r\n"
206
+ assert_nil reader.get_chunks(raw_bytes)
207
+ end
208
+
209
+ def test_transaction_mult_requests
210
+ # Client sends 3 requests GET/HEAD/GET and then gets 3 replies
211
+ client,server = client_server_pair
212
+ client.write "GET /admin/ HTTP/1.1\r\n\r\n"
213
+ assert_equal ['GET'], client.state[:requests]
214
+ client.write "HEAD /admin/ HTTP/1.1\r\n\r\n"
215
+ assert_equal ['GET', 'HEAD'], client.state[:requests]
216
+ client.write "GET /admin/ HTTP/1.1\r\n\r\n"
217
+ assert_equal ['GET', 'HEAD', 'GET'], client.state[:requests]
218
+
219
+ head_reply = <<-HERE
220
+ HTTP/1.1 200 OK\r
221
+ Content-Encoding: gzip\r
222
+ Content-Length: 158\r
223
+ Keep-Alive: timeout=15, max=100\r
224
+ Connection: Keep-Alive\r
225
+ Content-Type: text/html\r
226
+ \r
227
+ HERE
228
+
229
+ get_reply = head_reply + 'X'*158
230
+
231
+ server.write get_reply
232
+ server.write head_reply
233
+ server.write get_reply
234
+
235
+ assert_equal get_reply, client.read
236
+ assert_equal ['HEAD', 'GET'], client.state[:requests]
237
+
238
+ assert_equal head_reply, client.read
239
+ assert_equal ['GET'], client.state[:requests]
240
+
241
+ assert_equal get_reply, client.read
242
+ assert_equal [], client.state[:requests]
243
+ end
244
+
245
+
246
+ end
247
+
248
+ end
249
+ end
250
+ end
251
+ end