Showing posts with label [VulnerabilityScan]. Show all posts
Showing posts with label [VulnerabilityScan]. Show all posts

Dec 16, 2022

Vulnerability Scanner for Open Source

Finally, Google has released the OSV-scanner as a free tool that gives opensource developers access to vulnerability information which may relevant to their projects.

With the new launching OSV.dev service, it allows all the different opensource ecosystems and vulnerability databases to publish and consume information in one simple, precise, and machine readable format (JSON).

OSV-scanner is an effort to provide supported fronted to the OSV database (OSV.dev) that connects a project's list of dependencies with vulnerabilities that affect them. 

There are a few ways to use OSV:

So, let's get start running the OSV-scanner on your project to find all the dependencies that are being used by analyzing manifests, SBOMs, and commit hashes. The scanner hen connects this information with the centralized OSV database and displays the vulnerabilities relevant to your project.


Links:

Sep 6, 2022

ApacheTomcatScanner

ApacheTomcatScanner - A python script to scan for Apache Tomcat server vulnerabilities.

Features:

  • Multi-threaded workers to search for Apache tomcat servers.
  • Multiple target source possible:   
    • Retrieving list of computers from a Windows domain (through LDAP query)   
    • Reading targets line by line from a file.        
    • Reading individual targets (IP/DNS/CIDR) from -tt/--target option.    
  • Custom list of ports to test.    
  • Tests for /manager/html access and default credentials.    
  • List the CVEs of each version with the --list-cves option


Links:

Aug 31, 2022

3 advanced and comprehensive vulnerability scanners


This is an introduction video on 3 advanced and comprehensive vulnerability scanners: Nuclei, Trivy, Vuls.

 Nuclei is an advanced website, network, CVEs vulnerability scanner. Trivy a scanner that specialized in container images, filesystems, git repositories and Kubernetes. Vuls can be used to scan any server using ssh for a wide range of vulnerabilities. 


Links:

Aug 27, 2022

VulnScanner: Vuls

Vuls, is an agentless vulnerability scanner for Linux/FreeBSD. It is open-source, agent-less that based on information from NVD, OVAL, etc.

Vuls supports local and remote scan (with and without root). It uses multiple vulnerability databases, including:

  • Vulnerability Database - NVD, JVN
  • OVAL - Red Hat, Debian, Ubuntu, SUSE, Oracle Linux
  • Security Advisory - Alpine-secdb, Red Hat Security Advisories, Debian Security Bug Tracker
  • Commands
  • PoC, Exploit - ExploitDB, Metasploit, etc
  • CERT - US-CERT, JPCERT
  • Libraries
  • WordPress

Links:

Aug 26, 2022

VulnScanner: Trivy

Trivy is a comprehensive security scanner released by AquaSec. It is reliable, fast, extremely easy to use.

Trivy has different scanners that look for different security issues, and different targets where it can find those issues.

Targets:

  •     Container Image
  •     Filesystem
  •     Git repository (remote)
  •     Kubernetes cluster or resource


Scanners:

  •     OS packages and software dependencies in use (SBOM)
  •     Known vulnerabilities (CVEs)
  •     IaC misconfigurations
  •     Sensitive information and secrets


Installing Trivy (Ubuntu):

$ sudo apt install wget apt-transport-https gnupg lsb-release

$ wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | gpg --dearmor | sudo tee /usr/share/keyrings/trivy.gpg > /dev/null

$ echo "deb [signed-by=/usr/share/keyrings/trivy.gpg] https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main" | sudo tee -a /etc/apt/sources.list.d/trivy.list

$ sudo apt update

$ sudo apt install trivy


First use:

$ trivy image python:3.4-alpine



Links:

Jun 5, 2022

Finding bugs with Nuclei


Nuclei is a community-powered scanner that can scan for almost every web-based vulnerability. But how does it work and how can you tailor it to your needs? All that and much more will be covered in this session.


Links:

Jun 4, 2022

DevSecOps 101

This is 4 parts tutorial on DevSecOps 101.

In part 1, we will learn how to detect and avoid vulnerable dependencies when developing applications.In the first step of DevSecOps, the first step towards building more secure apps is detecting and avoid using dependencies that have known vulnerabilities. This process is called Software Component Analysis or SCA. 

There are a few commercial options like Snyk, but for this tutorial, we will use the open-source pip package safety.

$ pip install safety

$ safety check --full-report

The 2nd step is to integrate SCA into the CI/CD process by adding GitHub workflow to our repository.

Next, we will perform analysis on the source code to find security vulnerabilities. This process is known as Static Application Security Testing, and this has been part of the enterprise software development lifecycle (SDLC) for years.

Recently, there are opensource tools like pylint, eslint or semgrep.

semgrep is, as its names suggest, like grep, but for source code. It allows developers to automatically find patterns in their source code while taking into account semantics like variable renaming. You can find an example of semgrep finding XSS in Django code here.

Even better, semgrep supports a lot of languages, and the semgrep community already has written plenty of rulesets to detect bad practices and security flaws for those.

$ pip install semgrep

$ semgrep --config "p/ci" --exclude .venv --error

  •     --config "p/ci" means "use the community-written security rules for running in a ci environment"
  •     --exclude .venv means "do not search for vulnerable source code in the .venv folder" (otherwise it would return hundreds of alerts!)
  •     --error means return a non-zero error code if alerts are found. Useful for making the CI fail if insecure patterns are detected

Next, we need to add semgrep to the CI/CD to avoid ever doing the in the future. With this, we just installed a tool that scans all our python code to find insecure patterns, gives us recommendations on how to solve them, and integrates seamlessly into our CI/CD.

In part 3, we will be moving into Security Integration Testing (SIT) with automation.

To have an additional layer of security testing that is closer to the application's production context, security teams use specialized tools that will simulate attacks against the running application and report the successful ones.

This process is called Dynamic Application Security Testing (DAST).

Nuclei is an easy-to-use application security testing tool written in go-lang. It leverages the community to create new automated tests using simple YAML template files.  

$ go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest

$ docker-compose up

$ nuclei -u http://localhost:8080

Next, we will be integrating Nuclei inside the CI/CD process. Again,, in only a few steps, we just install a tool that scans for vulnerabilitites directly inside CI/CD. We scannd our live running app using nuclei web-app security scanner.

In part 4, we will be learning how to scan Docker images using Trivy. This is an opensource security scanner to find mis-configuration and vulnerabilities.

Thanks to trivy, one can scan its docker images to know literally in seconds if they contain packages with known vulnerabilities. Even cooler, trivy is free, open-source, and well maintained.

$  curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.21.0

$ docker build . --file Dockerfile.app -t dvpwa.app

$ trivy image dvpwa.app:latest

Lastly, we will be integrating trivy in GitHub Actions by following a template from AquaSec. So we just set up a tool that automatically detects vulnerable packages inside our docker images, directly in the CI/CD.

In fact trivy can scan way more than docker images: filesystems, requirements.txt, package.json, Dockerfiles and K8s configs.

$ trivy config .

This will scan Dockerfile.app and Docker.db automatic.


Links:

Jun 1, 2022

Nuclei - Community Powered Vulnerability Scanner

Nuclei is a fast and customizable vulnerability scanner based on simple YAML-based templates.

It has two components, 1) Nuclei engine - the core of the project allows scripting HTTP / DNS / Network / Headless / File protocols based checks in a very simple to read-and-write YAML-based format. 2) Nuclei templates - ready-to-use community-contributed vulnerability templates.


nuclei -u http://192.168.233.81 -t misconfiguration/

Installation

$ go install -v github.com/projectdiscovery/nuclei/v2/cmd/nuclei@latest


Link:

Apr 23, 2022

Network Exploitation, Reconnaissance & Vulnerability Engine

NERVE is a vulnerability scanner tailored to find low-hanging fruit level vulnerabilities, in specific application configurations, network services, and un-patched services. 

It does not do authenticated scans. And it operates in black-box mode and do "some" CVE checks based on fingerprinting.

Example of some of NERVE's detection capabilities:    

  • Subdomain takeovers
  • Information Disclosures
  • Misconfigurations in services (Nginx, Apache, IIS, etc.)
  • Open Databases or Caches

There are 2 ways to setup NERVE: docker or standalone server. Here, I just document how I setup NERVE in docker.

$ git clone http://github.com/PaytmLabs/nerve

$ cd nerve

$ docker build -t nerve .

$ docker run -e username="admin" -e password="pass1234" -d -p 80:8080 nerve

NERVE Dashboard


Links: