SlideShare a Scribd company logo
webshell-detector
~$ whoami
Enzo Borel
~$ date
31 Mai 2018
tree -L 2 webshell-detector
webshell-detector
├── Introduction
│ ├── Statement
│ └── Goal
├── Structure_of_the_system
│ ├── Overview
│ └── detectors
└── usage_and_project_continuation
whatis
~$ whatis webshell
Malicious script uploaded by an attacker
Often used as RAT
Problem: hard to detect. Scan at upload time is
not sufficient
~$ whatis webshell-detector
Goal: propose a new detection system not only
based on signatures
cd Structure_of_the_system
~$ eog overview.png
cd detectors
~$ ls -w 1
Entropy
Dangerous_routines
Obfuscation
Signatures
Fuzzy_hashing
~$ cat Entropy
Based on the formula:
Information viewed as the unexpectedness of a
signal
−∑
i=0
n
f i×log2(f i)
∑
i=0
n
f i
cd detectors
~$ cat Dangerous_routines
System commands: exec, passthru, system…
Anonymous routines
Variables functions:
$var = “phpinfo”;
$var();
~$ cat Obfuscation
Longest string
Decoding routines: base64_decode, gzuncompress…
Non-ASCII characters
/! Not always relevant by itself!
∑
i=0
n
f i
cd detectors
~$ cat Signatures
Signature: based on a portion of file
Identify known webshells.
Easily bypassed by obfuscation or new webshells
~$ cat Fuzzy_hashing
Similar files → similar bit sequences
The longer they are, the closer the hashes will be
Spamsum algorithm + Levenshtein distance
Computed by removing blanck spaces and carriage
returns
∑
i=0
n
f i
man webshell-detector
- as a Composer library
$ composer require rucd/webshell-detector
- as a command line tool
Uses the library Symfony Console
$ webshell-detector.phar analyze:file <file>
$ webshell-detector.phar analyze:directory -t
<threshold> <dir>
∑
i=0
n
f i

More Related Content

PPTX
Hunting for APT in network logs workshop presentation
ODP
Metasploit Framework Executable Encoding
PPT
Backdoor coding
PDF
Spark Day 2017- Spark 의 과거, 현재, 미래
PPTX
Metasploit for Web Workshop
PDF
Laura Garcia - Shodan API and Coding Skills [rooted2019]
PDF
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
PDF
Introduction to base shell scripting
Hunting for APT in network logs workshop presentation
Metasploit Framework Executable Encoding
Backdoor coding
Spark Day 2017- Spark 의 과거, 현재, 미래
Metasploit for Web Workshop
Laura Garcia - Shodan API and Coding Skills [rooted2019]
PuppetDB: A Single Source for Storing Your Puppet Data - PUG NY
Introduction to base shell scripting

More from Thibault Debatty (15)

PDF
An introduction to similarity search and k-nn graphs
PPTX
Blockchain for dummies
ODP
Building a Cyber Range for training Cyber Defense Situation Awareness
PDF
Design and analysis of distributed k-nearest neighbors graph algorithms
PDF
A comparative analysis of visualisation techniques to achieve CySA in the mi...
PDF
Cyber Range
PDF
Easy Server Monitoring
PDF
Data diode
PDF
USB Portal
PDF
Smart Router
PDF
Graph based APT detection
ODP
Multi-Agent System for APT Detection
ODP
Building k-nn Graphs From Large Text Data
PDF
Determining the k in k-means with MapReduce
ODP
Parallel SPAM Clustering with Hadoop
An introduction to similarity search and k-nn graphs
Blockchain for dummies
Building a Cyber Range for training Cyber Defense Situation Awareness
Design and analysis of distributed k-nearest neighbors graph algorithms
A comparative analysis of visualisation techniques to achieve CySA in the mi...
Cyber Range
Easy Server Monitoring
Data diode
USB Portal
Smart Router
Graph based APT detection
Multi-Agent System for APT Detection
Building k-nn Graphs From Large Text Data
Determining the k in k-means with MapReduce
Parallel SPAM Clustering with Hadoop
Ad

Recently uploaded (20)

PPTX
L1 - Introduction to python Backend.pptx
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
System and Network Administraation Chapter 3
PDF
medical staffing services at VALiNTRY
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Digital Strategies for Manufacturing Companies
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
assetexplorer- product-overview - presentation
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Design an Analysis of Algorithms I-SECS-1021-03
L1 - Introduction to python Backend.pptx
Digital Systems & Binary Numbers (comprehensive )
Which alternative to Crystal Reports is best for small or large businesses.pdf
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
System and Network Administraation Chapter 3
medical staffing services at VALiNTRY
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Digital Strategies for Manufacturing Companies
Why Generative AI is the Future of Content, Code & Creativity?
Navsoft: AI-Powered Business Solutions & Custom Software Development
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
assetexplorer- product-overview - presentation
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Upgrade and Innovation Strategies for SAP ERP Customers
Understanding Forklifts - TECH EHS Solution
Operating system designcfffgfgggggggvggggggggg
PTS Company Brochure 2025 (1).pdf.......
How to Choose the Right IT Partner for Your Business in Malaysia
Design an Analysis of Algorithms I-SECS-1021-03
Ad

Web shell detector

  • 2. tree -L 2 webshell-detector webshell-detector ├── Introduction │ ├── Statement │ └── Goal ├── Structure_of_the_system │ ├── Overview │ └── detectors └── usage_and_project_continuation
  • 3. whatis ~$ whatis webshell Malicious script uploaded by an attacker Often used as RAT Problem: hard to detect. Scan at upload time is not sufficient ~$ whatis webshell-detector Goal: propose a new detection system not only based on signatures
  • 5. cd detectors ~$ ls -w 1 Entropy Dangerous_routines Obfuscation Signatures Fuzzy_hashing ~$ cat Entropy Based on the formula: Information viewed as the unexpectedness of a signal −∑ i=0 n f i×log2(f i) ∑ i=0 n f i
  • 6. cd detectors ~$ cat Dangerous_routines System commands: exec, passthru, system… Anonymous routines Variables functions: $var = “phpinfo”; $var(); ~$ cat Obfuscation Longest string Decoding routines: base64_decode, gzuncompress… Non-ASCII characters /! Not always relevant by itself! ∑ i=0 n f i
  • 7. cd detectors ~$ cat Signatures Signature: based on a portion of file Identify known webshells. Easily bypassed by obfuscation or new webshells ~$ cat Fuzzy_hashing Similar files → similar bit sequences The longer they are, the closer the hashes will be Spamsum algorithm + Levenshtein distance Computed by removing blanck spaces and carriage returns ∑ i=0 n f i
  • 8. man webshell-detector - as a Composer library $ composer require rucd/webshell-detector - as a command line tool Uses the library Symfony Console $ webshell-detector.phar analyze:file <file> $ webshell-detector.phar analyze:directory -t <threshold> <dir> ∑ i=0 n f i