The pattern below matches the following match groups:
- Type of element: File, directory, symlink, named pipe, socket, block device or door.
- Permission
- Number of nodes (?)
- User
- Group
- Filesize
- Month (3 chars)
- Day
- Year (or in some cases a time in the format HH:MM)
- Filename
(This pattern can also be used for FTP server listings)
([-|d|l|p|s|b|D])([-|r|w|x|s|t]{9})\s+?(\d+?)\s+?(\w+)\s+(\w+)\s+?(\d+)\s+?(\w{3})\s+(\d+)\s+?(\d{4}|\d{2}\:\d{2})\s(.*)
This version supports the ls -l
and ls -lh
command: https://regex101.com/r/cN5gG2/2
The following groups are matched:
- Username
- Password (Encrypted password or
x
if it's stored in the shadow file) - User ID (UID)
- Group ID (GID)
- User ID Info
- Home directory
- Command/Shell
(.+)\:(.+?)\:(\d+)\:(\d+)\:(.*?)\:(.*?)\:(.*)
https://regex101.com/r/dK9pG0/1
Finds shellcode, it's not used to match a complete shellcode buffer but instead to check if there is shellcode in a document.
((?:\\x[a-fA-F0-9]{2})+)
https://regex101.com/r/kU7cZ8/1
Finds email and password combinations. The following matchgroups are matched:
- Password
([\w\.\?\+\-\^\{\}]+\@[\w\.\?\+\-\^]+\.[a-zA-Z]{2,4})(?:[\:\,\.\|\;\t]|\ {1,4})([^\r\n]+)
https://regex101.com/r/zW7aT8/1
Checks for hexadecimal values which must be 32 chars long.
[a-fA-F0-9]{32}
https://regex101.com/r/tU4fA1/1
Matches old Drupal 7 password hashes. The following groups are matched:
- Hash type (always "$S$")
- Number of log2 rounds (X) based on the position of the char in this list './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', example "D" -> 15
- Salt
- SHA512 hash using 2^X rounds
(Source of the parts of the hash from stackoverflow
(\$S\$)([0-9A-Za-z\.\/])([0-9A-Za-z\.\/]{8})([0-9A-Za-z\.\/]{43})
https://regex101.com/r/zA9zK8/1
Searches for base64 encoded data.
((?:[a-zA-Z0-9\+\/]{4}){4,}(?:[a-zA-Z0-9\+\/]{0,3}\={1,3})?)
https://regex101.com/r/vS8wI0/1
Matches the following groups:
- Name
- Season
- Episode
- Quality (if it exists, e.g. 720p, 1080p, ..)
- Mixed stuff (if it exists. Might contain the quality, file encoding etc.)
- Groupname
- Packager (if it exists [xyz])
- Fileextension
Version 1: Less restrictive
(.+)(?:[Ss _\.](\d{2,})[Ee _\.](\d{2,}))[\. _](\d{3,4}p)?(.+)?.*?\-(.+?)(?:\[(.+)\])?\.(\w+)
Version 2: Restrictive
([a-zA-Z0-9\.\- ]+)[\. _](?:[Ss](\d{2,})[Ee](\d{2,}))[\. _](\d{3,4}p)?(.+)\-([a-zA-Z0-9]+)(?:\[(.+)\])?\.(mkv|mp4|avi)
Version 1: https://regex101.com/r/eO0lY8/4
Version 2: https://regex101.com/r/eO0lY8/3
Matches the following groups:
- Username
- Domain
([a-zA-Z0-9_\-\.]+)\@(.+\..{2,})
https://regex101.com/r/kR6yE2/1
Matches the following groups:
- Scheme (http, https, ...)
- Domain
- Path (if any)
- GET-Arguments (if any)
- Fragment (if any)
(\w{3,})\:\/\/(?:(.+?)(\/.+)?(\?.+)(\#.+)|(.+?)(\/.+)(\?.+)|(.+?)(\/.+)(\#.+)|(.+?)(\/.+)|[^\s\/\#\?]+)
https://regex101.com/r/cL5kR3/7
Matches each value of a MAC-Address.
The matched formats are:
MM:MM:MM:SS:SS:SS
, MM-MM-MM-SS-SS-SS
and MMMM.MMSS.SSSS
(?<![a-fA-F0-9])(?:([a-fA-F0-9]{2})[\:\-]([a-fA-F0-9]{2})[\:\-]([a-fA-F0-9]{2})[\:\-]([a-fA-F0-9]{2})[\:\-]([a-fA-F0-9]{2})[\:\-]([a-fA-F0-9]{2})|([a-fA-F0-9]{4})\.([a-fA-F0-9]{4})\.([a-fA-F0-9]{4}))(?![a-fA-F0-9])
https://regex101.com/r/lF5pJ4/2
Matches various parts of the user-agent.
some/many user-agents arent matched yet - working on a better version
([\w]+?\/(?:\d+?\.?)+?)\ ?\((.+?)\)\ ?([\w]+?\/(?:\d+?\.?)+?)\ (?:([\w]+?\/(?:\d+?\.?)+?[^\w])|\(([\w\d ;,:\.\-]+?)\)\ ([\w\d\.]+\/[\w\d\.]+)(?:\ ([\w\d\.\]+[\/[\w\d\.]+[^\w]))?)
https://regex101.com/r/cZ9fM7/3
Matches common version numbers.
((?:\d\.?)+(?:\-?\w+(?!\w))?)
https://regex101.com/r/lH5jW8/1
Matches the following information on imdb movie pages:
- IMDb Title ID (ttxxxxx)
- Rating (x/10)
- Title
- Duration
- Genre1*
- Genre2*
- Genre3*
- Release date
- Poster link
- Short summary
*Groups 5-7 might not always exist, only when the movie has 3 genres listed those are matched. The same goes for 2 and 1 genres.
\/title\/(tt\d+)\/.+?itemprop=\"ratingValue\">((?:\d+?\.?)+).+?itemprop="name".+?\>(.+?) .+?\/year\/(\d{4}).+?(\d+?h\s\d+?min|\d+?min|\d+?h)(?:.+?itemprop="genre">(.+?)<\/span.+?itemprop="genre">(.+?)<\/span)?(?:.+?itemprop="genre">(.+?)<\/span)?.+datePublished.+?content="(\d{4}(?:\-\d{2}){2}).+?class="poster".+?src=\"(.+?)\"\sitemprop="image.+?itemprop="description">\s{21}(.+?\.).+?\<\/div>
https://regex101.com/r/wU0rQ2/2