Note that there are some explanatory texts on larger screens.

plurals
  1. POjava read website infomation while sending cookie infomation
    primarykey
    data
    text
    <p>so, basically, ive got a little page that i set a password for, it uses a simple php form to do the checks, </p> <p>i wish to get the information that the form is protecting, by sending the cookie infomation with it, </p> <p>in my java file it already sends a request to the form to get my cookie information, now i wish to send that cookie information back and read the plain text under it, </p> <p>how would i do this?</p> <p>this is the code i use to get the cookies</p> <pre><code> HttpPost httpost = new HttpPost("localhost/form.php"); List &lt;NameValuePair&gt; nvps = new ArrayList &lt;NameValuePair&gt;(); nvps.add(new BasicNameValuePair("user", "derp")); nvps.add(new BasicNameValuePair("pass", "derp1")); httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8)); HttpResponse response = httpclient.execute(httpost); HttpEntity entity = response.getEntity(); EntityUtils.consume(entity); List&lt;Cookie&gt; cookies = httpclient.getCookieStore().getCookies(); for (int i = 0; i &lt; cookies.size(); i++) { System.out.println("- " + cookies.get(i).toString()); } </code></pre> <p>how do i think request the page again, but sending the cookie back so it does not show the form, but the text the form is hiding</p> <p>sorted, using </p> <pre><code> URL url = new URL("http://localhost/~/test.php"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestProperty("Cookie", cookies); BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream())); String String; while ((String = in.readLine()) != null) { System.out.println(String); } in.close(); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload