Skip to content

Commit ea1a626

Browse files
committed
Dont refresh accessTokens if they fail to validate
- Add authentication generator information to readme.
1 parent fa217e3 commit ea1a626

File tree

3 files changed

+94
-5
lines changed

3 files changed

+94
-5
lines changed

README.md

Lines changed: 88 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,31 @@ This attack method uses CreativeInventoryActionPacket to create an item with blo
2525
The server will read the xyz of the item and try to load the block entity in the world at that position.
2626
There's no range limit on this, so the server can be forced to load/generate chunks that are far away.
2727

28+
## Authentication Generators
29+
### increment
30+
This will generate usernames with a base name and sequential digits appended.
31+
Configuration:
32+
- `username`: Sets the base name used for generating usernames.
33+
- `password`: Sets the password used for all generated usernames.
34+
- `start`: Sets the starting index for generation.
35+
36+
### random
37+
This will generate random all-lowercase usernames.
38+
Configuration:
39+
- `min`: Sets the minimum length of the username to generate.
40+
- `max`: Sets the maximum length of the username to generate.
41+
42+
### multi-user
43+
This will read username:password combinations from a file.
44+
Configuration:
45+
- `filename`: The file that contains the username:password combinations.
46+
47+
### multi-token
48+
This will read username:accessToken:clientToken:profileId combinations from a file.
49+
The profileId isn't required, but it needs to hit the API to fetch it. It will get rate limited faster.
50+
Configuration:
51+
- `filename`: The file that contains the tokens.
52+
2853
## Examples
2954
```
3055
./avalanche --username bot --password pw --server 127.0.0.1:25565
@@ -46,12 +71,16 @@ Spawns in 19 instances that will do the interact attack.
4671
```
4772
Reads the config from basic.json file.
4873

49-
### JSON Example
74+
### JSON Examples
5075
```
5176
{
5277
"login": {
53-
"username": "user",
54-
"password": "pw",
78+
"generator": {
79+
"method": "increment",
80+
"username": "user",
81+
"password": "pw",
82+
"start": 0
83+
},
5584
"server": "127.0.0.1",
5685
"method": {
5786
"name": "flood",
@@ -66,3 +95,59 @@ Reads the config from basic.json file.
6695
}
6796
}
6897
```
98+
99+
```
100+
{
101+
"login": {
102+
"generator": {
103+
"method": "random",
104+
"min": 3,
105+
"max": 16
106+
},
107+
"server": "127.0.0.1",
108+
"method": {
109+
"name": "sequential",
110+
"delay": 5000
111+
}
112+
},
113+
"count": 5,
114+
"attack": {
115+
"method": "creative-world-lag",
116+
"send-per-tick": 30,
117+
"send-gamemode": true,
118+
"position": {
119+
"method": "random",
120+
"initial": {
121+
"x": 0,
122+
"y": 64,
123+
"z": 0
124+
},
125+
"increment": {
126+
"x": 10,
127+
"z": 10
128+
}
129+
}
130+
}
131+
}
132+
```
133+
134+
```
135+
{
136+
"login": {
137+
"generator": {
138+
"method": "multi-user",
139+
"filename": "users.txt"
140+
},
141+
"server": "127.0.0.1",
142+
"method": {
143+
"name": "sequential",
144+
"delay": 0
145+
}
146+
},
147+
"count": 3,
148+
"attack": {
149+
"method": "interact",
150+
"send-per-tick": 75
151+
}
152+
}
153+
```

avalanche/login/generator/MultiTokenGenerator.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "MultiTokenGenerator.h"
22

33
#include <fstream>
4+
#include <iostream>
45

56
namespace avalanche {
67

@@ -55,7 +56,10 @@ bool MultiTokenGenerator::Initialize(const std::string& filename) {
5556
}
5657

5758
mc::core::AuthToken token(accessToken, clientToken, profileId);
58-
m_Users.emplace_back(username, token);
59+
if (token.Validate(username))
60+
m_Users.emplace_back(username, token);
61+
else
62+
std::cerr << "Failed to validate " << username << std::endl;
5963
}
6064

6165
if (m_Users.empty())

0 commit comments

Comments
 (0)