Please test a program of mine

homeyg

Deity
Joined
Jan 12, 2004
Messages
3,631
I wrote a net send spoofer/spammer and since I don't have a LAN network at my house, I need someone with one to test this program for me. I want to see if it works before I take it to school. :p It is a very small program and it is very simple to use. Thanks to anyone who can help out.

Here it is.
 
All it does is send a message (if you are unfamiliar with the net send command, and need elaboration, just holler), but you can choose who you want it to be from. You can also specify how many times you want it to send that message. The worst possible thing that could happen is that it doesn't work (in which case it does nothing).
 
I've tested it myself at school and it does not work. I'm working on it right now, and if you still want to see source code, here it is (when compiling this, you need to link it to the 'netapi32' library):

Code:
#include <iostream>
#include <cstring>
#include <windows.h>
#include <Lm.h>

using namespace std;

int main()
{
    
    char fromName[20];
    char computerName[20];
    char message[100];
    char fake[30];
    //char completeCommand[140];
    int num;
    
    cout<<"Welcome, you are about to have the best fun of"
        <<"\nyour typing career at the expense of someone else!"<<endl;
    
    cout<<"Please enter the name of the computer you want to spam: ";
    cin.getline(computerName, 20);
    char* compConst = computerName;
    
    cout<<"Please enter the message you wish to spam with (must be below 100 chars): ";
    cin.getline(message, 100);
    
    
    cout<<"Please enter the assumed name: ";
    cin.getline(fake, 30);
    char* nameConst = fake;
    
    cout<<"Please enter the number of messages you wish to send to that alias: ";
    cin>>num;
    
    int msg = strlen(message);
    system("net name RECTOR /add");
    //NetMessageNameAdd(NULL, LPCWSTR("RECTOR"));
    for(int i = 0; i<num; i++){
    if(NetMessageBufferSend(NULL,(LPCWSTR)compConst, (LPCWSTR)nameConst, (BYTE*)message, msg*2)==ERROR_ACCESS_DENIED);
    {cout<<"BEEP."<<endl;}
    }
    cout<<ERROR_ACCESS_DENIED<<endl;
    cout<<"Done."<<endl;
    system("PAUSE");
    return 0;
}

Oh, yeah, forgot to mention, this is C++.
 
Okay, okay, I see nobody trusts me because all of the threats of getting viruses nowadays (I can tell because the thread has 87 views and only 2 replies). I am not a virus programmer! I've fixed the code and now I think it works. I just need someone to test this program for me to make sure. I'm trying to get my friend to do it, but he keeps logging off the damn AIM before I can send him the file.

What it does: This program sends a message to a computer on the same network as the computer you're using (you specify which by entering the name) by utilizing the 'net send' command (which you can execute through the command prompt). The good part of this program is that you can specify the from field on the message popup, allowing you to send anonymous messages. All of you who have used the 'net send' command know what I'm talking about. You can do 'net send' manually through the command prompt, BUT you cannot specify who the message is from manually (it defaults to your computer alias on the network).

Why I need someone to test it: I need someone to test this because I don't have a LAN network at my house so it is impossible to use the 'net send' command. I'm asking that someone who does has a LAN network please test this program for me.

Here is the source code:

Code:
#include <iostream>
#include <windows.h>
#include <Lm.h>
#define MAXLEN 50

using namespace std;

int main()
{
    DWORD rc;
    char from[MAXLEN];
    char name[MAXLEN];
    char msg[MAXLEN];
    char server[MAXLEN];
    wchar_t serverW[MAXLEN];
    wchar_t msgW[MAXLEN];
    wchar_t nameW[MAXLEN];
    wchar_t fromW[MAXLEN];
    
    int num;
    
    cout<<"Welcome, have fun spamming the crap out of people!"<<endl;

    cout<<"TO: ";
    cin >> name;
    cin.get();
    
    cout<<"MESSAGE: ";
    cin.getline(msg, 50);
    
    
    cout<<"FROM: ";
    cin >> from;
    
    cout<<"HOW MANY? ";
    cin >> num;
    //mbstowcs( serverW, server, MAXLEN );
    mbstowcs(msgW, msg, MAXLEN);
    mbstowcs(nameW, name, MAXLEN);
    mbstowcs(fromW, from, MAXLEN);
    NetMessageNameAdd(NULL, fromW);
	for(int i = 0; i<num; i++)
    {
        rc = NetMessageBufferSend( NULL, nameW, fromW, (byte*)msgW, wcslen( msgW ) * 2 );
        if(rc==NERR_Success)
        {
            cout<<"Completed."<<endl;
        }
        else {
        if(rc!=NERR_Success)
        {
            cout<<"Failed because of ";
        }
        if(rc==NERR_NameNotFound)
        {
            cout<<"an invalid message alias."<<endl;
        }
        if(rc==ERROR_INVALID_PARAMETER)
        {
            cout<<"an invalid parameter."<<endl;
        }
        if(rc==ERROR_NOT_SUPPORTED)
        {
            cout<<"an invalid network."<<endl;
        }
        if(rc==NERR_NetworkError)
        {
            cout<<"a network error."<<endl;
        }}
    }
    NetMessageNameDel(NULL, fromW);
		
    cout<<"Done."<<endl;
    system("PAUSE");
    return 0;
}

And here is the program:
 

Attachments

I have a LAN with another computer, but I don't know the 'name' of it. How can I find that?

PS: Why are you using the cin >> name; line for the name variable, but cin.getline (msg, 50); (I know what both of them do, fyi) for the message text? Just curious.
 
Okay. Go to the command prompt on one of the computers and type 'net name'. If it asks you to start the messenger service, type y (this may take a couple seconds). It should give you the name of your computer at the top. Start the messenger service on the other computer also.

As for the cin and the cin.getline, The computer name should be one word, in which case cin.getline isn't needed.
 
Are you serious?!?!? The message showed up on the other computer with the from name that you typed?
 
Yep, it did. I did more testing and the message can be more than 1 word, but the from address can only be 1 word- that's ok though. If you enter more than one word in the from line, then the "HOW MANY?" won't accept data - you just hit enter and it'll send until you close the program. A minor bug, but still nonetheless a successful program.
 
The reason I didn't use just cin for the from is because the 'net send' command doesn't accept names that are more than one word. When you type in more than one word for the 'from', cin stops at the blank character and the rest of what you typed is left in the input buffer and is taken in by the next input (which is another cin) therefore not allowing it to accept anymore input because it also reads the newline character which also terminates input. Thanks for testing it! :goodjob:
 
Yes. When you enter the TO field, just type *. Did you test it at school?
 
Well, in that case, I'm not sure how to do it with this. Let me see what I can do.

Try typing in 'owner' for the TO: field. I think that all computers have a default name of owner. If that doesn't work, try '/DOMAIN'. And if that doesn't work, try '/USERS'. And finally, if that doesn't work, it could be that the NetMessageBufferSend() function doesn't allow access to network wide sending.
 
I think it has something to do with the function I used. Did I mention that I got busted twice in 1 week for sending messages to the entire school board (every single school in the parish)? One was just a simple period (I was trying to find the name of the computer I was sitting at and at that point that was the only way I knew how to find it), and the second one I can't say here and it wasn't even supposed to happen, and I'm not going to say how it did.
 
Back
Top Bottom