Skip to content

Commit d3bca55

Browse files
authored
Merge pull request #56 from BitScout/22-detect-shell-exec-via-backticks
feat(ban): Add rule to ban shell execution via backticks
2 parents 5416d33 + cc5e609 commit d3bca55

16 files changed

+20
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ CHANGELOG
44
master
55
------
66

7-
* todo...
7+
* Added rule to ban shell execution via backticks
88

99
v1.0.0
1010
------

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ parameters:
6464
- system
6565
- var_dump
6666
67+
# enable detection of shell execution by backticks
68+
-
69+
type: Expr_ShellExec
70+
functions: null
71+
6772
# enable detection of `use Tests\Foo\Bar` in a non-test file
6873
use_from_tests: true
6974
```

extension.neon

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ parameters:
4141
- system
4242
- var_dump
4343

44+
# enable detection of shell execution by backticks
45+
-
46+
type: Expr_ShellExec
47+
functions: null
48+
4449
# enable detection of `use Tests\Foo\Bar` in a non-test file
4550
use_from_tests: true
4651

snippets/backticks.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
`ls -lsa`;

snippets/echo.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<?php
22

33
echo 'test echo';
4-

snippets/eval.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<?php
22

33
eval(true);
4-

snippets/exec.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<?php
22

3-
exec('');
4-
3+
exec('ls -lsa');

snippets/exit.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<?php
22

33
exit;
4-

snippets/passthru.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<?php
22

33
passthru('');
4-

snippets/phpinfo.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
<?php
22

33
phpinfo();
4-

0 commit comments

Comments
 (0)