ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //proc/thread-self/root/opt/gsutil/third_party/httplib2/script/compile-py3-openssl11.sh
#!not for running standalone, see .github/workflows/test.yaml

cache_dir=$HOME/.cache
install_dir=$cache_dir/py3-openssl11
python_version="3.7.3"
openssl_version="1.1.1f"
cpucount=$(nproc --all)
export PYTHONDONTWRITEBYTECODE=1

#rm -rf $cache_dir/* # uncomment to rebuild

if [[ ! -x "$install_dir/bin/python" ]] || [[ $($install_dir/bin/python -V) != "Python $python_version" ]] ; then
  (
  mkdir -p /tmp/source
  cd /tmp/source
  # Compile OpenSSL
  curl -fLOsS "https://www.openssl.org/source/openssl-$openssl_version.tar.gz"
  echo "Extracting OpenSSL..."
  tar xf openssl-$openssl_version.tar.gz
  cd ./openssl-$openssl_version
  echo "Compiling OpenSSL $openssl_version..."
  ./config shared --prefix=$install_dir
  echo "Running make for OpenSSL..."
  make -j$cpucount -s
  echo "Running make install for OpenSSL..."
  make install_sw >/dev/null
  export LD_LIBRARY_PATH=$install_dir/lib

  cd /tmp/source
  sudo apt install -qq --yes libffi-dev
  # Compile latest Python
  curl -fLOsS "https://www.python.org/ftp/python/$python_version/Python-$python_version.tar.xz"
  echo "Extracting Python..."
  tar xf Python-$python_version.tar.xz
  cd ./Python-$python_version
  echo "Compiling Python $python_version..."
  # Note we are purposefully NOT using optimization flags as they increase compile time 10x
  conf_flags="--with-openssl=$install_dir --prefix=$install_dir --with-ensurepip=upgrade"
  CFLAGS=-O1 ./configure $conf_flags > /dev/null
  make -j$cpucount -s
  echo "Installing Python..."
  make altinstall bininstall >/dev/null
  ln -fs pip3.7 $install_dir/bin/pip3
  ln -fs pip3 $install_dir/bin/pip
  ln -fs python3 $install_dir/bin/python
  # care for CI cache size
  find $install_dir -type d -name __pycache__ -print0 |xargs -0 rm -rf
  )
fi

export LD_LIBRARY_PATH=$install_dir/lib
export PATH=$install_dir/bin:$PATH
if [[ $(python -V) != "Python $python_version" ]] ; then
  echo "Required Python version was not installed into PATH" >&2
  exit 1
fi
if [[ $(python -c 'import ssl; print(ssl.OPENSSL_VERSION)') != OpenSSL\ ${openssl_version}* ]] ; then
  echo "Required OpenSSL version was not installed into Python" >&2
  exit 1
fi