Shodan da gezerken russian botnet adlı bir siteye denk geldim site düz text art bir siteydi biraz f12 yapıp kaynaklara bakınca learning adında bir html sayfası keşfettim içerisinde bir sürü pdf barınıyor.
kullanmadan önce analiz etmeyi ve izole alanda çalıştırmaya özen gösterin.
Aşağıdaki python programıyla bütün pdf dosyalarını indirebilirsiniz
kullanmadan önce analiz etmeyi ve izole alanda çalıştırmaya özen gösterin.
Aşağıdaki python programıyla bütün pdf dosyalarını indirebilirsiniz
Python:
import urllib.request
import requests
import os
from bs4 import BeautifulSoup
from urllib.parse import urlparse
files = []
def process(site):
site_open = urllib.request.urlopen(site)
html = site_open.read().decode('utf-8')
soup = BeautifulSoup(html, 'html.parser')
for a_tag in soup.find_all('a'):
link = a_tag.get('href')
if link:
print(site.rstrip('/') + '/' + link)
files.append(site.rstrip('/') + '/' + link)
def download():
if len(files) > 0:
for url in files:
response = requests.get(url.replace("/learning.html","")) #şimdilik böyle kalsın..
if response.status_code == 200:
filename = os.path.basename(url)
with open(filename, 'wb') as file:
file.write(response.content)
print(f'{filename} downloaded successfully')
else:
print(response.status_code)
else:
print("The list is empty, please check the source...")
site_url = "http://www.russian-bot.net/learning.html"
process(site_url)
download()
Son düzenleme:




