pwnlib 0.1.4 → 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
- metadata +3 -12
- data/.gitignore +0 -14
- data/Gemfile +0 -4
- data/LICENSE.txt +0 -22
- data/README.md +0 -31
- data/Rakefile +0 -2
- data/lib/pwnlib.rb +0 -48
- data/lib/pwnlib/process.rb +0 -86
- data/lib/pwnlib/version.rb +0 -3
- data/pwnlib.gemspec +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66046532fc741cd8ed83b1bdd9fd2d5a26601b0a
|
4
|
+
data.tar.gz: 1cf45027dc8fa5099cce6b2c4521583cb4764896
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2a208bee068b4c51dc41675ac7d6ec3f89d240a9ed2b1b0d47c93846891fbf1105118a269dac87f1e6ee1e35828f506ea03d7a40d92cfd452c1ce407d52afe6
|
7
|
+
data.tar.gz: 16da98283750f3751b01bc8cff089bd058296fd244ab57d32aac6c9a80263dfc3d23abf7258c80a8bc1feca468fd28effaac9674460eeb66e097ccb24c777a26
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwnlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Cook
|
@@ -44,16 +44,7 @@ email:
|
|
44
44
|
executables: []
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
|
-
files:
|
48
|
-
- ".gitignore"
|
49
|
-
- Gemfile
|
50
|
-
- LICENSE.txt
|
51
|
-
- README.md
|
52
|
-
- Rakefile
|
53
|
-
- lib/pwnlib.rb
|
54
|
-
- lib/pwnlib/process.rb
|
55
|
-
- lib/pwnlib/version.rb
|
56
|
-
- pwnlib.gemspec
|
47
|
+
files: []
|
57
48
|
homepage: ''
|
58
49
|
licenses:
|
59
50
|
- MIT
|
@@ -74,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
65
|
version: '0'
|
75
66
|
requirements: []
|
76
67
|
rubyforge_project:
|
77
|
-
rubygems_version: 2.
|
68
|
+
rubygems_version: 2.5.1
|
78
69
|
signing_key:
|
79
70
|
specification_version: 4
|
80
71
|
summary: Ruby binary pwning library
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/LICENSE.txt
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2016 TODO: Write your name
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
# Pwnlib
|
2
|
-
|
3
|
-
TODO: Write a gem description
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
Add this line to your application's Gemfile:
|
8
|
-
|
9
|
-
```ruby
|
10
|
-
gem 'pwnlib'
|
11
|
-
```
|
12
|
-
|
13
|
-
And then execute:
|
14
|
-
|
15
|
-
$ bundle
|
16
|
-
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
|
-
$ gem install pwnlib
|
20
|
-
|
21
|
-
## Usage
|
22
|
-
|
23
|
-
TODO: Write usage instructions here
|
24
|
-
|
25
|
-
## Contributing
|
26
|
-
|
27
|
-
1. Fork it ( https://github.com/[my-github-username]/pwnlib/fork )
|
28
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
-
5. Create a new Pull Request
|
data/Rakefile
DELETED
data/lib/pwnlib.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
require 'pwnlib/process'
|
2
|
-
require 'socket'
|
3
|
-
|
4
|
-
module Pwnlib
|
5
|
-
def p64 num
|
6
|
-
num = num.hex if num.is_a? String
|
7
|
-
[num].pack("Q")
|
8
|
-
end
|
9
|
-
|
10
|
-
def p32 num
|
11
|
-
num = num.hex if num.is_a? String
|
12
|
-
[num].pack("L")
|
13
|
-
end
|
14
|
-
|
15
|
-
def u32 num
|
16
|
-
num.unpack("L")[0]
|
17
|
-
# num.bytes.reverse.join
|
18
|
-
end
|
19
|
-
|
20
|
-
def u64 num
|
21
|
-
num.unpack("Q")[0]
|
22
|
-
# num.bytes.reverse.join
|
23
|
-
end
|
24
|
-
|
25
|
-
def process name
|
26
|
-
stdin, stdout, wait_thr = Open3.popen2e name
|
27
|
-
stdout.sync
|
28
|
-
stdin.sync
|
29
|
-
ProcessRun.new stdin, stdout
|
30
|
-
end
|
31
|
-
|
32
|
-
def remote name, port
|
33
|
-
s = TCPSocket.new name, port
|
34
|
-
ProcessRun.new s, s
|
35
|
-
end
|
36
|
-
|
37
|
-
def shellcode
|
38
|
-
"\x90\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x50\x53\x89\xe1\xb0\x0b\xcd\x80".force_encoding("ASCII-8BIT")
|
39
|
-
end
|
40
|
-
|
41
|
-
def shellcode2
|
42
|
-
"\xf7\xe6\x52\x48\xbb\x2f\x62\x69\x6e\x2f\x2f\x73\x68\x53\x48\x8d\x3c\x24\xb0\x3b\x0f\x05".force_encoding("ASCII-8BIT")
|
43
|
-
end
|
44
|
-
|
45
|
-
def shellcode3
|
46
|
-
"\x48\x31\xff\x57\x57\x5e\x5a\x48\xbf\x2f\x2f\x62\x69\x6e\x2f\x73\x68\x48\xc1\xef\x08\x57\x54\x5f\x6a\x3b\x58\x0f\x05".force_encoding("ASCII-8BIT")
|
47
|
-
end
|
48
|
-
end
|
data/lib/pwnlib/process.rb
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
class ProcessRun
|
2
|
-
require 'open3'
|
3
|
-
|
4
|
-
def initialize stdin, stdout
|
5
|
-
@stdin = stdin
|
6
|
-
@stdout = stdout
|
7
|
-
@output_buf = []
|
8
|
-
|
9
|
-
@get_input = true
|
10
|
-
|
11
|
-
@stdout_thr = Thread.new do
|
12
|
-
while @get_input
|
13
|
-
next_line = @stdout.readpartial(4096)
|
14
|
-
if next_line
|
15
|
-
@output_buf << next_line
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
def output
|
22
|
-
sleep 0.1
|
23
|
-
@output_buf.each {|l| puts l; }
|
24
|
-
output_clear
|
25
|
-
end
|
26
|
-
|
27
|
-
def output_clear
|
28
|
-
sleep 0.1
|
29
|
-
@output_buf = []
|
30
|
-
end
|
31
|
-
|
32
|
-
def recv
|
33
|
-
sleep 0.1
|
34
|
-
@output_buf.shift
|
35
|
-
end
|
36
|
-
|
37
|
-
def recv_bytes num=nil
|
38
|
-
sleep 0.1
|
39
|
-
byte_arr = @output_buf.shift.bytes.map do |n|
|
40
|
-
n.to_s(16)
|
41
|
-
end
|
42
|
-
if num
|
43
|
-
byte_arr[0,num].reverse.join
|
44
|
-
else
|
45
|
-
byte_arr.reverse.join
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def send msg
|
50
|
-
@stdin.write msg
|
51
|
-
sleep 0.1
|
52
|
-
end
|
53
|
-
|
54
|
-
def write msg
|
55
|
-
File.open("sploit", "w") do |f|
|
56
|
-
f.puts msg
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
def interactive
|
61
|
-
while 1
|
62
|
-
print "\n$> "
|
63
|
-
input = gets.chomp
|
64
|
-
|
65
|
-
if input == "exit" or input == "quit"
|
66
|
-
break
|
67
|
-
end
|
68
|
-
|
69
|
-
@stdin.puts(input)
|
70
|
-
|
71
|
-
sleep 0.1
|
72
|
-
output
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
def close
|
77
|
-
@stdout.flush
|
78
|
-
@stdin.flush
|
79
|
-
@get_input = false
|
80
|
-
|
81
|
-
output
|
82
|
-
|
83
|
-
@stdin.close
|
84
|
-
@stdout.close unless @stdin == @stdout
|
85
|
-
end
|
86
|
-
end
|
data/lib/pwnlib/version.rb
DELETED
data/pwnlib.gemspec
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'pwnlib/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "pwnlib"
|
8
|
-
spec.version = Pwnlib::VERSION
|
9
|
-
spec.authors = ["Kyle Cook"]
|
10
|
-
spec.email = ["kylecook80@gmail.com"]
|
11
|
-
spec.summary = %q{Ruby binary pwning library}
|
12
|
-
spec.description = %q{Library used to create exploits for binariesman}
|
13
|
-
spec.homepage = ""
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
23
|
-
end
|