mirror of https://github.com/nealey/firebot
Add HTTP proxy stuff
This commit is contained in:
parent
6ef32e3368
commit
ff7fa92750
14
arsenic.py
14
arsenic.py
|
@ -11,6 +11,10 @@ import os
|
||||||
import time
|
import time
|
||||||
import socket
|
import socket
|
||||||
import rp
|
import rp
|
||||||
|
import random
|
||||||
|
import webretriever
|
||||||
|
|
||||||
|
webretriever.proxy = ('proxyout.lanl.gov', 8080)
|
||||||
|
|
||||||
def esc(arg):
|
def esc(arg):
|
||||||
return "'" + arg.replace("'", r"'\''") + "'"
|
return "'" + arg.replace("'", r"'\''") + "'"
|
||||||
|
@ -72,6 +76,16 @@ class Arsenic(firebot.FireBot, ProcBot):
|
||||||
lag))
|
lag))
|
||||||
|
|
||||||
|
|
||||||
|
def pii(self, sender, forum, addl, match):
|
||||||
|
ssns = []
|
||||||
|
for i in range(10):
|
||||||
|
ssns.append('%03d-%02d-%04d' % (random.randint(1, 999),
|
||||||
|
random.randint(1, 99),
|
||||||
|
random.randint(1, 9999)))
|
||||||
|
forum.msg('Security incident! %s' % ' '.join(ssns))
|
||||||
|
bindings.append((re.compile(r'^pii$'),
|
||||||
|
pii))
|
||||||
|
|
||||||
bindings.extend(firebot.FireBot.bindings)
|
bindings.extend(firebot.FireBot.bindings)
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
|
@ -7,11 +7,18 @@ import socket
|
||||||
|
|
||||||
resolver = adns.init()
|
resolver = adns.init()
|
||||||
|
|
||||||
|
proxy = None
|
||||||
|
|
||||||
class WebRetriever(asynchat.async_chat):
|
class WebRetriever(asynchat.async_chat):
|
||||||
def __init__(self, url, body_cb):
|
def __init__(self, url, body_cb):
|
||||||
asynchat.async_chat.__init__(self)
|
asynchat.async_chat.__init__(self)
|
||||||
self.body_cb = body_cb
|
self.body_cb = body_cb
|
||||||
self.url = url
|
if proxy:
|
||||||
|
self.host, self.port = proxy
|
||||||
|
self.query = ''
|
||||||
|
self.fragment = ''
|
||||||
|
self.path = url
|
||||||
|
else:
|
||||||
(self.scheme,
|
(self.scheme,
|
||||||
self.netloc,
|
self.netloc,
|
||||||
self.path,
|
self.path,
|
||||||
|
|
Loading…
Reference in New Issue