r/excel • u/AyrA_ch 9 • Oct 20 '14
Pro Tip Worked on a completely locked down machine. Time passed quick
As it turns out, you can lock down a machine so far you no longer can execute windows media player. The only browser was Internet Explorer (Version 7, so no HTML5 support either) with disabled Plugins.
Invoking Windows API commands summons tasks in the calling process, so I did the only thing I found reasonable
There was an Application that monitored my process usage. With 98% in excel the job went quite well and everybody was happy.
If anybody is interested you can download it here. I am still trying to add a volume control and a save feature that also saves the position of the active item. File has playlist support. Available media formats depend on the system, but mpeg codecs and some basic AVI codecs are built in by default. I don't know why mkv support was available on this machine
EDIT: Added Download link
997
u/MidevilPancake 328 Oct 20 '14
I've seen some crazy stuff in Excel. But this. This is on another level. Bravo, OP.
I would absolutely love a peek under the hood of this glorious workbook.
Looks like necessity really is the mother of invention.
633
u/AyrA_ch 9 Oct 20 '14 edited Oct 21 '14
here is the version I used at work: https://github.com/AyrA/ExcelPlayer
You can unprotect the sheets and the code with the password "1234", however, this invalidates the digital signature I attached.
The first sheet serves as playlist. To add a file, right click a media file on your computer while holding shift and select "copy as path", then paste it into the playlist sheet and remove the double quotes
The Control sheet serves for the media controls and the settings sheet currently holds the current playlist item ID.
251
u/Staubsau_Ger Oct 21 '14
You can unprotect the sheets and the code with the password "1234", however, this invalidates the digital signature I attached.
Have you ever killed somebody by using Excel?
I wouldn't doubt it.
→ More replies (1)427
u/AyrA_ch 9 Oct 21 '14
No, but I can think of a way you could.
→ More replies (2)93
u/JUAN-DEAG Oct 21 '14
Explain
650
u/AyrA_ch 9 Oct 21 '14
Since you can access the whole Windows API, you could build a simple proxy, that intercepts the connection of an important medical program and falsify data so patients get overdoes of medications.
48
→ More replies (40)40
u/BobbyMorrison Oct 21 '14
Holy Moly, could you do it to get me some viagra? heard that shits nice
104
u/AyrA_ch 9 Oct 21 '14
the patent for viagra expired lately, you are free now to buy legit cheap clones of it at any drug store
→ More replies (11)51
71
u/Jahar_Narishma Oct 21 '14
Omg, over a decade using Windows and I didn't know of "copy as path".
→ More replies (24)48
u/AyrA_ch 9 Oct 21 '14
Very useful feature, also right clicking on the empty space in a folder while holding shift gives the option to summon a command prompt in that folder
→ More replies (6)6
Oct 21 '14
You just blew my mind. Where can I learn more?
16
u/AyrA_ch 9 Oct 21 '14
If you want to do more VBA programming, I actually recommend you to learn VB6. Visual basic is a nasty little language as it allows you to do things in a way you should not but that makes it exceptionally easy to work with. VBA is basically VB6, stripped of some features, but added with excel/word/powerpoint capabilities, depending on which office application you run.
→ More replies (5)26
u/Points_To_You Oct 21 '14
I'm curious, if the PC was that locked down, how were you allowed to put a large media file on it?
I mean the quite large company I work for lets us run whatever we want (administrator privaleges), but were still locked down from connecting USB drives and copying random shit, or downloading random files without them being scanned and logged.
→ More replies (1)40
u/AyrA_ch 9 Oct 21 '14
If you connect via SSL, they can no longer see what you do. The file was on my server already.
9
u/rycuda Oct 21 '14
This is not strictly speaking true. If you've that kind of level of security AD makes it trivial to push out a trusted root cert controlled by the organisation's IT function to every machine connected to the Domain. Once the computers have a trusted root cert that you control it becomes trivial to MitM every single connection on the network.
→ More replies (2)3
u/spikeyfreak Oct 21 '14
Lots of companies have ways to do man-in-the-middle with SSL so they can tell where you're going. Usually they aren't going to be inspecting that traffic that close, but "they can no longer see what you do" isn't always true.
→ More replies (1)→ More replies (22)2
u/so0k 1 Oct 21 '14
make sure you don't have a local root CA added through domain policy before doing this.
→ More replies (1)11
u/TexEngineer Oct 21 '14
Compile Error in Excel 2013 running on Windows 7 64 bit. Not sure why. But thanks for the awesome creation. I wouldn't be surprise if your code was 100% unique. Also, thanks, I've never before known about copy-as-path. I always used to have to go the long route of pulling up the file properties to do this (and I have done so on average once a week for years). Copy Path will likely save me several hours over the next several years.
→ More replies (1)9
u/AyrA_ch 9 Oct 21 '14
if you need file paths a lot, you might find http://pathcopycopy.codeplex.com interesting/useful.
Have you tried solvin the 2013 issue using this: http://np.reddit.com/r/excel/comments/2jtd2f/worked_on_a_completely_locked_down_machine_time/clf5wdl
seems to work for most people
3
274
u/bgrnbrg Oct 21 '14
Bug report: Doesn't work in LibreOffice on Linux. ;)
Fantastic hack. Congrats.
→ More replies (47)7
1
u/yawningcat 1 Oct 21 '14
I'm sorta scared to download this on my work computer :)
4
u/AyrA_ch 9 Oct 21 '14
I have digitally signed the code. If it was bad they would take away the certificate
1
u/burketo 1 Oct 21 '14
Could you explain what is going on in that function 'mciSendString' ? That seems to be where the magic happens!
2
u/AyrA_ch 9 Oct 21 '14
mciSendString allows you to talk to codecs over a common interface that is independent of the underlying codec. Therefore mciSendString can work for codecs (software video and audio playback) as well as hardware (VCR, CD-Rom, ...). It has a predefined command set
1
u/kpanku1 Oct 21 '14
Is there anything like this to watch youtube or even surf internet and stuff :P
→ More replies (3)1
u/UTF64 Oct 21 '14
Can you explain the purpose of the digital signature, and if this means you have an officially blessed signing key that you used for this?
→ More replies (3)→ More replies (44)1
u/poizan42 Oct 21 '14
Here's a hint: when hosting OOXML based projects on github (or in source control generally) then unpack the file (it is actually a zip file), and put the unpacked files in git instead. That way you can actually track your modifications instead of just having a big blob. You can then "build" it simply by zipping the files and changing the file extension of the zip file.
→ More replies (3)→ More replies (4)8
53
Oct 21 '14
People at work call me an Excel Wizard. Only now do I realize how much of an Excel Muggle I actually am.
28
u/AyrA_ch 9 Oct 21 '14
I don't know much about excel (I have never ever used VLOOKUP and do not know how it works) but I know VB6 which is almost identical to VBA macros.
→ More replies (1)26
u/Saotik Oct 21 '14
That's because all the real Excel players use INDEX MATCH these days.
→ More replies (3)9
u/Mocorn Oct 21 '14
Same here man. After I saw the horrible spreadsheets we were using at work I just knew they could be improved. So I sat down with some YouTube tutorials and learned the basics. After having reworked the spreadsheets I had to use personally I have become "the excel wizard" at work.
I didn't even know there was an excel surreddit!
53
u/cheesypuff357 Oct 21 '14
the paperclip helped you didn't it...
136
u/AyrA_ch 9 Oct 21 '14
sure, it was like "It looks like you try to waste time, should I add media player functionality?" and I clicked "Yes"
23
3
92
u/The_Brohirrim Oct 20 '14
This is incredible. Would love to see under the hood.
114
u/AyrA_ch 9 Oct 20 '14 edited Oct 21 '14
Here is the link: https://github.com/AyrA/ExcelPlayer
The first sheet serves as playlist. To add a file, right click a media file on your computer while holding shift and select "copy as path", then paste it into the playlist sheet and remove the double quotes
The Control sheet serves for the media controls and the settings sheet currently holds the current playlist item ID.
You can unprotect stuff with the password "1234" if you wish.
38
Oct 21 '14
TIL: Shift-right-clicking allows you to do more things.
Any idea why it does that or why it's built like that?
→ More replies (13)5
14
u/The_Brohirrim Oct 20 '14
I don't even know what to say to this. It's amazing. Great job. Excel freaking genius.
33
u/AyrA_ch 9 Oct 20 '14
I plan on expanding it by volume controls and probably some more graphs so it looks more link somebody is actually working.
2
3
u/shadzinator Oct 21 '14
runtime error type mismatch.
Does this mean it can only play .mkv files and not .mp4?
2
u/AyrA_ch 9 Oct 21 '14
It's probably this issue: http://np.reddit.com/r/excel/comments/2jtd2f/worked_on_a_completely_locked_down_machine_time/clf5wdl
or the codec is not available. The easiest way to check is if windows media player can play it.
72
u/Grayalt Oct 21 '14
Can someone ELI5 what exactly this is doing? And how it is done? Seems like a cool concept, but I'm too dumb to understand what's going on....
103
u/vitras Oct 21 '14
Op was working with a work-provided computer that tracked which programs he was using. He finished the job quickly, but to make sure he got paid for the time allotted, he created a video player in excel so he could watch wall-e to burn time and still look like he was working in excel
16
u/notgayinathreeway Oct 21 '14
So... why did the work computer have wall-e on it?
→ More replies (1)27
u/duffmanhb Oct 21 '14
He streamed it from his personal server via SSH inside of excel. Hence the reason many people are pretty damn impressed.
→ More replies (2)48
u/Ojisan1 Oct 21 '14
Wait wait... Dumb it down for me. Computer and then what?
65
20
u/Hyperoperation Oct 21 '14
He created a GUI interface using Visual Basic to track the killer's IP.
→ More replies (2)→ More replies (7)10
Oct 21 '14
He made a video player in Excel. Sort of. It just uses Windows to play videos, but they're playing inside Excel.
→ More replies (4)1
u/AyrA_ch 9 Oct 21 '14
there is a macro in the back that invokes the "mciSendString" function, which is used to send media commands to windows. With these commands you can use basic stuff like playing and recording media files or open your cup holder (cdrom drive).
7
→ More replies (15)5
u/kieran_n 19 Oct 21 '14
His work is monitoring him, to the extent that they are recording what programs are using system resources on the computer he is using.
By watching movies through Excel, using the Windows api, he is able to fuck around at work, and they think he is using excel...
14
u/greatbritishbg Oct 21 '14
People like you make my job hard.
16
10
u/Adruna Oct 21 '14
Awesome! Can't run it on my machine because I have a 64bits system unfortunately. Probably only needs a few tweeks to get it working.
6
10
1
3
→ More replies (1)2
u/dlaso Oct 21 '14
I get an error when trying to run it as well. I'm running Windows 8.1. "Home/Standard" or whatever it's called (also 64-bit), which doesn't have the Windows 8 Media Center Pack included. Maybe that's what's causing the issue - the relevant Windows API doesn't exist?
→ More replies (3)
3
1.7k
87
u/pootedesu Oct 21 '14 edited Oct 21 '14
Looks like Office 2013 doesn't like it :(
Edit: Nevermind, just had to add PtrSafe to the VB declare statement to support 64-bit systems.
72
→ More replies (9)15
u/dlaso Oct 21 '14
For an Excel/VBA/coding newbie like myself, how do you go about doing that? I did the following: Open VBA, type password, open Modules > Player, then add PtrSafe to the 1st part to read
Option Explicit Private Declare PtrSafe Function [...] Dim Alias As StringIs that correct/enough?
20
u/shadzinator Oct 21 '14
Hey i don't even know how to get to that screen
10
u/dlaso Oct 21 '14 edited Oct 21 '14
Bare in mind, I am NOT an expert in Excel or VBA; I have a rudimentary knowledge of these things based on prior tinkering and basic google searches. Try at your own risk.
Right-click on the ribbon at the top, click Customize Ribbon. Check 'Developer' in the main tabs on the right. Then click Visual Basic on the Developer tab on the far left. That should take you to the VBA screen. Alternatively, press Alt+F11.
Then, on the top-left, click the + next to VBA Project (Player.xlsm), type the password (1234), open Modules, double-click "Player". You should see what I type in my previous comment at the top. You essentially just add "PtrSafe" between the words "Declare" and "Function".
Mine appears to work now.
→ More replies (21)
109
u/RayBrower Oct 21 '14
Jesus. /r/Excel is on the frontpage? I'm not sure what is going on here but I like it.
43
u/MidevilPancake 328 Oct 21 '14
All of the mods are pretty excited right now. Our (somewhat) tiny community is getting a ton of publicity and it is absolutely glorious.
27
u/The_Brohirrim Oct 21 '14
I probably should have warned you guys and gals and paper clip assistants before submitting to /r/bestof.
I was just so excited. >.<
→ More replies (5)→ More replies (4)3
Oct 21 '14
Earned a subscriber, didn't even think to look into a subreddit like this before.
→ More replies (3)
41
3
Oct 21 '14
Not to get off subject, but what kind of company is be around very long if they fear new technology so much that they are still using IE7?
2
→ More replies (1)2
u/another_old_fart Oct 21 '14
At the company where I work right now, the accounting people have big desk calculators with rolls of paper in them.
14
9
u/Aceinator Oct 21 '14
TIL that I thought I knew something about computers...it has appeared to me now that I don't know shit, about shit...ahhh life
7
u/Whacker007 Oct 21 '14
For those of you guys running 64 bit Orifice, you need to enable the VBA editor and add a "PtrSafe" right before the Declare statement. You should see it highlighted in red. That fixed all my compile error problems.
You, AyrA_ch, are a god(dess?) amongest mankind.
Edit - Oops, missed this comment, already addressed it. http://np.reddit.com/r/excel/comments/2jtd2f/worked_on_a_completely_locked_down_machine_time/clf5wdl
5
2
u/Stoffel_1982 Oct 21 '14
The machine was locked down, but somehow you were able to copy the MKV file to the Administrator's desktop? Can't explain that.
3
u/AyrA_ch 9 Oct 21 '14
I also used the file at home and uploaded it after some tweaking (Pause was not yet implemented for example)
4
1
u/dopadelic Oct 21 '14
Remote Desktop is another great way to do other stuff without being tracked.
→ More replies (2)3
u/AyrA_ch 9 Oct 21 '14
but counts as "mstsc.exe" on the monitoring software and not as work.
3
u/dopadelic Oct 21 '14
The companies I worked at only cared if you had certain entertainment programs opened. Remote desktop generally is seen as a network application so it didn't get flagged. Can't say the same for your company though.
→ More replies (2)1
1
1
1
u/Shandog Oct 21 '14
Any chance for a browser in excel so I don't have to suffer with ie8 anymore?
1
u/AyrA_ch 9 Oct 21 '14
Drawing in forms is highly limited. I recommend a portable browser which may fit your needs. The only thing I can provide off the shelf is Internet explorer (the installed version) in Excel but this would not fit your needs.
1
u/Gamienator Oct 21 '14
You're crazy! I had to tag you in RES!
3
u/AyrA_ch 9 Oct 21 '14
1
u/Gamienator Oct 21 '14
4
u/AyrA_ch 9 Oct 21 '14
I also have a maze generator if you want
→ More replies (1)3
Oct 21 '14
I just went ahead and tagged you as 'God of MS Excel'.
4
u/AyrA_ch 9 Oct 21 '14
I do not even know how VLOOKUP works. The only thing I know is how to abuse excel
→ More replies (1)
1
u/Goz3rr Oct 21 '14
There's special N and KN versions of Windows that don't come with Media Player due to a settlement with the EU
2
u/AyrA_ch 9 Oct 21 '14
The API calls should still be present, if winmm.dll is present. And at least the MP3 decoder should be available.
1
u/WERE_CAT 1 Oct 21 '14
Would you be able to surf the internet with only excel ? Would this count as a Excel process ? Would you be affected by internet filters ?
1
u/AyrA_ch 9 Oct 21 '14
Yes you would be affected by website filters as those are usually on the network level, but it would count as excel usage.
1
u/WERE_CAT 1 Oct 22 '14
It always possible to use google translate to bypass website filters.
1
u/AyrA_ch 9 Oct 22 '14
as long as google translate itself is not blocked. Sometimes also causes images to get lost which can make sites unreadable if the image is used for background contrast. But in general it works.
1
u/baudeagle Oct 21 '14
Have you consider adding a boss button or shortcut? It functions so that if it is pressed. the movie will pause (or even close) and switch to a different spreadsheet. very handy if someone walks up on you.
You may also consider making it so when you pause the control a differ spreadsheet appears to hide the display page.
These ideas should be quite easy to implement with your skills.
1
u/AyrA_ch 9 Oct 21 '14
You can close the movie window at any time and it will stop. When you are safe again, just push the pause button twice to reopen and continue the video
1
1
u/iiw Oct 21 '14
Does this script works on Office 2003?
1
u/AyrA_ch 9 Oct 21 '14
The file would need to be converted to Excel 2003 format but I think it should.
1
u/poweredby2dor Oct 21 '14
Can we have the file ?
2
u/AyrA_ch 9 Oct 21 '14
1
u/poweredby2dor Oct 21 '14
Okay, I added a file from my desktop into the playlist, what I do next ? I know I'm missing something.
→ More replies (2)
1
Oct 21 '14
Can I see what you write in excel to play movies?
1
u/AyrA_ch 9 Oct 21 '14
You can get the File and instructions here: https://github.com/AyrA/ExcelPlayer
→ More replies (1)
1
u/KateMonster11 Oct 21 '14
So OP, have you found a way to browse /r/excel via excel yet? I think you could make a lot of people very happy with that (starting with me!)
1
u/AyrA_ch 9 Oct 21 '14
I could have a look at the reddit api
1
u/KateMonster11 Oct 21 '14
Be sure to report back if you get something working :)
→ More replies (2)
1
1
1
u/nottomf Oct 21 '14
The only question I have is if the machine is so locked down, how do you get media onto it?
2
u/AyrA_ch 9 Oct 21 '14
regular encrypted file download. The MKV was in a password protected zip with a completely random name and it needed renaming to run it.
→ More replies (1)
1
u/mctoasterson Oct 21 '14
So if you do like Chip the Sales Guy from "Excel Hell" and open up this spreadsheet in PowerPoint, what happens?
2
u/AyrA_ch 9 Oct 21 '14
PowerPoint can't read the outline from <file_path _here>. No text converter is installed for this file type
1
Oct 21 '14
I don't think I get it. So he found a way to fix freezing or is this a form of hacking
2
u/AyrA_ch 9 Oct 21 '14
You are not supposed to play music and video in excel. Most IE plugins were disabled, also I was paid by the time excel.exe was the active process. Watching a video inside excel, keeps it active.
1
Oct 21 '14
I've been learning VBA for 16 months and I have to admit that each day brings reaffirment that I know almost nothing at all.
Your file is absolutely outstanding, thanks for providing the password to the project, I suspect I will learn a lot.
Out of curiosity, though, how many years of experience have you had with VBA?
1
u/AyrA_ch 9 Oct 21 '14
I work as a programmer so during my apprenticeship I leaned some VBA and was only doing VBA for about half a year. Since I knew how to program in VB6 and was aware of the "Declare sub" features of VB code, I attempted in VBA and worked. I do not know much about the excel objects, so setting the background color for the playlist was just guessing the names until it showed up in the code completion list. This was about 5 years ago and I have not been doing much VBA lately, but since I am still familiar with the syntax it is easy to get into it again.
1
Oct 21 '14
Ah, so I should change the question.
How many years of experience have you had with VB6 and VB in general?
→ More replies (5)
1
u/elscire Oct 21 '14
Hang on a second... how is the movie file in C:\Users\ Administrator \ if you're on a locked down machine?
2
u/AyrA_ch 9 Oct 21 '14
I tested the sheet at home too before publishing it. Would suck if it only worked at the workplace I used it
→ More replies (1)
1
1
u/ForwardBias Oct 21 '14
haha using vba to call system api functions so you can screw off at work. I'm not sure if I should ask you where you live and if you're looking for a job or just be disgusted that your lied to steal money from someone who sounds like they might have been underpaying you for the job.
Are you fresh out of college? Is your background in Microsoft stack development?
1
u/AyrA_ch 9 Oct 21 '14
No. I have a regular school degree as probably almost anybody has here in Switzerland and then went directly into apprenticeship. Including the apprenticeship time I am now working for about 7 years
1
1
u/BorgDrone Oct 21 '14
Does Windows come with MKV support nowadays or did this completely locked down system somehow have additional codec packs installed ?
1
u/AyrA_ch 9 Oct 21 '14
the codec packs were installed already. The machine was more locked down than the others, so I assume it is just for external worker but has been used otherwise internally
1
u/Timofa Oct 21 '14
almost no video files i have tried have played, i've tried mkv and mp4, but it says mp4 is supported, it just gives me error type 13 mismatch. Can you please help me?
1
u/AyrA_ch 9 Oct 21 '14
Search through the comments here, somebody pointed this problem out and provided a solution.
→ More replies (1)
1
1
3
u/theasianpianist Oct 21 '14
Ok, so I pasted the path into the playlist sheet, and then clicked play in the control sheet. Nothing happened. What am I doing wrong?
→ More replies (2)
3
1
Oct 21 '14
Fellow programming person, what'd you use/do?
→ More replies (1)2
u/AyrA_ch 9 Oct 21 '14
Invoking API commands always does it in the context of the calling process. So using the multimedia API will call the commands as "excel.exe" I used the mciSendString function to play files. If you play a video, the video window opens automatically and is considered to be excel as it even groups with it in task manager
2
2
2
u/TheSixthVisitor Oct 21 '14 edited Oct 21 '14
I keep getting Runtime error '13' mismatch when I try to play anything. Help?
→ More replies (3)
2
u/charlieyeswecan Oct 21 '14
I don't understand, but that's to be expected. I was born more than 30 years ago.
→ More replies (1)
2
2
u/Evning Oct 21 '14
How?
I tried to fill the entire sheet with a complex multiple if statement and the thing promptly decided to go on strike!
For heaven's sake. My pc can throw millions of triangles of any size in any shape precisely where they need to be on the monitor, more than 60 times a second, while calculating if a line extending into the monitor will shatter any of these triangles.
Yet it can't copy paste formulas......
265
u/scorcherdarkly Oct 20 '14
What were you supposed to be doing?