Пример #1
0
        public static bool GenerateActivation(string Username, string pass, string SKey, string email)
        {
            try
            {
                string         Machine = Environment.MachineName;
                string         con     = string.Format("user={0}&pass={1}&SK={2}&Machine={3}&email={4}&MTD=VALIDATE", Username, pass, SKey, Machine.ToLower(), email);
                byte[]         b       = Encoding.ASCII.GetBytes(con);
                HttpWebRequest req     = (HttpWebRequest)WebRequest.Create("http://www.arsslensoft.tk/avl/Kavprot/kpavdbv.php");
                req.Method = "POST";
                req.Accept = "gzip";
                req.AutomaticDecompression = DecompressionMethods.GZip;
                req.ContentType            = "application/x-www-form-urlencoded";
                req.Timeout = 20000;
                Stream stream = req.GetRequestStream();
                stream.Write(b, 0, b.Length);
                stream.Close();
                stream = req.GetResponse().GetResponseStream();

                StreamReader sr   = new StreamReader(stream);
                string       text = sr.ReadToEnd();
                stream.Close();
                if (text == "FALSE")
                {
                    return(false);
                }
                else
                {
                    DateTime dt    = DateTime.Parse("24/11/1995");
                    bool     parse = DateTime.TryParse(text, out dt);
                    if (parse)
                    {
                        FileSecurity fs    = new FileSecurity();
                        string[]     lines = { Username, pass, SKey, dt.ToString(), Machine };
                        fs.ACTWriteAllLines(lines, actfile);
                        return(true);
                    }
                }

                return(false);
            }
            catch (Exception ex)
            {
                AntiCrash.LogException(ex, 0);
                MessageBox.Show(ex.Message, "Activation", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                Expired = true;
            }
            finally
            {
            }
            return(false);
        }
Пример #2
0
 /// <summary>
 /// Send sms using Bulk SMS Gateway
 /// </summary>
 /// <param name="username">Bulk sms gateway username</param>
 /// <param name="password">Bulk sms gateway password</param>
 /// <param name="msisdn">Phone number with country code without (00 or +)</param>
 /// <param name="msg">your message maximum characters is 160</param>
 public static void SendBulkSMS(string username, string password, string msisdn, string msg)
 {
     try
     {
         if (msg.Length < 160)
         {
             Hashtable result;
             string    data = seven_bit_message(username, password, msisdn, msg);
             result = send_sms(data, "http://bulksms.vsms.net:5567/eapi/submission/send_sms/2/2.0");
         }
     }
     catch (Exception ex)
     {
         AntiCrash.LogException(ex);
     }
     finally
     {
     }
 }
Пример #3
0
        void EncryptFile(string _FileToEncrypt, string _cryptoFile, string _Password)
        {
            try
            {
                // Step 1. Create the Stream objects
                FileStream inFile  = new FileStream(_FileToEncrypt, FileMode.Open, FileAccess.Read);
                FileStream outFile = new FileStream(_cryptoFile, FileMode.OpenOrCreate, FileAccess.Write);

                // Step 2. Create the Symetrical algo object
                SymmetricAlgorithm symAlgo = new RijndaelManaged();

                // Step 3. Specify a key (optional)
                byte[]             salt   = Encoding.ASCII.GetBytes("QUARANTINESALT");
                Rfc2898DeriveBytes theKey = new Rfc2898DeriveBytes(_Password, salt);
                symAlgo.Key = theKey.GetBytes(symAlgo.KeySize / 8);
                symAlgo.IV  = theKey.GetBytes(symAlgo.BlockSize / 8);

                // Read the unencrypted file file into fileData
                byte[] fileData = new byte[inFile.Length];
                inFile.Read(fileData, 0, (int)inFile.Length);

                // Step 4. Create the ICryptoTransfor object
                ICryptoTransform encryptor = symAlgo.CreateEncryptor();

                // Step 5. Create teh Crypto Stream object
                CryptoStream encryptStream = new CryptoStream(outFile, encryptor, CryptoStreamMode.Write);

                // Step 6. Write the contents to the CryptoStream
                encryptStream.Write(fileData, 0, fileData.Length);

                // Close file handles
                encryptStream.Close();
                inFile.Close();
                outFile.Close();
            }
            catch (Exception ex)
            {
                AntiCrash.LogException(ex);
            }
            finally
            {
            }
        }
Пример #4
0
        public static void MakeRescue(string Directory, string Destination, ProgressBarX progress)
        {
            int       i       = 0;
            CDBuilder builder = new CDBuilder();

            builder.VolumeIdentifier = "SYS_RESCUE_DISK";
            builder.UseJoliet        = true;
            List <string> files = FileHelper.GetFilesRecursive(Directory);

            GUI.UpdateProgress(progress, 0, files.Count);

            using (StreamWriter str = new StreamWriter(Directory + @"\SYSRESCUEINFO.KPAVRSCI", true))
            {
                str.WriteLine("BEGIN SYS_RESC_DISK|" + DateTime.Now.ToString() + "|KAVPROT_ISO_RESCUE|" + Environment.MachineName + "|" + Environment.OSVersion.ToString() + "|" + Environment.UserName);
                foreach (string file in files)
                {
                    i++;
                    try
                    {
                        GUI.UpdateProgress(progress, i, files.Count);
                        builder.AddFile(Path.GetFileName(file), file);
                        str.WriteLine(file);
                        builder.Build(Destination);
                    }
                    catch (Exception ex)
                    {
                        AntiCrash.LogException(ex, 2);
                    }
                    finally
                    {
                    }
                }
                str.WriteLine("END SYS_RESC_DISK " + files.Count);
            }
            builder.AddFile("SYSRESCUEINFO.KPAVRSCI", Directory + @"\SYSRESCUEINFO.KPAVRSCI");

            builder.Build(Destination);
        }
Пример #5
0
        internal static void LearnDefinitin(string filename, string infections)
        {
            try
            {
                Dictionary <string, string> db = new Dictionary <string, string>();
                VDBT vdt = VirusDBTeacher.GetSignatures(filename, true, infections);
                switch (vdt.SIGID)
                {
                case "PES":
                    if (vdt.TEXTHASH.Length > 4)
                    {
                        db.Add(vdt.TEXTHASH, vdt.VirusName);
                    }

                    if (vdt.DATAHASH.Length > 4)
                    {
                        db.Add(vdt.DATAHASH, vdt.VirusName);
                    }

                    VDB.AddKeys(db, DBT.PEMD5);

                    break;

                case "ARS":
                    if (vdt.FILEHASH.Length > 4)
                    {
                        db.Add(vdt.FILEHASH, vdt.VirusName);
                    }

                    VDB.AddKeys(db, DBT.HDB);
                    break;

                case "HAS":
                    if (vdt.FILEHASH.Length > 4)
                    {
                        db.Add(vdt.FILEHASH, vdt.VirusName);
                    }

                    VDB.AddKeys(db, DBT.HDB);
                    break;

                case "ASC":
                    if (vdt.FILEHASH.Length > 4)
                    {
                        db.Add(vdt.FILEHASH, vdt.VirusName);
                    }

                    if (vdt.FILESOURCE.Length > 4)
                    {
                        db.Add(vdt.FILESOURCE, vdt.VirusName);
                    }

                    VDB.AddKeys(db, DBT.SDB);
                    break;
                }
            }
            catch (Exception ex)
            {
                AntiCrash.LogException(ex);
            }
            finally
            {
            }
        }