当前位置 : 主页 > 编程语言 > python >

Python Ethical Hacking - WEB PENETRATION TESTING(2)

来源:互联网 收集:自由互联 发布时间:2021-06-25
CRAWING DIRECTORIES Directories/folders inside the web root. Can contain files or other directories. Ex: target.com/directory plus.google.com/discover Target: Metasploitable2-Linux # !/usr/bin/env python import requests def request(url): tr

 CRAWING DIRECTORIES

  • Directories/folders inside the web root.
  • Can contain files or other directories.

Ex:

  • target.com/directory
  • plus.google.com/discover

 

Target: Metasploitable2-Linux

 

 

#!/usr/bin/env python

import requests


def request(url):
    try:
        return requests.get("http://" + url)
    except requests.exceptions.ConnectionError:
        pass


target_url = "10.0.0.45/mutillidae/"

with open("common.list", "r") as wordlist_file:
    for line in wordlist_file:
        word = line.strip()
        response = request(test_url)
        if response:
            print("[+] Discovered URL --> " + test_url)

 

 WoW, Amazing!

网友评论