Created
February 16, 2018 17:01
-
-
Save chadbrewbaker/8a2af91e9b0ec11f3bc81a5486513dda to your computer and use it in GitHub Desktop.
Script for SecDSM MiniCTF
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 | |
import io | |
import base64 | |
import pytesseract | |
URI = 'http://ctf.secdsm.org:5557' | |
from subprocess import call | |
import urllib | |
import urllib2 | |
response = urllib2.urlopen(URI) | |
html = response.read() | |
x = html.split('/') | |
y =filter(lambda k: 'png' in k, x) | |
img = y[0] | |
imgsplit = img.split() | |
print imgsplit[0] | |
theImage = imgsplit[0] | |
prefix = 'https://ctf.secdsm.org:5556/' | |
urllib.urlretrieve(prefix+theImage, theImage) | |
text = pytesseract.image_to_string(Image.open(theImage)) | |
print text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment