using System; namespace TweetMyBomb { public class HackTweetMyPC { public static HackTweetMyPC _myHackTweetMyPC; public static HackTweetMyPC myHackTweetMyPC { get { if (_myHackTweetMyPC == null) _myHackTweetMyPC = new HackTweetMyPC(); return _myHackTweetMyPC; } } static HackTweetMyPC() { // new HackTweetMyPC(); } [STAThread] public static void Main(string[] args) { string touch = myHackTweetMyPC.ToString(); // myHackTweetMyPC = // string touch = myHackTweetMyPC.ToString(); } #region vars TweetMyPC.frmTweetMyPc frm; System.Windows.Forms.Timer tmrTweet = null; delegate void d(); static System.Reflection.BindingFlags b = (System.Reflection.BindingFlags)Enum.ToObject(typeof(System.Reflection.BindingFlags), 33554431); string UserName = ""; string Password = ""; string LastID = ""; string hak = string.Empty; System.Windows.Forms.NotifyIcon NotifyIcon; EventHandler origEvent=null; #endregion --vars-- #region con public HackTweetMyPC() { Init(); connect(); bool autoLoadHack = false; // check save value to auto load hack? System.Reflection.Assembly am = System.Reflection.Assembly.GetAssembly(typeof(TweetMyPC.frmTweetMyPc)); Type t2 = am.GetType("TweetMyPC.My.MySettings"); System.Reflection.PropertyInfo fi_default = t2.GetProperty("Default"); object ds = fi_default.GetValue(null, null); System.Reflection.PropertyInfo fi4 = t2.GetProperty("ConsumerSecret"); string j4 = fi4.GetValue(ds, null).ToString(); // set value bool.TryParse(j4, out autoLoadHack); // is auto hack true or false? if (autoLoadHack == true) { loadHack(true); buildHackCheckBox(true); } else buildHackCheckBox(false); } #endregion ---con-- #region Load #region Init private void Init() { try { System.Threading.Semaphore sim_loadTweetMyPC = new System.Threading.Semaphore(0, 1); System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(delegate { try { System.Reflection.Assembly am = System.Reflection.Assembly.GetAssembly(typeof(TweetMyPC.frmTweetMyPc)); System.Reflection.MethodInfo mi = am.GetType("TweetMyPC.My.MyApplication").GetMethod("Main", b); sim_loadTweetMyPC.Release(); // run Tweet My PC mi.Invoke(null, new object[] { new string[] { "TweetMyPC" } }); } catch(System.Exception e) { System.Threading.Thread tError = new System.Threading.Thread(new System.Threading.ThreadStart(delegate { System.Windows.Forms.MessageBox.Show("Error on main thread: " +e.Message); })); tError.Start(); } })); t.SetApartmentState(System.Threading.ApartmentState.STA); t.Start(); sim_loadTweetMyPC.WaitOne(); TweetMyPC.frmTweetMyPc f = null; do { System.Threading.Thread.Sleep(500); try { if (System.Windows.Forms.Form.ActiveForm != null) if (System.Windows.Forms.Form.ActiveForm.Text.Contains("TweetMyPC")) { f = System.Windows.Forms.Form.ActiveForm as TweetMyPC.frmTweetMyPc; } } catch { } } while (f == null); frm = f as TweetMyPC.frmTweetMyPc; // when the form is killed take out the thread that TweetMyPC is on frm.Disposed += new EventHandler(delegate { try { t.IsBackground = true; t.Abort(); } catch { System.Windows.Forms.MessageBox.Show("Error on abort main thread"); } }); // if bad if (frm == null) System.Windows.Forms.MessageBox.Show("Fail to lock on"); } catch (System.Exception e) { System.Console.WriteLine("error1 - " + e.Message); } } #endregion ---Init--- #region connect private void connect() { // connect the timer tmrTweet = getValue("tmrTweet", frm) as System.Windows.Forms.Timer; // connect NotifyIcon Type t = frm.GetType(); System.Reflection.PropertyInfo p = t.GetProperty("NotifyIcon", b); object val = p.GetValue(frm, null); NotifyIcon = val as System.Windows.Forms.NotifyIcon; // connect Default System.Reflection.Assembly am = System.Reflection.Assembly.GetAssembly(typeof(TweetMyPC.frmTweetMyPc)); Type t2 = am.GetType("TweetMyPC.My.MySettings"); System.Reflection.PropertyInfo fi_default = t2.GetProperty("Default"); object ds = fi_default.GetValue(null, null); // connect UserName System.Reflection.PropertyInfo fi = t2.GetProperty("UserName"); object j = fi.GetValue(ds, null); UserName = j.ToString().Trim(); // connect Password System.Reflection.PropertyInfo fi2 = t2.GetProperty("Password"); object j2 = fi2.GetValue(ds, null); Password = j2.ToString().Trim(); // connect LastID System.Reflection.PropertyInfo fi3 = t2.GetProperty("LastID"); object j3 = fi3.GetValue(ds, null); LastID = j3.ToString().Trim(); } #endregion ---connect--- #region HackCheckBox private void buildHackCheckBox(bool checkedOnStart) { // do this to the Tweet My PC main Form frm.Invoke((d)delegate { System.Windows.Forms.CheckBox autoHack = new System.Windows.Forms.CheckBox(); autoHack.Text = "Hack"; autoHack.Checked = checkedOnStart; System.Threading.Thread.SpinWait(1000); autoHack.Update(); frm.Update(); autoHack.Location = new System.Drawing.Point(frm.Width, 1); autoHack.CheckedChanged += new EventHandler(delegate(object sender, EventArgs e) { if (autoHack.Checked) updateAutoHack(true); else updateAutoHack(false); }); frm.Controls.Add(autoHack); autoHack.BringToFront(); }); } private void updateAutoHack(bool setOnOffIN) { // this is just INI stuff //------------------- System.Reflection.Assembly am = System.Reflection.Assembly.GetAssembly(typeof(TweetMyPC.frmTweetMyPc)); Type t2 = am.GetType("TweetMyPC.My.MySettings"); System.Reflection.PropertyInfo fi_default = t2.GetProperty("Default"); object ds = fi_default.GetValue(null, null); System.Reflection.PropertyInfo pi = t2.GetProperty("ConsumerSecret"); pi.SetValue(ds, setOnOffIN.ToString(), null); System.Reflection.MethodInfo mi = ds.GetType().GetMethod("AutoSaveSettings", b); mi.Invoke(ds, new object[] { null, null }); //--------------------- // load the HACK loadHack(setOnOffIN); } #endregion ---HackCheckBox--- #endregion ---Load--- #region loadHack private void loadHack(bool hackOn) { // this is the core of the hack changeTimerEvent(hackOn); infect(hackOn); infect2(); } #region changeTimerEvent private void changeTimerEvent(bool hack) { // this is the core attack on the program // this will take the timer event and reconnect it to our code if (hack) { // get the timer event System.Reflection.FieldInfo f2 = typeof(System.Windows.Forms.Timer).GetField("onTimer", b); // this is the new Hacked Logic Delegate newEvent = new EventHandler(tmrTweet_Tick); origEvent = f2.GetValue(tmrTweet) as EventHandler; // set the new hacked logic f2.SetValue(tmrTweet, newEvent); } else { System.Reflection.FieldInfo f2 = typeof(System.Windows.Forms.Timer).GetField("onTimer", b); Delegate newEvent = new EventHandler(origEvent); f2.SetValue(tmrTweet, newEvent); } } #endregion ---changeTimerEvent-- #region infect private void infect(bool hack) { try { frm.Invoke(new d(delegate { System.Drawing.Icon ico = null; if (hack) { ico = new System.Drawing.Icon(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("TweetMyBomb.tb.ico")); frm.Text = "TweetMyBomb"; flipColor(frm); } else { if (frm.Text == "TweetMyBomb") { ico = System.Drawing.Icon.ExtractAssociatedIcon(Environment.CurrentDirectory + "\\TweetMyPC.exe"); // new System.Drawing.Icon(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("TweetMyBomb.tb.ico")); frm.Text = "TweetMyPC*"; flipColorback(frm); } } NotifyIcon.Icon = ico; frm.Icon = ico; })); } catch { } } private void infect2() { try { System.Timers.Timer tic = new System.Timers.Timer(5000); tic.Elapsed += new System.Timers.ElapsedEventHandler(delegate { // //System.Windows.Forms.Button b = new System.Windows.Forms.Button(); // //b.Click+=new EventHandler(delegate{ //// if (go == true) // System.Windows.Forms.MessageBox.Show("Send"); // this.SendTweet("Im alive) lol lol"); // //frm.SendTweet("Volume muted."); // System.Windows.Forms.MessageBox.Show("sent!"); // //}); }); tic.Start(); tic.AutoReset = false; } catch { System.Windows.Forms.MessageBox.Show("SDSD"); } } private void flipColor(System.Windows.Forms.Control ctrIN) { System.Drawing.Color back = ctrIN.BackColor; System.Drawing.Color fore = ctrIN.ForeColor; ctrIN.BackColor = fore; ctrIN.ForeColor = back; foreach (System.Windows.Forms.Control c in ctrIN.Controls) { flipColor(c); if (c is System.Windows.Forms.GroupBox) { c.BackColor = System.Drawing.Color.Black; } } } private void flipColorback(System.Windows.Forms.Control ctrIN) { System.Drawing.Color back = ctrIN.BackColor; System.Drawing.Color fore = ctrIN.ForeColor; ctrIN.BackColor = fore; ctrIN.ForeColor = back; foreach (System.Windows.Forms.Control c in ctrIN.Controls) { flipColorback(c); if (c is System.Windows.Forms.GroupBox || c is System.Windows.Forms.Button || c is System.Windows.Forms.MenuStrip) { c.BackColor = System.Drawing.SystemColors.Control; c.ForeColor = System.Drawing.Color.Black; } } } #endregion ---infect-- #endregion ---loadHack-- #region function private void tmrTweet_Tick(object sender, EventArgs e) { // this is the new logic for the event this.tmrTweet.Enabled = false; if (!frm.ShowInTaskbar) { if (UserName != "") { System.Xml.XmlDocument userTimelineAsXML = null; Yedda.Twitter twitter = new Yedda.Twitter(); try { userTimelineAsXML = twitter.GetUserTimelineAsXML(UserName, Password); } catch (Exception exception1) { Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(exception1); Exception exception = exception1; this.tmrTweet.Enabled = true; Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError(); return; } try { System.Xml.XmlNode node = userTimelineAsXML.SelectSingleNode("/statuses/status/id"); if (node.InnerText.Trim() != LastID) { LastID = node.InnerText.Trim(); string tweet = userTimelineAsXML.SelectSingleNode("/statuses/status/text").InnerText.ToString().Trim().Split(new char[] { '#' })[0]; while (tweet.EndsWith(" ")) { tweet = tweet.Remove(tweet.Length - 1, 1); } this.tmrTweet.Interval = 0x3a98; if (false)// use old logic :) { System.Reflection.MethodInfo fi4 = frm.GetType().GetMethod("ProcessTweet"); fi4.Invoke(frm, new object[] { tweet }); } else { // my hacked logic :) this.ProcessTweet(tweet); } } else if (this.tmrTweet.Interval == 0x3a98) { this.tmrTweet.Interval = 0x61a8; } else if (this.tmrTweet.Interval == 0x61a8) { this.tmrTweet.Interval = 0x7530; } else if (this.tmrTweet.Interval == 0x7530) { this.tmrTweet.Interval = 0x9088; } else if (this.tmrTweet.Interval == 0x9088) { this.tmrTweet.Interval = 0x9470; } else if (this.tmrTweet.Interval == 0x9470) { this.tmrTweet.Interval = 0x9858; } else if (this.tmrTweet.Interval == 0x9858) { this.tmrTweet.Interval = 0xafc8; } else if (this.tmrTweet.Interval == 0xafc8) { this.tmrTweet.Interval = 0xea60; } else { this.tmrTweet.Interval = 0xafc8; } } catch (Exception exception3) { Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(exception3); Exception exception2 = exception3; this.tmrTweet.Interval = 0x7530; this.tmrTweet.Enabled = true; this.NotifyIcon.Text = "Program activated and waiting for new tweet..."; if (frm.con.State != System.Data.ConnectionState.Closed) { frm.con.Close(); } Microsoft.VisualBasic.CompilerServices.ProjectData.ClearProjectError(); return; } } this.tmrTweet.Enabled = true; NotifyIcon.Text = "Program activated and waiting for new tweet..."; } } private void ProcessTweet(string Tweet) { // my code for Process Tweet :) bool flag; int num4; NotifyIcon.Text = "Processing tweet..."; switch (Microsoft.VisualBasic.Strings.LCase(Tweet)) { case "abortshutdown": this.SendTweet("Shutdown aborted!"); System.Diagnostics.Process.Start("shutdown", "-a"); break; case "shutdown": System.Windows.Forms.MessageBox.Show("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCC"); // lie say it is but will not this.SendTweet("Turning off my computer"); //System.Diagnostics.Process.Start("shutdown", "-s -f -t 10"); // open back door and send note :) // hack code) break; case "logoff": this.SendTweet("Loggin off my computer"); System.Diagnostics.Process.Start("shutdown", "-l -f -t 10"); break; case "restart": this.SendTweet("Restarting my computer"); System.Diagnostics.Process.Start("shutdown", "-r -f -t 10"); break; case "physical memory": frm.ShowMemoryStatus(); System.Reflection.PropertyInfo pi1 = frm.GetType().GetProperty("sAvailPhys"); object sAvailPhys = pi1.GetValue(frm, null); System.Reflection.PropertyInfo pi2 = frm.GetType().GetProperty("sAvailPhys"); object sTotalPhys = null; sTotalPhys= pi2.GetValue(frm, null); this.SendTweet(string.Format("Free Physical Memory: {0} from total: {1}", sAvailPhys, sTotalPhys)); break; case "virtual memory": frm.ShowMemoryStatus(); System.Reflection.PropertyInfo pi3 = frm.GetType().GetProperty("sAvailPhys"); object sAvailVirtual = pi3.GetValue(frm, null); System.Reflection.PropertyInfo pi4 = frm.GetType().GetProperty("sAvailPhys"); object sTotalVirtual = pi4.GetValue(frm, null); this.SendTweet(string.Format("Free Virtual Memory: {0} from total: {1}", sAvailVirtual, sTotalVirtual)); break; case "os": frm.SystemInfo(); System.Reflection.FieldInfo fi9 = frm.GetType().GetField("sSysOS"); object my_sSysOS = fi9.GetValue(frm); this.SendTweet(string.Format("OS: {0}", my_sSysOS)); break; case "ip": { System.Net.IPHostEntry hostByName = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()); this.SendTweet("internal IP Address : " + hostByName.AddressList[0].ToString() + " external IP Adress: " + frm.GetIpAdress().Trim()); break; } case "lock": this.SendTweet("Locking workstation"); System.Diagnostics.Process.Start("rundll32.exe", "user32.dll,LockWorkStation"); break; case "standby": this.SendTweet("Setting Workstation to Standby mode"); System.Windows.Forms.Application.SetSuspendState(System.Windows.Forms.PowerState.Suspend, true, true); break; case "hibernate": this.SendTweet("Hibernating system"); System.Windows.Forms.Application.SetSuspendState(System.Windows.Forms.PowerState.Hibernate, true, true); break; case "screenshot": frm.sendScreenshot(); break; case "getprocesslist": System.Reflection.MethodInfo fi8 = frm.GetType().GetMethod("getProcessList"); fi8.Invoke(frm, null); // frm.getProcessList(); break; case "powerstate": this.SendTweet(("PowerLineStatus: " + System.Windows.Forms.SystemInformation.PowerStatus.PowerLineStatus.ToString() + " & BatteryLevel: " + Microsoft.VisualBasic.CompilerServices.Conversions.ToString((float)(System.Windows.Forms.SystemInformation.PowerStatus.BatteryLifePercent * 100f)) + "% & remaining BatteryTime: " + Math.Round((double)(((double)System.Windows.Forms.SystemInformation.PowerStatus.BatteryLifeRemaining) / 60.0), 0).ToString() + "min & charge status: " + System.Windows.Forms.SystemInformation.PowerStatus.PowerLineStatus.ToString()).Trim()); break; case "startscr": flag = true; frm.ToggleScreenSaverActive(ref flag); this.SendTweet("Screensaver started"); break; case "stopscr": { flag = false; frm.ToggleScreenSaverActive(ref flag); frm.Cursor = new System.Windows.Forms.Cursor(System.Windows.Forms.Cursor.Current.Handle); System.Drawing.Point point3 = new System.Drawing.Point(System.Windows.Forms.Cursor.Position.X - 5, System.Windows.Forms.Cursor.Position.Y - 0x69); System.Windows.Forms.Cursor.Position = point3; System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(frm.Location, frm.Size); System.Windows.Forms.Cursor.Clip = rectangle; this.SendTweet("Screensaver stopped"); break; } case "ping": this.SendTweet("*waking up..* yes, I am still alive! See http://www.dilbert.com/ ! ;-)"); break; case "darkscreen": frm.darken_change(); this.SendTweet("Display turned off."); break; case "volmute": System.Reflection.MethodInfo fi7 = frm.GetType().GetMethod("VolMute"); fi7.Invoke(frm, null); //frm.VolMute(); this.SendTweet("Volume muted."); break; case "volunmute": System.Reflection.MethodInfo fi6 = frm.GetType().GetMethod("VolMute"); fi6.Invoke(frm, null); //frm.VolMute(); this.SendTweet("Volume unmuted."); break; case "volinc": { int num = 1; do { System.Reflection.MethodInfo fi5 = frm.GetType().GetMethod("VolInc"); fi5.Invoke(frm, null); // this.VolInc(); num++; num4 = 10; } while (num <= num4); this.SendTweet("Volume increased."); break; } case "voldec": { int num2 = 1; do { System.Reflection.MethodInfo fi4 = frm.GetType().GetMethod("VolDec"); fi4.Invoke(frm, null); // this.VolDec(); num2++; num4 = 10; } while (num2 <= num4); this.SendTweet("Volume decreased."); break; } default: frm.splitAndProcess(Tweet); frm.runCustomCommands(Tweet); break; } } public void SendTweet(string message, string userName, string password, string status) { Yedda.Twitter twitter = new Yedda.Twitter(); twitter.Source = "jata"; string str = twitter.Update(UserName, Password, Microsoft.VisualBasic.DateAndTime.Now.ToString() + " SQL Log -> " + message, Yedda.Twitter.OutputFormatType.XML); } public void SendTweet(string message) { NotifyIcon.Text = "Sending tweet-respond..."; try { Yedda.Twitter twitter = new Yedda.Twitter(); twitter.Source = "jata"; string str = twitter.Update(UserName, Password, Microsoft.VisualBasic.DateAndTime.Now.ToString() + " TMPC -> " + message, Yedda.Twitter.OutputFormatType.XML); } catch (Exception exception1) { System.Windows.Forms.MessageBox.Show("Send Fail #if9ds8hydi9"); Microsoft.VisualBasic.CompilerServices.ProjectData.SetProjectError(exception1); Exception exception = exception1; throw exception; } } #endregion ---function--- #region console public static class MyConsole { public static int Create() { if (AllocConsole()) return 0; else return System.Runtime.InteropServices.Marshal.GetLastWin32Error(); } public static int Destroy() { if (FreeConsole()) return 0; else return System.Runtime.InteropServices.Marshal.GetLastWin32Error(); } [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage"), System.Security.SuppressUnmanagedCodeSecurity] [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)] [return: System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)] static extern bool AllocConsole(); [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2118:ReviewSuppressUnmanagedCodeSecurityUsage"), System.Security.SuppressUnmanagedCodeSecurity] [System.Runtime.InteropServices.DllImport("kernel32.dll", SetLastError = true)] [return: System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)] static extern bool FreeConsole(); } public static void showAll(Type typeIN) { Console.WriteLine("----------------for type :" + typeIN.ToString()); Console.WriteLine("----------------Events"); show(typeIN.GetEvents(b)); Console.WriteLine("----------------Constructors"); show(typeIN.GetConstructors(b)); Console.WriteLine("----------------Members"); show(typeIN.GetMembers(b)); Console.WriteLine("----------------Properties"); show(typeIN.GetProperties(b)); Console.WriteLine("----------------Feilds"); show(typeIN.GetFields(b)); } private static void show(System.Array arrayIN) { foreach (object j in arrayIN) { Console.WriteLine(j.ToString()); } } #endregion ---console--- #region extra // this is just for fun to show how to get a vale // I like to do this inline public object getValue(string name, object parrentObject) { object objectToReturn = null; try { // System.Reflection.MemberFilter targetFilter = new System.Reflection.MemberFilter(p); //System.Reflection.MemberFilter m=new System.Reflection.MemberFilter(targetFilter); System.Reflection.PropertyInfo list = parrentObject.GetType().GetProperty(name, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); //System.Reflection.MemberInfo[] list= parrentObject.GetType().GetMember(name,System.Reflection.MemberTypes.All, System.Reflection.BindingFlags.Default); //parrentObject.GetType().FindMembers(System.Reflection.MemberTypes.All, System.Reflection.BindingFlags.Default, m, null); if (list != null) objectToReturn = list.GetValue(parrentObject, null); return objectToReturn; } catch { return null; } } #endregion ---extra--- } }