Тёмный

HakTip - Bash Basics: Turn Long Commands into Scripts 

Hak5
Подписаться 936 тыс.
Просмотров 45 тыс.
50% 1

Hak5 -- Cyber Security Education, Inspiration, News & Community since 2005:
____________________________________________
In this Bash basics HakTip, we're turning exhaustively long commands into shell scripts with minimal effort.
____________________________________________
Founded in 2005, Hak5's mission is to advance the InfoSec industry. We do this through our award winning educational podcasts, leading pentest gear, and inclusive community - where all hackers belong.

Опубликовано:

 

11 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 39   
@storytimecentral3894
@storytimecentral3894 7 лет назад
forget the haters I'm just starting out and this is good information well presented, thank you very much indeed.... subbed!
@vapornate
@vapornate 7 лет назад
Back when Netflix sponsored Hak5, those were the days.
@TaiiwoLlort
@TaiiwoLlort 13 лет назад
i once made a batch script in windows that boots up a tethered apple device in DFU mode. i was pretty happy with myself :D this rule generally applies to bash scripts: if you don't know how to do it yourself, you wont be able to tell your computer how to do it by itself.
@ross817
@ross817 13 лет назад
Wouldn't bash be /bin/bash? /bin/sh is a different interpreter, I think.
@buumi3
@buumi3 13 лет назад
ty for the ctrl-x ctrl-e never knew this: btw: you can change the default edit doing this update-alternatives --config editor
@Lolliloll1285
@Lolliloll1285 13 лет назад
You should do a tutorial on intelligent scripts, with if, then and else. I love them, because they make scripts safer to do, as they can depend on conditions to run. (Like, if you're not root, it won't even run.) And of course, variables. Variables are the most important thing with making scripts. It's what makes us as lazy as we are.
@ABitOfZero
@ABitOfZero 13 лет назад
Just a little history on the name: BASH was called so because it was what replaced it's previous UNIX shell, the "Bourne Shell" which was created by Stephen Bourne, the Bourne Again Shell was then named such by Brian Fox as a tribute to the predecessor.
@andjack
@andjack 13 лет назад
Why not use Emacs, which have many short commands in common with Bash. Usefull command: M-x shell C-x C-f (C-x extended command C-f fined file) C-x C-s (C-w save file) C-x C-c (C-c quit) C-x b C-x C-b (b buffer C-b list buffers) C-a C-e C-k C-w C-y (C-a first C-e end C-k kill line C-w cut C-y past) Tab to expand filename M-/ find next occurance of string just typed. There are much more. The commands have logical names. And you can make commands "stronger" with C- and M-
@BenAshton24
@BenAshton24 13 лет назад
@bobicool You could also use command line arguments, like so: ping $1 | while [...] and then run it with "./pingdate 8.8.8.8" or whatever ip you wanted
@1197vijay
@1197vijay 8 лет назад
It is very help full to me.. thank u very much
@andjack
@andjack 13 лет назад
@Coolmax71 As i wrote, it's easier to remember commands in Emacs than in vim. AND the key bindings in Bash is the same as in Emacs :)
@SecurityTalent
@SecurityTalent 2 года назад
Great
@maximumrfan
@maximumrfan 13 лет назад
@tylerzacc If you don't mind me asking, could you post it somewhere? It sounds very interesting.
@andjack
@andjack 13 лет назад
@buumi3 to use update-alternatives only work in Debian (and distributions created from Debian). It also set default editor for ALL users on your machine. With my sollution, you only change for this user. Better to use environment variables instead. They only change for you. export EDITOR="value" makes all commands started from this shell have "value" as value of EDITOR. unset EDITOR removes variable EDITOR from this shell and all commands started from this shell.
@andjack
@andjack 13 лет назад
@buumi3 Better to use environment variablers. Bash (and other) first check VISUAL., and uses the value as the command. If no VISUAL, check EDITOR and use that if exists. If not, start default editor. So, start an Emacs in background (with "emacs &") and type M-x server-start (or start from ~/.emacs, se man) Set EDITOR="emacsclient -t" and/or set VISUAL="emacsclien -c" Go on and now try C-x C-e in Bash. Exit emacs with C-x # Now editing with emacs is fast.
@MarianoBillinghurst
@MarianoBillinghurst 6 лет назад
What happened to the wireless Series?????
@buumi3
@buumi3 13 лет назад
@andjack thanks for the info :-)
@fission1110
@fission1110 13 лет назад
@blake9753 Nope. It will write whatever you type into the variable $randomvar
@cdbcbd4930
@cdbcbd4930 4 года назад
it didn't work? im going to through it into a curl -P | xargs.
@AmarKashyap1995
@AmarKashyap1995 13 лет назад
hey! Loving the new series... i wanted to install crunchbang linux on a VERY old netbook of mine but it doesnt have a cd drive. when i tried to install it from usb i get an error saying it cant find the cd! help!!!!
@randallrulo2109
@randallrulo2109 2 года назад
go into your bios and change your boot order...
@Coolmax71
@Coolmax71 13 лет назад
nano? vim ftw! (;
@jarisipilainen3875
@jarisipilainen3875 7 лет назад
I have never seen darren teach us gcc :)))
@NoctuTech
@NoctuTech 13 лет назад
Darren needs to send me a hak5 skin for my netbook!!!!!!!!!
@candlehawk
@candlehawk 13 лет назад
BASH is Bourne Again SHell.
@JaqenHghar.
@JaqenHghar. 10 лет назад
I know this is really old but I'm just learning about this stuff and these episodes have helped a lot but why am I getting my permission denied when I try to save the file?
@xTheRebellion
@xTheRebellion 9 лет назад
Jaqen H'ghar Late reply, so hopefully you found your answer.. but you cannot save a file which you do not have write permissions to.. so either use "chmod" as super user to give you those permissions -> chmod u+w file.txt and then you will be able to save, or sudo nano file.txt and you will be able to save ( try not to use sudo unless necessary)
@Mammongorothkar
@Mammongorothkar 9 лет назад
+Jaqen H'ghar He tells you how to change file permissions..... chmod+x "filename"
@MrMinecraftviking
@MrMinecraftviking 8 лет назад
+Jaqen H'ghar Because you are saving in a dir owned by another user. (likely root)
@nathanstott1909
@nathanstott1909 6 лет назад
The shebang should be /bin/bash not ksh
@metal571
@metal571 11 лет назад
Bourne again shell. Misspellings make me angry more than your lack of including all the other linux shells.
@FeelItRising
@FeelItRising 13 лет назад
so muxh linux!!! sponsored by Netflix?
@Emorejets
@Emorejets 13 лет назад
WPA hacking?
@fission1110
@fission1110 13 лет назад
@blake9753 a blake. Yep, just type "read randomvar" this will allow the user to input information, and then save it into the variable "$randomvar"
@SynxS
@SynxS 13 лет назад
@afonso360 use a VPN service
@Rufeo0
@Rufeo0 13 лет назад
should have mentioned how to use variables, pretty pointless without variables
@FanColdRikkie
@FanColdRikkie 13 лет назад
:D
@beardymonger
@beardymonger 13 лет назад
8.8.8.8 = One of Google's DNS servers. Don't use if you don't want to be tracked by Google. Just kidding....
@afonso360
@afonso360 13 лет назад
i woud like netflix but im in europe
Далее
HakTip - Packet Sniffing 101: Promiscuous Mode
6:53
Просмотров 115 тыс.
Linux Command-Line Tips & Tricks: Over 15 Examples!
31:37
HakTip - Bash Basics: Ping, Date and While
7:06
Просмотров 50 тыс.
Bash for Bug Bounty & Ethical Hacking | Basic Course
40:33
Terminal vs. Bash vs. Command line vs. Prompt
11:06
Просмотров 236 тыс.
Bash Scripting Tutorial for Beginners
47:57
Просмотров 481 тыс.
I'll Let Myself In: Tactics of Physical Pen Testers
44:56