-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Davide Arcuri
committed
Oct 23, 2024
1 parent
b90df40
commit fb6d942
Showing
18 changed files
with
453 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ | |
"}\n", | ||
"\n", | ||
"req = session.post(\n", | ||
" f\"{url}/api/auth/\", data=data, cookies=first.cookies, verify=False, headers=headers\n", | ||
" f\"{url}/api/auth/\", data=data, cookies=first.cookies, headers=headers, verify=False\n", | ||
")\n", | ||
"if req.status_code != 200:\n", | ||
" print(req.text)\n", | ||
|
@@ -67,9 +67,10 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"dumps = session.get(f\"{url}/api/dumps/\").json()\n", | ||
"dumps = session.get(f\"{url}/api/dumps/\", verify=False).json()\n", | ||
"print(f\"{len(dumps)} dumps found\")\n", | ||
"pprint(dumps[0])" | ||
"if dumps: \n", | ||
" pprint(dumps[0])" | ||
] | ||
}, | ||
{ | ||
|
@@ -85,16 +86,17 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"\"\"\" TODO\n", | ||
"files = {'upload': open('/home/DATA/AMF_MemorySamples/linux/sorpresa.zip','rb')}\n", | ||
"values = {'operating_system': 'Linux', 'name': 'sorpresa'}\n", | ||
"res = session.post(f\"{url}/api/dumps/\", files=files, data=values)\n", | ||
"\n", | ||
"files = {'upload': ('sorpresa.zip', open('/home/dadokkio/Insync/[email protected]/Google Drive/Lavoro/Agusta/DATA/AMF_MemorySamples/linux/sorpresa.zip','rb'))}\n", | ||
"data = {\n", | ||
" 'payload': '{\"operating_system\": \"Linux\", \"name\": \"sorpresa\", \"folder\": {\"name\": \"linux-samples\"}}'\n", | ||
"}\n", | ||
"res = session.post(f\"{url}/api/dumps/\", files=files, data=data, cookies=first.cookies, headers=headers, verify=False)\n", | ||
"if res.status_code == 200:\n", | ||
" pprint(res.json())\n", | ||
" dump_pk = res.json()[\"pk\"]\n", | ||
" dump_pk = res.json()[\"index\"]\n", | ||
"else:\n", | ||
" print(res.status_code)\n", | ||
"\"\"\"" | ||
" print(res.status_code, res.text)" | ||
] | ||
}, | ||
{ | ||
|
@@ -110,20 +112,19 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"\"\"\" TODO\n", | ||
"# This code requires a file on the server in the folder specified in the LOCAL_UPLOAD_PATH\n", | ||
"# settings folder\n", | ||
"\n", | ||
"res = session.post(f\"{url}/api/dumps/import_local/\", files=(\n", | ||
" ('operating_system', (None, 'Linux')),\n", | ||
" ('name', (None, 'sasf3sfas33')),\n", | ||
" ('filepath', (None, '/uploads/linux/linux-sample-4.bin')),\n", | ||
" ))\n", | ||
"files = {'upload': None}\n", | ||
"data = {\n", | ||
" 'payload': '{\"operating_system\": \"Linux\", \"name\": \"remote-test\", \"folder\": {\"name\": \"linux-samples\"}, \"local_folder\": \"/uploads/sorpresa.vmem\"}'\n", | ||
"}\n", | ||
"res = session.post(f\"{url}/api/dumps/\", files=files, data=data, cookies=first.cookies, headers=headers, verify=False)\n", | ||
"if res.status_code == 200:\n", | ||
" pprint(res.json())\n", | ||
" dump_pk = res.json()[\"index\"]\n", | ||
"else:\n", | ||
" print(res.status_code)\n", | ||
"\"\"\"" | ||
" print(res.status_code, res.text)" | ||
] | ||
}, | ||
{ | ||
|
@@ -139,16 +140,41 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"res = session.get(f\"{url}/api/plugins/\")\n", | ||
"res = session.get(f\"{url}/api/plugins/\", verify=False)\n", | ||
"if res.status_code == 200:\n", | ||
" plugins = res.json()\n", | ||
" print(f\"{len(plugins)} plugins found\")\n", | ||
" pprint(plugins[0])\n", | ||
"res = session.get(f\"{url}/api/plugins/?operating_system=Other\")\n", | ||
"else:\n", | ||
" print(res.status_code, res.text) \n", | ||
"res = session.get(f\"{url}/api/plugins/?operating_system=Other\", verify=False)\n", | ||
"if res.status_code == 200:\n", | ||
" plugins = res.json()\n", | ||
" print(f\"{len(plugins)} plugins found\")\n", | ||
" pprint(plugins[0])" | ||
" pprint(plugins[0])\n", | ||
"else:\n", | ||
" print(res.status_code, res.text) " | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# GET PLUGINS FOR A SPECIFIC DUMP" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"res = session.get(f\"{url}/api/dumps/{dump_pk}/plugins\", verify=False)\n", | ||
"if res.status_code == 200:\n", | ||
" if example := res.json():\n", | ||
" print(example[0])\n", | ||
"else:\n", | ||
" print(res.status_code, res.text) " | ||
] | ||
}, | ||
{ | ||
|
@@ -164,13 +190,11 @@ | |
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"\"\"\" TODO\n", | ||
"res = session.get(f\"{url}/api/dumps/{dump_pk}/results/\")\n", | ||
"res = session.get(f\"{url}/api/dumps/{dump_pk}/plugins/{plugin_pk}/\", verify=False)\n", | ||
"if res.status_code == 200:\n", | ||
" pprint(res.json())\n", | ||
" result_pk = [x['pk'] for x in res.json() if x['plugin'] == 'linux.pslist.PsList'][0]\n", | ||
" print(res.status_code)\n", | ||
"\"\"\"" | ||
" print(res.status_code)\n" | ||
] | ||
}, | ||
{ | ||
|
@@ -267,7 +291,7 @@ | |
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "orochi", | ||
"display_name": "base", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.