Ir para conteúdo
Fórum Script Brasil

caion90

Membros
  • Total de itens

    16
  • Registro em

  • Última visita

Tudo que caion90 postou

  1. pessoal, no C# como faço pra transforma 2 chars (ex. FF) em byte?
  2. realmente Jhonas, esta vaga minha pergunta.. estou me referindo ao que o computador faz. (Ex.) um programa. pode ser interpretado como um circuito lógico (digo virtual no sentido de não ser fisico mas estar por ex. no hd). penso que o computador (cpu) é um interpretador lógico. não sei em que momento da história que os programas (funções) eram feitos no hardware, e dado momento um cara da intel resolveu criar um programa em uma memória que seria interpretado, dessa forma substituindo varios circuitos por um interpretador, que seria no caso um processador.
  3. pra quem já cursou CC ou sabe. desconfio que deve ser um circuito lógico virtual interpretado pelo processador. to certo?
  4. em um tabulero NxN tem N damas, como achar as posições para que cada umas das N damas não ataquem umas as outras?
  5. cara, se conselho prestase até de daria, mas, em resumo, essa de kl n vira. pensa, o que você faria se você tivesse tudo o q você quer ter com esse kl... b***? n vale a pena perca tempo com coisa q presta.
  6. pessoal, beleza? estou tentando fazer uma função que gere uma chave de 16 bytes. estou emperrado nela, se alguém souber a resolvela, kkkkk nem eu to conseguindo! function serial(str:string):string; var val: array[0..15] of byte; i,j: integer; tmp: byte; begin val[0] := $37; val[1] := $72; val[2] := $96; val[3] := $93; val[4] := $10; val[5] := $25; val[6] := $45; val[7] := $61; val[8] := $81; val[9] := $97; val[10] := $6; val[11] := $22; val[12] := $42; val[13] := $77; val[14] := $82; val[15] := $64; for I := 0 to length(val)-1 do for j := 1 to length(str) do begin case (j mod 3) of 0: tmp := tmp + val; 1: tmp := tmp - val; 2: tmp := tmp * i; end; end; result := result + char(tmp); tmp := $0; end;
  7. Pessoal, peguei esse desafio da internet e estou tentando resolve, é bem interessante! estou tentando usar a propriedade "Canvas.Pixels[x,y]" para ler os pixels da imagem e traçar os pontos para no final poder reconstruir o circulo, de outra cor. para quem topar me ajudar e tentar resolver: http://pastebin.com/KnUH1J7w vlw pessoal!
  8. usa essa função... uses ZLIB; function Comprimir(abrir,salvar: string):TFileStream; var zip: TCompressionStream; tmp: TFileStream; begin result := TFileStream.Create(salvar, fmcreate); tmp := TFileStream.Create(abrir, fmOpenRead); zip := TCompressionStream.Create(clmax, result); zip.CopyFrom(tmp, tmp.Size); zip.Free; tmp.Free; end;
  9. caion90

    Erros bobos... =\

    as funções STRPOS não validam quando eu envio um comando com '.c', '.php', ou '.pas' pro programa, e quando uso STRPOS(...)>0 ele sempre valida mesmo não tendo a string, n sei trabalhar com essa função
  10. não sei fazer isso, preciso da ajuda do forum... NTSTATUS ZwCreateSection( __out PHANDLE SectionHandle, __in ACCESS_MASK DesiredAccess, __in_opt POBJECT_ATTRIBUTES ObjectAttributes, __in_opt PLARGE_INTEGER MaximumSize, __in ULONG SectionPageProtection, __in ULONG AllocationAttributes, __in_opt HANDLE FileHandle ); os __in_opt são opcionais, como faço para ver se eles estão ou não setados? já tentei if (ObjectAttributes != 0x00), if (ObjectAttributes)...
  11. caion90

    Erro bobo

    pessoal, ainda estou na tentativa de fazer o PoC. seria mais ou menos o seguinte, o programa chama a função URLDownloadToFile da URLMON.DLL, isso é normal, e é bem conhecido, o que quero é redirecionar a função que abre as bibliotecas para quando ele tentar abrir uma biblioteca, ex. NOMLRU.DLL (que é urlmon) vou redirecionar para URLMON verdadeira. aqui esta o source, mas tem alguns erros, estão na comparação porque o hook que faço alguns parametros são opcionais e não consigo verificar se eles estão setados, aqui vai o codigo #include <ntddk.h> #define SYSTEMSERVICE(_name) KeServiceDescriptorTable.ServiceTable[*(DWORD *) ((unsigned char *)_name + 1)] #define DEBUG typedef unsigned long DWORD, *PDWORD; typedef unsigned char BYTE, *PBYTE; void hooking(void); void Unhooking(); NTSTATUS DriverEntry(PDRIVER_OBJECT, PUNICODE_STRING); // main() du driver void Unload_driver(IN PDRIVER_OBJECT); #pragma pack(1) typedef struct ServiceDescriptorEntry { PDWORD ServiceTable; PDWORD CounterTableBase; DWORD ServiceLimit; PBYTE ArgumentTable; } SDT; #pragma pack() __declspec(dllimport) SDT KeServiceDescriptorTable; /*typedef NTSYSAPI NTSTATUS (*ZWCREATEFILE) ( OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength ); typedef NTSYSAPI NTSTATUS (*ZWOPENFILE) ( OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG ShareAccess, IN ULONG OpenOptions ); */ typedef NTSYSAPI NTSTATUS (*ZWCREATESECTION) ( OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN PLARGE_INTEGER MaximumSize, IN ULONG SectionPageProtection, IN ULONG AllocationAttributes, IN HANDLE FileHandle ); /*ZWCREATEFILE OrigZwCreateFile; extern ZWCREATEFILE OrigZwCreateFile; ZWOPENFILE OrigZwOpenFile; extern ZWOPENFILE OrigZwOpenFile; */ ZWCREATESECTION OrigZwCreateSection; extern ZWCREATESECTION OrigZwCreateSection; /* NTSTATUS RtlEqualUnicodeString( IN PUNICODE_STRING String1, IN PUNICODE_STRING String2, IN BOOLEAN CaseInSensitive ); typedef struct _OBJECT_ATTRIBUTES { ULONG Length; HANDLE RootDirectory; PUNICODE_STRING ObjectName; ULONG Attributes; PVOID SecurityDescriptor; PVOID SecurityQualityOfService; } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; typedef CONST OBJECT_ATTRIBUTES *PCOBJECT_ATTRIBUTES; NTSTATUS ZwCreateSection( __out PHANDLE SectionHandle, __in ACCESS_MASK DesiredAccess, __in_opt POBJECT_ATTRIBUTES ObjectAttributes, __in_opt PLARGE_INTEGER MaximumSize, __in ULONG SectionPageProtection, __in ULONG AllocationAttributes, __in_opt HANDLE FileHandle ); */ NTSTATUS FakeZwCreateSection( OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN PLARGE_INTEGER MaximumSize, IN ULONG SectionPageProtection, IN ULONG AllocationAttributes, IN HANDLE FileHandle ) { UNICODE_STRING KernelName; UNICODE_STRING UrlmonName; UNICODE_STRING RKernelName; UNICODE_STRING RUrlmonName; RtlInitUnicodeString(&RKernelName, L"\\??\\C:\\windows\\system32\\kernel32.dll"); RtlInitUnicodeString(&KernelName, L"\\??\\C:\\windows\\system32\\lld.23lenrek"); RtlInitUnicodeString(&RUrlmonName, L"\\??\\C:\\windows\\system32\\URLMON.DLL"); RtlInitUnicodeString(&UrlmonName, L"\\??\\C:\\windows\\system32\\LLD.NOMLRU"); if (ObjectAttributes) { if(RtlEqualUnicodeString(ObjectAttributes->ObjectName,&KernelName, TRUE)){ DbgPrint("ZWCREATESECTION redirect acionado - KERNEL32\n"); // ObjectAttributes->ObjectName = &RKernelName; return(((ZWCREATESECTION)(OrigZwCreateSection)) ( SectionHandle, DesiredAccess, ObjectAttributes, MaximumSize, SectionPageProtection, AllocationAttributes, FileHandle)); } else if(RtlEqualUnicodeString(ObjectAttributes->ObjectName,&UrlmonName, TRUE)){ DbgPrint("ZWCREATESECTION redirect acionado - URLMON\n"); // ObjectAttributes->ObjectName = &RUrlmonName; return(((ZWCREATESECTION)(OrigZwCreateSection)) ( SectionHandle, DesiredAccess, ObjectAttributes, MaximumSize, SectionPageProtection, AllocationAttributes, FileHandle)); } else return(((ZWCREATESECTION)(OrigZwCreateSection)) ( SectionHandle, DesiredAccess, ObjectAttributes, MaximumSize, SectionPageProtection, AllocationAttributes, FileHandle)); } else return(((ZWCREATESECTION)(OrigZwCreateSection)) ( SectionHandle, DesiredAccess, ObjectAttributes, MaximumSize, SectionPageProtection, AllocationAttributes, FileHandle)); } /* NTSTATUS FakeZwOpenFile( OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG ShareAccess, IN ULONG OpenOptions ) { UNICODE_STRING KernelName; UNICODE_STRING UrlmonName; UNICODE_STRING RKernelName; UNICODE_STRING RUrlmonName; RtlInitUnicodeString(&KernelName, L"\\??\\C:\\windows\\system32\\lld.23lenrek"); RtlInitUnicodeString(&UrlmonName, L"\\??\\C:\\windows\\system32\\LLD.NOMLRU"); RtlInitUnicodeString(&RKernelName, L"\\??\\C:\\windows\\system32\\kernel32.dll"); RtlInitUnicodeString(&RUrlmonName, L"\\??\\C:\\windows\\system32\\URLMON.DLL"); if(RtlEqualUnicodeString(ObjectAttributes->ObjectName,&KernelName, TRUE)){ DbgPrint("ZWOPENFILE redirect acionado - KERNEL32\n"); ObjectAttributes->ObjectName = &RKernelName; return(((ZWOPENFILE)(OrigZwOpenFile)) ( FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, ShareAccess, OpenOptions)); } else if(RtlEqualUnicodeString(ObjectAttributes->ObjectName,&UrlmonName, TRUE)){ DbgPrint("ZWOPENFILE redirect acionado - URLMON\n"); ObjectAttributes->ObjectName = &RUrlmonName; return(((ZWOPENFILE)(OrigZwOpenFile)) ( FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, ShareAccess, OpenOptions)); } else return(((ZWOPENFILE)(OrigZwOpenFile)) ( FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, ShareAccess, OpenOptions)); } */ void Hooking(void) { _asm{cli} OrigZwCreateSection = (ZWCREATESECTION) (SYSTEMSERVICE(ZwCreateSection)); (ZWCREATESECTION) (SYSTEMSERVICE(ZwCreateSection)) = FakeZwCreateSection; _asm{sti} } void Unhooking() { _asm{cli} (ZWCREATESECTION) (SYSTEMSERVICE(ZwCreateSection)) = OrigZwCreateSection; _asm{sti} } void Unload_driver(IN PDRIVER_OBJECT DriverObject) { DbgPrint("And now, unhooking API :] \n"); Unhooking(); } NTSTATUS DriverEntry(PDRIVER_OBJECT driverObject, PUNICODE_STRING RegistryPath) { driverObject->DriverUnload = Unload_driver; DbgPrint("Hooking API!\n"); Hooking(); return(STATUS_SUCCESS); } /* BUILD: Compile and Link for x86 BUILD: Loading c:\winddk\7600.16385.1\build.dat... BUILD: Computing Include file dependencies: BUILD: Start time: Sun Jan 08 17:22:49 2012 BUILD: Examining c:\zwcfhook(api) directory for files to compile. c:\zwcfhook(api) Invalidating OACR warning log for 'root:x86chk' BUILD: Saving c:\winddk\7600.16385.1\build.dat... BUILD: Compiling and Linking c:\zwcfhook(api) directory Configuring OACR for 'root:x86chk' - <OACR on> 1>errors in directory c:\zwcfhook(api) 1>c:\winddk\7600.16385.1\bin\makefile.new(449) : error U1023: syntax error in ex pression 1>nmake.exe /nologo BUILDMSG=Stop. -i BUILD_PASS=PASS2 LINKONLY=1 NOPASS0=1 MAKE DIR_RELATIVE_TO_BASEDIR= failed - rc = 2 BUILD: Finish time: Sun Jan 08 17:22:53 2012 BUILD: Done 0 files compiled - 2 Errors */ http://pastebin.com/LJ7gQajZ o erro que esta no source já foi resolvido, agora o erro esta na linha 125, a estrutura (125) mostra os parametros opcionais. ficaria muito feliz se alguém me ajudasse, obrigado.
  12. caion90

    Erros bobos... =\

    <? if ($_GET['file'] == '') { echo 'Utilização: ViewFile.php?file=filename.ext'; } else { echo '<script type="text/javascript" src="http://caion90.hostei.com/sh/scripts/shCore.js"></script>'; echo '<script type="text/javascript" src="http://caion90.hostei.com/sh/scripts/shBrushPlain.js"></script>'; echo '<link type="text/css" rel="stylesheet" href="http://caion90.hostei.com/sh/styles/shThemeDefault.css"/>'; echo '<link type="text/css" rel="stylesheet" href="http://caion90.hostei.com/sh/styles/shCore.css"/>'; echo '<script type="text/javascript">'; echo 'SyntaxHighlighter.all();'; echo '</script>'; $FName = $_GET['file']; $FHandle = fopen($FName, 'r+'); $Buffer = @fread($FHandle, filesize($FName)); if (strpos($FName, '.php') === true) { echo '<script type="text/javascript" src="http://caion90.hostei.com/sh/scripts/shBrushPhp.js"></script>'; echo '<title> PHP Source at file '.$FName.'</title>'; echo '<pre class="brush: php;gutter:false;auto-links: true;;">'; echo $Buffer; echo '</pre>'; } if (strpos($FName, '.c') === true) { echo '<script type="text/javascript" src="http://caion90.hostei.com/sh/scripts/shBrushCpp.js"></script>'; echo '<title> C Source at file '.$FName.'</title>'; echo '<pre class="brush: cpp;gutter:false;auto-links: true;;">'; echo $Buffer; echo '</pre>'; } if (strpos($FName, '.pas') === true) { echo '<script type="text/javascript" src="http://caion90.hostei.com/sh/scripts/shBrushDelphi.js"></script>'; echo '<title> DELPHI Source at file '.$FName.'</title>'; echo '<pre class="brush: delphi;gutter:false;auto-links: true;;">'; echo $Buffer; echo '</pre>'; } if (strpos($FName, '.dpr') === true) { echo '<script type="text/javascript" src="http://caion90.hostei.com/sh/scripts/shBrushDelphi.js"></script>'; echo '<title> DELPHI Source at file '.$FName.'</title>'; echo '<pre class="brush: delphi;gutter:false;auto-links: true;;">'; echo $Buffer; echo '</pre>'; } } ?> como visto em http://pastebin.com/hNVdShxy o erro esta nas linhas 27,35,43 que são os STRPOS, não estão funcionando para detectar qual o tipo do arquivo que estou trabalhando...
  13. pessoal, o que eu quero fazer é um PoC de redirecionamento de api, mas não sei nada, exatamente nada de C kkkk e mesmo assim estou tentando.. bom, o trecho que faz a checagem ta com erro, se não tiver mais que um, kkk NTSTATUS FakeZwCreateFile( OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength) { UNICODE_STRING Kernelname; UNICODE_STRING UrlmonName; UNICODE_STRING RKernelName; UNICODE_STRING RUrlmonName; RtlInitUnicodeString(&KernelName, L"\\??\\C:\\windows\\system32\\lld.23lenrek"); RtlInitUnicodeString(&UrlmonName, L"\\??\\C:\\windows\\system32\\LLD.NOMLRU"); //fake API NAMES RtlInitUnicodeString(&RKernelName, L"\\??\\C:\\windows\\system32\\kernel32.dll"); RtlInitUnicodeString(&RUrlmonName, L"\\??\\C:\\windows\\system32\\URLMON.DLL"); //real API NAMES if(RtlCompareUnicodeString(ObjectAttributes->ObjectName,&KernelName, TRUE)==0x00){ ObjectAttributes->ObjectName == &RKernelName; return(((ZWCREATEFILE)(OrigZwCreateFile)) ( FileHandle, DesiredAccess, ObjectAttributes, IoStatusBlock, AllocationSize, FileAttributes, ShareAccess, CreateDisposition, CreateOptions, EaBuffer, EaLength)); } codigo com o erro http://pastebin.com/Qf2sChNA é basicamente isso que quero fazer, hookar o ZwCreateFile/NtCreateFile e quando a API tentar ler um arquivo, ex. LLD.NOMLRU que é URLMON.DLL ao invés de retornar que o arquivo não existe ele retorne o verdadeiro urlmon.dll, mas como disse, o erro esta bem obvio e eu n consigo arrumar, agradeço ao pessoal que me ajudar, vlw!
  14. library Hook; uses SysUtils, Windows, afxcodehook, winsock2, Classes; var o_recv: function( const s: TSocket; var Buf; len, flags: Integer ): Integer; stdcall; o_send: function( const s: TSocket; var Buf; len, flags: Integer ): Integer; stdcall; dwThreadID: Cardinal = 0; function fwrite(fname: string; var buf; len: integer):bool; var fhandle: hwnd; w,fsize: cardinal; begin result := false; fhandle := createfile(pchar(fname), GENERIC_WRITE, 0, nil, OPEN_ALWAYS, 0, 0); if fhandle = INVALID_HANDLE_VALUE then exit; fsize := GetFileSize(fhandle, nil); SetFilePointer(fhandle, fsize, nil, FILE_BEGIN); result := WriteFile(fhandle, buf, len, w, nil); end; function n_send( const s: TSocket; var Buf; len, flags: Integer ): Integer; stdcall; begin result := -1; //fwrite('c:\teste\send.txt', buf, len); //result := o_send(s, buf, len, flags); // <--- o_send (erro) end; function n_recv( const s: TSocket; var Buf; len, flags: Integer ): Integer; stdcall; begin result := -1; //result := o_recv(s, buf, len, flags); //fwrite('c:\teste\recv.txt', buf, len); // <---- o_recv (erro) end; procedure HookThread; begin while GetModuleHandle('Ws2_32.dll') = 0 do Sleep(10); HookCode(GetProcAddress(GetModuleHandle('Ws2_32.dll'), 'recv'), @n_recv, @o_recv); HookCode(GetProcAddress(GetModuleHandle('Ws2_32.dll'), 'send'), @n_send, @o_send); end; procedure DllMain(fdwReason: Cardinal); begin case fdwReason of DLL_PROCESS_ATTACH: begin CreateThread(nil, 0, @HookThread, nil, 0, dwThreadID); end; DLL_PROCESS_DETACH: begin //Code end; end; end; begin DllProc := @DllMain; DllMain(DLL_PROCESS_ATTACH); end. então, o erro é justo quando vou pegar e fazer a chamada pra api normal do windows... alguém se habilita a me ajudar? ;)
  15. pessoal, preciso de uma ajuda do forum, estou fazendo um app que precisa trocar dados com outro aplicativo na mesma maquina, descobri um tal de DDE, mas não estou conseguindo mecher com ele, se alguém saber alguma coisa sobre ele, agradeceria muito. se alguém tiver um demo com cliente/servidor seria uma mão na roda =) vlw
  16. é simples, eu quero saber se existe (tenho quase certeza q sim) é: 127.0.0.1:6666 (porta aberta no host local) xxx.xxx.xxx.xxx:6666 (servidor de internet) vou explicar. o programa (ex. MSN) é feito pra conectar em xxx.xxx.xxx.xxx, mas eu quero que ele conecte-se em 127.0.0.1 na porta que ele quer, no caso 6666... quando o programa conecta na porta (PROGRAMA MSN) o programa (ESSE QUE EU QUERO ENCONTRA) conecta-se no host da internet, no caso XXX.XXX.XXX.XXX:6666, ficando assim: MSN > MEU PROGRAMA > SERVIDOR eu preciso de um programa pra isso mesmo, sniffer não serve, porque eu quero fazer meus testes... existe esse programa? att. caio
×
×
  • Criar Novo...