-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running phantap on other router models #1
Comments
Hi @s0meguy1 The idea is that you need all the data to go through the linux bridge (br-phantap) for PhanTap to work. The limitation is that your device might block tagged traffic (802.1Q), which in most case will be fine (I think most devices don't support double tagging). I have a GL-AR750S, I'll try to have a look today. |
Thanks! Let me know, I ordered one on Amazon but if it doesn't work, no worries, I can easily return it, after I do some testing trying to get it to work that is |
On a GL-AR750S-EXT
So you don't have double tagging, but if you just want to use it on a classic ethernet link without VLAN it works fine It seems there is an upstream DSA driver for this switch, https://lwn.net/Articles/646595/, so someone with more knowledge than me just need to play with the dts and that should work, and then we would not need double tagging to be able to let through tagged packets |
Thats pretty good news. Personally I do not know how big my need is for seeing VLAN traffic is, but I'll play around with it, even though attempting to do this may also be above my pay grade. It comes this weekend but I may not be able to play with it until Monday. Thanks for looking into it! |
Ok, I am not as savvy as I thought when it comes to this. How were you able to install it on the 750s? opkg didn't have it in its repos, so I tried to install generic openwrt on it (here) and it bricked it (I had to use sysupgrade -F -n ./file). I had to reflash the stock back. How did you get it working? |
Hi @s0meguy1 Sorry for the delay. GL.iNET include an easy to use recovery mode to flash again the router, maybe I had to use that, I don't remember. See the instructions here https://docs.gl-inet.com/en/2/troubleshooting/debrick/, the only difference is that the default IP of OpenWrt is 192.168.1.1 |
Yeah was able to unbrick it, I just can't get phantap installed on it. What steps did you take to get phantap running? |
What error do you have ? What image did you flash ? |
So with a fresh boot onto the AR750S, I do an opkg install phantap phantap-learn, and it cannot find the package. I tried to compile from source, however g++/gcc is not supported by openwrt. So I wasn't able to even follow the basic instructions. |
Hi, Did you do |
So initially I used the default snapshot, that failed, I did some googling and realized I needed the master, as you said. So I went here (https://downloads.openwrt.org/snapshots/targets/ath79/generic/) and downloaded the master, attempted to flash the device via the web GUI and it gave me an error. So then I ssh'ed into the device and flashed it using the CLI, with the commands: |
Now that you have the snapshot working (if I understand correctly), have you run |
Yes, I did, however I am unsure if the link I provided was the correct master. Can you confirm that is the master branch (https://downloads.openwrt.org/snapshots/targets/ath79/generic/)? |
Looks good to me yes |
You cannot use the initramfs, you need the sysupgrade file |
I think it worked! I need to confirm when I get home from work because I am not able to connect this device to my work network, but I was successfully able to flash sysupgrade! I'll let you know the results later... |
@s0meguy1 everything working now ? |
Yes! Thanks for your help - I was just trying to flash the wrong version of openWRT. I am having issues, however it has to do with the fact I have two bridges from setup and not phantap. I haven't played with it since Tues, but I tired to setup a local bride for configurations and I had install phatap, so I also had the phantap bridge. I wanted to access it via wifi while it was MiTM'ing traffic, but I more than likely misconfigured it. I believe the fact there were two bridges messed up the networking. I had planned to re-flash then try again, but work/life got in the way. Monday the 19th I plan on re-flashing, installing everything I need, then installing phantap. I report back after that |
@s0meguy1 Do you have an update for us? |
In case anyone is interested, I am planning to get phantap working on the NanoPi R1S, which has 1 true GbE interface, and one USB2->GbE interface (i.e. limited to ~300Mbps, but will still negotiate GbE with the switch). So far I have been fighting with FriendlyWrt (FriendlyArm's version of OpenWrt) to build a minimal image, but I expect it to submit soon! :-D |
Hi @RoganDawes, if you write some instructions/blog we can add a link to the README |
Will do! |
Nice idea with the NanoPi R1S! Eager to see the writeup, too :) |
I haven't really made an effort to get phantap working on it so far, I have a shell script that does the necessary quite effectively. My build is based on Armbian, though, rather than OpenWrt, purely because all the devices worked from the outset with Armbian, and I struggled for a long time to get OpenWrt working (and failed). One interesting thing, though, is that it doesn't seem necessary to patch the kernel to pass 802.1x traffic across the bridge. It just works, when I set A cute trick that I use to prevent leaking of traffic onto the target network is to put the bridge and interfaces into a network namespace. Then only processes deliberately placed in the namespace are able to access the interface. I also have a python program watching tcpdump output for ARP, DNS, and UDP/TCP packets to update the arp tables, hosts files, and routing tables. It is not currently adding a default gateway if it identifies any non-RFC1918 traffic, but that would be a very simple thing to add. It also runs dnsmasq watching the directory that I write the DNS answers to, so that the user can refer to previously observed hosts by name, without ever putting their own DNS queries onto the wire. |
It can be a challenge to get OpenWrt working on some device but you can usually find pretty good support on IRC
It's OpenWrt specific, they have a patch that block it by default, but the author of the patch doesn't remember why it was needed, so we just added a sysctl to have the normal Linux behaviour
You should validate that with a "Throwing Star LAN Tap", as for example if you don't disable ipv6, it's doing DAD (duplicate address detection) when you ifup the interface or bridge, thus leaking some info.
That's nice! |
Yeah, I have had good experience working with the OpenWrt community.
Ah, ok, makes sense.
I do disable IPv6 on the 2 interfaces, as well as the bridge. It's cheating sure, but probably not missing too much at this point.
I'm sure it could be reused, by someone who is familiar/competent with C :-D That someone is not me!!
Yeah, same with my script too. I decided to back away from choosing an IP address on the switch side to use to target the victim PC, but that is not really needed. The bash script sets up the interfaces, the bridge and the network name space, and a couple of initial iptables rules to prevent packet leakage. Then it hands over to the python script that uses
Absolutely understood. The R1S (and the AR750S for that matter) are a lot more competent devices, though. Which is not to say that having the implementation in C is a bad thing, but I prefer my script because it is hopefully a bit easier to understand from a teaching perspective. |
Still we also found some dumb typo in our script looking at the actual traffic the "Throwing Star", so I highly recommend validating with it
Don't sell yourself short, I only do C when working on OpenWrt and each time I start I have to look again value/pointer/dereference :P
Ok so not using tcpdump but pycap ? Or both ?
So we have an AR750S but on OpenWrt it's using swconfig so only 1 interface visible to OpenWrt and you need to use some vlan tricks. With the migration to DSA and hardware nat/fast path we should be able to do the same job but at line rate in the future !! |
Fair enough! I am using my 750S as my upstream so I can see any unexpected packets that the gateway emits. I'm less worried about downstream, if they smell a rat, they will probably find it hiding behind the printer! :-)
:-D
tcpdump for the very first identification of the victim, primarily because of the
Yeah, it will be great when the DSA migration is done. I really like the Slate! (https://twitter.com/RoganDawes/status/1203622183530123264) |
Just a question, could this be run on the GL-AR750S, which is gigabit? Or something a littler faster, like the MT300N?
The text was updated successfully, but these errors were encountered: