Created
April 14, 2018 19:54
-
-
Save glennzw/1e1f17b05cbe57c5f5ba08f7f2c4c494 to your computer and use it in GitHub Desktop.
Hack to allow us to load icon images in Maltego by following the redirect and serving up the actual image.
This file contains hidden or 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/env/python | |
# -*- coding: utf-8 -*- | |
# Hack to allow us to load icon images in Maltego by following | |
# the redirect and serving up the actual image. | |
from flask import Flask, send_file | |
import requests | |
app = Flask(__name__) | |
@app.route('/fb/pic/<id>') | |
def getPicURL(id): | |
"Pass Facebook ID, get profile photo" | |
r = requests.get("https://graph.facebook.com/%s/picture" % id) | |
url = r.url | |
response = requests.get(url, stream=True) | |
return send_file(response.raw, mimetype='image/gif') | |
return response.raw | |
if __name__ == "__main__": | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment