Ich versuche, UDP-Pakete von einem RADIUS-Server zu analysieren, und ich habe verschiedene Tools wie Scapy, Pynids und Pypcap ausprobiert. Das Problem ist, einige der Radius-Attribute werden nicht richtig dekodiert und einige von ihnen sind. Was könnte die Ursache dafür sein?Python wie RADIUS-Server-Pakete zu analysieren?
Hier ist mein Code:
from scapy.all import sniff, Radius
packets = sniff(iface='eth0', filter='udp', count=5)
packet = packets[0]
print packet.show()
Und hier ist die Zusammenfassung der Ausgabe erhalte ich:
###[ Ethernet ]###
dst = 94:57:a5:53:ab:70
src = d4:ca:6d:ae:a0:66
type = 0x800
###[ UDP ]###
sport = 38667
dport = radius
len = 205
chksum = 0x2bbd
###[ Radius ]###
code = Access-Request
id = 80
len = 197
authenticator= "T\xfb\x9c\t\x00 '\x14\xeb\x99\x84t\x9b\xb4\x83\x95"
\attributes\
|###[ Radius Attribute ]###
| type = Framed-Protocol
| len = 6
| value = '\x00\x00\x00\x01'
|###[ Radius Attribute ]###
| type = NAS-Port
| len = 6
| value = '\x00\xf6\xa7\xf9'
|###[ Radius Attribute ]###
| type = Called-Station-Id
| len = 8
| value = 'Dslam1'
|###[ Radius Attribute ]###
| type = 87
| len = 16
| value = 'ether1-Dslam 1'
|###[ Radius Attribute ]###
| type = Vendor-Specific
| len = 24
| value = '\x00\x00\x017\x0b\x12\x19\xfc4\xd01\xaf\x03\xd6\x0e!j\xa7H]\xdd;'
|###[ Radius Attribute ]###
| type = NAS-Identifier
| len = 15
| value = 'TEH-P'
Das funktionierte, aber ich bekomme die codierten Daten, wissen Sie, wie es zu entschlüsseln? – PachinSV
@PachinSV Ist der Wert nicht bereits dekodiert? Wie die Antwort, die ich aufgenommen habe? –
Ich bekomme Werte wie folgt: 80 [b '\ xac) bH \ x9c4L \ x04i \ xb2 \ x8a \ x9a ~ \ xe0 \ x95'] – PachinSV