مضى على الشبكة و يوم من العطاء.
  • تحذير: يجب على كل روّاد الشبكة تشغيل برامج الاختراق داخل الأنظمة الوهمية وهي بهدف التعلم وحماية الأعضاء والتوعية بها

جمع الSub Domains عن طريق شهادة الموقع SSL


linux

السمعة:

السلام عليكم ورحمة الله

اليوم جايبلكم طريقة إن شاء الله تفيدكم في عملية جمع المعلومات

أحياناً ممكن يكون الـ Target شركة صغيرة وما في معلومات كافي عنها وبهذه الحالة لازم يكون في عنا بدائل كهكرز:ninja:

ممكن يجي شخص يحكي إنه منقدر نبحث عنها عن طريق مفتاح ASN الخاص بالشركة بحكيله أنا صحيح لكن مش كل الشركات عندها مفتاح ASN 🙂

وبهذي الحالة أفضل حل هو البحث عن طريق الشهادة

ممكن يجي نفس الشخص ويسأل ليش طيب عن طريق الشهادة تحديداً؟
راح احكيله لأنه الشركة بتشتري الشهادة لمره وحده وبتقدر تعطيها لكل السب دومينز اللي عندها أو المواقع الفرعية اللي بتملكها
وبهذه الحالة احنا منقدر نستغل هذي الميزة لصالحنا 😃

وبتمنى معش حدا يسأل ويعمل فيها إنه الفاهم 🙂
لا بمزح عادي خذ راحتك اسأل 😆


اسم الموقع:

شرح العملية في الفيديو على موقع wikipedia.org


يمكنك أيضاً البحث عن طريق الهاش الخاص بالشهادة في نفس الموقع

Happy hacking _<
إلى اللقاء _<
 
التعديل الأخير بواسطة المشرف:
ادخل عند في profile او bashrc

وحط ال function دي
Bash:
crt(){
        curl -s https://crt.sh/?q=%.$1 | grep ">*.$1" | sed 's/<[/]*[TB][DR]>/\n/g' | grep -vE "<|^[\*]*[\.]*$1" | sort -u | awk 'NF'
}

هتكتب بس crt sh3ll.cloud وكل ال subs هتطلع معاك
او دا
Bash:
 curl -s https://crt.sh/\?q\=%25.sh3ll.cloud\&output\=json | jq . | grep 'name_value' | awk '{print $2}' | sed -e 's/"//g'| sed -e 's/,//g' |  awk '{gsub(/\\n/,"\n")}1' | sort -u

1736016353098.webp


أو حط الكود دا في ملف .py وممكن تعمله run علي كذا domain لو عاوز تطلع اكتر اعمل run علي subs
Python:
import re
import requests
from bs4 import BeautifulSoup
import argparse
import sys
from colorama import init, Fore, Style

# Initialize colorama for colored terminal output
init(autoreset=True)

def extract_subdomains(text, domain):
    subdomains = set()
    regex = re.compile(r'\b(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+' + re.escape(domain) + r'\b')
    matches = regex.findall(text)
    for match in matches:
        subdomains.add(match)
    return subdomains

# Function to get subdomains from crt.sh
def get_subdomains_crtsh(domain):
    subdomains = set()
    url = f"https://crt.sh/?q={domain}"

    try:
        response = requests.get(url)
        response.raise_for_status()
    except requests.exceptions.RequestException as e:
        print(Fore.RED + f"Error: {str(e)}")
        return subdomains

    subdomains.update(extract_subdomains(response.text, domain))
    return subdomains

# Function to save subdomains to a file
def save_subdomains(subdomains, output_file):
    with open(output_file, "a") as f:
        for subdomain in subdomains:
            f.write(subdomain + "\n")

# Function to process multiple domains from a file
def process_domains_from_file(domain_file, output_file):
    with open(domain_file, "r") as f:
        domains = f.readlines()

    for domain in domains:
        domain = domain.strip()
        subdomains = get_subdomains_crtsh(domain)

        subdomain_count = len(subdomains)

        if subdomain_count > 0:
            print(Fore.GREEN + f"[§]Found {subdomain_count} unique subdomains for {domain}")

            if output_file:
                save_subdomains(subdomains, output_file)
                print(Fore.GREEN + f"[§]Subdomains saved to {output_file}")
            else:
                print(Fore.RED + "Subdomains:")
                for subdomain in subdomains:
                    print(Fore.GREEN + subdomain)
        else:
            print(Fore.RED + f"No subdomains found for {domain}")

        print(Fore.CYAN + f"Total number of subdomains: {subdomain_count}")
        print()

# Main function that runs the script
def main(domain, output_file, domain_file):
    if domain_file:
        print(Fore.CYAN + f"Processing domains from file {domain_file}...")
        process_domains_from_file(domain_file, output_file)
        return

    print(Fore.CYAN + "Extracting subdomains from crt.sh now...")
    subdomains = get_subdomains_crtsh(domain)

    subdomain_count = len(subdomains)

    if subdomain_count > 0:
        print(Fore.GREEN + f"[§]Found {subdomain_count} unique subdomains for {domain}")

        if output_file:
            save_subdomains(subdomains, output_file)
            print(Fore.GREEN + f"[§]Subdomains saved to {output_file}")
        else:
            print(Fore.RED + "Subdomains:")
            for subdomain in subdomains:
                print(Fore.GREEN + subdomain)
    else:
        print(Fore.RED + f"No subdomains found for {domain}")

    print(Fore.CYAN + f"Total number of subdomains: {subdomain_count}")

# The entry point of the script
if __name__ == "__main__":

    # Define command-line argument parser
    parser = argparse.ArgumentParser(description=Fore.YELLOW + Style.BRIGHT + "Find subdomains of a domain.")
    parser.add_argument("-d", "--domain", required=not bool(sys.stdin.isatty()), help=Fore.YELLOW + "The target domain.")
    parser.add_argument("-l", "--domain_file", required=False, help=Fore.YELLOW + "A file containing a list of domains to process (optional).")
    parser.add_argument("-o", "--output_file", required=False, help=Fore.RED + "The file to store subdomains into (optional).")


    # Check if there are any arguments provided
    if len(sys.argv) == 1 and sys.stdin.isatty():
        print(Fore.YELLOW + parser.description)
        print(Fore.CYAN + "Usage: python crtHunter.py -d DOMAIN OR -l DOMAINS_LIST [-o OUTPUT_FILE] ")
        sys.exit(1)

    # Parse the command-line arguments and run the main function
    args = parser.parse_args()

    if not args.domain and not args.domain_file:
        print(Fore.RED + "Error: you must provide either a target domain (-d) or a file containing a list of domains (-l)")
        sys.exit(1)

    main(args.domain, args.output_file, args.domain_file)
 
السلام عليكم ورحمة الله

اليوم جايبلكم طريقة إن شاء الله تفيدكم في عملية جمع المعلومات

أحياناً ممكن يكون الـ Target شركة صغيرة وما في معلومات كافي عنها وبهذه الحالة لازم يكون في عنا بدائل كهكرز:ninja:

ممكن يجي شخص يحكي إنه منقدر نبحث عنها عن طريق مفتاح ASN الخاص بالشركة بحكيله أنا صحيح لكن مش كل الشركات عندها مفتاح ASN 🙂

وبهذي الحالة أفضل حل هو البحث عن طريق الشهادة

ممكن يجي نفس الشخص ويسأل ليش طيب عن طريق الشهادة تحديداً؟
راح احكيله لأنه الشركة بتشتري الشهادة لمره وحده وبتقدر تعطيها لكل السب دومينز اللي عندها أو المواقع الفرعية اللي بتملكها
وبهذه الحالة احنا منقدر نستغل هذي الميزة لصالحنا 😃

وبتمنى معش حدا يسأل ويعمل فيها إنه الفاهم 🙂
لا بمزح عادي خذ راحتك اسأل 😆


اسم الموقع:

شرح العملية في الفيديو على موقع wikipedia.org


مشاهدة المرفق 15973



Happy hacking _<
إلى اللقاء _<
الشرح رائع ❤️ والموزة حكاية
 

آخر المشاركات

فانوس

رمضان
عودة
أعلى