forked from barryclark/jekyll-now
-
Notifications
You must be signed in to change notification settings - Fork 1
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
0x00Jeff
committed
Apr 15, 2024
1 parent
ac26def
commit 659230c
Showing
24 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,63 @@ | ||
#!/bin/bash | ||
|
||
if [ $# != 1 ];then | ||
echo "usage : port.sh IP" | ||
exit | ||
fi | ||
|
||
LOW=1 | ||
HIGH=2 | ||
last_state=0 | ||
current_state=0 | ||
port=$(( ($RANDOM % 4999 ) + 9000)) | ||
step=1000 | ||
|
||
|
||
#echo port is $port | ||
|
||
while true; do | ||
|
||
echo -n "$port -> " | ||
|
||
response=$(ssh $1 -p $port -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null 2>/dev/null) | ||
echo $response | ||
|
||
|
||
#echo response is $response | ||
|
||
if [ "$(echo $response)" == "$(echo -en "Higher\r")" ];then | ||
while (( $(( $port - $step )) < 9000 ));do | ||
step=$(( $step / 2)) | ||
done | ||
|
||
if [ $last_state == $LOW ];then # response change from "Lower" to "Higher" | ||
step=$(( $step / 2)) | ||
fi | ||
|
||
port=$(( $port - $step )) | ||
current_state=$HIGH | ||
|
||
elif [ "$(echo $response)" == "$(echo -en "Lower\r")" ];then | ||
while (( $(( $port + $step)) > 13999 ));do | ||
step=$(( $step / 2)) | ||
done | ||
|
||
if [ $last_state == $HIGH ];then # response changed from "Hihger" to "Lower" | ||
step=$(( $step / 2)) | ||
fi | ||
|
||
port=$(( $port + $step )) | ||
current_state=$LOW | ||
|
||
else | ||
# this doesn't work, instead the scripts freezes duo the connection persisting | ||
# and asking for a password instead of closing up like the other ports | ||
# when this script freezes you know you found your target port | ||
echo the right port is $port ! | ||
exit | ||
|
||
fi | ||
|
||
last_state=$current_state | ||
|
||
done |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.