Learn to hack: Difference between revisions

From Enlace Hacktivista
Jump to navigation Jump to search
No edit summary
(36 intermediate revisions by 2 users not shown)
Line 3: Line 3:
Make sure that you follow good OPSEC when carrying out your operations! See [https://enlacehacktivista.org/index.php?title=Learn_to_hack#Operational_security OPSEC]
Make sure that you follow good OPSEC when carrying out your operations! See [https://enlacehacktivista.org/index.php?title=Learn_to_hack#Operational_security OPSEC]


= General Resources =
== General Resources ==


Resources that assume little to no background knowledge:
Resources that assume little to no background knowledge:
Line 11: Line 11:
Resources that assume minimal tech background:
Resources that assume minimal tech background:
* (book) Penetration Testing: A Hands-On Introduction to Hacking
* (book) Penetration Testing: A Hands-On Introduction to Hacking
* [https://web.archive.org/web/20230531145531/https://papers.vx-underground.org/papers/Malware%20Defense/Malware%20Analysis%202021/2021-08-31%20-%20Bassterlord%20%28FishEye%29%20Networking%20Manual%20%28X%29.pdf Bassterlord Networking Manual (translated)]
* [https://web.archive.org/web/20230531145531/https://papers.vx-underground.org/papers/Malware%20Defense/Malware%20Analysis%202021/2021-08-31%20-%20Bassterlord%20%28FishEye%29%20Networking%20Manual%20%28X%29.pdf Bassterlord Networking Manual (translated)] (Focuses on [https://enlacehacktivista.org/index.php?title=Fortinet_SSL_VPN_Path_Traversal exploiting and hacking into networks via Forti SSL VPN])
* [https://web.archive.org/web/20230531144434if_/https://cdn-151.anonfiles.com/vcD868ubz5/08a9b897-1685544763/BasterLord+-+Network+manual+v2.0.pdf Bassterlord Networking Manual v2.0 (translated)]
* [https://web.archive.org/web/20230531144434if_/https://cdn-151.anonfiles.com/vcD868ubz5/08a9b897-1685544763/BasterLord+-+Network+manual+v2.0.pdf Bassterlord Networking Manual v2.0 (translated)] (Focuses on [[VPN brute forcing]])
* Translated: [https://web.archive.org/web/20230404175503if_/https://cdn-150.anonfiles.com/satbX2i8z2/75a3be58-1680631481/Conti_playbook_translated.pdf Conti playbook]
* Translated: [https://web.archive.org/web/20230404175503if_/https://cdn-150.anonfiles.com/satbX2i8z2/75a3be58-1680631481/Conti_playbook_translated.pdf Conti playbook]
* LockBit 3.0 CobaltStrike: [https://web.archive.org/web/20230701141731if_/https://cdn-147.anonfiles.com/s1cbD0z3z3/4536e4f8-1688221595/LockBit-CobaltStrike.pdf LockBit 3.0 Guide]
* LockBit 3.0 CobaltStrike: [https://web.archive.org/web/20230701141731if_/https://cdn-147.anonfiles.com/s1cbD0z3z3/4536e4f8-1688221595/LockBit-CobaltStrike.pdf LockBit 3.0 Guide]
Line 25: Line 25:
* https://book.hacktricks.xyz
* https://book.hacktricks.xyz
* [https://kolektiva.media/w/twJjCTkvumnugRy61BjD3T Pronico Hack Back]
* [https://kolektiva.media/w/twJjCTkvumnugRy61BjD3T Pronico Hack Back]
* https://github.com/Correia-jpv/fucking-the-book-of-secret-knowledge
* https://github.com/0xPugazh/One-Liners


The Bug Hunters Methodology:
The Bug Hunters Methodology:
* https://github.com/jhaddix/tbhm
* https://github.com/jhaddix/tbhm
* Application Analysis: https://youtu.be/FqnSAa2KmBI  
* Application Analysis: https://youtu.be/FqnSAa2KmBI  
 
* The Bug Hunter's Methodology v4.0: https://youtu.be/p4JgIu1mceI?si=jXcYksd4UqodZDBF
Practice labs:
Practice labs:
* https://www.hackthebox.com
* https://www.hackthebox.com
Line 36: Line 38:
* https://lab.pentestit.ru
* https://lab.pentestit.ru
* https://overthewire.org/wargames
* https://overthewire.org/wargames
* https://www.vulnhub.com/


Appsec:
Appsec:
Line 44: Line 47:
* https://github.com/ytisf/theZoo/tree/master/malware
* https://github.com/ytisf/theZoo/tree/master/malware


== General references ==
=== General references ===


General resources you may find useful for learning.  
General resources you may find useful for learning.  
Line 55: Line 58:
See recommended reading [https://libgen.fun books] that will aid you in your learning. See [[recommended reading in the library]]
See recommended reading [https://libgen.fun books] that will aid you in your learning. See [[recommended reading in the library]]


= Operational security =
* [https://theanarchistlibrary.org/special/index The Anarchist Library] ([http://libraryqxxiqakubqv3dc2bend2koqsndbwox2johfywcatxie26bsad.onion/special/index Tor])
* Phrack: http://phrack.org
 
== Operational security ==


Operational security (OPSEC) is crucial for protecting oneself from surveillance and maintaining anonymity while conducting hacktivist operations.
Operational security (OPSEC) is crucial for protecting oneself from surveillance and maintaining anonymity while conducting hacktivist operations.
Line 65: Line 71:
For more information on recommended operational security measures, see [[Opsec Measures]]
For more information on recommended operational security measures, see [[Opsec Measures]]


== Secure Messaging ==
=== Secure Messaging ===


Best practice for secure messaging includes proxying connections over Tor and using end-to-end encryption for messages.
Best practice for secure messaging includes proxying connections over Tor and using end-to-end encryption for messages.


=== Recommended Applications ===
==== Recommended Applications ====


For Jabber/XMPP, make sure to enable OTR or OMEMO encryption. For email use PGP for encryption. For file sharing use onionshare.
For Jabber/XMPP, make sure to enable OTR or OMEMO encryption. For e-mail use PGP for encryption. For file sharing use onionshare.


For more information on recommended applications, see [[Secure Messaging Applications]]
For more information on recommended applications, see [[Secure Messaging Applications]]


= Initial Access =
== Initial Access ==


There are many ways to get a [https://attack.mitre.org/tactics/TA0001/ initial access] into a targets network, from phishing, buying credential access, buying infected machines in corporate networks, password spraying, performing a targeted [https://www.ired.team/offensive-security-experiments/offensive-security-cheetsheets penetration test] and spray and pray scanning for vulnerabilities and hacking in. Here we list some resources in these regards.
There are many ways to gain [https://attack.mitre.org/tactics/TA0001/ initial access] into a targets network, from phishing, buying credential access, buying infected machines in corporate networks, password spraying, performing a targeted [https://www.ired.team/offensive-security-experiments/offensive-security-cheetsheets penetration test] and spray and pray scanning for vulnerabilities and hacking in. Here we list some resources in these regards.
 
=== Common Initial Access TTPs ===


For more information on gaining a foothold, see [[Initial Access Tactics, techniques and procedures]]
For more information on gaining a foothold, see [[Initial Access Tactics, techniques and procedures]]
=== Attacking Common Services ===
Your targets will likely use many services either externally or internally, this could be SSH, RDP, SMB, etc. It's important to know their common misconfigurations, attack vectors, their attack surface and how to hack these various protocols which may serve as the initial access vector. Here we cover various tools, techniques, common misconfigurations, tips and tricks and we cover both internal and external (publicly accessible) networks.
See [[Common Service Attacks]]


=== Scanning and Recon ===
=== Scanning and Recon ===
Line 97: Line 110:
For more information on recommended tools and resources, see [[OSINT Tools and Resources]]
For more information on recommended tools and resources, see [[OSINT Tools and Resources]]


= Post exploitation =
== Persistence ==
Once you've found a weakness in your targets infrastructure and have been able to gain [https://enlacehacktivista.org/index.php?title=Initial_Access_Tactics,_techniques_and_procedures initial access] you'll want to keep it and avoid detection to maintain your access to your targets network for as long as possible.


=== Windows ===
See [[Persistence]].
Find common vulnerabilities and misconfigurations in a windows environment to escalate your privileges: [https://github.com/carlospolop/PEASS-ng/tree/master/winPEAS winPEAS]
* Living Off The Land Binaries, Scripts and Libraries: https://lolbas-project.github.io
* Living off the land. Evading detection with Sysinternals: https://live.sysinternals.com (\\live.sysinternals.com\tools)
* [[mimikatz]]: https://github.com/gentilkiwi/mimikatz/releases
* https://github.com/fortra/impacket
* [[Disable Defender]]
* [https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20Using%20credentials.md Windows - Using credentials]


==== Active Directory ====
== Post exploitation ==


Active Directory General Tools & resources you may find useful for learning.
=== Windows ===
 
For Windows post exploitation, Active Directory and networking hacking, Lateral movement techniques, privilege escalation, defensive and offensive techniques:
See [[Active Directory]] for learning resources and tools.


=== Antivirus & EDR Evasion ===
See [[Hacking Windows]]
* https://s3cur3th1ssh1t.github.io/Bypass_AMSI_by_manual_modification/
* https://s3cur3th1ssh1t.github.io/Customizing_C2_Frameworks/
* https://s3cur3th1ssh1t.github.io/Powershell-and-the-.NET-AMSI-Interface/
* https://www.blackhillsinfosec.com/tag/sacred-cash-cow-tipping/
* https://blog.securityevaluators.com/creating-av-resistant-malware-part-1-7604b83ea0c0
* https://www.ired.team/offensive-security/defense-evasion
* https://www.youtube.com/watch?v=UO3PjJIiBIE
* https://github.com/matterpreter/DefenderCheck
* https://github.com/RythmStick/AMSITrigger
* https://amsi.fail
* [https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Windows%20-%20AMSI%20Bypass.md https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology and Resources/Windows - AMSI Bypass.md]


=== Linux ===
=== Linux ===
* Rooting: [[Rooting linux]]
For performing Linux post exploitation, gaining persistence, evading detection, privilege escalation and more:
* [[Stabilizing shells]]
* [https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Linux%20-%20Evasion.md Linux - Evasion]
* [https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Linux%20-%20Persistence.md Linux - Persistence]
* Tips, Tricks & Hacks Cheat Sheet: https://github.com/hackerschoice/thc-tips-tricks-hacks-cheat-sheet


=== Persistence ===
See [[Hacking Linux]]
* Gsocket: https://github.com/hackerschoice/gsocket
* PHP: https://github.com/epinna/weevely3
* [https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md#reverse-shell-cheat-sheet Reverse Shell] Generator: https://www.revshells.com
* Meterpreter: https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Reverse%20Shell%20Cheatsheet.md#meterpreter-shell
* Blog: https://dhilipsanjay.gitbook.io/ctfs/tryhackme/tryhackme/linuxbackdoors
* Database: https://www.adminer.org
* PAM: [https://book.hacktricks.xyz/linux-hardening/linux-post-exploitation Pluggable Authentication Module]
* DNS: https://github.com/iagox86/dnscat2


==== C2 Frameworks ====
== Exfiltration ==
[https://www.thec2matrix.com/matrix C2 Matrix]. Open source and closed source command and control (C2) frameworks. Go to [https://enlacehacktivista.org/index.php?title=Initial_Access_Tactics,_techniques_and_procedures#Buying_access popular forums] to find cracked frameworks such as cobalt strike.
* https://docs.google.com/spreadsheets/d/1b4mUxa6cDQuTV2BPC6aA-GR4zGZi0ooPYtBe4IgPsSc
* Living Off Trusted Sites. Use popular legitimate domains when conducting phishing, C&C, exfiltration and downloading tools to evade detection: https://lots-project.com
 
= Office 365 & Azure =
* Extremely in-depth technical info on everything https://o365blog.com
* https://www.synacktiv.com/en/publications/azure-ad-introduction-for-red-teamers.html
* https://blog.xpnsec.com/azuread-connect-for-redteam
* AAD Connect Cloud Sync: as local admin impersonate or retrieve managed password of the provagentgMSA account to dcsync.
** see: https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Methodology%20and%20Resources/Active%20Directory%20Attack.md#reading-gmsa-password
* https://www.blackhillsinfosec.com/webcast-getting-started-in-pentesting-the-cloud-azure
* https://github.com/dafthack/CloudPentestCheatsheets/blob/master/cheatsheets/Azure.md
* https://www.inversecos.com
 
=== Tools ===
* https://github.com/nyxgeek/o365recon
* https://github.com/dirkjanm/ROADtools
* https://github.com/fox-it/adconnectdump
* https://github.com/LMGsec/o365creeper
* https://bloodhound.readthedocs.io/en/latest/data-collection/azurehound.html
* https://github.com/rvrsh3ll/TokenTactics
* https://github.com/nyxgeek/onedrive_user_enum
* https://github.com/dafthack/MSOLSpray
* https://github.com/dafthack/MFASweep
 
= Exfiltration =
One of the main objectives for a hacktivist is that of exfiltrating data, company secrets and if your motivations is that of revealing corruption then this step is of the most importance.
One of the main objectives for a hacktivist is that of exfiltrating data, company secrets and if your motivations is that of revealing corruption then this step is of the most importance.


See [[Data Exfiltration]] for techniques and methods for exfiltrating data out of your targets network.
See [[Data Exfiltration]] for techniques and methods for exfiltrating data out of your targets network.


= Destruction =
== Destruction ==
There may be times during a hacktivist operation when you come to the end of your hack, you've fully compromised your target, exfiltrated everything you can/want and now before finally leaving the network and leaking all the targets secrets online you want to cause chaos and destruction. [https://kolektiva.media/w/twJjCTkvumnugRy61BjD3T As was seen by Guacamaya] where they used <code>sdelete64.exe -accepteula -r -s C:\*</code> to wipe systems attached to Pronicos domain you might also want to do the same for Linux and Windows systems in your operations, maybe you want to recursively print a text file with your manifesto across a system/network, encrypt files beyond recovery or just delete everything.
There may be times during a hacktivist operation when you come to the end of your hack, you've fully compromised your target, exfiltrated everything you can/want and now before finally leaving the network and leaking all the targets secrets online you want to cause chaos and destruction. [https://kolektiva.media/w/twJjCTkvumnugRy61BjD3T As was seen by Guacamaya] where they used <code>sdelete64.exe -accepteula -r -s C:\*</code> to wipe systems attached to Pronicos domain you might also want to do the same for Linux and Windows systems in your operations, maybe you want to recursively print a text file with your manifesto across a system/network, encrypt files beyond recovery or just delete everything.


See [[Chaos and Destruction]] for different ways to achieve this!
See [[Chaos and Destruction]] for different ways to achieve this!


= Hacking Misc =
== Hacking Misc ==
 
=== Web Application Hacking ===
 
See [[Hacking Web Applications]]


== API Hacking ==
=== API Hacking ===
Application Programming Interfaces (APIs) are the plumbing of today’s financial services and FinTech infrastructure, enabling FinTechs to embed banking into their apps and banks to offer a more unified experience to their customers demanding more from their bank ([https://web.archive.org/web/20230713230449if_/https://cdn-153.anonfiles.com/a5Q8c02azf/b80f3b8b-1689290042/Scorched-Earth-Whitepaper.pdf Knight]). [https://owasp.org/www-project-api-security APIs can be exploited] and aid in data exfiltration and taking advantage of an existing service.
Application Programming Interfaces (APIs) are the plumbing of today’s financial services and FinTech infrastructure, enabling FinTechs to embed banking into their apps and banks to offer a more unified experience to their customers demanding more from their bank ([https://web.archive.org/web/20230713230449if_/https://cdn-153.anonfiles.com/a5Q8c02azf/b80f3b8b-1689290042/Scorched-Earth-Whitepaper.pdf Knight]). [https://owasp.org/www-project-api-security APIs can be exploited] to aid in data exfiltration and taking advantage of an existing service.


See [[Hacking APIs]]
See [[Hacking APIs]]!


== IoT Hacking ==
=== IoT Hacking ===
* https://github.com/V33RU/IoTSecurity101
* https://github.com/V33RU/IoTSecurity101


= Product-specific Hacking =
=== Hacking The Cloud ===
More and more of corporate networks are moving away from on-prem to in the cloud. Learning how to [https://hackingthe.cloud hack the cloud infrastructure] of your target is a valuable skill and as time progresses more and more networks will migrate towards the cloud.
 
See [[Cloud Hacking]]
 
=== Reverse Engineering ===
As was seen by [https://enlacehacktivista.org/index.php?title=Hack_Back!_A_DIY_Guide Phineas Fisher], highly motivated hacktivists who seek to hack their targets by any means necessary should consider 0-day research and exploit development, reverse engineering applications and services that their target may be running to gain an initial foothold and perform post exploitation.
 
See [[Reverse Engineering]]
 
== Product-specific Hacking ==


== GSuite ==
=== Google Workspace ===
https://www.slideshare.net/dafthack/ok-google-how-do-i-red-team-gsuite
https://www.slideshare.net/dafthack/ok-google-how-do-i-red-team-gsuite


== VMware ==
=== VMware ===
* Exploiting vCenter to add vSphere user: https://github.com/HynekPetrak/HynekPetrak/blob/master/take_over_vcenter_670.md
* Exploiting vCenter to add vSphere user: https://github.com/HynekPetrak/HynekPetrak/blob/master/take_over_vcenter_670.md
* VMware Workspace ONE Access and Identity Manager RCE via SSTI. [https://attackerkb.com/topics/BDXyTqY1ld/cve-2022-22954/rapid7-analysis CVE-2022-22954:] Unauthenticated server-side template injection. [https://github.com/tunelko/CVE-2022-22954-PoC Mass Exploit]
* VMware Workspace ONE Access and Identity Manager RCE via SSTI. [https://attackerkb.com/topics/BDXyTqY1ld/cve-2022-22954/rapid7-analysis CVE-2022-22954:] Unauthenticated server-side template injection. [https://github.com/tunelko/CVE-2022-22954-PoC Mass Exploit]


== RocketChat ==
=== Rocket.Chat ===
* Account hijacking and RCE as admin: [https://web.archive.org/web/20210805092939/https://edbrsk.dev/content/real-cases/how-I-compromised-300-stores-and-a-spanish-consultancy https://edbrsk.dev/content/real-cases/how-I-compromised-300-stores-and-a-spanish-consultancy]
* Account hijacking and RCE as admin: [https://web.archive.org/web/20210805092939/https://edbrsk.dev/content/real-cases/how-I-compromised-300-stores-and-a-spanish-consultancy https://edbrsk.dev/content/real-cases/how-I-compromised-300-stores-and-a-spanish-consultancy]


== Microsoft Exchange ==
=== Microsoft Exchange ===


ProxyLogon is dead. It's mitigated by Defender. ProxyShell is not. AMSI catches unmodified public exploits.
ProxyLogon is dead. It's mitigated by Defender. ProxyShell is not. AMSI catches unmodified public exploits.

Revision as of 22:37, 21 November 2023

This page aims to compile high quality resources for hackers for both the experienced and inexperienced. All books listed on this page can be found on Library Genesis.

Make sure that you follow good OPSEC when carrying out your operations! See OPSEC

General Resources

Resources that assume little to no background knowledge:

Resources that assume minimal tech background:

Resources that assume a tech or hacking background:

The Bug Hunters Methodology:

Practice labs:

Appsec:

Malware, a collection of malware source code and binaries:

General references

General resources you may find useful for learning.

See General References

OWASP Top 10 is a broad consensus about the most critical security risks to web applications. See TryHackMe's room for practical OWASP Top 10 learning and their Juice Shop.

Recommended Reading - The Library

See recommended reading books that will aid you in your learning. See recommended reading in the library

Operational security

Operational security (OPSEC) is crucial for protecting oneself from surveillance and maintaining anonymity while conducting hacktivist operations.

Recommended Measures

Any illegal hacktivity should be done from an encrypted and separate computer or virtual machine, with all traffic router over Tor.

For more information on recommended operational security measures, see Opsec Measures

Secure Messaging

Best practice for secure messaging includes proxying connections over Tor and using end-to-end encryption for messages.

Recommended Applications

For Jabber/XMPP, make sure to enable OTR or OMEMO encryption. For e-mail use PGP for encryption. For file sharing use onionshare.

For more information on recommended applications, see Secure Messaging Applications

Initial Access

There are many ways to gain initial access into a targets network, from phishing, buying credential access, buying infected machines in corporate networks, password spraying, performing a targeted penetration test and spray and pray scanning for vulnerabilities and hacking in. Here we list some resources in these regards.

Common Initial Access TTPs

For more information on gaining a foothold, see Initial Access Tactics, techniques and procedures

Attacking Common Services

Your targets will likely use many services either externally or internally, this could be SSH, RDP, SMB, etc. It's important to know their common misconfigurations, attack vectors, their attack surface and how to hack these various protocols which may serve as the initial access vector. Here we cover various tools, techniques, common misconfigurations, tips and tricks and we cover both internal and external (publicly accessible) networks.

See Common Service Attacks

Scanning and Recon

For scanning and recon tools, see Scanning and Recon. Make sure to make use of your tool's documentation and read the help menu (-hh/-h/--help).

Search Engines

Search engines are a useful tool for gathering information and intelligence from publicly available sources. Some are paid and some are free. Make sure to operate good OPSEC whenever placing a purchase for any service that will be used in your recon on a target.

For more information on recommended search engines, see Search Engines Resources

OSINT

Open-source intelligence (OSINT) refers to the collection and analysis of information from publicly available sources.

For more information on recommended tools and resources, see OSINT Tools and Resources

Persistence

Once you've found a weakness in your targets infrastructure and have been able to gain initial access you'll want to keep it and avoid detection to maintain your access to your targets network for as long as possible.

See Persistence.

Post exploitation

Windows

For Windows post exploitation, Active Directory and networking hacking, Lateral movement techniques, privilege escalation, defensive and offensive techniques:

See Hacking Windows

Linux

For performing Linux post exploitation, gaining persistence, evading detection, privilege escalation and more:

See Hacking Linux

Exfiltration

One of the main objectives for a hacktivist is that of exfiltrating data, company secrets and if your motivations is that of revealing corruption then this step is of the most importance.

See Data Exfiltration for techniques and methods for exfiltrating data out of your targets network.

Destruction

There may be times during a hacktivist operation when you come to the end of your hack, you've fully compromised your target, exfiltrated everything you can/want and now before finally leaving the network and leaking all the targets secrets online you want to cause chaos and destruction. As was seen by Guacamaya where they used sdelete64.exe -accepteula -r -s C:\* to wipe systems attached to Pronicos domain you might also want to do the same for Linux and Windows systems in your operations, maybe you want to recursively print a text file with your manifesto across a system/network, encrypt files beyond recovery or just delete everything.

See Chaos and Destruction for different ways to achieve this!

Hacking Misc

Web Application Hacking

See Hacking Web Applications

API Hacking

Application Programming Interfaces (APIs) are the plumbing of today’s financial services and FinTech infrastructure, enabling FinTechs to embed banking into their apps and banks to offer a more unified experience to their customers demanding more from their bank (Knight). APIs can be exploited to aid in data exfiltration and taking advantage of an existing service.

See Hacking APIs!

IoT Hacking

Hacking The Cloud

More and more of corporate networks are moving away from on-prem to in the cloud. Learning how to hack the cloud infrastructure of your target is a valuable skill and as time progresses more and more networks will migrate towards the cloud.

See Cloud Hacking

Reverse Engineering

As was seen by Phineas Fisher, highly motivated hacktivists who seek to hack their targets by any means necessary should consider 0-day research and exploit development, reverse engineering applications and services that their target may be running to gain an initial foothold and perform post exploitation.

See Reverse Engineering

Product-specific Hacking

Google Workspace

https://www.slideshare.net/dafthack/ok-google-how-do-i-red-team-gsuite

VMware

Rocket.Chat

Microsoft Exchange

ProxyLogon is dead. It's mitigated by Defender. ProxyShell is not. AMSI catches unmodified public exploits.