Forbidden
Donator
User avatar
Posts: 1396
Game name: Shigeo_Jiang

[Guide] Auto obtaining OTP for logging

May 6th, 2025, 12:21 pm

.
tired of being forced on writing OTP everytime you crash/login? This script automates the process of logging ingame using OTP . just for lazy people like me.
Tried this with Ente Auth it works perfectly and provides secret key to use.
i know you can just enable trust launcher from UCP, you could still edit this script and use it for other purposes
[+] Ente
Image

Code: Select all

# otp.py
# Secret key can be found Ente Auth if you're using it, Look for example
#If module pyotp not found install it with pip install pyotp
import pyotp
print(pyotp.TOTP("YOUR_SECRET_KEY_GOES_HERE").now())

Code: Select all

;auto Prints OTP in dialog on game start save it as autologin.ahk run it once and you're good to go
Loop {
WinWaitActive, GTA:SA:MP

;edit this if you connect too fast
Sleep, 18	000
SLeep, 500

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%

TempFile := A_ScriptDir "\otp_output.txt"


RunWait, %ComSpec% /c python otp.py > "%TempFile%" 2>&1, , Hide

FileRead, OutputVar, %TempFile%
FileDelete, %TempFile%

OutputVar := Trim(OutputVar)

; Send the OTP to the game dialog
SendInput %OutputVar%
FileAppend, %TempFile%`n, *

}
WinWaitClose GTA:SA:MP
}
return
Make sure you keep the two files within the same directory.



.

SpnKO
Retired Admin
Posts: 228
Game name: Oleg_Hercules, Mira_Tzah

Re: [Guide] Auto obtaining OTP for logging

May 9th, 2025, 10:22 am

This entirely defeats the purpose of OTP. The whole idea of OTP is to have it stored on a different device so that in the case the device you play SA-MP on is compromised, your account will not be. By storing the secret key on the same device you're allowing hackers to bypass this form of additional security.

Forbidden
Donator
User avatar
Posts: 1396
Game name: Shigeo_Jiang

Re: [Guide] Auto obtaining OTP for logging

May 9th, 2025, 2:52 pm

SpnKO wrote:
May 9th, 2025, 10:22 am
This entirely defeats the purpose of OTP. The whole idea of OTP is to have it stored on a different device so that in the case the device you play SA-MP on is compromised, your account will not be. By storing the secret key on the same device you're allowing hackers to bypass this form of additional security.
You're absolutely right, and this is a critical point that many overlook. The entire purpose of OTP (One-Time Password) is to act as a second layer of authentication, but you could still encrypt the secret_key using RSA encryption and Use a Code Obfuscator (pyarmor module) for the python before compiling it and you're good to go. Who would waste him time trying to decompile a script pyton just for a game account? :idea:
Image

Return to “Newbie Guides”