Kaynaklar

Bu bölümde şu anda kullanılabilir olan kaynakların bir listesi ve her birinin kısa bir açıklaması bulunmaktadır.

/tasks/create/file

POST /tasks/create/file

Bir dosyayı bekleyen görevler listesine ekler. Yeni oluşturulan görevin kimliğini döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" -F file=@/path/to/file http://localhost:8090/tasks/create/file

Python kullanılan örnek request:

import requests

REST_URL = "<http://localhost:8090/tasks/create/file>"
SAMPLE_FILE = "/path/to/malwr.exe"
HEADERS = {"Authorization": "Bearer S4MPL3"}

with open(SAMPLE_FILE, "rb") as sample:
    files = {"file": ("temp_file_name", sample)}
    r = requests.post(REST_URL, headers=HEADERS, files=files)

# Add your code to error checking for r.status_code.

task_id = r.json()["task_id"]

# Add your code for error checking if task_id is None.

Örnek response:

{
    "task_id" : 1
}

Form parametreleri:

Durum kodları:

/tasks/create/url

POST /tasks/create/url

Bir dosyayı bekleyen görevler listesine ekler. Yeni oluşturulan görevin kimlik bilgilerini döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" -F url="http://www.malicious.site" http://localhost:8090/tasks/create/url

Python kullanılan örnek request:

import requests

REST_URL = "http://localhost:8090/tasks/create/url"
SAMPLE_URL = "http://example.org/malwr.exe"
HEADERS = {"Authorization": "Bearer S4MPL3"}

data = {"url": SAMPLE_URL}
r = requests.post(REST_URL, headers=HEADERS, data=data)

# Add your code to error checking for r.status_code.

task_id = r.json()["task_id"]

# Add your code to error checking if task_id is None.

Örnek response:

{
    "task_id" : 1
}

Form parametreleri:

Durum kodları:

/tasks/create/submit

POST /tasks/create/submit

Bir veya daha fazla dosyayı ve/veya arşivlere gömülü dosyaları veya yeni oluşturulan görev(ler)in görev ID'lerini içeren bir satırda ayrılmış URL/hash'lerin listesini bekleyen görevlere ekler. Gönderi ID'sini ve yeni oluşturulan görev(ler)in görev ID'lerini döndürür.

Örnek request:

# Submit two executables.
curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/create/submit -F files=@1.exe -F files=@2.exe

# Submit http://google.com
curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/create/submit -F strings=google.com

# Submit http://google.com & http://facebook.com
curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/create/submit -F strings=$'google.com\nfacebook.com'

Python kullanılan örnek request:

import requests

HEADERS = {"Authorization": "Bearer S4MPL3"}

# Submit one or more files.
r = requests.post("http://localhost:8090/tasks/create/submit", files=[
    ("files", open("1.exe", "rb")),
    ("files", open("2.exe", "rb")),
], headers=HEADERS)

# Add your code to error checking for r.status_code.

submit_id = r.json()["submit_id"]
task_ids = r.json()["task_ids"]
errors = r.json()["errors"]

# Add your code to error checking on "errors".

# Submit one or more URLs or hashes.
urls = [
    "google.com", "facebook.com", "cuckoosandbox.org",
]
r = requests.post(
    "http://localhost:8090/tasks/create/submit",
    headers=HEADERS,
    data={"strings": "\n".join(urls)}
)

Örnek response:

{
    "submit_id": 1,
    "task_ids": [1, 2],
    "errors": []
}

Form parametreleri:

Status kodları:

/tasks/list

GET /tasks/list/ (int: limit) / (int: offset)

Görevlerin listesini döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/list

Örnek response:

{
    "tasks": [
        {
            "category": "url",
            "machine": null,
            "errors": [],
            "target": "http://www.malicious.site",
            "package": null,
            "sample_id": null,
            "guest": {},
            "custom": null,
            "owner": "",
            "priority": 1,
            "platform": null,
            "options": null,
            "status": "pending",
            "enforce_timeout": false,
            "timeout": 0,
            "memory": false,
            "tags": []
            "id": 1,
            "added_on": "2012-12-19 14:18:25",
            "completed_on": null
        },
        {
            "category": "file",
            "machine": null,
            "errors": [],
            "target": "/tmp/malware.exe",
            "package": null,
            "sample_id": 1,
            "guest": {},
            "custom": null,
            "owner": "",
            "priority": 1,
            "platform": null,
            "options": null,
            "status": "pending",
            "enforce_timeout": false,
            "timeout": 0,
            "memory": false,
            "tags": [
                        "32bit",
                        "acrobat_6",
                    ],
            "id": 2,
            "added_on": "2012-12-19 14:18:25",
            "completed_on": null
        }
    ]
}

Parametreler:

Durum kodları:

/tasks/sample

GET /tasks/sample/ (int: sample_id)

Belirtilen örnek için görev listesini döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/sample/1

Örnek response:

{
    "tasks": [
        {
            "category": "file",
            "machine": null,
            "errors": [],
            "target": "/tmp/malware.exe",
            "package": null,
            "sample_id": 1,
            "guest": {},
            "custom": null,
            "owner": "",
            "priority": 1,
            "platform": null,
            "options": null,
            "status": "pending",
            "enforce_timeout": false,
            "timeout": 0,
            "memory": false,
            "tags": [
                        "32bit",
                        "acrobat_6",
                    ],
            "id": 2,
            "added_on": "2012-12-19 14:18:25",
            "completed_on": null
        }
    ]
}

Parametreler:

Durum kodları:

/tasks/view

GET /tasks/view/ (int: id)

Belirtilen ID'ye sahip görevle ilgili ayrıntıları döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/view/1

Örnek response:

{
    "task": {
        "category": "url",
        "machine": null,
        "errors": [],
        "target": "http://www.malicious.site",
        "package": null,
        "sample_id": null,
        "guest": {},
        "custom": null,
        "owner": "",
        "priority": 1,
        "platform": null,
        "options": null,
        "status": "pending",
        "enforce_timeout": false,
        "timeout": 0,
        "memory": false,
        "tags": [
                    "32bit",
                    "acrobat_6",
                ],
        "id": 1,
        "added_on": "2012-12-19 14:18:25",
        "completed_on": null
    }
}

Not: Key status için olası değerler:

Parametreler:

Durum kodları:

/tasks/reschedule

GET /tasks/reschedule/ (int: id) / (int: priority)

Belirtilen kimlik ve önceliğe sahip bir görevi yeniden planlayın (varsayılan öncelik 1'dir).

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/reschedule/1

Örnek response:

{
    "status": "OK"
}

Parametreler:

Durum kodları:

/tasks/delete

GET /tasks/delete/ (int: id)

Verilen görevi veritabanından kaldırır ve sonuçları siler.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/delete/1

Parametreler:

Durum kodları:

/tasks/report

GET /tasks/report/ (int: id) / (str: format)

Belirtilen görev kimliğiyle ilişkili raporu döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/report/1

Parametreler:

Durum kodları:

/tasks/summary

GET /tasks/summary/ (int: id)

Belirtilen görev kimliğiyle ilişkili yoğunlaştırılmış bir raporu JSON biçiminde döndürür.

Örnek request:

curl http://localhost:8090/tasks/summary/1

Parametreler:

Durum kodları:

/tasks/screenshots

GET /tasks/screenshots/ (int: id) / (str: number)

Belirtilen görev kimliğiyle ilişkili bir veya tüm ekran görüntülerini döndürür.

Örnek request:

wget http://localhost:8090/tasks/screenshots/1

Parametreler:

Durum kodları:

/tasks/rereport

GET /tasks/rereport/ (int: id)

Belirtilen görev kimliğiyle ilişkili görev için raporlamayı yeniden çalıştırın.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/rereport/1

Örnek response:

{
    "success": true
}

Parametreler:

Durum kodları:

/tasks/reboot

GET /tasks/reboot/ (int: id) **

Mevcut bir analiz kimliğinden veritabanına bir yeniden başlatma görevi ekleyin.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/tasks/reboot/1

Örnek response:

{
    "task_id": 1,
    "reboot_id": 3
}

Parametreler:

Durum kodları:

/memory/list

GET /memory/list/ (int: id)

Belirtilen görev kimliğiyle ilişkili bellek döküm dosyalarının veya bir bellek döküm dosyasının bir listesini döndürür.

Örnek request:

wget http://localhost:8090/memory/list/1

Parametreler:

Durum kodları:

/memory/get

GET /memory/get/ (int: id) / (str: number)

Belirtilen görev kimliğiyle ilişkili bir bellek döküm dosyası döndürür.

Örnek request:

wget http://localhost:8090/memory/get/1/1908

Parametreler:

Durum kodları:

/files/view

GET /files/view/md5/ (str: md5)

GET /files/view/sha256/ (str: sha256)

GET /files/view/id/ (int: id)

Belirtilen MD5 hash, SHA256 hash veya kimlikle eşleşen dosyadaki ayrıntıları döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/files/view/id/1

Örnek response:

{
    "sample": {
        "sha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
        "file_type": "empty",
        "file_size": 0,
        "crc32": "00000000",
        "ssdeep": "3::",
        "sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
        "sha512": "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e",
        "id": 1,
        "md5": "d41d8cd98f00b204e9800998ecf8427e"
    }
}

Parametreler:

Durum kodları:

/files/get

GET /files/get/ (str: sha256)

Belirtilen SHA256 hashi ile eşleşen dosyanın binary içeriğini döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/files/get/e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 > sample.exe

Durum kodları:

/pcap/get

GET /pcap/get/ (int: task)

Verilen görevle ilişkili PCAP içeriğini döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/pcap/get/1 > dump.pcap

Durum kodları:

/machines/list

GET /machines/list

Cuckoo için mevcut olan analiz makinelerinin ayrıntılarını içeren bir liste döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/machines/list

Örnek response:

{
    "machines": [
        {
            "status": null,
            "locked": false,
            "name": "cuckoo1",
            "resultserver_ip": "192.168.56.1",
            "ip": "192.168.56.101",
            "tags": [
                        "32bit",
                        "acrobat_6",
                    ],
            "label": "cuckoo1",
            "locked_changed_on": null,
            "platform": "windows",
            "snapshot": null,
            "interface": null,
            "status_changed_on": null,
            "id": 1,
            "resultserver_port": "2042"
        }
    ]
}

Durum kodları:

/machines/view

GET /machines/view/ (str: name)

Verilen adla ilişkili analiz makinesindeki ayrıntıları döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/machines/view/cuckoo1

Örnek response:

{
    "machine": {
        "status": null,
        "locked": false,
        "name": "cuckoo1",
        "resultserver_ip": "192.168.56.1",
        "ip": "192.168.56.101",
        "tags": [
                    "32bit",
                    "acrobat_6",
                ],
        "label": "cuckoo1",
        "locked_changed_on": null,
        "platform": "windows",
        "snapshot": null,
        "interface": null,
        "status_changed_on": null,
        "id": 1,
        "resultserver_port": "2042"
    }
}

Durum kodları:

/cuckoo/status

GET /cuckoo/status/

Cuckoo sunucunun durumunu döndürür. 1.3 sürümünde diskspace girişi eklenmiştir. Diskspace girişi, ilgili dizinlerin bulunduğu diskin kullanılan, boş ve toplam disk alanını gösterir. Diskspace girişi, bir Cuckoo düğümünü Cuckoo API aracılığıyla izleme olanağı sağlar. Unutulmamalıdır ki her dizin ayrı ayrı kontrol edilir, çünkü birisi $CUCKOO/storage/analyses için ayrı bir sabit diske bir sembolik bağ oluşturabilir, ancak $CUCKOO/storage/binaries'yi olduğu gibi bırakabilir. (Bu özellik yalnızca Unix altında kullanılabilir!)

1.3 sürümünde cpuload girişi de eklenmiştir - cpuload girişi, sırasıyla son bir dakika, son 5 dakika ve son 15 dakika için CPU yükünü gösterir. (Bu özellik yalnızca Unix altında kullanılabilir!)

Diskspace dizinleri:

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/cuckoo/status

Örnek response:

{
    "tasks": {
        "reported": 165,
        "running": 2,
        "total": 167,
        "completed": 0,
        "pending": 0
    },
    "diskspace": {
        "analyses": {
            "total": 491271233536,
            "free": 71403470848,
            "used": 419867762688
        },
        "binaries": {
            "total": 491271233536,
            "free": 71403470848,
            "used": 419867762688
        },
        "temporary": {
            "total": 491271233536,
            "free": 71403470848,
            "used": 419867762688
        }
    },
    "version": "1.0",
    "protocol_version": 1,
    "hostname": "Patient0",
    "machines": {
        "available": 4,
        "total": 5
    }
}

Durum kodları:

/vpn/status

GET /vpn/status

VPN durumunu döndürür.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/vpn/status

Durum kodları:

/exit

GET /exit

Hata ayıklama modundaysa ve werkzeug sunucusunu kullanıyorsa sunucuyu kapatır.

Örnek request:

curl -H "Authorization: Bearer S4MPL3" http://localhost:8090/exit

Durum kodları: