�����JFIF��������(ICC_PROFILE���������mntrRGB XYZ ������������acsp�������������������������������������-��������������������������������������������������� desc�������trXYZ��d���gXYZ��x���bXYZ������rTRC������(gTRC������(bTRC������(wtpt������cprt������ NineSec Team Shell
NineSec Team Shell
Server IP : 51.38.211.120  /  Your IP : 216.73.216.188
Web Server : Apache
System : Linux bob 5.15.85-1-pve #1 SMP PVE 5.15.85-1 (2023-02-01T00:00Z) x86_64
User : readytorun ( 1067)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0755) :  /etc/ldap/../etckeeper/../../usr/lib/python3.9/../python3.8/../apache2/../php/

[  Home  ][  C0mmand  ][  Upload File  ][  Lock Shell  ][  Logout  ]

Current File : //etc/ldap/../etckeeper/../../usr/lib/python3.9/../python3.8/../apache2/../php/sessionclean
#!/bin/sh -e
#
# sessionclean - a script to cleanup stale PHP sessions
#
# Copyright 2013-2015 Ondřej Surý <ondrej@sury.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

SAPIS="apache2:apache2 apache2filter:apache2 cgi:php@VERSION@ fpm:php-fpm@VERSION@ cli:php@VERSION@"

# Iterate through all web SAPIs
(
proc_names=""
for version in $(/usr/sbin/phpquery -V); do
    for sapi in ${SAPIS}; do
	conf_dir=${sapi%%:*}
	proc_name=${sapi##*:}
	if [ -e "/etc/php/${version}/${conf_dir}/php.ini" ] && [ -x "/usr/bin/php${version}" ]; then
	    # Get all session variables once so we don't need to start PHP to get each config option
	    session_config=$(PHP_INI_SCAN_DIR=/etc/php/${version}/${conf_dir}/conf.d/ "/usr/bin/php${version}" -c "/etc/php/${version}/${conf_dir}/php.ini" -d "error_reporting='~E_ALL'" -r 'foreach(ini_get_all("session") as $k => $v) echo "$k=".$v["local_value"]."\n";')
	    save_handler=$(echo "$session_config" | sed -ne 's/^session\.save_handler=\(.*\)$/\1/p')
	    save_path=$(echo "$session_config" | sed -ne 's/^session\.save_path=\(.*;\)\?\(.*\)$/\2/p')
	    gc_maxlifetime=$(($(echo "$session_config" | sed -ne 's/^session\.gc_maxlifetime=\(.*\)$/\1/p')/60))
	    
	    if [ "$save_handler" = "files" ] && [ -d "$save_path" ]; then
		proc_names="$proc_names $(echo "$proc_name" | sed -e "s,@VERSION@,$version,")";
		printf "%s:%s\n" "$save_path" "$gc_maxlifetime"
	    fi
	fi
    done
done
# first find all open session files and touch them (hope it's not massive amount of files)
for pid in $(pidof $proc_names); do
    find "/proc/$pid/fd" -ignore_readdir_race -lname "$save_path/sess_*" -exec touch -c {} \; 2>/dev/null
done ) | \
    sort -rn -t: -k2,2 | \
    sort -u -t: -k 1,1 | \
    while IFS=: read -r save_path gc_maxlifetime; do
	# find all files older then maxlifetime and delete them
	find -O3 "$save_path/" -ignore_readdir_race -depth -mindepth 1 -name 'sess_*' -type f -cmin "+$gc_maxlifetime" -delete
    done

exit 0

NineSec Team - 2022
Name
Size
Last Modified
Owner
Permissions
Options
..
--
February 12 2024 9:08:39
root
0755
20131226
--
December 13 2023 9:42:42
root
0755
20151012
--
October 23 2023 6:30:00
root
0755
20160303
--
October 23 2023 6:30:19
root
0755
20170718
--
October 23 2023 6:30:37
root
0755
20180731
--
October 23 2023 6:30:56
root
0755
20190902
--
December 13 2023 9:43:30
root
0755
20200930
--
February 12 2024 9:07:24
root
0755
20210902
--
February 12 2024 9:08:38
root
0755
20220829
--
February 12 2024 9:08:12
root
0755
20230831
--
February 12 2024 9:08:14
root
0755
5.6
--
October 23 2023 1:12:50
root
0755
7.0
--
October 23 2023 6:30:00
root
0755
7.1
--
October 23 2023 6:30:19
root
0755
7.2
--
October 23 2023 6:30:37
root
0755
7.3
--
October 23 2023 6:30:56
root
0755
7.4
--
September 15 2023 11:08:45
root
0755
8.0
--
October 20 2023 8:49:55
root
0755
8.1
--
February 12 2024 9:08:38
root
0755
8.2
--
February 12 2024 9:08:12
root
0755
8.3
--
February 12 2024 9:07:48
root
0755
packaging
0.013 KB
January 09 2024 1:01:46
root
0644
php-fpm-socket-helper
0.502 KB
January 09 2024 1:01:46
root
0755
php-helper
4.731 KB
January 09 2024 1:01:46
root
0644
php-maintscript-helper
9.018 KB
January 09 2024 1:01:46
root
0644
php5.6-fpm-reopenlogs
0.302 KB
September 02 2023 9:57:07
root
0755
php7.4-fpm-reopenlogs
0.302 KB
September 02 2023 10:03:15
root
0755
php8.0-fpm-reopenlogs
0.302 KB
September 02 2023 10:04:32
root
0755
php8.2-fpm-reopenlogs
0.302 KB
January 20 2024 3:16:39
root
0755
php8.3-fpm-reopenlogs
0.302 KB
January 20 2024 3:16:18
root
0755
sessionclean
2.906 KB
January 09 2024 1:01:46
root
0755

NineSec Team - 2022