Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // IpGen.cpp : Defines the entry point for the console application.
- #include "stdafx.h"
- #include <stdlib.h>
- #include <time.h>
- #include <iostream>
- #include <string>
- #include <fstream>
- using namespace std;
- void Splash();
- string temp;
- string ip;
- string dot = ".";
- int max;
- int counter = 0;
- int counter1 = 1;
- bool nmap = false;
- int main()
- {
- Splash();
- cout << "How many ips do you want to find\n>";
- cin >> max;
- cout << "Do you have nmap installed? (y/n)\n>";
- cin >> temp;
- if (temp == "y" || temp == "Y")
- {
- nmap = true;
- temp == "";
- }
- else
- {
- nmap = false;
- temp == "";
- }
- system("cls");
- srand(time(NULL));
- while (counter != max)
- {
- int random0 = (rand() % (0 - 255)) + 1;
- int random1 = (rand() % (0 - 255)) + 1;
- int random2 = (rand() % (0 - 255)) + 1;
- int random3 = (rand() % (0 - 255)) + 1;
- ip = std::to_string(random0) + dot + std::to_string(random1) + dot + std::to_string(random2) + dot + std::to_string(random3);
- Splash();
- cout << "\n\t\t---------------------------------\n";
- cout << "\t\tTry(" << counter1 << ")" << "\t Found(" << counter << ")\n\t\tIp Generated : " << ip;
- cout << "\n\t\t---------------------------------";
- string cmd = "ping " + ip;
- int result = system(cmd.c_str());
- if (result == 0)
- {
- //Device Connected
- counter++;
- cout << "\n\t\t---------------------------------";
- cout << "\n\t\tDevice Connected";
- cout << "\n\t\t---------------------------------\n\n";
- ofstream Connected;
- Connected.open("Generated_Ips.txt", ios::out | ios::app);
- Connected << ip << "\n";
- Connected.close();
- system("cls");
- }
- else
- {
- //Device Disconnected
- cout << "\n\t\t---------------------------------";
- cout << "\n\t\tDevice Disconnected";
- cout << "\n\t\t---------------------------------\n\n";
- system("cls");
- }
- counter1++;
- }
- if (nmap == true)
- {
- system("nmap -oN output.txt -iL Generated_Ips.txt");
- }
- else
- {
- //do nothing
- }
- cout << "Found " << max << " ips";
- cin >> temp;
- return 0;
- }
- void Splash()
- {
- cout << "Yattaze's\n";
- cout << "\t8888888 .d8888b. \n";
- cout << "\t 888 d88P Y88b \n";
- cout << "\t 888 888 888 \n";
- cout << "\t 888 88888b. 888 .d88b. 88888b. \n";
- cout << "\t 888 888 88b 888 88888 d8P Y8b 888 88b \n";
- cout << "\t 888 888 888 888888 888 888 88888888 888 888 \n";
- cout << "\t 888 888 d88P Y88b d88P Y8b. 888 888 \n";
- cout << "\t8888888 88888P Y8888P88 Y8888 888 888 \n";
- cout << "\t 88 \n";
- cout << "\t 88 \n";
- cout << "\t 88 \n\n";
- cout << "--------01001001 01110000 00101101 01000111 01100101 01101110--------\n\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement