-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathAPI_example.py
More file actions
35 lines (25 loc) · 845 Bytes
/
API_example.py
File metadata and controls
35 lines (25 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from MalwrAPI import MalwrAPI
# Unauthenticated way, verbose mode ON
api_unauthenticated = MalwrAPI(verbose=True)
print "\nRecent domains"
res = api_unauthenticated.get_recent_domains()
print res
print "\nPublic tags"
res = api_unauthenticated.get_public_tags()
print res
print "\nRecent Analysis"
res = api_unauthenticated.get_recent_analyses()
print res
print "\nLast comments"
res = api_unauthenticated.get_latest_comments()
print res
res = api_unauthenticated.submit_sample('/tmp/test.txt')
print res
res = api_unauthenticated.submit_folder('/tmp/malware/')
print res
# Use the API the authenticated way
api_authenticated = MalwrAPI(verbose=True, username='username', password='password')
res = api_authenticated.submit_sample(filepath='/tmp/waga.exe')
print res
res = api_authenticated.search(search_word='string:kali')
print res