< Return to Video

apt, dpkg, git, Python PiP (Linux Package Management) // Linux for Hackers // EP 5

  • 0:00 - 0:02
    So how do you install stuff on Linux?
  • 0:02 - 0:04
    Like if you want to install
  • 0:04 - 0:06
    software, programs, or packing tools, what
  • 0:06 - 0:07
    do you do?
  • 0:07 - 0:09
    If you're fairly new to Linux, you might
  • 0:09 - 0:10
    be a bit lost. Don't worry,
  • 0:10 - 0:12
    I got you. In this video, I'm going to
  • 0:12 - 0:13
    show you how to install pretty much
  • 0:13 - 0:15
    anything on Linux. Everything from common
  • 0:15 - 0:17
    tools that everyone uses to even some
  • 0:17 - 0:19
    custom hacking stuff that other hackers
  • 0:19 - 0:19
    create
  • 0:19 - 0:21
    you can download on GitHub. How do you do
  • 0:21 - 0:23
    all that? Let's get started.
  • 0:23 - 0:31
    [Music]
  • 0:31 - 0:33
    This is episode 5 of Linux for hackers
  • 0:33 - 0:34
    and everyone because
  • 0:34 - 0:36
    everyone needs to learn Linux. In this
  • 0:36 - 0:38
    episode, we're covering Linux package
  • 0:38 - 0:39
    management or basically how do you
  • 0:39 - 0:41
    manage all the software and the programs
  • 0:41 - 0:43
    on your Linux machine? And I'm going to
  • 0:43 - 0:44
    do my best to cover pretty much
  • 0:44 - 0:45
    everything, so if you're looking for any
  • 0:45 - 0:47
    particular way to install something,
  • 0:47 - 0:48
    check the timestamps, jump to it.
  • 0:48 - 0:51
    Also, I want you to do this with me. Every
  • 0:51 - 0:52
    command I type, everything I
  • 0:52 - 0:54
    install, do it with me. The best way to
  • 0:54 - 0:56
    learn anything is hands-on,
  • 0:56 - 0:58
    especially Linux, and you can do that for
  • 0:58 - 0:59
    free
  • 0:59 - 1:01
    right now thanks to our sponsor Hack The
  • 1:01 - 1:03
    Box Academy. Get signed up for free at
  • 1:03 - 1:04
    the link in the description, and you'll
  • 1:04 - 1:05
    get access to a
  • 1:05 - 1:08
    pwn box which is as cool as it sounds.
  • 1:08 - 1:09
    It's basically a Linux computer that you
  • 1:09 - 1:10
    can use
  • 1:10 - 1:12
    right here in your browser, it's amazing.
  • 1:12 - 1:13
    And it's free, like
  • 1:13 - 1:15
    yeah, just do it, just do it. Also what the
  • 1:15 - 1:17
    junk is Hack The Box Academy.
  • 1:17 - 1:18
    Well, I like to think of them as
  • 1:18 - 1:20
    Hogwarts for hackers. You're a wizard
  • 1:20 - 1:21
    Harry.
  • 1:21 - 1:22
    They teach you how to become a hacker
  • 1:22 - 1:24
    from zero to whatever you need to be.
  • 1:24 - 1:26
    It's awesome. They also recently came out
  • 1:26 - 1:27
    with a student subscription so if you
  • 1:27 - 1:29
    are a student, you get a discounted rate.
  • 1:29 - 1:31
    And you get CPE credits for completing
  • 1:31 - 1:32
    tier 1 modules and above,
  • 1:32 - 1:35
    it's awesome. Check it out, link below. So
  • 1:35 - 1:36
    get your pwn box ready,
  • 1:36 - 1:37
    grab your cup of coffee, what are you
  • 1:37 - 1:40
    drinking? I'm drinking
  • 1:40 - 1:42
    networkchuck.coffee, check it out. Let's get
  • 1:42 - 1:43
    started. Oh, and by the way,
  • 1:43 - 1:45
    have you hacked the YouTube algorithm
  • 1:45 - 1:46
    today? Let's make sure you do. Like this
  • 1:46 - 1:48
    video, comment, subscribe, notification
  • 1:48 - 1:49
    bell.
  • 1:49 - 1:51
    Let's hack YouTube today ethically, of
  • 1:51 - 1:53
    course. [Sips Coffee]
  • 1:53 - 1:55
    Oh, let's get started. Okay, as always, get
  • 1:55 - 1:57
    logged in to Hack The Box Academy and
  • 1:57 - 1:57
    launch the
  • 1:57 - 1:59
    Linux fundamentals module right here. And
  • 1:59 - 2:00
    today we're going to be focusing on
  • 2:00 - 2:03
    package management which is right around
  • 2:03 - 2:05
    here. So go ahead and click on that. Now
  • 2:05 - 2:07
    again, freaking fantastic stuff right
  • 2:07 - 2:08
    here, but the stuff you want to look at
  • 2:08 - 2:10
    right now with me as you follow along
  • 2:10 - 2:10
    this video
  • 2:10 - 2:13
    is right around here. Scroll down, click
  • 2:13 - 2:15
    on start instance to start your killer
  • 2:15 - 2:16
    awesome pwn box.
  • 2:16 - 2:17
    And while that's brewing, perfect time
  • 2:17 - 2:21
    for a coffee break. [Sips Coffee]
  • 2:21 - 2:22
    And mine is ready. I want to jump in
  • 2:22 - 2:24
    there and get this party started. So in
  • 2:24 - 2:26
    Linux, the stuff we want to install,
  • 2:26 - 2:27
    our apps, our programs, like you know,
  • 2:27 - 2:29
    Discord or Firefox or
  • 2:29 - 2:31
    Minecraft. Anything that we want to install, it's
  • 2:31 - 2:32
    contained in something called
  • 2:32 - 2:35
    packages. We install packages. Packages
  • 2:35 - 2:37
    are the thing. Packages, packages, packages.
  • 2:37 - 2:38
    Sorry, I've already had too much coffee
  • 2:38 - 2:40
    today. [Laughs]
  • 2:40 - 2:41
    No such thing as too much. How do we
  • 2:41 - 2:43
    install these packages?
  • 2:43 - 2:44
    Well, as you may have guessed from the
  • 2:44 - 2:46
    intro, it's something called a package
  • 2:46 - 2:48
    manager. Now there isn't just one package
  • 2:48 - 2:49
    manager. Of course, there's not just one.
  • 2:49 - 2:50
    It wouldn't be that
  • 2:50 - 2:52
    simple, right? It's not. There are two main
  • 2:52 - 2:54
    ones we see all the time though. One is
  • 2:54 - 2:55
    called dpkg
  • 2:55 - 2:57
    or d package, that's the way I like to
  • 2:57 - 2:58
    say it. The other you'll see all the time
  • 2:58 - 2:59
    is apt,
  • 2:59 - 3:01
    apt. Now, I'll go ahead and get this out
  • 3:01 - 3:03
    of the way. Apt is awesome,
  • 3:03 - 3:05
    it's super easy to do. You can install
  • 3:05 - 3:07
    things in a flash, no worries. But I'm not
  • 3:07 - 3:08
    going to show you that one just yet. You
  • 3:08 - 3:09
    got to earn that, you got to pay your
  • 3:09 - 3:11
    dues. I'm going to show you the harder
  • 3:11 - 3:13
    way first so you can appreciate
  • 3:13 - 3:14
    what this is and what it does for us.
  • 3:14 - 3:16
    Don't you want to do that? Yes. I'm
  • 3:16 - 3:17
    answering for you. So first, I want to
  • 3:17 - 3:18
    show you
  • 3:18 - 3:20
    d package or dpkg, I said it right that
  • 3:20 - 3:22
    time. Now, I say hard, it's not too crazy,
  • 3:22 - 3:25
    but it does look stupid compared to apt.
  • 3:25 - 3:26
    It's referred to as a
  • 3:26 - 3:29
    low-level package manager because it's
  • 3:29 - 3:30
    kind of and this is my opinion,
  • 3:30 - 3:32
    kind of dumb. I mean, sure, it'll do the
  • 3:32 - 3:34
    job. It'll install your software. It'll
  • 3:34 - 3:36
    install your packages.
  • 3:36 - 3:38
    It'll uninstall or remove them, but it
  • 3:38 - 3:39
    has two major,
  • 3:39 - 3:41
    huge flaws that I hate. So let's go ahead
  • 3:41 - 3:43
    and launch our terminal, our shell,
  • 3:43 - 3:45
    the green or yellow thing up here, and
  • 3:45 - 3:46
    we're gonna install our first
  • 3:46 - 3:47
    application,
  • 3:47 - 3:48
    Discord. And it's gonna be hard, it's
  • 3:48 - 3:49
    gonna be difficult because we're using
  • 3:49 - 3:51
    the more difficult way of doing this.
  • 3:51 - 3:52
    And already, we've hit our first flaw
  • 3:52 - 3:54
    because to install Discord, we have to
  • 3:54 - 3:54
    go
  • 3:54 - 3:56
    find it and download the package. So
  • 3:56 - 3:57
    let's go ahead and launch our web
  • 3:57 - 4:00
    browser. We'll go to discord.com.
  • 4:00 - 4:02
    Click on the little side panel over here,
  • 4:02 - 4:03
    and click on
  • 4:03 - 4:05
    download. We'll scroll down and right
  • 4:05 - 4:06
    here we have download for
  • 4:06 - 4:09
    Linux. Click on that. That's going to say
  • 4:09 - 4:11
    deb, who's deb?
  • 4:11 - 4:12
    I'll explain here in a minute. Click on
  • 4:12 - 4:14
    deb. Now, instead of open with, I want you
  • 4:14 - 4:15
    to do save
  • 4:15 - 4:16
    file, just work with me here. Click on
  • 4:16 - 4:18
    that, save file, and then click ok. And it
  • 4:18 - 4:20
    should go pretty stinking quick. So now
  • 4:20 - 4:21
    we can close Firefox
  • 4:21 - 4:22
    and get back to where we love being, our
  • 4:22 - 4:24
    terminal, our bash shell,
  • 4:24 - 4:26
    yes. First thing we want to do is get to
  • 4:26 - 4:28
    our downloads folder. If we type in ls to
  • 4:28 - 4:29
    list our contents of our stuff here, we
  • 4:29 - 4:31
    have a downloads folder, let's cd to that.
  • 4:31 - 4:32
    So cd
  • 4:32 - 4:33
    downloads. Type in ls to see what's
  • 4:33 - 4:35
    inside. And there's our Discord right
  • 4:35 - 4:36
    there.
  • 4:36 - 4:39
    Our Discord Debby. When you see .deb, that's
  • 4:39 - 4:40
    the file extension for
  • 4:40 - 4:43
    packages in Linux, specifically Debian
  • 4:43 - 4:43
    based,
  • 4:43 - 4:45
    which is what we're on right now. We're
  • 4:45 - 4:47
    using Parrot OS which is a Debian-based
  • 4:47 - 4:47
    system.
  • 4:47 - 4:49
    It's sort of like .exe you see on
  • 4:49 - 4:50
    Windows and
  • 4:50 - 4:52
    .dmg you see with Mac. Now, if you do
  • 4:52 - 4:54
    happen to be on another Linux system
  • 4:54 - 4:55
    that's maybe not debian-based,
  • 4:55 - 4:59
    maybe it's CentOS, maybe it's openSUSE,
  • 4:59 - 5:02
    Red Hat, instead of .deb, you'll see .rpm, but
  • 5:02 - 5:03
    we're not going to cover that today.
  • 5:03 - 5:03
    We're going to cover
  • 5:03 - 5:05
    debian-based systems. So how do we
  • 5:05 - 5:06
    install deb here,
  • 5:06 - 5:08
    our Discord server or not server, our
  • 5:08 - 5:09
    Discord application. It's pretty
  • 5:09 - 5:11
    straightforward actually. We'll type in
  • 5:11 - 5:11
    dee pay,
  • 5:11 - 5:15
    dee pay, I'll never get this right. Dpkg
  • 5:15 - 5:17
    for d package. We'll do a dash 'i' for
  • 5:17 - 5:18
    install, and then we'll specify our
  • 5:18 - 5:20
    package. There it is, that simple. But no
  • 5:20 - 5:21
    it's not, though.
  • 5:21 - 5:24
    No, you can do this, but it's going to
  • 5:24 - 5:25
    fail. Let's do it anyway. This is going to
  • 5:25 - 5:27
    reveal the second major flaw with d
  • 5:27 - 5:30
    package. Oh wait, that wasn't it. We do
  • 5:30 - 5:31
    need sudo
  • 5:31 - 5:32
    privileges. If you don't know what sudo
  • 5:32 - 5:34
    means, go watch episode four. So sudo
  • 5:34 - 5:37
    d package, let's do that now. Flaw coming.
  • 5:37 - 5:39
    So far so good. Looking good, right?
  • 5:39 - 5:42
    Whoa, whoa, whoa, whoa, whoa, error. I hate seeing
  • 5:42 - 5:42
    errors.
  • 5:42 - 5:45
    Problems, more specifically, dependency
  • 5:45 - 5:46
    problems. And that's
  • 5:46 - 5:48
    the second major flaw with d package. You
  • 5:48 - 5:50
    see, most packages in Linux, they depend
  • 5:50 - 5:51
    on
  • 5:51 - 5:53
    other packages to work. For example,
  • 5:53 - 5:55
    Discord here, if I scroll up a bit, Discord
  • 5:55 - 5:56
    depends on the
  • 5:56 - 5:58
    libappindicator1, which is not
  • 5:58 - 5:59
    installed, and the
  • 5:59 - 6:01
    libc++1, and it's not
  • 6:01 - 6:02
    installed. Those are two packages that
  • 6:02 - 6:04
    have to be installed for Discord to work.
  • 6:04 - 6:05
    So d package, the dummy is like
  • 6:05 - 6:08
    hey, yeah sure, I'll install Discord for
  • 6:08 - 6:10
    you, but it needs two other things, and
  • 6:10 - 6:12
    it's just not gonna work, sorry. You
  • 6:12 - 6:13
    need to go get those two other things
  • 6:13 - 6:17
    yourself. Okay, lazy. So yeah, sure, we could
  • 6:17 - 6:18
    go out and find these and
  • 6:18 - 6:20
    install it using d package, but that's
  • 6:20 - 6:22
    stupid. And this is where apt
  • 6:22 - 6:24
    shines, it's better. Let's talk about apt.
  • 6:24 - 6:26
    Apt is beautiful, and if you've ever
  • 6:26 - 6:27
    installed anything on Linux, any kind of
  • 6:27 - 6:29
    debian-based system, you've probably used
  • 6:29 - 6:29
    apt
  • 6:29 - 6:31
    before. It stands for advanced package
  • 6:31 - 6:33
    tool, and when comparing that to d
  • 6:33 - 6:36
    package, duh, it's advanced. D package is
  • 6:36 - 6:36
    stupid.
  • 6:36 - 6:38
    Anyways, it has its place. Sometimes you
  • 6:38 - 6:40
    may have to install something manually
  • 6:40 - 6:40
    with a
  • 6:40 - 6:42
    .deb file, whatever, we'll get to that, why
  • 6:42 - 6:43
    that is in a second.
  • 6:43 - 6:46
    Coffee break for a second, real quick. [Sips Coffee]
  • 6:46 - 6:47
    So let's install something with apt. Now,
  • 6:47 - 6:49
    first thing we're going to do real quick,
  • 6:49 - 6:52
    new command time. We'll do sudo apt
  • 6:52 - 6:54
    and we'll do the command update. I'll
  • 6:54 - 6:55
    explain that here in a moment, just go
  • 6:55 - 6:56
    ahead and do it. Let it do its thing.
  • 6:56 - 6:58
    Now time to install something, so do sudo
  • 6:58 - 6:59
    apt.
  • 6:59 - 7:01
    This time, instead of update, we'll do
  • 7:01 - 7:02
    install, and then we'll just
  • 7:02 - 7:04
    name the program or package we want to
  • 7:04 - 7:05
    install. I'm going to install an old
  • 7:05 - 7:06
    favorite,
  • 7:06 - 7:08
    pidgin. Remember pidgin? The open
  • 7:08 - 7:11
    source instant messaging app. [Laughs]
  • 7:11 - 7:14
    So instead of having to specify the .deb
  • 7:14 - 7:16
    file, instead of talking to deb, all we
  • 7:16 - 7:18
    have to do is reference the package name
  • 7:18 - 7:20
    which is pidgin and that's it. Now, it's
  • 7:20 - 7:22
    not going to work.
  • 7:22 - 7:23
    And it's not his fault. It's actually d
  • 7:23 - 7:25
    package's fault, I'll show you. Apt was
  • 7:25 - 7:26
    smart. It went out and found everything,
  • 7:26 - 7:27
    but then it's like whoa, whoa,
  • 7:27 - 7:30
    hold on, Discord, we noticed that it's
  • 7:30 - 7:31
    kind of broken, we don't have the
  • 7:31 - 7:31
    dependencies
  • 7:31 - 7:33
    of the lib indicator and the c++.
  • 7:33 - 7:35
    You might want to fix that. Dumb old d
  • 7:35 - 7:37
    package, but it even gives us a way to
  • 7:37 - 7:37
    fix it. Apt
  • 7:37 - 7:39
    fix broken install. It'll fix Discord
  • 7:39 - 7:40
    for us, so let's do that real quick. I'm
  • 7:40 - 7:41
    just going to copy that command.
  • 7:41 - 7:44
    Apt fix broken install. Let's paste
  • 7:44 - 7:46
    that in there. I'll do a control 'a' to get
  • 7:46 - 7:47
    to the front of my command and type in
  • 7:47 - 7:48
    sudo right before it.
  • 7:48 - 7:51
    And let's fix some Discord. It's
  • 7:51 - 7:52
    going to install those two packages.
  • 7:52 - 7:55
    Hit enter. Thank you, apt. So it fixed that.
  • 7:55 - 7:56
    I'm going to clear my screen, and let's
  • 7:56 - 7:58
    try to install Pidgin once more.
  • 7:58 - 8:02
    Up arrow twice or three times, four times.
  • 8:02 - 8:03
    There we go. And let's hit enter on
  • 8:03 - 8:05
    Pidgin right now. Now, real quick before I
  • 8:05 - 8:06
    hit enter to say yeah, let's continue
  • 8:06 - 8:07
    this, let's scroll just a little bit here.
  • 8:07 - 8:10
    Notice it's not only installing Pidgin,
  • 8:10 - 8:12
    super smart, amazing apt goes oh,
  • 8:12 - 8:13
    hey, we have some dependencies. The
  • 8:13 - 8:15
    following new packages will also be
  • 8:15 - 8:16
    installed as well.
  • 8:16 - 8:18
    And it's kind of a lot right, but it's
  • 8:18 - 8:20
    going to do it for us, which is what you
  • 8:20 - 8:21
    expect. That's like- you
  • 8:21 - 8:22
    want that to happen. So let's
  • 8:22 - 8:24
    go ahead and do that, hit enter. Coffee
  • 8:24 - 8:24
    break.
  • 8:24 - 8:27
    Very short, I love this. Actually long
  • 8:27 - 8:30
    coffee break, it's kind of long, isn't it?
  • 8:30 - 8:32
    And that was it. I want to try launching
  • 8:32 - 8:35
    Pidgin just by typing in Pidgin. [Laughs]
  • 8:35 - 8:37
    Look at that. I'm not going to use it, but
  • 8:37 - 8:38
    that was pretty cool, right? Way easier
  • 8:38 - 8:39
    than d-package. Now, I'm not sure if I
  • 8:39 - 8:41
    mentioned this before, but apt is a
  • 8:41 - 8:42
    high-level
  • 8:42 - 8:44
    package manager, which basically means
  • 8:44 - 8:46
    it's easier for us to use. Now, one of the
  • 8:46 - 8:48
    main differences between itself
  • 8:48 - 8:50
    and d-package is that d-package required
  • 8:50 - 8:51
    us to download the
  • 8:51 - 8:54
    .deb file, the actual package file. Apt
  • 8:54 - 8:54
    doesn't
  • 8:54 - 8:56
    need that or use that. As you saw in our
  • 8:56 - 8:58
    example, apt just needed the
  • 8:58 - 9:00
    package name, but how does that work? Apt
  • 9:00 - 9:02
    will rely on a thing called a repository.
  • 9:02 - 9:03
    A repository is basically a storage
  • 9:03 - 9:05
    location or essentially just someone's
  • 9:05 - 9:06
    server
  • 9:06 - 9:07
    that has a collection of all the
  • 9:07 - 9:09
    software that we might want to use. The
  • 9:09 - 9:11
    most common stuff anyway. So when we
  • 9:11 - 9:12
    typed in apt
  • 9:12 - 9:14
    install pidgin, apt went out to his
  • 9:14 - 9:16
    repository and goes hey, where's this
  • 9:16 - 9:17
    pidgin thing at? You got it? And the
  • 9:17 - 9:18
    repository said yep,
  • 9:18 - 9:20
    here it is, go ahead and download it, it's
  • 9:20 - 9:21
    good. And going back to that first
  • 9:21 - 9:23
    command we entered, what was it? Do you
  • 9:23 - 9:23
    know what it was?
  • 9:23 - 9:26
    The first command was apt update, and
  • 9:26 - 9:27
    what that did is apt
  • 9:27 - 9:30
    went out to the repository and said hey,
  • 9:30 - 9:31
    give me all those packages, what you got
  • 9:31 - 9:33
    there? I want a list of everything you
  • 9:33 - 9:33
    have.
  • 9:33 - 9:35
    And the repository replies with a list of
  • 9:35 - 9:37
    everything he has. And by the way, this is
  • 9:37 - 9:37
    something you want to do
  • 9:37 - 9:39
    every time you install something. Before
  • 9:39 - 9:41
    you say apt install whatever tool you
  • 9:41 - 9:42
    want to install,
  • 9:42 - 9:45
    do apt update to update your list of
  • 9:45 - 9:45
    stuff
  • 9:45 - 9:47
    because these repositories are owned by
  • 9:47 - 9:49
    someone else and they're regularly
  • 9:49 - 9:50
    updated. There are a lot of repositories
  • 9:50 - 9:51
    out there, which
  • 9:51 - 9:53
    ones are we using? Well, let me show you.
  • 9:53 - 9:54
    There's an easy way to do this, and we'll
  • 9:54 - 9:56
    use the apt command here as well.
  • 9:56 - 9:58
    New command time. The command will be- and
  • 9:58 - 10:00
    we're going to always start with sudo,
  • 10:00 - 10:03
    apt space edit dash sources,
  • 10:03 - 10:05
    and hit enter. And it's so nice, it asks
  • 10:05 - 10:07
    us what text editor we want to use.
  • 10:07 - 10:09
    Nano, my favorite one, I don't care. Now,
  • 10:09 - 10:11
    Parrot pulls like a bait and switch.
  • 10:11 - 10:12
    Normally you'll have your list of
  • 10:12 - 10:15
    repositories in this file. Parrot's like
  • 10:15 - 10:15
    nah,
  • 10:15 - 10:17
    nah, nah, we put our stuff somewhere else.
  • 10:17 - 10:19
    It tells us the parrot repo is located
  • 10:19 - 10:20
    at this location right here, so I want to
  • 10:20 - 10:21
    do right now is just
  • 10:21 - 10:23
    highlight that, copy it, go ahead and do
  • 10:23 - 10:24
    that with me.
  • 10:24 - 10:26
    Let's control x to get out of this file,
  • 10:26 - 10:28
    and we're going to
  • 10:28 - 10:30
    cat that file. So I'll type in cat. Paste
  • 10:30 - 10:32
    that file there, and hit enter.
  • 10:32 - 10:33
    I must have not highlighted the entire
  • 10:33 - 10:35
    thing, yeah, it's parrot dot list. Oh yeah,
  • 10:35 - 10:37
    I've forgot the list, dot list.
  • 10:37 - 10:39
    Dot list, there we go. And actually
  • 10:39 - 10:41
    instead of cat, let's go ahead and just
  • 10:41 - 10:43
    nano that. So I'll do sudo nano just so
  • 10:43 - 10:45
    we can see it a bit cleaner I think.
  • 10:45 - 10:47
    Dot list, yeah, that's better. So right
  • 10:47 - 10:48
    here we have a list of servers or
  • 10:48 - 10:49
    repositories
  • 10:49 - 10:52
    that apt will look to to pull packages
  • 10:52 - 10:52
    from.
  • 10:52 - 10:55
    Notice it does have the deb preface
  • 10:55 - 10:56
    before it, and what do you say we go
  • 10:56 - 10:57
    check it out real quick? We can actually
  • 10:57 - 10:59
    just click on that link here,
  • 10:59 - 11:02
    control click. Yeah that's what it was, control
  • 11:02 - 11:03
    and click. We're browsing the repository.
  • 11:03 - 11:05
    So if I jump into the pool directory
  • 11:05 - 11:07
    right here, go to let's say the main
  • 11:07 - 11:09
    directory. We got a bunch of stuff in
  • 11:09 - 11:10
    here.
  • 11:10 - 11:12
    Let's go to the n's, let's go to
  • 11:12 - 11:13
    n. And look,
  • 11:13 - 11:15
    there's nmap right there in the
  • 11:15 - 11:17
    repository. So when you do sudo apt
  • 11:17 - 11:18
    install
  • 11:18 - 11:20
    nmap, it looks at that repository and
  • 11:20 - 11:21
    goes oh, there it is,
  • 11:21 - 11:23
    let's pull that down. Now, sometimes the
  • 11:23 - 11:25
    tool you want to install is not in these
  • 11:25 - 11:26
    repositories. Like for example, this is
  • 11:26 - 11:28
    the one that's provided by Parrot OS.
  • 11:28 - 11:29
    What do you do then? Well most of the
  • 11:29 - 11:31
    time, these tools will have an
  • 11:31 - 11:32
    alternative way to install it. We'll
  • 11:32 - 11:33
    cover that here in a moment.
  • 11:33 - 11:34
    Or they'll have their own repositories
  • 11:34 - 11:36
    that you can add to the sources list.
  • 11:36 - 11:37
    They'll document it for you. They'll say hey,
  • 11:37 - 11:39
    here's our source. Add that to your
  • 11:39 - 11:41
    sources list, do a sudo apt
  • 11:41 - 11:43
    update, sudo apt install, you're solid.
  • 11:43 - 11:44
    Now, you're ready?
  • 11:44 - 11:47
    New commands with an 's' time. Apt has some
  • 11:47 - 11:49
    cool stuff we can do with it.
  • 11:49 - 11:51
    Now, first always you can do sudo apt dash h-
  • 11:51 - 11:53
    what the heck am I doing here?
  • 11:53 - 11:54
    It'll tell you some stuff you can play
  • 11:54 - 11:56
    with, some of those switches you can use.
  • 11:56 - 11:57
    Let's walk through a few real quick.
  • 11:57 - 11:59
    Sudo apt list will list all the
  • 11:59 - 12:01
    available packages in your-
  • 12:01 - 12:04
    I can't talk, repositories. You can
  • 12:04 - 12:06
    also do apt
  • 12:06 - 12:08
    list dash dash installed to see what
  • 12:08 - 12:10
    your system is installed with, very handy.
  • 12:10 - 12:11
    If you want to search through that list,
  • 12:11 - 12:13
    just do a pipe at the end of that.
  • 12:13 - 12:15
    Pipe, type in grep, we'll explain that
  • 12:15 - 12:17
    sometime in another episode, and then
  • 12:17 - 12:18
    just
  • 12:18 - 12:19
    search for something, like let's search
  • 12:19 - 12:21
    for, let's say, anything that begins with
  • 12:21 - 12:23
    nmap. And there it is. Nmap is installed
  • 12:23 - 12:24
    right there. Let's say you want to learn
  • 12:24 - 12:26
    more about what tools you have installed,
  • 12:26 - 12:27
    like what the junk
  • 12:27 - 12:28
    is that, what does it do? You can do
  • 12:28 - 12:30
    sudo apt
  • 12:30 - 12:32
    show or show me what it is, let's just
  • 12:32 - 12:33
    say nmap.
  • 12:33 - 12:35
    Show nmap, and it'll dang tell you. The
  • 12:35 - 12:36
    network mapper, and it tells you all
  • 12:36 - 12:38
    about it. You can also do
  • 12:38 - 12:41
    apt search, and let's just say again, nmap.
  • 12:41 - 12:42
    And it's going to search through the
  • 12:42 - 12:43
    description of a lot of stuff
  • 12:43 - 12:45
    and show you all the stuff, and that's an
  • 12:45 - 12:47
    easy way to search through a bunch of
  • 12:47 - 12:48
    packages. Now, we covered how to install
  • 12:48 - 12:51
    packages, but how do we remove stuff, how
  • 12:51 - 12:52
    do we uninstall something?
  • 12:52 - 12:54
    Two ways. Apt is still the guy for this.
  • 12:54 - 12:56
    So sudo apt,
  • 12:56 - 12:57
    new command time, remove. Pretty
  • 12:57 - 12:59
    self-explanatory. So if you wanted to
  • 12:59 - 13:00
    remove
  • 13:00 - 13:01
    Pidgin, just type that in, hit enter, and
  • 13:01 - 13:03
    it's going to say whoa, whoa, whoa,
  • 13:03 - 13:04
    are you sure? And I'm going to say no, not
  • 13:04 - 13:06
    right now because I got more to tell you.
  • 13:06 - 13:08
    Remove is kind of a safe command because
  • 13:08 - 13:09
    it will remove the application, but not
  • 13:09 - 13:11
    your user data. Basically the config you
  • 13:11 - 13:13
    might have put into the application. So
  • 13:13 - 13:14
    if you removed it accidentally or you
  • 13:14 - 13:16
    want to reinstall it, all that stuff will
  • 13:16 - 13:17
    still be there. Now, if you're confident
  • 13:17 - 13:19
    you don't want this dumb app anymore, you
  • 13:19 - 13:21
    want it gone, you can use a different
  • 13:21 - 13:22
    command, the purge.
  • 13:22 - 13:25
    So we'll swap out remove for purge. This
  • 13:25 - 13:27
    sounds so intense. We're gonna purge
  • 13:27 - 13:28
    Pidgin. This will remove
  • 13:28 - 13:29
    everything. And let's go ahead and do
  • 13:29 - 13:31
    that. So if we do our command that we
  • 13:31 - 13:32
    learned earlier,
  • 13:32 - 13:35
    sudo apt list dash dash
  • 13:35 - 13:38
    installed, we'll grep for anything that
  • 13:38 - 13:39
    begins with
  • 13:39 - 13:42
    Pidgin. So it did remove the main package,
  • 13:42 - 13:43
    but not this secondary one, the Pidgin
  • 13:43 - 13:45
    data. So I want to remove that real quick.
  • 13:45 - 13:47
    Let's purge Pidgin data. Let's see if
  • 13:47 - 13:50
    Pidgin is here now.
  • 13:50 - 13:52
    No Pidgin here. All right, two more useful
  • 13:52 - 13:53
    commands with apt.
  • 13:53 - 13:56
    First sudo apt upgrade. As you might
  • 13:56 - 13:58
    imagine, sometimes your applications, your
  • 13:58 - 13:58
    packages
  • 13:58 - 14:00
    get updates. You would hope they get
  • 14:00 - 14:01
    updates, and this is the way to update
  • 14:01 - 14:03
    those packages. Now, normally you'll see
  • 14:03 - 14:03
    this
  • 14:03 - 14:06
    command combined with the update command.
  • 14:06 - 14:08
    So you might see it like this: sudo apt
  • 14:08 - 14:10
    update to go to the repository and say
  • 14:10 - 14:11
    repository,
  • 14:11 - 14:12
    can you tell me if the packages have
  • 14:12 - 14:14
    been updated, otherwise you wouldn't know
  • 14:14 - 14:15
    about it, right? So update that and then you'll
  • 14:15 - 14:16
    see an '&&',
  • 14:16 - 14:18
    which allows us to do two commands in
  • 14:18 - 14:21
    one line which is awesome. Sudo apt
  • 14:21 - 14:24
    upgrade. So check the repository and then
  • 14:24 - 14:25
    update everything. Now, there is another
  • 14:25 - 14:27
    version of this. Now, upgrade will just
  • 14:27 - 14:28
    upgrade your applications if they need
  • 14:28 - 14:31
    upgrading. Another one is full dash
  • 14:31 - 14:31
    upgrade.
  • 14:31 - 14:33
    Full upgrade will actually remove
  • 14:33 - 14:35
    previously installed applications
  • 14:35 - 14:37
    or packages that aren't required for the
  • 14:37 - 14:39
    upgrade, so maybe old versions of things.
  • 14:39 - 14:40
    Now, I do want to jump back to our old
  • 14:40 - 14:42
    guy d package real quick.
  • 14:42 - 14:44
    He does a lot of the stuff too. I'm not
  • 14:44 - 14:45
    going to go over everything, but just
  • 14:45 - 14:46
    giving an example.
  • 14:46 - 14:49
    Dpkg, if I do a dash 'l',
  • 14:49 - 14:51
    he'll also list all the install packages
  • 14:51 - 14:52
    on your system. I can do the same thing
  • 14:52 - 14:54
    as I did before with
  • 14:54 - 14:57
    mr apt by grepping his stuff and looking
  • 14:57 - 14:57
    for
  • 14:57 - 14:59
    anything that starts with nmap. That
  • 14:59 - 15:01
    didn't work, let's just try nmap.
  • 15:01 - 15:03
    There we go, and again, it has a lot of
  • 15:03 - 15:04
    the same switches and features. I'm not
  • 15:04 - 15:06
    going to do that again. So d package,
  • 15:06 - 15:09
    low-level, stupid. Apt, high-level, awesome.
  • 15:09 - 15:10
    But there's also one other thing worth
  • 15:10 - 15:11
    mentioning.
  • 15:11 - 15:13
    It's something called aptitude, which
  • 15:13 - 15:15
    starts with apt,
  • 15:15 - 15:17
    but just has a full word to it. This also
  • 15:17 - 15:18
    is high-level,
  • 15:18 - 15:21
    but it's sort of like apt on steroids a
  • 15:21 - 15:22
    bit, it does more. Now, I'm not going to go
  • 15:22 - 15:24
    too deep into it, but just give you an
  • 15:24 - 15:26
    example of what it might do, let's just
  • 15:26 - 15:27
    type in
  • 15:27 - 15:30
    aptitude- actually, I'll do sudo aptitude.
  • 15:30 - 15:32
    Just type that in just like that and hit enter.
  • 15:32 - 15:34
    Oh, fancy.
  • 15:34 - 15:35
    You kind of get a nice little
  • 15:35 - 15:37
    interactive GUI thing in your command
  • 15:37 - 15:39
    line. So that's fun. Anyways, I'm going to
  • 15:39 - 15:40
    quit, but that's also a package manager
  • 15:40 - 15:41
    that's high-level
  • 15:41 - 15:43
    that will get the job done for you. Now, I
  • 15:43 - 15:45
    told you, installing stuff in Linux
  • 15:45 - 15:47
    can be very easy, but there's a lot of
  • 15:47 - 15:49
    ways to do it. One very popular way that
  • 15:49 - 15:51
    I personally think is amazing
  • 15:51 - 15:53
    is called snap. Now, not like the previous
  • 15:53 - 15:54
    episode where Thanos
  • 15:54 - 15:57
    destroys users and stuff. No, no. This
  • 15:57 - 15:59
    thing called snap is also kind of a
  • 15:59 - 16:00
    package manager. When you install it if
  • 16:00 - 16:02
    you don't already have it installed, it's
  • 16:02 - 16:04
    actually called snapd.
  • 16:04 - 16:06
    But snap isn't really a
  • 16:06 - 16:08
    repository, it's more of like a store,
  • 16:08 - 16:10
    a snap store. And it works very similarly
  • 16:10 - 16:12
    to apt as far as actually using the
  • 16:12 - 16:13
    command line.
  • 16:13 - 16:14
    But the main difference here is that
  • 16:14 - 16:16
    when let's say you're a developer and
  • 16:16 - 16:17
    you make your app,
  • 16:17 - 16:18
    and you want people to be able to
  • 16:18 - 16:20
    install it easily right now on any Linux
  • 16:20 - 16:22
    system. It might take some time to get
  • 16:22 - 16:22
    your
  • 16:22 - 16:24
    app on a repository, especially one
  • 16:24 - 16:26
    that's already existing on the system
  • 16:26 - 16:28
    like Ubuntu's, ParrotOS's, Kali's, whatever.
  • 16:28 - 16:30
    A better way is to be able to add your
  • 16:30 - 16:31
    app to a store,
  • 16:31 - 16:33
    and then it becomes immediately
  • 16:33 - 16:35
    available just like in a snap, right? Is
  • 16:35 - 16:36
    that why it's called that? I don't know.
  • 16:36 - 16:38
    So that's what snap is for. They can add
  • 16:38 - 16:40
    their app to the snap store,
  • 16:40 - 16:43
    and it's available in a snap, right? [Laughs]
  • 16:43 - 16:45
    I don't know, so it's pretty easy, check
  • 16:45 - 16:45
    it out. So if you don't- again, if you
  • 16:45 - 16:47
    don't already have snap installed,
  • 16:47 - 16:49
    we do on the system, but you'd just do apt
  • 16:49 - 16:50
    install snapd.
  • 16:50 - 16:53
    You would- [Laughs] You would use apt to install
  • 16:53 - 16:54
    another package manager.
  • 16:54 - 16:56
    But anyways, a lot of the modern apps do
  • 16:56 - 16:58
    this. So let's install something like
  • 16:58 - 17:00
    I don't know, VS Code. I love VS Code.
  • 17:00 - 17:03
    It's my favorite IDE, code editor, whatever it
  • 17:03 - 17:03
    is,
  • 17:03 - 17:04
    whatever you want to call it. So let's
  • 17:04 - 17:07
    try sudo snap. This is all it is. It's
  • 17:07 - 17:10
    just like apt. Install and then your app.
  • 17:10 - 17:13
    Now, for VS Code, they do require the dash
  • 17:13 - 17:14
    dash classic
  • 17:14 - 17:16
    switch, but then we just put in the
  • 17:16 - 17:18
    package name, which in this case will be
  • 17:18 - 17:21
    code for VS Code, and that's it, just
  • 17:21 - 17:22
    press enter.
  • 17:22 - 17:24
    And it's going to start doing it. Snapd
  • 17:24 - 17:26
    going at it. Coffee break. [Sips Coffee]
  • 17:26 - 17:27
    Oh coffee's cold, I've been doing this
  • 17:27 - 17:29
    too long. And bam, it's installed. If i
  • 17:29 - 17:30
    just type in
  • 17:30 - 17:33
    code, I think, it should launch, I think.
  • 17:33 - 17:34
    Yeah, there it is.
  • 17:34 - 17:36
    Okay. So snap is pretty cool. I can see
  • 17:36 - 17:37
    this being one of the main ways we get
  • 17:37 - 17:38
    our apps now.
  • 17:38 - 17:41
    No, we're not quite done yet. There's more
  • 17:41 - 17:41
    ways to get
  • 17:41 - 17:43
    apps in Linux. Now, we've covered the main
  • 17:43 - 17:45
    ways, but the next few ways are
  • 17:45 - 17:47
    interesting because they're based on
  • 17:47 - 17:50
    Python and Ruby and more like
  • 17:50 - 17:52
    specific to a programming language. What
  • 17:52 - 17:54
    do I mean? Well, for example, when you run
  • 17:54 - 17:55
    a Python script,
  • 17:55 - 17:56
    there may be some specific dependencies
  • 17:56 - 17:59
    it needs, certain libraries, certain just
  • 17:59 - 18:00
    things that help it to work
  • 18:00 - 18:03
    or, you know, packages. Python has its own
  • 18:03 - 18:04
    package manager called
  • 18:04 - 18:07
    pip. We absolutely will be using this in
  • 18:07 - 18:08
    a moment when we
  • 18:08 - 18:11
    talk about Git so bu-
  • 18:11 - 18:12
    I almost said button your seat belts.
  • 18:12 - 18:14
    Buckle your seat belts unless your seat
  • 18:14 - 18:15
    belts have buttons, I don't know, that's
  • 18:15 - 18:16
    weird. Another one
  • 18:16 - 18:18
    would be Ruby. Ruby's a programming
  • 18:18 - 18:19
    language that's very popular.
  • 18:19 - 18:21
    And that will use a package manager
  • 18:21 - 18:23
    called RubyGems.
  • 18:23 - 18:24
    And the command you actually use is
  • 18:24 - 18:26
    called gems. You'll use gem
  • 18:26 - 18:29
    install, so similar syntax as every other
  • 18:29 - 18:30
    package manager we've seen,
  • 18:30 - 18:32
    but it's specific to Ruby. So you might
  • 18:32 - 18:34
    install rails. Never heard of Ruby on
  • 18:34 - 18:35
    Rails?
  • 18:35 - 18:37
    Well, you would actually do gem install
  • 18:37 - 18:39
    rails to, you know, mess with the rails.
  • 18:39 - 18:42
    But now, let's get to Git. Get to Git, okay.
  • 18:42 - 18:44
    Let's get it. I use
  • 18:44 - 18:47
    GitHub all the time to install hacking
  • 18:47 - 18:47
    scripts,
  • 18:47 - 18:49
    scripts that other hackers might create.
  • 18:49 - 18:51
    And they're amazing, they help you do all
  • 18:51 - 18:52
    kinds of amazing things. In fact, I've
  • 18:52 - 18:54
    done a number of tutorials that involve
  • 18:54 - 18:57
    using Git to go off to GitHub and grab
  • 18:57 - 18:58
    the information so you can use it on
  • 18:58 - 18:59
    your system.
  • 18:59 - 19:01
    But how do you do that? Now, first, a
  • 19:01 - 19:02
    requirement is that you would need to
  • 19:02 - 19:03
    have a Git
  • 19:03 - 19:06
    installed. So use your favorite package
  • 19:06 - 19:07
    manager, we've already learned about this.
  • 19:07 - 19:10
    Sudo apt install git. Now, thankfully we
  • 19:10 - 19:11
    already have Git installed on our system.
  • 19:11 - 19:12
    How do you-
  • 19:12 - 19:15
    yeah, quiz. How do you see that?
  • 19:15 - 19:17
    Comment below. What's the command? So here
  • 19:17 - 19:18
    we go a scenario. Let's say you find this
  • 19:18 - 19:19
    amazing hacking tool.
  • 19:19 - 19:21
    There's one I actually found, it's pretty
  • 19:21 - 19:22
    neat. Let's go look at it right now. It's
  • 19:22 - 19:23
    called
  • 19:23 - 19:25
    turbolist3r, and what it will do is look
  • 19:25 - 19:26
    at a website and list all the sub
  • 19:26 - 19:28
    domains of that website. It'll go and
  • 19:28 - 19:30
    do it in kind of a passive way, very cool.
  • 19:30 - 19:31
    But here I am on GitHub, and I want to
  • 19:31 - 19:33
    use this tool, but
  • 19:33 - 19:35
    what do I do? Let's do it. So the first
  • 19:35 - 19:37
    thing you'll do is kind of just
  • 19:37 - 19:38
    get the URL at the top here. So it's
  • 19:38 - 19:41
    github.com/fleetcaptain/turbolist3r,
  • 19:41 - 19:43
    I'll put a link in the description. I'm
  • 19:43 - 19:44
    just gonna grab that link,
  • 19:44 - 19:46
    and that's the repository link. So copy
  • 19:46 - 19:48
    that, I'll go over here and the command
  • 19:48 - 19:48
    will be
  • 19:48 - 19:51
    get clone, we're gonna clone that
  • 19:51 - 19:52
    repository. We're basically taking their
  • 19:52 - 19:53
    code
  • 19:53 - 19:55
    and copying it to our Linux machine here
  • 19:55 - 19:57
    which is super cool.
  • 19:57 - 19:59
    So I'm going to paste that URL right
  • 19:59 - 20:00
    after clone.
  • 20:00 - 20:01
    And that's it. It's going to do something
  • 20:01 - 20:03
    really cool, you ready? And also, it's
  • 20:03 - 20:04
    going to clone it to whatever
  • 20:04 - 20:06
    directory I'm in, the working directory.
  • 20:06 - 20:07
    So right now you can see I'm in
  • 20:07 - 20:11
    downloads. So I'm going to hit enter,
  • 20:11 - 20:14
    and it did it. That's so cool. So if I do
  • 20:14 - 20:15
    ls to list the contents of my current
  • 20:15 - 20:16
    directory,
  • 20:16 - 20:19
    there she is, turbolist3r ready to go.
  • 20:19 - 20:22
    So I'm gonna cd into turbolist3r, the
  • 20:22 - 20:23
    directory there.
  • 20:23 - 20:24
    Type in ls to see what's inside there,
  • 20:24 - 20:26
    and I've got a few things going on. Now,
  • 20:26 - 20:28
    specifically to this project, it's a
  • 20:28 - 20:29
    Python project,
  • 20:29 - 20:30
    and to use this tool, I would use this
  • 20:30 - 20:34
    Python script right here, turbolist3r.py.
  • 20:34 - 20:35
    But there's one big thing. Before we
  • 20:35 - 20:37
    can do that,
  • 20:37 - 20:38
    just like every other application we
  • 20:38 - 20:40
    install on our system, just like any
  • 20:40 - 20:41
    script you might use in Python,
  • 20:41 - 20:44
    there are some requirements that we have
  • 20:44 - 20:45
    to meet. We have to make sure we have the
  • 20:45 - 20:47
    Python libraries and packages installed
  • 20:47 - 20:48
    to make this thing work.
  • 20:48 - 20:49
    Now,, if only there were a tool that could
  • 20:49 - 20:52
    help us do that. What do you think it is?
  • 20:52 - 20:54
    It's pip. So right here while we're in
  • 20:54 - 20:55
    this directory, we can actually just
  • 20:55 - 20:57
    very quickly install all the
  • 20:57 - 20:58
    requirements. Let me show you the command.
  • 20:58 - 20:59
    The command will be
  • 20:59 - 21:02
    pip3. Now, I'm saying pip3 because
  • 21:02 - 21:04
    we're actually using Python three
  • 21:04 - 21:06
    versus python two, which would use just
  • 21:06 - 21:08
    the command pip. So Python three,
  • 21:08 - 21:12
    pip3. Pip3 install
  • 21:12 - 21:15
    dash 'r', and then we'll put in
  • 21:15 - 21:17
    requirements.txt.
  • 21:17 - 21:19
    So with this command, pip3 is going to go
  • 21:19 - 21:20
    huh, let's look inside
  • 21:20 - 21:22
    the requirements.txt file, which is right
  • 21:22 - 21:24
    here, and see what dependencies this
  • 21:24 - 21:26
    script needs. It'll go through it,
  • 21:26 - 21:28
    install them, and then we're ready to go.
  • 21:28 - 21:29
    So let's try it. I'm going to go ahead
  • 21:29 - 21:31
    and hit enter on this.
  • 21:31 - 21:34
    And fingers crossed, coffee break, oh that
  • 21:34 - 21:35
    was quick man, and let me tell you
  • 21:35 - 21:36
    something.
  • 21:36 - 21:38
    That was pretty much it. Like as far as
  • 21:38 - 21:39
    downloading a script or
  • 21:39 - 21:41
    an application or a hacking tool from
  • 21:41 - 21:43
    GitHub, you download the repository,
  • 21:43 - 21:45
    you install the requirements, then you
  • 21:45 - 21:48
    run the thing. You run the script.
  • 21:48 - 21:49
    Let's just do it real quick. So the
  • 21:49 - 21:51
    command will be for this
  • 21:51 - 21:55
    python3, and then the script name which
  • 21:55 - 21:57
    was turbolist3r, yeah there it was. Now, like
  • 21:57 - 21:58
    most things, if you don't know what to do,
  • 21:58 - 21:59
    just type in dash
  • 21:59 - 22:01
    'h', and it will give you some help. But I
  • 22:01 - 22:02
    know what I want to do real quick.
  • 22:02 - 22:04
    I'm going to do dash 'd' for domain. And let's take
  • 22:04 - 22:06
    a look at Hack The Box's subdomains,
  • 22:06 - 22:09
    hackthebox.eu and hit enter.
  • 22:09 - 22:11
    Now, one thing I love about all these
  • 22:11 - 22:12
    scripting tools is that they have, you
  • 22:12 - 22:14
    know, some really cool ASCII script up
  • 22:14 - 22:15
    here, making it look really neat. But
  • 22:15 - 22:16
    anyways, it's going to go through all
  • 22:16 - 22:17
    these things and try to find the
  • 22:17 - 22:20
    subdomains of hackthebox.eu, which by the
  • 22:20 - 22:21
    way, is what we're using right now.
  • 22:21 - 22:24
    So it's kind of fun, inception. We're
  • 22:24 - 22:25
    attacking from the inside.
  • 22:25 - 22:26
    We're not attacking. It's just
  • 22:26 - 22:28
    passive reconnaissance. And
  • 22:28 - 22:30
    bam, there it is. Look at that. All these
  • 22:30 - 22:31
    sub domains have hackthebox. That's
  • 22:31 - 22:32
    kind of cool, right?
  • 22:32 - 22:34
    They have a lot. Goodness gracious. Now,
  • 22:34 - 22:36
    that was
  • 22:36 - 22:39
    a lot. We covered how to install stuff
  • 22:39 - 22:42
    in Linux and also remove it and all
  • 22:42 - 22:43
    kinds of stuff.
  • 22:43 - 22:47
    So real quick, quick review. 1000 foot
  • 22:47 - 22:47
    look at this.
  • 22:47 - 22:49
    The two main ways we install stuff on
  • 22:49 - 22:51
    Linux is with our package managers
  • 22:51 - 22:55
    d package or apt. D-package being the
  • 22:55 - 22:58
    low-level, dumb version, and apt being
  • 22:58 - 22:59
    high-level
  • 22:59 - 23:00
    and it's awesome, whereas d-package
  • 23:00 - 23:02
    requires you to download the dot
  • 23:02 - 23:05
    deb file, deb, hi deb. And then it also doesn't
  • 23:05 - 23:07
    install dependencies for you, what at
  • 23:07 - 23:08
    loser.
  • 23:08 - 23:10
    But apt, it just looks at a repository
  • 23:10 - 23:12
    when you reference a package, like hey,
  • 23:12 - 23:14
    install docker for me please, and it goes
  • 23:14 - 23:15
    out and gets it for us.
  • 23:15 - 23:17
    And it also installs all dependencies it
  • 23:17 - 23:19
    might need because packages need
  • 23:19 - 23:21
    packages on packages on packages.
  • 23:21 - 23:22
    There's a fancier version called
  • 23:22 - 23:24
    aptitude, which looks really cool.
  • 23:24 - 23:25
    I've never played with it, but it looks
  • 23:25 - 23:27
    fun. And then there's snap, which I think
  • 23:27 - 23:29
    is the best out of all of them because
  • 23:29 - 23:31
    the developers can just upload their new
  • 23:31 - 23:32
    applications they code
  • 23:32 - 23:34
    straight to a store, and you can just get
  • 23:34 - 23:36
    it in a snap
  • 23:36 - 23:38
    with the snap install command. And it
  • 23:38 - 23:39
    does work in a similar way to apt
  • 23:39 - 23:41
    except it's not looking at a repository
  • 23:41 - 23:42
    to pull information, it's looking at a
  • 23:42 - 23:44
    store. And then we had our programming
  • 23:44 - 23:46
    language-specific package managers. Now,
  • 23:46 - 23:47
    this is not exhaustive, but the main
  • 23:47 - 23:49
    ones we see right now are Python with
  • 23:49 - 23:51
    this pip or pip3 for Python 3.
  • 23:51 - 23:54
    Ruby has gem or that's the tool, it's
  • 23:54 - 23:55
    actually called RubyGems, and again, these
  • 23:55 - 23:57
    are both handy for installing
  • 23:57 - 23:59
    programming language-specific packages
  • 23:59 - 24:00
    to help you run your scripts and
  • 24:00 - 24:02
    apps. And then last but certainly not
  • 24:02 - 24:03
    least, we have Git.
  • 24:03 - 24:05
    It's a command line tool we can install
  • 24:05 - 24:07
    with another package manager like apt,
  • 24:07 - 24:09
    apt install git. And what Git allows us
  • 24:09 - 24:11
    to do is pull down stuff from places
  • 24:11 - 24:13
    like GitHub, which also is itself a
  • 24:13 - 24:14
    repository.
  • 24:14 - 24:17
    Don't get confused. So we demonstrated
  • 24:17 - 24:19
    how you might find an amazing hacking
  • 24:19 - 24:20
    tool that a hacker
  • 24:20 - 24:22
    another hacker developed, and you would
  • 24:22 - 24:24
    use Git to go get
  • 24:24 - 24:27
    that tool, download it to your Linux
  • 24:27 - 24:29
    machine, and in this case, we were using
  • 24:29 - 24:31
    a Python script, so we used pip3 to
  • 24:31 - 24:32
    install the requirements for that
  • 24:32 - 24:34
    because it did have some requirements.
  • 24:34 - 24:35
    And then we used that amazing turbo
  • 24:35 - 24:37
    list3r tool to
  • 24:37 - 24:40
    list sub-domains, super fun. So yeah, that
  • 24:40 - 24:41
    was a lot.
  • 24:41 - 24:43
    Let me know what you think of this video.
  • 24:43 - 24:44
    If you have any questions or comments or
  • 24:44 - 24:46
    anything, just comment below. I'll take a
  • 24:46 - 24:47
    look.
  • 24:47 - 24:49
    And also let's see how you did, like as
  • 24:49 - 24:50
    you went through this and you learned,
  • 24:50 - 24:52
    you took notes and practiced, you got
  • 24:52 - 24:53
    hands-on,
  • 24:53 - 24:55
    let's test your skills. I've got a quiz
  • 24:55 - 24:56
    in the link below. I also have a
  • 24:56 - 24:58
    walkthrough lab you can go through as
  • 24:58 - 25:00
    well to kind of reinforce these things.
  • 25:00 - 25:01
    Check it out, free sign up, no big deal.
  • 25:01 - 25:04
    And of course, sign up for Hack The Box
  • 25:04 - 25:05
    Academy dude. What we're doing here is
  • 25:05 - 25:06
    completely free,
  • 25:06 - 25:08
    and if you want to go down further and
  • 25:08 - 25:10
    become an even better hacker and
  • 25:10 - 25:11
    learn other stuff,
  • 25:11 - 25:12
    like hacking WordPress and all kinds of
  • 25:12 - 25:14
    weird things, you can subscribe as a
  • 25:14 - 25:16
    regular person or as a student,
  • 25:16 - 25:18
    and just do it. And yeah, that's
  • 25:18 - 25:20
    about it. This was episode 5
  • 25:20 - 25:21
    of Linux for hackers and everyone
  • 25:21 - 25:23
    because dude, everyone's got to learn
  • 25:23 - 25:24
    Linux.
  • 25:24 - 25:26
    And also, if you like this shirt, which is
  • 25:26 - 25:28
    a raspberry pi blueprint
  • 25:28 - 25:30
    or this mug, go check out my store
  • 25:30 - 25:31
    networkchuck.coffee. You can get all this
  • 25:31 - 25:32
    merch as well as
  • 25:32 - 25:34
    coffee of course, and yeah, seriously,
  • 25:34 - 25:36
    that's all I have today.
  • 25:36 - 25:37
    Thanks guys for watching this.
  • 25:37 - 25:39
    Continue the next episode if it's
  • 25:39 - 25:40
    already out, which it should be
  • 25:40 - 25:43
    hopefully. If not, well subscribe and hit
  • 25:43 - 25:44
    that notification bell because it'll
  • 25:44 - 25:47
    come out any day now, you never know.
  • 25:47 - 25:49
    Yeah, I'll catch you guys next time
  • 25:49 - 26:05
    [Music]
Title:
apt, dpkg, git, Python PiP (Linux Package Management) // Linux for Hackers // EP 5
Description:

more » « less
Video Language:
English
Duration:
26:05

English subtitles

Revisions Compare revisions