Skip to content

Commit

Permalink
Merge pull request #1816 from blacklanternsecurity/misc-improvements
Browse files Browse the repository at this point in the history
Fix pypi autopublish
  • Loading branch information
TheTechromancer authored Oct 3, 2024
2 parents 4e69080 + a608f3e commit 0aad57e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 21 deletions.
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 @@ -278,6 +281,7 @@
"aaron",
"abigail",
"adam",
"adeem",
"alan",
"albert",
"alex",
Expand Down Expand Up @@ -415,6 +419,7 @@
"evelyn",
"faramir",
"florence",
"fox",
"frances",
"francis",
"frank",
Expand Down Expand Up @@ -509,6 +514,7 @@
"kevin",
"kimberly",
"kyle",
"kylie",
"lantern",
"larry",
"laura",
Expand All @@ -532,6 +538,7 @@
"lupin",
"madison",
"magnus",
"marcus",
"margaret",
"maria",
"marie",
Expand Down Expand Up @@ -630,6 +637,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

0 comments on commit 0aad57e

Please sign in to comment.