**EXHIBIT
      10.5**




**SECOND** **LOAN
      MODIFICATION AGREEMENT**




This Second Loan
      Modification Agreement (this “Loan Modification Agreement”) is entered into as
      of __ April,
      3rd ____________,
      2007 ,
      by and among
      (i) **SILICON
      VALLEY BANK** ,
      a California corporation and with a loan production office located at One Newton
      Executive Park, Suite 200, 2221 Washington Street, Newton, Massachusetts 02462
      (“Bank”), and (ii) **TECHNEST
      HOLDINGS, INC.** ,
      a Nevada corporation, with offices at 1 McKinley Sq., Fifth Floor, Boston,
      Massachusetts 02109 (“Technest”), **E-OIR
      TECHNOLOGIES, INC.** ,
      a Virginia corporation, with offices at 10300 Spotsylvania Ave., Suite 220,
      Fredericksburg, Virginia 22408 (“EOIR”), and **GENEX
      TECHNOLOGIES INCORPORATED** ,
      a Maryland corporation, with offices at 10411 Motor City Drive, Suite 650,
      Bethesda, Maryland 20817 (“Genex”) (hereinafter, Technest, EOIR and Genex are
      jointly and severally, individually and collectively, referred to as
“Borrower”) .




1.  DESCRIPTION
      OF EXISTING INDEBTEDNESS AND OBLIGATIONS .
      Among
      other indebtedness and obligations which may be owing by Borrower to Bank,
      Borrower is indebted to Bank pursuant to a loan arrangement dated as of August
      4, 2006, evidenced by, among other documents, a certain Loan and Security
      Agreement dated as of August 4, 2006, between Borrower and Bank,
      as amended by a certain First Loan Modification Agreement dated as of February
      14, 2007, between Borrower and Bank (as
      amended, the “Loan Agreement”). Capitalized terms used but not otherwise defined
      herein shall have the same meaning as in the Loan Agreement.




2.  DESCRIPTION
      OF COLLATERAL . Repayment
      of the Obligations is secured by the Collateral as described in the Loan
      Agreement and the Intellectual Property Collateral as described in a certain
      Intellectual Property Security Agreement dated August 4, 2006 (the “IP Security
      Agreement”) (together with any other collateral security granted to Bank, the
“Security Documents”).




Hereinafter,
      the Security Documents, together with all other documents evidencing or securing
      the Obligations shall be referred to as the “Existing Loan
      Documents”.




3.  DESCRIPTION
      OF CHANGE IN TERMS .




A.
            Modifications
                to Loan Agreement.




1
            The
                Loan Agreement shall be amended by deleting the following text, appearing
                in Section 2.2 thereof:




“  (a)  Interest
      Rate .
      Subject to Section 2.2(b), the principal amount of Term Advances outstanding
      shall initially accrue interest at a floating per annum rate equal to two and
      three-quarters of one percentage points (2.75%) above the Prime Rate, which
      interest shall be payable monthly. Upon the Borrower’s achieving a Fixed Charge
      Coverage Ratio of at least 1.75 to 1.0 for three (3) consecutive fiscal quarters
      after the Effective Date, the principal amount of Term Advances outstanding
      shall accrue interest at a floating per annum rate equal to two percentage
      points (2.00%) above the Prime Rate, which interest shall be payable monthly.
      Upon the Borrower’s achieving a Fixed Charge Coverage Ratio of at least 2.0 to
      1.0 for three (3) consecutive fiscal quarters after the Effective Date, the
      principal amount of Term Advances outstanding shall accrue interest at a
      floating per annum rate equal to one and one-half of one percentage points
      (1.50%) above the Prime Rate, which interest shall be payable
      monthly.”









and
      inserting in lieu thereof the following:




“  (a)  Interest
      Rate .
      Subject to Section 2.2(b), the principal amount of Term Advances outstanding
      shall initially accrue interest at a floating per annum rate equal to three
      and
      one-half of one percentage points (3.50%) above the Prime Rate, which interest
      shall be payable monthly. Upon the Borrower’s achieving a monthly
      Fixed Charge Coverage Ratio measured on May 31, 2007, and on the last day of
      each subsequent month, for the three (3) month period ending on the last day
      of
      such month, of (i) at least 1.0:1.0 but less than 1.25:1.0, then, during such
      month, the principal amount of Term Advances outstanding shall accrue interest
      at a floating per annum rate equal to three and one-quarter of one percentage
      points (3.25%) above the Prime Rate, which interest shall be payable monthly,
      (ii) at least 1.25:1.0 but less than 1.5:1.0, then, during such month, the
      principal amount of Term Advances outstanding shall accrue interest at a
      floating per annum rate equal to three percentage points (3.0%) above the Prime
      Rate, which interest shall be payable monthly, and (iii) at least 1.5:1.0,
      then,
      during such month, the principal amount of Term Advances outstanding shall
      accrue interest at a floating per annum rate equal to two and three-quarters
      of
      one percentage points (2.75%) above the Prime Rate, which interest shall be
      payable monthly. Notwithstanding the foregoing, if Borrower achieves a monthly
      Fixed Charge Coverage Ratio measured on May 31, 2007, and on the last day of
      each subsequent month, for the three (3) month period ending on the last day
      of
      such month, of at least 1.25:1.0 (which calculation is inclusive of the
      principal and interest payments due to Shelter Island Opportunity Fund, LLC
      during such period, and, without such inclusion, would be at least 1.5:1.0),
      then, during such month, the principal amount of Term Advances outstanding
      shall
      accrue interest at a floating per annum rate equal to two and three-quarters
      of
      one percentage points (2.75%) above the Prime Rate. In
      addition, upon the Borrower’s achieving a Fixed Charge Coverage Ratio of at
      least (a) 1.75 to 1.0 for three (3) consecutive fiscal quarters after the
      Effective Date, the principal amount of Term Advances outstanding shall accrue
      interest at a floating per annum rate equal to two percentage points (2.00%)
      above the Prime Rate, which interest shall be payable monthly, and (b) 2.0
      to
      1.0 for three (3) consecutive fiscal quarters after the Effective Date, the
      principal amount of Term Advances outstanding shall accrue interest at a
      floating per annum rate equal to one and one-half of one percentage points
      (1.50%) above the Prime Rate, which interest shall be payable
      monthly.”




2
            The
                Loan Agreement shall be amended by deleting the following text, appearing
                in Section 6.7 thereof:




“  (b)  Fixed
      Charge Coverage Ratio .
      A
      monthly Fixed Charge Coverage Ratio measured on the last day of every month,
      for
      the three (3) month period ending on the last day of such month, of at least
      1:0
      to 1:0 through periods ending November 30, 2006; at least 1.25:1.0 for periods
      ending on December 31, 2006 through May 31, 2007; and at least 1.50:1.0 for
      all
      periods thereafter.”




and
      inserting in lieu thereof the following:




“  (b)  Fixed
      Charge Coverage Ratio .
      A
      monthly Fixed Charge Coverage Ratio measured on the last day of every month,
      for
      the three (3) month period ending on the last day of such month, of at least
      (i)
      1:0 to 1:0 through periods ending November 30, 2006, (ii) 1.25:1.0 for the
      periods ending on December 31, 2006 and January 31, 2007, (iii) 1.0:1.0 for
      the
      period ending on May 31, 2007, (iv) 1.25:1.0 for the periods ending on June
      30,
      2007 and July 31, 2007, and (v) 1.50:1.0 for the period ending August 31, 2007
      and for all periods thereafter.









(c)  EBITDA .
      Monthly
      EBITDA of at least (i) $1.00 for the month ending February 28, 2007, (ii)
      $65,000.00 for the month ending March 31, 2007, and (iii) $150,000.00 for the
      month ending April 30, 2007.”




3
            The
                Loan Agreement shall be amended by deleting the following definition,
                appearing alphabetically in Section 13
                thereof:




“  “ **EBITDA** ”
      shall mean earnings before interest, taxes, depreciation and
      amortization.”




and
      inserting in lieu thereof the following:




“  “ **EBITDA** ”
      shall mean earnings before interest, taxes, depreciation and amortization,
      plus,
      for the months of March 2007, April 2007 and May 2007, any portion of the
      Restructuring Fees paid to Bank during such month.”




4
            The
                Loan Agreement shall be amended by inserting the following definition,
                appearing alphabetically in Section 13
                thereof:




“  “ **2007
      Loan Modification Agreements** ”
are,
      collectively, (a) the Second Loan Modification Agreement dated as of April
      3,
      2007 in connection with this Agreement, and (b) the Second Loan Modification
      Agreement dated as of April 3, 2007 in connection with the Receivables Loan
      and
      Security Agreement.”




“  “ **Restructuring
      Fees** ”
are
      commitment or facility fees, in an amount not to exceed $150,000, which are
      contractually due and owing to Bank pursuant to the 2007 Loan Modification
      Agreements.”




5
            The
                Compliance Certificate appearing asExhibit
                Cto the Loan Agreement is hereby replaced with the Compliance Certificate
                attached asExhibit
                Ahereto.




B.
            Waiver.
                Bank hereby waives Borrower’s existing default under the Loan Agreement by
                virtue of Borrower’s failure to comply with the financial covenant set
                forth in Section 6.7(b) (relative to Borrower’s Fixed Charge Coverage
                Ratio) thereof as of the three-month period ending January 31, 2007.
                Bank’s waiver of Borrower’s compliance of said affirmative covenant shall
                apply only to the foregoing specific
                period.




4.  FEES . Borrower
      shall pay to Bank a commitment fee equal to Twenty Five Thousand Dollars
      ($25,000.00), which fee shall be earned as of the date hereof and shall be
      due
      and payable as follows: (a) $5,000.00 on the date hereof; (b) $10,000.00 upon
      the earlier to occur of (i) April 15, 2007, (ii) the early termination of the
      Loan Agreement, and (iii) the occurrence of an Event of Default; and (c)
      $10,000.00 upon the earlier to occur of (i) May 15, 2007, (ii) the early
      termination of the Loan Agreement, and (iii) the occurrence of an Event of
      Default. Borrower shall also reimburse Bank for all reasonable legal fees and
      expenses incurred in connection with this amendment to the Existing Loan
      Documents.




5.  RATIFICATION
      OF IP SECURITY AGREEMENT .
      Except as set forth on **Exhibit
      A** to the First Loan Modification Agreement, Borrower hereby ratifies, confirms
      and
      reaffirms, all and singular, the terms and conditions of the IP Security
      Agreement and acknowledges, confirms and agrees that the IP Security Agreement
      contains an accurate and complete listing of all Intellectual Property
      Collateral as defined therein.









6.  RATIFICATION
      OF PERFECTION CERTIFICATES . Except
      as set forth on **Exhibit
      A** to the First Loan Modification Agreement, Technest hereby ratifies, confirms
      and
      reaffirms, all and singular, the terms and disclosures contained in a certain
      Perfection Certificate dated as of August 4, 2006 between Technest and Bank,
      and
      acknowledges, confirms and agrees the disclosures and information Borrower
      provided to Bank in the Perfection Certificate have not changed, as of the
      date
      hereof. Except as set forth on **Exhibit
      A** to the First Loan Modification Agreement, EOIR hereby ratifies, confirms and
      reaffirms, all and singular, the terms and disclosures contained in a certain
      Perfection Certificate dated as of August 4, 2006 between EOIR and Bank, and
      acknowledges, confirms and agrees the disclosures and information EOIR provided
      to Bank in the Perfection Certificate have not changed, as of the date hereof.
      Except as set forth on **Exhibit
      A** to the First Loan Modification Agreement, Genex hereby ratifies, confirms and
      reaffirms, all and singular, the terms and disclosures contained in a certain
      Perfection Certificate dated as of August 4, 2006 between Genex and Bank, and
      acknowledges, confirms and agrees the disclosures and information Genex provided
      to Bank in the Perfection Certificate have not changed, as of the date
      hereof.




7.  CONSISTENT
      CHANGES .
      The
      Existing Loan Documents are hereby amended wherever necessary to reflect the
      changes described above.




8.  RATIFICATION
      OF LOAN DOCUMENTS .
      Borrower hereby ratifies, confirms, and reaffirms all terms and conditions
      of
      all security or other collateral granted to the Bank, and confirms that the
      indebtedness secured thereby includes, without limitation, the
      Obligations.




9.  NO
      DEFENSES OF BORROWER .
      Borrower hereby acknowledges and agrees that Borrower has no offsets, defenses,
      claims, or counterclaims against Bank with respect to the Obligations, or
      otherwise, and that if Borrower now has, or ever did have, any offsets,
      defenses, claims, or counterclaims against Bank, whether known or unknown,
      at
      law or in equity, all of them are hereby expressly WAIVED and Borrower hereby
      RELEASES Bank from any liability thereunder.




10.  CONTINUING
      VALIDITY .
      Borrower understands and agrees that in modifying the existing Obligations,
      Bank
      is relying upon Borrower’s representations, warranties, and agreements, as set
      forth in the Existing Loan Documents. Except as expressly modified pursuant
      to
      this Loan Modification Agreement, the terms of the Existing Loan Documents
      remain unchanged and in full force and effect. Bank’s agreement to modifications
      to the existing Obligations pursuant to this Loan Modification Agreement in
      no
      way shall obligate Bank to make any future modifications to the Obligations.
      Nothing in this Loan Modification Agreement shall constitute a satisfaction
      of
      the Obligations. It is the intention of Bank and Borrower to retain as liable
      parties all makers of Existing Loan Documents, unless the party is expressly
      released by Bank in writing. No maker will be released by virtue of this Loan
      Modification Agreement.




11.  JURISDICTION/VENUE .
      Borrower accepts for itself and in connection with its properties,
      unconditionally, the exclusive jurisdiction of any state or federal court of
      competent jurisdiction in the Commonwealth of Massachusetts in any action,
      suit,
      or proceeding of any kind against it which arises out of or by reason of this
      Loan Modification Agreement; provided, however, that if for any reason Bank
      cannot avail itself of the courts of the Commonwealth of Massachusetts, then
      venue shall lie in Santa Clara County, California. NOTWITHSTANDING THE
      FOREGOING, THE BANK SHALL HAVE THE RIGHT TO BRING ANY ACTION OR PROCEEDING
      AGAINST THE BORROWER OR ITS PROPERTY IN THE COURTS OF ANY OTHER JURISDICTION
      WHICH THE BANK DEEMS NECESSARY OR APPROPRIATE IN ORDER TO REALIZE ON THE
      COLLATERAL OR TO OTHERWISE ENFORCE THE BANK’S RIGHTS AGAINST THE BORROWER OR ITS
      PROPERTY.




12.  COUNTERSIGNATURE .
      This
      Loan Modification Agreement shall become effective only when it shall have
      been
      executed by Borrower and Bank.






*[The
      remainder of this page is intentionally left blank]*







This
      Loan
      Modification Agreement is executed as a sealed instrument under the laws of
      the
      Commonwealth of Massachusetts as of the date first written above.




**BORROWER:**
              
              **BANK:****TECHNEST
                  HOLDINGS, INC.**
              
              **SILICON
                  VALLEY BANK**
  By:
              
              By:
                  Gage GilmoreName:
                  Gino Pereira
              
              Name
                  Gage GilmoreTitle:
                  Chief Financial Officer
              
              Title:
                  Vice President
  **E-OIR
                  TECHNOLOGIES, INC.**By:Name:
                  Gino PereiraTitle:
                  Chief Financial Officer
  **GENEX
                  TECHNOLOGIES INCORPORATED**By:Name:
                  Gino PereiraTitle:
                  Chief Financial Officer




The
      undersigned, MARKLAND TECHNOLOGIES, INC., ratifies, confirms and reaffirms,
      all
      and singular, the terms and conditions of: (a) a certain Unconditional Guaranty
      dated as of August 4, 2006 (the “Guaranty”), and (b) a certain Stock Pledge
      Agreement dated as of August 4, 2006 (the “Stock Pledge Agreement”) and
      acknowledges, confirms and agrees that the Guaranty and Stock Pledge Agreement
      each shall remain in full force and effect and shall in no way be limited by
      the
      execution of this Loan Modification Agreement, or any other documents,
      instruments and/or agreements executed and/or delivered in connection
      herewith.




**MARKLAND
                  TECHNOLOGIES, INC.**By:Name:
                  Gino PereiraTitle:
                  Chief Financial Officer







**Exhibit
      A**





**EXHIBIT
      C**





**COMPLIANCE
      CERTIFICATE**




TO:
              SILICON
                  VALLEY BANK
              
              Date:
                  _________________________FROM:
              (A)
                  TECHNEST HOLDINGS, INC.(B)
                  E-OIR TECHNOLOGIES, INC.(C)
                  GENEX TECHNOLOGIES INCORPORATED







The
      undersigned authorized officer of Technest Holdings, Inc., E-OIR Technologies,
      Inc. and Genex Technologies Incorporated (“Borrower”) certifies that under the
      terms and conditions of the Agreement between Borrower and Bank (the
“Agreement”), (1) Borrower is in complete compliance for the period ending
      _______________ with all required covenants except as noted below, (2) there
      are
      no Events of Default, (3) all representations and warranties in the
      Agreement are true and correct in all material respects on this date except
      as
      noted below; provided, however, that such materiality qualifier shall not be
      applicable to any representations and warranties that already are qualified
      or
      modified by materiality in the text thereof; and provided, further that
      those representations and warranties expressly referring to a specific date
      shall be true, accurate and complete in all material respects as of such
      date ,
      (4)
      Borrower, and each of its Subsidiaries, has timely filed all required tax
      returns and reports, and Borrower
      has timely paid all foreign, federal, state and local taxes, assessments,
      deposits and contributions owed by Borrower except
      as otherwise permitted pursuant to the terms of Section 5.8 of the Agreement,
      and (5) no Liens have been levied or claims made against Borrower or any of
      its
      Subsidiaries relating to unpaid employee payroll or benefits of which Borrower
      has not previously provided written notification to Bank. Attached are the
      required documents supporting the certification. The undersigned certifies
      that
      these are prepared in accordance with generally GAAP consistently applied from
      one period to the next except as explained in an accompanying letter or
      footnotes. The undersigned acknowledges that no borrowings may be requested
      at
      any time or date of determination that Borrower is not in compliance with any
      of
      the terms of the Agreement, and that compliance is determined not just at the
      date this certificate is delivered. Capitalized terms used but not otherwise
      defined herein shall have the meanings given them in the Agreement.




**Please
        indicate compliance status by circling Yes/No under “Complies”
column.**





**Reporting
                Covenant**
            **Required**
            **Complies**Monthly
                financial statements with
              Compliance
                Certificate
            Monthly
                within 30 days
            Yes
                NoAnnual
                financial statement (CPA Audited) + CC
            FYE
                within 120 days
            Yes
                No10-Q,
                10-K and 8-K
            Within
                5 days after filing with SEC
            Yes
                NoDeferred
                Revenue Report, Funded Backlog schedules, A/R & A/P
                Agings
            Monthly
                within 30 days
            Yes
                No


__________________________
 The
        following Intellectual Property was registered after the Effective Date (if
        no
        registrations, state “None”)




**Financial
                  Covenant**
              **Required**
              **Actual**
              **Complies**Maintain
                  on a Monthly Basis:Minimum
                  Quick Ratio*
              _____:1.0
              _____:1.0
              Yes
                  NoMinimum
                  Fixed Charge Coverage Ratio**
              _____:1.0
              _____:1.0
              Yes
                  NoEBITDA***
              $_______
              $_______





*As
      set
      forth in Section 6.7(a) of the Loan and Security Agreement.


**As
      set
      forth in Section 6.7(b) of the Loan and Security Agreement.


***As
      set
      forth in Section 6.7(c) of the Loan and Security Agreement.





The
      following financial covenant analyses and information set forth in Schedule
      1
      attached hereto are true and accurate as of the date of this
      Certificate.





The
      following are the exceptions with respect to the certification above: (If no
      exceptions exist, state “No exceptions to note.”)















Technest
                Holdings, Inc.
              
              By: 
                __________________________
              Name:
                ________________________
              Title:
                _________________________
              
              E-OIR
                Technologies, Inc.
              
              By:
                __________________________
              Name:
                ________________________
              Title:
                _________________________
              
              Genex
                Technologies Incorporated
              
              By:
                __________________________
              Name:
                ________________________
              Title:
                _________________________
            **BANK
                USE ONLY**
              
              Received
                by: _____________________
              authorized
                signer
              Date:_________________________
              
              Verified:
                ________________________
              authorized
                signer
              Date:_________________________
              
              Compliance
                Status:Yes     
                No














**Schedule
      1 to Compliance Certificate**





**Financial
      Covenants of Borrower**





Dated:  ____________________





In
      the
      event of a conflict between this Schedule and the Loan Agreement, the terms
      of
      the Loan Agreement shall control.




I.  **Quick
      Ratio** (Section
      6.7(a))


Required:  _____:1.00





Actual:


A.
              Aggregate
                  value of the unrestricted cash at Bank and cash equivalents of
                  Borrower
              $
                  _________B.
              Aggregate
                  value of the net billed accounts receivable of Borrower
              $
                  _________C.
              Quick
                  Assets (the sum of lines A and B)
              $
                  _________D.
              Aggregate
                  value of liabilities of Borrower (including all Indebtedness) but
                  excluding Subordinated Debt permitted by Bank to be paid by Borrower
                  to
                  Affiliates
              $
                  _________E.
              Current
                  Liabilities (line D)
              $
                  _________F.
              Quick
                  Ratio (line C divided by line E)
  Is
      line F
      equal to or greater than ___:1:00?




______
      No, not in compliance       ______
      Yes, in compliance





II.  **Fixed
      Charge Coverage Ratio** (See
      definitions and Section 6.7(b))





Required:  
      _________





Actual:


A.
              Borrower’s
                  EBITDA, plus non-cash stock compensation expenses and other non-cash
                  expenses as reasonably determined  by Borrower and allowed by Bank,
                  plus Restructuring Fee
              $
                  ________B.
              The
                  sum ofBorrower’s
                  principal and interest payments on all debt, cash taxes, dividends
                  and
                  unfunded capital expenditures (not includingamounts
                  paid to Markland pursuant to clause (c) of Section 7.8)
              $
                  ________C.
              Fixed
                  Charge Coverage Ratio (line A divided by Line B)
              _____:1.00
  Is
      line C
      less than or equal to ____:1.00?




_____  
      No, not in compliance       _____ 
      Yes, in compliance




III.  EBITDA
      (see definitions and Section 6.7(c))


Required:
      _____





Actual:   
      _____




______
        No, not in compliance       ______
        Yes, in compliance