Advertisement
Guest User

Computrace Lojack Checker Source

a guest
May 21st, 2014
4,559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.79 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.IO;
  10. using Microsoft.Win32;
  11. using System.Diagnostics;
  12.  
  13. namespace Computrace_Lojack_Checker
  14. {
  15.     public partial class Form1 : Form
  16.     {
  17.         public Form1()
  18.         {
  19.             InitializeComponent();
  20.  
  21.             if (File.ReadLines(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "drivers/etc/hosts")).Any(line => line.Contains("namequery.com"))){
  22.                 button2.Enabled = false;
  23.                 button2.Text = "Your Hosts file is already patched";
  24.             }
  25.         }
  26.  
  27.         private string[] files = new string[]{
  28.             @"c:\Windows\system32\rpcnet.exe",
  29.             @"c:\Windows\system32\rpcnetp.exe",
  30.             @"c:\Windows\system32\wceprv.exe",
  31.             @"c:\Windows\system32\identprv.exe",
  32.             @"c:\Windows\system32\Upgrd.exe",
  33.             @"c:\Windows\system32\autochk.exe.bak"
  34.         };
  35.         private string[] kis = new string[]{
  36.             @"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\rpcnet",
  37.             @"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\rpcnetp"
  38.         };
  39.         private string[] pros = new string[]{
  40.             "rpcnet",
  41.             "rpcnetp",
  42.         };
  43.         private string[] hosts = new string[]{
  44.             "127.0.0.1  search.namequery.com",
  45.             "127.0.0.1  search.us.namequery.com",
  46.             "127.0.0.1  search64.namequery.com",
  47.             "127.0.0.1  bh.namequery.com",
  48.             "127.0.0.1  namequery.nettrace.co.za",
  49.             "127.0.0.1  search2.namequery.com",
  50.             "127.0.0.1  m229.absolute.com",
  51.             "127.0.0.1  m*.absolute.com",
  52.             "127.0.0.1  209.53.113.223"
  53.         };
  54.  
  55.         private void button1_Click(object sender, EventArgs e)
  56.         {
  57.             t.AppendText("LOOKING IN SYSTEM32...\r\n\r\n");
  58.  
  59.             foreach (string s in files)
  60.             {
  61.                 var f = Path.GetFileName(s);
  62.                 t.AppendText(File.Exists(s) ? alert(f) :  "- "+f+" does not exist.\n");
  63.             }
  64.  
  65.             t.AppendText("\r\nLOOKING IN REGISTRY...\r\n\r\n");
  66.  
  67.             foreach(string s in kis){
  68.                 t.AppendText(Registry.LocalMachine.OpenSubKey(s) != null ? alert(s) : "- " + s + " does not exist.\n");
  69.             }
  70.  
  71.             t.AppendText("\r\nLOOKING IN RUNNING PROCESSES...\r\n\r\n");
  72.  
  73.             foreach (string s in pros)
  74.             {
  75.                 t.AppendText(Process.GetProcessesByName(s).Length == 1 ? alert(s) : "- " + s + " does not exist.\n");
  76.             }
  77.  
  78.             if (t.ForeColor != Color.Red)
  79.             {
  80.                 button1.Text = "Everything seems to be fine";
  81.             }
  82.             else
  83.             {
  84.                 button1.Text = "Uh-Oh";
  85.             }
  86.  
  87.  
  88.             button1.Text = (t.ForeColor != Color.Red) ? "Everything seems to be fine" : "Uh-Oh...";
  89.         }
  90.  
  91.         private String alert(string file)
  92.         {
  93.             t.ForeColor = Color.Red;
  94.             return "- " + file + " is here : Bad news for you, seems anyone can remote control your device...";
  95.         }
  96.  
  97.         private void button2_Click(object sender, EventArgs e)
  98.         {
  99.             t.AppendText("\r\nBLOCKING SERVERS IN HOSTS FILE...\r\n\r\n");
  100.  
  101.             using (StreamWriter w = File.AppendText(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "drivers/etc/hosts")))
  102.             {
  103.                 foreach (string s in hosts)
  104.                 {
  105.                     w.WriteLine(s);
  106.  
  107.                     t.AppendText("- "+s+" added\n");
  108.                 }
  109.             }
  110.  
  111.             button2.Enabled = false;
  112.         }
  113.     }
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement