Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pypi autopublish #1816

Merged
merged 4 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
git switch gh-pages
git push
publish_code:
needs: update_docs
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/stable')
continue-on-error: true
Expand Down
8 changes: 8 additions & 0 deletions bbot/core/helpers/names_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
"affectionate",
"aggravated",
"aggrieved",
"agoraphobic",
"almighty",
"anal",
"atrocious",
"autistic",
"awkward",
"baby",
"begrudged",
Expand Down Expand Up @@ -113,6 +115,7 @@
"imaginary",
"immense",
"immoral",
"impulsive",
"incomprehensible",
"inebriated",
"inexplicable",
Expand Down Expand Up @@ -277,6 +280,7 @@
"aaron",
"abigail",
"adam",
"adeem",
"alan",
"albert",
"alex",
Expand Down Expand Up @@ -414,6 +418,7 @@
"evelyn",
"faramir",
"florence",
"fox",
"frances",
"francis",
"frank",
Expand Down Expand Up @@ -508,6 +513,7 @@
"kevin",
"kimberly",
"kyle",
"kylie",
"lantern",
"larry",
"laura",
Expand All @@ -531,6 +537,7 @@
"lupin",
"madison",
"magnus",
"marcus",
"margaret",
"maria",
"marie",
Expand Down Expand Up @@ -629,6 +636,7 @@
"stephen",
"steven",
"susan",
"syrina",
"tammy",
"taylor",
"teresa",
Expand Down
14 changes: 8 additions & 6 deletions bbot/modules/filedownload.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ class filedownload(BaseModule):
"bak", # Backup File
"bash", # Bash Script or Configuration
"bashrc", # Bash Script or Configuration
"conf", # Configuration File
"cfg", # Configuration File
"conf", # Configuration File
"crt", # Certificate File
"csv", # Comma Separated Values File
"db", # SQLite Database File
"sqlite", # SQLite Database File
"dll", # Windows Dynamic Link Library
"doc", # Microsoft Word Document (Old Format)
"docx", # Microsoft Word Document
"exe", # Windows PE executable
Expand All @@ -39,7 +39,6 @@ class filedownload(BaseModule):
"ini", # Initialization File
"jar", # Java Archive
"key", # Private Key File
"pub", # Public Key File
"log", # Log File
"markdown", # Markdown File
"md", # Markdown File
Expand All @@ -55,23 +54,26 @@ class filedownload(BaseModule):
"ppt", # Microsoft PowerPoint Presentation (Old Format)
"pptx", # Microsoft PowerPoint Presentation
"ps1", # PowerShell Script
"pub", # Public Key File
"raw", # Raw Image File Format
"rdp", # Remote Desktop Protocol File
"sh", # Shell Script
"sql", # SQL Database Dump
"sqlite", # SQLite Database File
"swp", # Swap File (temporary file, often Vim)
"sxw", # OpenOffice.org Writer document
"tar", # Tar Archive
"tar.gz", # Gzip-Compressed Tar Archive
"zip", # Zip Archive
"tar", # Tar Archive
"txt", # Plain Text Document
"vbs", # Visual Basic Script
"war", # Java Web Archive
"wpd", # WordPerfect Document
"xls", # Microsoft Excel Spreadsheet (Old Format)
"xlsx", # Microsoft Excel Spreadsheet
"xml", # eXtensible Markup Language File
"yml", # YAML Ain't Markup Language
"yaml", # YAML Ain't Markup Language
"yml", # YAML Ain't Markup Language
"zip", # Zip Archive
],
"max_filesize": "10MB",
"base_64_encoded_file": "false",
Expand Down
34 changes: 20 additions & 14 deletions bbot/modules/output/http.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from bbot.errors import WebError
from bbot.modules.output.base import BaseOutputModule


Expand Down Expand Up @@ -52,16 +51,23 @@ async def setup(self):

async def handle_event(self, event):
while 1:
try:
await self.helpers.request(
url=self.url,
method=self.method,
auth=self.auth,
headers=self.headers,
json=event.json(siem_friendly=self.siem_friendly),
raise_error=True,
)
break
except WebError as e:
self.warning(f"Error sending {event}: {e}, retrying...")
await self.helpers.sleep(1)
response = await self.helpers.request(
url=self.url,
method=self.method,
auth=self.auth,
headers=self.headers,
json=event.json(siem_friendly=self.siem_friendly),
)
is_success = False if response is None else response.is_success
if not is_success:
status_code = getattr(response, "status_code", 0)
self.warning(f"Error sending {event} (HTTP status code: {status_code}), retrying...")
body = getattr(response, "text", "")
self.debug(body)
if status_code == 429:
sleep_interval = 10
else:
sleep_interval = 1
await self.helpers.sleep(sleep_interval)
continue
break
Loading