@@ -380,7 +380,9 @@ def Decryptor(self):
380
380
print ("Goodbye" )
381
381
382
382
383
- def LAN (host , rhost ):
383
+ def LAN (ls ):
384
+ host = ls [0 ]
385
+ rhost = ls [1 ]
384
386
ln = rhost .LAN
385
387
print ("Welcome to LAN tool" )
386
388
while True :
@@ -389,8 +391,9 @@ def LAN(host, rhost):
389
391
if ent == "e" :
390
392
return
391
393
elif ent == "s" :
394
+ print ("Computers connected to LAN:" )
392
395
for x in ln :
393
- print ("{} - {}" .format (x .name , x .type ))
396
+ print ("{} - Lan state: {}" .format (x .name , x .type ))
394
397
elif ent == "c" :
395
398
name = input ("Enter name of computer on lan: " )
396
399
lan_adp = search (ln , "name" , name )
@@ -404,6 +407,7 @@ def LAN(host, rhost):
404
407
if user == lan_adp .user and password == lan_adp .password :
405
408
Instance .i = comp
406
409
print ("Connected." )
410
+ return
407
411
408
412
409
413
def hashdump (lhost , rhost ):
@@ -487,7 +491,7 @@ class Instance:
487
491
488
492
class PC :
489
493
all_pc = []
490
- story = 1 # shows to which part of the story we are
494
+
491
495
492
496
def __init__ (self , name , ip , me , space = 1000 , hard = [], mails = []):
493
497
self .ip = ip
@@ -512,7 +516,7 @@ def __init__(self, name, ip, me, space=1000, hard=[], mails=[]):
512
516
self .mails = mails
513
517
self .me = me
514
518
self .space = space
515
-
519
+ self . story = 1 # shows to which part of the story we are
516
520
self .ports = []
517
521
self .all_pc .append (self )
518
522
@@ -551,14 +555,22 @@ def reply(self, contact, mess):
551
555
"find the mainframe." )])
552
556
contact .attachments = [File .fls ["LAN" ]]
553
557
print ("New message." )
558
+ elif part == 6 and mess == "p6" :
559
+ self .story += 1
560
+ add_email (contact , "Well done" , [box ("All right. Now just decrypt the file and follow the trail : )" )])
561
+ print ("New message." )
554
562
555
563
def execute (self , command ):
556
564
command = command .split (" " )
557
565
cmd = command [0 ]
558
566
if cmd == "help" :
559
- print ("'help' - to show this screen\n 'ls' - to list files in current directory\n 'connect' - to connect to"
567
+ print ("'help' - to show this screen\n 'ls' - to list files in current directory"
568
+ "\n 'mkdir [folder_name]' - to make a new folder\n 'cd [path]' - to change current directory\n "
569
+ "'mv [filename] [folder_path]' - to move a file to another folder\n 'connect' - to connect to"
560
570
" another computer.\n 'email' - to access emails\n 'dis' - to disconnect from a computer\n "
561
- "'download' - to download files\n 'space' - to see current memory\n 'run' - to open a file" )
571
+ "'download' - to download files\n 'space' - to see current memory\n 'run' - to open a file\n "
572
+ "'hrun' - to run files from your computer when connected to another"
573
+ "\n 'web [url]' - to go to a website" )
562
574
563
575
elif cmd == "admin" :
564
576
print ("Welcome Shadow" )
@@ -575,9 +587,9 @@ def execute(self, command):
575
587
self .story = part
576
588
577
589
elif cmd == "creds" :
578
- ls = [obj1 ]
590
+ ls = [obj1 , obj3 ]
579
591
for x in ls :
580
- print ("{} - ports: {}" .format (x .ip , list (map (lambda y : y .number , x .ports ))))
592
+ print ("{} {} - ports: {}" .format (x . name , x .ip , list (map (lambda y : y .number , x .ports ))))
581
593
582
594
elif cmd == "ls" :
583
595
for x in self .dir .folder :
@@ -656,6 +668,8 @@ def execute(self, command):
656
668
print ("Server ip found: {}" .format (obj2 .ip ))
657
669
if self .story == 4 :
658
670
self .reply (self .mails [0 ], "p4" )
671
+ elif page == "www.metasploit.com" :
672
+ pass # download msf.exe
659
673
else :
660
674
print ("Unresolved web address. :/" )
661
675
@@ -667,6 +681,18 @@ def execute(self, command):
667
681
else :
668
682
file .run (self )
669
683
684
+ elif cmd == "hrun" :
685
+ host = Instance .host
686
+ print ("Files on host:" )
687
+ for x in host .dir .folder :
688
+ print (x .name )
689
+ file = input ("Enter filename: " )
690
+ file = search (host .dir .folder , "name" , file )
691
+ if file == False :
692
+ print ("No such file found." )
693
+ else :
694
+ file .run ([host , self ])
695
+
670
696
elif cmd == "space" :
671
697
print ("Memory: {}/{}" .format (self .used , self .space ))
672
698
@@ -696,6 +722,14 @@ def execute(self, command):
696
722
self .bash = path + "#> "
697
723
self .path = path
698
724
self .dir = search (self .harddrive , "path" , path )
725
+ elif cmd == "mv" :
726
+ file = command [1 ]
727
+ folder = command [2 ]
728
+ file = search (self .dir .folder , "name" , file )
729
+ folder = search (self .harddrive , "path" , folder )
730
+ folder .folder .append (copy .deepcopy (file ))
731
+ self .dir .folder .remove (file )
732
+ print ("File moved to " + folder .path )
699
733
700
734
elif cmd == "connect" :
701
735
ip = input ("Enter ip to connect: " )
@@ -727,11 +761,14 @@ def execute(self, command):
727
761
if file == "c" :
728
762
break
729
763
elif file == "d" :
730
- my_pc = search ( PC . all_pc , "me" , True )
764
+ my_pc = Instance . host
731
765
self .download (fls , my_pc )
732
766
if my_pc .story == 3 :
733
767
contact = my_pc .mails [0 ]
734
768
my_pc .reply (contact , "p3" )
769
+ if my_pc .story == 6 :
770
+ contact = my_pc .mails [0 ]
771
+ my_pc .reply (contact , "p6" )
735
772
break
736
773
else :
737
774
file = search (self .dir .folder , "name" , file , True )
@@ -778,6 +815,7 @@ def download(self, fls, obj):
778
815
File .fls ["LAN" ] = File ("LAN_connect" , 30 , "exe" , LAN )
779
816
File .fls ["ObjtxtFile1" ] = File ("data" , 20 , "txt" , t2a ("Some data" ), True )
780
817
File .fls ["Dictionary" ] = File ("dict" , 30 , "txt" , "pass1, pass2, pass3" )
818
+ File .fls ["Link_to_msf" ] = File ("link" , 30 , "txt" , t2a ("The file is at: www.metasploit.com" ), True )
781
819
Port .ports .append (Port (25 , 1 ))
782
820
Port .ports .append (Port (80 , 2 ))
783
821
# Initializing other computers
@@ -788,14 +826,14 @@ def download(self, fls, obj):
788
826
obj3 = PC ("User" , ipgen (), False , 600 ) # first LAN
789
827
obj3 .ports .append (Port (25 , 1 ))
790
828
obj3 .lan_conn = LAN_con (obj3 )
791
- obj4 = PC ("Retr0" , ipgen (), False , 2000 ) # has hashdump
829
+ obj4 = PC ("Retr0" , ipgen (), False , 2000 ) # middle
792
830
obj4 .lan_conn = LAN_con (obj4 )
793
- obj5 = PC ("Mainframe" , ipgen (), False , 2000 ) # has msfconsole
831
+ obj5 = PC ("Mainframe" , ipgen (), False , 2000 , [ File . fls [ "Link_to_msf" ]] ) # has msfconsole 'end'
794
832
obj5 .ports .append (Port (40 , 3 , "closed" ))
795
- obj5 .lan_conn = LAN_con (obj5 , "locked" , credits ( 4 , 1 )[ 0 ], credits ( 1 , 4 )[ 1 ] )
833
+ obj5 .lan_conn = LAN_con (obj5 )
796
834
obj3 .LAN = [obj4 .lan_conn ]
797
- obj4 .LAN = [obj5 .lan_conn ]
798
- obj5 .LAN = [obj3 . lan_conn , obj4 .lan_conn ]
835
+ obj4 .LAN = [obj3 . lan_conn , obj5 .lan_conn ]
836
+ obj5 .LAN = [obj4 .lan_conn ]
799
837
File .fls ["ObjtxtFile1" ].content = t2a ("So the files are on: {}" .format (obj3 .ip ))
800
838
# head()
801
839
name = input ("Enter name: " )
@@ -805,6 +843,7 @@ def download(self, fls, obj):
805
843
Instance .i = player
806
844
Instance .host = search (PC .all_pc , "me" , True )
807
845
print ("New emails check mailbox with 'email'" )
846
+ print ("Use 'help' to see available commands" )
808
847
while True :
809
848
inst = Instance .i
810
849
inst .execute (input (inst .bash ))
0 commit comments