Posts

Showing posts with the label ssh

How to capture Android traffic throught Wireshark

An option is connect wireshark from your pc to your android throught ssh. You can use sshdroid to enable ssh on your Android. On your computer use the following commands: mkfifo /tmp/remote wireshark -k -i /tmp/remote & ssh root@android_ip "tcpdump -s 0 -U -n -w - not port 22" > /tmp/remote Now you could see you Android traffic Enjoy it!

How to access a ssh account through ssh multihop

If you have a machineA without open ports to Internet, but you can access to it on your local network, a solution is access throught a DMZ machineB with ssh. Just use this command: ssh -t userB@machineB ssh userA@machineA Also, you can create an alias on your ~/.bashrc file: alias ssh_machineA='ssh -t userB@machineB ssh userA@machineA'  Other option, is to do it throught ProxyCommand. Add to your ~/.ssh/config file these lines: # machineA config file Host machineA Hostname machineA.com port 22 User lala # machineB config file Host machineB Hostname machineB.com port 22 user lala ProxyCommand ssh -q machineA nc -q0 machineB 22 If you run ssh, you probably you will get this message: ssh machineB nc: getaddrinfo: Name or service not known ssh_exchange_identification: Connection closed by remote host To fix it, change the last line by: ProxyCommand ssh -W %h:%p machineB Enjoy it!

Use a remote wireshark interface to sniff your smartphone traffic with tcpdump and ssh

If you want sniff your data throught your mobile device, a good option is redirect it to your pc and view it using wireshark (you can see your traffic in real time). To do this, you need download previosly a tcpdump compiled for ARM or to our arquitecture. Now these are the following steps to mount your device on the pc: adb root adb remount remount of system failed: Permission denied remount failed This is a common error. To solve it, you need run the instructions as super user: adb shell su -c mount -o rw,remount /system adb push tcpdumpt /system/xbin/ Now we need to give execution permission to tcpdump: adb shell su -c chmod 777 /system/xbin/tcpdump In Android, you can download SSHDroid to install a ssh server with port 2222 as default. Later we transfer the output to wireshark: ssh root@${ip} -p 2222 tcpdump -U -s0 -w - 'not port 2222' | wireshark -k -i - tcpdump: Can't open netlink socket 13:Permission denied Remember, give permission with su...