Exploiting Fundamental Weaknesses in Command and Control (C&C) Panels



Similar documents
Exploiting Fundamental Weaknesses in Botnet Command and Control (C&C) Panels

Advancements in Botnet Attacks and Malware Distribution

Web Maniac Hacking Trust. Aditya K Sood [adi_ks [at] secniche.org] SecNiche Security

WWPass External Authentication Solution for IBM Security Access Manager 8.0

How To Manage Web Content Management System (Wcm)

How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

ASL IT SECURITY BEGINNERS WEB HACKING AND EXPLOITATION

ABC LTD EXTERNAL WEBSITE AND INFRASTRUCTURE IT HEALTH CHECK (ITHC) / PENETRATION TEST

Lab 7 - Exploitation 1. NCS 430 Penetration Testing Lab 7 Sunday, March 29, 2015 John Salamy

SANS Dshield Webhoneypot Project. OWASP November 13th, The OWASP Foundation Jason Lam

Web Application Threats and Vulnerabilities Web Server Hacking and Web Application Vulnerability

Web application security

Security Threat Kill Chain What log data would you need to identify an APT and perform forensic analysis?

Application Security Testing. Generic Test Strategy

Penetration Testing with Kali Linux

COURSE NAME: INFORMATION SECURITY INTERNSHIP PROGRAM

SANS Top 20 Critical Controls for Effective Cyber Defense

Project management integrated into Outlook

SYWorks Vulnerable Web Applications Compilation For Penetration Testing Installation Guide

Secure Web Development Teaching Modules 1. Security Testing. 1.1 Security Practices for Software Verification

ASL IT Security Advanced Web Exploitation Kung Fu V2.0

Botnets: The Advanced Malware Threat in Kenya's Cyberspace

Web Application Security Payloads. Andrés Riancho Director of Web Security OWASP AppSec USA Minneapolis

Introduction to Endpoint Security

INDUSTRIAL CONTROL SYSTEMS CYBER SECURITY DEMONSTRATION

Penetration Testing Report Client: Business Solutions June 15 th 2015

CRYPTUS DIPLOMA IN IT SECURITY

Reference Architecture: Enterprise Security For The Cloud

Hardening Joomla 1. HARDENING PHP. 1.1 Installing Suhosin. 1.2 Disable Remote Includes. 1.3 Disable Unneeded Functions & Classes

THE OPEN UNIVERSITY OF TANZANIA

Backup and Restore MySQL Databases

Top Ten Web Attacks. Saumil Shah Net-Square. BlackHat Asia 2002, Singapore

Web App Security Audit Services

Detecting Web Application Vulnerabilities Using Open Source Means. OWASP 3rd Free / Libre / Open Source Software (FLOSS) Conference 27/5/2008

CYBERTRON NETWORK SOLUTIONS

How to hack a website with Metasploit

Secure Web Application Coding Team Introductory Meeting December 1, :00 2:00PM Bits & Pieces Room, Sansom West Room 306 Agenda

The Top Web Application Attacks: Are you vulnerable?

Web application testing

1. Building Testing Environment

A more comprehensive version of this material was published in the October issue of the Virus Bulletin magazine [3].

Penetration: from Application down to OS

Introduction to the Mobile Access Gateway

Pentests more than just using the proper tools

Vulnerability Assessment and Penetration Testing

Magento Search Extension TECHNICAL DOCUMENTATION

STABLE & SECURE BANK lab writeup. Page 1 of 21

INSTALLING, CONFIGURING, AND DEVELOPING WITH XAMPP

Content Management System

WordPress Security Scan Configuration

Adobe Systems Incorporated

WEB ATTACKS AND COUNTERMEASURES

INFORMATION SECURITY REVIEW

Livezilla How to Install on Shared Hosting By: Jon Manning

Check list for web developers

SAST, DAST and Vulnerability Assessments, = 4

SECURING APACHE : THE BASICS - III

Botnets Die Hard Owned and Operated

Last Updated: July STATISTICA Enterprise Server Security

Black Box Penetration Testing For GPEN.KM V1.0 Month dd "#$!%&'(#)*)&'+!,!-./0!.-12!1.03!0045!.567!5895!.467!:;83!-/;0!383;!

How We're Getting Creamed

LAE 5.1. Windows Server Installation Guide. Version 1.0

Mobile Application Hacking for Android and iphone. 4-Day Hands-On Course. Syllabus

Smartphone Pentest Framework v0.1. User Guide

Mingyu Web Application Firewall (DAS- WAF) All transparent deployment for Web application gateway

Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security

MageFence. User manual

MySQL Quick Start Guide

VMware vcenter Log Insight Security Guide

FORBIDDEN - Ethical Hacking Workshop Duration

MySQL quick start guide

Virtually Secure. a journey from analysis to remote root 0day on an industry leading SSL-VPN appliance

Global Security Report 2011

SECURITY TRENDS & VULNERABILITIES REVIEW 2015

Virtual Machine daloradius Administrator Guide Version 0.9-9

Using Nessus In Web Application Vulnerability Assessments

Hacker Intelligence Initiative, Monthly Trend Report #17

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

The anatomy of an online banking fraud

Pentests more than just using the proper tools


What IT Auditors Need to Know About Secure Shell. SSH Communications Security

Chapter 17. Transport-Level Security

Global Partner Management Notice

Installing CPV Lab Version 2.17

Guidelines for Web applications protection with dedicated Web Application Firewall

Essential IT Security Testing

Metasploit The Elixir of Network Security

6WRUP:DWFK. Policies for Dedicated IIS Web Servers Group. V2.1 policy module to restrict ALL network access

Threat Modelling for Web Application Deployment. Ivan Ristic (Thinking Stone)

THE SMARTEST WAY TO PROTECT WEBSITES AND WEB APPS FROM ATTACKS

Shellshock. Oz Elisyan & Maxim Zavodchik

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Cybercrime myths, challenges and how to protect our business. Vladimir Kantchev Managing Partner Service Centrix

Newsletter - September T o o l s W a t c h T e a m NJ OUCHN & MJ SOLER

Mercury Users Guide Version 1.3 February 14, 2006

OxyClassifieds Installation Handbook

Transcription:

Exploiting Fundamental Weaknesses in Command and Control (C&C) Panels What Goes Around Comes Back Around! Aditya K Sood Senior Security Researcher and Engineer 1

Dr. Aditya K Sood About the Speaker! Senior Threat Researcher and Engineer Others Worked previously for IOActive, Armorize, Coseinc and KPMG Active Speaker at Security conferences Written Content IEEE Magazine/Virus Bulletin/ ISSA/ISACA/CrossTalk/HITB Ezine /Elsevier NESE CFS Personal Website: LinkedIn : http://www.linkedin.com/in/adityaks Website: http://www.secniche.org Blog: http://secniche.blogspot.com Company Website : http://www.niara.com Authored Targeted Cyber Attacks Book! Email : contact {at} secniche {dot} org 2

Disclaimer! The opinions and views expressed in this research presentation is completely based on my independent research and do not relate to any of my previous or present employers. I am not responsible for the links (URLs) presented in Figures and Listings as part of testing analysis and do not assume any responsibility for the accuracy or functioning of these at the time of release of this paper. These links (URLs) were live and active during testing. The research presented in this presentation should only be used for educational purposes. Please also check the updated version of this presentation after the conference. The released version of the research paper is Version 1.1! Fetch it from BlackHat Archives or http://www.secniche.org 3

What This Talk is All About?! Learning about the different insights gathered from real-time testing of C&C panels Understanding the facts and C&C design of botnet families Zeus / ICE 1X/ Citadel / BetaBot etc. Busting several myths about C&C architecture and deployments Learning what methods to follow when direct exploitation is not possible Utilizing multiple vulnerabilities to attack C&C panels Gathering information using weak C&C configurations Building C&C intelligence for Incident Response and automated solutions 4

Rationale!! Why to Break when we can Bypass! 5

C&C Panels Overview! Web-based software components for managing bots around the Internet Centralized place for communicating with bots and sending updates Majority of the C&C panels are authored in PHP and MySQL Hosted on Apache / Nginx and LAMPP (XAMPP) servers C&C panel is architected using modular components that are interdependent on each other Failing one component can impact the working of other component 6

C&C Components Protection Design Protections Gates Cryptographic Key Login Web Page Key Generic C&C Components Note: naming convention and components changes with design Component gate.php cp.php index.php config.php install/ fsarch.php Overview preventing direct access to main control panel managing bots and exfiltrated data (control panel) restricting directory listing through default code configuring settings for bots and C&C panel itself installation component (tables, databases, reports and others) archiving files 7

What are Gates? C&C Gates! Intermediate web components that perform verification on the incoming requests sent by the bots Verification of bots identity Authorization and allocation of access rights Different from login or administrative panels Gates can be treated as proxies C&C prefers to communicate with bots through gates 8

Protecting C&C Resources! ICE 1X shows following message in one of its directory: ZEND Framework Authentication Zend_Session Built-in session management functionality using namespace objects Zend_Acl Lightweight access control privileges ioncube PHP encoder to encode the PHP source code and file paths ioncube loader manages the runtime execution of PHP code 9

C&C Attack Models! Reversing malware to extract cryptographic keys and file Key provides read/write operation capabilities on the C&C panel (including components) Obtaining backdoor access to hosting servers Finding design and deployment flaws including vulnerabilities Performing source code analysis on the downloaded C&C panel Note: Read Whitepaper for complete details! 10

Google Dorks Botnet C&Cs Potential Dorks Dorks are based on the default design of the botnet family Design such as naming convention can be changed by the bot herder A number of C&C panels have been exposed using these dorks Worth giving a TRY! Test more and build more dorks! Botnet Family Zeus ICE 1X Citadel BetaBot istealer SpyEye Potential Google Dorks inurl: cp.php?m=login inurl: cp.php?letter=login inurl: adm/index.php?m=login inurl: cp.php?m=login inurl: login.php" intext: mynews Content Manager inurl: index.php?action=logs intitle: login inurl: frmcp/ 11

Google Dorks Botnet C&Cs Example : Citadel and Zeus 12

Google Dorks Botnet C&Cs Example : Finding C&C Gates 13

Network Traffic Analysis (1) Detecting network traffic to gates Analyzing communication channels used for data exfiltration Data exfiltration to Gates Plasma Bot! 14

Network Traffic Analysis (2) Remember : Gates and C&C administration interface are hosted on the same server majority of the time Gate component shows blank page and C&C panel administration interface is present on the same server 15

Multiple C&C Panels Same Server! Possibility of only one C&C panel present on the same host on the destination server Not True! Operations Analyze URL structure and associated parameters Detect directory patterns in the C&C URL Guess or Fuzz the parameters in the C&C URL Example URL structure : http://[c&c_domain]/[directory]/index.php?m=login Try: http://www.example.com/storage/1/control.php?m=login http://www.example.com/storage/2/control.php?m=login http://www.example.com/storage/3/control.php?m=login http://www.example.com/storage/4/control.php?m=login 16

Multiple C&C Panels Server! Detected multiple Zeus C&C panels on same host 17

Multiple C&C Panels Server! Detected multiple Winlocker C&C Panels 18

Demo Detecting Multiple Panels! 19

Confirming Base C&C Components! Relying on the renamed C&C component and does not ensure the present of the default one Operations Bot herders rename the C&C component to other to avoid signatures Example: renaming cp.php check.php Ensure that the default components are present on the server Testing indicates that both renamed and original files are present on the C&C server Exposed Components! 20

Installation Component Check Installation component is exposed on several botnets Vulnerable C&C Panels Zeus / ICE 1X / Citadel Extracting report directory name and accessing it to access reports directory! 21

Demo Access Via Default Components! 22

Port Mapping for Similar Resources! Relying completely on the specific port detected in the network for C&C communication Verification of only TCP port 80 or 443 on the C&C for web services Assuming that TCP port 443 is used only for HTTPS Issuing the HTTP requests to same resources on different ports Fuzzing the same web resources on the target web server on different ports This technique has resulted in fruitful scenarios 23

Port Mapping for Similar Resources! Checking same resources on different ports. A cmd file is downloaded by targeting different paths and ports! 24

Port Mapping for Similar Resources! 25

Seriously? C&C Deployment on XAMPP! XAMPP is never meant to be used for production purposes Using it for C&C is serious mistake. But, its happening! Easy configuration Serious security issues in configuration The MySQL administrator (root) has no password The MySQL daemon is accessible via network ProFTPD uses the password "lampp" for user "daemon" PhpMyAdmin is accessible via network Examples are accessible via network Refer: https://www.apachefriends.org/faq_linux.html There are number of loopholes that can be exploited to hack back into servers using XAMPP 26

Seriously? C&C Deployment on XAMPP! 27

C&C Deployment on XAMPP! 28

Demo C&C Access via XAMPP! 29

Root Directory Verification! Root directory of the hosting server should be analyzed Majority of time directory index is obtained 30

Vulnerability Hunting!! Detecting vulnerabilities in C&C panels Like hunting flaws in web applications Example:- An earlier SQL Injection in SpyEye C&C panel! 31

Weak and Default Passwords! Several C&Cs are configured with weak or default passwords istealer panel accessed using weak password 32

Remote Management Shells! Search for PHP files with arbitrary names Possibility of finding remote management shells If you know the authentication key, you can upload of your own too. Inactive Shell. But active ones have been found too! 33

Demo Detecting Remote Shells! 34

Conclusion! To fight with malware, it is important to harness the power of penetration testing and malware analysis including reverse engineering There are no shortcuts to fight against cybercrime Note: Do read the whitepaper released with this talk for extensive details. Materials are available on BlackHat Archives and http://www.secniche.org 35

Future Work! To build more interesting attack models as this research is ongoing To analyze complete evolution of botnet C&C panels To detect new C&C panels for upcoming botnets To perform data analysis to understand security guidelines used by the end-users and organizations 36

Questions and Queries!! http://www.niara.com 37