timing_attack 0.4.0 → 0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4aa7a2b7ae3b9a7bf2b6d39d586d3484aa83d7e
4
- data.tar.gz: 3432f10030dbb838b9ff224d4c7942f8fb82392a
3
+ metadata.gz: 4c07deac97e0cdfadcb0c1249fc09a950642030b
4
+ data.tar.gz: b565450cb34a4c42a6e7a89394296546834c37cc
5
5
  SHA512:
6
- metadata.gz: 635ff7244a86461d6531034e54a607b0c91973c5d1a31631e571860b3eca132ce770753dce0973ab4d798a4aed209d9567bdaf7bca75901fa52f4dc8c94aa5fc
7
- data.tar.gz: 0d7d00c315e3bdc7f947c4ba1294f2810a4bd901a225bdc2655e51d4807ceebc785e7d85ace2d02d442088aa5b7f14eb66e2579c97cd5fd89fa4a4dc9ba7e4f1
6
+ metadata.gz: 27f0cbb88c3038b68d16764d8170a924c0c344117545c8ca37877e854d7b80526297b37f866c53cdc1ad0f5615df354dd898ba3267dd5ccb428db4d6d66a25af
7
+ data.tar.gz: 0507d9712a8d68d75d5686c7aa3e32e9042a3f7f9116dda113eac59bfed863e5a9203315a57bb1c0e5e38732bcfc3ff0e661f82f87b0b40be6a0d05f61d3b35e
data/README.md CHANGED
@@ -3,6 +3,9 @@
3
3
  Profile web applications, sorting inputs into two categories based on
4
4
  discrepancies in the application's response time.
5
5
 
6
+ If you need a known-vulnerable application for testing and/or development, see
7
+ [Camelflage](https://github.com/ffleming/camelflage).
8
+
6
9
  ## Installation
7
10
 
8
11
  ```bash
@@ -13,8 +13,13 @@ module TimingAttack
13
13
  attr_reader :known
14
14
  POTENTIAL_BYTES = (' '..'z').to_a
15
15
  def attack!
16
- while(true)
17
- attack_byte!
16
+ begin
17
+ while(true)
18
+ attack_byte!
19
+ end
20
+ rescue Errors::BruteForcerError => e
21
+ puts "\n#{e.message}"
22
+ exit(1)
18
23
  end
19
24
  end
20
25
 
@@ -48,7 +53,9 @@ module TimingAttack
48
53
  grouper = Grouper.new(attacks: attacks, group_by: { percentile: options.fetch(:percentile) })
49
54
  results = grouper.long_tests.map(&:input)
50
55
  if grouper.long_tests.count > 1
51
- raise StandardError.new("Got too many possibilities: #{results.join(', ')}")
56
+ msg = "Got too many possibilities to continue brute force:\n\t"
57
+ msg << results.join("\t")
58
+ raise Errors::BruteForcerError.new(msg)
52
59
  end
53
60
  @known = results.first
54
61
  end
@@ -0,0 +1,6 @@
1
+ module TimingAttack
2
+ module Errors
3
+ class BruteForcerError < StandardError
4
+ end
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module TimingAttack
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
data/lib/timing_attack.rb CHANGED
@@ -3,6 +3,7 @@ require 'json'
3
3
  require 'optparse'
4
4
  require 'ruby-progressbar'
5
5
  require "timing_attack/version"
6
+ require "timing_attack/errors"
6
7
  require "timing_attack/attacker"
7
8
  require 'timing_attack/spinner'
8
9
  require "timing_attack/brute_forcer"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: timing_attack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Forrest Fleming
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-04 00:00:00.000000000 Z
11
+ date: 2017-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-progressbar
@@ -116,6 +116,7 @@ files:
116
116
  - lib/timing_attack/attacker.rb
117
117
  - lib/timing_attack/brute_forcer.rb
118
118
  - lib/timing_attack/enumerator.rb
119
+ - lib/timing_attack/errors.rb
119
120
  - lib/timing_attack/grouper.rb
120
121
  - lib/timing_attack/spinner.rb
121
122
  - lib/timing_attack/test_case.rb