After reading Rioter's netbios hacking tutorial, and starting to work with the java.net package, and decided to make a fake "server" that listens on port 139. The only problem is that I wanted it to be where if you typed:
nbtstat -A 24.243.64.239
at the command prompt it would give you the same output as if it were real. But the nbtstat command doesn't recognize my "server" and I'm guessing it would be impossible, or at least nearly impossible to get it to work. The best I can do right now is get it to where if you type:
telnet 24.243.64.239 139
at the prompt it will take you to a telnet session, then from there if you type:
nbtstat -A 24.243.64.239
it will give you what you would see if you did it normally, only it is just text that i made up.
next you would type:
net view \\24.243.64.239
and it will show you that I'm sharing my c drive.
Then you type:
net use z: \\24.243.64.239\c
and it will say, your ip has been logged and your isp will be contacted, then it ends the session. Actually you could type anything and it will give you the same messages. But let that be our little secret.
I recommend that you see this for yourself by doing the above steps. It is really neat I think.
My question is, How can I get it to do the same except by using the nbtstat -A command instead of telnetting on port 139. Because telnetting wouldn't work anyway and if anyone were to try this trick on me they would use nbtstat or nmblookup. The only way I can think of would be to write the netbios protocol into the program. But I don't know it and I don't think I could even if I did. So my question is does anyone know how this can be done(getting it to respond to nbtstat)?
please check out this program by telnetting to it with:
telnet 24.243.64.239 139
thanks for the help.

here is some of the code if it helps

Code:
import java.net.*;
import java.io.*;
import java.util.*;

public class netprotocol {
    private static final int WAITING = 0;
    private static final int SENTKNOCKKNOCK = 1;
    private static final int SENTCLUE = 2;
    private static final int ANOTHER = 3;
    private static final int END = 4;

    private int state = WAITING;    

    public String processInput(String theInput) {
        String theOutput = "";
        Date date = new Date();

        if (state == WAITING) {

            state = SENTKNOCKKNOCK;
        } else if (state == SENTKNOCKKNOCK) {
            if (theInput.equalsIgnoreCase("nbtstat -A 24.243.64.239") || theInput.equalsIgnoreCase("nmblookup -A 24.243.64.239")) {
                theOutput = "      NetBIOS Remote Machine Name Table" +
                "\n\n\r   Name               Type         Status"+
                "\n\r---------------------------------------------"+
                "\n\rFACES_COMP2    <00>  UNIQUE      Registered"+
                "\n\rFACES_ETC      <00>  GROUP       Registered"+
                "\n\rFACES_COMP2    <03>  UNIQUE      Registered"+
                "\n\rFACES_COMP2    <20>  UNIQUE      Registered"+
                "\n\rFACES_ETC      <1E>  GROUP       Registered"+
                "\n\n\rMAC Address = 44-45-53-54-00-00";
                state = SENTCLUE;
            } else {
                theOutput = "      NetBIOS Remote Machine Name Table" +
                "\n\n\r   Name               Type         Status"+
                "\n\r---------------------------------------------"+
                "\n\rFACES_COMP2    <00>  UNIQUE      Registered"+
                "\n\rFACES_ETC      <00>  GROUP       Registered"+
                "\n\rFACES_COMP2    <03>  UNIQUE      Registered"+
                "\n\rFACES_COMP2    <20>  UNIQUE      Registered"+
                "\n\rFACES_ETC      <1E>  GROUP       Registered"+
                "\n\n\rMAC Address = 44-45-53-54-00-00";
                state = SENTCLUE;
            }
        } else if (state == SENTCLUE) {
            if (theInput.equalsIgnoreCase("net view " )) {
                theOutput = "Sharename    Type         Comment" +
                "\n\r-------------------------------------------------------------------------------"+
                "\n\rC            Disk "+
                "\n\rThe command was completed successfully.";
                state = ANOTHER;
            } else {
                theOutput = "Sharename    Type         Comment" +
                "\n\r-------------------------------------------------------------------------------"+
                "\n\rC            Disk "+
                "\n\rThe command was completed successfully.";
                state = ANOTHER;
            }
            }
         else if (state == ANOTHER) {
            if (theInput.equalsIgnoreCase("net use ")) {
                theOutput = "Your IP has been logged and your isp will be contacted";
                state = WAITING;
            }
            else {
                    theOutput = "Your IP has been logged and your isp will be contacted";
                    state = WAITING;
            }}
            return theOutput;
        }

    }
this is one of three programs. The other two set up the connection.