Last active
December 10, 2016 16:35
-
-
Save shlaikov/129d4149720a858d7e8ee484c1423008 to your computer and use it in GitHub Desktop.
One of CTF tasks/ Python3 script
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
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC8AAAABCAIAAADB42C9AAAAVElEQVR42jWMOwqAMBAF5yjpbMQrWNnaWwoKpknAD+LtXQYCWwzDvAVmqHBDgksOOGCFEzboNa8mggJd67Mwyovbx1UyLvYx3JvMmuSqelN7+8HwA2+IEHzgr4OjAAAAAElFTkSuQmCC |
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
from PIL import Image | |
def main(): | |
image = Image.open("image.png") | |
pixel = image.load() | |
width, height = image.size | |
arr = [] | |
for i in range(width): | |
arr.append("".join(str(pixel[i, 0][2])).strip(" ")) | |
flag = "".join([chr(int(item)) for item in arr]) | |
print flag | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment