自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

打造基于Zigbee的IoT漏洞安全試驗(yàn)環(huán)境

安全 漏洞
Zigbee是在智能家居設(shè)備和其他物聯(lián)網(wǎng)設(shè)備中最常見的通信協(xié)議之一。 由于Zigbee具備低功耗、網(wǎng)狀網(wǎng)絡(luò)和易用性的優(yōu)勢,所以日益成為制造商的首選。

前言

目前,Zigbee已經(jīng)成為智能家居和醫(yī)療設(shè)備中最流行的物聯(lián)網(wǎng)無線電通信協(xié)議,本文將討論它的安全性以及相關(guān)的物聯(lián)網(wǎng)設(shè)備的利用技術(shù)。

Zigbee簡介

Zigbee是在智能家居設(shè)備和其他物聯(lián)網(wǎng)設(shè)備中最常見的通信協(xié)議之一。 由于Zigbee具備低功耗、網(wǎng)狀網(wǎng)絡(luò)和易用性的優(yōu)勢,所以日益成為制造商的首選。它是在IEEE 802.15.4的基礎(chǔ)之上,由Zigbee聯(lián)盟成員公司共同創(chuàng)建的一個(gè)開放協(xié)議,該聯(lián)盟成員包括TI、Silicon Labs、Philips等公司。Zigbee協(xié)議已經(jīng)進(jìn)行了多次迭代,當(dāng)前版本是Zigbee 3.0。

可能的攻擊

作為一種無線電通信協(xié)議,Zigbee同樣免不了受到標(biāo)準(zhǔn)無線電協(xié)議的漏洞的影響。在使用Zigbee進(jìn)行通信時(shí),可能發(fā)生的攻擊有:

1. 攻擊者能夠嗅探傳輸?shù)臄?shù)據(jù)

2. 捕獲傳輸?shù)臄?shù)據(jù)后重放數(shù)據(jù)包,從而執(zhí)行惡意動(dòng)作

3. 在初始通信期間嗅探加密密鑰

4. 修改捕獲的數(shù)據(jù)包,然后重放

5. 欺騙攻擊

6. 拒絕服務(wù)攻擊

本文只是一個(gè)入門指南,介紹如何搭設(shè)利用Zigbee漏洞的實(shí)驗(yàn)環(huán)境和有關(guān)的基礎(chǔ)知識(shí),在后續(xù)文章中,我們將在此基礎(chǔ)上進(jìn)一步介紹上述每種類型的安全漏洞的利用技術(shù)。

硬件要求

在繼續(xù)閱讀下文之前,請不要忘了,這里介紹的硬件只是探索Zigbee安全性的可能硬件組合之一。實(shí)際上,有各種其他類型的硬件可資使用,例如我們既可以使用Zigbee開發(fā)套件,也可以使用商業(yè)IoT設(shè)備發(fā)射Zigbee信號(hào)等。

下面是一個(gè)供我們?nèi)腴T的簡單配置:

1. Arduino Uno/Nano

2. DigiKey Xbee module / Arduino Xbee shield

3. Atmel RzRaven USB stick

4. Attify Badge

Arduino:Arduino已經(jīng)在各種類型的電子項(xiàng)目中廣為普及了。實(shí)際上,你很可能已經(jīng)在大學(xué)或高中階段早就用過它了。Nano是體積最小的Arduino nano,但是對于本文的用途來說,它的功能已經(jīng)足夠了。

DigiKey Xbee module / Xbee Shield :為了學(xué)習(xí)Zigbee,你需要一些可以發(fā)送和接收Zigbee信號(hào)的東西。 Xbee是一種全雙工收發(fā)器,能夠使用Zigbee標(biāo)準(zhǔn)協(xié)議與其他Xbee模塊進(jìn)行無線通信。

Atmel RzRaven USB Stick:這是半雙工模塊,它能執(zhí)行嗅探,并且可以將捕獲的Zigbee數(shù)據(jù)包進(jìn)行相應(yīng)的修改后再次傳輸。如果你熟悉其他類型的無線電利用技術(shù)的話,可以將其視為“用于Zigbee的HackRF”。

Attify Badge:您可以將其插到系統(tǒng)上,然后使用它和XCTU對Xbee模塊進(jìn)行編程。之所以這么做,是因?yàn)閄bee通常沒有miniUSB或類似的端口,所以無法直接插入進(jìn)行編程。如果您沒有Attify Badge或類似的硬件,可以通過亞馬遜或您當(dāng)?shù)氐纳痰曩徺I一個(gè)用于Xbee的迷你USB套件,比如類似于頁面https://www.sparkfun.com/products/11812中這樣的套件。

[[177880]]

用于Xbee的MiniUSB電路板

或者,你也可以通過郵件(secure@attify.com)方式購買 Attify BadgeAttify Badge。

利用Attify攻擊物聯(lián)網(wǎng)嵌入式設(shè)備

對于編程和硬件連接來說,使用它是最簡單的方案,只需要連接下列引腳:power => power,Gnd => Gnd,Tx到Rx,Rx到Tx。如果需要的話,您可以進(jìn)一步參考Xbee模塊相應(yīng)版本的說明書。

對Arduino和Xbee進(jìn)行編程

對Arduino進(jìn)行編程

要想對Arduino進(jìn)行編程,只需從https://www.arduino.cc/en/Main/Software下載使用Arduino IDE即可。加載后,可以從Attify的github庫中逐一打開每個(gè)Arduino的Hub和Node程序。

代碼本身提供了詳細(xì)的內(nèi)聯(lián)注釋,你可以通過注釋來了解代碼的含義。另外,提供的代碼示例還可以通過傳感器和DHT庫來獲取溫度、濕度和光照值。它非常適合用于進(jìn)行完整的分析,以及通過傳輸一個(gè)硬編碼字符串進(jìn)行攻擊,而不是使用DHT值。此外,如果你想原封不動(dòng)地使用這些代碼的話,則需要購買DHT11和所需的其他附屬設(shè)備。

所需工具

Arduino * 1 https://www.sparkfun.com/products/11021

DHT 11 * 1 https://www.adafruit.com/product/386

XBee S1模塊(S2模塊需要不同的配置)* 2 LDR / Photocell * 1 https://www.sparkfun.com/products/9088

BC547 * 1 https://www.sparkfun.com/products/8928

LED *任意數(shù)量https://www.sparkfun.com/products/10635

跳線https://www.sparkfun.com/products/13870

面包板https://www.sparkfun.com/products/12046

Xbee shield * 2 https://www.sparkfun.com/products/128

電路圖

下面是我們的入門套件配置的電路圖。

Node電路圖:

Node電路圖

Hub電路圖:

Hub電路圖

Node代碼:

  1. // Offensive IoT Exploitation by Attify  
  2. // www.attify.com | www.offensiveiotexploitation.com  
  3. // <span id="eeb-575002"></span><script type="text/javascript">(function(){var ml="k-CeFED2o0t%ylAfaismr.4ch3un",mi=";I2@;79HD3?;I6;77C@A=:8;I>B3GJD3;F9@::A?<EG8C;77;79;79G=@BB;I6;77C@A=:81=AK0;77;I5B3GJD3;F9@::A?<EG8C;I2;74@;I5",o="";for(var j=0,l=mi.length;j<l;j++){o+=ml.charAt(mi.charCodeAt(j)-48);}document.getElementById("eeb-575002").innerHTML = decodeURIComponent(o);}());</script><noscript>*protected email*</noscript>  
  4. #include <dht.h> //Library for DHT11  Humidity 
  5. #define dht_dpin A0 // DTH11 Data pin connected to AO of arduino 
  6. #define led 2 // Led connected to Pin D2 
  7. #define ldr A1 // LDR connected to Pin A1 
  8. dht DHT; // Creating DHT function  
  9. void setup() { 
  10.   // initialize serial: 
  11.   Serial.begin(2400); // Initiliaze Hardware serial for xbee 
  12.   pinMode(2, OUTPUT); // Pin direction of LED to Output as it sends current 
  13. void loop() { // Continous loop 
  14.   // if there's any serial available, read it: 
  15.    DHT.read11(dht_dpin); // Reading DHT11 using the library 
  16.   int lig = analogRead(ldr); // Reading analog values from LDR 
  17.   int ligp = map(lig, 0, 1023, 0, 100); // Mapping the 10bit resolution ADC to 0 to 100 
  18.   int h = DHT.humidity; // Humidity value 
  19.   int t = DHT.temperature; // Temperature value 
  20.   while (Serial.available() > 0) { // Checking for any data on Xbee 
  21.     int red = Serial.parseInt(); // look for the next valid integer in the incoming serial stream 
  22.     if (Serial.read() == '!') // Check if the next Serial data is '!' 
  23.     { 
  24.       if(red == 1) // if the recieved data is 1!  
  25.         { 
  26.         Serial.print(h,DEC); // Send humidity value with '!' 
  27.         Serial.print("!"); 
  28.           } 
  29.          else  
  30.          if(red == 2) // if the recieved data is 2! 
  31.     { 
  32.       Serial.print(t,DEC); // Send Temperature value with '!' 
  33.       Serial.print("!"); 
  34.     } 
  35.     else  
  36.     if(red == 3) // if the recieved data is 3! 
  37.     { 
  38.     Serial.print(ligp,DEC); // Send Light value with '!' 
  39.       Serial.print("!"); 
  40.     } 
  41.      else  
  42.      if(red == 4) // if the recieved data is 4! 
  43.     { 
  44.    digitalWrite(2, HIGH); // Turn ON the LED 
  45.     delay(100); 
  46.     } 
  47.     else if(red == 5)  // if the recieved data is 5! 
  48.     { 
  49.    digitalWrite(2, LOW);  //Turn OFF the LEd 
  50.     delay(100); 
  51.     Serial.print("!attify!"); // Send the AES key 
  52.     } 
  53.     } 
  54.   } 

Hub代碼:

  1. // Offensive IoT Exploitation by Attify  
  2. // www.attify.com | www.offensiveiotexploitation.com  
  3. // <span id="eeb-82412"></span><script type="text/javascript">(function(){var ml="ikruc-CFsA3En%mahD.2l04oyfte",mi="=:6?=CE@2KI=:A=CC>?0DJG=:98K432K=FE?JJ0IHB4G>=CC=CE=CE4D?88=:A=CC>?0DJG5D0<1=CC=:;8K432K=FE?JJ0IHB4G>=:6=C7?=:;",o="";for(var j=0,l=mi.length;j<l;j++){o+=ml.charAt(mi.charCodeAt(j)-48);}document.getElementById("eeb-82412").innerHTML = decodeURIComponent(o);}());</script><noscript>*protected email*</noscript> 
  4. #include <SoftwareSerial.h> // Software based UART port to use Zigbee module 
  5. int a = 1; 
  6. float hum = 0, temp = 0;  // Float Variable to store Temperature and Humidity 
  7. SoftwareSerial xbee(3, 2); // RX, TX 
  8. void setup() //One time preloading function 
  9. {    
  10. Serial.begin(9600); // Hardware Serial initialization to be connected to a bluetooth module or PC 
  11. xbee.begin(2400);  // Software Serial initialization at 2400 Baud rate to communicate with zigbee  
  12. void loop() // Continous loop 
  13.  xbee.print(a);   // Sends (a) with "!" to Xbee -> "1!" Requests temperature data and vice versa 
  14.  xbee.println("!"); 
  15.  while(xbee.available() > 0) //Checks is any data has been recieved from zigbee.  
  16.   {  
  17.     char aChar = xbee.read();  //reading the value from the Xbee serial port 
  18.       if(aChar == 33)  //If the first character is 33 ie) ! in ASCII 
  19.       { 
  20.         xbee.flush();  // Clear the buffer and  
  21.         aChar = NULL
  22.        } 
  23.       if(aChar >= 100) // If it is more than 100 or random ASCII character flush the data 
  24.        { 
  25.         xbee.flush(); 
  26.         aChar = NULL
  27.        } 
  28.   Serial.print(aChar); //Printing the Read value  
  29.   } 
  30.   if(a == 3) // if a = 3 create new line or end of one set of data transmission 
  31.   { 
  32.     Serial.println(); //New line print 
  33.   } 
  34.   else  
  35.   { 
  36.     Serial.print(","); // if a not 3 then add ","  
  37.   } 
  38.   if(a> 3) // after a > 3 print the AES encryted data to xbee 
  39.   { 
  40.     a =1; // initialize a = 1 back 
  41.     xbee.print("!f+F8YW+9W3+Cg0S1NVBexycQxz32biWTmzVsxO48+fk=!"); 
  42.   } 
  43.   delay(100); // Wait for few ms for this to happen 
  44.   xbee.flush(); // flush any data in Xbee serial port 
  45.   a=a+1;  //Increment data 
  46.   if(Serial.available()); // Check if any data is sent from Hardware serial port 
  47.   { 
  48.     int r = Serial.parseInt(); // Recieving any integer data 
  49.     if(r== 1)  // if recieved data is 1. Send 4! which turns the LED on the Node. 
  50.     { 
  51.       xbee.print(4); 
  52.       xbee.print("!"); 
  53.       delay(100); 
  54.     } 
  55.       if(r== 2)// if recieved data is 2. Send 5! which turns the LED off the Node. 
  56.     { 
  57.       xbee.print(5); 
  58.       xbee.print("!"); 
  59.     } 
  60.   } 

一旦完成了這兩個(gè)Arduino的編程工作,下一步就是使用XCTU來配置Xbees。

對Xbee進(jìn)行編程

啟動(dòng)XCTU并單擊Discover Radio模塊,這時(shí)將顯示已插入設(shè)備的可用COM端口的列表。然后,選擇與Xbee模塊對應(yīng)的COM端口(如果您不太確定,就全部選上)。

其他配置總是8N1、8個(gè)數(shù)據(jù)位、無奇偶校驗(yàn)位和1個(gè)停止位。 此外,您還需要為給定的Xbee模塊指定波特率。 如果您不知道模塊使用的波特率,您可以給模塊選擇所有波特率,XCTU將掃描所有波特率并為您找到正確的波特率。

結(jié)束模塊的搜索后,點(diǎn)擊Finish,它就能識(shí)別出該設(shè)備。 單擊Add the Device。

利用XCTU識(shí)別出的設(shè)備

在這一步中,您將看到設(shè)備的各種屬性,例如信道名稱和PAN ID,這兩個(gè)屬性對于我們來說非常重要。在Zigbee中,每個(gè)頻帶總共有16個(gè)信道,每個(gè)信道間隔5MHz,2MHz的帶寬用于無噪聲數(shù)據(jù)傳輸。我們可以從http://www.digi.com/wiki/developer/index.php/Channels,_Zigbee找到所有Zigbee通道的清單。 Zigbee網(wǎng)絡(luò)的PAN ID是唯一的標(biāo)識(shí)符,其對于該網(wǎng)絡(luò)上的所有設(shè)備都是相同的。我們可以將信道名稱和PAN ID配置為任何特定的值,只需要確保其他Xbee也使用相同的信道名稱和PAN ID即可。

XCTU中顯示的Xbee屬性

后記

到此為止,我們一家搭建好了Zigbee的漏洞實(shí)驗(yàn)環(huán)境。在將來的Zigbee安全文章中,我們將在這個(gè)實(shí)驗(yàn)平臺(tái)上面介紹各種利用技術(shù),包括控制商業(yè)設(shè)備發(fā)射Zigbee信號(hào)等。

責(zé)任編輯:武曉燕 來源: attify
相關(guān)推薦

2017-05-04 15:10:01

漏洞IoT智能燈泡BLE

2015-08-26 10:14:29

2013-09-17 12:26:43

BYOD環(huán)境安全BYOD移動(dòng)設(shè)備

2022-07-07 10:41:53

鯤鵬

2019-10-25 10:34:49

變異測試單元測試

2021-04-25 21:45:25

網(wǎng)絡(luò)安全網(wǎng)絡(luò)安全攻防ZigBee安全

2011-05-25 18:23:52

2015-11-03 16:43:01

容器編排容器環(huán)境可擴(kuò)展

2009-12-04 10:22:35

網(wǎng)絡(luò)安全內(nèi)網(wǎng)安全企業(yè)安全

2018-09-10 06:00:12

2009-02-27 11:32:00

2018-12-26 09:14:24

物聯(lián)網(wǎng)安全物聯(lián)網(wǎng)設(shè)備物聯(lián)網(wǎng)

2018-10-26 14:14:19

Zigbee無線安全網(wǎng)絡(luò)拓?fù)?/a>

2011-10-08 16:46:29

2010-09-09 13:10:00

2018-12-05 08:39:28

IOTITOT

2016-08-18 13:51:43

安全云聯(lián)盟360云安全

2016-02-15 14:13:39

Python編碼環(huán)境

2011-05-18 14:07:59

XSL
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)