Using tor over ssh on virtual network - linux

I have two Machines running in VirtualBox, Ubuntu 12.04 LTS with two network adapters (NAT,Internal Network) and Kali Linux with one adapter (Internal Network). I'm also running tor ( SocksPort 9150, ControlPort 9151 ) in Ubuntu. My goal is to have access on the internet from Kali only through tor. So I used ssh port forwarding from kali to ubuntu and also configured firefox to use proxy( 127.0.0.1 - 9150)
kali~# ssh -N -L 9150:10.0.3.2:9150 root#10.0.3.1
With this command i am trying to forward all the traffic into tor.
The connection is established according to netstat and ping is working but when i try to load a page nothing happens and i keep getting the same error message on Kali's terminal
channel 2: open failed : connect failed : connection refused
Am i missing something? Do i need to open a port?
I also tried to use a SOCKS proxy with
ssh -D 9150 root#10.0.3.1
but it didn't work. Please share your thoughts with me, I am waiting for your insights.Thank you.
Internal Network Configuration:
Ubuntu:
IP:10.0.3.1
Broadcast Address:10.0.3.255
Subnet Mask:255.255.255.0
Default Route:10.0.2.2
Primary DNS:192.168.1.1
Kali:
IP:10.0.3.2
Broadcast Address:10.0.3.255
Subnet Mask:255.255.255.0
NAT Configuration:
Ubuntu
IP:10.0.2.15
Broadcast Address:10.0.2.255
Subnet Mask:255.255.255.0
Default Route:10.0.2.2
Primary DNS:192.168.1.1

Related

How to install whm,cPanel in my laptop?

I want to install whm & cpanel in my laptop. I install centOs 6.4 using oracle virtualBox as per instruction/iso in http://www.comunidadhosting.com/t/tutorial-de-como-instalar-cpanel-en-localhost.18879/.
After install it i check IP and it show me 10.0.2.15 . but my main problem is I am not able ping to guest machine from my host. When I ping from my guest to host machine then it's working fine , and host get internet access also.
I use NAT in networking.
Can any body tell me what is the problem and how to solve it ?
You need to check if you have a bridged connection OR a NAT connection with the outside host network. Both should have the same network connection and IP may be same/different.
And, if you have done this, then you need to disable the firewall on the guest-machine side so that your host machine could connect to the VM.
Your ping may then be failing because of getting blocked by the VM's firewall.

multicast traffic fails with virtualbox host only network

I have an application where it sends some multicast request to the multicast group ,
If I test my Client and Server application on two separate PC which are in same subnet it works fine .
Since I can not run always on two PCs during testing of my application, I thought of using the virtualbox to run the another OS to run my server application .
My Host is ubuntu , I installed the vitrtualbox to run the another guest os linux , and since my traffic only has to be with in the HOST and Guest , I have selected a "host only network type" .
My guest OS get the IP address but when I run my server application, It fails to join to the multicast group says
"No Such Device" .
Can someone help me to set up a network between the Guest and HOST OS ..
My main goal is to send a multicast request and it should reach the guest OS.
In VM:
ls /sys/class/net - get net devices. (lo, eth0, eth1...). You should have one lo and two eth devices.
sudo nano /etc/network/interfaces. At eth0 there is a NAT connection. Lo is a localhost. We should set the Host-Only connection. Add the following:
# The host-only network interface
auto eth1
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0
network 192.168.56.0
broadcast 192.168.56.255
(Address is taken from ipconfig/ifconfig output in host system. Instead eth1 you can have another connection name, taken from the step 4.b.i)
For checking the edited file, run:
sudo service network-manager restart
Check if you have all three connections running. Check Host-Only addresses.
ifconfig
Reboot
sudo reboot

NRPE remote host setup on amazon ec2

I have been trying to monitor a remote server using Nagios-Nrpe.
The remote host is the Amazon Ec2 instance where I have installed npre daemon on xinetd.
I have added my nagios server IP to "only-from" property in /etc/xinet.d/nrpe file.
I have added the entry in /etc/services.
I have made changes in iptables also.
I have added an entry for TCP port 5666 in my security group too.
These commands work properly:
$ netstat -at | grep nrpe
$usr/local/nagios/libexec/check_nrpe -H localhost
I have setup the nagios server and nrpe_check plugin on my local machine.
But whenever I am doing:
/usr/local/nagios/libexec/check_nrpe -H <"amazon-ec2-IP-address">
I get the following error:
connect to address <"amazon-ec2-IP-address"> port 5666: Connection refused ......
connect to host <"amazon-ec2-IP-address"> port 5666: Connection refused
I have tried making the nrpe client on another linux on my LAN and the command worked, but not for Amazon Ec2.
If anyone has the solution for this issue, please do share ASAP.
Make sure you have,
Opened up port 5666 in the Security Group linked to the EC2-instance.

Linux Debian SSH connection to another machine has delay after network settings change

Hi StackOverflow members,
I have an issue with ssh connection on my Debian 7 system to a remote OpenSSH server located on the same network. It looks like there is some network configuration problem but I cann't find where it lays. This two debian machines are connect with a switch that is NOT connected to a router. So the two machines have no internet connection.
A-Debian 7
IP: 192.168.1.2
MASK: 255.255.255.0
GW: 192.168.1.1
B-Debian 7
IP: 192.168.1.3
MASK: 255.255.255.0
GW: 192.168.1.1
With that configuration the ssh command prompts my for a password in less then a second. But the with the following network configuration I get the password prompt after a 10+ second delay:
A-Debian 7
IP: 10.10.1.83
MASK: 255.255.255.128
GW: 10.10.1.1
B-Debian 7
IP: 10.10.1.82
MASK: 255.255.255.128
GW: 10.10.1.1
The ssh connection from the server A -> B runs with both configs on custom 1111 port.
The B machine has also a Web server running on port 8080 that has no delays with both net configurations.
Thank you in advance for any clues or tips how to solve that problem.
SOLVED: Removing of the gateway parameter "GW: 10.10.1.1" in the network settings has solved the problem.
The usual culprits here are IPv6 and DNS lookups.
SSH might try to connect via IPv6, first, but the timeout is too low for that. You can see whether IPv6 is enabled with
cat /proc/sys/net/ipv6/conf/eth0/disable_ipv6
To disable:
echo 1 > /proc/sys/net/ipv6/conf/eth0/disable_ipv6
The second culprit is DNS; my guess is that DNS lookups don't work correctly with the second configuration. Try host www.google.com to test this theory.
If that also has a delay, you need to fix your DNS setup.
If that's not it, check the rest of your networking parameters: Gateway, cables, etc.
Start to ping the other host. Is that fast & reliable?
Next, try remote login (ssh, telnet). Note that you can give telnet a port to connect to, so if you have DB server running, you can still use telnet to connect to the server. It will print an error but it allows you to test the TCP/IP connection without any extra error sources.

Moving a VirtualBox .vdi Linux machine to a new host computer

I've been happily using an Ubuntu 12.04 VM as a webserver with a static IP running on VirtualBox on my Windows 7 machine for a few months (working on it from the host computer, bridged network connection, accessing via SSH from host and sharing folders through windows).
In /etc/network/interfaces, I've got:
address 192.168.1.112
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 194.168.4.100 194.168.8.100
I tried creating a new VM with it on my Win7 laptop by copying across the .vdi and creating a new VirtualBox machine with it, then changing the static IP to 192.168.1.116, but I'm not getting any network... It can't ping anything, when I try to SSH into the VM, it says "connection rejected" and it doesn't show up anywhere in my Windows network.
Can anyone shed any light?
"Perryg" on the VirtualBox forums solved it:
Edit the /etc/udev/rules.d/70-persistent-net.rules, or you can delete the rules and Linux will configure it on the next boot.
That's all there was to it.

Resources