-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathosx_disabler
106 lines (89 loc) · 2.92 KB
/
osx_disabler
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
#!/bin/bash
# Made by xeor 29. May 2011
function handle_isight {
# Try whatever we can to disable the builtin isight camera.
# Some of the builtin apps like FaceTime wont start at all with this hack. Photo Booth starts, but have no cam.
# Skype is also without camera after this (gray screen). Metasploit hack to capture the isight camera will also fail
# and give you a output that its unable to load some libs..
files="/System/Library/QuickTime/QuickTimeUSBVDCDigitizer.component"
files="$files /System/Library/QuickTime/QuickTimeComponents.component/Contents/MacOS/QuickTimeComponents"
files="$files /System/Library/PrivateFrameworks/CoreMediaIOServicesPrivate.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC"
files="$files /System/Library/PrivateFrameworks/CoreMediaIOServices.framework/Versions/A/Resources/VDC.plugin/Contents/MacOS/VDC"
files="$files /System/Library/PrivateFrameworks/CoreAUC.framework/Versions/A/CoreAUC"
if [[ "$1" == "load" ]]; then
perm=755
else
perm=0
fi
for f in $files; do
echo "Setting permission $perm on $f"
chmod $perm "$f"
done
echo "Apps that already [didn't] had access to the camera must be restarted.."
}
function handle_firewire {
# try first: kextunload /System/Library/Extensions/IOFireWireFamily.kext/Contents/PlugIns/AppleFWOHCI.kext
# /System/Library/Extensions/IOFireWireFamily.kext + reboot
# load: kextload /System/Library/Extensions/IOFireWireFamily.kext/Contents/PlugIns/AppleFWOHCI.kext
# back with .kext
echo
}
function handle_thunderbolt {
if [[ "$1" == "load" ]]; then
echo "not implemented"
else
echo "not implemented"
fi
}
###################################################################
###################################################################
# Dont do anything below here.. All modules are above this line!" #
###################################################################
###################################################################
if [[ "$(id -u)" != 0 ]]; then
echo "This utility need root to run."
exit 1
fi
mydir=$(cd $(dirname ${BASH_SOURCE:-$0});pwd)
mypath="$mydir/$0"
function get_all_modules {
# A little magic to get all the modules
all_modules=$(grep "function handle_" $mypath | grep -v grep | awk {'print $2'} | sed -e 's/handle_//g')
echo $all_modules
}
function get_modules {
if [[ "$1" == "" ]]; then
modules=$(get_all_modules)
else
modules=$*
fi
echo $modules
}
function do_action {
action=$1
shift
modules=$(get_modules $*)
for s in $modules; do
if grep -q "function handle_$s {" $mypath; then
echo "** $action $s **"
handle_$s $action
echo
else
echo "didnt find $s"
fi
done
}
t=$1
shift
case "$t" in
load)
do_action load $*
;;
unload)
do_action unload $*
;;
*)
echo "Use [load|unload] [module ...]"
echo "All modules: $(get_all_modules)"
;;
esac