Skip to content

Commit

Permalink
Removed debug data
Browse files Browse the repository at this point in the history
  • Loading branch information
mtelvers committed Aug 7, 2020
1 parent c6ea789 commit a186c89
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions ps-snmp.ps1
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@

#$data = [byte[]]@(0x3f, 130, 130, 55, 0x83, 0x1, 0x1, 0x1, 0xf)
#$data = [byte[]]@(0x3f, 130, 130, 55, 0x03, 0xf)
#$data = [byte[]]@(0x30, 0x17, 0x2, 0x1, 0x0, 0x4, 0x6, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, 0xa, 0x2, 0x2, 0x65, 0x2e, 0x2, 0x1, 0x0, 0x2, 0x1, 0x0)

#$data = [Byte[]]@(0x30, 0x27, 0x02, 0x01, 0x00, 0x04,
# 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa0, 0x1a, 0x02, 0x02, 0x65, 0x2e, 0x02, 0x01, 0x00,
# 0x02, 0x01, 0x00, 0x30, 0x0e, 0x30, 0x0c, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x05,
# 0x00, 0x05, 0x00)

#$data = [Byte[]]@(0x30, 0x30, 0x02, 0x01, 0x00, 0x04,
# 0x06, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0xa2, 0x23, 0x02, 0x02, 0x65, 0x2e, 0x02, 0x01, 0x00,
# 0x02, 0x01, 0x00, 0x30, 0x17, 0x30, 0x15, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x01, 0x05,
# 0x00, 0x04, 0x09, 0x4e, 0x50, 0x49, 0x46, 0x30, 0x30, 0x46, 0x45, 0x34)

Add-Type -TypeDefinition @"
public enum asn1tag
{
Expand Down Expand Up @@ -260,6 +246,7 @@ Function BERtoSNMP {
}
}


Function SNMPGetRequesttoBER {
Param (
[Parameter(mandatory = $true)]
Expand All @@ -286,6 +273,7 @@ Function SNMPGetRequesttoBER {
return ,$ret
}


Function EncodeBER {
Param (
[Parameter(mandatory = $true)]
Expand Down Expand Up @@ -343,20 +331,16 @@ Function EncodeBER {
return ,$bytes
}

#$x = DecodeBER $data
#$s = BERtoSNMP $x
#$s
#
#$q = SNMPGetRequesttoBER (New-Object PSObject -Property @{version=0; community="public"; pdu=0; request_id=(Get-Random -Maximum 65535); varbind=@{'1.3.6.1.2.1.1.5.0'=$null} })
#$w = EncodeBER $q
#[System.BitConverter]::ToString($w)


function Get-SNMP {
<#
.SYNOPSIS
Sends a SNMP request
.NOTES
Author: Mark Elvers
Email: [email protected]
.EXAMPLE
Get-SNMP -Server 172.29.0.89 -OIDs @('1.3.6.1.2.1.1.5.0', '1.3.6.1.2.1.1.3.0', '1.3.6.1.2.1.25.3.2.1.3.1', '1.3.6.1.2.1.43.5.1.1.17.1')
#>
Expand Down

0 comments on commit a186c89

Please sign in to comment.