-
Notifications
You must be signed in to change notification settings - Fork 786
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to run as a certain user via manual command on the Run Mon…
…key page
- Loading branch information
1 parent
1f12975
commit 0f45837
Showing
5 changed files
with
62 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 8 additions & 8 deletions
16
monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_linux_curl.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import {OS_TYPES} from '../utils/OsTypes'; | ||
|
||
|
||
export default function generateLocalLinuxCurl(ip, osType) { | ||
export default function generateLocalLinuxCurl(ip, osType, username) { | ||
let bitText = osType === OS_TYPES.LINUX_32 ? '32' : '64'; | ||
return `curl https://${ip}:5000/api/monkey/download/monkey-linux-${bitText} -k | ||
-o monkey-linux-${bitText}; | ||
chmod +x monkey-linux-${bitText}; | ||
./monkey-linux-${bitText} m0nk3y -s ${ip}:5000\`;`; | ||
let command = `curl https://${ip}:5000/api/monkey/download/monkey-linux-${bitText} -k ` | ||
+ `-o monkey-linux-${bitText}; ` | ||
+ `chmod +x monkey-linux-${bitText}; ` | ||
+ `./monkey-linux-${bitText} m0nk3y -s ${ip}:5000;`; | ||
if (username != '') | ||
command = `su - ${username} -c "${command}"`; | ||
return command; | ||
} | ||
|
||
|
||
|
13 changes: 8 additions & 5 deletions
13
monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_linux_wget.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import {OS_TYPES} from '../utils/OsTypes'; | ||
|
||
|
||
export default function generateLocalLinuxWget(ip, osType) { | ||
export default function generateLocalLinuxWget(ip, osType, username) { | ||
let bitText = osType === OS_TYPES.LINUX_32 ? '32' : '64'; | ||
return `wget --no-check-certificate https://${ip}:5000/api/monkey/download/ | ||
monkey-linux-${bitText}; | ||
chmod +x monkey-linux-${bitText}; | ||
./monkey-linux-${bitText} m0nk3y -s ${ip}:5000`; | ||
let command = `wget --no-check-certificate https://${ip}:5000/api/monkey/download/` | ||
+ `monkey-linux-${bitText}; ` | ||
+ `chmod +x monkey-linux-${bitText}; ` | ||
+ `./monkey-linux-${bitText} m0nk3y -s ${ip}:5000`; | ||
if (username != '') | ||
command = `su - ${username} -c "${command}"`; | ||
return command; | ||
} |
14 changes: 9 additions & 5 deletions
14
monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_windows_cmd.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
import {OS_TYPES} from '../utils/OsTypes'; | ||
|
||
|
||
export default function generateLocalWindowsCmd(ip, osType) { | ||
export default function generateLocalWindowsCmd(ip, osType, username) { | ||
let bitText = osType === OS_TYPES.WINDOWS_32 ? '32' : '64'; | ||
return `powershell [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}; | ||
(New-Object System.Net.WebClient).DownloadFile('https://${ip}:5000/api/monkey/download/ | ||
monkey-windows-${bitText}.exe','.\\monkey.exe'); | ||
;Start-Process -FilePath '.\\monkey.exe' -ArgumentList 'm0nk3y -s ${ip}:5000';`; | ||
let command = `powershell [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}; ` | ||
+ `(New-Object System.Net.WebClient).DownloadFile('https://${ip}:5000/api/monkey/download/ ` | ||
+ `monkey-windows-${bitText}.exe','.\\monkey.exe'); ` | ||
+ `;Start-Process -FilePath '.\\monkey.exe' -ArgumentList 'm0nk3y -s ${ip}:5000';`; | ||
|
||
if (username != '') | ||
command = `runas /user:${username} "cmd /K ${command}"`; | ||
return command; | ||
} |
13 changes: 8 additions & 5 deletions
13
...nkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_windows_powershell.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
import {OS_TYPES} from '../utils/OsTypes'; | ||
|
||
|
||
export default function generateLocalWindowsPowershell(ip, osType) { | ||
export default function generateLocalWindowsPowershell(ip, osType, username) { | ||
let bitText = osType === OS_TYPES.WINDOWS_32 ? '32' : '64'; | ||
return `[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}; | ||
(New-Object System.Net.WebClient).DownloadFile('https://${ip}:5000/api/monkey/download/ | ||
monkey-windows-${bitText}.exe','.\\monkey.exe'); | ||
;Start-Process -FilePath '.\\monkey.exe' -ArgumentList 'm0nk3y -s ${ip}:5000';`; | ||
let command = `[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}; ` | ||
+ `(New-Object System.Net.WebClient).DownloadFile('https://${ip}:5000/api/monkey/download/ ` | ||
+ `monkey-windows-${bitText}.exe','.\\monkey.exe'); ` | ||
+ `;Start-Process -FilePath '.\\monkey.exe' -ArgumentList 'm0nk3y -s ${ip}:5000';`; | ||
if (username != '') | ||
command = `Start-Process powershell.exe -ArgumentList "-noexit ${command}" -Credential ${username}`; | ||
return command; | ||
} |