SRL Archive - Java Help and Tutorials

Could anyone...


footballjds

2008-01-14 20:43:07

Make a program to goes to a website… not realy website actouly:
https://192.168.1.1/
and type in a pass word, no username and change a few settings… this site is what controls my internet. But i know the pas *cough* the pass is: fatmomma
<– gay pass i know.. anyhow i hope to get a video up to show you WTF im talking about.
thanks!

heres the link to the vid. sorry about the bad(ish) quality. if you can help get on MSN/Aim/Yahoo
http://www.youtube.com/watch?v=qm7HFrGJaIU

bullzeye95

2008-01-14 21:30:37

Dude, 192.168.1.1 is your local router (and modem?) IP… :p

I'm not completely sure what you're trying to accomplish =/

Bobarkinator

2008-01-14 22:21:25

Just so you know, no one but you is going to be able to go to that, unless their DNS server is also 192.168.1.1

footballjds

2008-01-14 22:30:11

yeah, i know. but theres some kinda;) way to do what is in the vid. with java. no?
if anyone can help please PM, ty!

Jason2gs

2008-01-14 22:37:46

Yes, that's the IP for your router, silly ^_^

It's possible, but without using your router, I wouldn't know what data needs to be sent, etc…

If you want a SCAR script, then check out OpenConnection/SendConnectionData/ReadConnectionData/CloseConnection and/or InitializeHTTPClient/SendPostData/FreeClient. If you want a Delphi app, then check out either the ScktComp package that comes with Delphi, or a very nice third-party package called Indy. (Internet Direct)

Good luck! It's better to write your own code, anyway, than to have someone do it for you.

mpd

2008-01-15 04:06:31

is this what you are looking for perhaps:


<html>
<head>
<title>Title here</title>
<script language="javascript">

var pwPrompt=prompt("Enter the password please");

if (pwPrompt='password') alert('Welcome!')
else {
alert('Wrong Password')
document.location="http://www.google.com";

}
</script>

<base target="leftframe">
</head>
<body>
content goes here
</body>
</html>

what it does:
when someone enters your website, it asks for a password, if its correct it shows the content, if not it redirects you.

its very basic thou, if you're looking to secure you're whole website you'd better try php + mysql

footballjds

2008-01-15 11:06:45

mpd, not at all.
The problem is I am not aloud on the internet to Play runescape or get on sRL forums.. so i have to turn it on, then turn off b4 i leave.
only problem is i takes to long, i was hoping it wouldn't be to hard for somone to make a java program.. im not ver experianced in it. but it would have to initate an https client or somthing :rolleyes: and send the cookie everytime it does somthing. if someone needs more info. could you PM me? thanks!:)

footballjds

2008-01-15 12:14:48

Sorry about double post:
who ever might do it would use somthing to this extent:
package net.aileron;

import java.io.IOException;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.methods.GetMethod;

public class Foo {

public static void main(String[] args) {


// create a singular HttpClient object
HttpClient client = new HttpClient();

// establish a connection within 5 seconds
client.getHttpConnectionManager().
getParams().setConnectionTimeout(5000);

HttpMethod method = null;
String url = "";
// create a method object
method = new GetMethod(url);
method.setFollowRedirects(true);
// } catch (MalformedURLException murle) {
// System.out.println("<url> argument '" + url
// + "' is not a valid URL");
// System.exit(-2);
// }

// execute the method
String responseBody = null;
try{
client.executeMethod(method);
responseBody = method.getResponseBodyAsString();
} catch (HttpException he) {
System.err.println("Http error connecting to '" + url + "'");
System.err.println(he.getMessage());
System.exit(-4);
} catch (IOException ioe){
System.err.println("Unable to connect to '" + url + "'");
System.exit(-3);
}


// write out the request headers
System.out.println("*** Request ***");
System.out.println("Request Path: " + method.getPath());
System.out.println("Request Query: " + method.getQueryString());
org.apache.commons.httpclient.Header[] requestHeaders =
method.getRequestHeaders();
for (int i=0; i<requestHeaders.length; i++){
System.out.print(requestHeaders[i]);
}

// write out the response headers
System.out.println("*** Response ***");
System.out.println("Status Line: " + method.getStatusLine());
org.apache.commons.httpclient.Header[] responseHeaders =
method.getResponseHeaders();
for (int i=0; i<responseHeaders.length; i++){
System.out.print(responseHeaders[i]);
}

// write out the response body
System.out.println("*** Response Body ***");
System.out.println(responseBody);

// clean up the connection resources
method.releaseConnection();

}
}