rmitm 0.0.3 → 0.0.4

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDdkN2Y1MDM1NzdiMjU3NmY0Nzg1ZDkzOWIwMDZkODI5MTUxMjUzYQ==
4
+ YzUyODgzMmQxY2U1MDYwZWRlMTNhMzMyNWQzZThiZGU2ZjZhYzMzZA==
5
5
  data.tar.gz: !binary |-
6
- ZWMwNmQxM2NhYjMwYjc5M2M0MDVhMTQ4MTczMjI5NGY1ZjI2OTdjMg==
6
+ MDQ2NWEyY2ZlZTdhMzdjMzVhMGQ2NWQ3NjIyNzNiZjM1MTI3ODdhNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTI3N2UxN2E3NzMyM2NkODhkMGMwYjljNGI5NjUxNzBlMzBiZmRlNTRhYTVi
10
- MGUxZWUxZDI3N2UxYzRkYzYzYmRmNjMzNjRlNTg2NmNmZjc5Mjg1NDk0MjY0
11
- NjU2NTIwYmE1ZWZlNmMwYWMwYzNjNTM0MGNkYmM1MjI2NTlhOTc=
9
+ ZjI1YzIyOTc2ZjcyZjI4MTI0ZDQxNDM1MjU1MzlmYjUwYTE4OWJlMTIzYjJi
10
+ YTMyZmYyMjUxZTE1YTQzMTg5MzIzOGFmNzY3MDk5NTVjNGIyMWZhOWY0OTgw
11
+ ZWY0YTFjZTc1NWNlMDVmN2RkNDE2Yjg4ZWE0MWRjMjliNzVmZWY=
12
12
  data.tar.gz: !binary |-
13
- ODBiMjUyNDNhNGRmMDU4MDkyYzNjNWU2YWJiMzgzZTNiZWI5NzFkMjlkNzYx
14
- NzU4ZTM5MmU3NTFkMDAxYmI2ZDRkNThhYjk5MjIyN2EwN2NhZTc4YjkxYjBk
15
- MzU1NDFjMjA5NGE0MDlkMzIxNDA3NTVhZDhhZGU1MDdiZTU0Njk=
13
+ YWU0Yjk4YTA5YzZkZGYzNGVjMTM2MGIzODI3MzI3YTA4YWNmYzg1Y2QwMTJh
14
+ ZmE0MzYyNDA4MDJlYTMwOWE2YzdjODQ5NGY3MDRjYzRhZjE1ZWZiMGFhZWI3
15
+ ODc2MTZhNjUwYzFjM2M1YmZmNjY4OWQ5MzgwNzQ0ZmNhYmVhNjU=
data/bin/readFromFlow CHANGED
@@ -73,7 +73,7 @@ def readFlowFile():
73
73
  # END readFlowFile
74
74
 
75
75
  def dump(content):
76
- json.dump(content, sys.stdout, indent=4, ensure_ascii=False)
76
+ json.dump(content, sys.stdout, indent=4, ensure_ascii=True, encoding='ISO-8859-1')
77
77
  # END dump
78
78
 
79
79
  if __name__ == '__main__':
@@ -1,10 +1,22 @@
1
1
  import sys, getopt, re
2
+ from netlib.odict import ODictCaseless
3
+ from libmproxy.flow import Response
2
4
 
3
- def response(context, flow):
5
+ # def response(context, flow):
6
+ # if path.search(flow.request.path) is not None:
7
+ # flow.response.code = 404
8
+ # flow.response.msg = "Not Found"
9
+ # flow.response.content = "Blacklisted"
10
+
11
+ def request(context, flow):
4
12
  if path.search(flow.request.path) is not None:
5
- flow.response.code = 404
6
- flow.response.msg = "Not Found"
7
- flow.response.content = "Oooops!!"
13
+ resp = Response(
14
+ flow.request,
15
+ [1,1], 404, "Not Found",
16
+ ODictCaseless([["Content-Type","text/html"],["Server","Apache/2.4.9 (Unix)"]]),
17
+ "Blacklisted",
18
+ None)
19
+ flow.request.reply(resp)
8
20
 
9
21
  def start(context, argv):
10
22
  try:
@@ -39,7 +39,7 @@ class MitmdumpReader
39
39
  cmd = "#{File.expand_path('../../bin', __FILE__)}/readFromFlow #{options << ' '}#{@filename}"
40
40
  pp cmd if $DEBUG
41
41
  Open3.popen3(cmd) do |_, o, e, w|
42
- @stdout = o.read.encode!('ISO-8859-1', 'UTF-8', :invalid => :replace, :undef => :replace, :replace => "")
42
+ @stdout = o.read #.encode!('ISO-8859-1', 'UTF-8', :invalid => :replace, :undef => :replace, :replace => "")
43
43
  @stderr = e.read
44
44
  @stderr == "" ? parse : error
45
45
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmitm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc Bleeze
@@ -14,30 +14,42 @@ dependencies:
14
14
  name: jsonpath
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '0.5'
17
20
  - - ! '>='
18
21
  - !ruby/object:Gem::Version
19
- version: '0'
22
+ version: 0.5.6
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '0.5'
24
30
  - - ! '>='
25
31
  - !ruby/object:Gem::Version
26
- version: '0'
32
+ version: 0.5.6
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: json
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
37
+ - - ~>
38
+ - !ruby/object:Gem::Version
39
+ version: '1.8'
31
40
  - - ! '>='
32
41
  - !ruby/object:Gem::Version
33
- version: '0'
42
+ version: 1.8.1
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
47
+ - - ~>
48
+ - !ruby/object:Gem::Version
49
+ version: '1.8'
38
50
  - - ! '>='
39
51
  - !ruby/object:Gem::Version
40
- version: '0'
52
+ version: 1.8.1
41
53
  description: ! " rmitm provides a DSL and useful ruby classes and python scripts
42
54
  for using mitmdump\n for automated testing.\n"
43
55
  email: marcbleeze@gmail.com
@@ -74,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
86
  version: '0'
75
87
  requirements: []
76
88
  rubyforge_project:
77
- rubygems_version: 2.3.0
89
+ rubygems_version: 2.4.1
78
90
  signing_key:
79
91
  specification_version: 4
80
92
  summary: rmitm provides a DSL and useful ruby classes and python scripts for mitmdump