Arduino Network Vulnerability Scanner 

This Arduino code simulates a network reconnaissance system. When deployed, it scans the local network for vulnerable entry points by attempting to connect to specific target ports on each device within the network. The status of each port (open or closed) is monitored, and any changes are reported. This system provides a basic understanding of network security concepts and can be a starting point for building more advanced network monitoring and defense systems. You can integrate this functionality into your webpage to showcase how network scanning works and illustrate the importance of securing network devices. 

This code is provided for educational purposes only. The primary intent of this code is to demonstrate basic networking concepts, such as port scanning, and to promote understanding of network security principles. The use of this code for any malicious, unauthorized, or illegal activities is strictly prohibited.

Any use of this code for unauthorized scanning, intrusion, or exploitation of networks or systems without proper authorization is unethical and may violate applicable laws and regulations.

By using this code, you agree to use it responsibly and legally, with proper authorization and consent from the network owner or administrator. The creators and contributors of this code shall not be held responsible for any misuse or unauthorized use of this code.

In the provided picture, the serial output from the Arduino code is displayed within the PuTTY application. The output shows the progress of the network scanning process and provides information about open ports detected on the local network.

Overall, while the program has the potential for both good and bad applications, it primarily serves as an educational tool for understanding network security principles and conducting responsible security testing. It's essential to use such tools ethically and legally, with proper authorization and consent.

Arduino code below with detailed comments explaining each part to someone who's new to programming 


#include <SPI.h>

#include <EthernetV2_0.h>

#include <EthernetUdpV2_0.h>

const int greenLEDPin = 7; // Initiating stealth mode: Activating cloaking system...

const int redLEDPin = 8; // Initializing intruder alert system...

byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; // Deploying MAC spoofing protocol...

EthernetUDP Udp;

const int numPorts = 4;

int targetPorts[numPorts] = {21, 22, 23, 3389}; // Targeting critical infrastructure ports...

bool portStatus[numPorts];

void setup() {



Serial.println("Deploying MAC spoofing protocol...0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED");


Serial.println("  _____ ");

Serial.println(" /     \\");

Serial.println("| () () |");

Serial.println(" \\  ^  / ");

Serial.println("  |||||  ");

Serial.println("  |||||  ");

Serial.println("  \\___/  ");


Serial.println("Establishing Serial channel: Waiting for connection...");

  while (!Serial) {

    ; // Establishing secure channel: Waiting for encrypted connection...


  pinMode(greenLEDPin, OUTPUT); // Activating surveillance beacon...

  pinMode(redLEDPin, OUTPUT); // Initializing defense mechanism...

  if (Ethernet.begin(mac) == 0) {


    Serial.println("Failed to configure Ethernet using DHCP");

    digitalWrite(redLEDPin, HIGH); // Triggering security breach protocol...

    // No point in carrying on, so do nothing forevermore:

    while (true) {





  Serial.print("DHCP Access granted: IP address is: ");

  Serial.println(Ethernet.localIP()); // Covert operation established: Revealing IP address...


  Serial.println("Initiating reconnaissance: Starting port scan..."); // Commencing network sweep...

  digitalWrite(greenLEDPin, HIGH); // Disabling detection systems...

  Serial.println("Light is green, Starting port scan..."); // Commencing network sweep...


void loop() {

  // Conducting network infiltration: Scanning for vulnerable entry points...

  for (int i = 0; i < numPorts; i++) {

    for (int octet = 1; octet <= 254; octet++) {

      IPAddress targetIP(Ethernet.localIP()[0], Ethernet.localIP()[1], Ethernet.localIP()[2], octet);

      Serial.print("Executing probing sequence: Target IP: ");

      Serial.print(targetIP); // Engaging target IP...

      Serial.print(" Port: ");

      Serial.println(targetPorts[i]); // Targeting specified port...

      if (probePort(targetIP, targetPorts[i])) {

        if (!portStatus[i]) {

          Serial.print("Vulnerability detected: Port ");


          Serial.print(" breached on IP address: ");

          Serial.println(targetIP); // Intrusion successful: Port open...

          portStatus[i] = true;



      } else {

        if (portStatus[i]) {

          Serial.print("Security restored: Port ");


          Serial.print(" secured on IP address: ");

          Serial.println(targetIP); // Countermeasure activated: Port closed...

          portStatus[i] = false;







  delay(2000); // Tactical pause: Cooldown period...


bool probePort(IPAddress ip, int port) {

  EthernetClient client;

  if (client.connect(ip, port)) {


    return true;


  return false;


Now, let's go through each part:


If you've enjoyed exploring my Arduino projects and want to see more amazing creations, your support can make a big difference! By contributing, you're helping me continue to innovate and bring even more exciting projects to life. Together, we can explore the endless possibilities of DIY electronics! Don't forget to like, subscribe, and follow for updates on the latest developments. Thank you for being a part of this journey! 

Click here to make a difference with your donation today!