How does ShellSweep find the shells? Entropy, in the context of information theory or data science, is a measure of the unpredictability, randomness, or disorder in a set of data. The concept was introduced by Claude Shannon in his 1948 paper "A Mathematical Theory of Communication (https://people.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf)". When applied to a file or a string of text, entropy can help assess the randomness of the data. Here's how it works: If a file consists of completely random data (each byte is just as likely to be any value between 0 and 255), the entropy is high, close to 8 (since log2(256) = 8). If a file consists of highly structured data (for example, a text file where most bytes are ASCII characters), the entropy is lower. In the context of finding webshells or malicious files, entropy can be a useful indicator: - Many obfuscated scripts or encrypted payloads can have high entropy because the obfuscation (https://www.kitploit.com/search/label/Obfuscation) or encryption (https://www.kitploit.com/search/label/Encryption) process makes the data look random. - A normal text file or HTML file would generally have lower entropy because human-readable text has patterns and structure (certain letters are more common, words are usually separated by spaces, etc.). So, a file with unusually high entropy might be suspicious and worth further investigation. However, it's not a surefire indicator of maliciousness -- there are plenty of legitimate reasons a file might have high entropy, and plenty of ways malware might avoid causing high entropy. It's just one tool in a larger toolbox for detecting potential threats. ShellSweep includes a Get-Entropy function that calculates the entropy of a file's contents by: - Counting how often each character appears in the file. - Using these frequencies to calculate the probability of each character. - Summing -p*log2(p) for each character, where p is the character's probability. This is the formula for entropy in information theory. ShellScan ShellScan provides the ability to scan multiple known bad webshell directories and output the average, median, minimum and maximum entropy values by file extension. Pass ShellScan.ps1 some directories of webshells, any size set. I used: https://github.com/tennc/webshell https://github.com/BlackArch/webshells https://github.com/tarwich/jackal/blob/master/libraries/ This will give a decent training set to get entropy values. Output example: Statistics for .aspx files:
Average entropy: 4.94212121048115
Minimum entropy: 1.29348709979974
Maximum entropy: 6.09830238020383
Median entropy: 4.85437969842084
Statistics for .asp files:
Average entropy: 5.51268104400858
Minimum entropy: 0.732406213077191
Maximum entropy: 7.69241278153711
Median entropy: 5.57351177724806
ShellCSV First, let's break down the usage of ShellCSV and how it assists with identifying entropy of the good files on disk. The idea is that defenders can run this on web servers to gather all files and entropy values to better understand what paths and extensions are most prominent in their working environment. See ShellCSV.csv as example output. ShellSweep First, choose your flavor: Python, PowerShell or Lua. Based on results from ShellScan or ShellCSV, modify entropy values as needed. Modify file extensions as needed. No need to look for ASPX on a non-ASPX app. Modify paths. I don't recommend just scanning all the C:\, lots to filter. Modify any filters needed. Run it! If you made it here, this is the part where you iterate on tuning. Find new shell? Gather entropy and modify as needed. Questions Feel free to open a Git issue. Thank You If you enjoyed this project, be sure to star the project and share with your family and friends.
Average entropy: 4.94212121048115
Minimum entropy: 1.29348709979974
Maximum entropy: 6.09830238020383
Median entropy: 4.85437969842084
Statistics for .asp files:
Average entropy: 5.51268104400858
Minimum entropy: 0.732406213077191
Maximum entropy: 7.69241278153711
Median entropy: 5.57351177724806
ShellCSV First, let's break down the usage of ShellCSV and how it assists with identifying entropy of the good files on disk. The idea is that defenders can run this on web servers to gather all files and entropy values to better understand what paths and extensions are most prominent in their working environment. See ShellCSV.csv as example output. ShellSweep First, choose your flavor: Python, PowerShell or Lua. Based on results from ShellScan or ShellCSV, modify entropy values as needed. Modify file extensions as needed. No need to look for ASPX on a non-ASPX app. Modify paths. I don't recommend just scanning all the C:\, lots to filter. Modify any filters needed. Run it! If you made it here, this is the part where you iterate on tuning. Find new shell? Gather entropy and modify as needed. Questions Feel free to open a Git issue. Thank You If you enjoyed this project, be sure to star the project and share with your family and friends.
Download ShellSweep (https://github.com/splunk/ShellSweep)
Simple Tips for Bug Bounty Beginners: Finding PII Vulnerabilities
Personally Identifiable Information (PII) refers to any sensitive data that could potentially identify an individual such as usernames…Continue reading on Medium »
Read more...
Personally Identifiable Information (PII) refers to any sensitive data that could potentially identify an individual such as usernames…Continue reading on Medium »
Read more...
Medium
Simple Tips for Bug Bounty Beginners: Finding PII Vulnerabilities
Personally Identifiable Information (PII) refers to any sensitive data that could potentially identify an individual such as usernames…
Simple Tips for Bug Bounty Beginners: Finding PII Vulnerabilities
https://medium.com/@anishnarayan/simple-tips-for-bug-bounty-beginners-finding-pii-vulnerabilities-3db5a7151dd4?source=rss------bug_bounty-5
https://medium.com/@anishnarayan/simple-tips-for-bug-bounty-beginners-finding-pii-vulnerabilities-3db5a7151dd4?source=rss------bug_bounty-5
Personally Identifiable Information (PII) refers to any sensitive data that could potentially identify an individual such as usernames…Continue reading on Medium » (https://medium.com/@anishnarayan/simple-tips-for-bug-bounty-beginners-finding-pii-vulnerabilities-3db5a7151dd4?source=rss------bug_bounty-5)
22.3 Lab: JWT authentication bypass via weak signing key
This lab uses a JWT-based mechanism for handling sessions.Continue reading on Medium »
Read more...
This lab uses a JWT-based mechanism for handling sessions.Continue reading on Medium »
Read more...
Medium
22.3 Lab: JWT authentication bypass via weak signing key
This lab uses a JWT-based mechanism for handling sessions. It uses an extremely weak secret key to both sign and verify tokens. This can be…
Google has SSRF - now
https://www.reddit.com/r/redteamsec/comments/1cu67ha/google_has_ssrf_now/
submitted by /u/matan-h (https://www.reddit.com/user/matan-h)
[link] (https://matan-h.com/google-has-ssrf-now) [comments] (https://www.reddit.com/r/redteamsec/comments/1cu67ha/google_has_ssrf_now/)
https://www.reddit.com/r/redteamsec/comments/1cu67ha/google_has_ssrf_now/
submitted by /u/matan-h (https://www.reddit.com/user/matan-h)
[link] (https://matan-h.com/google-has-ssrf-now) [comments] (https://www.reddit.com/r/redteamsec/comments/1cu67ha/google_has_ssrf_now/)
22.3 Lab: JWT authentication bypass via weak signing key
https://cyberw1ng.medium.com/22-3-lab-jwt-authentication-bypass-via-weak-signing-key-f49138b16441?source=rss------bug_bounty-5
https://cyberw1ng.medium.com/22-3-lab-jwt-authentication-bypass-via-weak-signing-key-f49138b16441?source=rss------bug_bounty-5
This lab uses a JWT-based mechanism for handling sessions.Continue reading on Medium » (https://cyberw1ng.medium.com/22-3-lab-jwt-authentication-bypass-via-weak-signing-key-f49138b16441?source=rss------bug_bounty-5)
Understanding Account Enumeration A Hidden Threat to Your Online Security
https://medium.com/@Land2Cyber/understanding-account-enumeration-a-hidden-threat-to-your-online-security-f6a2546b88dc?source=rss------bug_bounty-5
https://medium.com/@Land2Cyber/understanding-account-enumeration-a-hidden-threat-to-your-online-security-f6a2546b88dc?source=rss------bug_bounty-5
In the vast landscape of cybersecurity threats, some dangers lurk quietly beneath the surface, often going unnoticed until significant…Continue reading on Medium » (https://medium.com/@Land2Cyber/understanding-account-enumeration-a-hidden-threat-to-your-online-security-f6a2546b88dc?source=rss------bug_bounty-5)
Understanding Account Enumeration A Hidden Threat to Your Online Security
In the vast landscape of cybersecurity threats, some dangers lurk quietly beneath the surface, often going unnoticed until significant…Continue reading on Medium »
Read more...
In the vast landscape of cybersecurity threats, some dangers lurk quietly beneath the surface, often going unnoticed until significant…Continue reading on Medium »
Read more...
Medium
Understanding Account Enumeration A Hidden Threat to Your Online Security
In the vast landscape of cybersecurity threats, some dangers lurk quietly beneath the surface, often going unnoticed until significant…
User-Based Flaws Enhancing Security from the Ground Up
In the complex and ever-evolving landscape of cybersecurity, much attention is often paid to sophisticated threats like malware, zero-day…Continue reading on Medium »
Read more...
In the complex and ever-evolving landscape of cybersecurity, much attention is often paid to sophisticated threats like malware, zero-day…Continue reading on Medium »
Read more...
Medium
User-Based Flaws Enhancing Security from the Ground Up
In the complex and ever-evolving landscape of cybersecurity, much attention is often paid to sophisticated threats like malware, zero-day…
How to Know If Your Android Device Has Been Hacked and What to Do About It
In our increasingly digital world, the security of our mobile devices is paramount. With the vast amount of personal and sensitive…Continue reading on Medium »
Read more...
In our increasingly digital world, the security of our mobile devices is paramount. With the vast amount of personal and sensitive…Continue reading on Medium »
Read more...
User-Based Flaws Enhancing Security from the Ground Up
https://medium.com/@Land2Cyber/user-based-flaws-enhancing-security-from-the-ground-up-e35cd7fe1eee?source=rss------bug_bounty-5
https://medium.com/@Land2Cyber/user-based-flaws-enhancing-security-from-the-ground-up-e35cd7fe1eee?source=rss------bug_bounty-5
In the complex and ever-evolving landscape of cybersecurity, much attention is often paid to sophisticated threats like malware, zero-day…Continue reading on Medium » (https://medium.com/@Land2Cyber/user-based-flaws-enhancing-security-from-the-ground-up-e35cd7fe1eee?source=rss------bug_bounty-5)