
Merhaba, bu yazımda Python ile panel bulucu nasıl kodlanır onu göstermeye çalışıcam.Kullanımı gayet basit olacak.
panel.txt içinde panel dizinleri var ve sırasıyla
panel.txt 'den hedef siteye brute yapacak.Bu arada panel dizinlerini havij'den çektim;
375 satır dizin var.Php+Asp karışık tarıyor, istenirse kullanıcı tercihine göre asp/php ayrı taranabilir.Sizin daha iyisini yapacağınıza şüphem yok :) başlayalım...
Program HTTP Protokol yanıt kodlarına göre çalışacak.Bütün response kodlarını çekecek ama ben
200,
301 ve
302 protokol kodlarını baz alıcam.Zaten bunlar dışında bir durum olursa 404'e atacak. başka bir kod bulursa onuda tararken belirtecek.Son olarak bulduklarını
bulunan.txt adında bir dosya oluşturup içine yazarak sonlanacak.
| 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!