

import http.client
print('\n'
'**************************************\n'
'* Python Panel Scanner *\n'
'* Coded by UsluBey *\n'
'* uslubey.blogspot.com *\n'
'**************************************\n')
hedef = input("[+] Hedefi Ver (Örn.: site.com) : ")
print("\n")
site = hedef
Siteye bağlanırken http.client modülünü kullanıyorum.Ardından input() ile hedef siteyi değişkene atıyorum.def dump(msj,site,panel):
dump = open("bulunan.txt","a")
veri = str(msj)+" "+str(site)+"/"+str(panel)+"\n"
dump.write(veri)
print("[!] bulunan.txt'ye yazıldı!")
dump.close()
Ardından dump() fonksiyonu oluşturuyorum.Bu fonksiyon bulunan dizinleri bulunan.txt'ye yazacak.Tarama yapacak fonksiyonumuzu da yazalım:def tara(site,panel):
try:
con = http.client.HTTPConnection(site)
con.request("HEAD","/"+panel)
kod = con.getresponse()
msj = kod.status
if msj == 200:
print("[+] [200:OK] Bulundu ! "+site+"/"+panel)
dump(msj,site,panel)
elif msj == 301:
print("[+] [301:Moved Permanently] Bulundu ! "+site+"/"+panel)
dump(msj,site,panel)
elif msj == 302:
print("[+] [302:Found] Bulundu ! "+site+"/"+panel)
dump(msj,site,panel)
else:
print("[-] ["+str(msj)+"] "+site+"/"+panel)
except Exception as x:
print("hata: "+str(x))
tara() fonksiyonu ile siteden protokol kodunu çekip işimize yarayanları ekrana basıp ardından txt'ye yazdıralım.Eğer siteye erişim sağlanamazsa except Exception as x betiği ile hatayı x değişkenine atayarak ekrana basıcaz."f = open("panel.txt","r")
for panel in f.readlines():
panel = panel.strip()
tara(site,panel)
panel.txt'de brute edilecek dizinlerimiz var demiştik.Satır satır kontrol için oluşturduğumuz tara() fonksiyonunu for döngüsüne sokuyuyoruz.Şimdi parçaları birleştirelim:
import http.client
print('\n'
'**************************************\n'
'* Python Panel Scanner *\n'
'* Coded by UsluBey *\n'
'* uslubey.blogspot.com *\n'
'**************************************\n')
hedef = input("[+] Hedefi Ver (Örn.: site.com) : ")
print("\n")
site = hedef
def dump(msj,site,panel):
dump = open("bulunan.txt","a")
veri = str(msj)+" "+str(site)+"/"+str(panel)+"\n"
dump.write(veri)
print("[!] bulunan.txt'ye yazıldı!")
dump.close()
def tara(site,panel):
try:
con = http.client.HTTPConnection(site)
con.request("HEAD","/"+panel)
kod = con.getresponse()
msj = kod.status
if msj == 200:
print("[+] [200:OK] Bulundu ! "+site+"/"+panel)
dump(msj,site,panel)
elif msj == 301:
print("[+] [301:Moved Permanently] Bulundu ! "+site+"/"+panel)
dump(msj,site,panel)
elif msj == 302:
print("[+] [302:Found] Bulundu ! "+site+"/"+panel)
dump(msj,site,panel)
else:
print("[-] ["+str(msj)+"] "+site+"/"+panel)
except Exception as x:
print("hata: "+str(x))
f = open("panel.txt","r")
for panel in f.readlines():
panel = panel.strip()
tara(site,panel)
Çalıştığında 375 satır dizin tarıyor.php,asp karışık olduğu için biraz kabarık...Paneli bulduğunda döngüyü sonlandırmıyoruz çünkü bazı istisna durumlarda panel 200 koduna karşılık gibi görünebilir fakat apayrı bir yerde olabilir.Şimdilik bu kadar arkadaşlar, iyi çalışmalar.
[!] Kodlar Python 3 'e göre yazılmıştır.
0 yorum :
Yorum Gönder
Yorumun denetlendikten sonra görüntülenecek...Teşekkürler!