Phishing with tx.origin | Hack Solidity (0.6)

Поділитися
Вставка
  • Опубліковано 13 гру 2024

КОМЕНТАРІ • 19

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

    What is tx.origin? 0:24
    Contract vulnerable to phishing 0:57
    Exploit 2:37
    Demo 5:14
    Preventative technique 6:24

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

    Excellent! I never thought that the money will be stolen in this way.

  • @salem232
    @salem232 4 роки тому +2

    😦 this seems super easy to be hacked !!! Thanks so much for the awareness 🙏

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

    Excellent explanation. Thank you!

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

    Excellent video, thank you so much!

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

    Great, simple explanation. Thank you.

  • @realbotix
    @realbotix 2 роки тому +2

    Great explanation.

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

    Hello would u be able to transfer nfts as well?

  • @sauravverma6179
    @sauravverma6179 4 роки тому +1

    Can we also use transfer function instead of using call function to transfer ether? Are they equivalent?

    • @sauravshukla1
      @sauravshukla1 4 роки тому +2

      You can use transfer. But using "call" is preffered as "transfer" function send fixed gas of 2500 to fallback function,whereas if sent using "call"..u can set as many "gas value" along with it

    • @smartcontractprogrammer
      @smartcontractprogrammer  4 роки тому +1

      transfer assumes that reentrancy attack is impossible with 2500 gas. call does not make that assumption. By using call, you force yourself to write code against wider range of reentrancy attack

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

    The real question is how do we trick alice into using our malicious contract

    • @smartcontractprogrammer
      @smartcontractprogrammer  3 роки тому +9

      Make a pretty UI, create a fake audit report, hype up the scam product on social media. Most users can't read Solidity

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

      @@smartcontractprogrammer Why you are saying most users can't read solidity for this case. This kind of phishing attack works only when the wallet is not secured by provider it's not depending on the user right ? If we trick alice to use the contract but the wallet is secure (not using tx.origin == owner) this attack will not work. How is this dependant on the user ? It should be depending on the wallet provider ?
      Thanks for your videos I'm learning a lot through you it's AMAZING!

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

      Tell Alice if she sends 1 Eth to your malicious contract, she will get back in return 2 Eth. (Please don't do this though)

  • @ivanlagade
    @ivanlagade 2 роки тому +1

    not true. it doesn't worked. Only the wallet contract owner can withdraw via attack contract calling. if other address "msg.sender" is calling to the attack contract, it always fails.

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

      @serenity7116 Even if Eve tricked Alice to call the "attack function" it won't work because the attack contract can only be called by the attack contract owner and Alice is not the "attack contract owner". The code presented isn't complete.

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

      @serenity7116 why don't you try to run the code and see why i said "code incomplete". 😅 See it your self.😂

    • @derastephh
      @derastephh 3 місяці тому

      It works, I just tried it. As far the attack function doesn't have a require check to be called, anybody can call the attack function