Skip to content

Commit

Permalink
恶搞钓鱼网站
Browse files Browse the repository at this point in the history
  • Loading branch information
gxcuizy committed Sep 3, 2021
1 parent a136530 commit b59d476
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 0 deletions.
10 changes: 10 additions & 0 deletions 恶搞钓鱼网站/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### 文件结构

```
├── zhapian.py # 代码脚本
├── chromedriver.exe # Chrome浏览器驱动
```

### 交流学习

如有写的不对或者错误的地方,希望大家指正,相互交流,谢谢。
Binary file added 恶搞钓鱼网站/chromedriver.exe
Binary file not shown.
61 changes: 61 additions & 0 deletions 恶搞钓鱼网站/zhapian.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
模拟手机浏览器刷钓鱼诈骗网站
author: gxcuizy
date: 2021-09-03
"""

from selenium import webdriver
import random


class PreventFraud(object):
"""刷钓鱼网站数据类"""

def __init__(self):
"""定义实例属性,初始化"""
# 初始化浏览器驱动
self.chrome_option = webdriver.ChromeOptions()
self.chrome_option.add_experimental_option('mobileEmulation', {'deviceName': 'iPhone X'})
self.driver = None
# 网站
self.url = 'https://tz8gnkznst.bsj138168.xyz/x_kms.asp'

def open_url(self, id_card):
"""打开网址,并输入信息"""
self.driver = webdriver.Chrome(executable_path='chromedriver.exe', chrome_options=self.chrome_option)
self.driver.get(self.url)
# 输入身份证
self.driver.find_element_by_id("accountNo").send_keys(id_card)
# 提交下一步
self.driver.find_element_by_id("btn").click()
# 输入银行卡相关信息
self.driver.find_element_by_id("xmxm").send_keys(self.get_user_name())
self.driver.find_element_by_id("t4").send_keys('42010119850414' + str(random.randint(1000, 9999)))
self.driver.find_element_by_id("t5").send_keys('1571664' + str(random.randint(1000, 9999)))
self.driver.find_element_by_id("t3").send_keys(random.randint(100000, 999999))
self.driver.find_element_by_id("je").send_keys(random.randint(10000, 99999))
# 同意提交
self.driver.find_element_by_xpath("//div[@class='tjbtn']/input[1]").click()
# 关闭浏览器
self.driver.close()

def get_user_name(self):
"""随机生成姓名"""
head = random.randint(0xb0, 0xf7)
body = random.randint(0xa1, 0xfe)
val = f'{head:x}{body:x}'
return bytes.fromhex(val).decode('gb2312') + bytes.fromhex(val).decode('gb2312')

def run(self):
"""脚本执行方法"""
while True:
self.open_url('622202075661528' + str(random.randint(1000, 9999)))


# 程序主入口
if __name__ == "__main__":
obj = PreventFraud()
obj.run()

0 comments on commit b59d476

Please sign in to comment.