Sample Header Ad - 728x90

Weird behaviour of bash in Kali Terminal (Qt I think) - piping to nc ends with awaiting input forever

0 votes
1 answer
105 views
I've been trying to pipe bytecode to netcat (nc) like this:
python3 -c "import sys;bof='a'*16;bof2='a'*8;sys.stdout.buffer.write(bof.encode('ascii')+b'\xef\xbe\xad\xde'+bof2.encode('ascii')+b'\x21\x52\x54\x55\x55\x35')" | nc example.com 1337
But when I execute it my terminal prints out the program's output and as if it is awaiting input, but when I input my text and press enter nothing happens - it still awaits input. I've tried Ctrl+D to end it, I tried ', '"', ')'. It didn't work. Any clue why? Ctrl+C ends the execution but I think nothing is sent or at least the output isn't being printed out making it useless for me :( What I've also tried: Piping to xxd to check whether there's a mistake there, but nope it seems ok. I tried googling but apparently to no avail.
Asked by Sir Muffington (1306 rep)
Aug 23, 2022, 04:03 PM