Percy233 / PPPoE_Simulator-for-RM2100-exploit

15 stars 4 forks source link

Crash error. #1

Open CBServices opened 4 years ago

CBServices commented 4 years ago

I'm trying to use this script to access a Redmi AC2100 router and install OpenWRT.

I'm getting an error, as soon as the router starts probing for PPPoE connection:


root@orangepiwin:\~/RedmiAC2100 OpenWRT# python pppoe-simulator.py Waiting for packets Traceback (most recent call last): File "pppoe-simulator.py", line 183, in sniff(prn=packet_callback, filter="pppoed or pppoes", lfilter=isNotOutgoing) File "/usr/lib/python2.7/dist-packages/scapy/sendrecv.py", line 620, in sniff r = prn(p) File "pppoe-simulator.py", line 63, in packet_callback for tag in pkt[PPPoED][PPPoED_Tags].tag_list: NameError: global name 'PPPoED_Tags' is not defined root@orangepiwin:~/RedmiAC2100 OpenWRT#

This is running on Debian 9.

The same thing happens in either python 2.7, or python 3.5.3

Percy233 commented 4 years ago

"PPPoED_Tags" gets imported by "from scapy.layers.ppp import *" please make sure your scapy install is up to date and maybe check if "scapy/ppp.py" contains the "class PPPoED_Tags(Packet):" definition. This script currently only works with python 3 so make sure to use the pip3 and python3 commands.

CBServices commented 4 years ago

Thanks for the response. I've done some programming, but know very little python, and diddly squat about PPPoE's internal workings.

I've checked, and no, ppp.py doesn't contain that string at all. As I stated, I'm running Debian 9.1, which is one version old for stable. It's up to date within that version, but I'll try upgrading to 10, and see if that fixes my issue. I'll let you know either way.

Thanks again.

CBServices commented 4 years ago

Ok, rather than doing a full upgrade, I just downloaded the scapy package for Python3 in Debian 10 to have a look at it first, and it doesn't have the "class PPPoED_Tags(Packet):" definition, either. But, it does have "class PPPoED_Tag(Packet):"

Singular, vs. plural. The version in Debian 9 also has this singular definition.

Is this what I'm looking for? If so, is it a typo in your script, or does Debian mess with these files and break things? (Wouldn't be the first time....)

Edit: Or is Debian 10's version still too old, and I need to get something even newer?

Edit 2: Never mind. It's "PPPoE_Tag(Packet)" in the Debian 10 version (no D), and I've checked the most recent version from the Scapy download site, and it does have the definition you're looking for. I'll check Debian testing, and if I need to just update scapy manually to the latest version, I'll do that.

Either way, I'll still let you know of my results when I'm finished.

Thanks again.

v17564 commented 3 years ago

Hello @CBServices

I use MX Linux 19.3, based on Debian 10 Buster and have the same problem.

I already found the solution to the problem, my scapy/ppp.py has not defined the variables PPPoED_Tags and PPPoED_Tag. Searching online I found that it's need the minimum version of scapy 2.4.2.

Rereading the manual I have seen it put (Ubuntu), so quoted without further clarification. I think maybe it would be advisable to clarify that it is essential to use Ubuntu - Xubuntu 20.04 LTS (at least), since it installs versions of Python 3.8.5 and Python3-scapy 2.4.3-4, with which Python programs work at first.

I installed Xubuntu 20.04 LTS on a Virtualbox machine. I proceeded to install Python and Scapy and then changed the configuration of the virtualbox network card to bridge mode, set the IP parameters in the virtual machine and the Python programs worked to the first one and so I could install Openwrt without problems.

Thanks.

Percy233 commented 3 years ago

Sadly I no longer have the hardware and environment to test the script. That's why I hesitated to edit the script. Please try the branch I just created and report back if that fixes the issue in which case I will merge the change.

v17564 commented 3 years ago

Hello @Percy233

Sadly I no longer have the hardware and environment to test the script. That's why I hesitated to edit the script. Please try the branch I just created and report back if that fixes the issue in which case I will merge the change.

The scripts working fine but in Ubuntu - Xubuntu, 20.04, i use Xubuntu in Virtualbox.

I put this message only for made a little contribution and for others users can find an answers in case that they have the same issue. I think that you only need put an advertised in the scripts.

Thanks for your work.