BytesCode 1.0 → 2.0
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 +4 -4
- data/lib/BytesCode.rb +31 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd6415df650e2cd9895af73aba8584c1fb0416b9d69d7e157b81944e0ed371b8
|
4
|
+
data.tar.gz: 69da7314067a2e6046301a379716d2b75ca93b56ba1aceed87844d74b11aa65e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8895dd21feb362d01fe5d34ac0d4d1521aae19ded0ddef2edca0d0a8ad8c292c81ec9b08988ef387e45bd141fce4f9e4490b3a394bf0a520bdaedaa70c0499f
|
7
|
+
data.tar.gz: 567d6746d421ca51175bb5e792925191d7933657e0b79f47bdd77c2e26ec2d600c38eb1a655b56b8defb3382d906ac24abc132d25674d439dc8f23974acd9746
|
data/lib/BytesCode.rb
CHANGED
@@ -4,7 +4,30 @@ end
|
|
4
4
|
|
5
5
|
class BytesCode
|
6
6
|
|
7
|
-
def self.
|
7
|
+
def self.countdown(shellcode)
|
8
|
+
shellcode_array = shellcode.split('\x')
|
9
|
+
no_authorized = ["00", "FF", "0D", "0A", "ff", "0d", "0a"]
|
10
|
+
final_rez = []
|
11
|
+
shellcode_array.each do |bytes|
|
12
|
+
|
13
|
+
no_authorized.each do |no_auth|
|
14
|
+
if bytes == no_auth
|
15
|
+
shellcode_array.delete(bytes)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
shellcode_array.each do |octet|
|
21
|
+
if octet != ""
|
22
|
+
final_rez << "\\x#{octet}"
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
return final_rez.join
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.to_opcode(file, countdown=false)
|
8
31
|
|
9
32
|
if(File.file?(file) == false)
|
10
33
|
raise FileError, "#{file} => File not found"
|
@@ -21,9 +44,15 @@ class BytesCode
|
|
21
44
|
final_res << "\\x#{data}"
|
22
45
|
end
|
23
46
|
|
24
|
-
|
47
|
+
if(countdown == false)
|
48
|
+
return final_res.join
|
49
|
+
else
|
50
|
+
return self.countdown(final_res.join)
|
51
|
+
end
|
25
52
|
end
|
26
53
|
|
27
54
|
end
|
28
55
|
|
29
56
|
|
57
|
+
|
58
|
+
|