-2

I have written a (very) simple python scrip using xmpppy to try and make an xmpp(jabber) account brute forcer but when I try to run it I get:

line 5 print "Syntax: xsend JID text" SyntaxError: invalid syntax.

Any Ideas what I am doing wrong?

#!/usr/bin/python
# -*- coding by unknown-error -*-
import sys,os,xmpp
if len(sys.argv) < 2:
    print "Syntax: xsend JID text"
    sys.exit(0)

tojid=sys.argv[1]
text=' '.join(sys.argv[2:])

jidparams={}
if os.access(os.environ['HOME']+'/.xsend',os.R_OK):
    for ln in open(os.environ['HOME']+'/.xsend').readlines():
        key,val=ln.strip().split('=',1)
        jidparams[key.lower()]=val
for mandatory in ['jid']:
    if mandatory not in jidparams.keys():
        open(os.environ['HOME']+'/.xsend','w').write('#JID=romeo@montague.net')
        print 'Please ensure the ~/.xsend file has valid JID for sending messages.'
        sys.exit(0)
jid=xmpp.protocol.JID(jidparams['jid'])
cl=xmpp.Client(jid.getDomain(),debug=[])

file_name=raw_input("passwords.txt")
f=open(file_name,"r")
a= for name in f
        a:
            cl.connect()
        cl.auth(jid.getNode(),jidparams['password' = a])
        except self._session_state=SESSION_NOT_AUTHED:
            continue
        else:
            print " - password ---->>> "+'password'
            break

1 Answers1

1

Just to quote the manual on "what's new in Python 3".

Print Is A Function The print statement has been replaced with a print() function, with keyword arguments to replace most of the special syntax of the old print statement (PEP 3105).

So simply use print(...) wherever you've used print ....

For more information consult the documentation

Ps. asking on stackoverflow for brute forcers are likely to receive down votes on principle.

EWit
  • 1,954
  • 13
  • 22
  • 19
  • I don't really understand why do you say asking about brute forcers in stackoverflow would lead to down votes. From my point of view, brute forcers, as wire cutters, can be used by good people for good means. – Felipower Jan 01 '16 at 11:55