Skip to content

Commit 67b82f6

Browse files
committed
Added elements manipulation level
1 parent f87573d commit 67b82f6

File tree

4 files changed

+183
-0
lines changed

4 files changed

+183
-0
lines changed

src/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { DebuggerController } from './controllers/debugger.controller';
1313
import { CookieBasicController } from './controllers/cookie-basic.controller';
1414
import { IndexedDBBasicController } from './controllers/indexedDB-basic.controller';
1515
import { UserAgentController } from './controllers/user-agent.controller';
16+
import { ElementsManipulationController } from './controllers/elements-manipulation.controller';
1617

1718
@Module({
1819
controllers: [
@@ -27,6 +28,7 @@ import { UserAgentController } from './controllers/user-agent.controller';
2728
CookieBasicController,
2829
IndexedDBBasicController,
2930
UserAgentController,
31+
ElementsManipulationController,
3032
],
3133
providers: [AppService],
3234
imports: [

src/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ const config = {
4343
url: 'level-a68f14e9',
4444
flag: createFlag('UA_PR0F3SSI0NAL'),
4545
}),
46+
elementsManipulation: createLevelConfig('EL_MANIPULATION', {
47+
url: 'level-abc12345',
48+
flag: createFlag('ELEMENTS_BABY'),
49+
}),
4650
},
4751
server: {
4852
port: +envWithDefault<number>('PORT', 3000),
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Controller, Get, Render } from '@nestjs/common';
2+
import config from '~/config';
3+
import { toBase64 } from '~/utils/toBase64';
4+
import { chunkParts } from '~/utils/chunkParts';
5+
6+
const levelConfig = config.levels.elementsManipulation;
7+
const FLAG_PARTIALS = 3;
8+
const encoded = encodeURIComponent(toBase64(levelConfig.flag));
9+
const chunkedFlag = chunkParts(encoded, FLAG_PARTIALS);
10+
11+
@Controller(levelConfig.url)
12+
export class ElementsManipulationController {
13+
@Get()
14+
@Render('elements-manipulation.hbs')
15+
render() {
16+
return Object.fromEntries(
17+
chunkedFlag.map((chunk, i) => [`flag${i + 1}`, chunk])
18+
);
19+
}
20+
}
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
{{> headers}}
5+
<script type="application/json" id="__DATA__">
6+
{
7+
"a":"{{flag1}}",
8+
"b":"0VJRBc0Al",
9+
"c":"{{flag2}}",
10+
"d":"5e452a05",
11+
"e":"{{flag3}}",
12+
"f":"e267f8ed",
13+
"g":"c8f44612",
14+
"i":"c0acb099",
15+
"j":"8f3a00b9",
16+
"l":"36a399ff",
17+
"m":"e3f6622d",
18+
"n":"ff35c8c1",
19+
"o":"d9784d7a"
20+
}
21+
22+
23+
24+
25+
</script>
26+
<style>
27+
28+
@keyframes shake {
29+
10%, 90% {
30+
transform: translate3d(-1px, 0, 0);
31+
}
32+
33+
20%, 80% {
34+
transform: translate3d(2px, 0, 0);
35+
}
36+
37+
30%, 50%, 70% {
38+
transform: translate3d(-4px, 0, 0);
39+
}
40+
41+
40%, 60% {
42+
transform: translate3d(4px, 0, 0);
43+
}
44+
}
45+
46+
.submit-btn {
47+
padding: .5rem 1rem;
48+
background-color: #4aad1d;
49+
border-radius: 2rem;
50+
border: none;
51+
font-size: 2rem;
52+
color: #313131;
53+
cursor: pointer;
54+
}
55+
56+
.submit-btn:disabled {
57+
--color1: #696969;
58+
--stop: 15px;
59+
--color2: #808080;
60+
color: #424242;
61+
cursor: not-allowed;
62+
background: repeating-linear-gradient(45deg,
63+
var(--color1), var(--color1) var(--stop),
64+
var(--color2) var(--stop), var(--color2) calc(var(--stop) * 2)
65+
);
66+
}
67+
68+
.submit-btn:disabled:active {
69+
animation: shake cubic-bezier(.36, .07, .19, .97) infinite .82s;
70+
}
71+
</style>
72+
</head>
73+
<body class="center full-size">
74+
<form action="">
75+
<input id="submitBtn" class="submit-btn" type="submit" disabled>
76+
</form>
77+
<script defer>
78+
function _0x3a3f(_0xe8c61d, _0x2c31cc) {
79+
const _0x23de0a = _0x23de();
80+
return _0x3a3f = function(_0x3a3f91, _0x3ea3a1) {
81+
_0x3a3f91 = _0x3a3f91 - 0x65;
82+
let _0x4ed814 = _0x23de0a[_0x3a3f91];
83+
return _0x4ed814;
84+
}, _0x3a3f(_0xe8c61d, _0x2c31cc);
85+
}
86+
87+
const _0x2f348d = _0x3a3f;
88+
(
89+
function(_0x446864, _0xfef117) {
90+
const _0x1c0370 = _0x3a3f, _0x3de815 = _0x446864();
91+
while (!![]) {
92+
try {
93+
const _0xd22d4f = parseInt(_0x1c0370(0x78)) / 0x1 * (
94+
parseInt(_0x1c0370(0x67)) / 0x2
95+
) + -parseInt(_0x1c0370(0x6e)) / 0x3 * (
96+
-parseInt(_0x1c0370(0x6b)) / 0x4
97+
) + parseInt(_0x1c0370(0x69)) / 0x5 + -parseInt(_0x1c0370(0x75)) / 0x6 * (
98+
parseInt(_0x1c0370(0x65)) / 0x7
99+
) + -parseInt(_0x1c0370(0x77)) / 0x8 + parseInt(_0x1c0370(0x6c)) / 0x9 +
100+
parseInt(_0x1c0370(0x6d)) / 0xa * (
101+
-parseInt(_0x1c0370(0x68)) / 0xb
102+
);
103+
if (_0xd22d4f === _0xfef117) break; else _0x3de815["push"](_0x3de815["shift"]());
104+
} catch (_0x41dcbd) {
105+
_0x3de815["push"](_0x3de815["shift"]());
106+
}
107+
}
108+
}(_0x23de, 0xd054c)
109+
);
110+
const JSON_DATA = JSON[_0x2f348d(0x70)](document[_0x2f348d(0x6a)](_0x2f348d(0x72))[_0x2f348d(0x73)]),
111+
data = atob(decodeURIComponent(JSON_DATA["a"] + JSON_DATA["c"] + JSON_DATA["e"])), INITIAL_TEXT = "Get\x20Flag",
112+
form = document[_0x2f348d(0x74)]("form"), btn = document[_0x2f348d(0x6a)](_0x2f348d(0x7a));
113+
114+
function _0x23de() {
115+
const _0x3e081a = [
116+
"onclick",
117+
"__DATA__",
118+
"textContent",
119+
"querySelector",
120+
"138sSxrgx",
121+
"onsubmit",
122+
"11900056VGjceB",
123+
"42281ApRwSc",
124+
"disabled",
125+
"submitBtn",
126+
"flag",
127+
"preventDefault",
128+
"212751DCfLcN",
129+
"dataset",
130+
"4bPCMQL",
131+
"91201eMTBKV",
132+
"7927510YmaAvI",
133+
"getElementById",
134+
"580376eSNEIW",
135+
"15238287fIaWQO",
136+
"1790YyDQnp",
137+
"24adAEaQ",
138+
"value",
139+
"parse"
140+
];
141+
_0x23de = function() {return _0x3e081a;};
142+
return _0x23de();
143+
}
144+
145+
form[_0x2f348d(0x76)] = _0x2e7786 => {
146+
const _0x379090 = _0x2f348d;
147+
_0x2e7786[_0x379090(0x7c)]();
148+
}, btn[_0x2f348d(0x6f)] = INITIAL_TEXT, btn[_0x2f348d(0x71)] = () => {
149+
const _0x5a4500 = _0x2f348d;
150+
btn[_0x5a4500(0x6f)] = "Success", form[_0x5a4500(0x66)][_0x5a4500(0x7b)] = data, setTimeout(() => {
151+
const _0xa0e190 = _0x5a4500;
152+
btn[_0xa0e190(0x79)] = !![], btn[_0xa0e190(0x6f)] = INITIAL_TEXT;
153+
}, 0x7d0);
154+
};
155+
</script>
156+
</body>
157+
</html>

0 commit comments

Comments
 (0)