Comments (2)
Your regex is both too strict and missing parts to be used for generic purposes. I did try a few variations, but when trying to be encompassing it resulted in too many false positives. Here are a few examples of text that either make matching difficult or cause false positives.
$_COOKIE['f'][0]("php://input");
echo "Debugging $test($return)";
$test[2]($ff);
$dynamic($$a);
/*
param string $thing (value|alternative) optional
*/
Detecting deliberate backdoors isn't really something graudit is intended for, but you should pick up the above with the following command:
graudit -d php/superglobal <path>
Or if you really want to look for dynamic invocation and don't mind the false positives the following command seems to find most of them...
echo "\\\$[\-_A-Za-z0-9]+(\[[\'\"]?[0-9A-Za-z]+[\'\"]?\])*[[:space:]]*\([^\)]+\)" | graudit -d - <path>
but I find it too noisy to be a valuable rule.
from graudit.
Thanks for your input, I agree with the pattern (or idea behind it) to be too noisy for inclusion. I'll go ahead and close this one :)
from graudit.
Related Issues (20)
- Finding better patterns for false positive avoiding. HOT 2
- Test fail in master HOT 3
- Unable to build graudit HOT 1
- old signatures usage HOT 2
- [Suggestion] various potentially new rules HOT 2
- A couple of questions HOT 4
- Matching filename via glob HOT 1
- greap for "echo" v/s graudit; we can see graudit does not report all usage of echo HOT 2
- unescaped backslash removes all occurrences of the letter 'r' in output HOT 9
- Couldn't run the analysis!
- Can't start scan of a project folder HOT 2
- Windows style newline characters can cause issues in Cygwin. HOT 3
- Run Fails? HOT 1
- Scan specific filetypes only? HOT 5
- PHP mysqli::query HOT 2
- [Feature]: Semantic versioning HOT 1
- WordPress dictionary? HOT 2
- Release tags HOT 1
- Default build target fails HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graudit.