Open xorr0 opened 5 years ago
p4wnp1 () {
echo "1" | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null
sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 172.16.0.0/30
sudo ifconfig usb0 172.16.0.2 netmask 255.255.255.252
ping -c 1 172.16.0.1 >/dev/null 2>&1
if [ $? -eq 0 ]; then
sshpass -p "toor" ssh -f root@172.16.0.1 "route add default gw 172.16.0.2 usbeth"
echo "[+] SUCCESS: access P4wnP1 via USB CDC Ethernet @ 172.16.0.1/30"
else
echo "[!] FAILURE, something went wrong"
fi
}
nop4wnp1 () { sshpass -p "toor" ssh -f root@172.16.0.1 "route del default gw 172.16.0.2 usbeth" sleep 2 echo "0" | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null sudo iptables -t nat -F POSTROUTING if [ $? -eq 0 ]; then echo "[+] SUCCESS: P4wnP1 connectivity removed" else echo "[!] FAILURE, something went wrong" fi }
Wow, good joob! We can connect us P4wnP1 to internet and works like ever? If us host is windows, what we have to do?
Thanks men :)
For Windows:
1) Enable RNDIS on P4wnP1
2) Reconfigure usbeth
to use DHCP client instead of DHCP server
3) On the Windows host enable Internet Connection Sharing (ICS) for the Network adapter which provides Internet access
4) Configure ICS to share the connection with the RNDIS adapter deployed by P4wnP1 (after attaching via USB)
Ok, i connect with my phone to 172.24.0.1, acced the web interface, goes to "Networking", selected "usbeth" and changed DHCP-SERVER to DCHP-CLIENT, pressed "DEPLOY" but...
In my W10 i can't find the network interface "Red no identificada" (spanish) --> "Unidentified network" (english). With this error we can't ICS us real w10 connection (Wifi).
I have enabled the RNDIS "USB SETTINGS"--> RNDIS (by default)
EDIT:
Ok, it works!!
When y press "DEPLOY" in your web interface, the P4wnP1 don't "tell us" nothing, but if we send a ping (P4wnP1 ssh 172.24.0.1 --> ping 8.8.8.8) we can see the packets 💃
THANKS!
Hi, I'm having a Problem with sshing into my p4wnp1 after getting dynamic ip (in my case 192.168.137.1). What i tried without success so far: -sshing into 172.16/24.0.1 couldn't reach it, neither via phone nor putty from targetmachine -sshing into 192.168.137.1 connection refused (via putty and phone) -using the discribed method on a vm ware kali linux distro -using a ethernet to usb adapter directly plugged into my router and sshing into p4p1 via phone network unreachable/ temporary nameressolve error Looking forward to hear some suggetsions on what to try next :)
btw I also tried to install software (ettercap) manually but cmake is missing and installing cmake is not working due to make not working properly XD
Hi, I'm having a Problem with sshing into my p4wnp1 after getting dynamic ip (in my case 192.168.137.1). What i tried without success so far: -sshing into 172.16/24.0.1 couldn't reach it, neither via phone nor putty from targetmachine -sshing into 192.168.137.1 connection refused (via putty and phone) -using the discribed method on a vm ware kali linux distro -using a ethernet to usb adapter directly plugged into my router and sshing into p4p1 via phone network unreachable/ temporary nameressolve error Looking forward to hear some suggetsions on what to try next :)
btw I also tried to install software (ettercap) manually but cmake is missing and installing cmake is not working due to make not working properly XD
I have the same problem.
Could you find a solution?
Thank you
A +
quick HOWTO for linux: USB networking + internet access for the p4wnp1 aloa
after connecting the p4wnp1 aloa to your computer via USB, setup your linux host computer to forward IP packets
$ echo "1" | sudo tee /proc/sys/net/ipv4/ip_forward
> /dev/null
:$ echo "1" | sudo tee /proc/sys/net/ipv4/ip_forward > /dev/null
$ sudo iptables -A POSTROUTING -t nat -j MASQUERADE -s 172.16.0.0/30
bring up the
usb#
interface (usb0
in my case) on your linux host computer$ sudo ifconfig usb0 172.16.0.2 netmask 255.255.255.252
sudo dmesg | grep cdc_ether
to see what interface got created, and/orifconfig -a
to view all your usb interfaces... for me personally, usb0 has been pretty consistent across linux distros I've used.test connectivity, ping the p4wnp1 aloa at 172.16.0.1, and you should get a successful response
$ ping 172.16.0.1
ssh to the p4wnp1 aloa at 172.16.0.1 (DEFAULT SSH PASSWORD:
toor
)$ ssh root@172.16.0.1
setup a default route on the p4wnp1 aloa back to the linux host device:
root@kali:~# route add default gw 172.16.0.2 usbeth
test connectivity via ping to the internet, you should get a successful response
/etc/resolv.conf
root@kali:~# echo "nameserver 1.1.1.1" >> /etc/resolv.conf
when finished, disable forwarding packets on your linux host computer