Hi everyone
Good afternoon, this is my code today, been trying to make an xss scanner or vulnerability, i just had some problems and i needed to talk to someone.
Now an Xss scanner needs to scan a couple of web pages to check for errors / vulnerabilities. and show them so that the programmer can stop the attacks. Hence i decided to work on something like this .
I used Memo in 2 places , but it doesnt seem to display the text in the memo1.text, neither does it show in memo2, screenshot is shown below
(http://s30.postimg.org/xwy63z3s1/xssscan.png)
I got confused along the line, and my code looks like this
unit Unit1;
{$mode delphi}{$H+}
interface
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls , fphttpclient;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
Memo1: TMemo;
Memo2: TMemo;
procedure Button1Click(Sender: TObject);
procedure Memo1Change(Sender: TObject);
procedure Memo2Change(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
var
url_array : array [1..1000] of string;
url2 : string;
procedure TForm1.Memo1Change(Sender: TObject);
const
FirstEnter: boolean = True;
begin
Memo1.Clear;
FirstEnter:=False;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
begin
url_array := Memo1.Text;
url2 = Memo1.Text + '<script> alert(PChar('Hi am a javascript'))</script>';
for url2:= Low(url_array) to High(url_array) do
begin
httpclient := TFPHttpClient.Create(Nil);
try
html := httpclient.Get(url2);
finally
end;
end;
end;
procedure TForm1.Memo2Change(Sender: TObject);
const
FirstEnter: boolean = True;
begin
Memo2.Clear;
FirstEnter:=False;
end;
end.