Dans le cadre d'un pré-audit ISO27k, j'ai fais en qq minutes (WAPT Power !!) un "ptipackagealacon" qui audit les péripheriques USB de type storage qui ont été branché sur les postes Windows.
Je vous partage ici ce package:
Dans le control, on set l'audit_schedule à la valeur désirée (ici 12h)
Le setup.py:
|# -*- coding: utf-8 -*- fromsetuphelpersimport* definstall(): pass defaudit(): try: usb=run_powershell(r'Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Enum\USBSTOR** | Select FriendlyName,PSChildName') print('%s'%usb) except: print('No USB Storage Found') return"OK" if__name__=='__main__': audit() defupdate_package(): pass | ||
|Le rapport qui va bien:|
||
|select hosts.computer_name, hosts.serialnr, hosts.last_logged_on_user,|
|hostpackagesstatus.last_audit_status, hostpackagesstatus.last_audit_on, hostpackagesstatus.last_audit_output|
|from hosts|
|LEFT JOIN hostpackagesstatus on hostpackagesstatus.host_id = hosts.uuid and hostpackagesstatus.package = 'ywh-audit-usbstorage'|
|where hosts.platform = 'Windows' |
| |
||
|||Ce qui nous sort des infos du genre:|
| |
|Auditing ywh-audit-usbstorage|
|{'FriendlyName': 'Kingston DataTraveler 3.0 USB Device', 'PSChildName': 'E0D55EA5XXXXXXXXXXXX71&0'}|
||
| Le PSChildName étant le serial du peripherique USB ;)
Bon weekend !
|
Bonjour,
Merci pour cette contribution qui nous sera bien utile ici. Je teste de suite !
Cordialement,
M. Ramsès PERRIN Responsable des Systèmes d’Information - IT Manager ________________________________ Lycée français de Kuala Lumpur Henri Fauconnier - French School of Kuala Lumpur 34, Jalan Dutamas Raya 51200 Kuala Lumpur, Malaysia Tel (00603) 62504415 Ext 133
ramses.perrin@lfkl.edu.mymailto:ramses.perrin@lfkl.edu.my Facebookhttps://www.facebook.com/lyceefrancaisdekualalumpur/ – LinkedInhttps://www.linkedin.com/company/lyc%C3%A9efran%C3%A7aisdekualalumpur-frenchschoolofkualalumpur/mycompany/?viewAsMember=true – Twitterhttps://twitter.com/LyceeKuala – Instagramhttps://www.instagram.com/lfkl_lyceefrancaiskualalumpur/ - Youtubehttps://www.youtube.com/channel/UCjwxVQih1aQdFu1yoMOXvYA – www.lfkl.edu.myhttp://www.lfkl.edu.my
[cid:image001.jpg@01D84820.10D1AE00]
Ce message et toutes les pièces jointes sont protégés par les règles déontologiques du secret de la correspondance. Il peut notamment contenir des informations confidentielles à l'attention exclusive du (des) destinataire(s). Toute utilisation de ce message non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, ne peut être faite qu'avec l'autorisation expresse de l'émetteur. Si vous recevez ce message par erreur, merci de le détruire sans en conserver de copie et d'en avertir immédiatement l'émetteur.
This message and all attachments are protected by the deontological rules of secrecy of correspondence. In particular, it may contain confidential information for the exclusive attention of the recipient(s). Any use of this message not in accordance with its destination, any distribution or publication, in whole or in part, can only be made with the express permission of the sender. If you receive this message by mistake, please destroy it without keeping a copy and immediately notify the sender. De : WAPT wapt-bounces@lists.wapt.fr De la part de Jordi Morillo via WAPT Envoyé : vendredi 1 avril 2022 23:40 À : wapt@lists.wapt.fr Cc : Jordi Morillo j.morillo@yeswehack.com Objet : [Wapt] Audit USB storage
Dans le cadre d'un pré-audit ISO27k, j'ai fais en qq minutes (WAPT Power !!) un "ptipackagealacon" qui audit les péripheriques USB de type storage qui ont été branché sur les postes Windows.
Je vous partage ici ce package:
Dans le control, on set l'audit_schedule à la valeur désirée (ici 12h)
Le setup.py:
# -*- coding: utf-8 -*-
from setuphelpers import *
def install():
pass
def audit():
try:
usb = run_powershell(r'Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Enum\USBSTOR** | Select FriendlyName,PSChildName')
print('%s' % usb)
except:
print('No USB Storage Found')
return "OK"
if __name__ == '__main__':
audit()
def update_package():
pass
Le rapport qui va bien:
select hosts.computer_name, hosts.serialnr, hosts.last_logged_on_user,
hostpackagesstatus.last_audit_status, hostpackagesstatus.last_audit_on, hostpackagesstatus.last_audit_output
from hosts
LEFT JOIN hostpackagesstatus on hostpackagesstatus.host_id = hosts.uuid and hostpackagesstatus.package = 'ywh-audit-usbstorage'
where hosts.platform = 'Windows'
Ce qui nous sort des infos du genre:
Auditing ywh-audit-usbstorage
{'FriendlyName': 'Kingston DataTraveler 3.0 USB Device', 'PSChildName': 'E0D55EA5XXXXXXXXXXXX71&0'}
Le PSChildName étant le serial du peripherique USB ;)
Bon weekend !