Info Getter 1.1 08-15-2013, 11:49 PM
#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;
}
![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)