I have a fun challenge. I have to send the password "flubergump" to a page on the net (php script).
I wrote this common code:
try {
URL url = new URL(A);
URLConnection con = url.openConnection();
con.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(con.getOutputStream());
F = URLEncoder.encode(F, "UTF-8");
writer.write(F);
System.out.println(F);
String line;
DataInputStream in = new DataInputStream (con.getInputStream ());
while ((line = in.readLine()) != null) {
G=G + line;
}
textarea.setText(G);
writer.close();
in.close();
and tried sending every version of password = flubergump!
Sending this HTML would work:
<form method="post" action="http://www.hackthis.co.uk/levels/i2.php">
<input type="hidden" name="password" value="flubergump">
</form>
But I wanted to make a "post variables" tool, simply in the name of practice. Can you help by telling me why I'm not getting any success. I tried writing my own PHP scripts and I'm still having no luck. I've researched this topic to death, and one would get the impression that this code is supposed to work.