İçeriğe geç
ShiftDelete.Net
Haber ara/ SDN'ye SorGiriş
Haber Akışı SDNTV İnceleme Forum Yapay Zeka Akıllı Telefon Elektrikli Otomobil Oyun ShiftDelete.Net Global Teknoloji Haberleri Mobil Otomobil Donanım Savunma Bilim Sosyal Medya İnternet Giyilebilir Teknoloji Rehber Ürünler Son dakika Yazarlar
  1. Ana sayfa
  2. Topluluk
  3. Programlama
  4. Programlama Dilleri
Programlama Dilleri

Python kod ekleme önerisi.

haticedemirci3328.09.20201 cevap960 görüntüleme
haticedemirci33
2020'den beri65 mesaj
#1
Arkadaşlar siber güvenlik üzerine çalışıyorum ve yazdığım kodlarda hedef sitenin önemli bilgilerini değil de sadece orta seviyeli bilgilerini alabiliyorum acaba herhangi bir ekleme yapabilir miyim? Yani farklı kütüphaneler denemek istiyorum. Yardımlarınız için teşekkürler. Kodlarım aşağıdaki gibi:

import urllib2
import threading
import Queue
import urllib

threads = 50
target_url = "https://hedef_site.com/"
wordlist_file = "/home/haticedemirci/wordlist.txt"
resume = None
user_agent = "Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101Firefox/19.0"

def build_wordlist(wordlist_file):

fd = open(wordlist_file,"rb")
raw_words = fd.readlines()
fd.close()

found_resume = False
words = Queue.Queue()

for word in raw_words:
word = word.rstrip()

if resume is not None:

if found_resume:
words.put(word)
else:
if word == resume:
found_resume = True
print "Resuming wordlist from: %s" % resume
else:
words.put(word)

return words
def dir_bruter(word_queue,extensions=None):
while not word_queue.empty():
attempt = word_queue.get()

attempt_list = []

if "." not in attempt:
attempt_list.append("/%s/" % attempt)
else:
attempt_list.append("/%s" % attempt)

if extensions:
for extension in extensions:
attempt_list.append("/%s%s" % (attempt,extension))

for brute in attempt_list:
for word in raw_words:
word = word.rstrip()

if resume is not None:

if found_resume:
words.put(word)
else:
if word == resume:
found_resume = True
print "Resuming wordlist from: %s" % resume
else:
words.put(word)

return words
def dir_bruter(word_queue,extensions=None):
while not word_queue.empty():
attempt = word_queue.get()

attempt_list = []

if "." not in attempt:
attempt_list.append("/%s/" % attempt)
else:
attempt_list.append("/%s" % attempt)

if extensions:
for extension in extensions:
attempt_list.append("/%s%s" % (attempt,extension))

for brute in attempt_list:
url = "%s%s" % (target_url,urllib.quote(brute))
try:
headers = {}
headers["User-Agent"] = user_agent
r = urllib2.Request(url,headers=headers)

response = urllib2.urlopen(r)

if len(response.read()):
print "[%d] => %s" % (response.code,url)

except urllib2.URLError,e:
if hasattr(e, 'code') and e.code != 404:print "!!! %d => %s" % (e.code,url)

pass

word_queue = build_wordlist(wordlist_file)
extensions = [".php",".bak",".orig",".inc"]

for i in range(threads):
t = threading.Thread(target=dir_bruter,args=(word_queue,extensions,))
t.start()
import urllib2
import threading
import Queue
import urllib

threads        = 50
target_url     = "https://hedef_site.com/"
wordlist_file  = "/home/haticedemirci/wordlist.txt"
resume         = None
user_agent     = "Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101Firefox/19.0"

def build_wordlist(wordlist_file):
    
    fd = open(wordlist_file,"rb")
    raw_words = fd.readlines()
    fd.close()

    found_resume = False
    words        = Queue.Queue()

    for word in raw_words:
        word = word.rstrip()

    if resume is not None:

        if found_resume:
            words.put(word)
        else:
            if word == resume:
                found_resume = True
                print "Resuming wordlist from: %s" % resume
    else:
        words.put(word)

    return words
def dir_bruter(word_queue,extensions=None):
    while not word_queue.empty():
        attempt = word_queue.get()
        
        attempt_list = []

        if "." not in attempt:
            attempt_list.append("/%s/" % attempt)
        else:
            attempt_list.append("/%s" % attempt)

        if extensions:
            for extension in extensions:
                attempt_list.append("/%s%s" % (attempt,extension))

        for brute in attempt_list:
            for word in raw_words:
                word = word.rstrip()

                if resume is not None:

                    if found_resume:
                        words.put(word)
                    else:
                        if word == resume:
                            found_resume = True
                            print "Resuming wordlist from: %s" % resume
                else:
                    words.put(word)

            return words
def dir_bruter(word_queue,extensions=None):
    while not word_queue.empty():
        attempt = word_queue.get()

        attempt_list = []

        if "." not in attempt:
            attempt_list.append("/%s/" % attempt)
        else:
            attempt_list.append("/%s" % attempt)

        if extensions:
            for extension in extensions:
                attempt_list.append("/%s%s" % (attempt,extension))

        for brute in attempt_list:
            url = "%s%s" % (target_url,urllib.quote(brute))
            try:
                headers = {}
                headers["User-Agent"] = user_agent
                r = urllib2.Request(url,headers=headers)

                response = urllib2.urlopen(r)

                if len(response.read()):
                    print "[%d] => %s" % (response.code,url)

            except urllib2.URLError,e:
                if hasattr(e, 'code') and e.code != 404:print "!!! %d => %s" % (e.code,url)

                pass
        
word_queue = build_wordlist(wordlist_file)
extensions = [".php",".bak",".orig",".inc"]

for i in range(threads):
    t = threading.Thread(target=dir_bruter,args=(word_queue,extensions,))
    t.start()
Cevaplar
2021'den beri15 mesaj
#2
online compiler da çalıştırmak istedeim
sonuç: A module you have imported isn't available at the moment. It will be available soon.(İçe aktardığınız bir modül şu anda mevcut değil. Yakında satışa sunulacak.)

Cevabını yaz

Cevap yazmak için giriş yap ya da üye ol. Eski forum kullanıcı adın ve parolanla girebilirsin.