Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wxScanck
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
yaozheng
wxScanck
Commits
f4b41fcc
Commit
f4b41fcc
authored
Aug 09, 2022
by
TesterYao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
571d11b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
10 deletions
+45
-10
quanmin.py
quanmin.py
+33
-0
wx-cli-ck.py
wx-cli-ck.py
+12
-10
No files found.
quanmin.py
0 → 100644
View file @
f4b41fcc
import
requests
from
log
import
LOG
# 全民对接
class
QM
:
def
__init__
(
self
):
self
.
host
=
'https://gateway.hjff18.com'
# ssp上报被封域名或链接
self
.
block_list_url
=
'/mall/domain/ta/jc'
self
.
session
=
requests
.
session
()
def
post_block_list
(
self
,
b_url
):
LOG
.
info
(
'全民上报被封域名:'
+
b_url
)
if
b_url
.
startswith
(
'http'
):
r
=
self
.
session
.
post
(
url
=
self
.
host
+
self
.
block_list_url
,
json
=
{
'domain'
:
b_url
})
else
:
b_url
=
'https://'
+
b_url
data
=
{
'domain'
:
b_url
}
r
=
self
.
session
.
post
(
url
=
self
.
host
+
self
.
block_list_url
,
json
=
data
)
print
(
'上报结果:'
+
r
.
text
)
if
r
.
status_code
==
200
and
r
.
json
()
.
get
(
'desc'
)
==
"成功"
:
LOG
.
info
(
'上报成功:'
+
r
.
text
)
else
:
LOG
.
error
(
'上报失败,1.5S后重新上报:'
+
r
.
text
)
if
__name__
==
'__main__'
:
qm
=
QM
()
qm
.
post_block_list
(
'www.baidu.com'
)
wx-cli-ck.py
View file @
f4b41fcc
from
time
import
sleep
from
time
import
sleep
from
urllib.parse
import
urlparse
from
urllib.parse
import
urlparse
import
requests
import
requests
from
quanmin
import
QM
from
dingMessage
import
send_messages
from
dingMessage
import
send_messages
from
log
import
LOG
from
log
import
LOG
from
manager
import
Tui
def
check_domain
(
check_url
,
i
=
0
):
def
check_domain
(
check_url
,
i
=
0
):
tag
=
False
try
:
try
:
sleep
(
1
)
sleep
(
1
)
...
@@ -25,7 +25,7 @@ def check_domain(check_url,i=0):
...
@@ -25,7 +25,7 @@ def check_domain(check_url,i=0):
host
=
urlparse
(
res_url
)
.
hostname
# 判断域名,如果是微信安全中心的域名'weixin110.qq.com',则说明被封
host
=
urlparse
(
res_url
)
.
hostname
# 判断域名,如果是微信安全中心的域名'weixin110.qq.com',则说明被封
if
host
and
host
==
'weixin110.qq.com'
:
if
host
and
host
==
'weixin110.qq.com'
:
LOG
.
info
(
'巡查结束,域名被封:
%
s'
%
check_url
)
LOG
.
info
(
'巡查结束,域名被封:
%
s'
%
check_url
)
send_messages
(
'广告主落地页链接被封,被封链接为:'
+
gj_url
)
tag
=
True
else
:
else
:
LOG
.
info
(
'巡查结束,域名正常:
%
s'
%
check_url
)
LOG
.
info
(
'巡查结束,域名正常:
%
s'
%
check_url
)
...
@@ -40,6 +40,7 @@ def check_domain(check_url,i=0):
...
@@ -40,6 +40,7 @@ def check_domain(check_url,i=0):
check_domain
(
check_url
,
i
)
check_domain
(
check_url
,
i
)
else
:
else
:
LOG
.
error
(
'微信域名巡查脚本,执行巡查时出错,请及时处理!!!'
)
LOG
.
error
(
'微信域名巡查脚本,执行巡查时出错,请及时处理!!!'
)
return
tag
def
get_pg_list
():
def
get_pg_list
():
pg_url
=
'https://engine.tuia.cn/apollo/getIdMapStrByKeyStr?keyStr=wx.ad.page'
pg_url
=
'https://engine.tuia.cn/apollo/getIdMapStrByKeyStr?keyStr=wx.ad.page'
...
@@ -47,9 +48,8 @@ def get_pg_list():
...
@@ -47,9 +48,8 @@ def get_pg_list():
pg_lsit
=
[]
pg_lsit
=
[]
if
r
.
ok
:
if
r
.
ok
:
res
=
eval
(
r
.
text
)
res
=
eval
(
r
.
text
)
for
k
,
v
in
res
.
items
():
pg_lsit
.
append
(
v
)
return
res
return
pg_lsit
...
@@ -57,12 +57,15 @@ if __name__ == '__main__':
...
@@ -57,12 +57,15 @@ if __name__ == '__main__':
base_url
=
'http://mp.weixinbridge.com/mp/wapredirect?url='
# 微信官方接口,可用于域名巡查,后面拼接上需要巡查的域名或链接
base_url
=
'http://mp.weixinbridge.com/mp/wapredirect?url='
# 微信官方接口,可用于域名巡查,后面拼接上需要巡查的域名或链接
session
=
requests
.
session
()
session
=
requests
.
session
()
headers
=
{
'User-Agent'
:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'
}
headers
=
{
'User-Agent'
:
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36'
}
qm
=
QM
()
while
True
:
while
True
:
try
:
try
:
ck_url_list
=
get_pg_list
()
ck_url_list
=
get_pg_list
()
for
ck_url
in
ck_url_list
:
for
k
,
v
in
ck_url_list
.
items
():
check_domain
(
ck_url
)
if
check_domain
(
v
):
send_messages
(
'广告主落地页链接被封,被封链接为:'
+
v
)
if
k
.
startswith
(
'全民'
):
qm
.
post_block_list
(
v
)
sleep
(
2
)
sleep
(
2
)
sleep
(
10
)
sleep
(
10
)
except
:
except
:
...
@@ -75,4 +78,3 @@ if __name__ == '__main__':
...
@@ -75,4 +78,3 @@ if __name__ == '__main__':
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment