Python Ethical Hacking - VULNERABILITY SCANNER(2)
VULNERABILITY_SCANNER
How to discover a vulnerability in a web application?
1. Go into every possible page.
2. Look for ways to send data to web application(URL + Forms).
3. Send payloads to discover vulnerabilities.
4. Analyze the response to check of the website is vulnerable.
->General steps are the same regardless of the vulnerability.
Class Scanner.
#!/usr/bin/env python import requests
import re
from urllib.parse import urljoin class Scanner:
def __init__(self, url):
self.target_url = url
self.target_links = [] def extract_links_from(self, url):
response = requests.get(url)
return re.findall('(?:href=")(.*?")', response.content.decode()) def crawl(self, url):
href_links = self.extract_links_from(url)
for link in href_links:
link = urljoin(url, link) if "#" in link:
link = link.split("#")[0] if self.target_url in link and link not in self.target_links:
self.target_links.append(link)
print(link)
self.crawl(link)
Vulnerability scanner.
#!/usr/bin/env python import scanner target_url = "http://10.0.0.45/mutillidae/"
vuln_scanner = scanner.Scanner(target_url)
vuln_scanner.crawl(target_url)
The Python program runs fine.

Polish the Python code using Default Parameters.
Class Scanner.
#!/usr/bin/env python import requests
import re
from urllib.parse import urljoin class Scanner:
def __init__(self, url):
self.target_url = url
self.target_links = [] def extract_links_from(self, url):
response = requests.get(url)
return re.findall('(?:href=")(.*?")', response.content.decode()) def crawl(self, url=None):
if url == None:
url = self.target_url
href_links = self.extract_links_from(url)
for link in href_links:
link = urljoin(url, link) if "#" in link:
link = link.split("#")[0] if self.target_url in link and link not in self.target_links:
self.target_links.append(link)
print(link)
self.crawl(link)
Vuln_scanner:
#!/usr/bin/env python import scanner target_url = "http://10.0.0.45/mutillidae/"
vuln_scanner = scanner.Scanner(target_url)
vuln_scanner.crawl()
Python Ethical Hacking - VULNERABILITY SCANNER(2)的更多相关文章
- Python Ethical Hacking - VULNERABILITY SCANNER(9)
Automatically Discovering Vulnerabilities Using the Vulnerability Scanner 1. Modify the run_scanner ...
- Python Ethical Hacking - VULNERABILITY SCANNER(7)
VULNERABILITY_SCANNER How to discover a vulnerability in a web application? 1. Go into every possibl ...
- Python Ethical Hacking - VULNERABILITY SCANNER(4)
Extracting & Submitting Forms Automatically Target website:http://10.0.0.45/dvwa/vulnerabilities ...
- Python Ethical Hacking - VULNERABILITY SCANNER(8)
Implementing Code To Discover XSS in Parameters 1. Watch the URL of the XSS reflected page carefully ...
- Python Ethical Hacking - VULNERABILITY SCANNER(3)
Polish the Python code using sending requests in a session Class Scanner. #!/usr/bin/env python impo ...
- Python Ethical Hacking - VULNERABILITY SCANNER(1)
HTTP REQUESTS BASIC INFORMATION FLOW The user clicks on a link. HTML website generates a request(cli ...
- Python Ethical Hacking - VULNERABILITY SCANNER(6)
EXPLOITATION - XSS VULNS EXPLOITING XSS Run any javascript code. Beef framework can be used to hook ...
- Python Ethical Hacking - VULNERABILITY SCANNER(5)
EXPLOITATION - XSS VULNS XSS - CROSS SITE SCRIPTING VULNS Allow an attacker to inject javascript cod ...
- Python Ethical Hacking - BACKDOORS(8)
Cross-platform hacking All programs we wrote are pure python programs They do not rely on OS-specifi ...
随机推荐
- Jmeter系列(21)- 详解 HTTP Request
如果你想从头学习Jmeter,可以看看这个系列的文章哦 https://www.cnblogs.com/poloyy/category/1746599.html HTTP Request 介绍 用来发 ...
- 键盘侠Linux干货| ELK(Elasticsearch + Logstash + Kibana) 搭建教程
前言 Elasticsearch + Logstash + Kibana(ELK)是一套开源的日志管理方案,分析网站的访问情况时我们一般会借助 Google / 百度 / CNZZ 等方式嵌入 JS ...
- 手写spring事务框架-蚂蚁课堂
1.视频参加C:\Users\Administrator\Desktop\蚂蚁3期\[www.zxit8.com] 0017-(每特教育&每特学院&蚂蚁课堂)-3期-源码分析-手写Sp ...
- 关于Java的jdbc中 DriverManager.registerDriver(driver); //注册驱动 有没有必要写的思考
加载数据库驱动的时候,有如下部分代码: /1) 注册驱动程序 //给java.sql.Driver接口的引用赋值 com.mysql.jdbc.Driver 实现类对象// Driver driver ...
- 平时Chrome中用的一些插件
一.chrome://extensions Adblock Plus Dark Reader 让网站黑色主题 Infinity 新标签页 一个比较流行的新标签页工具 GNOME Shell integ ...
- dart快速入门教程 (4)
4.流程控制 4.1.分支结构 1.if语句 void main() { int score = 80; if (score >= 90) { print('优秀'); } else if (s ...
- 运行python出现 SyntaxError: Non-ASCII character '\xe6' in file /Users/finup/Documents/python_project/test.py 解决办法
使用pycharm运行程序时出现以下错误 这个错误主要是由于python2的编码默认是ASCII,你的文件里有中文就必须要用utf-8编码,只要在文件需要在文件开头标注 #coding=utf-8如下 ...
- Spring Boot入门系列(十七)整合Mybatis,创建自定义mapper 实现多表关联查询!
之前讲了Springboot整合Mybatis,介绍了如何自动生成pojo实体类.mapper类和对应的mapper.xml 文件,并实现最基本的增删改查功能.mybatis 插件自动生成的mappe ...
- ORA-04063: package body "DBSNMP.BSLN_INTERNAL" has errors
ORA-04063: package body "DBSNMP.BSLN_INTERNAL" has errors 问题描述: 警告日志出现报错: Sun Jun 21 00:00 ...
- NuGet 应用指南
一.前言 在产品开发过程中,一点有很多类库:这么多类库大家是如何管理的呢,TFS.SVN.Github……?在开发人员使用对应类库是否存在类库引用路径不一致.版本不一致问题.依赖类库版本不对应等一些 ...