Skip to content

Instantly share code, notes, and snippets.

@idem2lyon
Forked from haxwithaxe/outgress.py
Created October 19, 2020 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idem2lyon/0fdf947d6a6dbae70b7c05c86ba74891 to your computer and use it in GitHub Desktop.
Save idem2lyon/0fdf947d6a6dbae70b7c05c86ba74891 to your computer and use it in GitHub Desktop.
An adapter from outgress to IFTTT Maker action. Use as a cgi and set the destination to it in outgress.
import cgi
import requests
__author__ = 'haxwithaxe <spam@haxwithaxe.net>'
__license__ = 'GPLv3'
IFTTT_TRIGGER = '<your maker action name here>'
IFTTT_API_KEY = '<your Maker action key here>'
URL = 'https://maker.ifttt.com/trigger/{trigger}/with/key/{api_key}'
def relay_alert():
form = cgi.FieldStorage()
alert = {
'value1': form.getvalue('portal_name'),
'value2': form.getvalue('attacker'),
'value3': form.getvalue('alert_name')
}
requests.post(URL.format(trigger=IFTTT_TRIGGER, api_key=IFTTT_API_KEY), data=alert)
if __name__ == '__main__':
try:
relay_alert()
except:
print('Content-Type: text/plain\nStatus-Code: 500\n\nDerp\n')
else:
print('Content-Type: text/plain\nStatus-Code: 201\n\nCreated\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment