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 Online
AI 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):
7    def run(self):
8        # Detailed result from job
9        self.output['detail'] = []
10
11        # Short result from job
12        self.output['compact'] = []
13
14        # Steps, commands, etc for doing the job
15        self.output['video'] = []
16
17        # Simulate reading from info.log
18        log_contents = open('/path/to/s4e.io/info.log', 'r').read()
19
20        # Regex pattern to find username:password
21        pattern = r'(w+:[S]+)'
22        matches = re.findall(pattern, log_contents)
23
24        if matches:
25            for match in matches:
26                username, password = match.split(':', 1)
27                try:
28                    response = requests.post(
29                            'https://auth.s4e.io/login',
30                                data={
31                                    'username': username, 
32                                    'password': password
33                                }
34                        )
35
36                    if 'OK' in response.text:
37                        alert_message = f'Successful login with {username}:{password}'
38                        self.output['detail'].append(alert_message)
39                        self.output['compact'].append("Valid credentials found and alert generated.")
40
41                    else:
42                        self.output['detail'].append(f'Failed login attempt for {username}')
43                except requests.RequestException as e:
44                    self.output['detail'].append(f'Request failed: {e}')
45                    continue
46
47        else:
48            self.output['detail'].append('No username:password pattern found in logs.')
49
50        self.output['compact'].append('No valid credentials found.')
51        self.output['video'].append("Install requests: pip install requests")
52        self.output['video'].append("Parsed /path/to/s4e.io/info.log for patterns matching regex.")
53        self.output['video'].append("Simulated POST request to auth.s4e.io/login using credentials found in log.")
54        self.output['video'].append("Checked response for 'OK' to identify successful logins.")
55
56    def calculate_score(self):
57        # Simulated attack score calculation
58        num_successful_logins = len([entry for entry in self.output['detail'] if 'Successful login' in entry])
59
60        if num_successful_logins > 0:
61            # Critical due to successful unauthorized logins
62            self.score = 10
63        else:
64            # Information since no successful logins
65            self.score = 1
66

Explore Our Plan

CTEM Features

Continuous Threat Exposure Management

Check Out More Resources

Check Out More Resources

Continuous Threat Exposure Management for All Business Sizes