msoap / shell2http

Executing shell commands via HTTP server
MIT License
1.32k stars 129 forks source link

Support parameter transfer command #84

Closed opcache closed 1 year ago

opcache commented 1 year ago

I want to define an interface that can execute any command. The executed command is passed through the shell parameter, such as curl 127.0.0.1:8080/get? shell="df -h"

msoap commented 1 year ago

@opcache you can use -form with variables like this:

shell2http -form / 'sh -c "$v_cmd"'
curl 'http://localhost:8080/?cmd=echo+123'
opcache commented 1 year ago

@opcache you can use -form with variables like this:

shell2http -form / 'sh -c "$v_cmd"'
curl 'http://localhost:8080/?cmd=echo+123'

Oh, Thank you so much!