repl.it
Python

Pen-Testing game

fork
loading
Files
  • main.py
  • events
  • executables
  • computer.py
  • filesystem.py
  • funfunctions.py
  • game.py
  • MainMenuException.py
  • shell.py
  • title.py
  • virus.py
  • zUnusedCode
  • Packager files
  • requirements.txt
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
'''
Run the game
'''


from game import Game
from MainMenuException import MainMenuException
import funfunctions

from replit import clear
import time

while True:
  # Create the game, agent, computer; and get a shell
  game = Game()
  if game.leave:
    break
  ailee = game.spawn_agent("Ailee")
  comp = game.add_computer('127.0.0.1', 'localhost')
  game.eventLogDir = comp.fs.mkdir('chat_log')
  pDir = comp.fs.mkdir('go_here_first')
  pDir.addFile('readme.txt', 'The "run" command runs .exe files.\n\nYou can use the command "cd .." to move up a directory')
  pDir.addFile('executable.exe', """
  Error: Unreadable file
  """)
  pDir.addFile('.hiddenFile.txt', 'I am a hidden file, good job finding me!')
  prev = comp.fs
  for i in range(1, 11):
    prev = prev.mkdir("folder{}".format(i))
  prev.addFile('file.txt', 'belt')
  prev.addFile('.sign.txt', 'Mario was here')
  comp.add_user('Administrator')
  if not game.skip_dialog:
    clear()
    funfunctions.login(comp.get_user('Administrator').name, comp.get_user('Administrator').password)
    clear()
    funfunctions.startAilee()
  ailee.login(comp)
  try:
    ailee.shells[0].start_shell_loop()
    print("Just broke out of main loop")
    time.sleep(10)
  except MainMenuException:
    pass # So the shutdown command returns to the main menu instead of exiting
?