Fix script execution on windows #4
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "windows-fixes"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
Historia de usuario: https://ognproject.evlt.uma.es/redmine/issues/252
Levantar el agente de windows como se vio en #2 (pero instalar ogagent-1.3.3 en lugar de la 1.3.1).
Preparar script multilínea con variables:
Comprobar que el base64 es correcto:
Enviar solicitud al agente:
En el windows deberían aparecer un bloc de notas (en virtud del
Start-Process notepad.exe
), una calculadora (debido alStart-Process calc.exe
y en el filesystem debería aparecer unpath.msi
enC:\Program Files (x86)\OGAgent
. También debería haber un log, bastante crudo, enC:\users\docker\appdata\local\temp\opengnsys-subprocs.log
.WIP Fix script execution on windowsto Fix script execution on windowsFunciona
De los pasos de la PR #2 cuando ejecutas
sudo perl -MDateTime -Mojo -E 'a("/*foo" => sub { printf "%s %s %s %s\n", DateTime->now->strftime ("%Y%m%d %H%M%S%z"), $_->tx->remote_address, $_->param("foo"), $_->req->body; $_->render (text => "{}") })->start ("daemon", "-l", "https://192.168.0.37:443")'
copias el secret que te genera cuando inicias windows
Lo reemplazas en la seccion de Authorization
url --insecure -X POST --header 'Authorization: jsd5ts0echz00pdnzesg0x3zxq8lqz23' --data '{"script":"U3RhcnQtUHJvY2VzcyBub3RlcGFkLmV4ZQokdXJsID0gImh0dHBzOi8vd3d3LnB5dGhvbi5vcmcvZnRwL3B5dGhvbi8zLjEyLjMvYW1kNjQvcGF0aC5tc2kiCkludm9rZS1XZWJSZXF1ZXN0IC1VcmkgJHVybCAtT3V0RmlsZSBwYXRoLm1zaQpTdGFydC1Qcm9jZXNzIGNhbGMuZXhlCg==","client":"true"}' https://localhost:8000/opengnsys/script
y listo, te abre todo lo que venga en el script multilínea: