Bagaimana mencari berkas .git
secara masif?
Gunakan script ini.
import requests
import json
elements = json.loads(open('urls.json').read())
def gitscan(host):
url = 'http://{}/.git/config'.format(host)
y = requests.get(url, allow_redirects=False)
if y.status_code == 200 and 'true' in y.text and len(y.text) > 0:
return True
def svnscan(host):
url = 'http://{}/.svn/wc.db'.format(host)
y = requests.get(url, allow_redirects=False)
if y.status_code == 200 and len(y.text) > 64:
return True
for x in elements['data']:
url = x['host']
try:
if gitscan(url):
with open('git-vulnerable.lst','a') as v:
v.write(url)
v.write('\n')
if svnscan(url):
with open('svn-vulnerable.lst','a') as v:
v.write(url)
v.write('\n')
except:
pass