0.2.2 • Published 10 years ago

shrvr v0.2.2

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

Shell server

Start a web server to execute templated shell command directly.

###Usage Install

npm i shrvr -g

Writing the shell template.

alias iptable_path = /iptables/:source_ip/:port/:destination
alias delete_rule = iptables -D PREROUTING -p tcp -s #source_ip --dport #port -j DNAT --to-destination #destination
alias add_rule = iptables -A PREROUTING -p tcp -s #source_ip --dport #port -j DNAT --to-destination #destination
POST iptable_path delete_rule && add_rule && echo "delete_rule" | at now + 48hour
DELETE iptable_path delete_rule

The command on this template will forward requests from :port of :source_ip to :destination. And automatic revoke this rule after 48 hours. A valid command is:

iptable -A PREROUTING -p tcp -s 1.2.3.4 --dport 21135 -j DNAT --to-destination 192.168.2.1:8080

Start shrvr:

shrvr -t example-routes/iptable.route -p 6333 -b 192.168.1.10

Add an iptable rule via shrvr

curl -X POST http://192.168.1.10:6333/1.2.3.4/21135/192.168.2.1:8080
0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago