Skip to content

Commit

Permalink
Merge pull request #369 from DigvijayBhosale1729/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
adeyosemanputra authored Jul 8, 2022
2 parents e1d2ccb + 35fe13f commit b08e2ca
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 55 deletions.
40 changes: 23 additions & 17 deletions securetea/args/args_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def __init__(self, args):
self.securetea_conf = SecureTeaConf()

self.cred_provided = False
self.twitter_provided = False
# self.twitter_provided = False
self.malware_analysis_provided = False
self.telegram_provided = False
self.twilio_provided = False
Expand Down Expand Up @@ -210,11 +210,13 @@ def __init__(self, args):
self.cred['debug']
)

"""
@takeInput
def configureTwitter(self):
"""
'''
Returns the format to configure Twitter
"""
'''
self.logger.log('Twitter configuration setup')
default = load_default('twitter')
return {
Expand All @@ -226,6 +228,7 @@ def configureTwitter(self):
},
'default': default
}
"""

@takeInput
def configureMalwareAnalysis(self):
Expand Down Expand Up @@ -310,7 +313,7 @@ def configureDiscord(self):
Returns the format to configure Discord
"""
self.logger.log('Discord configuraton setup')
default = load_default('Discord')
default = load_default('discord')
return {
'input': {
'webhookurl': 'Your channel webhook url'
Expand Down Expand Up @@ -585,17 +588,13 @@ def check_args(self):
(len(sys.argv) == 3 + int(self.args.skip_input) + int(self.cred['skip_config_file']) and self.args.debug and self.args.hist) or
(len(sys.argv) == 2 + int(self.args.skip_input) + int(self.cred['skip_config_file']) and (self.args.debug or self.args.hist)))): # Peform all integration

"""
# Start the twitter configuration setup
twitter = self.configureTwitter()
if twitter:
self.cred['twitter'] = twitter
self.twitter_provided = True

# Start the malware_analysis configuration setup
malware_analysis = self.configureMalwareAnalysis()
if malware_analysis:
self.cred['malware_analysis'] = malware_analysis
self.malware_analysis_provided = True
"""

# Start the telegram configuration setup
telegram = self.configureTelegram()
Expand All @@ -621,14 +620,12 @@ def check_args(self):
self.cred['slack'] = slack
self.slack_provided = True


# Start the Discord configuration setup
discord = self.configureDiscord()
if discord:
self.cred['discord'] = discord
self.discord_provided = True


# Start the aws ses configuration setup
aws_ses = self.configureAwsSES()
if aws_ses:
Expand All @@ -640,6 +637,12 @@ def check_args(self):
if gmail:
self.cred['gmail'] = gmail
self.gmail_provided = True

# Start the malware_analysis configuration setup
malware_analysis = self.configureMalwareAnalysis()
if malware_analysis:
self.cred['malware_analysis'] = malware_analysis
self.malware_analysis_provided = True

waf=self.configureWaf()
if waf:
Expand Down Expand Up @@ -708,13 +711,14 @@ def check_args(self):
if social_eng:
self.cred['social_eng'] = social_eng
self.social_eng_provided = True


"""
if self.args.twitter and not self.twitter_provided:
twitter = self.configureTwitter()
if twitter:
self.cred['twitter'] = twitter
self.twitter_provided = True
"""

if self.args.malware_analysis and not self.malware_analysis_provided:
malware_analysis = self.configureMalwareAnalysis()
Expand Down Expand Up @@ -1007,7 +1011,8 @@ def check_args(self):
self.cred["ids"]["interface"] = interface
if iot_check:
self.cred["iot-check"] = iot_check


"""
if not self.twitter_provided:
if (self.args.twitter_api_key and
self.args.twitter_api_secret_key and
Expand All @@ -1020,6 +1025,7 @@ def check_args(self):
twitter['access_token_secret'] = self.args.twitter_access_token_secret
self.cred['twitter'] = twitter
self.twitter_provided = True
"""

if not self.social_eng_provided:
if self.args.social_eng_email:
Expand Down Expand Up @@ -1271,7 +1277,7 @@ def check_args(self):

self.cred['firewall'] = firewall
self.firewall_provided = True
if (self.twitter_provided or
if (# self.twitter_provided or
self.malware_analysis_provided or
self.telegram_provided or
self.twilio_provided or
Expand Down Expand Up @@ -1299,7 +1305,7 @@ def check_args(self):
return {
'cred': self.cred,
'cred_provided': self.cred_provided,
'twitter_provided': self.twitter_provided,
# 'twitter_provided': self.twitter_provided,
'malware_analysis': self.malware_analysis_provided,
'telegram_provided': self.telegram_provided,
'twilio_provided': self.twilio_provided,
Expand Down
13 changes: 9 additions & 4 deletions securetea/args/arguments.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,21 @@ def get_args():
action="store_true",
help='Skip taking configuration from config file'
)


"""
parser.add_argument(
'--twitter',
required=False,
action='store_true',
help='Setup twitter credentials'
)
"""

parser.add_argument(
'--malware_analysis',
required=False,
action='store_true',
help='Setup twitter credentials'
help='Setup malware Analysis credentials'
)

parser.add_argument(
Expand Down Expand Up @@ -142,6 +144,7 @@ def get_args():
help='Setup AWS SES credentials'
)

"""
parser.add_argument(
'--twitter_api_key',
'-tak',
Expand All @@ -150,6 +153,7 @@ def get_args():
help='Twitter api key'
)
parser.add_argument(
'--twitter_api_secret_key',
'-tas',
Expand All @@ -173,6 +177,7 @@ def get_args():
required=False,
help='Twitter access token secret'
)
"""

parser.add_argument(
'--telegram_bot_token',
Expand Down Expand Up @@ -272,10 +277,10 @@ def get_args():

parser.add_argument(
'--webhookurl',
'--url',
'--w_url',
type=str,
required=False,
help="Your discord channerl webhook url"
help="Your discord channel webhook url"
)

parser.add_argument(
Expand Down
2 changes: 2 additions & 0 deletions securetea/args/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
def get_config():
"""Get default configuration credentials."""
return {
"""
"twitter": {
"api_key": "XXXX",
"api_secret_key": "XXXX",
"access_token": "XXXX",
"access_token_secret": "XXXX"
},
"""
"telegram": {
"token": "XXXX",
"user_id": "XXXX"
Expand Down
Loading

0 comments on commit b08e2ca

Please sign in to comment.