i am facing a hard time with this question ,is there anyone can help me to solve it ?
HTTP supports a mechanism that allows users to upload files in addition to retrieving
them through a PUT command.
c. Consider the following code, which allows for text file storage and logging functionality:
public void storeFile(BufferedReader br, OutputStreamWriter osw, String pathname) throws Exception { FileWriter fw = null; try { fw = new FileWriter (pathname); String s = br.readLine(); while (s != null) { fw.write (s); s = br.readLine(); } fw.close(); osw.write ("HTTP/1.0 201 Created"); } catch (Exception e) { osw.write ("HTTP/1.0 500 Internal Server Error"); } } public void logEntry(String filename,String record) { FileWriter fw = new FileWriter (filename, true); fw.write (getTimestamp() + " " + record); fw.close(); } public String getTimestamp() { return (new Date()).toString(); }
Modify the processRequest() method in SimpleWebServer to use the preceding file storage and logging code
d. Run your web server and mount an attack that defaces the index.html home page
how can i run the code and Modify the processRequest()???
or
given me instruction to solve it because i do not know from where i should start