forked from souravbaghz/Carpunk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcarpunk.sh
133 lines (107 loc) · 3.21 KB
/
carpunk.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#!/bin/bash
#Project: CarPunk
#Coded By: souravbaghz
#+++++++++++++++++++++++++ WARNINGS ++++++++++++++++++++++++++
#EDUCATIONAL PURPOSE ONLY - DON'T USE ON UNAUTHORISED VEHICLES
#I AM NOT RESPONSIBLE FOR ANY BAD USE OF THIS TOOL
#Colours
bold="\e[1m"
italic="\e[3m"
reset="\e[0m"
blink="\e[5m"
crayn="\e[36m"
yellow="\e[93m"
red="\e[31m"
black="\e[30m"
green="\e[92m"
redbg="\e[41m"
greenbg="\e[40m"
mkdir -p logs
#var
msg=" Hack the Car"
inc="1"
#=============================================
# PLEASE CHANGE THE INTERFACE AND LOG-NAME
i="vcan0"
log="carpunk"
#=============================================
banner(){
echo -e "${green}
|──────────────────────────────────────|
▄▄· ▄▄▄· ▄▄▄ ▄▄▄·▄• ▄▌ ▐ ▄ ▄ •▄
▐█ ▌▪▐█ ▀█ ▀▄ █·▐█ ▄██▪██▌•█▌▐██▌▄▌▪
██ ▄▄▄█▀▀█ ▐▀▀▄ ██▀·█▌▐█▌▐█▐▐▌▐▀▀▄·
▐███▌▐█ ▪▐▌▐█•█▌▐█▪·•▐█▄█▌██▐█▌▐█.█▌
·▀▀▀ ▀ ▀ .▀ ▀.▀ ▀▀▀ ▀▀ █▪·▀ ▀
${greenbg}${green}<:coded by souravbaghz:>${reset}
$msg
$green|──────────────────────────────────────|$reset
"
}
trap ctrl_c INT
ctrl_c(){
echo
echo "CTRL_C by user"
menu
}
menu(){
clear
banner
echo -e " [1] UP the CAN Interface"
echo -e " [2] Down the CAN Interface"
echo -e " [3] Start the Basic Sniffing"
echo -e " [4] Record the CAN Packets"
echo -e " [5] Play the CAN Packets"
echo -e " [0] Exit"
read -p " [>] Choose: " option
if [[ $option = 1 || $option = 01 ]]
then
ip link set $i up
msg=" Interface Is UP Now!"
clear
menu
elif [[ $option = 2 || $option = 02 ]]
then
ip link set $i down
msg=" Interface Is Down Now!"
clear
menu
elif [[ $option = 3 || $option = 03 ]]
then
echo -e "${red}+${reset}------------------------------------${red}+${reset}"
msg=" Happy Car Hacking"
cansniffer $i -c
read -r -s -p $'Press ENTER to go menu.'
clear
menu
elif [[ $option = 4 || $option = 04 ]]
then
echo -e "${red}+${reset}------------------------------------${red}+${reset}"
msg=" Recorded & Stored as $log$inc.log"
candump -L $i >logs/$log$inc.log
inc=$((inc+1))
echo " >"
read -r -s -p $'Press ENTER to go menu.'
menu
elif [[ $option = 5 || $option = 05 ]]
then
echo -e "${red}+${reset}------------------------------------${red}+${reset}"
msg=" Replay Attack Completed"
read -p "[?]Enter log name: " logname
canplayer -I logs/$logname
clear
menu
elif [[ $option = 0 || $option = 00 ]]
then
echo -e "[!]Exiting...${green}${reset}"
clear
exit 1
else
echo "Invalid Option..."
sleep 1
msg=" Oops! It's incorrect option"
clear
menu
fi
}
menu