I had it figured out a few minutes after this post… i didnt know the
differnce between a string and array… i convert the array to a string
then used compact
i thought i was working the string class so i was reading threw the
wrong page…
any ways… because of this premature post, i spent a few hours try to
solve a new problem before i ask for help…
strings=“a9digh0t5”
every 3 bytes i need broke into separate strings[x]
#server.rb
require ‘socket’ # Get sockets from stdlib
server = TCPServer.open(2000) # Socket to listen on port 2000
loop { # Servers run forever
Thread.start(server.accept) do |client|
file = File.new(’/pentest/windows-binaries/tools/test.exe’)
fileContent = file.read # reads the file
client.puts(fileContent)
client.close
end
}
#client
require ‘socket’
host = ‘192.168.1.4’
port = 2000
sock = TCPSocket.open(host, port)
data = sock.recvfrom(999999)
destFile = File.open(’/tmp/poop.exe’, ‘wb’)
destFile.print data
destFile.close
Ok, just to show you what im working with… it works, but there is a
file size limit when working with recvfrom()
im trying to work out a function to check file size then brake the data
into blocks…
I had it figured out a few minutes after this post… i didnt know the
differnce between a string and array… i convert the array to a string
then used compact
Ridiculous. You would never compact an array just to get the first
element. If you want the first element, then grab it. See Bertram’s
posts.
i thought i was working the string class so i was reading threw the
wrong page…
any ways… because of this premature post, i spent a few hours try to
solve a new problem before i ask for help…
strings=“a9digh0t5”
every 3 bytes i need broke into separate strings[x]
I had it figured out a few minutes after this post… i didnt know the
differnce between a string and array… i convert the array to a string
then used compact
Ridiculous. You would never compact an array just to get the first
element. If you want the first element, then grab it. See Bertram’s
posts.
i thought i was working the string class so i was reading threw the
wrong page…
any ways… because of this premature post, i spent a few hours try to
solve a new problem before i ask for help…
strings=“a9digh0t5”
every 3 bytes i need broke into separate strings[x]
I think 7stud is being sarcastic… He thinks the compact is
unnecessary, and is explaining his point by introducing other
unnecessary elements like inject.