|20-CS-6053||Network Security||Spring 2017|
|Lab 1 Hints|
The monitor cannot find the server if:
Monitor says "host xxxxx is not known"
In ActiveClient.java try changing
HOSTNAME = toMonitor.getLocalAddress().getHostName();to
HOSTNAME = toMonitor.getLocalAddress().toString().substring(1);This will send your IP address to the monitor - the monitor may have a better chance of making a connection knowing this.
Server can't verify the monitor
String PPCHECKSUM = ""; ... String msg = GetMonitorMessage(); PPCHECKSUM = GetNextCommand(msg,"PARTICIPANT_PASSWORD_CHECKSUM"); String PASSWORD = "whatever"; MessageDigest md = MessageDigest.getInstance("SHA");Then
String password = PASSWORD.toUpperCase(); // important md.update(password.getBytes()); BigInteger big = new BigInteger(1,md.digest()); // important, big is a // positive signed magnitude integer, not a 2's complement integer. // Below, the trim is because I am paranoid. Important - the PPCHECKSUM // is a hex number, hence toString(16); if (big.toString(16).equals(PPCHECKSUM.trim())) return true; // the test else return false
A Sample Player
|Instructions: Create a directory, say SamplePlayer. Download sampleplayer.tar and untar it in that directory. Run the twoplayers script to start clients and servers for two players named franco1 and franco2 assuming a monitor is running on the localhost, port 8150. The server of one player is on port 20500 and the other on port 20000. Use the active client of one to issue TRANSFER_REQUEST commands to the other. Run oneplayer to start a single client and server and a shell. Use the shell to send commands to the localhost monitor via telnet. Detailed instructions are in the file.|