Exemple #1
0
        static void Main(string[] args)
        {
            var notAdminUsername = new StartProcess("calc.exe");

            notAdminUsername.Start();

            var json = UnsecureSerializer <StartProcess> .Serialize(notAdminUsername);

            var tamperedJson = json.Replace("calc.exe", "Virus.exe");

            var adminUsername = UnsecureSerializer <StartProcess> .Deserialize(tamperedJson);

            adminUsername.Start();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            var notAdminUsername = new StartProcessBad("calc.exe");

            Console.WriteLine(notAdminUsername.Cmd);

            var json = UnsecureSerializer <StartProcessBad> .Serialize(notAdminUsername);

            var tamperedJson = json.Replace("calc.exe", "Virus.exe");

            var adminUsername = UnsecureSerializer <StartProcessBad> .Deserialize(tamperedJson);

            Console.WriteLine(adminUsername.Cmd);


            Console.ReadLine();
        }
Exemple #3
0
        private static void Main(string[] args)
        {
            var owner = new Owner
            {
                Name = "Tim Apple", Businesses = new List<Business>
                {
                    new Business
                    {
                        Name = "ProgramingExtreme", Address = "ProgramingLane", Employees = new List<Employee>
                        {
                            new Employee {Name = "Harry"}, new Employee {Name = "Sally"}
                        }
                    }
                }
            };

            var ownerJson = UnsecureSerializer<Owner>.Serialize(owner);
            var EmployeeJson = UnsecureSerializer<DbEmployee>.Serialize(new DbEmployee("2"));

            var OwnerFromEmployer = UnsecureSerializer<Owner>.DeserializeToObject(EmployeeJson);

            Console.WriteLine("Hello World!");
        }