我已经使用 xmpppy 编写了一个(非常)简单的 python 脚本来尝试制作一个 xmpp(jabber)帐户暴力破解器,但是当我尝试运行它时,我得到:
第 5 行打印“语法:xsend JID 文本”语法错误:语法无效。
任何想法我做错了什么?
#!/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