echo -e '*1\r\n$4\r\nPING\r\n' | nc redis.host.com 6379
Created
July 4, 2018 08:03
-
-
Save eeddaann/6e2b70e36f7586a556487f663b97760e to your computer and use it in GitHub Desktop.
Test connection to Redis with netcat
Thanks!
If redis has a password:
$ echo -e 'AUTH password-here\r\n*1\r\n$4\r\nPING\r\n' | nc -w1 127.0.0.1 6379
+OK
+PONG
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah I saw it working about 1 time in 5, but the sleep fixes that. Or this command works instantly:
exec 3<>/dev/tcp/redis.host.com/6379 && echo -e "PING\r\n" >&3 && head -c 7 <&3
That's from this answer which uses a file descriptor bash tcp trick