修复一个小bug

This commit is contained in:
MasonLiu 2025-01-05 18:29:06 +08:00
parent 58c3b37308
commit 50b3bacd4c
3 changed files with 172 additions and 22 deletions

View File

@ -15,7 +15,8 @@ def create_database():
link TEXT,
description TEXT,
pubDate DATETIME,
author TEXT
author TEXT,
is_sended BOOLEAN
)''')
conn.commit()
conn.close()
@ -34,9 +35,14 @@ def insert_data(data):
formatted_pub_date = entry['pubDate']
cursor.execute('''
INSERT INTO articles (title, link, description, pubDate, author)
VALUES (?, ?, ?, ?, ?)
''', (entry['title'], entry['link'], entry['description'], formatted_pub_date, entry['author']))
SELECT 1 FROM articles WHERE title = ? AND author = ?
''', (entry['title'], entry['author']))
if cursor.fetchone() is None:
cursor.execute('''
INSERT INTO articles (title, link, description, pubDate, author)
VALUES (?, ?, ?, ?, ?)
''', (entry['title'], entry['link'], entry['description'], formatted_pub_date, entry['author']))
conn.commit()
conn.close()
@ -68,39 +74,54 @@ def get_doonsec_json():
return total_data
def select_articles(e_hour, Doonsec_switch, Doonsec):
def select_articles(Doonsec_switch, Doonsec):
conn = sqlite3.connect('./resources/db/doonsec.db')
cursor = conn.cursor()
# 获取当前日期和时间
now = datetime.now()
start_time = now - timedelta(hours=e_hour, minutes=3)
end_time = now
two_days_ago = now - timedelta(days=2)
if Doonsec_switch == False:
if Doonsec_switch == False:
# 查询指定时间段内的数据
cursor.execute('''
SELECT * FROM articles
WHERE pubDate BETWEEN ? AND ?
''', (start_time.strftime('%Y-%m-%d %H:%M:%S'), end_time.strftime('%Y-%m-%d %H:%M:%S')))
WHERE is_sended IS NULL AND pubDate BETWEEN ? AND ?
ORDER BY pubDate DESC
''', (two_days_ago.strftime('%Y-%m-%d %H:%M:%S'), now.strftime('%Y-%m-%d %H:%M:%S')))
elif Doonsec_switch == True:
# 查询指定时间段内且title包含特定关键词的数据
placeholders = ', '.join(['?'] * len(Doonsec))
like_conditions = ' OR '.join([f"title LIKE ?"] * len(Doonsec))
# 完整的查询语句
query = f'''
SELECT * FROM articles
WHERE pubDate BETWEEN ? AND ?
AND (title LIKE ? OR title LIKE ? OR title LIKE ?)
WHERE is_sended IS NULL AND pubDate BETWEEN ? AND ?
AND ({like_conditions})
ORDER BY pubDate DESC
'''
# 构建参数列表
params = [start_time.strftime('%Y-%m-%d %H:%M:%S'), end_time.strftime('%Y-%m-%d %H:%M:%S')]
for keyword in Doonsec:
params.append(f'%{keyword}%')
params = [
two_days_ago.strftime('%Y-%m-%d %H:%M:%S'),
now.strftime('%Y-%m-%d %H:%M:%S')
] + [f'%{keyword}%' for keyword in Doonsec]
# 执行查询
cursor.execute(query, params)
results = cursor.fetchall()
if results:
for row in results:
user_id = row[0]
cursor.execute('''
UPDATE articles
SET is_sended = True
WHERE id = ?
''', (user_id,))
conn.commit() # 提交事务
conn.close()
return results
@ -150,13 +171,13 @@ def get_filtered_articles(entries, Is_short):
return result
def Src_doonsec(e_hour, Is_short, Doonsec_switch, Doonsec):
def Src_doonsec(Is_short, Doonsec_switch, Doonsec):
if not os.path.exists('./resources/db/doonsec.db'):
# 创建数据库和表
create_database()
# 清空表
clear_table()
# clear_table()
# 获取 JSON 数据
M_doonsec_data = get_doonsec_json()
@ -165,7 +186,7 @@ def Src_doonsec(e_hour, Is_short, Doonsec_switch, Doonsec):
insert_data(M_doonsec_data)
# 查询指定时间段内的数据
filtered_articles = select_articles(e_hour, Doonsec_switch, Doonsec)
filtered_articles = select_articles(Doonsec_switch, Doonsec)
# print(filtered_articles)
if filtered_articles:
@ -175,7 +196,7 @@ def Src_doonsec(e_hour, Is_short, Doonsec_switch, Doonsec):
return False
if __name__ == "__main__":
reslts = Src_doonsec(24, False, True, ["webshell", "2000", "POC"] )
reslts = Src_doonsec(False, True, ["webshell", "2000", "POC", "SQL", "XSS", "CSRF", "漏洞"] )
if reslts != False:
print(reslts)
else:

View File

@ -0,0 +1,126 @@
#### 文章:[漏洞预警 | Apache MINA反序列化漏洞](https://mp.weixin.qq.com/s?__biz=MzkwMTQ0NDA1NQ==&mid=2247491972&idx=1&sn=307a01116d071dca48ffee093d16aaab)
**作者**:浅安安全
**上传时间**2025-01-04 08:03:54
**简介**Apache MINA存在反序列化漏洞攻击者可通过向受影响的应用程序发送特制的恶意序列化数据利用不安全的反序列化过程触发该漏洞从而可能导致远程代码执行。
----------------------------------------
#### 文章:[漏洞预警 | 卓软计量业务管理平台任意文件读取漏洞](https://mp.weixin.qq.com/s?__biz=MzkwMTQ0NDA1NQ==&mid=2247491972&idx=3&sn=ff471839b4b2ae7ac321141a08593a64)
**作者**:浅安安全
**上传时间**2025-01-04 08:03:54
**简介**:卓软计量业务管理平台的/HuameiMeasure/image.ashx接口存在任意文件读取漏洞未经身份验证的攻击者可以通过该漏洞读取服务器任意文件从而获取服务器大量敏感信息。
----------------------------------------
#### 文章:[攻防靶场(31):日志投毒与文件包含漏洞 Solstice](https://mp.weixin.qq.com/s?__biz=MzI0NjA3Mzk2NQ==&mid=2247495429&idx=1&sn=38b21b3d0a81ed449647cb0de481cac6)
**作者**OneMoreThink
**上传时间**2025-01-04 01:17:57
**简介**:基于 ATTCK 的 OSCP PG Play 靶场通关攻略
----------------------------------------
#### 文章:[【高危漏洞预警】Windows LDAP远程代码执行漏洞CVE-2024-49112](https://mp.weixin.qq.com/s?__biz=MzI3NzMzNzE5Ng==&mid=2247489400&idx=1&sn=c983947941f4637d6fade0c80b18ea2c)
**作者**:飓风网络安全
**上传时间**2025-01-03 22:37:58
**简介**None
----------------------------------------
#### 文章:[【已复现】Windows 轻量级目录访问协议 (LDAP) 拒绝服务漏洞(CVE-2024-49113)安全风险通告](https://mp.weixin.qq.com/s?__biz=MzU5NDgxODU1MQ==&mid=2247502708&idx=1&sn=30ee0bf007924eb359c6c609b3ba1cb7)
**作者**:奇安信 CERT
**上传时间**2025-01-03 22:18:20
**简介**:致力于第一时间为企业级用户提供权威漏洞情报和有效解决方案。
----------------------------------------
#### 文章:[【成功复现】大华智能物联综合管理平台远程代码执行漏洞](https://mp.weixin.qq.com/s?__biz=MzU2NDgzOTQzNw==&mid=2247502820&idx=1&sn=5ebcb4158f712c89ddc3f0c5b1ee0bed)
**作者**:弥天安全实验室
**上传时间**2025-01-03 18:50:36
**简介**:【成功复现】大华智能物联综合管理平台远程代码执行漏洞
----------------------------------------
#### 文章:[大量 Four-Faith 路由器因严重漏洞面临远程攻击风险](https://mp.weixin.qq.com/s?__biz=MzU3MzU4NjI4OQ==&mid=2247515719&idx=1&sn=01c1fdb783a2a11f73b6961114c9435b)
**作者**:河北镌远网络科技有限公司
**上传时间**2025-01-03 18:29:17
**简介**:大量 Four-Faith 路由器因严重漏洞面临远程攻击风险
----------------------------------------
#### 文章:[漏洞预警 | Apache MINA反序列化漏洞](https://mp.weixin.qq.com/s?__biz=MzkwMTQ0NDA1NQ==&mid=2247491972&idx=1&sn=307a01116d071dca48ffee093d16aaab)
**作者**:浅安安全
**上传时间**2025-01-04 08:03:54
**简介**Apache MINA存在反序列化漏洞攻击者可通过向受影响的应用程序发送特制的恶意序列化数据利用不安全的反序列化过程触发该漏洞从而可能导致远程代码执行。
----------------------------------------
#### 文章:[漏洞预警 | 卓软计量业务管理平台任意文件读取漏洞](https://mp.weixin.qq.com/s?__biz=MzkwMTQ0NDA1NQ==&mid=2247491972&idx=3&sn=ff471839b4b2ae7ac321141a08593a64)
**作者**:浅安安全
**上传时间**2025-01-04 08:03:54
**简介**:卓软计量业务管理平台的/HuameiMeasure/image.ashx接口存在任意文件读取漏洞未经身份验证的攻击者可以通过该漏洞读取服务器任意文件从而获取服务器大量敏感信息。
----------------------------------------
#### 文章:[攻防靶场(31):日志投毒与文件包含漏洞 Solstice](https://mp.weixin.qq.com/s?__biz=MzI0NjA3Mzk2NQ==&mid=2247495429&idx=1&sn=38b21b3d0a81ed449647cb0de481cac6)
**作者**OneMoreThink
**上传时间**2025-01-04 01:17:57
**简介**:基于 ATTCK 的 OSCP PG Play 靶场通关攻略
----------------------------------------
#### 文章:[【高危漏洞预警】Windows LDAP远程代码执行漏洞CVE-2024-49112](https://mp.weixin.qq.com/s?__biz=MzI3NzMzNzE5Ng==&mid=2247489400&idx=1&sn=c983947941f4637d6fade0c80b18ea2c)
**作者**:飓风网络安全
**上传时间**2025-01-03 22:37:58
**简介**None
----------------------------------------
#### 文章:[【已复现】Windows 轻量级目录访问协议 (LDAP) 拒绝服务漏洞(CVE-2024-49113)安全风险通告](https://mp.weixin.qq.com/s?__biz=MzU5NDgxODU1MQ==&mid=2247502708&idx=1&sn=30ee0bf007924eb359c6c609b3ba1cb7)
**作者**:奇安信 CERT
**上传时间**2025-01-03 22:18:20
**简介**:致力于第一时间为企业级用户提供权威漏洞情报和有效解决方案。
----------------------------------------
#### 文章:[【成功复现】大华智能物联综合管理平台远程代码执行漏洞](https://mp.weixin.qq.com/s?__biz=MzU2NDgzOTQzNw==&mid=2247502820&idx=1&sn=5ebcb4158f712c89ddc3f0c5b1ee0bed)
**作者**:弥天安全实验室
**上传时间**2025-01-03 18:50:36
**简介**:【成功复现】大华智能物联综合管理平台远程代码执行漏洞
----------------------------------------
#### 文章:[大量 Four-Faith 路由器因严重漏洞面临远程攻击风险](https://mp.weixin.qq.com/s?__biz=MzU3MzU4NjI4OQ==&mid=2247515719&idx=1&sn=01c1fdb783a2a11f73b6961114c9435b)
**作者**:河北镌远网络科技有限公司
**上传时间**2025-01-03 18:29:17
**简介**:大量 Four-Faith 路由器因严重漏洞面临远程攻击风险
----------------------------------------
#### 文章:[漏洞预警 | Apache MINA反序列化漏洞](https://mp.weixin.qq.com/s?__biz=MzkwMTQ0NDA1NQ==&mid=2247491972&idx=1&sn=307a01116d071dca48ffee093d16aaab)
**作者**:浅安安全
**上传时间**2025-01-04 08:03:54
**简介**Apache MINA存在反序列化漏洞攻击者可通过向受影响的应用程序发送特制的恶意序列化数据利用不安全的反序列化过程触发该漏洞从而可能导致远程代码执行。
----------------------------------------
#### 文章:[漏洞预警 | 卓软计量业务管理平台任意文件读取漏洞](https://mp.weixin.qq.com/s?__biz=MzkwMTQ0NDA1NQ==&mid=2247491972&idx=3&sn=ff471839b4b2ae7ac321141a08593a64)
**作者**:浅安安全
**上传时间**2025-01-04 08:03:54
**简介**:卓软计量业务管理平台的/HuameiMeasure/image.ashx接口存在任意文件读取漏洞未经身份验证的攻击者可以通过该漏洞读取服务器任意文件从而获取服务器大量敏感信息。
----------------------------------------
#### 文章:[攻防靶场(31):日志投毒与文件包含漏洞 Solstice](https://mp.weixin.qq.com/s?__biz=MzI0NjA3Mzk2NQ==&mid=2247495429&idx=1&sn=38b21b3d0a81ed449647cb0de481cac6)
**作者**OneMoreThink
**上传时间**2025-01-04 01:17:57
**简介**:基于 ATTCK 的 OSCP PG Play 靶场通关攻略
----------------------------------------
#### 文章:[【高危漏洞预警】Windows LDAP远程代码执行漏洞CVE-2024-49112](https://mp.weixin.qq.com/s?__biz=MzI3NzMzNzE5Ng==&mid=2247489400&idx=1&sn=c983947941f4637d6fade0c80b18ea2c)
**作者**:飓风网络安全
**上传时间**2025-01-03 22:37:58
**简介**None
----------------------------------------
#### 文章:[【已复现】Windows 轻量级目录访问协议 (LDAP) 拒绝服务漏洞(CVE-2024-49113)安全风险通告](https://mp.weixin.qq.com/s?__biz=MzU5NDgxODU1MQ==&mid=2247502708&idx=1&sn=30ee0bf007924eb359c6c609b3ba1cb7)
**作者**:奇安信 CERT
**上传时间**2025-01-03 22:18:20
**简介**:致力于第一时间为企业级用户提供权威漏洞情报和有效解决方案。
----------------------------------------
#### 文章:[【成功复现】大华智能物联综合管理平台远程代码执行漏洞](https://mp.weixin.qq.com/s?__biz=MzU2NDgzOTQzNw==&mid=2247502820&idx=1&sn=5ebcb4158f712c89ddc3f0c5b1ee0bed)
**作者**:弥天安全实验室
**上传时间**2025-01-03 18:50:36
**简介**:【成功复现】大华智能物联综合管理平台远程代码执行漏洞
----------------------------------------
#### 文章:[大量 Four-Faith 路由器因严重漏洞面临远程攻击风险](https://mp.weixin.qq.com/s?__biz=MzU3MzU4NjI4OQ==&mid=2247515719&idx=1&sn=01c1fdb783a2a11f73b6961114c9435b)
**作者**:河北镌远网络科技有限公司
**上传时间**2025-01-03 18:29:17
**简介**:大量 Four-Faith 路由器因严重漏洞面临远程攻击风险
----------------------------------------

View File

@ -195,3 +195,6 @@ def run():
huawei_main()
doonsec_main()
qianxin_main()
if __name__ == "__main__":
run()