SlideShare a Scribd company logo
#!/bin/sh -h
trap "" 1 2 3 4 5 6 7 8 9
OUT="/usr/tmp/.$LOGNAME.ps.`date '+%m%d%H%M%S'`"
echo "@LOGIN `date '+%m/%d %H:%M:%S'` $$ `tty` `id`" > $OUT
while true
do
echo "# c"
read CMD
if test "X$CMD" != "X"
then
echo "`date '+%m/%d %H:%M:%S'` `pwd`: $CMD" >> $OUT
set X $CMD
if test "$2" = "exit" -o "$2" = "break" -o "$2" = "logout"
then
echo "@LOGOUT `date '+%m/%d %H:%M:%S'` $$ `tty` `id`" >> $OUT
exit 0
fi
TYP="`type $2`"
set X $TYP a b c d e f g h
if test "$6" = "builtin" -a "$2" != "set"
then
if test "$2" = "cd" -a "$2" != "$CMD"
then
set X $CMD
if test -d "$3"
then
$CMD
else
($CMD)
fi
else
$CMD
fi
else
if test "$4" = "/usr/bin/sh"
-o "$5" = "(/usr/bin/sh)"
-o
"/usr/bin/sh"
-o 
"$4" = "/usr/bin/csh"
-o "$5" = "(/usr/bin/csh)" -o
"/usr/bin/csh"
-o 
"$4" = "/usr/bin/ksh"
-o "$5" = "(/usr/bin/ksh)" -o
"/usr/bin/ksh"
-o 
"$4" = "/usr/bin/jsh"
-o "$5" = "(/usr/bin/jsh)" -o
"/usr/bin/jsh"
-o 
"$4" = "/usr/bin/su"
-o "$5" = "(/usr/bin/su)"
-o
"/usr/bin/su"
then
echo "Access denied, sorry."
else
sh -che "$CMD"
fi
fi
fi
done

"$8" =
"$8" =
"$8" =
"$8" =
"$8" =

More Related Content

ZIP
全裸でワンライナー(仮)
PDF
PDF
Scroll pHAT HD に美咲フォント
PPTX
London XQuery Meetup: Querying the World (Web Scraping)
ZIP
TerminalでTwitter
PDF
Security and Mobility - WordCamp Porto 2016
PDF
The Magic Of Tie
全裸でワンライナー(仮)
Scroll pHAT HD に美咲フォント
London XQuery Meetup: Querying the World (Web Scraping)
TerminalでTwitter
Security and Mobility - WordCamp Porto 2016
The Magic Of Tie

What's hot (20)

TXT
hotel managment
PDF
Beginning web programming with PHP [PHP 101-02]
PDF
201412 seccon2014 オンライン予選(英語) write-up
PDF
Yahoo! JAPANとKotlin
TXT
Codigos
PDF
PPTX
6. hello popescu 2
PDF
Perl Fitxers i Directoris
PDF
Communities - Perl edition (RioJS)
DOC
PDF
Itsecteam shell
DOC
Area de un triangulo
PDF
104 alhumazah
DOCX
Consulta de notas
DOCX
Verificacion de notas
ODT
linieaire regressie
PDF
subversion hacks (create a commit template)
PDF
Node.js - Demnächst auf einem Server in Ihrer Nähe
PDF
Random. Kinda.
PDF
Nette framework (WebElement #27 lightning talk)
hotel managment
Beginning web programming with PHP [PHP 101-02]
201412 seccon2014 オンライン予選(英語) write-up
Yahoo! JAPANとKotlin
Codigos
6. hello popescu 2
Perl Fitxers i Directoris
Communities - Perl edition (RioJS)
Itsecteam shell
Area de un triangulo
104 alhumazah
Consulta de notas
Verificacion de notas
linieaire regressie
subversion hacks (create a commit template)
Node.js - Demnächst auf einem Server in Ihrer Nähe
Random. Kinda.
Nette framework (WebElement #27 lightning talk)
Ad

Similar to Bloqueador cmd-sh (20)

TXT
Pop3ck sh
PDF
คู่มือการใช้โปรแกรม Pharmacy MTM
TXT
Vyg monitor
PDF
Ellzey 5611 module 3
PDF
Perl Bag of Tricks - Baltimore Perl mongers
PDF
Bag of tricks
PDF
Speeding up Red Team engagements with carnivorall
TXT
PPT
De webmaster is niet meer (beknopte versie)
DOC
5th Sem SS lab progs
PDF
Mundos de fantasía, Blaubloom
PDF
03 tk2123 - pemrograman shell-2
RTF
PDF
Ipad gump
PPTX
Presentation1
KEY
Hidden treasures of Ruby
PDF
Les antigènes de P .Falciparum
PDF
16 intégrales curvilignes, formes différentielles
DOCX
32 shell-programming
PDF
Classification des différents faciès et strates épidémiologiques du paludisme
Pop3ck sh
คู่มือการใช้โปรแกรม Pharmacy MTM
Vyg monitor
Ellzey 5611 module 3
Perl Bag of Tricks - Baltimore Perl mongers
Bag of tricks
Speeding up Red Team engagements with carnivorall
De webmaster is niet meer (beknopte versie)
5th Sem SS lab progs
Mundos de fantasía, Blaubloom
03 tk2123 - pemrograman shell-2
Ipad gump
Presentation1
Hidden treasures of Ruby
Les antigènes de P .Falciparum
16 intégrales curvilignes, formes différentielles
32 shell-programming
Classification des différents faciès et strates épidémiologiques du paludisme
Ad

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Electronic commerce courselecture one. Pdf
PDF
Getting Started with Data Integration: FME Form 101
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Tartificialntelligence_presentation.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
1. Introduction to Computer Programming.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
A Presentation on Artificial Intelligence
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Unlocking AI with Model Context Protocol (MCP)
Digital-Transformation-Roadmap-for-Companies.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Electronic commerce courselecture one. Pdf
Getting Started with Data Integration: FME Form 101
Programs and apps: productivity, graphics, security and other tools
Network Security Unit 5.pdf for BCA BBA.
Tartificialntelligence_presentation.pptx
Approach and Philosophy of On baking technology
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Assigned Numbers - 2025 - Bluetooth® Document
Diabetes mellitus diagnosis method based random forest with bat algorithm
1. Introduction to Computer Programming.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A Presentation on Artificial Intelligence

Bloqueador cmd-sh

  • 1. #!/bin/sh -h trap "" 1 2 3 4 5 6 7 8 9 OUT="/usr/tmp/.$LOGNAME.ps.`date '+%m%d%H%M%S'`" echo "@LOGIN `date '+%m/%d %H:%M:%S'` $$ `tty` `id`" > $OUT while true do echo "# c" read CMD if test "X$CMD" != "X" then echo "`date '+%m/%d %H:%M:%S'` `pwd`: $CMD" >> $OUT set X $CMD if test "$2" = "exit" -o "$2" = "break" -o "$2" = "logout" then echo "@LOGOUT `date '+%m/%d %H:%M:%S'` $$ `tty` `id`" >> $OUT exit 0 fi TYP="`type $2`" set X $TYP a b c d e f g h if test "$6" = "builtin" -a "$2" != "set" then if test "$2" = "cd" -a "$2" != "$CMD" then set X $CMD if test -d "$3" then $CMD else ($CMD) fi else $CMD fi else if test "$4" = "/usr/bin/sh" -o "$5" = "(/usr/bin/sh)" -o "/usr/bin/sh" -o "$4" = "/usr/bin/csh" -o "$5" = "(/usr/bin/csh)" -o "/usr/bin/csh" -o "$4" = "/usr/bin/ksh" -o "$5" = "(/usr/bin/ksh)" -o "/usr/bin/ksh" -o "$4" = "/usr/bin/jsh" -o "$5" = "(/usr/bin/jsh)" -o "/usr/bin/jsh" -o "$4" = "/usr/bin/su" -o "$5" = "(/usr/bin/su)" -o "/usr/bin/su" then echo "Access denied, sorry." else sh -che "$CMD" fi fi fi done "$8" = "$8" = "$8" = "$8" = "$8" =