Last active
August 29, 2015 14:00
-
-
Save zmc/11016140 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
This is a test case for http://tracker.ceph.com/issues/8116 | |
It will base64-decode the payload, then attempt to ssh to your local machine | |
and read it via teuthology-wrapped paramiko | |
""" | |
import base64 | |
import subprocess | |
from teuthology.orchestra.remote import Remote | |
from teuthology.orchestra.run import run | |
bad_file_name = '/tmp/monmap.bad' | |
hostname = subprocess.Popen('hostname', stdout=subprocess.PIPE)\ | |
.stdout.read().strip() | |
payload_64 = "AwPPAQAAQI2cVYjRQbCFPRWK4PPnBwAAAAADAAAAAQAAAGEAAAAAAAAAAAACGoUK1opHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAGIAAAAAAAAAAAACGoUK1opEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAGMAAAAAAAAAAAACGoYK1opHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAfR5QUxiAwAZ9HlBTGIDABg==" # noqa | |
with file(bad_file_name, 'w') as bad_file: | |
payload = base64.b64decode(payload_64) | |
bad_file.write(payload) | |
remote = Remote(hostname) | |
conn = remote.connect() | |
run(conn, ['cat', '--', bad_file_name]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment