Section 6. If the action is for the possession of land after foreclosure of a mortgage thereon, the condition of the bond shall be for the entry of the action and payment to the plaintiff, if final judgment is in his favor, of all costs and of a reasonable amount as rent of the land from the day when the mortgage was foreclosed until possession of the land is obtained by the plaintiff. If the action is for possession of land after purchase, the condition of the bond shall be for the entry of the action and payment to the plaintiff, if final judgment is in his favor, of all costs and of a reasonable amount as rent of the land from the day that the purchaser obtained title to the premises until the delivery of possession thereof to him, together with all damage and loss which he may sustain by withholding of possession of the land or tenement demanded, and by any injury done thereto during such withholding with all costs. Upon final judgment for the plaintiff, all money then due to him may be recovered in an action on the bond.