I wrote this awhile ago as one of my first programs. Lol, it just uses built in windows functions, but you don't have to type in the IP every time.![]()
Code:#include <fstream.h> #include <stdlib.h> #include <stdio.h> void ping (); void tracert(); void telnet(); void active(); char ip[30]; int main() { int y = 5; system("cls"); cout << "\n\n\t\t\t Jared's Toolbox\n\n"; cout << "\n\n\t\t\t By: Jared Stewart.\n\n\n\n\n\t\t "; system("PAUSE"); while (y==5) { system("cls"); cout << "Target IP Address: "; cin >> ip; do { system("cls"); cout << "Target: " << ip << endl << endl; cout << "1. Ping" << endl; cout << "2. Tracert" << endl; cout << "3. Telnet" << endl; cout << "4. Local Active Connections" << endl; cout << "5. New Target" << endl; cout << "6. Exit" << endl; cout << "\nChoose an operation: " ; cin >> y; if (y==1) ping(); if (y==2) tracert(); if (y==3) telnet(); if (y==4) active(); system("PAUSE"); } while(y!=6 && y!=5); } return 0; } void ping() { char command[50]=""; short int number = 0; cout << "Number of packets: "; cin >> number; sprintf(command, "ping -n %d %s", number, ip); system(command); return; } void tracert() { char command[50]=""; system("cls"); cout << "Route to " << ip << ":\n"; sprintf(command, "tracert %s", ip); system(command); return; } void telnet() { char command[50]=""; int number = 0; cout << "Port: "; cin >> number; sprintf(command, "telnet %s %d", ip, number); system(command); return; } void active() { system("cls"); cout << "Active connections:" << endl; system("netstat -n"); return; }


Reply With Quote
Bookmarks