From 6a16cf96ba739097d1512e4fdd254aa69257a62c Mon Sep 17 00:00:00 2001 From: William Vu Date: Tue, 21 Jan 2014 11:35:53 -0600 Subject: [PATCH 1/2] Fix bug in fsupload Badchar analysis: file may contain form feeds. --- lib/rex/proto/pjl/client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rex/proto/pjl/client.rb b/lib/rex/proto/pjl/client.rb index 7ce5ec7003..0a85245af2 100644 --- a/lib/rex/proto/pjl/client.rb +++ b/lib/rex/proto/pjl/client.rb @@ -151,7 +151,7 @@ class Client @sock.put(%Q{#{FSUPLOAD} NAME = "#{pathname}" OFFSET=0 SIZE=#{size}\n}) - if @sock.get(DEFAULT_TIMEOUT) =~ /SIZE=\d+\r?\n(.*?)\f/m + if @sock.get(DEFAULT_TIMEOUT) =~ /SIZE=\d+\r?\n(.*)\f/m file = $1 end From dc4b4218b3464dde441ee87636291d7b52af2a27 Mon Sep 17 00:00:00 2001 From: William Vu Date: Tue, 21 Jan 2014 12:13:14 -0600 Subject: [PATCH 2/2] Make {COUNT,SIZE}_MAX more readable Good suggestion, @jlee-r7. --- lib/rex/proto/pjl.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/rex/proto/pjl.rb b/lib/rex/proto/pjl.rb index b1b548973e..5b771e8417 100644 --- a/lib/rex/proto/pjl.rb +++ b/lib/rex/proto/pjl.rb @@ -8,8 +8,8 @@ module Rex::Proto::PJL DEFAULT_PORT = 9100 DEFAULT_TIMEOUT = 5 - COUNT_MAX = 2147483647 - SIZE_MAX = 2147483647 + COUNT_MAX = 2_147_483_647 + SIZE_MAX = 2_147_483_647 UEL = "\e%-12345X" # Universal Exit Language PREFIX = "@PJL"