GHAPI-Python for LoginSvr Source 

Cabal is a virus!
Decennium
Joined
Jul 24, 2011
Messages
841
Reaction score
786
Hello!

Today had some time to learn and work on the api. It's 100% based on GoldenHeaven Node JS scipt, but on python.

Installation:
-Extract the package and edit your DB_PASSWORD in db.py
-Copy the files to correct folder (as it in the zip: /opt/ghapi-python)
-chmod 0777 on install.sh
-Run install.sh

It will install the python and the necessary libraries, and it will add the api as service, so you don't run it every time.

commands when you need edit/restart it:
sudo systemctl start ghapi
sudo systemctl stop ghapi
sudo systemctl restart ghapi

LoginSvr_01 settings:
Code:
DiGeamAuthWeb=1
DiGeamAuthDB=1
DiGeamOTP=1
DiGeamToken=1

AuthMethodStep1=DiGeamAuthWeb;DiGeamAuthDB

AuthMethodStep2=DiGeamOTP

[DiGeamAuthWeb]
Host=YOUR_IP:3000
Path=/game-api/game_login
#
[DiGeamOTP]
Host=YOUR_IP:3000
Path=/game-api/otp_login
#
[DiGeamToken]
Host=YOUR_IP:3000
Path1=/game-api/get_auth
Path2=/game-api/login_auth
Service=Cabal
ServerID=1100

Important notice! Use the default LoginSvr bin! (Link: Episode 33 Release)

nftables (firewall) rules for debian11 to avoid external api connections:
(/etc/nftables.conf) -> after editing you must restart the nftables!
Code:
#!/usr/sbin/nft -f

flush ruleset

table inet filter {
    chain input {
        type filter hook input priority 0;

        ip saddr 172.17.0.0/16 tcp dport 3000 accept

        tcp dport 3000 drop
    }
    chain forward {
        type filter hook forward priority 0;
    }
    chain output {
        type filter hook output priority 0;
    }
}

If you get AffiliatedCorpIP problem:
Account Database -> dbo.cabal_gms_ini_table and add this like as in this picture:
gms_ini - GHAPI-Python for LoginSvr - RaGEZONE Forums


With working email function:
Email Sender version

Credits:
GoldenHeaven for the base source
amiidotcom to fix the shitcode which i made
 

Attachments

Last edited:
Added some useful info for fir
Process: 19357 ExecStart=/usr/bin/python3 /opt/ghapi-python/app.py (code=exited, status=1/FAILURE)
Main PID: 19357 (code=exited, status=1/FAILURE)

May I ask how to solve this?
try to debug it:
systemctl stop ghapi
cd /opt/ghapi-python/
python3 app.py

and you will get a detailed message what it missing...

also added some notice about firewall and database setting in case you encounter AffiliatedCorpIP issue..
 
添加了一些有用的 fir 信息

尝试调试它:
systemctl 停止 ghapi
cd /opt/ghapi-python/
python3 应用程序.py

并且您将收到详细的缺失信息...

还增加了一些关于防火墙和数据库设置的注意事项,以防您遇到AffiliatedCorpIP问题。
My debian11 does not have the file/usr/bin/python3.
 
install.sh 运行完成?
尝试手动安装 apt install -y python3
I have found Python 3, 【Python 3.11.2 (main, Nov 30 2024, 21:22:50) [GCC 12.2.0] on linux
How to obtain incorrect information for Type "help", "copyright", "credits" or "license" for more information?



python3 is already the newest version (3.11.2-1+b1).
python3-pip is already the newest version (23.0.1+dfsg-1).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
odbcinst : Depends: odbcinst1debian2 (>= 2.3.11-3) but it is not going to be installed
unixodbc : Depends: odbcinst1debian2 (>= 2.3.11-3) but it is not going to be installed
Depends: libodbc1 (>= 2.3.11-3) but it is not going to be installed
unixodbc-dev : Depends: odbcinst1debian2 (= 2.3.11-3) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
root@cabalep33:~# unixodbc-dev gcc g++ make curl


Unable to install, how can I handle it
 
Last edited:
root@vmi2552893:/opt/ghapi-python# python3 app.py
Traceback (most recent call last):
File "/opt/ghapi-python/app.py", line 1, in <module>
from flask import Flask, request, jsonify
ModuleNotFoundError: No module named 'flask'


Edit: pip install flask

(y)
1745506303734 - GHAPI-Python for LoginSvr - RaGEZONE Forums
 
I can't figure out how to install it
Code:
cd /opt/ghapi-python/

Code:
chmod 0777 install.sh

Code:
./install.sh


Code:
pip install flask
pip install flask-cors
pip install pyodbc


Code:
systemctl status ghapi
systemctl start ghapi
systemctl restart ghapi
systemctl stop ghapi

Code:
systemctl restart nftables.service
 
Code:
cd /opt/ghapi-python/

Code:
chmod 0777 install.sh

Code:
./install.sh


Code:
pip install flask
pip install flask-cors
pip install pyodbc


Code:
systemctl status ghapi
systemctl start ghapi
systemctl restart ghapi
systemctl stop ghapi

Code:
systemctl restart nftables.service
why does it keep giving an error i followed the guide
Screenshot 2025-04-24 192458 - GHAPI-Python for LoginSvr - RaGEZONE Forums
 
Apr 25 02:07:23 cabalep33 python[551]: ERROR:db:SQL Error: ('28000', "[28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user 'sa'. (18456) (SQLDriverConnect)")
Apr 25 02:07:23 cabalep33 python[551]: INFO:__main__:Authentication result: None
Apr 25 02:07:23 cabalep33 python[551]: INFO:__main__:Authentication failed, returning 404 with RetVal: -1
Apr 25 02:07:23 cabalep33 python[551]: INFO:werkzeug:172.17.0.3 - - [25/Apr/202502:07:23] "POST /game-api/game_login HTTP/1.1" 404 -
why? it keep me wrong password on login in client also in database say user sa is failed too.

--fixed but otp still bypassing
Apr 25 02:16:29 cabalep33 python[27083]: INFO:werkzeug: * Debugger PIN: 502-121-338
Apr 25 02:16:37 cabalep33 python[27083]: INFO:__main__:Request POST game_login! Content-Type: application/x-www-form-urlencoded
Apr 25 02:16:37 cabalep33 python[27083]: INFO:__main__:Request data: ImmutableMultiDict([('user_id', 'aerox009x'), ('password', '1234'), ('user_ip', '192.168.1.102')])
Apr 25 02:16:37 cabalep33 python[27083]: INFO:db:Authentication Request Result: (32, 2005)
Apr 25 02:16:37 cabalep33 python[27083]: INFO:__main__:Authentication result: (32, 2005)
Apr 25 02:16:37 cabalep33 python[27083]: INFO:db:Raw OTP info results: {'useotp': 0, 'externalid': ''}
Apr 25 02:16:37 cabalep33 python[27083]: INFO:db:GetOTPInfo Request Output: {'useotp': 0, 'externalid': ''}
Apr 25 02:16:37 cabalep33 python[27083]: INFO:__main__:OTP info: {'useotp': 0, 'externalid': ''}
Apr 25 02:16:37 cabalep33 python[27083]: INFO:__main__:Sending response: {'RetVal': 0, 'user_id': 2005, 'otp': False}
Apr 25 02:16:37 cabalep33 python[27083]: INFO:werkzeug:172.17.0.3 - - [25/Apr/2025 02:16:37] "POST /game-api/game_login HTTP/1.1" 200 -

-loginsvrlog--

[2025-04-25 02:16:37.294426 140489547175616]: [Auth] DiGeamAuthWeb Verify Success : UserIdx(3), UserNum(0), UserID(aerox009x), IP(192.168.1.102), Flag(1,2,1), processTick=612354(429ms), connctTick=612294(489ms)
[2025-04-25 02:16:37.294709 140489547175616]: [Auth] DiGeamAuthDB Request Redirect : UserIdx(3), UserNum(0), UserID(aerox009x), IP(192.168.1.102), Flag(1,0,32769)
[2025-04-25 02:16:37.294882 140489547175616]: [Auth] DiGeamAuthDB Verify Remote : UserIdx(3), UserNum(0), UserID(aerox009x), IP(192.168.1.102), Flag(1,1,32769)
[2025-04-25 02:16:37.306406 140486836745920]: [Auth] DiGeamAuthDB Verify Success : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(1,2,32769), processTick=612783(12ms), connctTick=612294(501ms)
[2025-04-25 02:16:37.306510 140486836745920]: [Auth] CompletedStep1 Request Redirect : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(1,0,98305)
[2025-04-25 02:16:37.306555 140486836745920]: [Auth] CompletedStep1 Verify Remote : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(1,1,98305)
[2025-04-25 02:16:37.621143 140488329893568]: [Auth] CompletedStep1 Verify Remote Result(1) : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(2,2,98305), Reason(32)
[2025-04-25 02:16:37.621396 140488329893568]: [Auth] CompletedStep1 Verify Success : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(2,2,98305), processTick=612795(315ms), connctTick=612294(816ms)
[2025-04-25 02:16:37.621504 140488329893568]: [Auth] DiGeamOTP Request Bypass : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(2,0,229377)
[2025-04-25 02:16:37.621560 140488329893568]: [Auth] Complete : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(2,0,134447105)
 
Last edited:
Apr 25 02:07:23 cabalep33 python[551]: ERROR:db:SQL Error: ('28000', "[28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user 'sa'. (18456) (SQLDriverConnect)")
Apr 25 02:07:23 cabalep33 python[551]: INFO:__main__:Authentication result: None
Apr 25 02:07:23 cabalep33 python[551]: INFO:__main__:Authentication failed, returning 404 with RetVal: -1
Apr 25 02:07:23 cabalep33 python[551]: INFO:werkzeug:172.17.0.3 - - [25/Apr/202502:07:23] "POST /game-api/game_login HTTP/1.1" 404 -
why? it keep me wrong password on login in client also in database say user sa is failed too.
try to change db.py -DB_PASSWORD to yours!
 
Apr 25 02:07:23 cabalep33 python[551]: ERROR:db:SQL Error: ('28000', "[28000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Login failed for user 'sa'. (18456) (SQLDriverConnect)")
Apr 25 02:07:23 cabalep33 python[551]: INFO:__main__:Authentication result: None
Apr 25 02:07:23 cabalep33 python[551]: INFO:__main__:Authentication failed, returning 404 with RetVal: -1
Apr 25 02:07:23 cabalep33 python[551]: INFO:werkzeug:172.17.0.3 - - [25/Apr/202502:07:23] "POST /game-api/game_login HTTP/1.1" 404 -
why? it keep me wrong password on login in client also in database say user sa is failed too.

--fixed but otp still bypassing
Apr 25 02:16:29 cabalep33 python[27083]: INFO:werkzeug: * Debugger PIN: 502-121-338
Apr 25 02:16:37 cabalep33 python[27083]: INFO:__main__:Request POST game_login! Content-Type: application/x-www-form-urlencoded
Apr 25 02:16:37 cabalep33 python[27083]: INFO:__main__:Request data: ImmutableMultiDict([('user_id', 'aerox009x'), ('password', '1234'), ('user_ip', '192.168.1.102')])
Apr 25 02:16:37 cabalep33 python[27083]: INFO:db:Authentication Request Result: (32, 2005)
Apr 25 02:16:37 cabalep33 python[27083]: INFO:__main__:Authentication result: (32, 2005)
Apr 25 02:16:37 cabalep33 python[27083]: INFO:db:Raw OTP info results: {'useotp': 0, 'externalid': ''}
Apr 25 02:16:37 cabalep33 python[27083]: INFO:db:GetOTPInfo Request Output: {'useotp': 0, 'externalid': ''}
Apr 25 02:16:37 cabalep33 python[27083]: INFO:__main__:OTP info: {'useotp': 0, 'externalid': ''}
Apr 25 02:16:37 cabalep33 python[27083]: INFO:__main__:Sending response: {'RetVal': 0, 'user_id': 2005, 'otp': False}
Apr 25 02:16:37 cabalep33 python[27083]: INFO:werkzeug:172.17.0.3 - - [25/Apr/2025 02:16:37] "POST /game-api/game_login HTTP/1.1" 200 -

-loginsvrlog--

[2025-04-25 02:16:37.294426 140489547175616]: [Auth] DiGeamAuthWeb Verify Success : UserIdx(3), UserNum(0), UserID(aerox009x), IP(192.168.1.102), Flag(1,2,1), processTick=612354(429ms), connctTick=612294(489ms)
[2025-04-25 02:16:37.294709 140489547175616]: [Auth] DiGeamAuthDB Request Redirect : UserIdx(3), UserNum(0), UserID(aerox009x), IP(192.168.1.102), Flag(1,0,32769)
[2025-04-25 02:16:37.294882 140489547175616]: [Auth] DiGeamAuthDB Verify Remote : UserIdx(3), UserNum(0), UserID(aerox009x), IP(192.168.1.102), Flag(1,1,32769)
[2025-04-25 02:16:37.306406 140486836745920]: [Auth] DiGeamAuthDB Verify Success : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(1,2,32769), processTick=612783(12ms), connctTick=612294(501ms)
[2025-04-25 02:16:37.306510 140486836745920]: [Auth] CompletedStep1 Request Redirect : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(1,0,98305)
[2025-04-25 02:16:37.306555 140486836745920]: [Auth] CompletedStep1 Verify Remote : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(1,1,98305)
[2025-04-25 02:16:37.621143 140488329893568]: [Auth] CompletedStep1 Verify Remote Result(1) : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(2,2,98305), Reason(32)
[2025-04-25 02:16:37.621396 140488329893568]: [Auth] CompletedStep1 Verify Success : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(2,2,98305), processTick=612795(315ms), connctTick=612294(816ms)
[2025-04-25 02:16:37.621504 140488329893568]: [Auth] DiGeamOTP Request Bypass : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(2,0,229377)
[2025-04-25 02:16:37.621560 140488329893568]: [Auth] Complete : UserIdx(3), UserNum(2005), UserID(aerox009x), IP(192.168.1.102), Flag(2,0,134447105)
Can you let your friends enjoy the battle together if you succeed?
 
Back