zoukankan      html  css  js  c++  java
  • Python Ethical Hacking

    WHAT IS A WEBSITE

    • Computer with OS and some servers.
    • Apache, MySQL ...etc.
    • Cotains web application.
    • PHP, Python ...etc.
    • Web application is executed here and not on the client's machine.

    How to hack a website?

    • An application installed on a computer.
    • ->web application pentesting
    • Computer uses an OS + other applications.
    • ->server side attacks.
    • Managed by humans.
    • ->client side attacks.

     INFORMATION GATHERING

    • IP address.
    • Domain name info.
    • Technologies used.
    • Other websites on the same server.
    • DNS records.
    • Files, sub-domains, directories.

    CRAWLING SUBDOMAINS

    • Domains before the actual domain name.
    • Part of the main domain.

    Ex:

    • subdomain.target.com
    • mail.google.com
    • plus.google.com
    #!/usr/bin/env python
    
    import requests
    url = "baidu.com"
    try:
        get_response = requests.get("http://" + url)
        print(get_response)
    except requests.exceptions.ConnectionError:
        pass

     Polished Python Code:

    #!/usr/bin/env python
    
    import requests
    
    
    def request(url):
        try:
            return requests.get("http://" + url)
        except requests.exceptions.ConnectionError:
            pass
    
    
    target_url = "baidu.com"
    
    with open("subdomains.list", "r") as wordlist_file:
        for line in wordlist_file:
            word = line.strip()
            test_url = word + "." + target_url
            response = request(test_url)
            if response:
                print("[+] Discovered subdomain --> " + test_url)

    相信未来 - 该面对的绝不逃避,该执著的永不怨悔,该舍弃的不再留念,该珍惜的好好把握。
  • 相关阅读:
    iOS离屏渲染简书
    iOS Waxpatch项目(动态更新)
    waxpatch修改任意类的用法
    ios waxpatch lua语法
    ios WaxPatch热更新原理
    WaxPatch中demo注意问题
    ios wax热更新之安装wax(xcode7.3.1)
    获取第三方键盘高度(包括自带键盘高度)
    25个增强iOS应用程序性能的提示和技巧(高级篇)(2)
    JS基础_一元运算符
  • 原文地址:https://www.cnblogs.com/keepmoving1113/p/11705186.html
Copyright © 2011-2022 走看看