summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2014-07-08 18:29:19 +0200
committermakefu <github@syntax-fehler.de>2014-07-08 18:29:19 +0200
commitfcf4a7f64463a8190260ab2c138e428f07cadee7 (patch)
tree938f718f0fffa71493e86ca42afdd0d6596afbcd
parent033ce69ba717841f5c9834f4680cdd6db625ce4b (diff)
parentda8f9b0ea4c73aa90244f8e9eba4d1f5af9af611 (diff)
Merge branch 'master' of ssh://github.com/krebscode/painload
-rw-r--r--Reaktor/IRC/ircasy.py24
-rwxr-xr-xReaktor/commands/taken28
-rwxr-xr-xReaktor/commands/whois4
m---------Reaktor/repos/dnsrecon0
m---------Reaktor/repos/view-website0
-rwxr-xr-xReaktor/titlebot/commands/undo2
-rwxr-xr-xReaktor/titlebot/commands/up2
-rw-r--r--Reaktor/titlebot/titlebot.py5
-rwxr-xr-xutil/t/anonbox.net/got-some-valid-looking-email2
9 files changed, 55 insertions, 12 deletions
diff --git a/Reaktor/IRC/ircasy.py b/Reaktor/IRC/ircasy.py
index 9a7f44f3..99fbc324 100644
--- a/Reaktor/IRC/ircasy.py
+++ b/Reaktor/IRC/ircasy.py
@@ -89,15 +89,22 @@ class asybot(asychat):
self.data += data.decode()
except Exception as e:
print('error decoding message: ' + str(e));
+ print('current data: %s' % self.data);
+ print('received data: %s' % data);
+ print('trying to decode as latin1')
+ self.data += data.decode('latin1')
def found_terminator(self):
self.log.debug('<< %s' % self.data)
message = self.data
self.data = ''
-
- _, prefix, command, params, rest, _ = \
- split('^(?::(\S+)\s)?(\S+)((?:\s[^:]\S*)*)(?:\s:(.*))?$', message)
+ try:
+ _, prefix, command, params, rest, _ = \
+ split('^(?::(\S+)\s)?(\S+)((?:\s[^:]\S*)*)(?:\s:(.*))?$', message)
+ except Exception as e:
+ print("cannot split message :(\nmsg: %s"%message)
+ return
params = params.split(' ')[1:]
if command == 'PING':
@@ -126,10 +133,13 @@ class asybot(asychat):
self.reset_alarm()
def push(self, message):
- self.log.debug('>> %s' % message)
- msg = (message + self.myterminator).encode()
- self.log.debug('>> %s' % msg)
- asychat.push(self, msg)
+ try:
+ self.log.debug('>> %s' % message)
+ msg = (message + self.myterminator).encode()
+ self.log.debug('>> %s' % msg)
+ asychat.push(self, msg)
+ except:
+ pass
def disconnect(self):
self.push('QUIT')
diff --git a/Reaktor/commands/taken b/Reaktor/commands/taken
new file mode 100755
index 00000000..b8beba68
--- /dev/null
+++ b/Reaktor/commands/taken
@@ -0,0 +1,28 @@
+#!/bin/sh
+#!/bin/bash
+
+# domainavailable
+# Fast, domain name checker to use from the shell
+# Use globs for real fun:
+# domainavailable blah{1..3}.{com,net,org,co.uk}
+# Inspired by foca / giles:
+# http://gilesbowkett.blogspot.com/2009/02/simple-bash-domain-availability.html
+
+for d in $@;
+do
+if host "$d" | grep "NXDOMAIN" >&/dev/null; then
+ w=$(whois "$d")
+ if ! test "$?" -eq 0 ;then
+ echo "$d - whois not available"
+ elif echo "$w" | grep -Ei "(No match|NOT FOUND|Status: free)" >&/dev/null; then
+ echo "$d available";
+ elif echo "$w"| grep -Ei "(Status: invalid)" >&/dev/null ;then
+ echo "$d invalid"
+ else
+ echo "$d taken";
+ fi
+else
+ echo "$d taken";
+fi
+done
+exit 0
diff --git a/Reaktor/commands/whois b/Reaktor/commands/whois
new file mode 100755
index 00000000..b0733891
--- /dev/null
+++ b/Reaktor/commands/whois
@@ -0,0 +1,4 @@
+#!/bin/sh
+(! type whois >/dev/null 2>/dev/null) && echo "whois does not exist" && exit 0
+
+whois "${1?usage: $0 domain}" | sed -e '/^$/d' -e '/^%/d' -e '/^Nserver/d' -e 's/^\[.*/---/' -e '/^Changed/d' -e '/^Status/d' -e '/^Type/d' -e '/^PostalCode/d' -e '/^Phone/d' -e '/^Fax/d' -e '/Last update of WHOIS database/Q' -e '/ID:/d'
diff --git a/Reaktor/repos/dnsrecon b/Reaktor/repos/dnsrecon
-Subproject 31de30e4f6674585676c841c5612a330c22de94
+Subproject a6a5a5e7f6d03cf3430a75d461c76ae0f76cf94
diff --git a/Reaktor/repos/view-website b/Reaktor/repos/view-website
-Subproject a3892837aabd5d95e997c0fd2526096f685669f
+Subproject f62601b09882efdd273ee2cbf6625734cf1e316
diff --git a/Reaktor/titlebot/commands/undo b/Reaktor/titlebot/commands/undo
index a66de67f..e1b0abab 100755
--- a/Reaktor/titlebot/commands/undo
+++ b/Reaktor/titlebot/commands/undo
@@ -15,7 +15,7 @@ except:
print("""usage: undo number (...)
undos vote of one or more entries based on .list""")
sys.exit(1)
-voter = environ['_prefix']
+voter = environ['_prefix'].split("@")[1]
voter_name = environ['_from']
for vote in votes:
try:
diff --git a/Reaktor/titlebot/commands/up b/Reaktor/titlebot/commands/up
index 0a48bdb0..7aff5944 100755
--- a/Reaktor/titlebot/commands/up
+++ b/Reaktor/titlebot/commands/up
@@ -15,7 +15,7 @@ if not votes:
upvotes one or more entries based on .list""")
sys.exit(1)
-voter = environ['_prefix']
+voter = environ['_prefix'].split("@")[1]
voter_name =environ['_from']
for vote in votes:
try:
diff --git a/Reaktor/titlebot/titlebot.py b/Reaktor/titlebot/titlebot.py
index c1eac3b0..41717484 100644
--- a/Reaktor/titlebot/titlebot.py
+++ b/Reaktor/titlebot/titlebot.py
@@ -6,7 +6,7 @@ debug = False
# CAVEAT name should not contains regex magic
name = 'bgt_titlebot'
-workdir = '/tmp/state'
+workdir = '/home/titlebot/state'
try:
mkdir(workdir)
@@ -68,7 +68,8 @@ public_commands = [
# identify via direct connect
{ 'capname': 'identify',
'pattern': '^identify' + '\\s*(?:\\s+(?P<args>.*))?$',
- 'argv' : [ 'commands/identify' ]}
+ 'argv' : [ 'commands/identify' ],
+ 'env':{'config_filename': config_filename}}
]
commands = [
default_command('reload'),
diff --git a/util/t/anonbox.net/got-some-valid-looking-email b/util/t/anonbox.net/got-some-valid-looking-email
index 4c3e7a11..e254687d 100755
--- a/util/t/anonbox.net/got-some-valid-looking-email
+++ b/util/t/anonbox.net/got-some-valid-looking-email
@@ -12,5 +12,5 @@ anonbox.net >$tempfile
} | {
IFS=@. read _logname subdomain domain
- echo "$uri" | grep -q "^https://$domain/$subdomain/[0-9a-f]*/$"
+ echo "$uri" | grep -q "^https://$domain/$subdomain/[^/][^/]*/$"
}