微慑信息网

wordpressの下载插件的历史版本的最新方法 – vulsee.com

例如:插件 https://cn.wordpress.org/plugins/baidu-submit-link/

方法一:

点击高级视图(Advanced View):

然后拉到最下方,有个历史版本,可以下载老旧版本

方法二:

点击开发进展浏览代码:

不是所有插件有提供该界面,可以构造URL(vulsee.com):

https://plugins.trac.wordpress.org/browser/插件名/

或者:

https://plugins.trac.wordpress.org/log/browser/插件名/

 

点击进去会有项目的所有文件,基本都有历史版本,可以依次下载;


为了方便,写了一个脚本,下载对应Rev编号的插件版本:

 

#coding:utf-8
'''
__author__=="sonic"
__website__=="http://vulsee.com"
'''
import requests
from bs4 import BeautifulSoup
import ssl
import urllib
import os
import wget
try:
    _create_unverified_https_context = ssl._create_unverified_context
except AttributeError:
    pass
else:
    ssl._create_default_https_context = _create_unverified_https_context
requests.packages.urllib3.disable_warnings()
headers = {
#需要headers
}

def getpages(file):
    startUrl = 'https://plugins.trac.wordpress.org/export/'
    resUrl = '{}{}/{}/trunk/{}'.format(startUrl,proId,proName,file)
    #print resUrl
    download(resUrl)

def download(url):
    savepath = './{}/{}/'.format(proName,proId)
    filepaths = savepath+url.split('trunk')[-1]
    fileName = url.split('trunk')[-1].split('/')[-1]
    writePathname = os.getcwd() +filepaths
    #writePath = writePathname.split('/')[0:-1]
    
    print writePathname,fileName
    writePath = writePathname.split(fileName)[0]
    
    if os.path.exists(writePath)==False:
        os.makedirs(writePath)
        wget.download(url,writePathname)
    else:
        wget.download(url,writePathname)
    
def check(path):
    url = 'https://plugins.trac.wordpress.org/browser/{}/trunk/{}?rev={}&action=inplace&range_min_secs=63679144160&range_max_secs=63726016168'.format(proName,path,proId)
    html = requests.get(url, headers=headers, verify=False).content
    #print (html)
    soup=BeautifulSoup(html,'lxml')
    files = soup.find_all("a",class_='trac-rawlink')
    for file in files:
        resfile = file.attrs["href"].split('?')[0].split('trunk')[-1]
        getpages(resfile)
    filepaths = soup.find_all("a",class_='dir')
    if len(filepaths)>0:
        for filepath in filepaths:
            respath =  filepath.attrs["href"].split('?')[0].split('trunk')[-1]
            check(respath)
            
     

def main():
    global proId,proName
    proName = 'baidu-submit-link'
    proId = 2496522 
    check('/')


if __name__ == '__main__':
    main()

 

赞(0) 打赏
转载请附本站链接,未经允许不得转载,,谢谢:微慑信息网-VulSee.com » wordpressの下载插件的历史版本的最新方法 – vulsee.com

评论 抢沙发

微慑信息网 专注工匠精神

微慑信息网-VulSee.com-关注前沿安全态势,聚合网络安全漏洞信息,分享安全文档案例

访问我们联系我们

觉得文章有用就打赏一下文章作者

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫打赏

微信扫一扫打赏

登录

找回密码

注册