fire-marshal-ebay 0.0.1-security.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of fire-marshal-ebay might be problematic. Click here for more details.
- package/PadBuster/LICENSE +202 -0
- package/PadBuster/README +16 -0
- package/PadBuster/padBuster.pl +889 -0
- package/confused/.github/workflows/codeql-analysis.yml +67 -0
- package/confused/.github/workflows/golangci-lint.yml +28 -0
- package/confused/.goreleaser.yml +40 -0
- package/confused/CHANGELOG.md +31 -0
- package/confused/LICENSE +21 -0
- package/confused/README.md +93 -0
- package/confused/composer.go +105 -0
- package/confused/confused +0 -0
- package/confused/interfaces.go +11 -0
- package/confused/main.go +104 -0
- package/confused/mvn.go +120 -0
- package/confused/mvnparser.go +139 -0
- package/confused/npm.go +210 -0
- package/confused/packages.json +86 -0
- package/confused/pip.go +99 -0
- package/confused/util.go +11 -0
- package/index.js +47 -0
- package/package.json +9 -4
- package/synackAPI/Dockerfile +36 -0
- package/synackAPI/README.md +238 -0
- package/synackAPI/RHINOSPIDER/burpOOS.txt +25 -0
- package/synackAPI/RHINOSPIDER/burpScope.txt +1 -0
- package/synackAPI/RHINOSPIDER/scope.txt +1 -0
- package/synackAPI/bot.py +72 -0
- package/synackAPI/checkCerts.py +67 -0
- package/synackAPI/connect.py +9 -0
- package/synackAPI/currentTarget +24 -0
- package/synackAPI/getAnalytics.py +40 -0
- package/synackAPI/getHydra.py +46 -0
- package/synackAPI/getPayouts.py +11 -0
- package/synackAPI/getscope.py +123 -0
- package/synackAPI/polling.py +27 -0
- package/synackAPI/register.py +7 -0
- package/synackAPI/requirements.txt +7 -0
- package/synackAPI/synack.py +1046 -0
- package/synackAPI/synstats.py +54 -0
- package/synackAPI/target.py +17 -0
- package/README.md +0 -5
@@ -0,0 +1,238 @@
|
|
1
|
+
# Library for interacting with Synack API
|
2
|
+
This is a library and set of scripts that make SRT life a little easier when interacting with the platform from a linux commandline.
|
3
|
+
* Connect to platform
|
4
|
+
* Stay connected to the platform
|
5
|
+
* Register available targets
|
6
|
+
* Connect to targets
|
7
|
+
* Download targets' scope
|
8
|
+
* Retrieve analytics from `Web Application` and `Host` targets
|
9
|
+
* Download hydra findings
|
10
|
+
* Retrieve target specific information:
|
11
|
+
* Client names
|
12
|
+
* Codenames
|
13
|
+
* Slugs
|
14
|
+
* Target types
|
15
|
+
* Enable mission-claiming bots
|
16
|
+
* Manage notifications
|
17
|
+
|
18
|
+
# Acknowledgements
|
19
|
+
Thank you Malcolm, Nicolas, and pmnh for making this better!
|
20
|
+
|
21
|
+
# Configuration requirements
|
22
|
+
## Operating System
|
23
|
+
This has been developed on Linux. I have no idea if it will work on Windows. It might, but your mileage may vary. I do not use windows. If you do, and you want to test, please do.
|
24
|
+
|
25
|
+
## Configuration Directories
|
26
|
+
The required directory is `~/.synack`.
|
27
|
+
|
28
|
+
## synack.conf
|
29
|
+
This is a required config file, and is expected to be in the directory ~/.synack/
|
30
|
+
```
|
31
|
+
[DEFAULT]
|
32
|
+
login_wait = 15
|
33
|
+
login_url = https://login.synack.com
|
34
|
+
email = your.email@domain.tld
|
35
|
+
password = your.synack.password
|
36
|
+
authy_secret = ABCDEFGHIJKLMNOPQRSTUVWXYZ======
|
37
|
+
webhook_url = https://hooks.slack.com/services/...
|
38
|
+
```
|
39
|
+
* login_wait
|
40
|
+
* Number of seconds to wait for the platform's website to be loaded before attempting to log in. Can take a while.
|
41
|
+
* login_url
|
42
|
+
* This should stay as is, unless Synack changes something
|
43
|
+
* email
|
44
|
+
* The email address you use to log into the platform
|
45
|
+
* password
|
46
|
+
* The password you use to log into the platform
|
47
|
+
* authy_secret
|
48
|
+
* base32 secret for generating Authy tokens
|
49
|
+
* Guillaume Boudreau provide a nice [walk through](https://gist.github.com/gboudreau/94bb0c11a6209c82418d01a59d958c93) for getting this secret
|
50
|
+
* Follow the above to get Authy into debug mode, then use [THIS CODE](https://gist.github.com/louiszuckerman/2dd4fddf8097ce89594bb33426ab5e23#ok-thats-nice-but-i-want-to-get-rid-of-authy-now) to get your valid TOTP SECRET!
|
51
|
+
* webhook_url is the incoming webhook url for slack notifications. This will be used from the bot.py to inform you about obtained missions in real time. To create one simply visit https://api.slack.com/apps?new_app=1 and create an app to add later an incoming webhook into it. You can choose any workspace to do so.
|
52
|
+
* gecko true/false (default true) - if false, the `requests` module will be used for the login flow, instead of the geckodriver (works well on Windows)
|
53
|
+
* proxy true/false (default false) - if true, route requests through a local proxy for debugging
|
54
|
+
* proxyport (default 8080) - local proxy port used for debugging
|
55
|
+
* session_token_path (default /tmp/synacktoken) - location to store synack token
|
56
|
+
* notification_token_path (default /tmp/notificationtoken) - location to store notification token
|
57
|
+
|
58
|
+
## requirements.txt
|
59
|
+
Your best bet to have all required python3 modules is to run `pip3 install -r requirements.txt`. I cannot help troubleshoot any other modules.
|
60
|
+
|
61
|
+
## geckodriver
|
62
|
+
You must install [geckodriver](https://github.com/mozilla/geckodriver/) and it must be in your $PATH (note, this is currently true even if you have `gecko` set to `False` in the config file)
|
63
|
+
|
64
|
+
# Synack API python3 module
|
65
|
+
|
66
|
+
This python3 module provides a class to create objects for interacting with the Synack LP/LP+ platform.
|
67
|
+
<br>Basic use:
|
68
|
+
```
|
69
|
+
from synack import synack
|
70
|
+
|
71
|
+
s1 = synack()
|
72
|
+
s1.getSessionToken()
|
73
|
+
s1.getAllTargets()
|
74
|
+
```
|
75
|
+
## synack()
|
76
|
+
This method creates an object that can be used to interact with the LP/LP+ platform.
|
77
|
+
|
78
|
+
## connectToPlatform()
|
79
|
+
This method is used to connect to the Synack platform and writes the session token to disk using requests or Gecko.
|
80
|
+
|
81
|
+
## connectToPlatformrequests()
|
82
|
+
This method
|
83
|
+
|
84
|
+
## connectToPlatformGecko()
|
85
|
+
### SSL Certificates
|
86
|
+
This method will create the directory `~/.synack/selenium.profile`. The first time connecting to the SRT Platform, you will be asked to install the cacert.crt file. This allows the cert to be permanently stored and used with geckodriver.
|
87
|
+
|
88
|
+
## getSessionToken()
|
89
|
+
This method reads a file disk location of `synack.tokenPath` and stores the file contents into the `synack.token` variable. If the file does not contain a valid Synack platform authentication token, the rest of this library will not work.
|
90
|
+
|
91
|
+
## getAllTargets()
|
92
|
+
This method pulls down a descriptive JSON on all targets. Most other methods rely on this JSON and should normally be the second function method called.
|
93
|
+
|
94
|
+
## getAssessments()
|
95
|
+
This method returns a list of all Synack assessments that have been completed.
|
96
|
+
|
97
|
+
## getCodenames(category, mission_only=False)
|
98
|
+
This method takes two parameters and returns a list of codenames.
|
99
|
+
|
100
|
+
### parameters:
|
101
|
+
* category `STRING` defines the type of target you're looking for and must be one of the following:
|
102
|
+
* "web application"
|
103
|
+
* "host"
|
104
|
+
* "mobile"
|
105
|
+
* "source code"
|
106
|
+
* "reverse engineering"
|
107
|
+
* "hardware"
|
108
|
+
* mission_only `BOOLEAN`
|
109
|
+
* True: returns targets that only allow SV2M missions
|
110
|
+
* False: returns targets that are NOT SV2M only.
|
111
|
+
|
112
|
+
## clientName(codename)
|
113
|
+
This method takes the target codename and returns the client's true name.
|
114
|
+
|
115
|
+
## connectToTarget(codename)
|
116
|
+
This method takes a target codename and connects to it.
|
117
|
+
|
118
|
+
## getCategory(codename)
|
119
|
+
This method takes a target codename and returns what type of assessment the target requires.
|
120
|
+
|
121
|
+
## getTargetID(codename)
|
122
|
+
This method takes a target codename and returns the project slug. This method is generally not used by end users, but rather supports other function methods.
|
123
|
+
|
124
|
+
## getCodenameFromSlug(slug)
|
125
|
+
This method takes a project slug and returns the target codename. This method is generally not used by end users, but rather supports other function methods.
|
126
|
+
|
127
|
+
## getCurrentTargetSlug()
|
128
|
+
This method returns the slug of whatever target you are connected to. If not connected to a target, this will return `None`.
|
129
|
+
|
130
|
+
## getScope(codename)
|
131
|
+
This method takes a codename and returns its scope as a list of dicts.
|
132
|
+
* `Host` targets return the CIDR notation ranges
|
133
|
+
* `Web Application` targets return the expanded list of rules:
|
134
|
+
* scheme: (http || https)
|
135
|
+
* netloc: the "domain" part of the url
|
136
|
+
* path: the path of the url
|
137
|
+
* wildcard: if the **subdomain** of the url is a wildcard, not the path
|
138
|
+
|
139
|
+
```
|
140
|
+
https://www.example.com/*
|
141
|
+
*.example.com/path/*
|
142
|
+
|
143
|
+
[
|
144
|
+
{
|
145
|
+
'scheme': 'https',
|
146
|
+
'netloc': 'www.example.com',
|
147
|
+
'path': '/*',
|
148
|
+
'wildcard': False
|
149
|
+
},
|
150
|
+
{
|
151
|
+
'scheme': '',
|
152
|
+
'netloc': 'example.com',
|
153
|
+
'path': '/path/*',
|
154
|
+
'wildcard': True
|
155
|
+
}
|
156
|
+
]
|
157
|
+
```
|
158
|
+
|
159
|
+
## registerAll()
|
160
|
+
This method registers all unregistered targets
|
161
|
+
<br>**Thanks Ozgur for most of the leg work :)**
|
162
|
+
|
163
|
+
## getAnalytics(codename, status)
|
164
|
+
This method takes a codename and status `accepted | rejected | in_queue | all` and returns a list of all endpoints reported in that target's `Analytics` tab.
|
165
|
+
|
166
|
+
## getHydra(codename)
|
167
|
+
This method takes a codename and returns a json of all hydra reported in that target's `Hydra` tab.
|
168
|
+
|
169
|
+
## getRoes(slug):
|
170
|
+
This method takes a target slug and returns any additional rules of engagement as a list.
|
171
|
+
|
172
|
+
## pollMissions()
|
173
|
+
This method polls the API for available missions and returns a json to send to `claimMission(missionJson)`
|
174
|
+
|
175
|
+
## claimMission(missionJson)
|
176
|
+
This method takes a json from the pollMission() function and attempts to claim available missions based on dollar value, highest to lowest. The return value is a list of dicts in the format:
|
177
|
+
```
|
178
|
+
[
|
179
|
+
{
|
180
|
+
'target': 'Target Name',
|
181
|
+
'payout': '20',
|
182
|
+
'claimed': False
|
183
|
+
}
|
184
|
+
]
|
185
|
+
```
|
186
|
+
|
187
|
+
## getNotificationToken()
|
188
|
+
This method is used to obtain the bearer token used to authenticate to the notifications.synack.com API.
|
189
|
+
|
190
|
+
## markNotificationsRead()
|
191
|
+
This method marks all notifications as read.
|
192
|
+
|
193
|
+
## pollNotifications()
|
194
|
+
This method retrieves all unread notifications and returns a list of dicts with the following fields:
|
195
|
+
```
|
196
|
+
{
|
197
|
+
"id": INT, # ID of the notifications
|
198
|
+
"user_id": INT, # Your synack ID (integer)
|
199
|
+
"subject": "STRING", # Codename, dollar amount of transfer, etc..
|
200
|
+
"subject_type": "STRING", # What is this? listing update, cashout, etc..
|
201
|
+
"action": "STRING", # What is the action: outage_starts, scope, etc..
|
202
|
+
"url": "STRING", # Relevant URL path
|
203
|
+
"created_at": "DATETIME",
|
204
|
+
"read": BOOL, # true/false
|
205
|
+
"meta": {
|
206
|
+
# All sorts of other stuff
|
207
|
+
}
|
208
|
+
}
|
209
|
+
```
|
210
|
+
|
211
|
+
## getVulns(status="accepted")
|
212
|
+
This method takes either zero or single parameter (status) and returns a list of all vulns you've submitted. The `status` parameter could be either
|
213
|
+
* accepted (default)
|
214
|
+
* rejected
|
215
|
+
|
216
|
+
## getVuln(identifier)
|
217
|
+
This method takes a vulnerability identifier, e.g. CODENAME-###, as a parameter and returns a dict with all details of the vulnerability.
|
218
|
+
|
219
|
+
## getDrafts()
|
220
|
+
This method returns a list of dictionaries containing data for each draft vulnerability.
|
221
|
+
|
222
|
+
## deleteDraft(id)
|
223
|
+
This method takes a draft vulnerability identifier (integer value) as a parameter and deletes the draft vulnerability.
|
224
|
+
|
225
|
+
## getTransactions()
|
226
|
+
This method returns all cashout transactions as list.
|
227
|
+
|
228
|
+
## Docker setup
|
229
|
+
There are few ways to run the module under docker, the fastest way will be to obtain it directly and run it using <br>
|
230
|
+
```docker run -d --name synackapi --dns 8.8.8.8 --rm -v ~/.synack:/root/.synack krasn/synackapi```<br>
|
231
|
+
The above will run the docker directly under the name synackapi and will use your synack.conf as it's configured per above instructions. The default mode of the docker will be to stay on the background and poll for new targets every hour which will accept.
|
232
|
+
<br>
|
233
|
+
To run the missions bot an idea will be to run the docker with the following method:<br>
|
234
|
+
```docker run -ti --name synackapi --dns 8.8.8.8 --rm -v ~/.synack:/root/.synack krasn/synackapi python3 bot.py```<br>
|
235
|
+
or if it's already running <br>
|
236
|
+
```docker exec -ti synackapi krasn/synackapi python3 bot.py```<br>
|
237
|
+
* Notes ** If would like to build the docker from scratch instructions are on Dockerfile, you will additionally need to modify synack.conf file and set `self.headless = True`
|
238
|
+
* To simply pull the docker image and do nothing you can always use ```docker pull krasn/synackapi```
|
@@ -0,0 +1,25 @@
|
|
1
|
+
refacing\.homedepot\.com/
|
2
|
+
careers\.homedepot\.com/
|
3
|
+
(.*\.|)www\.thecompanystore\.com\/*
|
4
|
+
(.*\.|)sam-v1\.fit\.homedepot\.com\/*
|
5
|
+
(.*\.|)corporate\.homedepot\.com\/*
|
6
|
+
(.*\.|)ir\.homedepot\.com\/*
|
7
|
+
(.*\.|)thdloan\.greenskycredit\.com\/*
|
8
|
+
(.*\.|)careers\.homedepot\.com\/*
|
9
|
+
(.*\.|)hdmoving\.com\/*
|
10
|
+
(.*\.|)sam-v2\.fit\.homedepot\.com\/*
|
11
|
+
(.*\.|)www\.homedepot\.ca\/*
|
12
|
+
(.*\.|)refacing\.homedepot\.com\/*
|
13
|
+
(.*\.|)www\.homedepot\.com\.mx\/*
|
14
|
+
(.*\.|)homedepotmeasures\.com\/*
|
15
|
+
(.*\.|)measurecomp\.com\/*
|
16
|
+
(.*\.|)ecooptions\.homedepot\.com\/*
|
17
|
+
(.*\.|)www\.proreferral\.com\/*
|
18
|
+
(.*\.|)citiretailservices\.citibankonline\.com\/*
|
19
|
+
(.*\.|)www\.retailservicescommercial\.citi\.com\/*
|
20
|
+
(.*\.|)homedepot\.cashstar\.com\/*
|
21
|
+
(.*\.|)homedepot\.egifter\.com\/*
|
22
|
+
(.*\.|)sam\.fit\.homedepot\.com\/*
|
23
|
+
(.*\.|)www\.homedepot\.com\/services\/i\/homedepot-measures-b\/1d547910d\/form\/*
|
24
|
+
(.*\.|)www\.blinds\.com\/*
|
25
|
+
(.*\.|)www\.thdloanonline\.com\/*
|
@@ -0,0 +1 @@
|
|
1
|
+
(.*\.|)homedepot\.com\/*
|
@@ -0,0 +1 @@
|
|
1
|
+
homedepot.com/*
|
package/synackAPI/bot.py
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
from synack import synack
|
3
|
+
import time
|
4
|
+
|
5
|
+
|
6
|
+
###### PLEASE READ THIS FIRST #####
|
7
|
+
## This is the URL you must read ##
|
8
|
+
## before using a bot. It gives ##
|
9
|
+
## you the maximum API requests ##
|
10
|
+
## allowed. If you exceed the 5- ##
|
11
|
+
## minute maximum, you are at ##
|
12
|
+
## risk for being removed from ##
|
13
|
+
## the platform in its entirety. ##
|
14
|
+
## ##
|
15
|
+
## IT IS ADVISED THAT YOU DO NOT ##
|
16
|
+
## POLL MORE THAN ONCE EVERY 10 ##
|
17
|
+
## SECONDS!!! PLEASE REVIEW THE ##
|
18
|
+
## HELP CENTER ARTICLE! ##
|
19
|
+
## ##
|
20
|
+
|
21
|
+
## https://support.synack.com/hc/en-us/articles/1500002201401-Mission-Automation-Throttling-MUST-READ ##
|
22
|
+
|
23
|
+
## ##
|
24
|
+
## YOU ALONE ARE RESPONSIBLE FOR ##
|
25
|
+
## MAKING SURE YOU DO NOT EXCEED ##
|
26
|
+
## THE MAXIMUM NUMBER OF ALLOWED ##
|
27
|
+
## API CALLS OVER THE SPECIFIED ##
|
28
|
+
## PERIOD! ##
|
29
|
+
###################################
|
30
|
+
|
31
|
+
## This is a bare-bones mission ##
|
32
|
+
## bot. The sky is the limit on ##
|
33
|
+
## what options you want to add ##
|
34
|
+
## to it ##
|
35
|
+
|
36
|
+
|
37
|
+
## pollSleep will sleep for x ##
|
38
|
+
## seconds after polling the ##
|
39
|
+
## API for available missions ##
|
40
|
+
pollSleep = 31
|
41
|
+
|
42
|
+
## claimSleep will sleep for y ##
|
43
|
+
## seconds after attempting to ##
|
44
|
+
## claim mission. This is used ##
|
45
|
+
## to prevent hitting the max ##
|
46
|
+
## API requests over any 5 min ##
|
47
|
+
## period. ##
|
48
|
+
claimSleep = 5
|
49
|
+
|
50
|
+
|
51
|
+
## Don't claim missions on the following targets ##
|
52
|
+
dontclaim=[]
|
53
|
+
|
54
|
+
## Only claim missions on the following ##
|
55
|
+
## target types: ##
|
56
|
+
## "Web Application" ##
|
57
|
+
## "Reverse Engineering" ##
|
58
|
+
## "Mobile" ##
|
59
|
+
## "Host" ##
|
60
|
+
## "Source Code" ##
|
61
|
+
## "Hardware" ##
|
62
|
+
assetType = []
|
63
|
+
|
64
|
+
s1 = synack()
|
65
|
+
s1.getSessionToken()
|
66
|
+
while True:
|
67
|
+
time.sleep(pollSleep)
|
68
|
+
missionJson = s1.pollMissions()
|
69
|
+
if len(missionJson) == 0:
|
70
|
+
continue
|
71
|
+
s1.claimMission(missionJson, dontclaim, assetType)
|
72
|
+
time.sleep(claimSleep)
|
@@ -0,0 +1,67 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
import OpenSSL
|
3
|
+
import datetime
|
4
|
+
import requests
|
5
|
+
import ssl
|
6
|
+
import socket
|
7
|
+
from synack import synack
|
8
|
+
|
9
|
+
def process_server_cert(url, port=443, name=None):
|
10
|
+
if name is None:
|
11
|
+
name = url
|
12
|
+
process_cert(name, ssl.get_server_certificate((url, port)))
|
13
|
+
|
14
|
+
def process_cert(name, cert):
|
15
|
+
try:
|
16
|
+
x509 = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, cert)
|
17
|
+
exp_date = datetime.datetime.strptime(x509.get_notAfter().decode(), '%Y%m%d%H%M%SZ')
|
18
|
+
now = datetime.datetime.now()
|
19
|
+
|
20
|
+
exp_days = (exp_date-now).days
|
21
|
+
print(f'{name}: Expires {exp_date.strftime("%Y-%m-%d")} ({exp_days} days)')
|
22
|
+
|
23
|
+
if exp_days <= 14:
|
24
|
+
print('****************************************************************')
|
25
|
+
print(f'WARNING: {name} is expiring soon! Send Synack a support ticket!')
|
26
|
+
print('****************************************************************')
|
27
|
+
except Exception as err:
|
28
|
+
print(f"Could not retrieve {name}: {err}")
|
29
|
+
|
30
|
+
# Platform
|
31
|
+
process_server_cert('platform.synack.com')
|
32
|
+
|
33
|
+
# LP CA cert
|
34
|
+
process_cert('CA cert', requests.get("https://storage.googleapis.com/wolfacid-prod-public/ca-root.cer").content)
|
35
|
+
|
36
|
+
# LP Test
|
37
|
+
process_server_cert('synack-launchpoint-test.com')
|
38
|
+
|
39
|
+
# LP+
|
40
|
+
process_server_cert('amberjack.synack-lp.com')
|
41
|
+
|
42
|
+
# TuPoC
|
43
|
+
process_server_cert('x1.pe')
|
44
|
+
|
45
|
+
# ¯\_(ツ)_/¯
|
46
|
+
process_server_cert('boss.synack.com')
|
47
|
+
process_server_cert('client.synack.com')
|
48
|
+
process_server_cert('login.synack.com')
|
49
|
+
process_server_cert('acropolis.synack.com')
|
50
|
+
process_server_cert('gladiolus.synack.com')
|
51
|
+
|
52
|
+
# OpenVPN LP Cert
|
53
|
+
try:
|
54
|
+
s1 = synack()
|
55
|
+
s1.gecko=False
|
56
|
+
s1.getSessionToken()
|
57
|
+
lp_creds = s1.getLPCredentials()
|
58
|
+
ovpn_file = lp_creds["openvpn_file"]
|
59
|
+
|
60
|
+
cert_start = ovpn_file.index(b"-----BEGIN CERTIFICATE-----")
|
61
|
+
cert_end = ovpn_file.index(b"-----END CERTIFICATE-----") + len(b"-----END CERTIFICATE-----")
|
62
|
+
cert = ovpn_file[cert_start:cert_end]
|
63
|
+
process_cert('OpenVPN LP cert', cert)
|
64
|
+
|
65
|
+
except Exception as err:
|
66
|
+
print(f"Could not obtain LP OpenVPN credentials: {err}")
|
67
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
from synack import synack
|
3
|
+
|
4
|
+
s1 = synack()
|
5
|
+
s1.gecko = False
|
6
|
+
s1.getSessionToken()
|
7
|
+
s1.getAllTargets()
|
8
|
+
response = s1.try_requests("GET", "https://platform.synack.com/api/launchpoint", 10)
|
9
|
+
jsonResponse=response.json()
|
10
|
+
status = jsonResponse['status']
|
11
|
+
if 'slug' in jsonResponse:
|
12
|
+
currentTarget = s1.getCodenameFromSlug(jsonResponse['slug'])
|
13
|
+
futureTarget = s1.getCodenameFromSlug(jsonResponse['pending_slug'])
|
14
|
+
else:
|
15
|
+
print("Not connected")
|
16
|
+
if currentTarget == None:
|
17
|
+
print("Not connected")
|
18
|
+
if(status != "connected"):
|
19
|
+
print("Not connected to target.")
|
20
|
+
else:
|
21
|
+
if(futureTarget != None):
|
22
|
+
print("Disconnecteding from "+currentTarget+" and connecting to "+futureTarget+".")
|
23
|
+
else:
|
24
|
+
print("Connected to "+currentTarget+".")
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
|
3
|
+
from synack import synack
|
4
|
+
import psycopg2
|
5
|
+
import subprocess
|
6
|
+
import sys
|
7
|
+
|
8
|
+
n = len(sys.argv)
|
9
|
+
s1 = synack()
|
10
|
+
|
11
|
+
def connect():
|
12
|
+
s1.getSessionToken()
|
13
|
+
s1.registerAll()
|
14
|
+
s1.getAllTargets()
|
15
|
+
|
16
|
+
def analytics(codename):
|
17
|
+
print(codename)
|
18
|
+
analytics = s1.getAnalytics(codename)
|
19
|
+
analyticsList = []
|
20
|
+
for k in range(len(analytics)):
|
21
|
+
analyticsList.append(analytics[k])
|
22
|
+
with open(codename+"_analytics.txt", mode='wt', encoding='utf-8') as myfile1:
|
23
|
+
print(analyticsList)
|
24
|
+
myfile1.write('\n'.join(map(str,analyticsList)))
|
25
|
+
|
26
|
+
|
27
|
+
if n > 1:
|
28
|
+
category = "Host"
|
29
|
+
connect()
|
30
|
+
codenames = s1.getCodenames(category)
|
31
|
+
codename = sys.argv[1]
|
32
|
+
analytics(codename)
|
33
|
+
elif n > 2:
|
34
|
+
category = sys.argv[2]
|
35
|
+
connect()
|
36
|
+
codenames = s1.getCodenames(category)
|
37
|
+
codename = sys.argv[1]
|
38
|
+
analytics(codename)
|
39
|
+
else:
|
40
|
+
print("Usage: %s target category" % (sys.argv[0]))
|
@@ -0,0 +1,46 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
|
3
|
+
from synack import synack
|
4
|
+
import os
|
5
|
+
import sys
|
6
|
+
|
7
|
+
def hydraOutput(codename):
|
8
|
+
jsonResponse = s1.getHydra(codename)
|
9
|
+
hydraOut = list()
|
10
|
+
for i in range(len(jsonResponse)):
|
11
|
+
keys = list(jsonResponse[i]['ports'].keys())
|
12
|
+
for j in range(len(keys)):
|
13
|
+
portKeys = list(jsonResponse[i]['ports'][keys[j]])
|
14
|
+
for k in range(len(portKeys)):
|
15
|
+
if len(jsonResponse[i]['ports'][keys[j]][portKeys[k]]) > 0:
|
16
|
+
if "synack" in jsonResponse[i]['ports'][keys[j]][portKeys[k]]:
|
17
|
+
if "cpe" in jsonResponse[i]['ports'][keys[j]][portKeys[k]]['synack']:
|
18
|
+
if "parsed" in jsonResponse[i]['ports'][keys[j]][portKeys[k]]['synack']['cpe']:
|
19
|
+
if jsonResponse[i]['ports'][keys[j]][portKeys[k]]['synack']['cpe']['parsed'] != "":
|
20
|
+
hydraOut.append(jsonResponse[i]['ip']+","+keys[j]+","+portKeys[k]+","+jsonResponse[i]['ports'][keys[j]][portKeys[k]]['synack']['cpe']['parsed'])
|
21
|
+
else:
|
22
|
+
hydraOut.append(jsonResponse[i]['ip']+","+keys[j]+","+portKeys[k]+",''")
|
23
|
+
return hydraOut
|
24
|
+
|
25
|
+
s1 = synack()
|
26
|
+
s1.gecko = False
|
27
|
+
s1.getSessionToken()
|
28
|
+
s1.getAllTargets()
|
29
|
+
args = len(sys.argv)
|
30
|
+
if args == 2:
|
31
|
+
codename = str(sys.argv[1].lower())
|
32
|
+
output = hydraOutput(codename)
|
33
|
+
with open("hydra.out", 'a') as out:
|
34
|
+
out.write('\n'.join(output))
|
35
|
+
if args > 2:
|
36
|
+
sys.exit()
|
37
|
+
if args == 1:
|
38
|
+
codenames = s1.getCodenames("host")
|
39
|
+
for codename in codenames:
|
40
|
+
print(codename)
|
41
|
+
targetPath = "./"+codename.upper()+"/"
|
42
|
+
if os.path.isdir(targetPath) == False:
|
43
|
+
os.mkdir(targetPath)
|
44
|
+
output = hydraOutput(codename)
|
45
|
+
with open(targetPath+"hydra.txt", 'a') as out:
|
46
|
+
out.write('\n'.join(output))
|
@@ -0,0 +1,123 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
|
3
|
+
from synack import synack
|
4
|
+
import subprocess
|
5
|
+
import os
|
6
|
+
import sys
|
7
|
+
|
8
|
+
s1 = synack()
|
9
|
+
s1.gecko=False
|
10
|
+
s1.getSessionToken()
|
11
|
+
s1.getAllTargets()
|
12
|
+
args = len(sys.argv)
|
13
|
+
arg_1 = str(sys.argv[1].lower())
|
14
|
+
|
15
|
+
if arg_1 == "web":
|
16
|
+
category = "Web Application"
|
17
|
+
codenames = s1.getCodenames(category)
|
18
|
+
elif arg_1 == "host":
|
19
|
+
category = "Host"
|
20
|
+
codenames = s1.getCodenames(category)
|
21
|
+
elif arg_1 == "mobile":
|
22
|
+
category = "mobile"
|
23
|
+
codenames = s1.getCodenames(category)
|
24
|
+
elif arg_1 == "re":
|
25
|
+
category = "reverse engineering"
|
26
|
+
codenames = s1.getCodenames(category)
|
27
|
+
elif arg_1 == "hardware":
|
28
|
+
category = "hardware"
|
29
|
+
codenames = s1.getCodenames(category)
|
30
|
+
elif arg_1 == "sc":
|
31
|
+
category = "source code"
|
32
|
+
codenames = s1.getCodenames(category)
|
33
|
+
else:
|
34
|
+
codenames = [arg_1]
|
35
|
+
category = s1.getCategory(codenames[0])
|
36
|
+
|
37
|
+
|
38
|
+
if category == "Host":
|
39
|
+
for i in range(len(codenames)):
|
40
|
+
codename = codenames[i]
|
41
|
+
print(codename)
|
42
|
+
cidrs = s1.getScope(codename)
|
43
|
+
ips = s1.getIPs(cidrs)
|
44
|
+
targetPath = "./"+codename.upper()+"/"
|
45
|
+
if os.path.isdir(targetPath) == False:
|
46
|
+
os.mkdir(targetPath)
|
47
|
+
filePath = "./"+codename.upper()+"/scope.txt"
|
48
|
+
if os.path.exists(filePath):
|
49
|
+
os.remove(filePath)
|
50
|
+
with open('./'+codename.upper()+'/scope.txt', mode='wt', encoding='utf-8') as myfile:
|
51
|
+
myfile.write('\n'.join(ips))
|
52
|
+
myfile.write('\n')
|
53
|
+
|
54
|
+
if category == "Web Application":
|
55
|
+
for i in range(len(codenames)):
|
56
|
+
print(codenames[i])
|
57
|
+
tupleList = set()
|
58
|
+
oosTupleList = set()
|
59
|
+
burpSet = set()
|
60
|
+
oosBurpSet = set()
|
61
|
+
codename = codenames[i]
|
62
|
+
scope,oos = s1.getScope(codename)
|
63
|
+
|
64
|
+
wildcardRegex = "(.*\.|)"
|
65
|
+
|
66
|
+
for j in range(len(scope)):
|
67
|
+
scheme = scope[j]['scheme']
|
68
|
+
netloc = scope[j]['netloc']
|
69
|
+
path = scope[j]['netloc']
|
70
|
+
port = scope[j]['port']
|
71
|
+
wildcard = scope[j]['wildcard']
|
72
|
+
path = scope[j]['path']
|
73
|
+
netloc = netloc+path
|
74
|
+
# tupleList.add(netloc)
|
75
|
+
print(netloc)
|
76
|
+
if wildcard == True:
|
77
|
+
tupleList.add(netloc)
|
78
|
+
burpStr = netloc.replace('.','\.')
|
79
|
+
burpStr = burpStr.replace('/','\/')
|
80
|
+
burpSet.add(wildcardRegex + burpStr)
|
81
|
+
else:
|
82
|
+
tupleList.add(netloc)
|
83
|
+
burpStr = netloc.replace('.','\.')
|
84
|
+
burpStr = burpStr.replace('/','\/')
|
85
|
+
burpSet.add(burpStr)
|
86
|
+
|
87
|
+
for k in range(len(oos)):
|
88
|
+
scheme = oos[k]['scheme']
|
89
|
+
netloc = oos[k]['netloc']
|
90
|
+
path = oos[k]['netloc']
|
91
|
+
port = oos[k]['port']
|
92
|
+
wildcard = oos[k]['wildcard']
|
93
|
+
path = oos[k]['path']
|
94
|
+
netloc = netloc + path
|
95
|
+
oosTupleList.add(netloc)
|
96
|
+
if wildcard == True:
|
97
|
+
oosTupleList.add(netloc)
|
98
|
+
oosBurpStr = netloc.replace('.','\.')
|
99
|
+
oosBurpStr = oosBurpStr.replace('/','\/')
|
100
|
+
oosBurpSet.add(wildcardRegex + oosBurpStr)
|
101
|
+
else:
|
102
|
+
oosBurpStr = netloc.replace('.','\.')
|
103
|
+
oosBurpStr = oosBurpStr.replace('/','\/')
|
104
|
+
oosTupleList.add(netloc)
|
105
|
+
oosBurpSet.add(netloc.replace('.','\.'))
|
106
|
+
scopeList = list(tupleList)
|
107
|
+
burpList = list(burpSet)
|
108
|
+
oosBurpList = list(oosBurpSet)
|
109
|
+
targetPath = "./"+codename.upper()+"/"
|
110
|
+
if os.path.isdir(targetPath) == False:
|
111
|
+
os.mkdir(targetPath)
|
112
|
+
filePath = "./"+codename.upper()+"/scope.txt"
|
113
|
+
if os.path.exists(filePath):
|
114
|
+
os.remove(filePath)
|
115
|
+
with open('./'+codename.upper()+'/scope.txt', mode='wt', encoding='utf-8') as myfile:
|
116
|
+
myfile.write('\n'.join(scopeList))
|
117
|
+
myfile.write('\n')
|
118
|
+
with open('./'+codename.upper()+'/burpScope.txt', mode='wt', encoding='utf-8') as myfile:
|
119
|
+
myfile.write('\n'.join(burpList))
|
120
|
+
myfile.write('\n')
|
121
|
+
with open('./'+codename.upper()+'/burpOOS.txt', mode='wt', encoding='utf-8') as myfile:
|
122
|
+
myfile.write('\n'.join(oosBurpList))
|
123
|
+
myfile.write('\n')
|