Jump to content

[Version 1] Ninite Function


Casper

Recommended Posts

Here's a function for those who were looking for a whitehat demo. It loads up Ninite.com in IE then goes though and picks what you want installed, grabs the installer and runs it. Should only need minor changes to work in Firefox. I did IE because I figured every windows machine had it and if it's not a windows machine your not going to ninite anyway.

#define NumPrograms 81

bool InstallOptions[NumPrograms]={
                //Web Browsers
                 /*Chrome*/0,/*Safari*/0,/*Opera*/0,/*Firefox*/0,
                 //Messaging
                /*Skype*/0,/*Messenger*/0,/*Pidgin*/0,/*Digsby*/0,/*Google Talk*/0,/*Thunderbird*/0,/*AIM*/0,/*Yahoo!*/0,
                //Media
                /*iTunes*/0,/*Songbird*/0,/*Hulu*/0,/*VLC*/0,/*KMPLayer*/0,/*AIMP*/0,/*foobar2000*/0,/*Winamp*/0,/*Audacity*/0,/*K-Lite Codecs*/0,/*GOM*/0,/*Spotify*/0,/*MediaMonkey*/0,
                //Imaging
                /*Paint.NET*/0,/*Picasa*/0,/*GIMP*/0,/*IrfanView*/0,/*XnView*/0,/*Inkscape*/0,/*FastStone*/0,
                //Documents
                /*Office*/0,/*OpenOffice*/0,/*Reader*/0,/*SumatraPDF*/0,/*Foxit Reader*/0,/*CutePDF*/0,
                //Security
                /*Essentials*/0,/*Avast*/0,/*AVG*/0,/*Malwarebytes*/0,/*Ad-Aware*/0,/*Spybot*/0,/*Super*/0,
                //Runtimes
                /*Flash*/0,/*Flash (IE)*/0,/*Java*/0,/*.NET*/0,/*Silverlight*/0,/*Air*/0,
                //File Sharing
                /*uTorrent*/0,/*eMule*/0,
                //Other
                /*Dropbox*/0,/*Evernote*/0,/*Google Earth*/0,/*Steam*/0,/*KeePass*/0,/*Everything*/0,/*Mozy*/0,
                //Utilities
                /*TeamViewer*/0,/*ImgBurn*/0,/*CCleaner*/0,/*Auslogics*/0,/*Defraggler*/0,/*RealVNC*/0,/*TeraCopy*/0,/*CDBurnerXP*/0,/*Recuva*/0,/*TrueCrypt*/0,/*Revo*/0,/*Launchy*/0,
                //Compression
                /*7-Zip*/0,/*WinRAR*/0,
                //Developer Tools
                /*Python*/0,/*FileZilla*/0,/*Notepad++*/0,/*JDK*/0,/*WinSCP*/0,/*PuTTY*/0,/*Eclipse*/0
              };
void DoNinite()
{
  digitalWrite(ledpin, HIGH);
  CommandAtRunBarMSWIN("cmd /c start iexplore.exe http://ninite.com");
  delay(10000);
  //PressAndRelease(KEY_TAB,6);//Move to just before first program for firefox
  //Had to split this into a loop to add extra delay for IE.
  for (int j=0;j<14;j++)
  {
    PressAndRelease(KEY_TAB,1);//Move to just before first program for ie
    delay(100);
  }

  digitalWrite(ledpin, LOW);
  delay(100);
  digitalWrite(ledpin, HIGH);
  delay(100);
  for (int i=0;i<NumPrograms;i++)
  {
    digitalWrite(ledpin, LOW);
    PressAndRelease(KEY_TAB,1);//Move to program    
    if (InstallOptions[i]) 
      PressAndRelease(KEY_SPACE,1);//and select it   
    delay(150);    
    digitalWrite(ledpin, HIGH);
    delay(150);
  }
  PressAndRelease(KEY_TAB,1);//Move to get installer
  PressAndRelease(KEY_SPACE,1);//and select it 
  delay(5000);

  //split to help increase the delay
   for (int j=0;j<11;j++)
   {
     PressAndRelease(KEY_TAB,1);//Move to just before first program for ie
     delay(100);
   }
  PressAndRelease(KEY_ENTER,1);//and select it 
  delay(4000);
  PressAndRelease(KEY_TAB,2);//Move to run button
  PressAndRelease(KEY_SPACE,1);//and press it 
  //Verify we want to run it.
  delay(4000);
  PressAndRelease(KEY_TAB,4);//Move to run button
  PressAndRelease(KEY_SPACE,1);//and press it 
}

Just change the 0 to ones for what you want to change. I originally was going to make this use strings and compare the two arrays to make it easier to use but it was using a bit too much memory. If anyone wants to change or fix that feel free to and re-post it here.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...