Repository: loseprivacy/loseprivacy-cli
Branch: master
Commit: 1fb7e42313f5
Files: 3
Total size: 10.3 KB
Directory structure:
gitextract_0le25gzs/
├── README.md
├── example.py
└── loseprivacy.py
================================================
FILE CONTENTS
================================================
================================================
FILE: README.md
================================================
# 免费社工库平台LosePrivacy源代码与API库
## 什么是LosePrivacy
[LosePrivacy](https://loseprivacy.icu)收录了近10多年全球著名的数据泄露事件及数据,方便用户真实掌握:我们哪些隐私信息被泄露了、隐私信息被谁泄露了。
## loseprivacy-cli
LosePrivacy-cli可以让用户通过命令行快速查询社工库平台的数据,安全、高效。
LosePrivacy-cli主要是基于LosePrivacy API v1的部分接口完成。关于LosePrivacy API的详细描述请移步:[LosePrivacy API](https://loseprivacy.github.io)。
## 下载
```
git clone https://github.com/loseprivacy/loseprivacy-cli
cd loseprivacy-cli
```
### 配置
打开example.py,填入参数apikey即可。
apikey可以到LosePrivacy的开发者中心中获取。
## 使用样例
搜索QQ号
```
search_qq(keyword)
```
搜索用户名/姓名
```
search_username(keyword)
```
搜索密码
```
search_password(keyword)
```
搜索手机号
```
search_phone(keyword)
```
搜索身份证号
```
search_identity(keyword)
```
搜索微博
```
search_weiboid(keyword)
```
搜索邮箱
```
search_email(keyword)
```
搜索Facebook
```
search_facebook(keyword)
```
## 目前可搜索的部分裤子列表(以下为部分库,完整库列表请运行程序后查看或直接至网页版查看)
- 17173网络游戏:17173网络游戏用户数据
- 人人网:人人网用户数据
- 12306:12306部分用户数据
- 天涯社区:天涯社区近4000万用户数据泄露
- 7K7K游戏:7K7K用户数据
- Taobao:Taobao近2000万用户数据泄露
- QQ:QQ用户数据
- 邮箱密码合集:多个安全事件中泄露的邮箱与密码数据合集
- 银行高存款客户:银行VIP用户数据
- 车主信息:70万车主信息数据
- 户籍信息:中国大陆1000多万居民户籍信息数据泄露
- Facebook:Facebook脸书超过5亿多用户数据泄露
- 借贷数据:暗网泄露的部分借贷数据
- 台湾居民信息:台湾2000多万居民敏感信息泄露
- BreachCompilation:14亿邮箱密码明文泄露信息合集
- 中国移动:中国移动多省份的用户信息泄露,涉及几千万用户
- 搜云:搜云社工库数据泄露
- 社保信息:38万深圳市社保数据泄露
- 平安保险:平安保险10万用户数据
- 小米论坛:小米论坛800万数据泄露
- 永硕E盘:永硕E盘用户数据
- 陌陌:陌陌3000万条数据泄露
- 京东:京东商城用户数据
- QQ密码:历年来泄露的QQ密码数据合集
- 手机密码合集:多个数据泄露事件中泄露的手机号与密码数据合集
- 华住集团酒店:华住集团酒店的用户数据
- 地下城与勇士DNF:地下城与勇士DNF近千万数据泄露
- 开心网:开心网用户数据
- 英雄联盟LoL:英雄联盟Lol共计1亿用户数据泄露
- Telegram:匿名聊天软件Telegram 4000多万用户数据泄露
- 顺丰快递:顺丰快递信息数据
- CSDN:CSDN账号数据
- 微博:微博用户数据
- 网易邮箱:网易邮箱数据
- 企查查:企查查全站数据
- QQ群:QQ群关系数据
- COMB:全球32亿多条邮箱、密码泄露数据合集
- 智慧树:智慧树200万用户数据泄露
- WHOIS数据库:全球WHOIS数据库泄露,数据泄露超过2.9亿条
- B站:B站(Bilibili)用户数据泄露
- 广东驾校:广东数十万驾校学员信息泄露
- 外围小姐数据:全国最新外围与楼凤数据汇总
- IP地址数据:全球IP地址数据库
================================================
FILE: example.py
================================================
#!/usr/bin/python3
# coding=utf-8
#
# LosePrivacy API Sample,最全最强大的社工库平台
# 官网:https://loseprivacy.click
# API介绍:https://loseprivacy.github.io
# CopyRight 2022 LosePrivacy.
#
import os
import requests
import json
import time
import logging
from loseprivacy import LosePrivacy
host = 'https://api.loseprivacy.cyou'
# 此处填入从LosePrivacy获取的API KEY
apikey = 'LosePrivacy API KEY'
# 此处填入API KEY的请求速率(速率值受限于API KEY的权限)
ratelimit = 2
timeout = 60
def main():
lp = LosePrivacy(host,apikey,ratelimit,timeout,logging.INFO)
lp.init_data()
lp.load_data()
res = lp.search_qq("2118558610")
print(res)
if __name__ == "__main__":
main()
================================================
FILE: loseprivacy.py
================================================
#!/usr/bin/python3
# coding=utf-8
#
# LosePrivacy API,最全最强大的社工库平台
# 官网:https://loseprivacy.click
# API介绍:https://loseprivacy.github.io
# CopyRight 2022 LosePrivacy.
#
import os
import sys
import requests
import json
import time
import logging
class LosePrivacy():
# 可搜索的数据类别
dataclasses = {}
# 不同类别下的数据泄露事件:cate:breach
breach_map = {}
# 所有数据泄露事件:breach_id:breach
all_breaches = {}
# 所有数据泄露专题: topic_id:topic
all_topics = {}
host = 'https://api.loseprivacy.cyou'
key = 'loseprivacy_apikey'
ratelimit = 2
timeout = 60
url_dc = '/api/v1/dataclasses'
url_breaches = '/api/v1/breaches'
url_breach = '/api/v1/breach'
url_searchbreach = '/api/v1/search_breach'
url_topics = '/api/v1/topics'
url_topic = '/api/v1/topic'
url_searchtopic = '/api/v1/search_topic'
file_dc = "loseprivacy/loseprivacy_dataclasses.txt"
file_breachmap = "loseprivacy/loseprivacy_breach_map.txt"
file_breaches = "loseprivacy/loseprivacy_breaches.txt"
file_topics = "loseprivacy/loseprivacy_topics.txt"
def __init__(self, gateway, key, ratelimit, timeout=60, log_level=logging.INFO):
self.host = gateway
self.key = key
self.ratelimit = ratelimit
self.timeout = timeout
logging.basicConfig(level=log_level, format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p')
def header(self):
headers = {
'User-Agent': 'loseprivacy',
'loseprivacy-auth-key': self.key,
}
return headers
# 从LosePrivacy拉取基本的数据泄露事件的数据并存入文件中
def init_data(self):
if os.path.exists(self.file_dc) and os.path.exists(self.file_breachmap) and os.path.exists(self.file_breaches) and os.path.exists(self.file_topics):
return
if not os.path.exists('loseprivacy'):
os.mkdir('loseprivacy')
logging.info('首次运行,将从LosePrivacy服务器中拉取最新的数据泄露事件的元数据')
# 获取LosePrivacy所有可搜索的数据类别
self.dataclasses = self.get_dataclasses()
if not self.dataclasses:
logging.error('init_data(): 数据获取失败,请检查API KEY权限')
return
# 获取LosePrivacy每一类别的数据泄露事件的具体信息
for dataclass in self.dataclasses:
breaches = self.get_breaches(dataclass['field'])
self.breach_map[json.dumps(dataclass)] = breaches
logging.info('%s类别下的数据泄露事件有:' % dataclass['name'])
for breach in breaches:
logging.info('%s:%s' % (breach['name'], breach['title']))
self.all_breaches[breach['id']] = breach
# 获取LosePrivacy所有数据泄露专题信息
all_topics = self.get_topics()
with open(self.file_dc, 'w+') as dc_file:
dc_file.write(json.dumps(self.dataclasses))
with open(self.file_breachmap, 'w+') as breach_file:
breach_file.write(json.dumps(self.breach_map))
with open(self.file_breaches, 'w+') as breaches_file:
breaches_file.write(json.dumps(self.all_breaches))
with open(self.file_topics, 'w+') as topics_file:
topics_file.write(json.dumps(all_topics))
# 后续运行时可以直接使用
def load_data(self):
if os.path.exists(self.file_dc) and os.path.exists(self.file_breachmap) and os.path.exists(self.file_breaches) and os.path.exists(self.file_topics):
with open(self.file_dc) as f:
data = f.read()
self.dataclasses = json.loads(data)
with open(self.file_breachmap) as f:
data = f.read()
self.breach_map = json.loads(data)
with open(self.file_breaches) as f:
data = f.read()
self.all_breaches = json.loads(data)
with open(self.file_topics) as f:
data = f.read()
all_topics = json.loads(data)
return
logging.error('load_data错误:请先调用init_data(),再调用load_data()!')
sys.exit("load_data Error")
# 获取LosePrivacy所有可搜索的数据类别
def get_dataclasses(self):
rsp = requests.post(url = self.host+self.url_dc, data = {},headers = self.header(), timeout=self.timeout)
if rsp.status_code != 200:
logging.error('网络错误')
return None
obj = json.loads(rsp.text.strip())
time.sleep(self.ratelimit)
if obj['code'] == 200:
logging.info('LosePrivacy可搜索的数据类型:')
for cate in obj['data']:
logging.info('%s: field_name:%s, field_value:%s' % (cate['name'],cate['field'],cate['value']))
return obj['data']
else:
logging.error('错误代码: %s' % obj['code'])
return None
# 获取LosePrivacy某一类别的数据泄露事件
def get_breaches(self, field):
rsp = requests.post(url = self.host+self.url_breaches, data = {'field':field},headers = self.header(), timeout=self.timeout)
if rsp.status_code != 200:
logging.error('网络错误')
return None
obj = json.loads(rsp.text.strip())
time.sleep(self.ratelimit)
if obj['code'] == 200:
return obj['data']
else:
logging.error('错误代码: %s' % obj['code'])
return None
# 获取LosePrivacy的所有数据泄露专题
def get_topics(self):
rsp = requests.post(url = self.host+self.url_topics, data = {},headers = self.header(), timeout=self.timeout)
if rsp.status_code != 200:
logging.error('网络错误')
return None
obj = json.loads(rsp.text.strip())
time.sleep(self.ratelimit)
if obj['code'] == 200:
return obj['data']
else:
logging.error('错误代码: %s' % obj['code'])
return None
# 搜索泄露信息
def searchbreach(self,keyword,breach_id,field):
data = {'keyword':keyword,'breach_id':breach_id,'field_value':field}
rsp = requests.post(url = self.host+self.url_searchbreach, data = data,headers = self.header(), timeout=self.timeout)
if rsp.status_code != 200:
logging.error('网络错误')
return None
obj = json.loads(rsp.text.strip())
time.sleep(self.ratelimit)
if obj['code'] == 200:
return obj['data']
else:
logging.error('错误代码: %s' % obj['code'])
return None
def search(self,keyword,field_value):
cates = self.breach_map.keys()
qq_cate = None
qq_cate_str = None
result = {}
for cate in cates:
qq_cate_str = cate
cate = json.loads(cate)
if cate['value'] == field_value:
qq_cate = cate
break
for breach in self.breach_map[qq_cate_str]:
logging.info('正在搜索%s-%s, 关键词:%s' % (breach['id'],breach['title'],keyword))
res = self.searchbreach(keyword,breach['id'],qq_cate['value'])
if len(res) > 0:
result[breach['title']] = res
return result
def search_qq(self, keyword):
logging.info('正在搜索QQ %s' % keyword)
return self.search(keyword,'qq')
def search_username(self,keyword):
logging.info('正在搜索用户名 %s' % keyword)
return self.search(keyword,'username')
def search_password(self,keyword):
logging.info('正在搜索密码 %s' % keyword)
return self.search(keyword,'password')
def search_phone(self,keyword):
logging.info('正在搜索手机 %s' % keyword)
return self.search(keyword,'phone')
def search_identity(self,keyword):
logging.info('正在搜索身份证号 %s' % keyword)
return self.search(keyword,'identity')
def search_weiboid(self,keyword):
logging.info('正在搜索微博UID %s' % keyword)
return self.search(keyword,'weibo')
def search_facebook(self,keyword):
logging.info('正在搜索Facebook ID %s' % keyword)
return self.search(keyword,'facebook')
def search_email(self,keyword):
logging.info('正在搜索邮箱 %s' % keyword)
return self.search(keyword,'email')
def dump(self):
for key in self.all_breaches.keys():
breach = self.all_breaches[key]
logging.info('%s:%s' % (breach['name'], breach['title']))
gitextract_0le25gzs/ ├── README.md ├── example.py └── loseprivacy.py
SYMBOL INDEX (20 symbols across 2 files)
FILE: example.py
function main (line 24) | def main():
FILE: loseprivacy.py
class LosePrivacy (line 18) | class LosePrivacy():
method __init__ (line 46) | def __init__(self, gateway, key, ratelimit, timeout=60, log_level=logg...
method header (line 53) | def header(self):
method init_data (line 61) | def init_data(self):
method load_data (line 92) | def load_data(self):
method get_dataclasses (line 111) | def get_dataclasses(self):
method get_breaches (line 128) | def get_breaches(self, field):
method get_topics (line 142) | def get_topics(self):
method searchbreach (line 156) | def searchbreach(self,keyword,breach_id,field):
method search (line 170) | def search(self,keyword,field_value):
method search_qq (line 188) | def search_qq(self, keyword):
method search_username (line 192) | def search_username(self,keyword):
method search_password (line 196) | def search_password(self,keyword):
method search_phone (line 200) | def search_phone(self,keyword):
method search_identity (line 204) | def search_identity(self,keyword):
method search_weiboid (line 208) | def search_weiboid(self,keyword):
method search_facebook (line 212) | def search_facebook(self,keyword):
method search_email (line 216) | def search_email(self,keyword):
method dump (line 220) | def dump(self):
Condensed preview — 3 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (13K chars).
[
{
"path": "README.md",
"chars": 1808,
"preview": "# 免费社工库平台LosePrivacy源代码与API库 \n\n## 什么是LosePrivacy\n\n[LosePrivacy](https://loseprivacy.icu)收录了近10多年全球著名的数据泄露事件及数据,方便用户真实掌握:"
},
{
"path": "example.py",
"chars": 655,
"preview": "#!/usr/bin/python3\n# coding=utf-8\n#\n# LosePrivacy API Sample,最全最强大的社工库平台\n# 官网:https://loseprivacy.click\n# API介绍:https"
},
{
"path": "loseprivacy.py",
"chars": 8129,
"preview": "#!/usr/bin/python3\n# coding=utf-8\n#\n# LosePrivacy API,最全最强大的社工库平台\n# 官网:https://loseprivacy.click\n# API介绍:https://lose"
}
]
About this extraction
This page contains the full source code of the loseprivacy/loseprivacy-cli GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 3 files (10.3 KB), approximately 3.3k tokens, and a symbol index with 20 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.