using System; using System.Collections.Generic; using System.IO; using Microsoft.Xna.Framework; namespace Hacknet { internal static class PortExploits { private const int EXE_FILE_LENGTH = 500; public static List portNums; public static List exeNums; public static Dictionary services; public static Dictionary cracks; public static Dictionary crackExeData; public static Dictionary needsPort; public static string ValidPacemakerFirmware; public static string DangerousPacemakerFirmware; public static List passwords; public static void populate() { portNums = new List(64); exeNums = new List(64); services = new Dictionary(64); cracks = new Dictionary(64); needsPort = new Dictionary(64); crackExeData = new Dictionary(64); var random1 = new Random(17021990); var random2 = Utils.random; Utils.random = random1; portNums.Add(22); exeNums.Add(22); services[22] = "SSH"; cracks[22] = "SSHcrack.exe"; needsPort[22] = true; crackExeData[22] = Computer.generateBinaryString(500); portNums.Add(21); exeNums.Add(21); services[21] = "FTP Server"; cracks[21] = "FTPBounce.exe"; needsPort[21] = true; crackExeData[21] = Computer.generateBinaryString(500); portNums.Add(25); exeNums.Add(25); services[25] = "SMTP MailServer"; cracks[25] = "SMTPoverflow.exe"; needsPort[25] = true; crackExeData[25] = Computer.generateBinaryString(500); portNums.Add(80); exeNums.Add(80); services[80] = "HTTP WebServer"; cracks[80] = "WebServerWorm.exe"; needsPort[80] = true; crackExeData[80] = Computer.generateBinaryString(500); portNums.Add(3724); exeNums.Add(3724); services[3724] = "Blizzard Updater"; cracks[3724] = "WoWHack.exe"; needsPort[3724] = true; crackExeData[3724] = Computer.generateBinaryString(500); portNums.Add(1433); exeNums.Add(1433); services[1433] = "SQL Server"; cracks[1433] = "SQL_MemCorrupt.exe"; needsPort[1433] = true; crackExeData[1433] = Computer.generateBinaryString(500); portNums.Add(104); exeNums.Add(104); services[104] = "Medical Services"; cracks[104] = "KBT_PortTest.exe"; needsPort[104] = true; crackExeData[104] = Computer.generateBinaryString(500); portNums.Add(3659); exeNums.Add(3659); services[3659] = "eOS Connection Manager"; cracks[3659] = "confloodEOS.exe"; needsPort[3659] = true; crackExeData[3659] = Computer.generateBinaryString(500); exeNums.Add(1); cracks[1] = "Tutorial.exe"; needsPort[1] = false; crackExeData[1] = Computer.generateBinaryString(500); exeNums.Add(4); cracks[4] = "SecurityTracer.exe"; needsPort[4] = false; crackExeData[4] = Computer.generateBinaryString(500); exeNums.Add(8); cracks[8] = "Notes.exe"; needsPort[8] = false; crackExeData[8] = Computer.generateBinaryString(500); exeNums.Add(9); cracks[9] = "Decypher.exe"; needsPort[9] = false; crackExeData[9] = Computer.generateBinaryString(500); exeNums.Add(10); cracks[10] = "DECHead.exe"; needsPort[10] = false; crackExeData[10] = Computer.generateBinaryString(500); exeNums.Add(11); cracks[11] = "Clock.exe"; needsPort[11] = false; crackExeData[11] = Computer.generateBinaryString(500); exeNums.Add(12); cracks[12] = "TraceKill.exe"; needsPort[12] = false; crackExeData[12] = Computer.generateBinaryString(500); exeNums.Add(13); cracks[13] = "eosDeviceScan.exe"; needsPort[13] = false; crackExeData[13] = Computer.generateBinaryString(500); exeNums.Add(14); cracks[14] = "themeSwitch.exe"; needsPort[14] = false; crackExeData[14] = Computer.generateBinaryString(500); exeNums.Add(15); cracks[15] = "hacknet.exe"; needsPort[15] = false; crackExeData[15] = Computer.generateBinaryString(500); exeNums.Add(16); cracks[16] = "HexClock.exe"; needsPort[16] = false; crackExeData[16] = Computer.generateBinaryString(500); exeNums.Add(17); cracks[17] = "Sequencer.exe"; needsPort[17] = false; crackExeData[17] = Computer.generateBinaryString(500); var streamReader = new StreamReader(TitleContainer.OpenStream("Content/passwords.txt")); var str = streamReader.ReadToEnd(); streamReader.Close(); passwords = new List(str.Replace("\n", " ").Replace("\r", "").Split(' ', '\t', '\n')); ValidPacemakerFirmware = Computer.generateBinaryString(500); DangerousPacemakerFirmware = Computer.generateBinaryString(500); Utils.random = random2; } public static string getRandomPassword() { return passwords[Utils.random.Next(passwords.Count)]; } } }