403Webshell
Server IP : 162.144.4.212  /  Your IP : 216.73.216.50
Web Server : Apache
System : Linux gator2125.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : cozeellc ( 2980)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : ON |  Pkexec : ON
Directory :  /usr/bin/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/bin/monarx-sample-upload
#!/usr/bin/env bash
# =================================
# Title        : monarx_sample_upload.sh
# Description  : Upload a sample file to monarx.com
# Author       : support@monarx.com
# =================================
set -eo pipefail

display_usage() {
  cat << EOL
Upload a sample file to monarx.com for analysis.

Usage:
  $0 <path> [--note value]

Options:
  -n | --note   Optional free form note to include with submission
EOL
}


# Defaults
UPLOAD_URL=https://api.monarx.com/v1/file/upload/sample
CURL_EXECUTABLE=$(command -v curl &2>/dev/null)
GZIP_EXECUTABLE=$(command -v gzip &2>/dev/null)
FILE_PATH=$1
NOTE=$(cat <<NOTE
Sample upload (EID: xxx)
NOTE
)


# Assert dependencies
if [[ ! -x "${CURL_EXECUTABLE}" ]]; then
  echo 'Error: curl is not installed' >&2
  exit 1
fi

if [[ ! -x "${GZIP_EXECUTABLE}" ]]; then
  echo 'Error: gzip is not installed' >&2
  exit 1
fi


# Validate required arguments
if [[ -z "${FILE_PATH}" ]]; then
  display_usage
  exit 1
fi

if [[ ! -f "${FILE_PATH}" ]]; then
  echo -e "Error: File path to upload does not exist\n"
  display_usage
  exit 1
fi

shift # Past required argument


# Parse optional arguments
while [[ $# -gt 0 ]]
do
  key="$1"

  case $key in
    -n|--note)
      NOTE="${NOTE}\n\n$2"
      shift # past argument
      shift # past value
      ;;
    *)
      echo "Error: Unknown option (${key})"
      display_usage
      exit 1
      ;;
  esac
done


${GZIP_EXECUTABLE} -c "${FILE_PATH}" | ${CURL_EXECUTABLE} --disable --silent --show-error \
  --fail --max-time 30 --form "file=@-;type=application/gzip" --form "note=${NOTE}" "${UPLOAD_URL}" \
  && echo "Sample uploaded successfully" \
  || echo "Error uploading sample"


Youez - 2016 - github.com/yon3zu
LinuXploit