-
-
Save AndyNovo/e12854da8cb390fa3b31d17ccda30b4b 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 | |
pal_im=Image.open("imgflag.png") | |
im = pal_im.convert('RGB') | |
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
wget https://websec.prof.ninja/fall2022/sql/flag.db |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment