Skip to content
This repository was archived by the owner on Sep 2, 2019. It is now read-only.

Commit 299df0a

Browse files
author
ecstatic_nobel
committed
Use Captures as the only default output directory. Remove UA var. Rename suspicious var. Update comments.
1 parent 586d29d commit 299df0a

File tree

2 files changed

+33
-51
lines changed

2 files changed

+33
-51
lines changed

aa_certstream.py

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,20 @@
88
99
Optional arguments:
1010
- --dns-twist : Check the twisted keywords found in dns_twisted.yaml
11-
- --file-dir : Directory to use for interesting files detected (default: ./InterestingFiles/)
12-
- --kit-dir : Directory to use for phishing kits detected (default: ./KitJackinSeason/)
11+
- --directory : Save data to CAP_DIR (default: ./Captures/)
1312
- --level : Recursion depth (default=1, infinite=0)
1413
- --log-nc : File to store domains that have not been checked
1514
- --quiet : Don't show wget output
1615
- --score : Minimum score to trigger a session (Default: 75)
1716
- --threads : Numbers of threads to spawn
18-
- --timeout : Set time to wait for a connection
17+
- --timeout : Set the connection timeout to TIMEOUT
1918
- --tor : Download files via the Tor network
2019
- --verbose : Show domains being scored
2120
- --very-verbose : Show error messages
2221
2322
Usage:
2423
```
25-
python aa_certstream.py [--dns-twist] [--file-dir] [--kit-dir] [--level] [--log-nc] [--quiet] [--score] [--threads] [--timeout] [--tor] [--verbose] [--very-verbose]
24+
python aa_certstream.py [--dns-twist] [--directory] [--level] [--log-nc] [--quiet] [--score] [--threads] [--timeout] [--tor] [--verbose] [--very-verbose]
2625
```
2726
2827
Debugger: open("/tmp/aa.txt", "a").write("{}: <MSG>\n".format(<VAR>))
@@ -50,16 +49,11 @@
5049
action="store_true",
5150
required=False,
5251
help="Check the twisted keywords found in dns_twisted.yaml")
53-
parser.add_argument("--file-dir",
54-
dest="file_dir",
55-
default="./InterestingFile/",
52+
parser.add_argument("--directory",
53+
dest="cap_dir",
54+
default="./Captures/",
5655
required=False,
57-
help="Directory to use for interesting files detected (default: ./InterestingFiles/)")
58-
parser.add_argument("--kit-dir",
59-
dest="kit_dir",
60-
default="./KitJackinSeason/",
61-
required=False,
62-
help="Directory to use for phishing kits detected (default: ./KitJackinSeason/)")
56+
help="Download data to CAP_DIR (default: ./Captures)")
6357
parser.add_argument("--level",
6458
dest="level",
6559
default=1,
@@ -93,7 +87,7 @@
9387
default=30,
9488
required=False,
9589
type=int,
96-
help="Set time to wait for a connection")
90+
help="Set the connection timeout to TIMEOUT")
9791
parser.add_argument("--tor",
9892
dest="tor",
9993
action="store_true",
@@ -109,16 +103,13 @@
109103
action="store_true",
110104
required=False,
111105
help="Show error messages")
112-
args = parser.parse_args()
113-
uagent = "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko"
106+
# Fix directory names
107+
args = commons.fix_directory(parser.parse_args())
114108

115109
# Set threads to a minimum of 20 if using --dns-twist
116110
if args.dns_twist and args.threads < 20:
117111
args.threads = 20
118112

119-
# Fix directory names
120-
args = commons.fix_directory(args)
121-
122113
tqdm.tqdm.monitor_interval = 0
123114

124115
def callback(message, context):
@@ -145,7 +136,7 @@ def callback(message, context):
145136

146137
pbar.update(1)
147138

148-
score = commons.score_domain(suspicious, domain.lower(), args)
139+
score = commons.score_domain(config, domain.lower(), args)
149140

150141
if "Let's Encrypt" in message["data"]["chain"][0]["subject"]["aggregated"]:
151142
score += 10
@@ -215,27 +206,27 @@ def on_open(instance):
215206
def main():
216207
""" """
217208
global exclusions
218-
global suspicious
209+
global config
219210
global url_queue
220211

221212
# Check if output directories exist
222213
commons.check_path(args)
223214

224215
# Print start messages
225216
commons.show_summary(args)
226-
commons.show_networking(args, uagent)
217+
commons.show_networking(args) # globals: proxies, torsocks
227218

228-
# Read suspicious.yaml
229-
suspicious = commons.read_suspicious(args)
219+
# Read config.yaml
220+
config = commons.read_config(args) # globals: config
230221

231222
# Recompile exclusions
232-
exclusions = commons.recompile_exclusions()
223+
exclusions = commons.recompile_exclusions() # globals: exclusions
233224

234225
# Create queues
235226
url_queue = commons.create_queue("url_queue")
236227

237228
# Create threads
238-
commons.UrlQueueManager(args, url_queue, uagent)
229+
commons.UrlQueueManager(args, url_queue)
239230

240231
# Listen for events via Certstream
241232
print(colored("Connecting to Certstream...\n", "yellow", attrs=["bold"]))

aa_whoisds.py

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,20 @@
1111
1212
Optional arguments:
1313
- --dns-twist : Check the twisted keywords found in dns_twisted.yaml
14-
- --file-dir : Directory to use for interesting files detected (default: ./InterestingFiles/)
15-
- --kit-dir : Directory to use for phishing kits detected (default: ./KitJackinSeason/)
14+
- --directory : Save data to CAP_DIR (default: ./Captures/)
1615
- --level : Recursion depth (default=1, infinite=0)
1716
- --log-nc : File to store domains that have not been checked
1817
- --quiet : Don't show wget output
1918
- --score : Minimum score to trigger a session (Default: 75)
2019
- --threads : Numbers of threads to spawn
21-
- --timeout : Set time to wait for a connection
20+
- --timeout : Set the connection timeout to TIMEOUT
2221
- --tor : Download files via the Tor network
2322
- --verbose : Show domains being scored
2423
- --very-verbose : Show error messages
2524
2625
Usage:
2726
```
28-
python aa_whoisds.py <DELTA> [--dns-twist] [--file-dir] [--kit-dir] [--level] [--log-nc] [--quiet] [--score] [--threads] [--timeout] [--tor] [--verbose] [--very-verbose]
27+
python aa_whoisds.py <DELTA> [--dns-twist] [--directory] [--level] [--log-nc] [--quiet] [--score] [--threads] [--timeout] [--tor] [--verbose] [--very-verbose]
2928
```
3029
3130
Debugger: open("/tmp/aa.txt", "a").write("{}: <MSG>\n".format(<VAR>))
@@ -52,16 +51,11 @@
5251
action="store_true",
5352
required=False,
5453
help="Check the twisted keywords found in dns_twisted.yaml")
55-
parser.add_argument("--file-dir",
56-
dest="file_dir",
57-
default="./InterestingFile/",
54+
parser.add_argument("--directory",
55+
dest="cap_dir",
56+
default="./Captures/",
5857
required=False,
59-
help="Directory to use for interesting files detected (default: ./InterestingFiles/)")
60-
parser.add_argument("--kit-dir",
61-
dest="kit_dir",
62-
default="./KitJackinSeason/",
63-
required=False,
64-
help="Directory to use for phishing kits detected (default: ./KitJackinSeason/)")
58+
help="Save data to CAP_DIR (default: ./Captures/)")
6559
parser.add_argument("--level",
6660
dest="level",
6761
default=1,
@@ -95,7 +89,7 @@
9589
default=30,
9690
required=False,
9791
type=int,
98-
help="Set time to wait for a connection")
92+
help="Set the connection timeout to TIMEOUT")
9993
parser.add_argument("--tor",
10094
dest="tor",
10195
action="store_true",
@@ -111,41 +105,38 @@
111105
action="store_true",
112106
required=False,
113107
help="Show error messages")
114-
args = parser.parse_args()
115-
uagent = "Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko"
108+
# Fix directory names
109+
args = commons.fix_directory(parser.parse_args())
116110

117111
# Set threads to a minimum of 20 if using --dns-twist
118112
if args.dns_twist and args.threads < 20:
119113
args.threads = 20
120114

121-
# Fix directory names
122-
args = commons.fix_directory(args)
123-
124115
def main():
125116
""" """
126117
# Check if output directories exist
127118
commons.check_path(args)
128119

129120
# Print start messages
130121
commons.show_summary(args)
131-
commons.show_networking(args, uagent)
122+
commons.show_networking(args) # globals: proxies, torsocks
132123

133-
# Read suspicious.yaml
134-
commons.read_suspicious(args)
124+
# Read config.yaml
125+
commons.read_config(args) # globals: config
135126

136127
# Recompile exclusions
137-
commons.recompile_exclusions()
128+
commons.recompile_exclusions() # globals: exclusions
138129

139130
# Create queues
140131
domain_queue = commons.create_queue("domain_queue")
141132
url_queue = commons.create_queue("url_queue")
142133

143134
# Create threads
144135
commons.DomainQueueManager(args, domain_queue, url_queue)
145-
commons.UrlQueueManager(args, url_queue, uagent)
136+
commons.UrlQueueManager(args, url_queue)
146137

147138
# Get domains
148-
domains = commons.get_domains(uagent, args)
139+
domains = commons.get_domains(args)
149140

150141
print(colored("Scoring and checking the domains...\n", "yellow", attrs=["bold"]))
151142
for domain in domains:

0 commit comments

Comments
 (0)