Effortless Cybersecurity with AI and Automation

Effortlessly secure your digital assets with AI-driven automation, providing 24/7 protection against evolving cyber threats.
Free Tools
hero-bottom-image

Platform Features

See how our tools help protect your website and data easily.

Your OnlineAI Based
Security Scanner

Create tailored scans effortlessly with our AI-powered tool, designed to meet your specific security or functional testing needs.

1from s4e.config import *
2from s4e.task import Task
3import re
4import requests
5
6class Job(Task):
7def run(self):
8    asset = self.asset
9    # Detailed result from job
10    self.output['detail'] = []
11
12    # Short result from job
13    self.output['compact'] = []
14
15    # Steps, commands, etc for doing the job
16    self.output['video'] = []
17
18    # Simulate reading from info.log
19    log_contents = 
20    open('/path/to/s4e.io/info.log', 'r').read()
21
22    # Regex pattern to find username:password
23    pattern = r'(+:[@#$%^&]+)'
24    matches = re.findall(pattern, log_contents)
25
26    if matches:
27        for match in matches:
28            username, password = match.split(':')
29            response = 
30            requests.post(
31            'https://auth.s4e.io/login',
32                data={
33                    'username': username, 
34                    'password': password
35                }
36            )
37
38    if 'OK' in response.text:
39        alert_message = 
40        f'Successful login with {username}:{password}'
41        self.output['detail'].append(alert_message)
42        self.output['compact']
43        .append("Valid credentials found and 
44        alert generated.")
45
46    else:
47        self.output['detail']
48        .append(f'Failed login attempt for {username}')
49
50    else:
51    self.output['detail']
52    .append('No username:password pattern 
53    found in logs.')
54
55    self.output['compact']
56    .append('No valid credentials found.')
57
58    self.output['video']
59    .append("Install requests: pip install requests")
60
61    self.output['video']
62    .append("Parsed /path/to/s4e.io/info.log for 
63    patterns matching regex.")
64
65    self.output['video']
66    .append("Simulated POST request to auth.s4e.io/login 
67    using credentials found in log.")
68
69    self.output['video']
70    .append("Checked response for 'OK' to identify 
71    successful logins.")
72
73def calculate_score(self):
74    # Simulated attack score calculation
75    num_successful_logins = 
76    len([entry for entry in self.output['detail'] 
77    if 'Successful login' in entry])
78
79    if num_successful_logins > 0:
80        # Critical due to successful unauthorized logins
81        self.score = 10
82    else:
83        # Information since no successful logins
84        self.score = 1

Explore Our Plan

CTEM Features

Continuous Threat Exposure Management

Check Out More Resources

View More
Continuous Threat Exposure Management for All Business Sizes