CRAWING SPIDER

Goal -> Recursively list all links starting from a base URL.

1. Read page HTML.

2. Extract all links.

3. Repeat for each new link that is not already on the list.

#!/usr/bin/env python
import re
import requests
from urllib.parse import urljoin target_url = "http://10.0.0.45/mutillidae/"
target_links = [] def extract_links_from(url):
response = requests.get(url)
return re.findall('(?:href=")(.*?")', response.content.decode()) def crawl(url):
href_links = extract_links_from(url)
for link in href_links:
link = urljoin(url, link) if "#" in link:
link = link.split("#")[0] if target_url in link and link not in target_links:
target_links.append(link)
print(link)
crawl(link) crawl(target_url)

The Python program runs perfectly.

http://10.0.0.45/mutillidae/favicon.ico"
http://10.0.0.45/mutillidae/styles/global-styles.css"
http://10.0.0.45/mutillidae/styles/ddsmoothmenu/ddsmoothmenu.css"
http://10.0.0.45/mutillidae/styles/ddsmoothmenu/ddsmoothmenu-v.css"
http://10.0.0.45/mutillidae/index.php?page=home.php"
http://10.0.0.45/mutillidae/index.php?page=login.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=login.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=login.php"
http://10.0.0.45/mutillidae/set-up-database.php"
http://10.0.0.45/mutillidae/index.php?page=show-log.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=show-log.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=show-log.php"
http://10.0.0.45/mutillidae/index.php?page=captured-data.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=captured-data.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=captured-data.php"
http://10.0.0.45/mutillidae/index.php?page=credits.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=credits.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=credits.php"
http://10.0.0.45/mutillidae/"
http://10.0.0.45/mutillidae/index.php?page=user-info.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=user-info.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=user-info.php"
http://10.0.0.45/mutillidae/index.php?page=register.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=register.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=register.php"
http://10.0.0.45/mutillidae/index.php?page=view-someones-blog.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=view-someones-blog.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=view-someones-blog.php"
http://10.0.0.45/mutillidae/index.php?page=add-to-your-blog.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=add-to-your-blog.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=add-to-your-blog.php"
http://10.0.0.45/mutillidae/index.php?page=site-footer-xss-discussion.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=site-footer-xss-discussion.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=site-footer-xss-discussion.php"
http://10.0.0.45/mutillidae/index.php?page=html5-storage.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=html5-storage.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=html5-storage.php"
http://10.0.0.45/mutillidae/index.php?page=capture-data.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=capture-data.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=capture-data.php"
http://10.0.0.45/mutillidae/index.php?page=dns-lookup.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=dns-lookup.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=dns-lookup.php"
http://10.0.0.45/mutillidae/index.php"
http://10.0.0.45/mutillidae/index.php?page=password-generator.php&username=anonymous"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=password-generator.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=password-generator.php"
http://10.0.0.45/mutillidae/index.php?page=user-poll.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=user-poll.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=user-poll.php"
http://10.0.0.45/mutillidae/index.php?page=set-background-color.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=set-background-color.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=set-background-color.php"
http://10.0.0.45/mutillidae/index.php?page=pen-test-tool-lookup.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=pen-test-tool-lookup.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=pen-test-tool-lookup.php"
http://10.0.0.45/mutillidae/index.php?page=text-file-viewer.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=text-file-viewer.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=text-file-viewer.php"
http://10.0.0.45/mutillidae/index.php?page=browser-info.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=browser-info.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=browser-info.php"
http://10.0.0.45/mutillidae/index.php?page=source-viewer.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=source-viewer.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=source-viewer.php"
http://10.0.0.45/mutillidae/index.php?page=arbitrary-file-inclusion.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=arbitrary-file-inclusion.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=arbitrary-file-inclusion.php"
http://10.0.0.45/mutillidae/index.php?page=secret-administrative-pages.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=secret-administrative-pages.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=secret-administrative-pages.php"
http://10.0.0.45/mutillidae/index.php?page=framing.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=framing.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=framing.php"
http://10.0.0.45/mutillidae/framer.html"
http://10.0.0.45/mutillidae/index.php?page=change-log.htm"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=change-log.htm"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=change-log.htm"
http://10.0.0.45/mutillidae/index.php?page=installation.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=installation.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=installation.php"
http://10.0.0.45/mutillidae/documentation/mutillidae-installation-on-xampp-win7.pdf"
http://10.0.0.45/mutillidae/index.php?page=documentation/vulnerabilities.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=documentation/vulnerabilities.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=documentation/vulnerabilities.php"
http://10.0.0.45/mutillidae/index.php?page=documentation/how-to-access-Mutillidae-over-Virtual-Box-network.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=documentation/how-to-access-Mutillidae-over-Virtual-Box-network.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=documentation/how-to-access-Mutillidae-over-Virtual-Box-network.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=home.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=home.php"
http://10.0.0.45/mutillidae/
http://10.0.0.45/mutillidae/?page=add-to-your-blog.php"
http://10.0.0.45/mutillidae/?page=view-someones-blog.php"
http://10.0.0.45/mutillidae/?page=show-log.php"
http://10.0.0.45/mutillidae/?page=text-file-viewer.php"
http://10.0.0.45/mutillidae/?page=user-info.php"
http://10.0.0.45/mutillidae/?page=login.php"
http://10.0.0.45/mutillidae/?page=credits.php"
http://10.0.0.45/mutillidae/?page=source-viewer.php"
http://10.0.0.45/mutillidae/index.php?page=usage-instructions.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=usage-instructions.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=usage-instructions.php"
http://10.0.0.45/mutillidae/index.php?page=php-errors.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=php-errors.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=php-errors.php"
http://10.0.0.45/mutillidae/index.php?page=notes.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-hints&page=notes.php"
http://10.0.0.45/mutillidae/index.php?do=toggle-security&page=notes.php"

Python Ethical Hacking - WEB PENETRATION TESTING(4)的更多相关文章

  1. Python Ethical Hacking - WEB PENETRATION TESTING(1)

    WHAT IS A WEBSITE Computer with OS and some servers. Apache, MySQL ...etc. Cotains web application. ...

  2. Python Ethical Hacking - WEB PENETRATION TESTING(2)

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

  3. Python Ethical Hacking - WEB PENETRATION TESTING(5)

    Guessing Login Information on Login Pages Our target website: http://10.0.0.45/dvwa/login.php #!/usr ...

  4. Python Ethical Hacking - WEB PENETRATION TESTING(3)

    CRAWLING SUMMARY Our crawler so far can guess: Subdomains. Directories. Files. Advantages: ->Disc ...

  5. Ethical Hacking - Web Penetration Testing(13)

    OWASP ZAP(ZED ATTACK PROXY) Automatically find vulnerabilities in web applications. Free and easy to ...

  6. Ethical Hacking - Web Penetration Testing(8)

    SQL INJECTION WHAT IS SQL? Most websites use a database to store data. Most data stored in it(userna ...

  7. Ethical Hacking - Web Penetration Testing(10)

    SQL INJECTION SQLMAP Tool designed to exploit SQL injections. Works with many DB types, MySQL, MSSQL ...

  8. Ethical Hacking - Web Penetration Testing(6)

    REMOTE FILE INCLUSION Similar to local file inclusion. But allows an attacker to read ANY file from ...

  9. Ethical Hacking - Web Penetration Testing(4)

    CODE EXECUTION VULNS Allows an attacker to execute OS commands. Windows or Linux commands. Can be us ...

随机推荐

  1. .NETCore微服务探寻(三) - 分布式日志

    前言 一直以来对于.NETCore微服务相关的技术栈都处于一个浅尝辄止的了解阶段,在现实工作中也对于微服务也一直没有使用的业务环境,所以一直也没有整合过一个完整的基于.NETCore技术栈的微服务项目 ...

  2. [ C++ ] 勿在浮沙筑高台 —— 拾遗

    explicit 主要用于处理一个参数的构造函数,使其不用于隐式类型转换(防止二义性) operator->() C++设计 ->可以一直保留下去 仿函数 仿函数会隐式继承他们中的一个(详 ...

  3. Eureka心跳健康检查机制和Spring boot admin 节点状态一直为DOWN的排查(忽略某一个节点的健康检查)

    https://www.jdon.com/springcloud/eureka-health-monitoring.html 运行阶段执行健康检查的目的是为了从Eureka服务器注册表中识别并删除不可 ...

  4. RabbitMQ:四、跨越集群

    跨越集群主要两种插件:Federation和Shovel. 原来的rabbitmq集群将多个broker将多个节点连接起来组成逻辑上独立的单个broker,但是集群也有其局限性:集群内部借助 Erla ...

  5. app之功能测试

    1 什么是APP测试? App测试就是软件工程师对这类应用软件进行功能测试,性能测试,安全性测试以及兼容性测试等. 对于app测试我们一般采用的是黑盒测试方法,也会在必要的时候进行自动化测试以及性能测 ...

  6. Jmeter系列(34)- 详解 Counter 计数器

    如果你想从头学习Jmeter,可以看看这个系列的文章哦 https://www.cnblogs.com/poloyy/category/1746599.html 简单介绍 计数器的作用:循环递增生成数 ...

  7. for循环里的break,continue和return有什么差别

    break: 此语句导致程序终止包含它的循环,并进行程序的下一阶段(整个循环后面的语句),即,不是跳到下一个循环周期而是退出循环.如果break语句包含在嵌套循环里,它只跳出最里面的循环. 如下代码 ...

  8. JavaScript基础函数体中的唯一var模式(002)

    全局变量是不好的.所以在声名变量的时候,应该采用函数体中的唯一var模式(Single var Pattern).这个模式有不少好处: 提供了一个唯一的地方来查看函数体中声名的变量 在使用一个变量之前 ...

  9. java重试

    项目中有很多需要重试的场景,而每次都得写如下的逻辑 for (int i=0;i++;i<retry){ try{ do(//逻辑代码); if(success){ break; } }catc ...

  10. JavaScript图形实例:Koch曲线

    Koch曲线的构造过程是:取一条长度为L0的直线段,将其三等分,保留两端的线段,将中间的一段改换成夹角为60度的两个等长直线:再将长度为L0/3的4个直线段分别进行三等分,并将它们中间的一段均改换成夹 ...