darkoperator / darkoperator/Posh-SSH
Can't pass command in a menu
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 1.1k
- Forks
- 222
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I'm working on the Cisco ISE (a network access control equipement), and i'm trying to generate a report via SSH.
i'm using this powershell script
Import-Module Posh-SSH
$password = ConvertTo-SecureString "PSSWR" -AsPlainText -Force
$credential = New-Object PSCredential ("USER", $password)
New-SSHSession -ComputerName "SERVER" -Credential $credential -AcceptKey -Verbose
$sw_ssh = Get-SSHSession -Index 0
$stream = $sw_ssh.Session.CreateShellStream("dumb", 0, 0, 0, 0, 1000)
$stream.Write("application configure ise`n")
$stream.Write("0`n")
$Response = $stream.Read()
$stream.Write("exit`n")
Remove-SSHSession -Index 0 | Out-Null
Write-Output $Response
the thing is after the application configure command this menu is prompt :
SERVER/@User# application configure ise
Selection configuration option
[1]Reset M&T Session Database
[2]Rebuild M&T Unusable Indexes
[3]Purge M&T Operational Data
[4]Reset M&T Database
[5]Refresh Database Statistics
[6]Display Profiler Statistics
[7]Export Internal CA Store
[8]Import Internal CA Store
[9]Create Missing Config Indexes
[10]Create Missing M&T Indexes
[11]Enable/Disable ACS Migration
[12]Generate Daily KPM Stats
[13]Generate KPM Stats for last 8 Weeks
[14]Enable/Disable Counter Attribute Collection
[15]View Admin Users
[16]Get all Endpoints
[17]Enable/Disable Wifi Setup
[18]Reset Config Wifi Setup
[19]Establish Trust with controller
[20]Reset Context Visibility
[21]Synchronize Context Visibility With Database
[22]Generate Heap Dump
[23]Generate Thread Dump
[24]Force Backup Cancellation
[25]CleanUp ESR 5921 IOS Crash Info Files
[26]Configure TCP params
[27]Recreate undotablespace
[28]Fetch SGA/PGA Memory usage
[0]Exit
And the script can't pass this menu, no error and no crash it's just blocked after the menu and wait for the Remove-SSHSession
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported entry points: New-SSHSession, CreateShellStream, stream.Write, stream.Read, and Remove-SSHSession. Reproduce the interactive Cisco ISE menu flow and inspect how CreateShellStream handles input and blocking reads. Done means the menu selection is submitted, its response is returned, and the SSH session can close without hanging.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100