Skip to main content
Question

Nice little scripts to scope to stolen computers

  • October 23, 2014
  • 68 replies
  • 395 views

Show first post

68 replies

Forum|alt.badge.img+3
  • New Contributor
  • May 1, 2017

I have setup the stolen static group, assigned the stolen machine to the stolen static group, added the scripts and created the policy to push the scripts to the machine....My question is where will the data appear? If still fairly new to JamfPro.

Many thanks,
Allen


Forum|alt.badge.img+14
  • Valued Contributor
  • May 1, 2017

If you are using the Safari history script - it will show in the log for the Policy.


Forum|alt.badge.img+3
  • New Contributor
  • May 1, 2017

Thank you!


Forum|alt.badge.img+14
  • Honored Contributor
  • May 30, 2017

EDIT

never mind. figured it out.


Forum|alt.badge.img+4

Just implemented @bollman's location script in my JAMF instance - amazing how accurate it seems to be!

One thing to be aware of is that this script relies on wifi being enabled and actively turns it on (and then back off) if it finds it in the off state. I'm betting most users won't dig seeing their wifi turning on by itself (and then back off, which is even MORE suspicious-looking), so consider fiddling with the if statements so that, if the script finds the wifi to be on then go ahead and do "it's thing" but, if it's off, simply return a message like "WiFi was disabled during last check-in; location not acquired."

Also, reading @JayDuff's comment about hitting an OVER_QUERY_LIMIT message from Google (which makes sense, considering how much this will hammer their servers, depending on the size of your system inventory), I'm thinking you could do something like store the name of the active WiFi network as a text file in /tmp when a lookup is performed, then modify the script to first compare that to the current wifi network the NEXT time the script is accessed and only proceed with a geo-lookup if it's changed. That should minimize the amount of lookups.


Forum|alt.badge.img+8
  • Contributor
  • July 31, 2017

@ChrisJScott-work What you'd look at to see if it changed is the BSSID. You might have a WiFi network available over a large area so the SSID might not change, but the BSSID will as it's unique to each base station.


Forum|alt.badge.img+4

Great suggestion, @StoneMagnet! You kind of read my mind... one thing that would be an issue w/ my solution is that, for example, my company has offices all over the world and they all have same wifi name - any user traveling from one office to the next w/o connecting to another network would not get their location updated. Not a matter of life or death, but a hiccup.

Anyhow, your suggestion would resolve that - thanks!

One other question: the accuracy - what is that a measurement of? Feet? Meters? Smoots (https://en.wikipedia.org/wiki/Smoot)?


Forum|alt.badge.img+14
  • Honored Contributor
  • August 29, 2017

This script doesn't seem to work anymore.

I keep getting the following errors when running the script

line 40: [: -ne: unary operator expected
 (lat=, long=, acc=)

Forum|alt.badge.img+5
  • Contributor
  • August 30, 2017

I was just about to come and post the same thing as @ooshnoo I noticed the other day, I get the same error also.


Forum|alt.badge.img+14
  • Honored Contributor
  • August 31, 2017

@bollman Any thoughts on why it no worky???


ega
Forum|alt.badge.img+17
  • Valued Contributor
  • August 31, 2017

@JayDuff On the imagesnap/screencapture and logging I have used a this with ARD before:
/tmp/imagesnap - | base64 | pbcopy

The other half is pbpaste | base64 -D -o ~/Desktop/shot.jpg;open ~/Desktop/shot.jpg

One might simply pipe the base64 encode into the logs and decode as needed.


Forum|alt.badge.img+5
  • Contributor
  • August 31, 2017

Not working as 404 error from google. Looks like the API is gone


Forum|alt.badge.img+14
  • Honored Contributor
  • September 1, 2017

deleted


Forum|alt.badge.img+18
  • Valued Contributor
  • September 1, 2017

I think it's still there, they just altered it so you have to insert your API key in the URL request each time.


Forum|alt.badge.img+14
  • Honored Contributor
  • September 4, 2017

@guidotti nope. entered my API key and it still fails


Forum|alt.badge.img+11
  • Author
  • Contributor
  • October 26, 2017

I haven't gotten around to fix this, but I really need to. It's been a while, but I think I somehow "reverse-engineered" how an android phone finds out it's location with no GPS. I'd have to go back and see if I saved the info on how I got the info, heh.
I'll get back to this thread.


Forum|alt.badge.img+14
  • Honored Contributor
  • January 3, 2018

@bollman Any luck on fixing this?


Forum|alt.badge.img+4

Considering we're now trying to track down a lost system, sure am wishing this script was working!!!! Agh!!!


Nick_Gooch
Forum|alt.badge.img+9
  • Contributor
  • January 31, 2018

@ChrisJScott-work You could download and install prey if it's still checking in. https://www.preyproject.com/
There is an api key that you can use to link it to your account when it's installed. We just recently tracked down a stolen laptop with it.

#!/bin/sh

#download prey
curl -o /private/tmp/prey-mac-1.7.3-x64.pkg "https://downloads.preyproject.com/prey-client-releases/node-client/1.7.3/prey-mac-1.7.3-x64.pkg"

#Run Prey Installer
API_KEY=yourkey sudo -E installer -pkg /private/tmp/prey-mac-1.7.3-x64.pkg -target /

#Remove Temp File
rm /private/tmp/prey-mac-1.7.3-x64.pkg

exit 0

Forum|alt.badge.img+4
  • Contributor
  • January 31, 2018

Nice and thanks for sharing.

We just firmware lock the machines, and put up a desktop wallpaper that says "We're not sure how you got this machine, but it was stolen" and then do a bunch of things:
- Disable terminal.app, iTunes, updates, printers
- Set accounts to log out after 3 minutes and set a screen saver to 1 minute
- Require a new password of ridiculous requirements be set every day
- Continuously remove any admin accounts
- Limit surfing to just Bing, Google, and Yahoo
- Make everything in the dock as big as possible
- Make everything on the desktop as big as possible
- Limit all external media to read-only
- Restrict all preferences, sharing services, functionality (camera, iCloud, etc), - Hide most of the button under the Apple icon
- Enable Parental Controls and limit the computers to 90 minutes a day

@Nick_Gooch - Be aware that scripts are stored on the local machine prior to execution, and it is possible to scrape API keys for installers and JAMF API calls from any scripts deployed to a client. I'd be careful of putting such items on a stolen machine.


Nick_Gooch
Forum|alt.badge.img+9
  • Contributor
  • February 1, 2018

@Seven What is the danger of them getting the api key to prey? There is nothing in the prey account aside from the stolen computer?


Forum|alt.badge.img+4
  • Contributor
  • February 1, 2018

@Nick_Gooch - Well, it looks like prey can be a paid for service, so you'd be exposing your API creds to being stolen, which could lead to you paying for someone else to use the product.

Overall, I was just cautioning that users can see the raw content of scripts, so just a reminder to people in the thread to be careful about putting sensitive creds for licenses, accounts, or APIs in the scripts.


Nick_Gooch
Forum|alt.badge.img+9
  • Contributor
  • February 1, 2018

Thanks, I see what you are saying. I'm not to concerned in this case but could see how that could be a problem. Would putting it in as a script variable be any better?

We used the free version with the one stolen laptop we had so far. After prey was installed the police recovered it in less then an hour.


Forum|alt.badge.img+10
  • Valued Contributor
  • March 17, 2018

just looking at this but can see it still needs fixing


Forum|alt.badge.img+3
  • New Contributor
  • March 19, 2018

Install Prey, it is really worth it !
A former employee left with his work laptop and I needed a way to make sure he had the computer.
This script was not working anymore so I created a free account with prey.
The API number is at the bottom of the settings page.

Create a script in Jamf with the following content :

#!/bin/sh

#download prey
curl -o /private/tmp/prey-mac-1.7.3-x64.pkg "https://downloads.preyproject.com/prey-client-releases/node-client/1.7.3/prey-mac-1.7.3-x64.pkg"

#Run Prey Installer
API_KEY=CHANGETHIS sudo -E installer -pkg /private/tmp/prey-mac-1.7.3-x64.pkg -target /

#Remove Temp File
rm /private/tmp/prey-mac-1.7.3-x64.pkg

exit 0

Scope it to the Mac you are looking for.
You can "monitor" 3 computers at once with the free version of prey.
as soon as prey is installed, you will receive a mail alert, put the computer in lost mode in prey and wait for the location and screenshots form the isight camera + desktop, to populate reports.

Enjoy !