lightning-bolt 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +2 -0
- data/bin/lightningbolt +3 -0
- data/lib/lightning/bolt/cli.rb +63 -0
- data/lib/lightning/bolt/codex.rb +308 -0
- data/lib/lightning/bolt/cypher.rb +85 -0
- data/lib/lightning/bolt/encoding.yml +73 -0
- data/lib/lightning/bolt/fuzzer.rb +51 -0
- data/lib/lightning/bolt/keys.yml +18 -0
- data/lib/lightning/bolt/seed.txt +2500 -0
- data/lib/lightning/bolt/templates/codex/en/colors.yml +19 -0
- data/lib/lightning/bolt/templates/codex/en/names.yml +3485 -0
- data/lib/lightning/bolt/templates/codex/en/organizations.yml +1 -0
- data/lib/lightning/bolt/templates/codex/en/us/states.yml +101 -0
- data/lib/lightning/bolt/templates/codex/en/vehicles.yml +193 -0
- data/lib/lightning/bolt/templates/codex/fr/names.yml +630 -0
- data/lib/lightning/bolt/templates/codex/it/names.yml +243 -0
- data/lib/lightning/bolt/templates/payload.yml +67 -0
- data/lib/lightning/bolt/util.rb +4 -0
- data/lib/lightning/bolt/version.rb +5 -0
- data/lib/lightning/bolt.rb +7 -0
- data/lightning-bolt.gemspec +25 -0
- data/specs/baseline.yml +79 -0
- data/specs/checkpoints.rb +22 -0
- data/specs/payload.yml +116 -0
- metadata +115 -0
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'securerandom'
|
2
|
+
module Lightning
|
3
|
+
module Bolt
|
4
|
+
class Fuzzer
|
5
|
+
|
6
|
+
def initialize(encoder)
|
7
|
+
@encoder = encoder
|
8
|
+
@ftldrive = 0
|
9
|
+
@warp = Time.new.to_i
|
10
|
+
end
|
11
|
+
|
12
|
+
def random_number(min,max)
|
13
|
+
randomizer = seeder(nil)
|
14
|
+
return randomizer.rand(min+max)+min
|
15
|
+
end
|
16
|
+
|
17
|
+
def launch(seed, size, non_printable)
|
18
|
+
randomizer = seeder(seed)
|
19
|
+
addable = true
|
20
|
+
enigma = ""
|
21
|
+
while(enigma.length < size)
|
22
|
+
rotar = randomizer.bytes(1)
|
23
|
+
if encodable?(rotar)
|
24
|
+
enigma += rotar
|
25
|
+
end
|
26
|
+
end
|
27
|
+
return enigma.encode(@encoder)
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
def seeder(seed)
|
33
|
+
time = Time.new.to_i
|
34
|
+
time += @ftldrive
|
35
|
+
@ftldrive = @ftldrive + 1
|
36
|
+
seed = seed.eql?(nil) ? time : seed
|
37
|
+
return Random.new(seed)
|
38
|
+
end
|
39
|
+
|
40
|
+
def encodable?(rotar)
|
41
|
+
begin
|
42
|
+
rotar.encode(@encoder)
|
43
|
+
return true
|
44
|
+
rescue Encoding::UndefinedConversionError
|
45
|
+
return false
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
---
|
2
|
+
keys:
|
3
|
+
reference: "#:[a-zA-Z]+-[a-zA-Z0-9\\-]+"
|
4
|
+
data: "@:[a-zA-Z]+-[a-zA-Z0-9\\-]+"
|
5
|
+
group: (?<match>\((?:\g<match>|[^()]++)*\))
|
6
|
+
set: (?<match>\[(?:\g<match>|[^\[\]]++)*\])
|
7
|
+
singular: (?<!\\)(?:\\\\)*
|
8
|
+
exist: \?
|
9
|
+
and: (?<!\\)(?:\\\\)*\&
|
10
|
+
or: (?<!\\)(?:\\\\)*\|
|
11
|
+
not: \!
|
12
|
+
any: \.
|
13
|
+
range: \[.+\.\..+\]
|
14
|
+
repeat: \{[0-9]+:[0-9]+\}
|
15
|
+
subsets: \[(\\-|.-\\.|.-.|\\.|.)+\]
|
16
|
+
memorize: +:[a-zA-Z]+-[a-zA-Z0-9]+
|
17
|
+
subset: \<[0-9]+:[0-9]+\>
|
18
|
+
escapable: \\.
|