Skip to content

Commit

Permalink
kill thread not process, other small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
srozb committed Jul 15, 2024
1 parent 78dd119 commit 70ec28e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion parasite.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "0.3.3"
version = "0.3.4"
author = "srozb"
description = "dll injection/hijack made fun"
license = "MIT"
Expand Down
6 changes: 4 additions & 2 deletions src/environ.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import strutils


proc getVer(): string {.compileTime.} =
## Returns parasite version string.
let nimble = staticRead("../parasite.nimble")
for l in nimble.splitLines():
if l.strip().startsWith("version"):
return "v." & l.split('"')[1]
return "v.<unknown>"
return l.split('"')[1]
return "<unknown>"

proc getCompileEnv(): string {.compileTime.} =
## Returns compilation details for easier tracking.
let user = staticExec("whoami").strip()
let host = staticExec("hostname").strip()
return user & "@" & host
Expand Down
2 changes: 1 addition & 1 deletion src/http/_menu.nwt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<li><a {% if request.path=="/wmi" %}class="is-active"{% endif %} href="/wmi">WMI</a></li>
</ul>
<p class="menu-label">
<a href="/quit">Terminate Host Process</a>
<a href="/quit">Terminate Parasite thread</a>
</p>
</aside>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/http/modules.nwt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
{% else %}
<tr>
{% endif %}
<td>{{ m.handle }}</td>
<td>0x{{ m.handle.toHex }}</td>
<td>{{ m.path }}</td>
<td><button class="button is-danger is-outlined is-small is-rounded" hx-delete="/modules/unload/{{m.name}}" hx-target="closest tr">Unload</button></td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion src/httpserv.nim
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ router paraRoutes:
post "/wmi":
resp renderWmi(request, @"namespace", @"query")
get "/quit":
quit()
terminateThread()
get "/bulma.min.css":
resp(content=BULMACSS, contentType="text/css;charset=utf=8")
get "/htmx.min.js":
Expand Down
4 changes: 4 additions & 0 deletions src/psapi.nim
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ proc terminatePid*(targetPid: int) =
raise newException(OSError, "Unable to terminate process.")
CloseHandle(hProc)

proc terminateThread*() =
## Terminate current thread
ExitThread(0)

proc isElevated*(): bool =
## Determine if current process is assigned with elevated token.
let
Expand Down

0 comments on commit 70ec28e

Please sign in to comment.