Python脚本|根据URL生成特定目标网站备份文件猜测字典

Python小白,分享一个网站信息搜集的思路,并用python写出脚本,仅供参考~

搜集常见的备份文件后缀类型,以及一些固定的文件名,可自由添加修改:

#coding=utf-8

# 根据URL生成特定目标网站备份文件猜测字典

#Test By: AnCoLin|影风

#http://www.storysec.com

suffixList = ['.rar','.zip','.sql','.gz','.tar','.bz2','.tar.gz','.bak','.dat']

keyList=['install','INSTALL','index','INDEX','ezweb','EZWEB','flashfxp','FLASHFXP']

# 请输入目标URL

print "Please input the URL:"
url = raw_input()

if (url[:5] == 'http:'):
    url = url[7:].strip()

if (url[:6] == 'https:'):
    url = url[8:].strip()

numT = url.find('/')

if(numT != -1):
    url = url - url[:numT]

# 根据URL,推测一些针对性的文件名:

num1 = url.find('.')
num2 = url.find('.',num1 + 1)

keyList.append(url[num1 + 1:num2])
keyList.append(url[num1 + 1:num2].upper())

keyList.append(url)  # www.test.com
keyList.append(url.upper())

keyList.append(url.replace('.','_'))  # www_test_com
keyList.append(url.replace('.','_').upper())

keyList.append(url.replace('.',''))  # wwwtestcom
keyList.append(url.replace('.','').upper())

keyList.append(url[num1 + 1:])   # test.com
keyList.append(url[num1 + 1:].upper())   

keyList.append(url[num1 + 1:].replace('.','_'))  # test_com
keyList.append(url[num1 + 1:].replace('.','_').upper())

# 生成字典列表,并写入txt文件:

tempList =[]

for key in keyList:
    for suff in suffixList:
        tempList.append(key + suff)

fobj = open("success.txt",'w')

for each in tempList:
    each ='/' + each
    fobj.write('%s%s' %(each,'\n'))
    fobj.flush()

print 'OK!'

测试如图:

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

标签:

分享到:

扫一扫在手机阅读

扫一扫 在手机阅读、分享本文

上一篇: 下一篇:已经是最新的文章了

还没有评论,快来抢沙发!

电子邮件地址不会被公开。 必填项已用*标注

loading

90后web菜鸟,互联网小白~
喜欢领域:编程|代码审计|web安全

最新评论