Pagina 1 di 3 1 2 3 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 24
  1. #1

    [VB2010] Avira trova un virus ( ?? !! )

    Mai successo dopo anni che uso Avira...

    Non posso testare un programma (in Debug o Release) che mi trova un trojan "TR/Spy.Gen" nell' .exe e mi blocca tutto.

    Pensavo di aver preso un virus in Visual Studio... ma se lancio qualsiasi altro programma VB non dà il minimo rilevamento ( ?? !! ).

    Ho fatto più di una scansione del .exe con quei siti che scansionano con più database antivirus... tutto Ok tranne che per Avira.

    Ma è successo anche a qualcun altro?? Il programma non ha controlli speciali che non abbia in qualsiasi altro mio programma...

  2. #2
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,481
    Cosa usi nel tuo codice? Delle API particolari?
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  3. #3
    Utente di HTML.it L'avatar di Vinsent
    Registrato dal
    May 2011
    Messaggi
    314
    A me è capitato con Avast e un semplice controllo personalizzato, ho cercato di inserire nelle esclusioni ecc., inviato più volte la segnalazione di falso positivo, dopo 10 giorni ho disinstallato Avast....

  4. #4
    Originariamente inviato da oregon
    Cosa usi nel tuo codice? Delle API particolari?
    Diverse API, ma NESSUNA API che non usi regolarmente in diversi altri programmini.

    L' unica dichiaraziome che mai avevo fatto è un:

    Public TextAlignment As HorizontalAlignment

    ... ma dubito che possa essere "visto" come un falso positivo.

    Morale: per lavorare sul programma l' UNICA è disabilitare l' antivirus...

  5. #5
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,481
    Che API ? GetAsyncKey o simili ?
    No MP tecnici (non rispondo nemmeno!), usa il forum.

  6. #6
    Originariamente inviato da oregon
    Che API ? GetAsyncKey o simili ?
    Scusa, perché continui a chiedermi delle API quando già ho precisato che sono API che uso REGOLARMENTE in tutti gli altri programmi senza il minimo problema?

    Comunque queste sono le API che normalmente uso nei miep programmi... quelle commentate al momento NON le uso in questo:

    codice:
      '<DllImport("user32.dll", CharSet:=CharSet.Unicode)> _
        'Friend Shared Function GetClassName(ByVal hWnd As System.IntPtr, ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer) As Integer
        'End Function
    
        '<DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)> _
        'Friend Shared Function ShowCursor(ByVal bShow As Boolean) As Integer
        'End Function
    
        <DllImport("wininet.dll")> _
        Friend Shared Function InternetGetConnectedState(ByRef Description As Integer, ByVal ReservedValue As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
        End Function
    
        '<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
        'Friend Shared Function GetWindow(ByVal hWnd As IntPtr, ByVal uCmd As UInt32) As IntPtr
        'End Function
    
        'Friend Declare Function Mouse_Event Lib "user32.dll" Alias "mouse_event" (ByVal dwFlags As Int32, _
        '        ByVal dX As Int32, ByVal dY As Int32, ByVal cButtons As Int32, ByVal dwExtraInfo As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
    
        '<DllImport("User32.dll", SetLastError:=True)> _
        'Friend Shared Function PrintWindow(hwnd As IntPtr, hDC As IntPtr, nFlags As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
        'End Function
    
        '<DllImport("user32.dll")> _
        'Friend Shared Function RedrawWindow(hWnd As IntPtr, lprcUpdate As IntPtr, hrgnUpdate As IntPtr, flags As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
        'End Function
    
        <DllImport("kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
        Friend Shared Function GetModuleHandle(ByVal lpModuleName As String) As IntPtr
        End Function
    
        <DllImport("user32.dll")> _
        Friend Shared Function CallNextHookEx(ByVal hhk As IntPtr, ByVal nCode As Int32, ByVal wParam As IntPtr, ByRef vkCode As UInt32) As IntPtr
        End Function
    
        <DllImport("user32.dll", SetLastError:=True)> _
        Friend Shared Function SetWindowsHookEx(ByVal idHook As Int32, ByVal lpfn As [Delegate], ByVal hMod As IntPtr, ByVal dwThreadId As UInt32) As IntPtr
        End Function
    
        <DllImport("user32.dll", SetLastError:=True)> _
        Friend Shared Function UnhookWindowsHookEx(ByVal hhk As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
        End Function
    
        '<DllImport("user32.dll")> _
        'Friend Shared Function GetWindowRect(ByVal hWnd As IntPtr, ByRef lpRect As RECT) As <MarshalAs(UnmanagedType.Bool)> Boolean
        'End Function
    
        '<DllImport("user32.dll", CharSet:=CharSet.Auto)> _
        'Friend Shared Function GetClientRect(ByVal hWnd As System.IntPtr, ByRef lpRECT As RECT) As <MarshalAs(UnmanagedType.Bool)> Boolean
        'End Function
    
        '<DllImport("user32.dll")> _
        'Friend Shared Function WindowFromPoint(ByVal PointX As Integer, PointY As Integer) As IntPtr
        'End Function
    
        'Friend Declare Unicode Function GetCurrentThemeName Lib "uxtheme.dll" (ByVal stringThemeName As StringBuilder, _
        '    ByVal lengthThemeName As Integer, ByVal stringColorName As StringBuilder, ByVal lengthColorName As Integer, _
        '       ByVal stringSizeName As StringBuilder, ByVal lengthSizeName As Integer) As Integer
    
        '<DllImport("user32.dll", CharSet:=CharSet.Unicode)> _
        'Friend Shared Function GetClassName(ByVal hWnd As System.IntPtr, ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer) As Integer
        'End Function
    
        '<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
        'Friend Shared Function SetParent(ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
        'End Function
    
        '<DllImport("user32.dll")> _
        'Friend Shared Function DefWindowProc(ByVal hWnd As IntPtr, ByVal uMsg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
        'End Function
    
        '<DllImport("user32.dll", ExactSpelling:=True, CharSet:=CharSet.Unicode)> _
        'Friend Shared Function GetParent(ByVal hWnd As IntPtr) As IntPtr
        'End Function
    
        '<DllImport("user32.dll")> _
        'Friend Shared Function MoveWindow(ByVal hWnd As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal bRepaint As Boolean) As <MarshalAs(UnmanagedType.Bool)> Boolean
        'End Function
    
        'Friend Declare Auto Function GetWindow Lib "user32.dll" ( _
        'ByVal hWnd As IntPtr, ByVal uCmd As Int32) As IntPtr
    
        '<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
        'Friend Shared Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr
        'End Function
    
        'serve per trovare le Child della Lobby
        'Friend Declare Function EnumChildWindows Lib "user32" (ByVal hWnd As IntPtr, ByVal lpEnumFunc As EnumWindProc, ByRef lParam As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
        'Friend Delegate Function EnumWindProc(ByVal hWnd As IntPtr, ByVal lParam As Int32) As <MarshalAs(UnmanagedType.Bool)> Boolean
    
        '<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
        'Friend Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
        'End Function
    
        '<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
        'Friend Shared Function FindWindowEx(ByVal parentHandle As IntPtr, _
        '                  ByVal childAfter As IntPtr, ByVal lclassName As String, ByVal windowTitle As String) As IntPtr
        'End Function
    
        <DllImport("user32.dll")> _
        Friend Shared Function SetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer, ByVal dwNewLong As IntPtr) As Integer
        End Function
    
        'questa serve per mettere in primo piano le finestre non dei tavoli e sapere se sono normali o massimizzate
        <DllImport("user32.dll", SetLastError:=True)> _
        Friend Shared Function GetWindowLong(ByVal hWnd As IntPtr, ByVal nIndex As Integer) As Integer
        End Function
    
        <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
        Friend Shared Function GetWindowText(ByVal hwnd As IntPtr, ByVal lpString As StringBuilder, ByVal cch As Integer) As Integer
        End Function
    
        <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
        Friend Shared Function GetWindowTextLength(ByVal hwnd As IntPtr) As Integer
        End Function
    
        <DllImport("user32.dll", SetLastError:=True)> _
        Friend Shared Function GetForegroundWindow() As IntPtr
        End Function
    
        <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
        Friend Shared Function ShowWindow(ByVal hwnd As IntPtr, ByVal nCmdShow As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
        End Function
    
        <DllImport("kernel32.dll")> _
        Friend Shared Function GetCurrentThreadId() As Integer
        End Function
    
        '<DllImport("user32.dll", SetLastError:=True)> _
        'Friend Shared Function BringWindowToTop(ByVal hwnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
        'End Function
    
        ''per leggere dal file .ini
        '<DllImport("kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
        'Friend Shared Function GetPrivateProfileString(ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, _
        '                ByVal lpReturnedString As StringBuilder, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
        'End Function
    
        '<DllImport("kernel32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
        'Friend Shared Function WritePrivateProfileString(ByVal lpAppName As String, _
        '                    ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As <MarshalAs(UnmanagedType.Bool)> Boolean
        'End Function
    
        <DllImport("user32.dll")> _
        Friend Shared Function GetAsyncKeyState(ByVal vKey As System.Windows.Forms.Keys) As Short
        End Function
    
        'Friend Declare Function SetWindowPos Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal hWndInsertAfter As IntPtr, _
        '  ByVal X As Integer, ByVal Y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal uFlags As Integer) As Boolean
    
        'Friend Declare Unicode Function GetCurrentThemeName Lib "uxtheme.dll" (ByVal stringThemeName As StringBuilder, _
        '        ByVal lengthThemeName As Integer, ByVal stringColorName As StringBuilder, ByVal lengthColorName As Integer, _
        '           ByVal stringSizeName As StringBuilder, ByVal lengthSizeName As Integer) As Integer
    
        Friend Declare Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As IntPtr, _
                                ByRef lpdwProcessId As Integer) As Integer
    
        Friend Declare Function AttachThreadInput Lib "user32.dll" (ByVal idAttach As Integer, _
                                ByVal idAttachTo As Integer, <MarshalAs(UnmanagedType.Bool)> ByVal fAttach As Boolean) As <MarshalAs(UnmanagedType.Bool)> Boolean
    
        Friend Declare Auto Function IsIconic Lib "user32.dll" (ByVal hwnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
    
        'Friend Declare Auto Function GetSystemMetrics Lib "user32.dll" (ByVal smIndex As Integer) As Integer
        'Friend Declare Auto Function IsZoomed Lib "user32.dll" (ByVal hwnd As IntPtr) As Boolean
    
        'Friend Declare Function EnumWindows Lib "user32" (ByVal Adress As CallBack, ByVal y As Integer) As Integer
        '' CallBack delegate    
        'Friend Delegate Function CallBack(ByVal hWnd As IntPtr, ByVal lParam As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
    
        'Friend Declare Function IsWindowVisible Lib "user32.dll" (ByVal hwnd As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
    GetAsyncKey la STRAUSO in quasi tutti i programmi e non dà il minimo problema.

    .

  7. #7
    Risolto

    Altro non ho fatto che creare un progetto ex novo in cui ho importato tutti i files del progetto che dava presenza di virus...

    Cosa provocava il falso positivo resterà un mistero...

    .

  8. #8
    Fumata nera!!

    Dopo una decina di lanci (sia debug che release) e con modifiche assolutamente irrilevanti al codice, Avira inizia a trovarmi il Trojan NELLA SOLA VERSIONE RELEASE. La versione Debug, per adesso, rimane esente da problemi (prima rilevava il virus in entrambe).

    Inizio a pensare se non sia il caso di fare un salto a Lourdes.

  9. #9
    Così ad occhio, dal nome virus fornito, ha l'aria di essere un controllo euristico piuttosto che un riconoscimento di una traccia virale nota; secondo me è l'abbinata GetAsyncKeyState/SetWindowsHookEx/AttachThreadInput e compagnia che fanno giustamente insospettire l'antivirus. Con le API in questione si può tranquillamente mettere in piedi uno spyware di tutto rispetto: GetAsyncKeyState per fare da keylogger, SetWindowsHookEx per monitorare ogni altra finestra, interferire con l'interazione tra utente e altre applicazioni e soprattutto iniettare proprie dll in altri processi, AttachThreadInput per dirottare i messaggi di input diretti ad altri thread.

    Ma esattamente tu che software stai mettendo in piedi per aver bisogno di tutta questa roba?
    GetAsyncKey la STRAUSO in quasi tutti i programmi e non dà il minimo problema.
    In un decennio di programmazione non credo di averla mai usata... che cosa te ne fai? In genere per qualunque cosa che non sia un keylogger ci sono modi meno invasivi... Idem per le hook...
    Amaro C++, il gusto pieno dell'undefined behavior.

  10. #10
    Non sono un programmatore di professione... programmo in ricordo dei vecchi tempi e per tenere la vecchia mente in (ottimo) allenamento. Poi se esce qualche programma che può servire lo metto on line donationware.

    Per passare il tempo, ovviamente, mi vado a cercare cose difficili... da qui l' uso di quelle API.

    Con le API ...Hook... creo un Hook di tastiera e/o mouse. E poiché a volte la routine di Hook va in palle e blocca tutto... con AsyncKeyState in un timer posso contare almeno su una Key di reset.

    Ma, ripeto, ammesso e non concesso che un antivirus rilevi qualcosa che non va usando quelle API... NON SI CAPISCE PERCHE' non succeda in TUTTI i miei programmini... e non si capisce perché RIFACENDO TUTTO (e recuperando i files precedenti) per molte volte abbia potuto lanciare il Release senza problemi... e perché possa usare il Debug senza problemi, che usa le stesse identiche istruzioni.

    Mi sa che faccio il solito formattone e riparto da capo....

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.