-
-
Save AndyNovo/31698cd5256b049231f988f84502ccc6 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
from PIL import Image | |
im=Image.open("imgflag.png") | |
w,h=im.size | |
pixels=[] | |
for i in range(w): | |
for j in range(h): | |
pixels.append(im.getpixel((i,j))) | |
f=file("loader.sql","w") | |
f.write("create table size (height int, width int);\n") | |
f.write("insert into size values (%d, %d);\n" % (w,h)) | |
f.write("create table pixels (indx integer primary key autoincrement, red integer, green integer, blue integer);\n") | |
for triple in pixels: | |
f.write("insert into pixels (red, green, blue) values (%d, %d, %d);\n" % triple) | |
f.close() | |
import os | |
os.system("sqlite3 flag.db < loader.sql") |
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
https://websec.prof.ninja/sql/flag.db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment