Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

深圳大学学子请教D版配置问题,TypeError: can't concat str to bytes #373

Open
CaesarYP opened this issue Oct 11, 2021 · 1 comment

Comments

@CaesarYP
Copy link

wireshark抓包后在线配置器conf文件如下:
server = '172.30.255.2'
username = '412264'
password = '666CaesarYP'
CONTROLCHECKSTATUS = '\x20'
ADAPTERNUM = '\x04'
host_ip = '172.24.173.94'
IPDOG = '\x01'
host_name = 'fuyumi'
PRIMARY_DNS = '192.168.1.1'
dhcp_server = '172.30.254.81'
AUTH_VERSION = '\x30\x00'
mac = 0x12c7d66c1102
host_os = 'Windows 10'
KEEP_ALIVE_VERSION = '\xdc\x02'
ror_version = False(已经试过改为True,无效)

用latest-wired-python3.py测试结果如下:
auth svr: 172.30.255.2
username: 412264
password: 666CaesarYP
mac: 0x12c7d66c110
bind ip: 0.0.0.0
[challenge] recv 0202b91d6304e10101000100f303e8f000000000ac1e299df000a8a80000e659f16700000000dc02000000000000000000000000000000000000000000000000000000000000000000000000
[DEBUG] challenge:
0202b91d6304e10101000100f303e8f000000000ac1e299df000a8a80000e659f16700000000dc02000000000000000000000000000000000000000000000000000000000000000000000000
[challenge] challenge packet sent.
Traceback (most recent call last):
File "C:\1\TOOLS\Indian WIFI\drcom-generic-master\latest-wired-python3.py", line 480, in
main()
File "C:\1\TOOLS\Indian WIFI\drcom-generic-master\latest-wired-python3.py", line 470, in main
package_tail = login(username, password, server)
File "C:\1\TOOLS\Indian WIFI\drcom-generic-master\latest-wired-python3.py", line 382, in login
packet = mkpkt(salt, usr, pwd, mac)
File "C:\1\TOOLS\Indian WIFI\drcom-generic-master\latest-wired-python3.py", line 288, in mkpkt
data += CONTROLCHECKSTATUS
TypeError: can't concat str to bytes

请求解答配置哪里有问题,谢谢!

@matlab2000
Copy link

python3 bytes 和 string有区别,从网络收到的是bytes ,CONTROLCHECKSTATUS = '\x20'是str,写成 CONTROLCHECKSTATUS = b'\x20'就是 一个字节长度的bytes,就可以加了。这个主要是python问题,很多linux自带的是python2,你这个是python3,导致字符串和bytes兼容问题

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants