Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
rbidou committed Mar 1, 2024
1 parent 000f805 commit 4e53469
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Python RASP

<p>
<img src="https://img.shields.io/badge/Version-0.4.3-green?style=for-the-badge" alt="version 0.4.3"/>
<img src="https://img.shields.io/badge/Version-0.4.4-green?style=for-the-badge" alt="version 0.4.4"/>
<a href="https://www.paracyberbellum.io">
<img src="https://img.shields.io/badge/A%20project%20by-ParaCyberBellum-blue?style=for-the-badge" alt="A project by ParaCyberBellum"/>
</a>
Expand Down Expand Up @@ -102,7 +102,7 @@ MIDDLEWARE = [
At startup of the application `pyrasp` loading information is displayed.

```
### PyRASP v0.4.0 ##########
### PyRASP v0.4.4 ##########
[+] Starting PyRASP
[+] Loading configuration from rasp.json
[+] XSS model loaded
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "pyrasp"
version = "0.4.3"
version = "0.4.4"
authors = [
{ name = "Renaud Bidou", email = "[email protected]" }
]
Expand Down
34 changes: 31 additions & 3 deletions pyrasp/pyrasp.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = '0.4.3'
VERSION = '0.4.4'

from pprint import pprint
import time
Expand Down Expand Up @@ -269,8 +269,15 @@ class PyRASP():
# Misc
INIT_VERBOSE = 0

# Platform
# PLATFORM
PLATFORM = 'Unknown'

# REQUESTS
REQUESTS = {
'success': 0,
'errors': 0,
'attacks': 0
}

####################################################
# CONSTRUCTOR & DESTRUCTOR
Expand Down Expand Up @@ -457,7 +464,12 @@ def send_beacon(self, key):
beacon_url = f'{PCB_PROTOCOL}://{PCB_SERVER}/rasp/beacon'
cpu = psutil.cpu_percent()
mem = psutil.virtual_memory().percent
data = { 'key': key, 'version': VERSION, 'cpu': cpu, 'mem': mem }
data = {
'key': key,
'version': VERSION,
'cpu': cpu,
'mem': mem,
'requests': self.REQUESTS }

error = False

Expand Down Expand Up @@ -504,6 +516,15 @@ def send_beacon(self, key):
if not server_result:
self.print_screen(f'[!] Error: {server_message}')
error = True

# Reset requests count
if not error:
self.REQUESTS = {
'success': 0,
'errors': 0,
'attacks': 0
}


# Set configuration
if not error and server_data.get('config'):
Expand Down Expand Up @@ -804,6 +825,13 @@ def process_response(self, response, attack = None):

if not attack == None:
response = self.make_attack_response()
self.REQUESTS['attacks'] += 1

elif response.status_code == 200:
self.REQUESTS['success'] += 1

else:
self.REQUESTS['errors'] += 1

if self.CHANGE_SERVER:
response = self.change_server(response)
Expand Down
4 changes: 3 additions & 1 deletion pyrasp/pyrasp_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@
"LOG_PROTOCOL": "UDP",

"CHANGE_SERVER": True,
"SERVER_HEADER": "Apache"
"SERVER_HEADER": "Apache",

"BEACON_DELAY": 5
}

0 comments on commit 4e53469

Please sign in to comment.