Skip to content

Instantly share code, notes, and snippets.

@glennzw
Created April 14, 2018 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save glennzw/1e1f17b05cbe57c5f5ba08f7f2c4c494 to your computer and use it in GitHub Desktop.
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.
#!/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