403Webshell
Server IP : 189.126.111.107  /  Your IP : 216.73.217.69
Web Server : Apache
System : Linux www.gadotticar.com.br 5.4.0-135-generic #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022 x86_64
User : gadotticar ( 1000)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/src/freeswitch-1.10.12/scripts/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/src/freeswitch-1.10.12/scripts/backtrace-from-core
#!/bin/sh
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
##### Author: Travis Cross <tc@traviscross.com>

log1 () { printf '%s' "$1">&2; }
log () { printf '%s\n' "$1">&2; }
err () { log "$1"; exit 1; }

usage () {
  local opt="$1" bs="" be=""
  $opt && { bs="[ "; be=" ]"; }
  log "usage: $0 <corefile> ${bs}<path/to/freeswitch>${be}"
}

while getopts "h" o; do
  case "$o" in
    h) usage true; exit 0; ;;
  esac
done
shift $(($OPTIND-1))


if [ $# -lt 1 ]; then
  usage true; exit 1
fi
core="$1"
if ! [ $# -lt 2 ]; then
  fspath="$2"
  [ -x "$fspath" ] || err "Not executable: $fspath"
fi
btpath="/tmp/$(date -u +%Y%m%dT%H%M%SZ)-bt.txt"
if [ -z "$fspath" ]; then
  for x in "$(which freeswitch)" \
    /usr/bin/freeswitch /usr/sbin/freeswitch \
    /usr/local/bin/freeswitch /usr/local/sbin/freeswitch \
    /opt/freeswitch/bin/freeswitch; do
    ! [ -x "$x" ] || { fspath="$x"; break; }
  done
fi
if [ -z "$fspath" ]; then
  log "Couldn't find FS binary"
  usage false; exit 1
fi
if test $(id -u) = 0 && test -f /etc/debian_version; then
  cat >&2 <<'EOF'
### You're running on Debian.  Please make sure you have appropriate
### freeswitch-*-dbg packages installed so we get as many symbols in
### this backtrace as possible.  I won't install these for you.  If
### you're running the freeswitch-all package, then you should install
### freeswitch-all-dbg.
EOF
log ''
fi

log1 'Generating backtrace...'
gdb "$fspath" "$core" > $btpath <<'EOF'
set prompt
set pagination off
printf "\n\n"
printf "================================================================================\n"
printf "# GDB session generated by FS backtrace-from-core\n"
printf "# FreeSWITCH version: %s\n", switch_version_full_str
printf "# FreeSWITCH version (human): %s\n", switch_version_full_human_str
printf "================================================================================\n"
printf "\n\n"
printf "================================================================================\n"
printf "# info threads\n"
printf "================================================================================\n"
info threads
printf "================================================================================\n"
printf "# bt\n"
printf "================================================================================\n"
bt
printf "================================================================================\n"
printf "# bt full\n"
printf "================================================================================\n"
bt full
printf "================================================================================\n"
printf "# thread apply all bt\n"
printf "================================================================================\n"
thread apply all bt
printf "================================================================================\n"
printf "# thread apply all bt full\n"
printf "================================================================================\n"
thread apply all bt full
quit
EOF
log 'done'
log ''
log "Please attach the backtrace here:"
log "$btpath"

Youez - 2016 - github.com/yon3zu
LinuXploit