Mahoni Mahoni - 1 year ago 857
HTTP Question

Abuse cURL to communicate with Redis

I want to send a

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

> GET / HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/ libidn/1.23 librtmp/2.3
> Host: localhost:6379
> Accept: */*
-ERR wrong number of arguments for 'get' command
-ERR unknown command 'User-Agent:'
-ERR unknown command 'Host:'
-ERR unknown command 'Accept:'

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

Answer Source

When you want to use curl, you need REST over RESP, like webdis, tinywebdis or turbowebdis. See

$ curl -w '\n'

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

$ (printf "PING\r\n";) | nc localhost 6379 

With netcat you have to build the RESP protocol by your self. See

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download