Jump to content

leo

Members
  • Posts

    11
  • Joined

  • Last visited

Everything posted by leo

  1. @enaiman Great! Got it! [18]|Data Returned (clear)|Cisco IOS Software, C3750 Software (C3750-IPBASE-M), Version 12.2(35)SE5, RELEASE SOFTWARE (fc1) Copyright © 1986-2007 by Cisco Systems, Inc. Compiled Thu 19-Jul-07 19:15 by nachen [18]|Data Returned (clear)|Cisco Internetwork Operating System Software IOS s72033_rp Software (s72033_rp-PK9SV-M), Version 12.2(17d)SXB11a, RELEASE SOFTWARE (fc1) Technical Support: http://www.cisco.com/techsupport Copyright © 1986-2006 by cisco Systems, Inc. Compiled I tried to get the decoded info as below.(for Cisco devices) [0]|0|00-00-00-00-00-00|127.0.20.20|static [1]|324|00-14-6A-C0-34-C3|172.17.224.82|static [2]|324|00-00-0C-07-AC-00|172.17.224.126|dynamic Add function for extract MAC address. Func _SNMPExtractMAC($strMAC) Local $extractedMACarray[7] Local $extractedMAC = "" For $i = 1 To 6 $extractedMACarray[$i] = StringMid($strMAC, 2 * $i - 1, 2) If $i = 6 Then $extractedMAC &= $extractedMACarray[$i] Else $extractedMAC &= $extractedMACarray[$i] & "-" EndIf Next Return $extractedMAC EndFunc ;==>_SNMPExtractMAC One question: For the array SNMP, I got the info as below use your function, but I should got the above info highlight with red. I guess the reason was the function didn't continued to query. [13]|Varbind 1|3013060E2B0601020104160101007F001414020100 [14]|Length|13 [15]|OID|2B0601020104160101007F001414 [16]|Data Type|02 [17]|Data Returned (hex)|00 [18]|Data Returned (clear)|0 [19]|| [20]|Varbind 2|3018060E2B0601020104160102007F0014140406000000000000 [21]|Length|18 [22]|OID|2B0601020104160102007F001414 [23]|Data Type|04 [24]|Data Returned (hex)|000000000000 [25]|Data Returned (clear)| [26]|| [27]|Varbind 3|3016060E2B0601020104160103007F00141440047F001414 [28]|Length|16 [29]|OID|2B0601020104160103007F001414 [30]|Data Type|40 [31]|Data Returned (hex)|7F001414 [32]|Data Returned (clear)|127.0.20.20 [33]|| [34]|Varbind 4|3013060E2B0601020104160104007F001414020104 [35]|Length|13 [36]|OID|2B0601020104160104007F001414 [37]|Data Type|02 [38]|Data Returned (hex)|04 [39]|Data Returned (clear)|4
  2. @enaiman Great! Clear description! Thank you very much!
  3. @enaiman I miss the digits 81b8 of varbind length, Dec("b8")=184, and actually value length=368(184*2). Another example: .1.3.6.1.2.1.1.1.0 3082012f0201000406535a56313932a282012002045c8df0f3020100020100308201103082010c06082b0601020101010004 81ff436973636f20496e7465726e6574776f726b204f7065726174696e672053797374656d20536f667477617265200d0a49 4f532028746d29207337323033335f727020536f66747761726520287337323033335f72702d504b3953562d4d292c205665 7273696f6e2031322e3228313764295358423131612c2052454c4541534520534f4654574152452028666331290d0a546563 686e6963616c20537570706f72743a20687474703a2f2f7777772e636973636f2e636f6d2f74656368737570706f72740d0a 436f707972696768742028632920313938362d3230303620627920636973636f2053797374656d732c20496e632e0d0a436f 6d70696c656420 The digits of varbind length is 81ff, Dec("ff")=255, and actually value length=510(255*2) I don't know if varbind length & value length has such relation.
  4. @enaiman I tried to calculate the digits 81e5,81d7,81c8,81c5. Results: Dec("e5")=229;Dec("d7")=215;Dec("c8")=200;Dec("c5")=197; But total length of that character string is 464. So, I still don't understand the next 2 digits after 81.
  5. @enaiman I compared three packets as below. .1.3.6.1.2.1.1.1.0 302902010004067075626c6963a01c020434615220020100020100300e300c06082b060102010101000500 3081e502010004067075626c6963a281d70204346152200201000201003081c83081c506082b060102010101000481b84369 73636F20494F5320536F6674776172652C20433337353020536F667477617265202843333735302D4950424153452D4D292C 2056657273696F6E2031322E32283335295345352C2052454C4541534520534F4654574152452028666331290D0A436F7079 72696768742028632920313938362D3230303720627920436973636F2053797374656D732C20496E632E0D0A436F6D70696C 6564205468752031392D4A756C2D30372031393A3135206279206E616368656E .1.3.6.1.2.1.1.3.0 302902010004067075626c6963a01c020434615223020100020100300e300c06082b060102010103000500 302c02010004067075626c6963a21f0204346152230201000201003011300f06082b060102010103004303252e2a .1.3.6.1.2.1.1.5.0 302902010004067075626c6963a01c020434615226020100020100300e300c06082b060102010105000500 303002010004067075626c6963a2230204346152260201000201003015301306082b060102010105000407546573742d3832 I found the different character string is 3081 in the first packets. I don't understand why use 3081 there. Anybody know?
  6. @enaiman Nothing. I'm studying SNMP structure. Hope to get your help.
  7. @enaiman Perfect! You are great!
  8. @enaiman I amended your function for HEX to ASCII as below. Func _HexToDec ($hex) Local $extractedHEXarray [stringLen($hex) + 1] Local $extractedHEX = "" For $i = 1 To StringLen($hex) Step 2 $extractedHEXarray[$i] = StringMid($hex, $i, 2) $extractedHEX &= Chr(Dec($extractedHEXarray[$i])) Next Return $extractedHEX EndFunc Now, I need to get the position of response information. Thinking...... Studying.....
  9. @enaiman Great! I got it. 54 65 73 74 2d 38 32 But I don't know which character string I should encode from. Example: I got the response character string as below. 0x302E02010004067075626C6963A221020201000201000201003015301306082B060102010105000407546573742D3832 Now, I know that should encode from 54. But I don't know which character string as below should encode from. 0x3082010602010004067075626C6963A281F8020201000201000201003081EB3081E806082B060102010101000481DB4369 73636F20496E7465726E6574776F726B204F7065726174696E672053797374656D20536F667477617265200D0A494F532028 746D2920433337353020536F667477617265202843333735302D49392D4D292C2056657273696F6E2031322E312831392945 4131642C2052454C4541534520534F4654574152452028666331290D0A436F707972696768742028632920313938362D3230 303420627920636973636F2053797374656D732C20496E632E0D0A436F6D70696C6564204D6F6E2030352D4170722D303420 32323A343020627920616E746F6E696E6F I don't know if you understand my mean. I only want to get the encoded information. Thank you very much for your help!
  10. @enaiman Thanks for your reply. My question: I can generate SNMP packets use your function, but I can't encode the response packets. I want to get the data as below. OID: .1.3.6.1.2.1.1.1.0 Value: Cisco Internetwork Operating System Software IOS C3750 Software (C3750-I9-M), Version 12.1(19)EA1d, RELEASE SOFTWARE (fc1) Copyright © 1986-2004 by cisco Systems, Inc. Compiled Mon 05-Apr-04 22:40 by antonino or OID: .1.3.6.1.2.1.1.3.0 Value: 234 hours 18 minutes 54 seconds Now, I only get the character string. Please kinldy help me.
  11. @enaiman Thank you for all your hard work! I'm autoit new guy. Could you give me some help for Cisco switch snmp? Thank you very much!
×
×
  • Create New...