Skip to Main Content
物联网设备安全
book

物联网设备安全

by Nitesh Dhanjani
March 2017
Intermediate to advanced content levelIntermediate to advanced
262 pages
5h 26m
Chinese
China Machine Press
Content preview from 物联网设备安全
36
1
# Pad it so 0:4:5a:fd:83:f9 becomes 00:04:5a:fd:83:f9 (thanks
# http://code.google.com/p/plazes/wiki/FindingMACAddress)
padded_m=`echo $m |
sed "s/^\(.\):/0\1:/" |
sed "s/:\(.\):/:0\1:/g" |
sed "s/:\(.\):/:0\1:/g" |
sed "s/:\(.\)$/:0\1/"`
# Ignore broadcast entries in the ARP table
if [ $padded_m != "FF:FF:FF:FF:FF:FF" ]
then
# Compute MD5 hash of the MAC address
bridge_username=( $(md5 -q -s $padded_m))
# Use the hash to attempt to instruct the bridge to turn
# all lights off
turn_it_off=($(curl --connect-timeout
5 -s -X PUT
http://$bridge_ip/api/$bridge_username/groups/0/action -d
{\"on\":false} | grep success))
# If it worked, go ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

数据科学之编程技术:使用R进行数据清理、分析与可视化

数据科学之编程技术:使用R进行数据清理、分析与可视化

迈克尔 弗里曼, 乔尔 罗斯
手把手教会你linux

手把手教会你linux

桑德.范.乌格特
C语言核心技术(原书第2版)

C语言核心技术(原书第2版)

Peter Prinz, Tony Crawford

Publisher Resources

ISBN: 9787111558668