Security vulnerability? Antivirus and my keylogger…

Just out of curiosity i wanted to learn how to make a key-logger… In less than 2 hours I was able to make a program that detects keystrokes and emails them to me.

At first my antivirus did pick it up, but soon I found out that was because my program was trying to  write to a file that was already open. After a minute of re-programming i fixed that hole, and now the program can run easily without being picked up by my antivirus..

Then i thought it wasn’t catching it because i was the author of the program and my antivirus (AVG Free 2011) knows that, so it doesn’t catch it on my computer, but i proved that assumption wrong by successfully running it on my net-book which is using Windows 7 starter and Microsoft security essentials.

The program is about 11kb is size and take around 5-8mb of memory to run. Most people wouldn’t bother to check Task Manager to see what process are running, and therefore not even realize its running.

Example of the email i get:

“LButton LButton ShiftKey LShiftKey T H I S Space I S Space A N Space E X A M P L E Space O F Space A Space S Back F I L E Space T H A T Space I S Space S E N T Space T O Space M E Space V I A Space E M A I L OemPeriod OemPeriod OemPeriod Space I OemQuotes M Space S U R P R I S E D Space T H A T Space N O Space A N T I V I R U S Space P R O G R A M Space H A S Space D E T E D Back C T E D Space I T Space Y E Y Back T OemPeriod OemPeriod OemPeriod Space L O O K Space M Y Space P A S W O R D Space I S ShiftKey LShiftKey OemSemicolon Space M M M A J H F C U A B C G J K ShiftKey LShiftKey D2 D7 D7 D3 J LButton LButton LButton LButton RButton LButton”

So am I missing something? Because I really don’t understand how I was able to make such a program in less than 2 hours.

Using the VLC ActiveX control in WPF

How to integrate the powerful VLC media player into your WPF application

Prerequisites:

  • Windows version of VLC Media Player with the ActiveX component installed.
  • Microsoft Visual Studio 2010 professional / Microsoft Visual C# 2010 Express (Don’t know if this method works on older versions).

Instructions:

  1. If you are not adding this to a current project then create a Visual C# > Windows > WPF Application.
  2. Add a User Control to your project (Project > Add New Item > Visual C# > User Control).
  3. Open the Toolbox (if you can’t see this: View > Toolbox).
  4. Right Click anywhere on the Toolbox then click on Choose Items. (This may take a while to open)
  5. Navigate to the COM Components tab, find and check “VideoLAN VLC ActiveX plugin v1” (axvlc.dell) and press OK.
  6. Now in your Toolbox you should see “VideoLAN VLC ActiveX plugin v1”. Double click on it and set its Dock Property to “Fill”
  7. Now save an build your project (Build > Build Solution.. or press F6)
  8. In the Solution Explorer under References you should now see “AXVLC” and “AxAXVLC”. if you don’t add them manually by right clicking on References, go into your projects debug folder and add “AxInterop.AXVLC.dll” and “Interop.AXVLC.dll”.
  9. Right clicking on References in the Solution Explorer, then Add Reference; Browse to the .NET Tab and find and select “WindowsFormsIntegration”, then press OK.
  10. Now in MainWindow.xaml (or where ever you want to add it to), Add a name to your grid (or the container)… i named mine “grid1”.
  11. From the toolbox add a WindowsFormsHost to the grid, and name it. I named mine “WFH1”  (see Figure 1)
  12. Now right click on your main window and click on View Code.
  13. Declare “AxAXVLC.AxVLCPlugin” as a global variable. (AxAXVLC.AxVLCPlugin vlcPlayer = new AxAXVLC.AxVLCPlugin();
  14. in your default constructor add the player object as the child of the WindowsFormsHost (WFH1.Child = vlcPlayer;)
  15. And that’s it! you wont see anything when you run the program, but the player is there, i will post a code snippet below so you can get a file to open and play in it (Figure 2).
  16. See http://wiki.videolan.org/ActiveX for instructions on how to use the VLC media player ActiveX Plugin.

UPDATE 16-OCT-2011: (List of Fields/Methods/Events of the Plug-in)
Here are a list of fields/methods/events that should allow you to have a lot of control over the plug-in:
Fields

  • bool AutoLoop { get; set; }
  • bool AutoPlay { get; set; }
  • bool CtlVisible { get; set; }
  • int Length { get; }
  • string MRL { get; set; }
  • bool Playing { get; }
  • int PlaylistCount { get; }
  • int PlaylistIndex { get; }
  • float Position { get; set; }
  • int Time { get; set; }
  • string VersionInfo { get; }
  • int Volume { get; set; }

Events

  • MediaPlayerBackward;
  • MediaPlayerBuffering;
  • MediaPlayerEncounteredError;
  • MediaPlayerEndReached;
  • MediaPlayerForward;
  • MediaPlayerNothingSpecial;
  • MediaPlayerOpening;
  • MediaPlayerPausableChanged;
  • MediaPlayerPaused;
  • MediaPlayerPlaying;
  • MediaPlayerPositionChanged;
  • MediaPlayerSeekableChanged;
  • MediaPlayerStopped;
  • MediaPlayerTimeChanged;
  • pauseEvent;
  • playEvent;
  • stopEvent;

Methods

  • void addTarget(string uri, object options, VLCPlaylistMode mode, int position);
  • void AttachInterfaces();
  • void CreateSink();
  • void DetachSink();
  • void fullscreen();
  • object getVariable(string name);
  • void pause();
  • void play();
  • void playFaster();
  • void playlistClear();
  • void playlistNext();
  • void playlistPrev();
  • void playSlower();
  • void setVariable(string name, object value);
  • void shuttle(int seconds);
  • void stop();
  • void toggleMute();

Figuare 1

Example of further useage:

I just added a button to my application to open allow the user to select a file and play it in the player:

[Updated 08 Oct 2012, courtesy of bielb89 from YouTube]

VLC V2.x.x.x +You will need to add “file:///” +before the Url for the file.

Figure 2.. Click on the more button to see a written version of the code.. [This Picture is outdated]

using System.Windows;
using System.Windows.Forms;

namespace WPFVLC
{
    ///
<summary> /// Interaction logic for MainWindow.xaml
 /// </summary>
    public partial class MainWindow : Window
    {
        AxAXVLC.AxVLCPlugin vlcPlayer = new AxAXVLC.AxVLCPlugin();
        public MainWindow()
        {
            InitializeComponent();
            WFH1.Child = vlcPlayer;
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            string mrl = "";
            OpenFileDialog ofd = new OpenFileDialog();
            ofd.ShowDialog();
            if (ofd.FileName != "")
            {
                mrl = ofd.FileName;
                vlcPlayer.addTarget("file:///" +mrl, null, AXVLC.VLCPlaylistMode.VLCPlayListReplaceAndGo, 0);
                vlcPlayer.play();
            }
        }
    }
}

Tutorial: Simple video player using WPF/C#

Just recorded:

AdvancedPostIt devlopment update

Progress of this project is moving much faster than i first expected.

I use what i call “Development Versions”(DevV)  to track progress on my project, DevV’s are just backups i make of the project before adding/changing large amounts of code.

Here is the progress I’ve made on the project recently:

Read more of this post

Something i’m working on..

A few weeks ago i started working on a application that i can use when working/doing assignments. The idea behind the program is simple, i needed something that can display information/pictures/videos, and will stay on top of any other applications I’m running. I don’t have a duel monitor setup, and a program such as that, will reduce the amount of ‘alt+tab’ing i do.

Last week i created a project on SourceForge. and posted something similar to a Proof of concept on TheNewBoston forums, and uploaded the project on SourceForge,(and i was surprised to find this soon after i uploaded it). Since then i didn’t have much time to work on it.

I’ve started work on the re-writing of the program, some of the new things i’m trying to achieve with it are:

  • Support for multiple images.
  • Reduce memory usage.
  • Support for video.

Here is a screen-shot after some rewriting:

I will re start working on it in about 2-3 weeks, i need to do a few other things first.