Sylhet Gas Field Limited (SGFL); Assistant Engineer (IT); Exam: 2023 (BUET)প্রশ্ন ও সমাধান
- Set by
- SGFL
- Post
- Assistant Engineer (IT)
- Exam date
- 2023
- Conducted by
- BUET
- Questions
- 5 (0 MCQ, 5 written)
- Exam guide
- Government IT officer posts · সরকারি প্রতিষ্ঠানের আইটি পদ
- Cyber Security · সাইবার নিরাপত্তা 1
- Database · ডেটাবেজ 1
- Mathematics · গণিত 1
- Networking · নেটওয়ার্কিং 1
- Programming · প্রোগ্রামিং 1
What is SQL Injection attack? How it launched?
Model answer
SQL Injection is a web-application attack in which an attacker inserts malicious SQL fragments into an input field so that the application's back-end database executes unintended commands.
How it happens
A vulnerable application builds SQL queries by directly concatenating user input:
SELECT * FROM users WHERE username = '$user' AND password = '$pass';
If the attacker enters admin' -- as the username, the query becomes:
SELECT * FROM users WHERE username = 'admin' -- ' AND password = '...';
The -- comments out the password check, so the attacker logs in as admin without knowing the password. Entering ' OR '1'='1 in either field similarly makes the WHERE clause always true, bypassing authentication entirely.
Attack flow
sequenceDiagram
participant Attacker
participant WebApp
participant DB
Attacker->>WebApp: username = admin' --
WebApp->>DB: SELECT * FROM users WHERE username='admin' -- ' AND password='...'
DB-->>WebApp: admin's row, password check skipped
WebApp-->>Attacker: Logged in as admin
Impact
- Bypassing authentication
- Reading/modifying/deleting arbitrary data
- Executing OS commands via extended stored procedures (in severe cases)
Prevention
- Use parameterized queries / prepared statements, never string concatenation.
- Apply input validation and escaping.
- Use least-privilege database accounts and a Web Application Firewall (WAF).
-- Safe (parameterized) version
SELECT * FROM users WHERE username = ? AND password = ?;
Exam takeaway: SQL Injection exploits unsanitized string-concatenated queries; the single most effective defense is always parameterized queries, not manual escaping.
What is NAT? Explain with topological diagram.
Model answer
NAT (Network Address Translation) is a router/firewall function that rewrites the source (or destination) IP address in a packet's header as it crosses between a private network and the public Internet, allowing many private-IP devices to share one public IP address.
How it works
- A LAN device (private IP, e.g. 192.168.0.2) sends a request to the Internet.
- The router/NAT device replaces the private source IP with its own public IP (and records the mapping in a NAT table, including port number).
- The response comes back to the public IP; NAT looks up the table and forwards it to the correct internal device.
graph LR
PC1["PC-1: 192.168.0.2"] --> R["Router / NAT: 192.168.0.1"]
PC2["PC-2: 192.168.0.3"] --> R
R -->|Public IP 203.0.113.5| M[Modem/ISP]
M --> I((Internet))
Types of NAT
| Type | Description |
|---|---|
| Static NAT | One-to-one fixed mapping of a private IP to a public IP |
| Dynamic NAT | Private IPs mapped to a pool of public IPs on demand |
| PAT / NAT Overload | Many private IPs share one public IP, distinguished by port number (most common in home/office routers) |
Why it's needed
- Conserves the limited pool of IPv4 public addresses.
- Hides internal network topology from outside (adds a layer of security).
- Lets private IP ranges (10.x, 172.16-31.x, 192.168.x) be reused across countless separate networks.
Exam takeaway: NAT translates private <-> public IP addresses at the network boundary - PAT (NAT overload), which also tracks port numbers, is the form used by virtually all home/SOHO routers today.
Find the output from this code-
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Find a recurrence relation and give initial conditions for the number of bit strings of length n that do not have two consecutive 0s.
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
SQL Query.....
Sign up free to see the model answer · উত্তর দেখতে বিনামূল্যে সাইন আপ করুন
Question text is from the public recruitment exam; answers and explanations are written by ARBS Academy. All past papers · Government IT officer posts guide