Skip to content

Instantly share code, notes, and snippets.

@faisalfs10x
Last active February 12, 2021 14:26
Show Gist options
  • Save faisalfs10x/164b600905631b1119dddde366075c21 to your computer and use it in GitHub Desktop.
Save faisalfs10x/164b600905631b1119dddde366075c21 to your computer and use it in GitHub Desktop.
strings for finding backdoor shells, rootkits, botnets, and exploitable functions
# strings for finding backdoor shells, rootkits, botnets, and exploitable functions
# grep -Rn "shell *(" /var/www
exec
passthru
shell_exec
system
phpinfo
base64_decode
chmod
mkdir
fopen
fclose
readfile
php_uname
eval
edoced_46esab
popen
include
create_function
mysql_execute
php_uname
proc_open
pcntl_exec
``
include_once
require
require_once
posix_mkfifo
posix_getlogin
posix_ttyname
getenv
get_current_user
proc_get_status
get_cfg_var
disk_free_space
disk_total_space
diskfreespace
getcwd
getlastmo
getmygid
getmyinode
getmypid
getmyuid
assert
extract
parse_str
putenv
ini_set
pfsockopen
fsockopen
apache_child_terminate
posix_kill
posix_setpgid
posix_setsid
posix_setuid
tmpfile
bzopen
gzopen
chgrp
chown
copy
file_put_contents
lchgrp
lchown
link
mkdir
move_uploaded_file
symlink
tempnam
imagecreatefromgif
imagecreatefromjpeg
imagecreatefrompng
imagecreatefromwbmp
imagecreatefromxbm
imagecreatefromxpm
ftp_put
ftp_nb_put
exif_read_data
read_exif_data
exif_thumbnail
exif_imagetype
hash_file
hash_hmac_file
hash_update_file
md5_file
sha1_file
highlight_file
show_source
php_strip_whitespace
get_meta_tags
str_repeat
unserialize
register_tick_function
register_shutdown_function
getuid
uname
gethostname

Auditing php source code with grep

XSS

grep -Ri "echo" *

grep -Ri "\$_" * | grep "echo"

grep -Ri "\$_GET" * | grep "echo"

grep -Ri "\$_POST" * | grep "echo"

grep -Ri "\$_REQUEST" * | grep "echo"


SQL Injection

grep -Ri "$sql" *

grep -RI "mysqli(" *

grep -Ri "pdo(" *


File inclusion

grep -Ri "file_include(" *

grep -Ri "file_get_contents(" *

grep -Ri "include(" *


Command execution

grep -Ri "shell_exec(" *

grep -RIt "system(" *

grep -Ri "exec(" *

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment