X-Git-Url: http://git.maemo.org/git/?p=pwnitter;a=blobdiff_plain;f=pwnitter.py;h=a007b0bcd98df9d9e42bf951e70c21f9a9455f8c;hp=c363a2378081c71031072141f34deceec675b305;hb=64bb8f25a382fbed7f29f59c5e6b050f9dd15748;hpb=3a4127ceda883251f58d8ddb180aae185710f1b7 diff --git a/pwnitter.py b/pwnitter.py index c363a23..a007b0b 100755 --- a/pwnitter.py +++ b/pwnitter.py @@ -118,17 +118,25 @@ class Pwnitter(dbus.service.Object): hostMatches = re.search('Host: ((?:api|mobile|www)?\.?twitter\.com)', data) if hostMatches: - log.debug('Host matched') host = hostMatches.group(1) - + log.debug('Host matched %s', host) + + user_agent_matches = re.search('User-Agent: ([^\n]+)', data) + if user_agent_matches: + user_agent = user_agent_matches.group(1) + log.debug('Found UserAgent: %s', user_agent) + else: + user_agent = "Mozilla/5.0" + cookieMatches = re.search('Cookie: ([^\n]+)', data) log.debug('CookieMatches? %r', cookieMatches) + if cookieMatches: cookie = cookieMatches.group(1) log.debug('yummie Cookie %r', cookie) headers = { - "User-Agent": "Mozilla/5.0", + "User-Agent": user_agent, "Cookie": cookie, } @@ -138,6 +146,9 @@ class Pwnitter(dbus.service.Object): log.error(e) else: log.debug('Connected to host %s', host) + #log.debug("%s", page) + if '''