Login Register


Info Getter 1.1 filter_list
Author
Message
Info Getter 1.1 #1
Code:
/* Get info on target and save data to file coded by Dreamwalker http://Dreamwalk.yolasite.com/ all rights reserved */ #include <string> #include <iostream> #include <fstream> using namespace std; string exec(string command, string target, string args) { //convert data to be used in execution for host target.append(args); command.append(target); const char* cmd = command.c_str(); FILE* pipe = _popen(cmd, "r"); if (!pipe) return "ERROR"; char buffer[128]; string result = ""; while(!feof(pipe)) { if(fgets(buffer, 128, pipe) != NULL) result += buffer; } _pclose(pipe); return result; } int main() { cout<<"\n~~~~~~~~~~ Info Getter 1.1 by Dreamwalker ~~~~~~~~~~~\n"<<endl; string host; cout<<"Preparing file..."; ofstream writer("info getter results.txt"); if(!writer) { cout<<"error opening file for output"; return -1; } cout<<"Done"<<endl; cout<<"Type in the host name or IP address:"<<endl; cin>>host; cout<<"Now gathering information:"<<endl; cout<<"pinging host..."<<endl; writer<< exec("ping ", host,"") <<endl; cout<<"performing nslookup..."<<endl; writer<< exec("nslookup ", host, "") <<endl; cout<<"performing zone transfer..."<<endl; writer<< exec("nslookup ls ", host, "") <<endl; cout<<"performing null session..."<<endl; writer<<exec("net use \\\\", host, "\\ipc$ \"\" \"\/user:\"\ ") <<endl; cout<<"trying to access shares..."<<endl; writer<<exec("net view \\\\",host,"") <<endl; cout<<"tracert (this may take a minute or so)..."<<endl; writer<<exec("tracert ",host,"") <<endl; cout<<"Finished, check the \"info getter results.txt\" file for results"<<endl; cout<<"In the same directory as this app, -SecurityFox"<<endl; writer.close(); char temp = NULL; while(1) { cout<<"type \'Q\' to quit"<<endl; cin>>temp; if(temp == 'q' || temp == 'Q') break; } return 0; }

Reply

RE: Info Getter 1.1 #2
Why is this a mix of C and C++ by the methods you're using? :S Personally I think this probably would have been just as good within a batch script.
ArkPhaze
"Object oriented way to get rich? Inheritance"
Getting Started: C/C++ | Common Mistakes
[ Assembly / C++ / .NET / Haskell / J Programmer ]

Reply







Users browsing this thread: