Skip to content

Commit 12cc41e

Browse files
committed
Refactored GitHub issue reporting; automatic submission replaced by manual sanitized reports.
1 parent 06beb62 commit 12cc41e

File tree

4 files changed

+56
-38
lines changed

4 files changed

+56
-38
lines changed

doc/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## Version 4.2 (TBA)
2+
* Revised: Refactored GitHub issue reporting; automatic submission replaced by manual sanitized reports.
3+
14
## Version 4.1 (2025-12-20)
25
* Fixed: Multiple bug-fixes regarding several reported unhandled exceptions.
36
* Fixed: Handling of parameter names containing non-ASCII characters.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name='commix',
20-
version='4.1',
20+
version='4.2.dev',
2121
description='Automated All-in-One OS Command Injection Exploitation Tool',
2222
long_description=open('README.md').read(),
2323
long_description_content_type='text/markdown',

src/utils/common.py

Lines changed: 49 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,16 @@ def create_github_issue(err_msg, exc_msg):
171171

172172
key = hashlib.md5(_).hexdigest()[:8]
173173

174-
bug_report = "Bug Report: Unhandled exception \"" + str([i for i in exc_msg.split(settings.END_LINE.LF) if i][-1]) + "\" " + "(#" + key + ")"
174+
bug_report = (
175+
"Bug Report: Unhandled exception \""
176+
+ str([i for i in exc_msg.split(settings.END_LINE.LF) if i][-1])
177+
+ "\" (#" + key + ")"
178+
)
175179

176180
while True:
177181
try:
178-
message = "Do you want to automatically create a new (anonymized) issue "
179-
message += "with the unhandled exception information at "
180-
message += "the official Github repository? [y/N] "
182+
message = "Do you want to prepare a sanitized GitHub issue report "
183+
message += "for manual submission? [y/N] "
181184
choise = read_input(message, default="N", check_batch=True)
182185
if choise in settings.CHOICE_YES:
183186
break
@@ -186,51 +189,66 @@ def create_github_issue(err_msg, exc_msg):
186189
return
187190
else:
188191
invalid_option(choise)
189-
pass
190192
except:
191193
settings.print_data_to_stdout("")
192194
raise SystemExit()
193195

194196
err_msg = err_msg[err_msg.find(settings.END_LINE.LF):]
195-
request = _urllib.request.Request(url="https://api.github.com/search/issues?q=" + \
196-
_urllib.parse.quote("repo:commixproject/commix" + settings.SINGLE_WHITESPACE + str(bug_report))
197-
)
197+
198+
request = _urllib.request.Request(
199+
url="https://api.github.com/search/issues?q=" +
200+
_urllib.parse.quote(
201+
"repo:commixproject/commix" +
202+
settings.SINGLE_WHITESPACE +
203+
str(bug_report)
204+
)
205+
)
198206

199207
try:
200-
content = _urllib.request.urlopen(request, timeout=settings.TIMEOUT).read()
208+
content = _urllib.request.urlopen(
209+
request,
210+
timeout=settings.TIMEOUT
211+
).read()
201212
_ = json.loads(content)
202213
duplicate = _["total_count"] > 0
203214
closed = duplicate and _["items"][0]["state"] == "closed"
204215
if duplicate:
205216
warn_msg = "That issue seems to be already reported"
206217
if closed:
207-
warn_msg += " and resolved. Please update to the latest "
208-
warn_msg += "(dev) version from official GitHub repository at '" + settings.GIT_URL + "'"
218+
warn_msg += " and resolved. Please update to the latest "
219+
warn_msg += "(dev) version from official GitHub repository at '"
220+
warn_msg += settings.GIT_URL + "'"
209221
warn_msg += "." + settings.END_LINE.LF
210-
settings.print_data_to_stdout(settings.print_warning_msg(warn_msg))
222+
settings.print_data_to_stdout(
223+
settings.print_warning_msg(warn_msg)
224+
)
211225
return
212226
except:
213227
pass
214228

215-
data = {"title": str(bug_report), "body": "```" + str(err_msg) + settings.END_LINE.LF + "```" + settings.END_LINE.LF + "```" + str(exc_msg) + "```"}
216-
request = _urllib.request.Request(url = "https://api.github.com/repos/commixproject/commix/issues",
217-
data = json.dumps(data).encode(),
218-
headers = {settings.AUTHORIZATION: "token " + base64.b64decode(settings.GITHUB_REPORT_OAUTH_TOKEN.encode(settings.DEFAULT_CODEC)).decode()}
219-
)
220-
try:
221-
content = _urllib.request.urlopen(request, timeout=settings.TIMEOUT).read()
222-
except Exception as err:
223-
content = None
224-
225-
issue_url = re.search(r"https://github.com/commixproject/commix/issues/\d+", content.decode(settings.DEFAULT_CODEC) or "")
226-
if issue_url:
227-
info_msg = "The created Github issue can been found at the address '" + str(issue_url.group(0)) + "'." + settings.END_LINE.LF
228-
settings.print_data_to_stdout(settings.print_info_msg(info_msg))
229-
else:
230-
warn_msg = "Something went wrong while creating a Github issue."
231-
if settings.UNAUTHORIZED_ERROR in str(err):
232-
warn_msg += " Please update to the latest revision." + settings.END_LINE.LF
233-
settings.print_data_to_stdout(settings.print_warning_msg(warn_msg))
229+
params = {
230+
"title": str(bug_report),
231+
"body":
232+
"```" + str(err_msg) + settings.END_LINE.LF +
233+
"```" + settings.END_LINE.LF +
234+
"```" + str(exc_msg) + "```"
235+
}
236+
237+
issue_url = (
238+
"https://github.com/commixproject/commix/issues/new?"
239+
+ _urllib.parse.urlencode(params)
240+
)
241+
242+
info_msg = (
243+
"A sanitized GitHub issue has been prepared with " +
244+
"relevant error details for manual review and submission:" +
245+
settings.END_LINE.LF +
246+
issue_url
247+
)
248+
249+
settings.print_data_to_stdout(
250+
settings.print_info_msg(info_msg)
251+
)
234252

235253
"""
236254
Masks sensitive data in the supplied message.

src/utils/settings.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,9 @@ def sys_argv_errors():
260260
DESCRIPTION_FULL = "Automated All-in-One OS Command Injection Exploitation Tool"
261261
DESCRIPTION = "The command injection exploiter"
262262
AUTHOR = "Anastasios Stasinopoulos"
263-
VERSION_NUM = "4.1"
264-
REVISION = "126"
265-
STABLE_RELEASE = True
263+
VERSION_NUM = "4.2"
264+
REVISION = "1"
265+
STABLE_RELEASE = False
266266
VERSION = "v"
267267
if STABLE_RELEASE:
268268
VERSION = VERSION + VERSION_NUM
@@ -1246,9 +1246,6 @@ class END_LINE:
12461246
# Options to explicitly mask in anonymous (unhandled exception) reports.
12471247
SENSITIVE_OPTIONS = ["--data", "-d", "--cookie", "-p", "--url", "-u", "-x", "--auth-cred", "-r", "-l"]
12481248

1249-
# Github OAuth token used for creating an automatic issue for unhandled exceptions.
1250-
GITHUB_REPORT_OAUTH_TOKEN = "YjNiYjdhZDBlYzM2MmM2NGEzYTAzZTc4ZDg1NmYwZTUyZGZlN2EyZQ=="
1251-
12521249
# Tranform payloads (via tamper script(s))
12531250
TRANFROM_PAYLOAD = None
12541251

0 commit comments

Comments
 (0)