5 Ekim 2013 Cumartesi

Metasploitable

Metasploitable is a kind of vulnerable Linux virtual machine image for penetration testing. It is Debian 32bit based operation system, and ready for usage without any configuration... It contains some payloads, encoder, exploit tools in it.
You can have a search on https://www.vulnhub.com/ or you can directly download the latest version from the following link: https://www.vulnhub.com/entry/metasploitable-2,29/
Do not forget to activate PAE/NX feature on the virtual environment under the System/Processor options.

Keep up-to-date:

Do with the sudo user:
apt upgrade
apt install metasploit-install


Let the attack begin!

3 Ekim 2013 Perşembe

Kali Linux: first things to do after installation

Adding mirros:

Open the terminal as sudo user and;
apt update

apt upgrade

Mirrors will be added automaticly after above operations...

If you are facing keyboard issue(I am usually facing, because of the usage of *.ova virtual images), you may want to change the keyboard settings. to do this, you can use following instruction;

setxkbmap tr
***"tr" for turkish...

One more tricky thing, to use kali in virtual box in full screen mode, appyl following instructions too;

apt install virtual box
You will see a list of available extensions, install below item;
apt install virtualbox-guest-x11
The name of this item may change depanding on the virtualbox version, year, etc... just to know there is a possibility for full screen mode, you may need additional search on the internet...

2 Nisan 2013 Salı

ARP Poisoning

nmap or netdiscover super fine way to determine the ip addresses in the LAN. I assume that we already passed the getting information part...

ARP --> to see the IP addresses+MAC addresses that we already have communication...

wireshark --> a nice tool to see the traffic...

to activate forwarding: echo 1 > /proc/sys/net/ipv4/ip_forward

ping target

arpspoof [-i interface] [-t target] [-r host]
arpspoof -i eth0 -t 192.168.1.XXX -r 192.168.1.1


24 Mart 2013 Pazar

List of TCP and UDP port numbers

1 TCP Port Service Multiplexer (TCPMUX)
5 Remote Job Entry (RJE)
7 ECHO
18 Message Send Protocol (MSP)
20 FTP -- Data
21 FTP -- Control
22 SSH Remote Login Protocol
23 Telnet
25 Simple Mail Transfer Protocol (SMTP)
29 MSG ICP
37 Time
42 Host Name Server (Nameserv)
43 WhoIs
49 Login Host Protocol (Login)
53 Domain Name System (DNS)
69 Trivial File Transfer Protocol (TFTP)
70 Gopher Services
79 Finger
80 HTTP
103 X.400 Standard
108 SNA Gateway Access Server
109 POP2
110 POP3
115 Simple File Transfer Protocol (SFTP)
118 SQL Services
119 Newsgroup (NNTP)
137 NetBIOS Name Service
139 NetBIOS Datagram Service
143 Interim Mail Access Protocol (IMAP)
150 NetBIOS Session Service
156 SQL Server
161 SNMP
179 Border Gateway Protocol (BGP)
190 Gateway Access Control Protocol (GACP)
194 Internet Relay Chat (IRC)
197 Directory Location Service (DLS)
389 Lightweight Directory Access Protocol (LDAP)
396 Novell Netware over IP
443 HTTPS
444 Simple Network Paging Protocol (SNPP)
445 Microsoft-DS
458 Apple QuickTime
546 DHCP Client
547 DHCP Server
563 SNEWS
569 MSN
1080 Socks

For more details: https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

22 Mart 2013 Cuma

Shell - Linux structure



Application programs: Mail-FTP-DBMS, etc...

Shell: Interaction btw user and OS.

Kernel: Hearth of OS. Bridge btween hardware and user interface. I/O, processes

Hardware: CPU-GPU-Harddisk-etc. physicall

*-----

We can access to the shell via terminal. Terminal is not the shell, just a kind of emulator...




to see version of the shell type below command on terminal;
echo $SHELL

to see kernel;
uname

for more information regarding kernel;
uname - a

19 Mart 2013 Salı

Linux commands

command -parameter+argument

touch --> creates a file(touch afile)

echo linux > afile --> type a text to target file

cat -->shows the content of the mentioned file(cat afile)

echo dontoverwrite >> afile (> overwrites, >> does not overwrite)

head --> first 8 rows

tail --> last 8 rows

more --> read line by line by pressing enter(press Ctrl+C to break more)

pwd --> where I am exactly?

ls --> shows the content of the folder you are in

ls - ln --> shows the content of the entire directory with the permission rights

cd --> jump upper level

cd +arg --> jump to folder arg


mkdir +arg --> creates a new folder named arg


rmdir +arg --> deletes the folder arg(same as command: rm)

cp --> copy a file(cp sourceFile targetFileWithNewName)
cp -r --> copy a folder(cp -r sourceFolder targetFolderWithNewName)

mv --> cut a file(mv file targetFolder)
mv --> addition of cur functionality, also changes the name of a file(mv file newName)

find --> search function. (find Folder)

locate  --> same as find command.

man --> manual for the commands(man grep)

help --> similar with the man.(grep --help)

grep --> find for a spesific pattern in a file
touch grepsample
echo test > grepsample
echo test2 >> grepsample
cat grepsample
cat grepsample | grep 2


useradd -m -g groupname -G othergroupnames -s shell username --> add new user
useradd -m -g users -G audio, video -s /bin/bash lorem

cat /etc/group --> shows user groups


ls - ln --> shows the content of the entire directory with the permission rights

chmod -7 fileName  --> Removes the rights for the current user
chmod -77 fileName --> Removes the rights for the current user group
chmod -777 fileName --> Removes the rights for the others

chmod +7 fileName  --> Gives rights for the current user
chmod +77 fileName --> Gives rights for the current user group

chmod +777 fileName --> Gives rights for the others

1 = execute, 2 = write, 4 = read, 7 total


ps aux --> whole active processes
ps -au(userName) --> active processes for the userName

ps -aux | grep processName --> active processes list which contaion processName

kill -9 processId --> kills process 

killall processName --> kills all processes 

.deb packages

dpkg -i packageName --> install package
dpkg -r packageName --> remove package
dpkg -l --> show installed packages


apt installer

apt update --> updates the package list from repositories
apt apgrade --> upgrades whole packages in your local
apt search packageName --> searchs a package from repository
apt install packageName --> installs a package

apt remove packageName --> removes a package
add apt repository repName --> adds a repository


*---

df --> displays harddisk configurations
fdisk -arg --> harddisk configurations

free --> ram
cat /proc/meminfo --> ram snapshot

vmstat --> CPU
top --> CPU with more details


*---

netstat

netstat -t --> list of tcp connections
netstat -u --> list of udp connections
netstat --route --> route table, gateway, genmask
netstat -s --> network statistics

ifconfig --> network details, ip address, mac, etc.

24 Şubat 2012 Cuma

SAP/ABAP: GUI_CREATE_DIRECTORY ve GUI_REMOVE_DIRECTORY

GUI_CREATE_DIRECTORY ve GUI_REMOVE_DIRECTORY

Lokalde bir yerlerde bir dizin oluşturmak istersem;
GUI_CREATE_DIRECTORY
DATA: LV_PATH(11) VALUE 'C:\'."C:\ + SY-DATUM(8CHAR)
CONDENSE LV_PATH.

CONCATANETE LV_PATH
     SY-DATUM
       INTO LV_PATH.

CALL FUNCTION 'GUI_CREATE_DIRECTORY'
 EXPORTING
  DIRNAME  = LV_PATH""C:\ + SY-DATUM
 EXCEPTIONS
  FAILED  = 1
  OTHERS  = 2.

IF SY-SUBRC NE 0.
 "Bir sıkıntı var...
ELSE.
 "Belirtilen dizine gidip bir bakmak lazım...
ENDIF.

Bir de GUI_REMOVE_DIRECTORY var…
Bu arkadaşla da belirtilen dizini silebiliyoruz;
CALL FUNCTION 'GUI_REMOVE_DIRECTORY'
 EXPORTING
  DIRNAME  = LV_SILINECEK_PATH
 EXCEPTIONS
  FAILED  = 1
  OTHERS  = 2.

IF SY-SUBRC NE 0.
 "Burada bir sıkıntı var demek.
ELSE.
 "Tamam, böyle olacaktı...
ENDIF.

22 Şubat 2012 Çarşamba

SAP/ABAP: GOS Objects, create, display, deletion, all

*  DATA:
*    ls_object_identity TYPE borident,
*    lo_gos             TYPE REF TO cl_gos_document_service.

*  ls_object_identity-objkey = p_equnr.
*  ls_object_identity-objtype = 'EQUI'.

*  CREATE OBJECT lo_gos.

*--------------------------------------------------------------------*
" Create an attachment...
*  CALL METHOD lo_gos->create_attachment
*    EXPORTING
*      is_object     = ls_object_identity
*    IMPORTING
*      ep_attachment = ls_object_identity-objkey.
*
*  COMMIT WORK.

*--------------------------------------------------------------------*
"Display an attachment content
*  CALL METHOD lo_gos->display_attachment
*    EXPORTING
**      is_object     = ls_object_identity
*      ip_attachment = ls_object_identity-objkey
*      .

*--------------------------------------------------------------------*
"Display all attachments in an itab...
  DATA: ls_object_identity TYPE sibflporb,
        et_atta            TYPE gos_t_atta.

  ls_object_identity-instid = p_equnr.
  ls_object_identity-typeid = 'EQUI'.
  ls_object_identity-catid  = 'BO'.
*
*  CALL FUNCTION 'GOS_API_GET_ATTA_LIST'
*    EXPORTING
*      is_object = ls_object_identity
*    IMPORTING
*      et_atta   = et_atta.

*--------------------------------------------------------------------*
"Display attachments in pop up

CALL FUNCTION 'GOS_ATTACHMENT_LIST_POPUP'
  EXPORTING
    is_object             = ls_object_identity
   IP_CHECK_ARL          = 'X'
   IP_CHECK_BDS          = 'X'
   IP_NOTES              = 'X'
   IP_ATTACHMENTS        = 'X'
   IP_URLS               = 'X'
   IP_MODE               = ''
* IMPORTING
*   EP_SAVE_REQUEST       =
* TABLES
*   IT_OBJECTS            =
          .

7 Şubat 2012 Salı

SAP/ABAP: Activation of debugger sessions in background jobs

In the job overview(tcode SM37), you can trigger the debugger if you select a job that has finished and type JDBG into the command field as you can see in the below screen shot;
Arkaplanda işlenmiş bir jobı debuglamak için, SM37’de mevzu bahis jobı seçip komut satırına JDBG yazıyoruz, ve debugger tetikleniyor…








17 Ocak 2012 Salı

SAP/ABAP: Download excel template from selection screen








TYPE-POOLS: slis,
            icon,
            truxs.

TABLES sscrfields.

INCLUDE ole2incl.
DATA: h_excel TYPE ole2_object,        " Excel object
      h_mapl  TYPE ole2_object,        " list of workbooks
      h_map   TYPE ole2_object,        " workbook
      h_zl    TYPE ole2_object,        " cell
      h_f     TYPE ole2_object.        " font

SELECTION-SCREEN: PUSHBUTTON /2(40) xlsdesen USER-COMMAND but1.
AT SELECTION-SCREEN.
  CASE sscrfields.
    WHEN 'BUT1'.
      "PERFORM  sapgui_progress  USING  'Excel template downloading...'.
      PERFORM xls_template.
  ENDCASE.

FORM xls_template .


  DATA  h TYPE i VALUE 1.

  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
*     PERCENTAGE = 0
      text   = text-007
    EXCEPTIONS
      OTHERS = 1.
* start Excel
  CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
  PERFORM err_hdl.
  SET PROPERTY OF h_excel  'Visible' = 1.
  PERFORM err_hdl.
* tell user what is going on
  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
*     PERCENTAGE = 0
      text   = text-008
    EXCEPTIONS
      OTHERS = 1.
* get list of workbooks, initially empty
  CALL METHOD OF h_excel 'Workbooks' = h_mapl.
  PERFORM err_hdl.
* add a new workbook
  CALL METHOD OF h_mapl 'Add' = h_map.
  PERFORM err_hdl.
* tell user what is going on
  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
*     PERCENTAGE = 0
      text   = text-009
    EXCEPTIONS
      OTHERS = 1.
* output column headings to active Excel sheet
  PERFORM fill_cell USING 1 1 1   'Account Number of Vendor or Creditor'.
  PERFORM fill_cell USING 1 2 1   'Material Number'.
  PERFORM fill_cell USING 1 3 1   'Purchasing Organization'.
  PERFORM fill_cell USING 1 4 1   'Plant'.
  PERFORM fill_cell USING 1 5 1   'Purchasing info record category'.
  PERFORM fill_cell USING 1 6 1   'Base Unit of Measure'.
  PERFORM fill_cell USING 1 7 1   'Numerator for Conversion to Base Units of Measure'.
  PERFORM fill_cell USING 1 8 1   'Denominator for conversion to base units of measure'.
  PERFORM fill_cell USING 1 9 1   'Material Number Used by Vendor'.
  PERFORM fill_cell USING 1 10 1  'Salesperson Responsible in the Event of Queries'.
  PERFORM fill_cell USING 1 11 1  'First telephone number'.
  PERFORM fill_cell USING 1 12 1  'Country Key'.
  PERFORM fill_cell USING 1 13 1  'Region (State, Province, County)'.
  PERFORM fill_cell USING 1 14 1  'Purchasing Group'.
  PERFORM fill_cell USING 1 15 1  'Currency Key'.
  PERFORM fill_cell USING 1 16 1  'Minimum Purchase Order Quantity'.
  PERFORM fill_cell USING 1 17 1  'Standard Purchase Order Quantity'.
  PERFORM fill_cell USING 1 18 1  'Planned Delivery Time in Days'.
  PERFORM fill_cell USING 1 19 1  'Net price'.
  PERFORM fill_cell USING 1 20 1  'Price Unit'.
  PERFORM fill_cell USING 1 21 1  'Order Price Unit (Purchasing)'.
  PERFORM fill_cell USING 1 22 1  'Date of last forecast'.
  PERFORM fill_cell USING 1 23 1  'Numerator for Conversion of Order Price Unit into Order Unit'.
  PERFORM fill_cell USING 1 24 1  'Denominator for Conv. of Order Price Unit into Order Unit'.
  PERFORM fill_cell USING 1 25 1  'Indicator: GR-Based Invoice Verification'.
  PERFORM fill_cell USING 1 26 1  'Order Acknowledgment Requirement'.
  PERFORM fill_cell USING 1 27 1  'Tax on sales/purchases code'.
  PERFORM fill_cell USING 1 28 1  'Confirmation Control Key'.
  PERFORM fill_cell USING 1 29 1  'Price Determination (Pricing) Date Control'.
  PERFORM fill_cell USING 1 30 1  'Maximum Lot Size'.
  PERFORM fill_cell USING 1 31 1  'Period Indicator for Shelf Life Expiration Date'.
  PERFORM fill_cell USING 1 32 1  'Material Number Used by Vendor'.
  PERFORM fill_cell USING 1 33 1  'Second Tier Process InfRec  '.

  FREE OBJECT h_excel.
  PERFORM err_hdl.
  MESSAGE 'Excel template downloaded...' TYPE 'W'.

ENDFORM.
FORM fill_cell USING i j bold val.
  CALL METHOD OF h_excel 'Cells' = h_zl EXPORTING #1 = i #2 = j.
  PERFORM err_hdl.
  SET PROPERTY OF h_zl 'Value' = val .
  PERFORM err_hdl.
  GET PROPERTY OF h_zl 'Font' = h_f.
  PERFORM err_hdl.
  SET PROPERTY OF h_f 'Bold' = bold .
  PERFORM err_hdl.
ENDFORM.                    "FILL_CELL

FORM err_hdl.
  IF sy-subrc <> 0.
    WRITE: / 'A problem occured'(010), sy-subrc.
    STOP.
  ENDIF.
ENDFORM.                    " ERR_HDL

11 Ocak 2012 Çarşamba

3 Ocak 2012 Salı

SAP/ABAP: SO_NAME_CONVERT FM

Vay annassını, fonksiyona gel…
DATA:  USER_DATA LIKE SOUD3.

MOVE SY-UNAME TO USER_DATA-SAPNAM.

CALL FUNCTION 'SO_NAME_CONVERT'
EXPORTING
NAME_IN               = USER_DATA
IMPORTING
NAME_OUT              = USER_DATA
EXCEPTIONS
OFFICE_NAME_NOT_EXIST = 1
PARAMETER_ERROR       = 2
SAP_NAME_NOT_EXIST    = 3
USER_NOT_EXIST        = 4.
IF SY-SUBRC NE 0.

ENDIF.

WRITE: USER_DATA-SAPNAM,
USER_DATA-USRNAM,
USER_DATA-OCSNAM,
USER_DATA-USRTP,
USER_DATA-USRYR,
USER_DATA-USRNO,
USER_DATA-ADRNAME.

2 Ocak 2012 Pazartesi

SAP/ABAP: Field Symbol performans

*&---------------------------------------------------------------------*
*& Report  ZFS_TEST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZFS_TEST.

*Field Symbol ile Work Area performans testi

DATA: LT_MAKT TYPE TABLE OF MAKT,
      LS_MAKT TYPE MAKT.

DATA: LV_FLAG TYPE FLAG,

      LV_BEGIN_TIME TYPE TIMESTAMPL,
      LV_ENDIN_TIME TYPE TIMESTAMPL,

      LV_WA_FARKI TYPE P DECIMALS 5,
      LV_FS_FARKI TYPE P DECIMALS 5,
      LV_FARK     TYPE P DECIMALS 5.

FIELD-SYMBOLS: <FS_MAKT> LIKE LINE OF LT_MAKT.

SELECT *
  FROM MAKT
  INTO TABLE LT_MAKT
  UP TO 100 ROWS.

*Work Area
GET TIME STAMP FIELD LV_BEGIN_TIME.

LOOP AT LT_MAKT INTO LS_MAKT.
  IF LV_FLAG EQ 'X'.
    LS_MAKT-MAKTX = 'Değiştirdim'.
    MODIFY LT_MAKT FROM LS_MAKT.
  ENDIF.
  CLEAR: LS_MAKT.
  IF LV_FLAG IS INITIAL.
    LV_FLAG = 'X'.
  ENDIF.
ENDLOOP.

GET TIME STAMP FIELD LV_ENDIN_TIME.
*--------------------------------------------------------------------*
LV_WA_FARKI = LV_ENDIN_TIME - LV_BEGIN_TIME.
*--------------------------------------------------------------------*

CLEAR: LV_FLAG,
       LV_BEGIN_TIME,
       LV_ENDIN_TIME.

*Field-Symbol
GET TIME STAMP FIELD LV_BEGIN_TIME.

LOOP AT LT_MAKT ASSIGNING <FS_MAKT>.
  IF LV_FLAG EQ 'X'.
    <FS_MAKT>-MAKTX = 'Değiştirdim'.
  ENDIF.
  IF LV_FLAG IS INITIAL.
    LV_FLAG = 'X'.
  ENDIF.
ENDLOOP.

GET TIME STAMP FIELD LV_ENDIN_TIME.
*--------------------------------------------------------------------*
LV_FS_FARKI = LV_ENDIN_TIME - LV_BEGIN_TIME.
*--------------------------------------------------------------------*

*Work Area ile Field Symbol farkı;
LV_FARK = LV_WA_FARKI - LV_FS_FARKI.

WRITE: /(10) 'WA Performansı', LV_WA_FARKI.
WRITE: /(10) 'FS Performansı', LV_FS_FARKI.
WRITE: /(10) 'Kârımız', LV_FARK.

"

28 Aralık 2011 Çarşamba

SAP/ABAP: Reference parameters are not allowed with RFC

When you are creating a RFC function module, you may face the error message; Reference parameters are not allowed with RFC
You can pass the error by checking “Pass Value” parameters in your parameter definitions…

SAP/ABAP: Colorconstants (for coloring a row and column in ALV)

TYPE-POOL ZCOL .
constants:
zcol_greyblue(04) type c value 'C100',
zcol_lightgrey(04) type c value 'C200',
zcol_yellow(04) type c value 'C300',
zcol_bluegreen(04) type c value 'C400',
zcol_green(04) type c value 'C500',
zcol_red(04) type c value 'C600',
zcol_violett(04) type c value 'C700',

zcol_greyblue_int(04) type c value 'C110',
zcol_lightgrey_int(04) type c value 'C210',
zcol_yellow_int(04) type c value 'C310',
zcol_bluegreen_int(04) type c value 'C410',
zcol_green_int(04) type c value 'C510',
zcol_red_int(04) type c value 'C610',
zcol_violett_int(04) type c value 'C710',

zcol_greyblue_inv(04) type c value 'C101',
zcol_lightgrey_inv(04) type c value 'C201',
zcol_yellow_inv(04) type c value 'C301',
zcol_bluegreen_inv(04) type c value 'C401',
zcol_green_inv(04) type c value 'C501',
zcol_red_inv(04) type c value 'C601',
zcol_violett_inv(04) type c value 'C701',

zcol_greyblue_int_inv(04) type c value 'C111',
zcol_lightgrey_int_inv(04) type c value 'C211',
zcol_yellow_int_inv(04) type c value 'C311',
zcol_bluegreen_int_inv(04) type c value 'C411',
zcol_green_int_inv(04) type c value 'C511',
zcol_red_int_inv(04) type c value 'C611',
zcol_violett_int_inv(04) type c value 'C711'.

İnsdroid

Sabahtan beri çatada çutada çatada çutada… Bitmedi yine de… Neyse, yolumuz uzun, toparlıyorum çantamı, adaptörü falan tıkıştırıyorum bir şe...