repl.it
@FuyuWinter/

{HTB} Snake | 3.x

Python

Hack The Box | Snake for Python 3.x

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import random 

print("""
___________.__               _________              __           
\__    ___/|  |__   ____    /   _____/ ____ _____  |  | __ ____  
  |    |   |  |  \_/ __ \   \_____  \ /    \\__  \ |  |/ // __ \ 
  |    |   |   Y  \  ___/   /        \   |  \/ __ \|    <\  ___/ 
  |____|   |___|  /\___  > /_______  /___|  (____  /__|_ \\___  >
                \/     \/          \/     \/     \/     \/    \/ 

""")

aa = "\x61"
db = "\x6e"
nn = "\x61"
ef = "\x63"
rr = "\x6f"
gh = "\x6e"
lr = "\x64"
ty = "\x61"

password = [0x69, 0x74, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x65, 0x61, 0x73, 0x79]

chains = [0x74, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x72, 0x6f, 0x6c, 0x6c]

auth = [0x6b, 0x65, 0x65, 0x70, 0x20, 0x74, 0x72, 0x79, 0x69, 0x6e, 0x67]

keys = [0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x21, 0x21]

chars = []

# Why even have a lock_pick variable when the result is always 5? -_- whatever, I am keeping it here because I am nice.

lock_pick = random.randint(0, 0x3e8)
lock = lock_pick * 2
lock = lock + 10
lock = lock / 2
lock = lock - lock_pick

print("The Snake Created by 3XPL017")
print("Cleaned up & updated py version by Misfortune")
print("Your number is {}".format(lock_pick))

for key in keys:
    keys_encrypt = int(lock) ^ key
    chars.append(keys_encrypt)

get_pass = []

for char in chars:
      get_pass.append(str(chr(char)))

for chain in chains:
    chains_encrypt = chain + 0xA
    chars.append(chains_encrypt)

slither = aa + db + nn + ef + rr + gh + lr + ty

print("Authentication required")
print("\nUsername: {}".format(slither))
print("Password: " + "".join(get_pass))
print("")

user_input = input("Enter your username\n")

if user_input != slither:
  print("Wrong username try harder")
  exit()

pass_input = input("Enter your password\n")

pc = zip(pass_input, chars)

# It may be accidental, but this part is genius.
# Instead of it saying "Good Job" when you get the pass correct
# It says "Good Job" even if it's not complete, throwing people off...

for passes, char in pc:
  if passes == str(chr(char)):
    print("Good Job")
    exit()
  else:
    print("Wrong password try harder")
    exit()
Fetching token
?