Берешит 4:7 Мидраш: Ein Yaakov (Glick Edition), Mekhilta DeRabbi Yishmael, Shir HaShirim Rabbah & Bereshit Rabbah

הֲל֤וֹא אִם־תֵּיטִיב֙ שְׂאֵ֔ת וְאִם֙ לֹ֣א תֵיטִ֔יב לַפֶּ֖תַח חַטָּ֣את רֹבֵ֑ץ וְאֵלֶ֙יךָ֙ תְּשׁ֣וּקָת֔וֹ וְאַתָּ֖ה תִּמְשָׁל־בּֽוֹ׃

Ведь если ты станешь лучше — возвысишься, а не станешь лучше — у входа лежит грех. [Грех] желает тебя, но ты властвуй над ним.

Ein Yaakov (Glick Edition)

Our Rabbis were taught (Deut. 11, 18) Therefore shall ye lay (V'sam-tam) i.e., an unfailing remedy. The Torah is likened unto a medicine of life. This may be compared unto a man who beat his son and wounded him severely. He applied a plaster unto the wound and warned him, saying: "My son, as long as this plaster will be on your wound you may eat and drink whatever you please; you may even bathe yourself in warm or cold water and you need not be afraid; but as soon as you will remove it, you will cause an ulceration." So also has the Holy One, praised be He, said unto Israel: "I have created an evil inclination and I have also created the Torah with which to season (temper) it. If you will study the Torah then you will not be surrendered into his hand, as it is said (Gen. 4, 7) If thou dost well, then it shall he lifted up. But if you will not study the Torah then you will be surrendered into his hand, as it is said (Ib., ib., ib.) Sin coucheth at the door; and not only this, but he will spend all his energy to induce you to sin, as it is said in the previous passage, And unto thee is its desire. However, if you desire you can rule over it, as it is said (Ib., ib., ib.) But thou canst rule over it."

Ein Yaakov (Glick Edition)

We are taught in a Baraitha: Abba Saul said: "Also in the border towns [of Jerusalem] they did it [forbore to sleep] in reminiscence of Temple usages, but it turned out to be a cause of sin." Abaye, and according to others, R. Nachman b. Isaac, said: "The remarks of Abba Saul refer to the Nehardeans." Elijah [once] said to R. Juda, the brother of R. Sala, the pious: "You ask why Messiah does not come? Today, although it is the Day of Atonement, nevertheless many adulterous acts have been committed in the city of Nehardea." "And what," asked R. Juda, "doth the Holy One, praised be He! say to that?" "He saith (Gen. 8, 7) Sin lieth at the door." Fol. 20) "And what says Satan to this?" in quired R. Juda again. "On the Day of Atonement he has no right to accuse." Whence do we know this? As Rami b. Chama said: "Hasatan by Gimatria is three hundred and sixty-four, therefore only on that number of days has he permission to accuse; but on the Day of Atonement (i.e., on the three hundred and sixty-fifth), he may not accuse."

Mekhilta DeRabbi Yishmael

Issi b. Yehudah says: There are five ambiguous verses in the Torah: "se'eth," "arur," "machar," "meshukadim," and "vekam.": "se'eth" — (Genesis 4:7) "If you do well, you will be forgiven (se'eth)" or "You will bear your sin (se'eth), if you do not do well." "arur" — (Ibid. 49:7) "Arur (Cursed) is their wrath, for it is fierce" or (Ibid. 6) "for in their wrath they slew a man, and in their wilfulness they razed an ox. Arur ("they are cursed.") "machar" ("tomorrow") — (Exodus 17:9) "Machar I will stand on top of the hill" or "Go out and do battle with Amalek machar." "meshukadim" ("of beaten work") — (Exodus 25:34) "meshukadim its bulbs and its flowers" or "in the menorah, four bowls meshukadim." "vekam" — (Devarim 31:16) "Vekam ("and there will arise") this people and they will stray, etc." or "you shall lie down with your people vekam" ("and arise"). These are the five ambiguous verses in the Torah.