Decode Base64 data what a scam [closed] - base64

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
What a scam,
I've purcased a theme for wordpress and functions.php is Base64 encoded... no answers and 0 support and I can't customize it without accessing this data.
this is the file: http://pastebin.com/TQAe3dbE
and this is what I've decoded (putting echo instead of eval) but I don't know how to use it: http://pastebin.com/G7TEFr0V
This stuff is driving me crazy why encoding a piece of a theme which people buy?
Thanks for any hints,
Andrea

Fortunately, there are free PHP testers which let us evaluate this type of code without putting our server at risk. http://phptester.net/ would be one example, and putting the linked code in there, and progressively de-obfuscating it reveals some suspicious behavior. I doubt this is a wordpress theme's functions.php file.
If anyone gets curious and feels like de-obfuscating further to see what this really is, here is my progress, which breaks down when it tries to start reading files, which is blocked by phptester.net. Those offending lines are commented out below.
<?php
echo '<hr>';
echo $OOO0O0O00=__FILE__;
echo '<hr>';
echo $OOO000000=urldecode('%74%68%36%73%62%65%68%71%6c%61%34%63%6f%5f%73%61%64%66%70%6e%72');
echo '<hr>';
echo $OO00O0000=46112;
echo '<hr>';
echo $OOO0000O0=$OOO000000{4}.$OOO000000{9}.$OOO000000{3}.$OOO000000{5};
echo '<hr>';
echo $OOO0000O0.=$OOO000000{2}.$OOO000000{10}.$OOO000000{13}.$OOO000000{16};
echo '<hr>';
echo $OOO0000O0.=$OOO0000O0{3}.$OOO000000{11}.$OOO000000{12}.$OOO0000O0{7}.$OOO000000{5};
echo '<hr>';
echo $O0O0000O0='OOO0000O0';
echo '<hr>';
echo ((base64_decode('JE9PME9PMDAwMD0kT09PMDAwMDAwezE3fS4kT09PMDAwMDAwezEyfS4kT09PMDAwMDAwezE4fS4kT09PMDAwMDAwezV9LiRPT08wMDAwMDB7MTl9O2lmKCEwKSRPMDAwTzBPMDA9JE9PME9PMDAwMCgkT09PME8wTzAwLCdyYicpOyRPTzBPTzAwME89JE9PTzAwMDAwMHsxN30uJE9PTzAwMDAwMHsyMH0uJE9PTzAwMDAwMHs1fS4kT09PMDAwMDAwezl9LiRPT08wMDAwMDB7MTZ9OyRPTzBPTzAwTzA9JE9PTzAwMDAwMHsxNH0uJE9PTzAwMDAwMHswfS4kT09PMDAwMDAwezIwfS4kT09PMDAwMDAwezB9LiRPT08wMDAwMDB7MjB9OyRPTzBPTzAwME8oJE8wMDBPME8wMCwxMTQzKTskT08wME8wME8wPSgkT09PMDAwME8wKCRPTzBPTzAwTzAoJE9PME9PMDAwTygkTzAwME8wTzAwLDM4MCksJzY5aVpRTUdjTjJYaERkRlJzNy9vM2p3bWUwTFZINXJ1eDhQdll0S0kxSkFhYlVTV0VrZ095VHBubHpmQys0QnE9JywnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLycpKSk7ZXZhbCgkT08wME8wME8wKTs=')));
echo '<hr>';
echo '<hr>';
echo $OO0OO0000=$OOO000000{17}.$OOO000000{12}.$OOO000000{18}.$OOO000000{5}.$OOO000000{19};
echo '<hr>';
echo"if(!0) $O000O0O00=$OO0OO0000($OOO0O0O00,'rb')";
//if(!0)echo '<hr>'. $O000O0O00=$OO0OO0000($OOO0O0O00,'rb');
echo '<hr>';
echo $OO0OO000O=$OOO000000{17}.$OOO000000{20}.$OOO000000{5}.$OOO000000{9}.$OOO000000{16};
echo '<hr>';
echo $OO0OO00O0=$OOO000000{14}.$OOO000000{0}.$OOO000000{20}.$OOO000000{0}.$OOO000000{20};
echo '<hr>';
echo" $OO0OO000O($O000O0O00,1143)";
echo '<hr>';
//echo $OO0OO000O($O000O0O00,1143);
echo '<hr>';
echo "$OO00O00O0= ($OOO0000O0($OO0OO00O0($OO0OO000O($O000O0O00,380),'69iZQMGcN2XhDdFRs7/o3jwme0LVH5rux8PvYtKI1JAabUSWEkgOyTpnlzfC+4Bq=','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')))";
echo '<hr>';
//echo $OO00O00O0= ($OOO0000O0($OO0OO00O0($OO0OO000O($O000O0O00,380),'69iZQMGcN2XhDdFRs7/o3jwme0LVH5rux8PvYtKI1JAabUSWEkgOyTpnlzfC+4Bq=','ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/')));
echo '<hr>';
echo '<hr>';
echo base64_decode('69iZQMGcN2XhDdFRs7/o3jwme0LVH5rux8PvYtKI1JAabUSWEkgOyTpnlzfC+4Bq=');

Related

Can the Mail/Mailx be used with mail server information in line?

I am trying to create a bash script to check that mounts are in place and if not both log the information to a file as well as send out a notification. I am very novice at scripting so some of the ins and outs are elusive to me.
Because we are doing this script to monitor a very finicky piece of software I was hoping to do as much as possible in line rather than have something that creates a config file or what not because I know that if anything is changed as a setting the vendor will say that is the cause of all the issues. Below is the code of what I have come up with so far. I will admit I am not totally confident that anything in the code is going to work so if you see any glaring errors I've made I would love to know about them.
#!/bin/bash
LOGFILE="/tmp/logs/mount.log
TIMESTAMP=`date "+%Y-%m-%d %H:%M:%S"`
while sleep 10m;
do
status=$(for mnt in /reachengine /reachdata/mongo /reachbkups /mnt/AsperaShares /mnt/Editing /mnt/VOD-World/Movies_in_ProRes51_Archive /mnt/Production /mnt/ReachEngine /mnt/ITBackup /mnt/reach '/mnt/Ready for Air' '/mnt/Ready for Reach'; do mountpoint -q "$mnt" || echo "$TIMESTAMP $mnt missing"; done)
[ "$status" ] && echo "$status" >> $LOGFILE
[ "$status" ] && echo "$status" | mail -s "Missing mount" ########.##
done
#!/bin/bash
logfile="/tmp/logs/mount.log" # add 1 quote
timestamp=$( date "+%Y-%m-%d %H:%M:%S" )
mounts=(
/reachengine
/reachdata/mongo
/reachbkups
/mnt/AsperaShares
/mnt/Editing
/mnt/VOD-World/Movies_in_ProRes51_Archive
/mnt/Production
/mnt/ReachEngine
/mnt/ITBackup
/mnt/reach
'/mnt/Ready for Air'
'/mnt/Ready for Reach'
)
while sleep 10m; do
status=$(
for mnt in ${mounts[#]}; do
mountpoint -q "$mnt" || echo "$timestamp $mnt missing"
done
)
if [ "$status" ]; then
echo "$status" >> $logfile
echo "$status" | mail -s "Missing mount" ########.##
fi
done
suggestions with:
correction close double quote on logfile=
lowercase variables
$( ) instead backticks
array to scan mounts, easier to maintain
better indentation
just a quick reading, not a test
take what you like

I Can't get my bash code right to check an answer read in

My current script is like this but is for one answer.
A1="hp"
echo
echo 1.What os uses swinstall for software installs?
read answer
if [ "$answer == "$A1" ]; then
echo "correct"
else
echo "incorrect"
fi
(for questions with two answers)i would like to put in place of this see below i would like for them to be able to choose either answer up top though.
echo the answer could be hp or ux
What about using a case statement? This allows for a bit of flexibility:
A1="hp"
A2="ux"
echo
echo 1. What OS uses swinstall for software installs?
read answer
case $answer in
($A1) echo "correct"
;;
($A2) echo "correct"
;;
(*) echo "incorrect"
;;
esac

How to compare variables in for loop bash [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I want to create if statement, but in this statement are some errors
for i in ${#:2} ; do
if (( $2 -eq $i ))
then
continue
fi
done
How to fix my if statement
Your statement only works for integers.
If you want to compare them as strings, you can use [[ "string1" = "string2" ]]:
$ cat -v myscript
#!/bin/bash
for i in "${#:2}" ; do
if [[ "$2" = "$i" ]]
then
echo "$2 and $i are the same"
else
echo "$2 and $i are different"
fi
done
$ chmod +x myscript
$ ./myscript dummy target foo bar target
target and target are the same
target and foo are different
target and bar are different
target and target are the same
As you can see from this runnable example, it works. If you find that it doesn't on your system, you should provide a complete example like the above demonstrating it.
I would suggest
if [ "$2" = "$i" ]

Show file contents after searching word Done [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I need to display the file contents after searching for a word. If the word is found, display the file.
My code is below:
GNU nano 2.2.6 File: work
#!/bin/bash
while read -p "Welcome what would you like to do (S) to search or (Q) to quit " option
do
case $option in
"S") echo "What is the name of the file you would like to search for?"
read file
echo "What word would you like to find in the file?"
read word
grep -q $word $file
if [ $? -eq 0 ]; then
echo "$word found in $file"
cat $file
else
echo "$word NOT found in $file"
fi
;;
"Q") echo "Goodbye!"
exit ;;
*) echo "invalid option" ;;
esac
done
Replace
echo $file
with
cat $file
I believe you are looking for command cat $file. Stick it inside of your if block.
I need to load up what a file says with out loading up the file.
There is no way to access the contents of the file without accessing the file.
grep -l word file | xargs -r cat
shows file content if word is found. This also shows name of file
grep -l word file | xargs -r -i bash -c "echo {}:; cat {}"

how to view all thread stack of a running process on aix? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
how to view stack and state of all threads of a running process on AIX machine.
the command or tool like pstack on linux should also help..
i tried procstack, but didnt help. it does not show any stack to me. and no error though..
any ideas..?
is procstack require all executables and libraries associated with process compiled with debig info?
thanks.
Here is a script I wrote using dbx to print the stack of all threads of the given process id. Hope this helps, worked like a charm for me on aix
if [ $# -ne 1 ]
then
echo "Usage dbxstack <processid>";
exit;
fi
rm -rf printthreads.fordbx
echo "thread" >> printthreads.fordbx
echo "detach" >> printthreads.fordbx
echo "quit" >> printthreads.fordbx
dbx -a $1 -c printthreads.fordbx > threads.tempdbx 2>/dev/null
awk '$1 ~ /\$t/ { print $1 }' threads.tempdbx | sed s/\$t//g | sed s/\>//g > threadsids.tempdbx
rm -rf printthreads.fordbx
for i in `cat threadsids.tempdbx`
do
echo "print \"------------------------\"" >> printthreads.fordbx
echo "thread current $i" >> printthreads.fordbx
echo "where" >> printthreads.fordbx
echo "print \"---------tid $i---------\"" >> printthreads.fordbx
i=$(( $i+1 ));
echo $i;
done
echo "detach" >> printthreads.fordbx
echo "quit" >> printthreads.fordbx
dbx -a $1 -c printthreads.fordbx > $1.stacktrace 2> $1.stacktracerr
rm -rf threads.tempdbx threadsids.tempdbx printthreads.fordbx

Resources