pwntools 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +4 -3
  3. data/Rakefile +3 -1
  4. data/lib/pwnlib/asm.rb +172 -2
  5. data/lib/pwnlib/constants/constants.rb +10 -3
  6. data/lib/pwnlib/context.rb +1 -3
  7. data/lib/pwnlib/elf/elf.rb +3 -3
  8. data/lib/pwnlib/errors.rb +30 -0
  9. data/lib/pwnlib/ext/helper.rb +1 -1
  10. data/lib/pwnlib/logger.rb +140 -2
  11. data/lib/pwnlib/pwn.rb +3 -0
  12. data/lib/pwnlib/reg_sort.rb +1 -1
  13. data/lib/pwnlib/shellcraft/generators/amd64/common/infloop.rb +9 -3
  14. data/lib/pwnlib/shellcraft/generators/amd64/common/pushstr_array.rb +6 -2
  15. data/lib/pwnlib/shellcraft/generators/amd64/common/setregs.rb +6 -2
  16. data/lib/pwnlib/shellcraft/generators/amd64/linux/cat.rb +23 -0
  17. data/lib/pwnlib/shellcraft/generators/amd64/linux/execve.rb +6 -4
  18. data/lib/pwnlib/shellcraft/generators/amd64/linux/exit.rb +23 -0
  19. data/lib/pwnlib/shellcraft/generators/amd64/linux/ls.rb +6 -2
  20. data/lib/pwnlib/shellcraft/generators/amd64/linux/open.rb +23 -0
  21. data/lib/pwnlib/shellcraft/generators/amd64/linux/sh.rb +6 -2
  22. data/lib/pwnlib/shellcraft/generators/amd64/linux/syscall.rb +6 -4
  23. data/lib/pwnlib/shellcraft/generators/i386/common/infloop.rb +9 -3
  24. data/lib/pwnlib/shellcraft/generators/i386/common/pushstr_array.rb +6 -2
  25. data/lib/pwnlib/shellcraft/generators/i386/common/setregs.rb +6 -2
  26. data/lib/pwnlib/shellcraft/generators/i386/linux/cat.rb +23 -0
  27. data/lib/pwnlib/shellcraft/generators/i386/linux/execve.rb +8 -4
  28. data/lib/pwnlib/shellcraft/generators/i386/linux/exit.rb +23 -0
  29. data/lib/pwnlib/shellcraft/generators/i386/linux/ls.rb +6 -2
  30. data/lib/pwnlib/shellcraft/generators/i386/linux/open.rb +23 -0
  31. data/lib/pwnlib/shellcraft/generators/i386/linux/sh.rb +6 -2
  32. data/lib/pwnlib/shellcraft/generators/i386/linux/syscall.rb +8 -4
  33. data/lib/pwnlib/shellcraft/generators/x86/linux/cat.rb +53 -0
  34. data/lib/pwnlib/shellcraft/generators/x86/linux/exit.rb +33 -0
  35. data/lib/pwnlib/shellcraft/generators/x86/linux/open.rb +46 -0
  36. data/lib/pwnlib/shellcraft/shellcraft.rb +3 -2
  37. data/lib/pwnlib/timer.rb +5 -2
  38. data/lib/pwnlib/tubes/process.rb +153 -0
  39. data/lib/pwnlib/tubes/serialtube.rb +112 -0
  40. data/lib/pwnlib/tubes/sock.rb +24 -25
  41. data/lib/pwnlib/tubes/tube.rb +191 -39
  42. data/lib/pwnlib/util/packing.rb +3 -9
  43. data/lib/pwnlib/version.rb +1 -1
  44. data/test/asm_test.rb +85 -2
  45. data/test/constants/constants_test.rb +2 -2
  46. data/test/data/echo.rb +2 -7
  47. data/test/elf/elf_test.rb +10 -15
  48. data/test/files/use_pwn.rb +2 -6
  49. data/test/logger_test.rb +38 -0
  50. data/test/shellcraft/linux/cat_test.rb +86 -0
  51. data/test/shellcraft/linux/syscalls/exit_test.rb +56 -0
  52. data/test/shellcraft/linux/syscalls/open_test.rb +86 -0
  53. data/test/shellcraft/shellcraft_test.rb +5 -4
  54. data/test/test_helper.rb +22 -2
  55. data/test/timer_test.rb +19 -1
  56. data/test/tubes/process_test.rb +99 -0
  57. data/test/tubes/serialtube_test.rb +165 -0
  58. data/test/tubes/sock_test.rb +20 -21
  59. data/test/tubes/tube_test.rb +86 -16
  60. metadata +75 -13
@@ -60,7 +60,7 @@ class TubeTest < MiniTest::Test
60
60
 
61
61
  class << t
62
62
  def recv_raw(_n)
63
- raise EOFError if io.eof?
63
+ raise ::Pwnlib::Errors::EndOfTubeError if io.eof?
64
64
  io.read
65
65
  end
66
66
 
@@ -73,13 +73,32 @@ class TubeTest < MiniTest::Test
73
73
  end
74
74
 
75
75
  def io
76
- @fakeio ||= Tempfile.new('pwntools_ruby_test')
76
+ @io ||= Tempfile.new('pwntools_ruby_test')
77
+ end
78
+
79
+ def io_out
80
+ io
77
81
  end
78
82
  end
79
83
 
80
84
  t
81
85
  end
82
86
 
87
+ def test_not_implement
88
+ t = Tube.new
89
+ # io_out
90
+ assert_raises(NotImplementedError) { context.local(log_level: :fatal) { t.interact } }
91
+ # send_raw
92
+ assert_raises(NotImplementedError) { t.puts }
93
+ # timeout_raw=
94
+ assert_raises(NotImplementedError) { t.recv(timeout: 1) }
95
+ class << t
96
+ def timeout_raw=(_) end
97
+ end
98
+ # recv_raw
99
+ assert_raises(NotImplementedError) { t.gets }
100
+ end
101
+
83
102
  def test_recv
84
103
  t = hello_tube
85
104
  assert_equal('Hello, world', t.recv)
@@ -110,11 +129,14 @@ class TubeTest < MiniTest::Test
110
129
  assert_equal('worldHello, ', t.recvuntil(' '))
111
130
  t.unrecv('Hello, world!')
112
131
  assert_equal('Hello,', t.recvuntil(' wor', drop: true))
113
- assert_equal('', t.recvuntil('DARKHH', drop: true, timeout: 0.1))
132
+
133
+ # test timeout
134
+ assert_raises(::Pwnlib::Errors::TimeoutError) { t.recvuntil('DARKHH', drop: true, timeout: 0.1) }
114
135
 
115
136
  t = basic_tube
116
137
  t.unrecv('meow')
117
- assert_equal('', t.recvuntil('DARKHH'))
138
+ # test EOF
139
+ assert_raises(::Pwnlib::Errors::EndOfTubeError) { t.recvuntil('DARKHH') }
118
140
  assert_equal('meow', t.recv)
119
141
  end
120
142
 
@@ -132,19 +154,37 @@ class TubeTest < MiniTest::Test
132
154
 
133
155
  t = basic_tube
134
156
  t.unrecv('Hello, world')
135
- assert_equal('', t.recvline)
157
+ # test EOF
158
+ assert_raises(::Pwnlib::Errors::EndOfTubeError) { assert_equal('', t.recvline) }
136
159
  assert_equal('Hello, world', t.recv)
137
160
  end
138
161
 
162
+ def test_gets
163
+ t = Tube.new
164
+ t.unrecv("Foo\nBar\r\nBaz\n")
165
+ assert_equal("Foo\n", t.gets)
166
+ assert_equal("Bar\r\n", t.gets)
167
+ assert_equal('Baz', t.gets(drop: true))
168
+
169
+ t = hello_tube
170
+ assert_equal('Hello,', t.gets(','))
171
+ assert_equal(' world', t.gets('H', drop: true))
172
+ assert_equal('ello', t.gets(4))
173
+ assert_raises(ArgumentError) { t.gets(t) }
174
+ end
175
+
139
176
  def test_recvpred
140
177
  t = hello_tube
141
178
  r = /H.*w/
142
179
  10.times { assert_match(r, t.recvpred { |data| data =~ r }) }
143
180
  r = /H.*W/
144
- assert_match('', t.recvpred(timeout: 0.01) { |data| data =~ r })
181
+
182
+ # test timeout
183
+ assert_raises(::Pwnlib::Errors::TimeoutError) { t.recvpred(timeout: 0.01) { |data| data =~ r } }
145
184
  t = basic_tube
146
185
  t.unrecv('darkhh')
147
- assert_match('', t.recvpred { |data| data =~ r })
186
+ # test EOF
187
+ assert_raises(::Pwnlib::Errors::EndOfTubeError) { t.recvpred { |data| data =~ r } }
148
188
  end
149
189
 
150
190
  def test_recvregex
@@ -157,11 +197,11 @@ class TubeTest < MiniTest::Test
157
197
 
158
198
  def test_send
159
199
  t = hello_tube
160
- t.write('DARKHH')
200
+ assert_equal(6, t.write('DARKHH'))
161
201
  assert_equal('DARKHH', t.buf)
162
- t.write(' QQ')
202
+ assert_equal(3, t.write(' QQ'))
163
203
  assert_equal('DARKHH QQ', t.buf)
164
- t.write(333)
204
+ assert_equal(3, t.write(333))
165
205
  assert_equal('DARKHH QQ333', t.buf)
166
206
 
167
207
  context.local(log_level: 'debug') do
@@ -192,8 +232,38 @@ class TubeTest < MiniTest::Test
192
232
  t = hello_tube
193
233
  t.write('DARKHH')
194
234
  assert_equal('DARKHH', t.buf)
195
- t.puts(' QQ')
235
+ assert_equal(4, t.sendline(' QQ'))
196
236
  assert_equal("DARKHH QQ\n", t.buf)
237
+ assert_equal(1, t.sendline(''))
238
+ assert_equal("DARKHH QQ\n\n", t.buf)
239
+ end
240
+
241
+ def test_puts
242
+ t = hello_tube
243
+ assert_equal(1, t.puts)
244
+ assert_equal("\n", t.buf)
245
+ assert_equal(17, t.puts("darkhh i4 so sad\n"))
246
+ assert_equal("\ndarkhh i4 so sad\n", t.buf)
247
+
248
+ t = hello_tube
249
+ assert_equal(14, t.puts('shik', 'hao', '', 123))
250
+ assert_equal("shik\nhao\n\n123\n", t.buf)
251
+
252
+ t = hello_tube
253
+ assert_equal(15, t.puts(['shik', '', "\n", 'hao', 123]))
254
+ assert_equal("shik\n\n\nhao\n123\n", t.buf)
255
+ assert_equal(0, t.puts([]))
256
+ assert_equal("shik\n\n\nhao\n123\n", t.buf)
257
+
258
+ t = hello_tube
259
+ assert_equal(20, t.puts(["darkhh\n\n", 'wei shi', 360]))
260
+ assert_equal("darkhh\n\nwei shi\n360\n", t.buf)
261
+
262
+ context.local(newline: '!!!') do
263
+ t = hello_tube
264
+ assert_equal(5, t.puts('hi'))
265
+ assert_equal('hi!!!', t.buf)
266
+ end
197
267
  end
198
268
 
199
269
  FLAG_FILE = File.expand_path('../data/flag', __dir__)
@@ -204,11 +274,11 @@ class TubeTest < MiniTest::Test
204
274
  begin
205
275
  t = basic_tube
206
276
  t.interact
207
- rescue EOFError
277
+ rescue ::Pwnlib::Errors::EndOfTubeError
208
278
  t.io.rewind
209
279
  assert_equal(IO.binread(FLAG_FILE), t.io.read)
210
280
  end
211
- assert_equal("[INFO] Switching to interactive mode\n", @log.string)
281
+ assert_equal("[INFO] Switching to interactive mode\n[INFO] Got EOF in interactive mode\n", @log.string)
212
282
  $stdin.close
213
283
  t.io.close
214
284
  $stdin = save_stdin
@@ -222,13 +292,13 @@ class TubeTest < MiniTest::Test
222
292
  @log.clear
223
293
  begin
224
294
  t = basic_tube
225
- t.instance_variable_set(:@fakeio, File.new(FLAG_FILE, File::RDONLY))
295
+ t.instance_variable_set(:@io, File.new(FLAG_FILE, File::RDONLY))
226
296
  t.interact
227
- rescue EOFError
297
+ rescue ::Pwnlib::Errors::EndOfTubeError
228
298
  $stdout.rewind
229
299
  assert_equal(IO.binread(FLAG_FILE), $stdout.read)
230
300
  end
231
- assert_equal("[INFO] Switching to interactive mode\n", @log.string)
301
+ assert_equal("[INFO] Switching to interactive mode\n[INFO] Got EOF in interactive mode\n", @log.string)
232
302
  $stdout.close
233
303
  t.io.close
234
304
  $stdin = save_stdin
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwntools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - peter50216@gmail.com
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-11-02 00:00:00.000000000 Z
13
+ date: 2018-08-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: crabstone
@@ -30,16 +30,22 @@ dependencies:
30
30
  name: dentaku
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - "~>"
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: 2.0.11
36
+ - - "<"
37
+ - !ruby/object:Gem::Version
38
+ version: 3.3.0
36
39
  type: :runtime
37
40
  prerelease: false
38
41
  version_requirements: !ruby/object:Gem::Requirement
39
42
  requirements:
40
- - - "~>"
43
+ - - ">="
41
44
  - !ruby/object:Gem::Version
42
45
  version: 2.0.11
46
+ - - "<"
47
+ - !ruby/object:Gem::Version
48
+ version: 3.3.0
43
49
  - !ruby/object:Gem::Dependency
44
50
  name: elftools
45
51
  requirement: !ruby/object:Gem::Requirement
@@ -69,33 +75,67 @@ dependencies:
69
75
  - !ruby/object:Gem::Version
70
76
  version: '0.9'
71
77
  - !ruby/object:Gem::Dependency
72
- name: rainbow
78
+ name: method_source
73
79
  requirement: !ruby/object:Gem::Requirement
74
80
  requirements:
75
81
  - - "~>"
76
82
  - !ruby/object:Gem::Version
77
- version: '2.2'
83
+ version: '0.9'
78
84
  type: :runtime
79
85
  prerelease: false
80
86
  version_requirements: !ruby/object:Gem::Requirement
81
87
  requirements:
82
88
  - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '0.9'
91
+ - !ruby/object:Gem::Dependency
92
+ name: rainbow
93
+ requirement: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '2.2'
98
+ - - "<"
99
+ - !ruby/object:Gem::Version
100
+ version: '4.0'
101
+ type: :runtime
102
+ prerelease: false
103
+ version_requirements: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
83
106
  - !ruby/object:Gem::Version
84
107
  version: '2.2'
108
+ - - "<"
109
+ - !ruby/object:Gem::Version
110
+ version: '4.0'
85
111
  - !ruby/object:Gem::Dependency
86
- name: codeclimate-test-reporter
112
+ name: ruby2ruby
87
113
  requirement: !ruby/object:Gem::Requirement
88
114
  requirements:
89
115
  - - "~>"
90
116
  - !ruby/object:Gem::Version
91
- version: '0.6'
92
- type: :development
117
+ version: '2.4'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.4'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubyserial
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.5'
132
+ type: :runtime
93
133
  prerelease: false
94
134
  version_requirements: !ruby/object:Gem::Requirement
95
135
  requirements:
96
136
  - - "~>"
97
137
  - !ruby/object:Gem::Version
98
- version: '0.6'
138
+ version: '0.5'
99
139
  - !ruby/object:Gem::Dependency
100
140
  name: minitest
101
141
  requirement: !ruby/object:Gem::Requirement
@@ -144,14 +184,14 @@ dependencies:
144
184
  requirements:
145
185
  - - "~>"
146
186
  - !ruby/object:Gem::Version
147
- version: '0.49'
187
+ version: '0.55'
148
188
  type: :development
149
189
  prerelease: false
150
190
  version_requirements: !ruby/object:Gem::Requirement
151
191
  requirements:
152
192
  - - "~>"
153
193
  - !ruby/object:Gem::Version
154
- version: '0.49'
194
+ version: '0.55'
155
195
  - !ruby/object:Gem::Dependency
156
196
  name: simplecov
157
197
  requirement: !ruby/object:Gem::Requirement
@@ -219,6 +259,7 @@ files:
219
259
  - lib/pwnlib/context.rb
220
260
  - lib/pwnlib/dynelf.rb
221
261
  - lib/pwnlib/elf/elf.rb
262
+ - lib/pwnlib/errors.rb
222
263
  - lib/pwnlib/ext/array.rb
223
264
  - lib/pwnlib/ext/helper.rb
224
265
  - lib/pwnlib/ext/integer.rb
@@ -237,9 +278,12 @@ files:
237
278
  - lib/pwnlib/shellcraft/generators/amd64/common/pushstr_array.rb
238
279
  - lib/pwnlib/shellcraft/generators/amd64/common/ret.rb
239
280
  - lib/pwnlib/shellcraft/generators/amd64/common/setregs.rb
281
+ - lib/pwnlib/shellcraft/generators/amd64/linux/cat.rb
240
282
  - lib/pwnlib/shellcraft/generators/amd64/linux/execve.rb
283
+ - lib/pwnlib/shellcraft/generators/amd64/linux/exit.rb
241
284
  - lib/pwnlib/shellcraft/generators/amd64/linux/linux.rb
242
285
  - lib/pwnlib/shellcraft/generators/amd64/linux/ls.rb
286
+ - lib/pwnlib/shellcraft/generators/amd64/linux/open.rb
243
287
  - lib/pwnlib/shellcraft/generators/amd64/linux/sh.rb
244
288
  - lib/pwnlib/shellcraft/generators/amd64/linux/syscall.rb
245
289
  - lib/pwnlib/shellcraft/generators/helper.rb
@@ -250,9 +294,12 @@ files:
250
294
  - lib/pwnlib/shellcraft/generators/i386/common/pushstr.rb
251
295
  - lib/pwnlib/shellcraft/generators/i386/common/pushstr_array.rb
252
296
  - lib/pwnlib/shellcraft/generators/i386/common/setregs.rb
297
+ - lib/pwnlib/shellcraft/generators/i386/linux/cat.rb
253
298
  - lib/pwnlib/shellcraft/generators/i386/linux/execve.rb
299
+ - lib/pwnlib/shellcraft/generators/i386/linux/exit.rb
254
300
  - lib/pwnlib/shellcraft/generators/i386/linux/linux.rb
255
301
  - lib/pwnlib/shellcraft/generators/i386/linux/ls.rb
302
+ - lib/pwnlib/shellcraft/generators/i386/linux/open.rb
256
303
  - lib/pwnlib/shellcraft/generators/i386/linux/sh.rb
257
304
  - lib/pwnlib/shellcraft/generators/i386/linux/syscall.rb
258
305
  - lib/pwnlib/shellcraft/generators/x86/common/common.rb
@@ -261,15 +308,20 @@ files:
261
308
  - lib/pwnlib/shellcraft/generators/x86/common/pushstr.rb
262
309
  - lib/pwnlib/shellcraft/generators/x86/common/pushstr_array.rb
263
310
  - lib/pwnlib/shellcraft/generators/x86/common/setregs.rb
311
+ - lib/pwnlib/shellcraft/generators/x86/linux/cat.rb
264
312
  - lib/pwnlib/shellcraft/generators/x86/linux/execve.rb
313
+ - lib/pwnlib/shellcraft/generators/x86/linux/exit.rb
265
314
  - lib/pwnlib/shellcraft/generators/x86/linux/linux.rb
266
315
  - lib/pwnlib/shellcraft/generators/x86/linux/ls.rb
316
+ - lib/pwnlib/shellcraft/generators/x86/linux/open.rb
267
317
  - lib/pwnlib/shellcraft/generators/x86/linux/sh.rb
268
318
  - lib/pwnlib/shellcraft/generators/x86/linux/syscall.rb
269
319
  - lib/pwnlib/shellcraft/registers.rb
270
320
  - lib/pwnlib/shellcraft/shellcraft.rb
271
321
  - lib/pwnlib/timer.rb
272
322
  - lib/pwnlib/tubes/buffer.rb
323
+ - lib/pwnlib/tubes/process.rb
324
+ - lib/pwnlib/tubes/serialtube.rb
273
325
  - lib/pwnlib/tubes/sock.rb
274
326
  - lib/pwnlib/tubes/tube.rb
275
327
  - lib/pwnlib/util/cyclic.rb
@@ -313,9 +365,12 @@ files:
313
365
  - test/memleak_test.rb
314
366
  - test/reg_sort_test.rb
315
367
  - test/shellcraft/infloop_test.rb
368
+ - test/shellcraft/linux/cat_test.rb
316
369
  - test/shellcraft/linux/ls_test.rb
317
370
  - test/shellcraft/linux/sh_test.rb
318
371
  - test/shellcraft/linux/syscalls/execve_test.rb
372
+ - test/shellcraft/linux/syscalls/exit_test.rb
373
+ - test/shellcraft/linux/syscalls/open_test.rb
319
374
  - test/shellcraft/linux/syscalls/syscall_test.rb
320
375
  - test/shellcraft/memcpy_test.rb
321
376
  - test/shellcraft/mov_test.rb
@@ -330,6 +385,8 @@ files:
330
385
  - test/test_helper.rb
331
386
  - test/timer_test.rb
332
387
  - test/tubes/buffer_test.rb
388
+ - test/tubes/process_test.rb
389
+ - test/tubes/serialtube_test.rb
333
390
  - test/tubes/sock_test.rb
334
391
  - test/tubes/tube_test.rb
335
392
  - test/util/cyclic_test.rb
@@ -358,7 +415,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
358
415
  version: '0'
359
416
  requirements: []
360
417
  rubyforge_project:
361
- rubygems_version: 2.5.2
418
+ rubygems_version: 2.7.6
362
419
  signing_key:
363
420
  specification_version: 4
364
421
  summary: pwntools
@@ -390,9 +447,12 @@ test_files:
390
447
  - test/shellcraft/ret_test.rb
391
448
  - test/shellcraft/popad_test.rb
392
449
  - test/shellcraft/nop_test.rb
450
+ - test/shellcraft/linux/cat_test.rb
393
451
  - test/shellcraft/linux/ls_test.rb
394
452
  - test/shellcraft/linux/sh_test.rb
453
+ - test/shellcraft/linux/syscalls/open_test.rb
395
454
  - test/shellcraft/linux/syscalls/syscall_test.rb
455
+ - test/shellcraft/linux/syscalls/exit_test.rb
396
456
  - test/shellcraft/linux/syscalls/execve_test.rb
397
457
  - test/shellcraft/shellcraft_test.rb
398
458
  - test/shellcraft/pushstr_test.rb
@@ -412,7 +472,9 @@ test_files:
412
472
  - test/util/lists_test.rb
413
473
  - test/timer_test.rb
414
474
  - test/tubes/sock_test.rb
475
+ - test/tubes/serialtube_test.rb
415
476
  - test/tubes/buffer_test.rb
477
+ - test/tubes/process_test.rb
416
478
  - test/tubes/tube_test.rb
417
479
  - test/abi_test.rb
418
480
  - test/files/use_pwnlib.rb