Skip to content
Advertisement

Abuse cURL to communicate with Redis

I want to send a PING to Redis to check if the connection is working, now I could just install redis-cli, but I don’t want to and curl is already there. So how can I abuse curl to do that? Basically I need to turn off what’s send here:

JavaScript

I was able to get rid of the User-Agent altogether by adding -A "", but I can’t find anything else for the rest. Any idea how I can do that?

Advertisement

Answer

When you want to use curl, you need REST over RESP, like webdis, tinywebdis or turbowebdis. See https://github.com/markuman/tinywebdis#turbowebdis-tinywebdis–cherrywebdis

JavaScript

Without a REST interface for redis, you can use netcat for example.

JavaScript

For password protected redis you can use netcat like this:

JavaScript

With netcat you have to build the RESP protocol by your self. See http://redis.io/topics/protocol

update 2018-01-09

I’ve build a powerfull bash function which pings the redis instance at any cost over tcp

JavaScript

usage redis-ping localhost

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement