Linux Message Decoder Script Example 2

View previous topic View next topic Go down

Linux Message Decoder Script Example 2

Post by jamied_uk on 14th July 2016, 18:13

I watched the vid showing decoding process and made a script out of it for automation.




Code:
#!/bin/bash
# Usage: ./AYD_Kris.sh https://youtu.be/0aTex-VPnpI
myvar="$@"
youtube-dl "$myvar"
# https://youtu.be/0aTex-VPnpI
a=1
for i in *.mp4; do
  new=$(printf "%04d.mp4" "$a") #04 pad to length of 4
  mv -- "$i" "$new"
  let a=a+1
done
ffmpeg -i 0001.mp4 image%2d.png
zbarimg --raw *.png > out
base64 -d out > f
file f
rm 0001.mp4
#clear
echo "Give Permissions? (Exit If No)"
sudo chmod +x f
hexedit
# now use strings and grep to filter for just urls
strings f|grep -i -A 10 http # try small a for different resaults
# grep -a -i http f


Usage Example

make executable

Code:
sudo chmod +x AYD_Kris.sh



Code:
./AYD_Kris.sh https://youtu.be/0aTex-VPnpI


Last edited by jamied_uk on 14th July 2016, 22:39; edited 1 time in total
avatar
jamied_uk
Admin

Posts : 2184
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Linux Message Decoder Script Example 2

Post by jamied_uk on 14th July 2016, 18:38

Cleanup Script




Code:
#!/bin/bash
# ./Cleanup.sh
rm *.png*
rm *.mp4*
# add more here if required
rm out.txt
rm out
clear
echo "All Done"
avatar
jamied_uk
Admin

Posts : 2184
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Linux Message Decoder Script Example 2

Post by jamied_uk on 14th July 2016, 23:12

Encode QR Code Or Base 64 From String




Code:
sudo apt-get install -y qrencode

Generate.sh

Code:
#!/bin/bash
# Usage: ./generate.sh "test123"
myvar="$@"
echo -n "$myvar" | base64 > new_file
sudo chmod +x new_file
echo "Done"
# Decode the code
# echo -n c2NvdHRsaW51eC5jb20gcm9ja3MK | base64 -d


QR Code From String

Code:
sudo apt-get install -y qrencode


Code:
#!/bin/bash
# Usage ./test.sh "TEST123"
# qrencode -o [filename.png] ‘[text/url/information to encode]’
#
myvar="$@"
qrencode -o bg.png "$myvar"
avatar
jamied_uk
Admin

Posts : 2184
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Linux Message Decoder Script Example 2

Post by jamied_uk on 15th July 2016, 00:32

Asci & Image To Base 64



Code:

#!/bin/bash
# Usage asci_to_b64.sh "6F0AD0BFEE7D4B478AFED096E03CD80A"
myvar="$@"
echo "$myvar" | xxd -r -p | base64 > out.txt


Code:
#!/bin/bash
# Uage ./image_to_b64.sh "test.gif"
# https://stackoverflow.com/questions/16918602/how-to-base64-encode-image-in-linux-bash-shell
myvar="$@"
test="$(cat "$myvar" | base64)"
echo $test > out2.txt
# However, base64 can read from the file itself:
# test=$( base64 DSC_0251.JPG )
cat out2.txt
avatar
jamied_uk
Admin

Posts : 2184
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Linux Message Decoder Script Example 2

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum