Commit Graph
25 Commits
Author SHA1 Message Date
nichogeniusandGitHub 3f516f9e15 added create_function
interesting note from the php.net manual on create_function:
Caution
This function internally performs an eval() and as such has the same security issues as eval(). Additionally it has bad performance and memory usage characteristics.
2017-07-27 23:07:54 -06:00
nichogeniusandGitHub 20fa892b51 just adding some comments
just adding some comments
2017-07-27 22:59:11 -06:00
nichogeniusandGitHub 0e40b194e6 Uploaded an organized and commented version
This file just contains a list of internal php 7 functions (probably incomplete depending on extensions etc) and their 3 base64 fingerprints. It is designed to be used as either a pattern file to explore potential patterns that may be effective, or simply as a reference to translate between plain text php and the 3 different base64 versions.
2017-07-27 22:53:33 -06:00
nichogeniusandGitHub eceff0545e ovh removed
ovh removed
2017-07-27 08:59:23 -06:00
nichogeniusandGitHub 1a5020d65d bad idea... lots of fps
bad idea... lots of fps
removing base_convert
2017-07-27 07:47:04 -06:00
nichogeniusandGitHub 954cfeb10a Adding base_convert as a test
base_convert seems like a rare enough function... trying it out to see if it generates many fp's.
2017-07-27 07:41:58 -06:00
nichogeniusandGitHub 26fd5d91e7 Removed (chr\(\d+\)\.){4,}
Too many false positives
2017-07-27 07:27:37 -06:00
nichogeniusandGitHub 317ff8b6b7 Added functions, dropped Spammer.
Spammers gives false positives.  added a couple more php functions in base64
2017-07-27 07:08:05 -06:00
nichogeniusandGitHub c4cac57689 Removed some nasty false positive patterns
Removed some nasty false positive patterns
2017-07-27 05:57:28 -06:00
nichogeniusandGitHub 0844963c21 Add files via upload
This is a file of base64 patterns that represent strings that would be present if any of the functions in php7 were encoded to base64.  I'll probably add structure later by grouping them with their plain text translation.

This file is useful to swap out with patterns_raw.txt to gain additional insights into other strings to search for in base64.
2017-07-27 02:38:55 -06:00
nichogeniusandGitHub f02a984f60 Added Security service providers
Phishers often block these web-security providers... worth checking for if they don't create many false positives.
2017-07-26 09:32:51 -06:00
nichogeniusandGitHub 857999aee2 Added case-insensitive search logic
Added case-insensitive search logic

will search patterns_raw.txt, patterns_iraw.txt and patterns_re.txt
2017-07-26 05:17:53 -06:00
nichogeniusandGitHub c5f1bcaa10 New file for case-insensitive search of strings
New file for case-insensitive search of strings
patterns_iraw.txt
2017-07-26 05:13:29 -06:00
nichogeniusandGitHub 0a198f82f5 using strpos instead of substr_count
don't know if it's faster, but I don't see a reason to count the number of times a line exists in a file for our use case.
2017-07-26 05:00:04 -06:00
nichogeniusandGitHub 1c7963149e Bug fix for last commit
comment and empty line filters were in the wrong place
2017-07-26 03:09:47 -06:00
nichogeniusandGitHub 86be84e8b6 Organizing, categorizing and prioritizing patterns
There's enough raw patterns in here to justify organizing the file.
Now that whitespace and comments are supported, I've been dividing it into sections

More critical problems should be near the top as I would rather the script identify a file as a backdoor instead of as a spammer.

I don't know the history behind a lot of these or the implication of the code, so I'm sure I mis-categorized many.  There are also many that I have not done yet.
2017-07-26 01:27:53 -06:00
nichogeniusandGitHub b138ce1707 Added generic base64 long string pattern
Added some comments to the file and added a generic base64 string regex for long base64 strings.
2017-07-26 00:26:29 -06:00
nichogeniusandGitHub 8122d11eff Whitespace and Comment handling for pattern files
The pattern files are large and complex enough to justify some whitespace and comments to explain what each entry is.

Added logic to check if the line is empty or if the first character is equal to '#' before using it as a pattern.  Simply skips over empty and commented lines.
2017-07-25 23:55:37 -06:00
nichogeniusandGitHub a371961928 Two-key sorting is better
cat php-malware-scanner-master/whitelist.txt | sort -k 2,2 -k 1,1 | less
More of an OCD thing than anything, but might as well sort primarily by file path, secondarily by hash value.
2017-07-25 23:50:42 -06:00
nichogeniusandGitHub bdb375441b Sorted this file by column 2
cat whitelist.txt | sort -k 2 | less
No reason this shouldn't be sorted perfectly to keep like files together.
No white list rules changed... just plain sorting.
2017-07-25 21:29:10 -06:00
nichogeniusandGitHub 9931821ec5 added wordfence whitelist
wp-content/plugins/wordfence/lib/wordfenceURLHoover.php
checksum verified with fresh download.
2017-07-25 06:38:23 -06:00
nichogeniusandGitHub 32e8992b50 preg_replace b64 sample shortened to 'replace'
preg_replace should be shortened to just replace as it will also match str_replace, str_ireplace, ereg_replace, eregi_replace and many others I'm sure.  Should increase number of hits.  

'preg_replace' base64 strings: (removed)
cHJlZ19yZXBsYWNl
ByZWdfcmVwbGFjZ
wcmVnX3JlcGxhY2

'replace' base64 strings: (added)
cmVwbGFjZ
JlcGxhY2
yZXBsYWNl
2017-07-24 22:32:57 -06:00
nichogeniusandGitHub 34e6238a19 Minor correction to base64 sample
JHZpc2l0Y291bnQgPSAkSFRUUF9DT09LSUVf is correct.  encoded version of "$visitcount = $HTTP_COOKIE_"
I seem to have added a couple of extra characters than what I should have.  Not sure where they came from.
2017-07-24 21:51:43 -06:00
nichogeniusandGitHub deb569cd11 contact-form-7 welcome-panel.php whitelist
contact-form-7 welcome-panel.php whitelist
confirmed md5 checksum from wordpress.org download.
2017-07-24 12:33:00 -06:00
nichogeniusandGitHub 6b55cfd8b3 Added Equivalent base64 pattern samples
Because base64 converts from an 8 bit to a 6 bit character system, you can get 3 unique base64 strings from a single ascii string depending on the position of the first character.

for example:
base64_encode("system");
base64_encode(" system");
base64_encode("(  system");

The above 3 input strings all produce very different base64 signatures even though they all contain the same keyword 'system'.  This is because the first letter of system, 's' fall on indices 0,1,2 respectively.

I updated several of the base64 samples to include their offset counterparts as the originals would only catch about 1 in 3 of the actual present matches.
2017-07-24 12:23:39 -06:00