<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2025-05-06</periodOfReport>

    <issuer>
        <issuerCik>0000775158</issuerCik>
        <issuerName>OSHKOSH CORP</issuerName>
        <issuerTradingSymbol>OSK</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001577394</rptOwnerCik>
            <rptOwnerName>Metcalf-Kupres Kimberley</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O OSHKOSH CORPORATION</rptOwnerStreet1>
            <rptOwnerStreet2>1917 FOUR WHEEL DRIVE</rptOwnerStreet2>
            <rptOwnerCity>OSHKOSH</rptOwnerCity>
            <rptOwnerState>WI</rptOwnerState>
            <rptOwnerZipCode>54902</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2025-05-06</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>1927</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>18759.43</value>
                    <footnoteId id="F2"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">Common Stock granted to Reporting Person pursuant to the Company's 2024 Incentive Stock and Awards Plan and deferred by Reporting Person pursuant to the Company's Deferred Compensation Plan for Directors and Executive Officers.</footnote>
        <footnote id="F2">The amount beneficially owned includes deferred shares acquired pursuant to dividend reinvestments in exempt transactions not required to be reported pursuant to Section 16(a).</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>Ignacio A. Cortina, for Kimberley Metcalf-Kupres</signatureName>
        <signatureDate>2025-05-06</signatureDate>
    </ownerSignature>
</ownershipDocument>
