Create a Dead Man's Switch in Python to Encrypt a File When You Don't Check In [Tutorial]

Поділитися
Вставка
  • Опубліковано 1 чер 2024
  • Our Premium Ethical Hacking Bundle Is 90% Off: nulb.app/cwlshop
    How to Create a Dead Man's Switch in Python 3
    Full Tutorial: nulb.app/z5jcp
    Subscribe to Null Byte: goo.gl/J6wEnH
    Kody's Twitter: / kodykinzie
    Cyber Weapons Lab, Episode 196
    If you've ever watched a classic mob movie, then you've seen a Dead Man's Switch in action. It involves some sort of information getting published if a certain person goes missing. But there are many different types of dead man switches, ones more useful for hackers. In this episode of Cyber Weapons Lab, we'll make a Python program that can encrypt and delete a file if you don't check in over Twitter during a set amount of time.
    To learn more, check out the article on Null Byte's site: nulb.app/z5jcp
    Twint tutorial: • Mine Twitter for Targe...
    Follow Null Byte on:
    Twitter: / nullbytewht
    Flipboard: flip.it/3.Gf_0
    Vimeo: vimeo.com/channels/nullbyte
    Website: null-byte.com
    Weekly newsletter: eepurl.com/dE3Ovb
  • Навчання та стиль

КОМЕНТАРІ • 274

  • @iamthatiam4496
    @iamthatiam4496 3 роки тому +190

    I am just starting to learn python at the tender age of 59. It’s an interesting experience

    • @definty
      @definty 3 роки тому +29

      Good for you. Remember programming is difficult and it's not just you, if you feel lost. Especially when learning.

    • @iamthatiam4496
      @iamthatiam4496 3 роки тому +8

      @@definty thx man

    • @GodotEnjoyer
      @GodotEnjoyer 3 роки тому +10

      @@iamthatiam4496 Sounds good dude
      If you start with python you will love everything and you will be excited to find about more and more!
      I believe that's about all languages!
      Have a nice trip mate!

    • @NullByteWHT
      @NullByteWHT  3 роки тому +13

      I really hope you enjoy it!

    • @iamthatiam4496
      @iamthatiam4496 3 роки тому +21

      @@NullByteWHT i do. But let me tell you something- things have changed since I programmed in BASIC in the 1970s. Truth be told- this is quite enjoyable. Thank you

  • @rentacowisgoogle
    @rentacowisgoogle 3 роки тому +30

    Cool extra feature you might add would be an extra code you can tweet which doesn't check you in, but encrypts the files immediately. A reverse uno card for the outrageous situation where you are being forced to "check in" at gunpoint lol.

    • @liesdamnlies3372
      @liesdamnlies3372 3 роки тому

      Not so outrageous, depending on your threat model.
      Of course, if your threat model is that extreme, that you even need a dead man’s switch is probably an indicator you may be Doing It Wrong(tm).

  • @mikesmith4403
    @mikesmith4403 3 роки тому +17

    This seems particularly useful in my current circumstances. How timely. Thank you sir.

    • @divad2237
      @divad2237 3 роки тому +13

      You getting hunted by the FBI or sum 🤔

    • @someguy7819
      @someguy7819 2 роки тому

      Epstein people trying to kill you?

    • @zcsz.
      @zcsz. 4 дні тому

      fuck kinda situation are u in

  • @GabrielXzavier
    @GabrielXzavier 3 роки тому +42

    No one:
    absolutely no one:
    Elliot Alderson every few episodes:

  • @CorEsan
    @CorEsan 3 роки тому +1

    Very cool! I can think of a lot of practical examples for this. Something cool might be to trigger an email to go to someone with the encrypted file attached as well or actually just decrypt a secret file and email it out in the event something happened to you. I guess if something happens to you, you may as well just delete the file haha cause no one else will know how to decrypt it anyway.. Thanks for sharing!

  • @iblackfeathers
    @iblackfeathers 3 роки тому +4

    just like on mr. robot or other tv shows, sending an email and/or sending a video file upon one’s death would also be interesting - like a video will / goodbye or spooky message to send to your friends after a certain amount of days, similar to a twilight zone episode with a telephone call from a dead person which ended up being the telephone line ran to a grave.

    • @efeyzee
      @efeyzee 3 роки тому +1

      Google has an "inactive account manager" that you might find interesting

  • @pacman804
    @pacman804 3 роки тому +6

    It has been a while Kody,thanks for this

  • @2millionblunts
    @2millionblunts 3 роки тому +19

    If you really wanted to make it tweet and you don't have a developer account you could maybe use selenium

  • @UNcommonSenseAUS
    @UNcommonSenseAUS 3 роки тому +16

    Admit it, you just come for the blinks.

    • @sluvvr
      @sluvvr 3 роки тому

      Nah i actually come here for the tools and info

    • @samberry449
      @samberry449 3 роки тому

      what blinks

  • @999fini
    @999fini 3 роки тому +15

    been a long time since this was recommended to me, missed the videos ngl

  • @berndeckenfels
    @berndeckenfels 3 роки тому +2

    It is a good idea to adjust your IDE fonts a bit, not all screens make 1080p that easily readable. I would also not encrypt a file, but use an encrypted Filesystem and forget it’s unlock key. That also fits well into network bound encryption. And you never need to know the encryption key

  • @whyeddy9702
    @whyeddy9702 3 роки тому

    love the framed shodan pic in the background

  • @swerytv4342
    @swerytv4342 3 роки тому

    Thank you so much for all. What is the procedure to do penetration tests of an API secured by OAuth the latest version in the security side. (Laravel, Spring boot, Nodejs...).

  • @Yorak404
    @Yorak404 3 роки тому +8

    I’m at school right now supposed to be writing script for my stupid mock trial but Instead of learning laws imma watch my favourite teacher😄

    • @NullByteWHT
      @NullByteWHT  3 роки тому +3

      Do good things with the law if that's where you're going!

    • @user-zr9hu3tf1y
      @user-zr9hu3tf1y 3 роки тому

      aw come on mock trial is dope

  • @Ragnarek72
    @Ragnarek72 3 роки тому

    Hi! there is a question about an antenna with three connectors for transmitting three spatial streams (outdoor). You can connect 3 adapters to it. Is it possible in this case to launch the attack of the evil double? Or do you need 2 separate antennas?

  • @bean5050
    @bean5050 3 роки тому

    I love these videos! they are so interesting, good job!!

  • @fullsolutionslab
    @fullsolutionslab 3 роки тому

    Yeahhh!! System Shock Image on the wall :) That rocks dude! n1ce video ;) thanks to share your knowledge with us!! Greetings from Switzerland

  • @pushkarshendre1856
    @pushkarshendre1856 3 роки тому

    i just grow with this man thx null ..

  • @azelbane87
    @azelbane87 3 роки тому

    Awsome! It would be GREAT if you actually increase the font size during the walkthrough... It would definitely makes it easier to follow up! Bless

  • @shashankpriya4498
    @shashankpriya4498 3 роки тому

    Luv you the non Blinking Robot finally your back. 😃😃

  • @exploiter5596
    @exploiter5596 3 роки тому

    Thank you so much for this information 😊

  • @tony99659
    @tony99659 3 роки тому

    love this content, and love python, new sub for you!

  • @jonathanmcdonald7512
    @jonathanmcdonald7512 3 роки тому +4

    This is critical. Thank you.

    • @deepserket4390
      @deepserket4390 3 роки тому +2

      no don't use this if you are against a gov, it has some problems

    • @liesdamnlies3372
      @liesdamnlies3372 3 роки тому

      Don’t use this for security. It’s absolutely not useful.

    • @liesdamnlies3372
      @liesdamnlies3372 3 роки тому

      @@jonathanmcdonald7512 That...makes no sense.

    • @jonathanmcdonald7512
      @jonathanmcdonald7512 3 роки тому

      It's critical because I don't want my mom to find the man butt pics on my computer. She isn't FBI, just old and zenophobic.

  • @AZ-ps1si
    @AZ-ps1si 3 роки тому

    I understand nothing but I watch every video he posts 🧐.

  • @str4080
    @str4080 3 роки тому

    these are the type of videos I like

  • @youtubegaveawaymychannelname
    @youtubegaveawaymychannelname 3 роки тому +2

    Thank god you lowered the volume of the intro music.

  • @DanielDiaz-by7fc
    @DanielDiaz-by7fc 3 роки тому +2

    Is there an advantage to doing this vs encrypting the entire drive from the get go?
    Also if I may put in a video request. Since it’s a common tactic amongst thieves and LEO to cause a distraction then snatch your laptop away. I think a cool video project would be to make like a USB drive attached to a bracelet, and if it gets removed from the laptop prior to some kind of shutdown code, the laptop will automatically lock and then start deleting all the drives . Is this possible to do?

  • @TheJoker-xw8zg
    @TheJoker-xw8zg 3 роки тому

    All this is way over my head, what's the best place to start learning in your opinion? Interesting in "hacking" so pen testing, cybersecurity, ect. It's all very overwhelming at first.

  • @bjollnirbjordsen9795
    @bjollnirbjordsen9795 2 роки тому

    finally my parents will never find my foot folder if I die, I can go peacefully

  • @marklonergan3898
    @marklonergan3898 3 роки тому +1

    1 thing worth bearing in mind is how it handles device connectivity going down.
    Side-question, are we taking bets on how long until there's a comment here saying something like "HELP, laptop encrypted and can't remember password. How do i decrypt?"

  • @john2426
    @john2426 3 роки тому

    Love u Work... Best Channel

  • @gaydolfhitler6310
    @gaydolfhitler6310 3 роки тому

    Do you have certification, like OSCP?

  • @realhomy
    @realhomy 3 роки тому +43

    Brooo yessir It’s KODY K. LETS GO

    • @cryptoslynesso8288
      @cryptoslynesso8288 3 роки тому

      you always leave 100000 comments on each of his videos, jeez chill

    • @jonathanmcdonald7512
      @jonathanmcdonald7512 3 роки тому

      I am with you on this, 06_8B. I like the positive attitude.

    • @NullByteWHT
      @NullByteWHT  3 роки тому +12

      @@cryptoslynesso8288 I don't see you leaving enough comments, crypto. Pls don't take it out on my best friend 06_8B over here.

    • @cryptoslynesso8288
      @cryptoslynesso8288 3 роки тому +1

      @@NullByteWHT fine

    • @cryptoslynesso8288
      @cryptoslynesso8288 3 роки тому +3

      @@NullByteWHT plz dont hack me :(

  • @andrewpage766
    @andrewpage766 3 роки тому

    Hey dude love the videos! Is there anyway you could show how to create a backdoor into a windows system using netcat, and exploit the OS using metasploit and gain privilege escalation?

  • @orlandcemine5016
    @orlandcemine5016 3 роки тому

    Thankyou for hands on hacking tutorial❤️

  • @deepserket4390
    @deepserket4390 3 роки тому +2

    Nice concept, but what about connecting a raspberry pi to a drill pointed to your hard disk?
    just to be sure that the data are destroyed ^^

  • @nezu_cc
    @nezu_cc 3 роки тому +10

    The encryption has absolutely 0 point unless you use non symmetric keys and only store the key to encrypt on the target system or make the script self destruct after encrypting so the password can't be just read back by someone else in plain text.

    • @MsHojat
      @MsHojat 3 роки тому +1

      Only "0 point" (extremely ineffective, still not useless) in high profile scenarios. If it's for keeping a friend or family out it's practically overkill despite being defeatable.
      That being said, there's no reason not to do that anyway though, sure. He does mention in the video that it should be deleted though, so are you really adding info that wasn't already said?

    • @liesdamnlies3372
      @liesdamnlies3372 3 роки тому

      @@MsHojat Deleting something is never a sure strategy. If anyone is this concerned, the only thing the script should be doing is locking the computer (e.g. shutting it down), because all the files are already encrypted. Doubly so using different encryption schemes for the really important stuff.

  • @liesdamnlies3372
    @liesdamnlies3372 3 роки тому +2

    This example of “at a protest” is absurd. A smart person working IT for law enforcement will be quickly doing a touch of OSINT on you, find your Twitter account, get a warrant, take control of the account, and bam, you’re screwed. Twitter is a ridiculous way to disarm this thing. (And I can think of half a dozen other things I would do to get around the possibility of such a script running, one of which being just not booting the device in question into the OS. Problem solved.)
    But literally none of that matters. The need for a dead man’s switch pretty much means you’re doing it wrong. Your files should already be encrypted. If it’s important, then doubly so with different schemes (e.g. VeraCrypt inside LUKS).
    The most such a script should bother doing is locking the computer, and it already should be locked if you, you know, closed the screen. Maybe do a thorough wipe of the drive? But that only matters for HDDs. The only way to securely wipe an SSD is to physically destroy it.
    It’s a fine example of how to use a dead man’s switch to _grant_ access to something that was secured, but it’s not appropriate in the other direction.

  • @baskaranbaskaran4533
    @baskaranbaskaran4533 3 роки тому

    Dude 😎 r u having mac book or running mac os In VMware

  • @DudethatGross
    @DudethatGross 3 роки тому

    how come you use camel case for python, function names that are BothCaptialized instead of snake_case

  • @shashank.s1492
    @shashank.s1492 3 роки тому

    Sir you are so cool keep going ❤️❤️❤️

  • @communist_demon4177
    @communist_demon4177 3 роки тому +1

    Ayyyy he back lets goooo

  • @MGNS
    @MGNS 3 роки тому

    Is twint still functional after Twitter changed the API?

  • @vladimirmuzik8648
    @vladimirmuzik8648 3 роки тому +3

    My teacher challenged me to break into my schools FTP server and change some files. What do you think is the best way?

    • @cmar8647
      @cmar8647 3 роки тому

      good ol sql injecting

    • @letsthink8245
      @letsthink8245 3 роки тому

      I would make sure you get written permission or something first on contract for legal reasons. Maybe show him that you are able to view all the files inside then tell him what do you want me to change.

    • @DotNetRussell
      @DotNetRussell 3 роки тому

      The best way would be to ask what version and brand of ftp server theyre running, get the os version and duplicate it all in a virtual box. Then practice on the virtual box so you don't go to prison.

  • @AlexMercersRevenge
    @AlexMercersRevenge 3 роки тому

    Can this work with smartphones as well?

  • @angulini
    @angulini 3 роки тому

    i have little problem when i run the sript i am learning python to and the problem is i typed everything right and all and when i hit enter all is say is : sleeping for 1 secs and then increments to 8 seconds affter that increments to 27 and so on can some one help ty so much to all

  • @obitorasu1760
    @obitorasu1760 3 роки тому

    I see system shock behind I auto like. Man of culture.

  • @admiralcasperr
    @admiralcasperr 3 роки тому +2

    Deadmen switch all you "homework"

  • @SuperSatyakiran
    @SuperSatyakiran 3 роки тому

    Can you tell me the process of decrypt of crypt12 database with out key.
    Thank you

  • @TheSnero3
    @TheSnero3 3 роки тому

    I like this idea, but shouldn't the drive be encrypted from the get go?
    If you are using this to WIPE a machine then that makes more sense. However, what happens if you get wasted and forget to check in 😭.

  • @kebman
    @kebman 3 роки тому +1

    This is a usecase where Python is a particularly bad choice.
    One can assume that anyone implementing something like this has it running on a personal server at home. In that case, the enemy will have physical access to your setup once you're "gone." And if so, encrypting your files most likely won't protect them at all if it's done with Python.
    This is due to how Python handles variables. For instance using `del password` will only delete the reference link to the memory location of the data, but not the actual data stored there itself, meaning your actual password string.
    Add to this that such data is often shared with other resources used by Python nilly willy. That makes a simple memdump a viable method to get hold of your secrets, even though you've instructed Python to "delete" it. On top of that, Python leaks a ton of data to various parts of your system. So even after a restart, there may still be sensitive data left lurking in logs or in system swap files. This makes it notoriously hard to securely encrypt files on a system where your enemies may get physical access if you're using Python (and some other high level languages as well). The better options would be a language where you can enjoy direct control over memory locations, such as with Rust. But the tradeoff is that lower lever languages are also harder to learn.
    As yvrelna already mentioned, this security implementation is also patently bad, not just because of using Twitter, but mostly because it doesn't pre-encrypt sensitive files.

  • @rosyidharyadi7871
    @rosyidharyadi7871 3 роки тому

    those browser extensions... you use them all?

  • @swapnilshinde9868
    @swapnilshinde9868 3 роки тому

    You need to make video on ' Scrcpy ' tool its mirrors your android screen on your kali linux machine.

  • @-DarK.shadow
    @-DarK.shadow 3 роки тому +2

    What you use for hacking “kali linux” please answer me 😊🥺

  • @varungupta3428
    @varungupta3428 3 роки тому

    @Null Byte could you please make a video on phishing whereby after the attack it redirects to the real login page or better yet, it even tries to login automatically on the real login page

    • @DotNetRussell
      @DotNetRussell 3 роки тому +1

      Learn to program and earn the knowledge for yourself. It's the number one way to avoid jail

    • @DIVYANSHSINGH-cx9ss
      @DIVYANSHSINGH-cx9ss 3 роки тому

      @@DotNetRussell yeah

  • @falven
    @falven 3 роки тому

    What’s stopping someone from modifying your scripts memory to check their own Twitter message?

  • @cglover0009
    @cglover0009 3 роки тому

    I can’t watch this without code reviewing your code. I recommend you read the book called clean code and also please rename your main function to main :)

  • @abridgetool
    @abridgetool 3 роки тому

    Title suits you. You don't blink either.

  • @Dave-kq7gv
    @Dave-kq7gv 3 роки тому +4

    has the framed System Shock picture always been there?

    • @NullByteWHT
      @NullByteWHT  3 роки тому +3

      She comes and goes

    • @marcosgarcia8018
      @marcosgarcia8018 3 роки тому

      @@NullByteWHT wow
      sounds like something the actual shodan would do
      shows up to guide the player towards her
      and then dips for like the rest of the level

  • @uKaigo
    @uKaigo 3 роки тому

    Great video, but you should be using while loop instead of recursion, otherwise the program will error.

  • @AndycullenLOL
    @AndycullenLOL 3 роки тому

    What happens if you stop the script after encrypting a file? how do you launch it again to decrypt it?

  • @daleythmpsn
    @daleythmpsn 3 роки тому

    Is it possible to use this code to check email or sms

  • @ivavrtaric
    @ivavrtaric 3 роки тому

    Why would you want to have encrypted file PLUS COPY OF NON ENCRYPTED STILL EXISTING FILE? Am I missing the point?

  • @retoelcorrer1387
    @retoelcorrer1387 3 роки тому +2

    I need a dead man's switch android app to send a pre-written email to a designated email address if i don't check into the app's timing setting (eg, app notifies me to check in every 2 days with a password), if i don't check in, it will try again 7 days later, and if that fails, the email will be sent

  • @unofficialcut
    @unofficialcut 3 роки тому +1

    Atlast something interesting

  • @messaribrahim5517
    @messaribrahim5517 3 роки тому +1

    Merci bien

  • @FirstLast-lx2vv
    @FirstLast-lx2vv 3 роки тому +1

    Incase anyone is wondering, I created a formula to predict nullbytes blinking:
    1blink/71 seconds (on average)

    • @obitorasu1760
      @obitorasu1760 3 роки тому

      Can we deploy it on this video feed with python to measure its accuracy?

    • @johnfiott
      @johnfiott 3 роки тому

      Can you disarm the blinking using Twitter?

  • @roshatron
    @roshatron 3 роки тому

    I might do this to my browser history

  • @arnolemay2175
    @arnolemay2175 3 роки тому +2

    This video made me imagine my eventual death... i feel weird now

  • @whitehorsewingchun
    @whitehorsewingchun 3 роки тому

    very cool.....dude....

  • @Chriptus
    @Chriptus 3 роки тому +4

    I see a StackOverflow xD

  • @nicroxio681
    @nicroxio681 3 роки тому +2

    no blinky

  • @thewhat4228
    @thewhat4228 3 роки тому

    Love you kody

  • @Andrath
    @Andrath 3 роки тому

    Also, using a scraper might not be the best idea. What if twitter changes their website design? That would break your scraper and will make your dead man switch fire prematurely.

  • @nawid1687
    @nawid1687 3 роки тому

    Sir Kody i have a video idea... i want to see how to break into for instance, facebook's database and get some hashed passwords

  • @chuxxsss
    @chuxxsss 3 роки тому

    Nice work, big question how do you find a person email address please. Long story behind this the person was a programmer in 1964.

  • @mryes8184
    @mryes8184 3 роки тому

    What laptop does he use? I'm looking to buy a laptop and i want a really good under 800$ laptop. Anyone's got any suggestion?

  • @ExtraWasabi
    @ExtraWasabi 3 роки тому +1

    there are few problems with this video
    1. Python 3 in Oct 2020 and no type hinting?
    2. CamelCase method name ... looks like you come from Java background and you dont do (1). Python PEP guide is method name should be lowercase_underscore
    3. check yvrelna comment about how flaw is this approach

  • @MsHojat
    @MsHojat 3 роки тому +1

    I wouldn't want to use Twitter for a dead man's switch.
    I'd rather see one that operates entirely offline. Although something that maybe uses a personal website or non-web internet server could be just as good or better.
    Also, about that... how would this react to a lost internet connection? I didn't watch the whole thing, but I'm guessing that a default fail state wasn't added. Maybe I'm wrong

    • @tunus04
      @tunus04 3 роки тому

      You are wrong

    • @MsHojat
      @MsHojat 3 роки тому

      @@tunus04 Where did he cover it, then? I just went over the video due to your claim, and _YOU_ seem to be wrong. There's no specification on what to do in a failed connection. Are you talking about "something bad happen"? Sure technically that's a catch, but it's a quite useless catch. We want to either specifically encrypt or specifically not encrypt due to a failed connection, and he didn't mention to people which one that it will be.

    • @tunus04
      @tunus04 3 роки тому

      @@MsHojat I agree it's not a great switch, but it is one. There are other issues with the code. His code doesn't check the content of the tweet to ensure it contains the right kill phrase. As long as it finds a tweet regardless of its content, it will not encrypt.

  • @SOCIALFALCON
    @SOCIALFALCON 3 роки тому

    Bro can I use in termux

  • @radiantomen5753
    @radiantomen5753 3 роки тому

    is that a FUD STUB?

  • @UWU-fi7gm
    @UWU-fi7gm 3 роки тому

    0:42 he blinked

  • @muhammadtijjani3203
    @muhammadtijjani3203 3 роки тому

    Pls do have page on facebook ?

  • @RodCornholio
    @RodCornholio 3 роки тому

    My movie of the grassy knoll will be safe.

  • @dustinramsey5940
    @dustinramsey5940 3 роки тому

    The code you provided on screen was extremely elementary in style. Please use type annotations and PEP 8.

  • @mrtz7187
    @mrtz7187 3 роки тому

    Dear creator can I do a vid about changing ip address?

  • @skgaming3562
    @skgaming3562 3 роки тому

    when was the last time you blinked?

  • @mrbmro3991
    @mrbmro3991 Рік тому

    But where is this code deployed?

  • @bsals8736
    @bsals8736 3 роки тому

    Is Null Byte on Discord??

  • @elowkrichena
    @elowkrichena 3 роки тому

    Real life Sheldon Cooper. ✌😊😊

  • @divyanshsharma1088
    @divyanshsharma1088 3 роки тому

    Twint is producing no result please help

  • @tubeDude48
    @tubeDude48 3 роки тому +1

    Need to Zoom-In and *DROP* the *CRAP-O-LA* music!!!!!!!!!!!

  • @trinity2725
    @trinity2725 3 роки тому

    Can u make a video how to access denied or blocked sites on different regions like in my region I can't access proxy sites and thank u for your efforts and don't hack me pls ;)

  • @jayeshdahibawkar3994
    @jayeshdahibawkar3994 3 роки тому

    installation step failed in kali linux

  • @johnromberg
    @johnromberg 3 роки тому

    Can you do a variant for Parler? The scenario can be going out to put out fires set by violent rioters and getting shot by them. Much more realistic.

  • @ramzymohamad8057
    @ramzymohamad8057 3 роки тому

    Your website doesn't work in my country the regime blocked it

  • @noname-deadend777
    @noname-deadend777 3 роки тому

    Why this is used for

  • @user-td4pf6rr2t
    @user-td4pf6rr2t 3 місяці тому

    awesome, now i can make telsa throw my computer the next time chatgpt response contains the words I'm sorry:
    if not flatEarth and ai-safety['False']:
    twint

  • @Cool-ge2db
    @Cool-ge2db 2 роки тому +1

    hai whackd

  • @XrpAndy
    @XrpAndy 2 роки тому

    John macafee has one